Continuous Integration and Continuous Delivery (CICD) Update Set API
The CICD Update Set API provides methods to create, retrieve, preview, commit, and back-out an update set.
This API is associated with the actions you can perform on system update sets and requires the sn_cicd.sys_ci_automation role and Continuous Integration and Continuous Delivery (CICD) REST API (com.glide.continuousdelivery) plugin to access it.
CICD Update Set - POST /api/sn_cicd/update_set/retrieve
Retrieves an update set with a given sys_id and allows you to remove the existing retrieved update set from the instance.
URL format
Versioned URL: /api/sn_cicd/{api_version}/update_set/retrieve
Default URL: /api/sn_cicd/update_set/retrieve
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 |
|---|---|
| update_set_id | Required. Sys_id of the update set on the source instance from where the update set was retrieved. Table: Update Sets [sys_update_set] Data type: String |
| update_source_id | Sys_id of the remote instance record. Table: Remote Instances [sys_update_set_source] Data type: String |
| update_source_instance_id | Instance ID of the remote instance. Table: Remote Instances [sys_update_set_source] Data type: String |
| auto_preview | Flag that indicates whether to automatically preview the update set after retrieval. Valid values:
Data type: Boolean Default: false |
| cleanup_retrieved | Flag that indicates whether to remove the existing retrieved update set from the instance. Valid values:
Data type: Boolean Default: false |
| 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. Supported types: application/json or application/xml.
Default: application/json |
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. |
| 401 | Unauthorized. The user credentials are incorrect or have not been passed. |
| 403 | Forbidden. The user doesn't have access rights to the specified record. |
| 404 | Not found. The requested item wasn't found. |
| 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)
| Name | Description |
|---|---|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object |
| links.progress | Progress information about the operation performed on the update set. Data type: Object |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint CI/CD - GET /sn_cicd/progress/{progress_id}. Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values:
Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker [sys_execution_tracker] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values:
Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
cURL request
The following example retrieves a particular update set with a given sys_id and instance ID.
curl
"https://instance.servicenow.com/api/sn_cicd/update_set/retrieve?update_set_id=2ce715950d619e10f87785462179bd67&update_source_id=e66613a49d011210f877036c70ae59f7" \
--request POST \
--header "Accept:application/json" \
--user 'username':'password'
Response body. Shows details about the update set's current status and execution progress.
{
"result": {
"links": {
"progress": {
"id": "e2ea3eedc92dde10f877184664aecd90",
"url": "https://instance.servicenow.com/api/sn_cicd/progress/e2ea3eedc92dde10f877184664aecd90"
}
},
"status": "0",
"status_label": "Pending",
"status_message": "",
"status_detail": "",
"error": "",
"percent_complete": 0
}
}
CICD Update Set - POST /api/sn_cicd/update_set/commitMultiple
Commits multiple update sets in a single request according to the order that they're provided.
URL format
Versioned URL: /api/sn_cicd/{api_version}/update_set/commitMultiple
Default URL: /api/sn_cicd/update_set/commitMultiple
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 |
|---|---|
| remote_update_set_ids | Required. List of sys_ids associated with any update sets to commit. Sys_ids are committed in the order given in the request. 注: You can use the CI/CD - GET /sn_cicd/progress/{progress_id} endpoint to get the remote update set ID. Data type: String Table: Retrieved Update Sets [sys_remote_update_set] |
| Name | Description |
|---|---|
| force_commit | Flag that indicates whether to force commit the update set. This feature is useful when some remote update sets specified in the input are already committed in an earlier operation. This feature also ensures the
commit order is obeyed in the order the update sets are provided. Valid values:
Data type: String Default: false |
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. Supported types: application/json or application/xml.
Default: application/json |
| Content-Type | Data format of the request body. Supported types: application/json or application/xml.
Default: application/json |
| Header | Description |
|---|---|
| Content-Type | Data format of the response body. Supported types: application/json or application/xml.
Default: application/json |
Status codes
| Name | Description |
|---|---|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn’t an admin or doesn’t have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn’t found. |
| 409 | Conflict. The requested item isn’t unique. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
Response body parameters (JSON or XML)
| Name | Description |
|---|---|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object |
| links.progress | Progress information about the operation performed on the update set. Data type: Object |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint CI/CD - GET /sn_cicd/progress/{progress_id}. Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values:
Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker [sys_execution_tracker] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values:
Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
cURL request
The following example shows how to commit an update with a given sys_id.
curl
"https://instance.servicenow.com/api/sn_cicd/update_set/commitMultiple?remote_update_set_ids=0a9f45ab9d415e10f877036c70ae5968%2Cc2e89999c9e19e10f877184664aecd40" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{\"force_commit\":\"true\"}" \
--user 'username':'password'
Response body.
{
"result": {
"links": {
"progress": {
"id": "3d174aa1c969de10f877184664aecdc0",
"url": "https://instance.servicenow.com/api/sn_cicd/progress/3d174aa1c969de10f877184664aecdc0"
}
},
"status": "0",
"status_label": "Pending",
"status_message": "",
"status_detail": "",
"error": "",
"percent_complete": 0
}
}
CICD Update Set - POST /api/sn_cicd/update_set/preview/{remote_update_set_id}
Previews an update set to check for any conflicts and retrieve progress information about the update set operation.
URL format
Versioned URL: /api/sn_cicd/{api_version}/update_set/preview/{remote_update_set_id}
Default URL: /api/sn_cicd/update_set/preview/{remote_update_set_id}
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 |
| remote_update_set_id | Sys_id of the update set to preview. Table: Retrieved Update Sets [sys_remote_update_set] Data type: String |
| 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. Supported types: application/json or application/xml.
Default: application/json |
| Content-Type | Data format of the request body. Supported types: application/json or application/xml.
Default: application/json |
| Header | Description |
|---|---|
| Content-Type | Data format of the response body. Supported types: application/json or application/xml.
Default: application/json |
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. |
| 401 | Unauthorized. The user credentials are incorrect or have not been passed. |
| 403 | Forbidden. The user doesn't have access rights to the specified record. |
| 404 | Not found. The requested item wasn't found. |
| 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)
| Name | Description |
|---|---|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object |
| links.progress | Progress information about the operation performed on the update set. Data type: Object |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint CI/CD - GET /sn_cicd/progress/{progress_id}. Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values:
Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker [sys_execution_tracker] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values:
Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
cURL request
The following example shows how to preview a remote update set using a given ID.
curl
curl "https://instance.servicenow.com/api/sn_cicd/update_set/preview/8f4608d39d89da10f877036c70ae5998" \
--request POST \
--header "Accept:application/json" \
--user 'username':'password'
Response body.
{
"result": {
"links": {
"progress": {
"id": "54e9c665c969de10f877184664aecd72",
"url": "https://instance.servicenow.com/api/sn_cicd/progress/54e9c665c969de10f877184664aecd72"
}
},
"status": "0",
"status_label": "Pending",
"status_message": "",
"status_detail": "",
"error": "",
"percent_complete": 0
}
}
CICD Update Set - POST /api/sn_cicd/update_set/back_out
Backs out an installation operation that was performed on an update set with a given sys_id.
For more information about how the back out operation affects an update set, see Back out an update set.
URL format
Versioned URL: /api/sn_cicd/{api_version}/update_set/back_out
Default URL: /api/sn_cicd/update_set/back_out
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 |
|---|---|
| rollback_installs | Flag that indicates whether to rollback the batch installation performed during the update set commit. Possible values:
Data type: Boolean Default: true |
| update_set_id | Required. Sys_id of the update set. Table: Update Sets [sys_update_set] 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. Supported types: application/json or application/xml.
Default: application/json |
| Content-Type | Data format of the request body. Supported types: application/json or application/xml.
Default: application/json |
| Header | Description |
|---|---|
| Content-Type | Data format of the request body. Supported types: application/json or application/xml.
Default: application/json |
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. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn’t an admin or doesn’t have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn’t found. |
| 405 | Invalid method. The functionality is inactive. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
Response body parameters (JSON or XML)
| Name | Description |
|---|---|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object |
| links.progress | Progress information about the operation performed on the update set. Data type: Object |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint CI/CD - GET /sn_cicd/progress/{progress_id}. Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values:
Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker [sys_execution_tracker] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values:
Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
cURL request
The following example shows how to roll back an installation operation on a specific update sys_id.
curl
"https://instance.servicenow.com/api/sn_cicd/update_set/back_out?update_set_id=73dd24e39dcd1e10f877036c70ae59ae&rollback_installs=false" \
--request POST \
--header "Accept:application/json" \
--user 'username':'password'
Response:
{
"result": {
"links": {
"progress": {
"id": "036bf811c9619e10f877184664aecdcb",
"url": "https://instance.servicenow.com/api/sn_cicd/progress/036bf811c9619e10f877184664aecdcb"
}
},
"status": "0",
"status_label": "Pending",
"status_message": "",
"status_detail": "",
"error": "",
"percent_complete": 0
}
}
CICD Update Set - POST /api/sn_cicd/update_set/commit/{remote_update_set_id}
Commits an update set with a given sys_id.
When you have previewed an update set and have resolved any issues, you can commit the update set using this endpoint. Committing an update set applies all changes to the instance and creates a local copy of the update set that contains an update record for every change. For more information about committing an update set, see Commit an update set.
URL format
Versioned URL: /api/sn_cicd/{api_version}/update_set/commit/{remote_update_set_id}
Default URL: /api/sn_cicd/update_set/ commit/{remote_update_set_id}
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 |
| remote_update_set_id | Sys_id of the update set to commit. 注: You can use the CI/CD - GET /sn_cicd/progress/{progress_id} endpoint to get the remote update set ID. Table: Retrieved Update Sets [sys_remote_update_set] Data type: String |
| Name | Description |
|---|---|
| None |
| Name | Description |
|---|---|
| force_commit | Flag that indicates whether to force commit the update set. Valid values:
Data type: String Default: false |
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. Supported types: application/json or application/xml.
Default: application/json |
| Content-Type | Data format of the request body. Supported types: application/json or application/xml.
Default: application/json |
| Header | Description |
|---|---|
| Content-Type | Data format of the response body. Supported types: application/json or application/xml.
Default: application/json |
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.
| Name | Description |
|---|---|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. A bad request type or malformed request was detected. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user doesn't have access rights to the specified record. |
| 404 | Not found. The requested item wasn’t found. |
| 409 | Conflict. The requested item isn’t unique. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
Response body parameters (JSON or XML)
| Name | Description |
|---|---|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object |
| links.progress | Progress information about the operation performed on the update set. Data type: Object |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint CI/CD - GET /sn_cicd/progress/{progress_id}. Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values:
Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker [sys_execution_tracker] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values:
Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
cURL request
The following example commits the update set with the associated sys_id.
curl
"https://instance.servicenow.com/api/sn_cicd/update_set/commit/4ee89999c9e19e10f877184664aecd42" \
--request POST \
--header "Accept:application/json" \
--user 'username':'password'
Response body.
{
"result": {
"links": {
"progress": {
"id": "bf380a11c9e59e10f877184664aecd0e",
"url": "https://instance.servicenow.com/api/sn_cicd/progress/bf380a11c9e59e10f877184664aecd0e"
}
},
"status": "0",
"status_label": "Pending",
"status_message": "",
"status_detail": "",
"error": "",
"percent_complete": 0
}
}
CICD Update Set - POST /api/sn_cicd/update_set/create
Creates a new update set and inserts the new record in the Update Sets [sys_update_set] table.
URL format
Versioned URL: /api/sn_cicd/{api_version}/update_set/create
Default URL: /api/sn_cicd/update_set/create
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 |
|---|---|
| description | Description of the update set. Data type: String Default: null |
| scope | Required if the sys_id parameter is not passed. The scope name of the application in which to create the new update set. Table: Applications [sys_scope] Data type: String |
| sys_id | Required if the scope parameter is not passed. Sys_id of the application in which to create the new update set. Table: Applications [sys_scope] Data type: String |
| update_set_name | Required. Name to give the update set. 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. Supported types: application/json or application/xml.
Default: application/json |
| Content-Type | Data format of the request body. Supported types: application/json or application/xml.
Default: application/json |
| Header | Description |
|---|---|
| Content-Type | Data format of the response body. Supported types: application/json or application/xml.
Default: application/json |
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.
| 201 | The update set was created successfully. |
| 400 | Bad request. The update set name is null or empty, or both input sys_id and scope are null or empty. |
| 403 | Forbidden. The user isn’t an admin or doesn’t have the sn_cicd.sys_ci_automation role. |
| 409 | Conflict. The requested item isn’t unique. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
Response body parameters (JSON or XML)
| Name | Description |
|---|---|
| error | Error message with details about the error. Data type: String |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values:
Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker [sys_execution_tracker] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values:
Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
| update_set_id | Sys_id of the created update set. Table: Update Sets [sys_update_set] Data type: String |
cURL request
The following example demonstrates how to create a new update set with the name Testupdateset and the scope set to sn_test.
curl
"https://instance.servicenow.com/api/sn_cicd/update_set/create?update_set_name=Testupdateset&scope=sn_test" \
--request POST \
--header "Accept:application/json" \
--user 'username':'password'
Response body.
{
"result": {
"status": "2",
"status_label": "",
"status_message": "Successfully created update set: Test update set 1",
"status_detail": "",
"error": "",
"update_set_id": "a9a485d1c9a19e10f877184664aecd11"
}
}