Creating a Workflow Instance
Function
This API is used to create a workflow instance.
Calling Method
For details, see Calling APIs.
URI
POST /v1/{project_id}/workspaces/{workspace_id}/soc/workflows/{workflow_id}/instances
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID, which is used to specify the project that a resource belongs to. You can query the resources of a project by project ID. You can obtain the project ID from the API or console. Obtaining the Project ID Constraints N/A Range N/A Default Value N/A |
|
workspace_id |
Yes |
String |
Definition Workspace ID. Range N/A |
|
workflow_id |
Yes |
String |
Workflow ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. You can obtain it by calling the IAM API for obtaining a user token. The user token is the value of X-Subject-Token in the response header. Obtaining a User Token Constraints N/A Range N/A Default Value N/A |
|
content-type |
Yes |
String |
Definition Content type.
Constraints N/A Range
Default Value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
command_type |
Yes |
String |
Definition Commands used to operate a workflow instance.
Constraints N/A Range
Default Value N/A |
|
action_type |
Yes |
String |
Definition Action type.
Constraints N/A Range
Default Value N/A |
|
action_id |
No |
String |
Definition Workflow ID. Constraints N/A |
|
action_instance_id |
No |
String |
Definition Workflow instance ID. Constraints N/A |
|
playbook_context |
No |
PlaybookcontextRef object |
Execution context. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
data_object |
Yes |
DataObjectRefInfo object |
Workflow execution context. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
content |
No |
Map<String,Object> |
Workflow instance context. |
|
dataclass |
No |
DataClassRef object |
Data class information. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
command_type |
String |
Definition Commands used to operate a workflow instance.
Constraints N/A Range
Default Value N/A |
|
action_type |
String |
Definition Action type.
Constraints N/A Range
Default Value N/A |
|
action_id |
String |
Definition Workflow ID. Constraints N/A |
|
action_instance_id |
String |
Definition Workflow instance ID. Constraints N/A |
|
playbook_context |
PlaybookcontextRef object |
Execution context. |
|
Parameter |
Type |
Description |
|---|---|---|
|
data_object |
DataObjectRefInfo object |
Workflow execution context. |
|
Parameter |
Type |
Description |
|---|---|---|
|
content |
Map<String,Object> |
Workflow instance context. |
|
dataclass |
DataClassRef object |
Data class information. |
Example Requests
The workflow instance for running alert data classes
{
"command_type" : "ActionInstanceRunCommand",
"action_type" : "workflow",
"action_id" : "446255ce-XXXXXXXXXX-0b4931",
"action_instance_id" : "1111xxxxxxxxxxxxxx111",
"playbook_context" : {
"data_object" : {
"dataclass" : {
"name" : "Alert"
},
"content" : {
"name" : { },
"key" : { }
}
}
}
}
Example Responses
Status code: 200
Response to the operation of a workflow instance.
{
"command_type" : "ActionInstanceRunCommand",
"action_type" : "workflow",
"action_id" : "446255ce-XXXXXXXXXX-0b4931",
"action_instance_id" : "1111xxxxxxxxxxxxxx111",
"playbook_context" : {
"data_object" : {
"dataclass" : {
"name" : "Alert"
},
"content" : {
"name" : { },
"key" : { }
}
}
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Response to the operation of a workflow instance. |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot