Upload Coverage
Upload a coverage file for a review definition or review result to assign monitors, reviewers, or alternate managers.
POST https://instance.securid.com/aveksa/command.submit?cmd=uploadCoverage
The coverage file can be sent as the POST request body (recommended) or placed in the server's import directory and referenced by the filename parameter. When filename is used, the command can be called as a GET request. When the POST body is used, a POST request is required. GET returns 405 without filename.
Request
Parameters
| uploadCoverage | |
| format | properties - (Default) Returns the response as key=value pairs. When multiple objects are returned, values are comma-delimited: key=value1,value2,value3.json - Returns the response as JSON. |
| name | The name of the review definition. Mutually exclusive with id. One of name or id is required. |
| id | The review instance ID returned by Get Review Result. Mutually exclusive with name. One of id or name is required. |
The type of coverage file. Valid values: monitor reviewer altmanager | |
| altManagerResolvesTo | The user attribute used to resolve entries in the alternate managers file. Only used when type=altmanager. |
| filename | The filename of a coverage file placed in the server's import directory. The import directory is configured at Admin > Web Services (the same setting used by the importMetadata command). Not available in G&L Cloud. The import directory option is absent from Cloud Web Services Settings. Use the POST body instead. |
Headers
Bearer token | |
| text/plain |
Body
The coverage file content sent as plain text. The file must have between 3 and 6 pipe-delimited (|) columns per row. The exact column structure depends on the type parameter and the entitlement types being assigned.
user_id='jsmith'|user|1=1|app-role|name='Datadog'|
user_id='mcastro'|user|1=1|ent|name='Dynatrace'|
Response
Parameters
type | Executed command name |
status | success or failure |
message | Returned when status is failure. Describes the reason the coverage file was rejected. |
Examples
Request
- Curl
- Python
- Node.js
curl -K -X POST \
"https://instance.securid.com/aveksa/command.submit?cmd=uploadCoverage&format=json&id=143&type=reviewer" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: text/plain" \
-d "user_id='jsmith'|user|1=1|app-role|name='Datadog'|
user_id='mcastro'|user|1=1|ent|name='Dynatrace'|"
import requests
url = "https://instance.securid.com/aveksa/command.submit"
params = {
"cmd": "uploadCoverage",
"format": "json",
"id": "143",
"type": "reviewer"
}
payload = """user_id='jsmith'|user|1=1|app-role|name='Datadog'|
user_id='mcastro'|user|1=1|ent|name='Dynatrace'|"""
headers = {
'Authorization': 'Bearer <token>',
'Content-Type': 'text/plain'
}
response = requests.post(url, data=payload, params=params, headers=headers)
if response.status_code == 200:
data = response.json()
print(data)
else:
print(f"Request failed with status code {response.status_code}")
const https = require('https');
const params = new URLSearchParams({
cmd: 'uploadCoverage',
format: 'json',
id: '143',
type: 'reviewer'
});
const body = `user_id='jsmith'|user|1=1|app-role|name='Datadog'|\nuser_id='mcastro'|user|1=1|ent|name='Dynatrace'|`;
const options = {
hostname: 'instance.securid.com',
path: `/aveksa/command.submit?${params}`,
method: 'POST',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'text/plain',
'Content-Length': Buffer.byteLength(body)
}
};
const req = https.request(options, res => {
let data = '';
res.on('data', chunk => { data += chunk; });
res.on('end', () => console.log(JSON.parse(data)));
});
req.on('error', err => console.error('Error:', err.message));
req.write(body);
req.end();
Response
- 200 Success
- 200 Invalid File
- 401 Invalid Token
- 405 Wrong Method
- 412 Missing ID or Name
- 412 Missing Type
- 412 Invalid Type
- 412 Import Dir Not Configured
- 404 ID Not Found
{
"data": {
"type": "uploadCoverage",
"status": "success"
}
}
{
"data": {
"type": "uploadCoverage",
"status": "failure",
"message": "The filters present in the coverage files are not proper. \nFile content is not delimited correctly. The file should have either 3 or 4 or 5 or 6 columns"
}
}
<html>
<head>
<title>Error</title>
</head>
<body>The token is not valid for the command 'uploadCoverage'. Token is invalid or expired</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The command must be executed using a HTTP POST request if the filename parameter is not provided
Query String=cmd=uploadCoverage&format=json&id=143&type=monitor</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The id parameter or the name parameter must be provided referencing a valid review result or definition respectively.
Query String=cmd=uploadCoverage&format=json&type=monitor</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The parameter type is required.
Query String=cmd=uploadCoverage&format=json&id=143</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The parameter type must be a valid value: monitor,reviewer,altmanager
Query String=cmd=uploadCoverage&format=json&id=143&type=bogus</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The filename parameter cannot be used until the import directory is configured in the Web Services configuration screen.
Query String=cmd=uploadCoverage&format=json&id=143&type=monitor&filename=coverage.csv</body>
</html>
<html>
<head>
<title>Error</title>
</head>
<body>The id parameter or the name parameter must be provided referencing a valid review result or definition respectively.
Query String=cmd=uploadCoverage&format=json&id=99999&type=monitor</body>
</html>
Verified with RSA Governance & Lifecycle version 8.0.0.188886 P10_HF01.
See Also
- Get Review Result: Resolve a
run-idto a review instanceid - Refresh Review: Reload reviewer assignments after a coverage upload
- Run Review: Trigger a review run