Skip to content

Commit

Permalink
Add trigger API documentation for workflow automation (#1687)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Jul 30, 2024
1 parent 929c755 commit cf2cb9f
Show file tree
Hide file tree
Showing 45 changed files with 2,439 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-30 17:01:11.256926",
"spec_repo_commit": "4380003d"
"regenerated": "2024-07-30 19:24:57.172113",
"spec_repo_commit": "edbd396a"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-30 17:01:11.275395",
"spec_repo_commit": "4380003d"
"regenerated": "2024-07-30 19:24:57.190109",
"spec_repo_commit": "edbd396a"
}
}
}
222 changes: 222 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,13 @@ components:
required: true
schema:
type: string
InstanceId:
description: The ID of the workflow instance.
in: path
name: instance_id
required: true
schema:
type: string
MetricID:
description: The name of the log-based metric.
in: path
Expand Down Expand Up @@ -543,6 +550,13 @@ components:
schema:
example: 00000000-0000-9999-0000-000000000000
type: string
WorkflowId:
description: The ID of the workflow.
in: path
name: workflow_id
required: true
schema:
type: string
requestBodies: {}
responses:
BadRequestResponse:
Expand Down Expand Up @@ -23831,6 +23845,107 @@ components:
- PAST_SIX_MONTHS
- PAST_ONE_YEAR
- ALERT
WorkflowInstanceCreateMeta:
description: Additional information for creating a workflow instance.
properties:
payload:
additionalProperties: {}
description: The input parameters to the workflow.
type: object
type: object
WorkflowInstanceCreateRequest:
description: Request used to create a workflow instance.
properties:
meta:
$ref: '#/components/schemas/WorkflowInstanceCreateMeta'
type: object
WorkflowInstanceCreateResponse:
additionalProperties: {}
description: Response returned upon successful workflow instance creation.
properties:
data:
$ref: '#/components/schemas/WorkflowInstanceCreateResponseData'
type: object
WorkflowInstanceCreateResponseData:
additionalProperties: {}
description: Data about the created workflow instance.
properties:
id:
description: The ID of the workflow execution. It can be used to fetch the
execution status.
type: string
type: object
WorkflowInstanceListItem:
additionalProperties: {}
description: An item in the workflow instances list.
properties:
id:
description: The ID of the workflow instance
type: string
type: object
WorkflowListInstancesResponse:
additionalProperties: {}
description: Response returned when listing workflow instances.
properties:
data:
description: A list of workflow instances.
items:
$ref: '#/components/schemas/WorkflowInstanceListItem'
type: array
meta:
$ref: '#/components/schemas/WorkflowListInstancesResponseMeta'
type: object
WorkflowListInstancesResponseMeta:
additionalProperties: {}
description: Metadata about the instances list
properties:
page:
$ref: '#/components/schemas/WorkflowListInstancesResponseMetaPage'
type: object
WorkflowListInstancesResponseMetaPage:
additionalProperties: {}
description: Page information for the list instances response.
properties:
totalCount:
description: The total count of items.
format: int64
type: integer
type: object
WorklflowCancelInstanceResponse:
description: Information about the canceled instance.
properties:
data:
$ref: '#/components/schemas/WorklflowCancelInstanceResponseData'
type: object
WorklflowCancelInstanceResponseData:
description: Data about the canceled instance.
properties:
id:
description: The id of the canceled instance
type: string
type: object
WorklflowGetInstanceResponse:
additionalProperties: {}
description: The state of the given workflow instance.
properties:
data:
$ref: '#/components/schemas/WorklflowGetInstanceResponseData'
type: object
WorklflowGetInstanceResponseData:
additionalProperties: {}
description: The data of the instance response.
properties:
attributes:
$ref: '#/components/schemas/WorklflowGetInstanceResponseDataAttributes'
type: object
WorklflowGetInstanceResponseDataAttributes:
additionalProperties: {}
description: The attributes of the instance response data.
properties:
id:
description: The id of the instance.
type: string
type: object
securitySchemes:
AuthZ:
description: This API uses OAuth 2 with the implicit grant flow.
Expand Down Expand Up @@ -37850,6 +37965,108 @@ paths:
summary: Get user memberships
tags:
- Teams
/api/v2/workflows/{workflow_id}/instances:
get:
description: List all instances of a given workflow.
operationId: ListWorkflowInstances
parameters:
- $ref: '#/components/parameters/WorkflowId'
- $ref: '#/components/parameters/PageSize'
- $ref: '#/components/parameters/PageNumber'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowListInstancesResponse'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: List workflow instances
tags:
- Workflow Automation
post:
description: Execute the given workflow
operationId: CreateWorkflowInstance
parameters:
- $ref: '#/components/parameters/WorkflowId'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowInstanceCreateRequest'
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowInstanceCreateResponse'
description: Created
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Execute a workflow
tags:
- Workflow Automation
x-codegen-request-body-name: body
/api/v2/workflows/{workflow_id}/instances/{instance_id}:
get:
description: Get a specific execution of a given workflow.
operationId: GetWorkflowInstance
parameters:
- $ref: '#/components/parameters/WorkflowId'
- $ref: '#/components/parameters/InstanceId'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/WorklflowGetInstanceResponse'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Get a workflow instance
tags:
- Workflow Automation
/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancel:
put:
description: Cancels a specific execution of a given workflow.
operationId: CancelWorkflowInstance
parameters:
- $ref: '#/components/parameters/WorkflowId'
- $ref: '#/components/parameters/InstanceId'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/WorklflowCancelInstanceResponse'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Cancel a workflow instance
tags:
- Workflow Automation
security:
- apiKeyAuth: []
appKeyAuth: []
Expand Down Expand Up @@ -38221,4 +38438,9 @@ tags:
externalDocs:
url: https://docs.datadoghq.com/account_management/users
name: Users
- description: Automate your teams operational processes with Datadog Workflow Automation.
externalDocs:
description: Find out more at
url: https://docs.datadoghq.com/service_management/workflows/
name: Workflow Automation
x-group-parameters: true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2024-07-24T18:39:57.489Z"
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"log": {
"_recordingName": "Workflow Automation/Cancel a workflow instance returns \"Bad Request\" response",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "98b0f3208080a6600c1990114cba0bd8",
"_order": 0,
"cache": {},
"request": {
"bodySize": 0,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
}
],
"headersSize": 568,
"httpVersion": "HTTP/1.1",
"method": "PUT",
"queryString": [],
"url": "https://api.datadoghq.com/api/v2/workflows/malformed/instances/malformed/cancel"
},
"response": {
"bodySize": 105,
"content": {
"mimeType": "application/json",
"size": 105,
"text": "{\"errors\":[{\"code\":\"INVALID_FIELD_VALUE\",\"detail\":\"value <no value> is invalid for field workflow_id\"}]}\n"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 647,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 400,
"statusText": "Bad Request"
},
"startedDateTime": "2024-07-24T18:39:57.498Z",
"time": 193
}
],
"pages": [],
"version": "1.2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2024-07-24T18:39:57.698Z"
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"log": {
"_recordingName": "Workflow Automation/Cancel a workflow instance returns \"Not Found\" response",
"creator": {
"comment": "persister:fs",
"name": "Polly.JS",
"version": "6.0.5"
},
"entries": [
{
"_id": "0f7c001df65a23839d1229ec52bc73cb",
"_order": 0,
"cache": {},
"request": {
"bodySize": 0,
"cookies": [],
"headers": [
{
"_fromType": "array",
"name": "accept",
"value": "application/json"
}
],
"headersSize": 622,
"httpVersion": "HTTP/1.1",
"method": "PUT",
"queryString": [],
"url": "https://api.datadoghq.com/api/v2/workflows/0233a3b7-b7ba-425e-a8cc-375ca2020b5b/instances/e0c64dc8-f946-4ae8-8d79-54569031ce67/cancel"
},
"response": {
"bodySize": 110,
"content": {
"mimeType": "application/json",
"size": 110,
"text": "{\"errors\":[{\"code\":\"INSTANCE_NOT_FOUND\",\"detail\":\"instance e0c64dc8-f946-4ae8-8d79-54569031ce67 not found\"}]}\n"
},
"cookies": [],
"headers": [
{
"name": "content-type",
"value": "application/json"
}
],
"headersSize": 647,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 404,
"statusText": "Not Found"
},
"startedDateTime": "2024-07-24T18:39:57.700Z",
"time": 118
}
],
"pages": [],
"version": "1.2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"2024-07-24T18:39:57.827Z"
Loading

0 comments on commit cf2cb9f

Please sign in to comment.