Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
425 changes: 425 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions examples/v2/workflow-automation/ExecuteWorkflowFromTemplate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Execute a workflow from a template returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.execute_workflow_from_template".to_sym] = true
end
api_instance = DatadogAPIClient::V2::WorkflowAutomationAPI.new

body = DatadogAPIClient::V2::WorkflowHeadlessExecutionRequest.new({
data: DatadogAPIClient::V2::WorkflowHeadlessExecutionRequestData.new({
attributes: DatadogAPIClient::V2::WorkflowHeadlessExecutionRequestAttributes.new({
config: DatadogAPIClient::V2::WorkflowHeadlessExecutionConfig.new({
connections: [
DatadogAPIClient::V2::WorkflowHeadlessExecutionConnection.new({
connection_id: "11111111-1111-1111-1111-111111111111",
label: "INTEGRATION_DATADOG",
}),
],
inputs: {},
}),
template_id: "template-789",
}),
id: "1234",
type: DatadogAPIClient::V2::WorkflowHeadlessExecutionRequestType::WORKFLOW_HEADLESS_EXECUTION_REQUEST,
}),
})
p api_instance.execute_workflow_from_template("parent_id", body)
10 changes: 10 additions & 0 deletions examples/v2/workflow-automation/ExecuteWorkflowFromWebhook.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Execute a workflow from a webhook returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.execute_workflow_from_webhook".to_sym] = true
end
api_instance = DatadogAPIClient::V2::WorkflowAutomationAPI.new

body = DatadogAPIClient::V2::WorkflowWebhookPayload.new({})
p api_instance.execute_workflow_from_webhook("workflow_id", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "sha256=abcdef123456...", "GitHub-Hookshot/abc123", body)
17 changes: 17 additions & 0 deletions examples/v2/workflow-automation/UpdateWorkflowFavorite.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Update workflow favorite status returns "No Content" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.update_workflow_favorite".to_sym] = true
end
api_instance = DatadogAPIClient::V2::WorkflowAutomationAPI.new

body = DatadogAPIClient::V2::WorkflowFavoriteRequest.new({
data: DatadogAPIClient::V2::WorkflowFavoriteRequestData.new({
attributes: DatadogAPIClient::V2::WorkflowFavoriteRequestAttributes.new({
favorite: true,
}),
type: DatadogAPIClient::V2::WorkflowFavoriteRequestType::WORKFLOW_FAVORITE_REQUEST,
}),
})
api_instance.update_workflow_favorite("workflow_id", body)
15 changes: 15 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3837,6 +3837,10 @@
"v2.ListUserPermissions" => {
"user_id" => "String",
},
"v2.ExecuteWorkflowFromTemplate" => {
"parent_id" => "String",
"body" => "WorkflowHeadlessExecutionRequest",
},
"v2.CreateWorkflow" => {
"body" => "CreateWorkflowRequest",
},
Expand All @@ -3850,6 +3854,10 @@
"workflow_id" => "String",
"body" => "UpdateWorkflowRequest",
},
"v2.UpdateWorkflowFavorite" => {
"workflow_id" => "String",
"body" => "WorkflowFavoriteRequest",
},
"v2.ListWorkflowInstances" => {
"workflow_id" => "String",
"page_size" => "Integer",
Expand All @@ -3867,4 +3875,11 @@
"workflow_id" => "String",
"instance_id" => "String",
},
"v2.ExecuteWorkflowFromWebhook" => {
"workflow_id" => "String",
"org_id" => "UUID",
"x_hub_signature_256" => "String",
"user_agent" => "String",
"body" => "Hash<String, Object>",
},
}
18 changes: 18 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5737,6 +5737,12 @@
"type": "safe"
}
},
"ExecuteWorkflowFromTemplate": {
"tag": "Workflow Automation",
"undo": {
"type": "safe"
}
},
"CreateWorkflow": {
"tag": "Workflow Automation",
"undo": {
Expand Down Expand Up @@ -5768,6 +5774,12 @@
"type": "idempotent"
}
},
"UpdateWorkflowFavorite": {
"tag": "Workflow Automation",
"undo": {
"type": "idempotent"
}
},
"ListWorkflowInstances": {
"tag": "Workflow Automation",
"undo": {
Expand All @@ -5791,5 +5803,11 @@
"undo": {
"type": "safe"
}
},
"ExecuteWorkflowFromWebhook": {
"tag": "Workflow Automation",
"undo": {
"type": "safe"
}
}
}
90 changes: 90 additions & 0 deletions features/v2/workflow_automation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,69 @@ Feature: Workflow Automation
When the request is sent
Then the response status is 204 Successfully deleted a workflow.

