Stores snapshot in DB.

post

/policy/risk/v1/snapshots

Snapshot can be stored in DB by generating it directly in the system or by uploading it as a binary/zip file.

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/octet-stream ()
Root Schema : schema
Type: binary
Request Body - application/json ()
Root Schema : schema
Type: object
Snapshot data
Show Source
Back to Top

Response

Supported Media Types

200 Response

Snapshot information.
Body ()
Root Schema : SnapshotsResponse
Type: object
Snapshot response
Show Source
Nested Schema : schema
Type: object
Snapshot data
Show Source

401 Response

Unauthorized

500 Response

Internal server error

503 Response

Service Unavailable
Back to Top

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>
Back to Top