Creating a Playbook
Function
Creating a Playbook
Calling Method
For details, see Calling APIs.
URI
POST /v1/{project_id}/workspaces/{workspace_id}/soc/playbooks
Parameter | Mandatory | Type | Description |
|---|---|---|---|
project_id | Yes | String | Project ID. |
workspace_id | Yes | String | Workspace ID |
Request Parameters
Parameter | Mandatory | Type | Description |
|---|---|---|---|
X-Auth-Token | Yes | String | User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is a token. |
content-type | Yes | String | application/json;charset=UTF-8 |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
name | Yes | String | Playbook name. |
description | No | String | Description. |
workspace_id | Yes | String | Workspace ID |
Response Parameters
Status code: 200
Parameter | Type | Description |
|---|---|---|
X-request-id | String | Request ID, in the format request_uuid-timestamp-hostname. |
Parameter | Type | Description |
|---|---|---|
code | String | Error code |
message | String | Error Message |
data | PlaybookInfo object | Playbook details. |
Parameter | Type | Description |
|---|---|---|
id | String | Playbook ID. |
name | String | Playbook name. |
description | String | Provides supplementary information about the resource. |
create_time | String | Playbook creation time. |
update_time | String | Playbook update time. |
project_id | String | Project ID. |
version_id | String | Playbook version ID. |
enabled | Boolean | Whether to enable. |
workspace_id | String | Workspace ID |
approve_role | String | Reviewer role. |
user_role | String | Role |
edit_role | String | Edit Role for Account |
owner_id | String | ID |
version | String | Version No. |
dataclass_name | String | Data class name. |
dataclass_id | String | Data class ID. |
unaudited_version_id | String | ID of the playbook version to be reviewed. |
reject_version_id | String | ID of the rejected playbook version. |
Status code: 400
Parameter | Type | Description |
|---|---|---|
X-request-id | String | Request ID, in the format request_uuid-timestamp-hostname. |
Parameter | Type | Description |
|---|---|---|
code | String | Error Code |
message | String | Error Description |
Example Requests
Create a playbook. Name is MyXXX; workspace ID is string; approver is approve; and status is enabled.
{
"name" : "MyXXX",
"description" : "This my XXXX",
"workspace_id" : "string"
} Example Responses
Status code: 200
Response when the request is successful.
{
"code" : 0,
"message" : "Error message",
"data" : {
"id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
"name" : "MyXXX",
"description" : "This my XXXX",
"create_time" : "2021-01-30T23:00:00Z+0800",
"update_time" : "2021-01-30T23:00:00Z+0800",
"project_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
"version_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
"enabled" : true,
"workspace_id" : "string",
"approve_role" : "approve",
"user_role" : "string",
"edit_role" : "editor",
"owner_id" : "909494e3-558e-46b6-a9eb-07a8e18ca62f",
"version" : "v1.1.1",
"dataclass_name" : "string",
"dataclass_id" : "string",
"unaudited_version_id" : "string",
"reject_version_id" : "string"
}
} Status Codes
Status Code | Description |
|---|---|
200 | Response when the request is successful. |
400 | Response when the request failed. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.