@generated @skip @team:DataDog/workflow-automation-dev
Scenario: Execute a workflow from a template returns "Bad Request" response
Given operation "ExecuteWorkflowFromTemplate" enabled
And new "ExecuteWorkflowFromTemplate" request
And request contains "parent_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"config": {"connections": [{"connection_id": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "inputs": {}}, "template_id": "template-789"}, "id": "1234", "type": "workflow_headless_execution_request"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/workflow-automation-dev
Scenario: Execute a workflow from a template returns "Not Found" response
Given operation "ExecuteWorkflowFromTemplate" enabled
And new "ExecuteWorkflowFromTemplate" request
And request contains "parent_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"config": {"connections": [{"connection_id": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "inputs": {}}, "template_id": "template-789"}, "id": "1234", "type": "workflow_headless_execution_request"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/workflow-automation-dev
Scenario: Execute a workflow from a template returns "OK" response
Given operation "ExecuteWorkflowFromTemplate" enabled
And new "ExecuteWorkflowFromTemplate" request
And request contains "parent_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"config": {"connections": [{"connection_id": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "inputs": {}}, "template_id": "template-789"}, "id": "1234", "type": "workflow_headless_execution_request"}}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/workflow-automation-dev
Scenario: Execute a workflow from a webhook returns "Bad Request" response
Given operation "ExecuteWorkflowFromWebhook" enabled
And new "ExecuteWorkflowFromWebhook" request
And request contains "workflow_id" parameter from "REPLACE.ME"
And request contains "orgId" parameter from "REPLACE.ME"
And request contains "X-Hub-Signature-256" parameter from "REPLACE.ME"
And request contains "User-Agent" parameter from "REPLACE.ME"
And body with value {"foo": "bar"}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/workflow-automation-dev
Scenario: Execute a workflow from a webhook returns "Not Found" response
Given operation "ExecuteWorkflowFromWebhook" enabled
And new "ExecuteWorkflowFromWebhook" request
And request contains "workflow_id" parameter from "REPLACE.ME"
And request contains "orgId" parameter from "REPLACE.ME"
And request contains "X-Hub-Signature-256" parameter from "REPLACE.ME"
And request contains "User-Agent" parameter from "REPLACE.ME"
And body with value {"foo": "bar"}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/workflow-automation-dev
Scenario: Execute a workflow from a webhook returns "OK" response
Given operation "ExecuteWorkflowFromWebhook" enabled
And new "ExecuteWorkflowFromWebhook" request
And request contains "workflow_id" parameter from "REPLACE.ME"
And request contains "orgId" parameter from "REPLACE.ME"
And request contains "X-Hub-Signature-256" parameter from "REPLACE.ME"
And request contains "User-Agent" parameter from "REPLACE.ME"
And body with value {"foo": "bar"}
When the request is sent
Then the response status is 200 OK

@replay-only @team:DataDog/workflow-automation-dev
Scenario: Execute a workflow returns "Bad Request" response
Given new "CreateWorkflowInstance" request
Expand Down Expand Up @@ -167,3 +230,30 @@ Feature: Workflow Automation
And body with value {"data": {"attributes": {"description": "A sample workflow.", "name": "Example Workflow", "published": true, "spec": {"connectionEnvs": [{"connections": [{"connectionId": "11111111-1111-1111-1111-111111111111", "label": "INTEGRATION_DATADOG"}], "env": "default"}], "inputSchema": {"parameters": [{"defaultValue": "default", "name": "input", "type": "STRING"}]}, "outputSchema": {"parameters": [{"name": "output", "type": "ARRAY_OBJECT", "value": "outputValue"}]}, "steps": [{"actionId": "com.datadoghq.dd.monitor.listMonitors", "connectionLabel": "INTEGRATION_DATADOG", "name": "Step1", "outboundEdges": [{"branchName": "main", "nextStepName": "Step2"}], "parameters": [{"name": "tags", "value": "service:monitoring"}]}, {"actionId": "com.datadoghq.core.noop", "name": "Step2"}], "triggers": [{"monitorTrigger": {"rateLimit": {"count": 1, "interval": "3600s"}}, "startStepNames": ["Step1"]}, {"startStepNames": ["Step1"], "githubWebhookTrigger": {}}]}, "tags": ["team:infra", "service:monitoring", "foo:bar"]}, "id": "22222222-2222-2222-2222-222222222222", "type": "workflows"}}
When the request is sent
Then the response status is 200 Successfully updated a workflow.

