POST DTA Snapshots

The POST /dta_snapshots method is used to generate a snapshot of a DTA query (cert or discovery). This method returns HTTP 201 Created on a success.

Table 14: POST DTA Snapshots Input Parameters

Name In Description
snapshotId body

A string indicating the name of the snapshot. This alphanumeric value supports underscores and does not support spaces.

For example:

snapshot_1
dtaCommand body

A string indicating the type of query. Supported values are cert and discovery.

dtaArgs body

An object containing one or more arrays of strings indicating the arguments (e.g, columns) to include in the snapshot.

For example:

Copy
"dtaArgs": {
  "columns": [
    "certIssuerAsn1s",
    "certCommonName",
    "certAltNames",
    "certNotValidAfterEpochSecs",
    "certPublicKeyAlgo"
  ]
}
Example:  Using curl to create a new cert snapshot:
Copy
API_KEY='<YOUR-API-KEY>'
HUB='https://<YOUR-HUB-SERVER>'

curl -sS -X POST "$HUB/api/v1/dta_snapshots" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "x-api-key: $API_KEY" \
  -d '{
    "snapshotId": "snapshot_5",
    "dtaCommand": "cert",
    "dtaArgs": {
      "columns": [
        "certIssuerAsn1s",
        "certCommonName",
        "certAltNames",
        "certNotValidAfterEpochSecs",
        "certPublicKeyAlgo"
      ]
    }
  }'

Using curl to create a new discovery snapshot:

Copy
API_KEY='<YOUR-API-KEY>'
HUB='https://<YOUR-HUB-SERVER>'

curl -sS -X POST "$HUB/api/v1/dta_snapshots" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "x-api-key: $API_KEY" \
  -d '{
    "snapshotId": "snapshot_6",
    "dtaCommand": "discovery",
    "dtaArgs": {
      "columns": [
        "clientIp",
        "clientName",
        "serverIp",
        "serverName",
        "serviceName",
        "byteVolume",
        "latest"
      ],
      "timeFrame": {
      "begin": "now minus 24 hours",
      "end": "now"
      }
    }
  }'