Stores snapshot in DB.
/policy/risk/v1/snapshots
Request
There are no request parameters for this operation.
- application/octet-stream
- application/json
binaryobject-
createTime: string
Create Time of snapshot
-
description: integer
Description of the snapshot
-
name: string
Name of the snapshot
-
snapshotId: string
Unique identifier of snapshot
Response
- application/xml
- application/json
200 Response
object-
message: integer
Message
-
snapshot: object
schema
Snapshot data
-
status: string
Status
object-
createTime: string
Create Time of snapshot
-
description: integer
Description of the snapshot
-
name: string
Name of the snapshot
-
snapshotId: string
Unique identifier of snapshot
401 Response
500 Response
503 Response
Examples
The following example shows a sample request and response for creating a snapshot in the DB.
cURL Command to Store the Snapshot in JSON Format
curl --location --request POST '<PolicyUrl>/policy/risk/v1/snapshots/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <Base64Encoded(<username>:<password>)>' \
--data '{
"name":"A sample snapshot",
"description": "This is a test sample snapshot"
}'Sample Response in JSON Format
{
"status": "201",
"message": "Snapshot created successfully.",
"snapshot": {
"name": "A sample snapshot",
"description": "This is a test sample snapshot",
"snapshotId": "20101",
"createTime": "11-17-2021 11:10:38"
}
}The following example shows a sample request and response for uploading a snapshot ZIP file previously downloaded using "Get a snapshot ZIP file".
cURL Command to Store the Snapshot in JSON Format
curl --location --request POST '<PolicyUrl>/policy/risk/v1/snapshots/' \ --header 'Content-Type: application/octet-stream' \ --header 'Authorization: Basic <Base64Encoded(<username>:<password>)>' \ --data-binary '@/scratch/hvellapp/respone_files/snapshot_11122021_163405143.zip'
Sample Response in JSON Format
{
"status": "201",
"message": "Snapshot created successfully.",
"snapshot": {
"name": "A sample SS",
"description": "This is a test sample SS",
"snapshotId": "20101",
"createTime": "11-17-2021 11:10:38"
}
}cURL Command to Store the Snapshot in XML Format
curl --location --request POST '<PolicyUrl>/policy/risk/v1/snapshots/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <Base64Encoded(<username>:<password>)>' \
--data '<?xml version="1.0" encoding="UTF-8" ?>
<OARMSnapshotData>
<name>A sample snapshot</name>
<description>This is a test sample snapshot</description>
</OARMSnapshotData>
'Sample Response in XML Format
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<SnapshotResponse>
<status>201</status>
<message>Snapshot created successfully.</message>
<snapshot>
<name>A sample snapshot</name>
<description>This is a test sample snapshot</description>
<snapshotId>20101</snapshotId>
<createTime>11-17-2021 11:10:38</createTime>
</snapshot>
</SnapshotResponse>
The following example shows a sample request and response for uploading a snapshot ZIP file previously downloaded using "Get a snapshot ZIP file".
cURL Command to Store the Snapshot in XML Format
curl --location --request POST '<PolicyUrl>/policy/risk/v1/snapshots/' \ --header 'Content-Type: application/octet-stream' \ --header 'Authorization: Basic <Base64Encoded(<username>:<password>)>' \ --data-binary '@/scratch/hvellapp/respone_files/snapshot_11122021_163405143.zip'
Sample Response in XML Format
<?xml version="1.0" encoding="UTF-8" ?>
<SnapshotResponse>
<status>201</status>
<message>Snapshot created successfully.</message>
<snapshot>
<name>A sample SS</name>
<description>This is a test sample SS</description>
<snapshotId>20101</snapshotId>
<createTime>11-17-2021 11:10:38</createTime>
</snapshot>
</SnapshotResponse>