@generated @skip @team:DataDog/workflow-automation-dev
Scenario: Update workflow favorite status returns "Bad Request" response
Given operation "UpdateWorkflowFavorite" enabled
And new "UpdateWorkflowFavorite" request
And request contains "workflow_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"favorite": true}, "type": "workflow_favorite_request"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/workflow-automation-dev
Scenario: Update workflow favorite status returns "No Content" response
Given operation "UpdateWorkflowFavorite" enabled
And new "UpdateWorkflowFavorite" request
And request contains "workflow_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"favorite": true}, "type": "workflow_favorite_request"}}
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/workflow-automation-dev
Scenario: Update workflow favorite status returns "Not Found" response
Given operation "UpdateWorkflowFavorite" enabled
And new "UpdateWorkflowFavorite" request
And request contains "workflow_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"favorite": true}, "type": "workflow_favorite_request"}}
When the request is sent
Then the response status is 404 Not Found
3 changes: 3 additions & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ def initialize
"v2.update_incident_team": false,
"v2.search_flaky_tests": false,
"v2.update_flaky_tests": false,
"v2.execute_workflow_from_template": false,
"v2.execute_workflow_from_webhook": false,
"v2.update_workflow_favorite": false,
}
@server_variables[:site] = ENV['DD_SITE'] if ENV.key? 'DD_SITE'
@api_key['apiKeyAuth'] = ENV['DD_API_KEY'] if ENV.key? 'DD_API_KEY'
Expand Down
18 changes: 18 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5188,6 +5188,20 @@ def overrides
"v2.workflow_data_type" => "WorkflowDataType",
"v2.workflow_data_update" => "WorkflowDataUpdate",
"v2.workflow_data_update_attributes" => "WorkflowDataUpdateAttributes",
"v2.workflow_favorite_request" => "WorkflowFavoriteRequest",
"v2.workflow_favorite_request_attributes" => "WorkflowFavoriteRequestAttributes",
"v2.workflow_favorite_request_data" => "WorkflowFavoriteRequestData",
"v2.workflow_favorite_request_type" => "WorkflowFavoriteRequestType",
"v2.workflow_headless_execution_config" => "WorkflowHeadlessExecutionConfig",
"v2.workflow_headless_execution_connection" => "WorkflowHeadlessExecutionConnection",
"v2.workflow_headless_execution_request" => "WorkflowHeadlessExecutionRequest",
"v2.workflow_headless_execution_request_attributes" => "WorkflowHeadlessExecutionRequestAttributes",
"v2.workflow_headless_execution_request_data" => "WorkflowHeadlessExecutionRequestData",
"v2.workflow_headless_execution_request_type" => "WorkflowHeadlessExecutionRequestType",
"v2.workflow_headless_execution_response" => "WorkflowHeadlessExecutionResponse",
"v2.workflow_headless_execution_response_attributes" => "WorkflowHeadlessExecutionResponseAttributes",
"v2.workflow_headless_execution_response_data" => "WorkflowHeadlessExecutionResponseData",
"v2.workflow_headless_execution_response_type" => "WorkflowHeadlessExecutionResponseType",
"v2.workflow_instance_create_meta" => "WorkflowInstanceCreateMeta",
"v2.workflow_instance_create_request" => "WorkflowInstanceCreateRequest",
"v2.workflow_instance_create_response" => "WorkflowInstanceCreateResponse",
Expand All @@ -5200,6 +5214,10 @@ def overrides
"v2.workflow_user_relationship" => "WorkflowUserRelationship",
"v2.workflow_user_relationship_data" => "WorkflowUserRelationshipData",
"v2.workflow_user_relationship_type" => "WorkflowUserRelationshipType",
"v2.workflow_webhook_execution_response" => "WorkflowWebhookExecutionResponse",
"v2.workflow_webhook_execution_response_attributes" => "WorkflowWebhookExecutionResponseAttributes",
"v2.workflow_webhook_execution_response_data" => "WorkflowWebhookExecutionResponseData",
"v2.workflow_webhook_execution_response_type" => "WorkflowWebhookExecutionResponseType",
"v2.worklflow_cancel_instance_response" => "WorklflowCancelInstanceResponse",
"v2.worklflow_cancel_instance_response_data" => "WorklflowCancelInstanceResponseData",
"v2.worklflow_get_instance_response" => "WorklflowGetInstanceResponse",
Expand Down
Loading
Loading