CdmSnapshotApi
-
- UpdatedJan 30, 2025
- 15 minutes to read
- Yokohama
- API reference
The CdmSnapshotApi provides endpoints that enable you to publish, unpublish, and re-validate snapshots in Configuration Data Management (CDM).
You publish a snapshot so that it can be exported, enabling the Continuous Integration and Continuous Delivery (CICD) pipeline to access and use the associated configuration data. Exporters can only execute on published snapshots. When snapshots are no longer needed, you can unpublish them to reduce the confusion as to whether the snapshot is viable anymore.
- Scripted REST CDM View ACL (sn_cdm.cdm.viewer)
- Scripted REST CDM Editor ACL (sn_cdm.cdm_editor)
In addition, the Configuration Data Management (CDM) plugin must be activated for this API to be available in an instance.
For additional information on snapshots, see View snapshots.
CdmSnapshotAPI - POST /sn_cdm/snapshots/{snapshot_id}/publish
Publishes a specified unpublished snapshot.
Before a snapshot can be published, it must be validated. You can use the CdmSnapshotAPI - POST /sn_cdm/snapshots/{snapshot_id}/validate endpoint to validate snapshots or have them automatically validated when you do a commit. A deployable must be connected to a service to publish its snapshots. Also, if the snapshot has already been published, the request will fail.
URL format
Versioned URL: /api/sn_cdm/{api_version}/snapshots/{snapshot_id}/publish
Default URL: /api/sn_cdm/snapshots/{snapshot_id}/publish
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
snapshot_id | Sys_id of the snapshot record to process. Data type: String Table: CDM Snapshot [sn_cdm_snapshot] |
Name | Description |
---|---|
None |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. A bad request type or malformed request was detected. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters (JSON or XML)
Example: cURL request
The following example shows how to publish the snapshot with the sys_id of 3a168d9dc342301054c1582e1340dd68.
The following shows both a success and failure response to the publish request.
CdmSnapshotAPI - POST /sn_cdm/snapshots/{snapshot_id}/unpublish
Unpublishes a previously published snapshot.
URL format
Versioned URL: /api/sn_cdm/{api_version}/snapshots/{snapshot_id}/unpublish
Default URL: /api/sn_cdm/snapshots/{snapshot_id}/unpublish
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
snapshot_id | Sys_id of the snapshot record to process. Data type: String Table: CDM Snapshot [sn_cdm_snapshot] |
Name | Description |
---|---|
None |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. A bad request type or malformed request was detected. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters (JSON or XML)
Example: cURL request
The following example shows how to unpublish the snapshot with the sys_id of 3a168d9dc342301054c1582e1340dd68.
The following shows both a success and failure response to the unpublish request.
CdmSnapshotAPI - POST /sn_cdm/snapshots/{snapshot_id}/validate
Validates a specified unpublished snapshot.
The validation is performed as an asynchronous process. Calling this endpoint only starts the validation process. The return results from this call only indicate whether the validation process started, not the results of the validation itself. To find out if the snapshot has validated, use the Table API to locate the snapshot and check its validation status.
URL format
Versioned URL: /api/sn_cdm/{api_version}/snapshots/{snapshot_id}/validate
Default URL: /api/sn_cdm/snapshots/{snapshot_id}/validate
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
snapshot_id | Sys_id of the snapshot record to process. Data type: String Table: CDM Snapshot [sn_cdm_snapshot] |
Name | Description |
---|---|
None |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. The specified snapshot is already published or cannot be located. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters (JSON or XML)
Example: cURL request
The following example shows how to validate the snapshot with the sys_id of 3a168d9dc342301054c1582e1340dd68.
The following shows both a success and failure response to the validate request.
CdmSnapshotApi - PUT /sn_cdm/snapshots/publish
Publishes a specified unpublished snapshot.
Before a snapshot can be published, it must be validated. You can use the CdmSnapshotApi - PUT /sn_cdm/snapshots/validate endpoint to validate snapshots or have them automatically validated when you do a commit. A deployable must be connected to a service to publish its snapshots. Also, if the snapshot has already been published, the request will fail.
The caller of this endpoint must have the CDM Editor role.
URL format
Versioned URL: /api/sn_cdm/{api_version}/snapshots/publish
Default URL: /api/sn_cdm/snapshots/publish
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. A bad request type or malformed request was detected. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
Example: cURL request
This code example shows how to publish a snapshot.
Return results:
CdmSnapshotApi - PUT /sn_cdm/snapshots/unpublish
Unpublishes a previously published snapshot.
URL format
Versioned URL: /api/sn_cdm/{api_version}/snapshots/unpublish
Default URL: /api/sn_cdm/snapshots/unpublish
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. A bad request type or malformed request was detected. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
Example: cURL request
This code example shows how to unpublish a snapshot.
Return results:
CdmSnapshotApi - PUT /sn_cdm/snapshots/validate
Validates a specified unpublished snapshot against its mapped policies.
The validation is performed as an asynchronous process. Calling this endpoint only starts the validation process. The return results from this call only indicate whether the validation process started, not the results of the validation itself. To find out if the snapshot has validated, use the Table API to locate the snapshot and check its validation status.
The caller of this endpoint must have the CDM Editor role.
URL format
Versioned URL: /api/sn_cdm/{api_version}/snapshots/validate
Default URL: /api/sn_cdm/snapshots/validate
Supported request parameters
Name | Description |
---|---|
api_version | Optional. Version of the endpoint to access. For example, v1 or v2. Only specify this value to use an endpoint version other than the
latest.
Data type: String |
Name | Description |
---|---|
None |
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header | Description |
---|---|
Accept | Data format of the response body. Only supports application/json. |
Content-Type | Data format of the request body. Only supports application/json. |
Header | Description |
---|---|
None |
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code | Description |
---|---|
200 | Successful. The request was successfully processed. |
400 | Bad Request. The specified snapshot is already published or cannot be located. |
500 | Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error. |
Response body parameters
Example: cURL request
This code example shows how to validate a snapshot.
Return results:
On this page
- CdmSnapshotAPI - POST /sn_cdm/snapshots/{snapshot_id}/publish
- CdmSnapshotAPI - POST /sn_cdm/snapshots/{snapshot_id}/unpublish
- CdmSnapshotAPI - POST /sn_cdm/snapshots/{snapshot_id}/validate
- CdmSnapshotApi - PUT /sn_cdm/snapshots/publish
- CdmSnapshotApi - PUT /sn_cdm/snapshots/unpublish
- CdmSnapshotApi - PUT /sn_cdm/snapshots/validate