이 페이지는 아직 한국어로 제공되지 않으며 번역 작업 중입니다. 번역에 관한 질문이나 의견이 있으시면 언제든지 저희에게 연락해 주십시오.

Workflow Automation

Automate your teams operational processes with Datadog Workflow Automation.

GET https://api.ap1.datadoghq.com/api/v2/workflows/{workflow_id}/instanceshttps://api.datadoghq.eu/api/v2/workflows/{workflow_id}/instanceshttps://api.ddog-gov.com/api/v2/workflows/{workflow_id}/instanceshttps://api.datadoghq.com/api/v2/workflows/{workflow_id}/instanceshttps://api.us3.datadoghq.com/api/v2/workflows/{workflow_id}/instanceshttps://api.us5.datadoghq.com/api/v2/workflows/{workflow_id}/instances

개요

List all instances of a given workflow. This API requires an application key scoped with the workflows_read permission. This endpoint requires the workflows_read authorization scope.

인수

Path Parameters

이름

유형

설명

workflow_id [required]

string

The ID of the workflow.

Query Strings

이름

유형

설명

page[size]

integer

Size for a given page. The maximum allowed value is 100.

page[number]

integer

Specific page number to return.

응답

OK

Response returned when listing workflow instances.

Expand All

항목

유형

설명

<any-key>

{
  "data": [
    {
      "id": "string"
    }
  ],
  "meta": {
    "page": {
      "totalCount": "integer"
    }
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                  # Path parameters
export workflow_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/workflows/${workflow_id}/instances" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
// List workflow instances returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_workflow_automation::ListWorkflowInstancesOptionalParams;
use datadog_api_client::datadogV2::api_workflow_automation::WorkflowAutomationAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = WorkflowAutomationAPI::with_config(configuration);
    let resp = api
        .list_workflow_instances(
            "ccf73164-1998-4785-a7a3-8d06c7e5f558".to_string(),
            ListWorkflowInstancesOptionalParams::default(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

POST https://api.ap1.datadoghq.com/api/v2/workflows/{workflow_id}/instanceshttps://api.datadoghq.eu/api/v2/workflows/{workflow_id}/instanceshttps://api.ddog-gov.com/api/v2/workflows/{workflow_id}/instanceshttps://api.datadoghq.com/api/v2/workflows/{workflow_id}/instanceshttps://api.us3.datadoghq.com/api/v2/workflows/{workflow_id}/instanceshttps://api.us5.datadoghq.com/api/v2/workflows/{workflow_id}/instances

개요

Execute the given workflow. This API requires an application key scoped with the workflows_run permission.

인수

Path Parameters

이름

유형

설명

workflow_id [required]

string

The ID of the workflow.

요청

Body Data (required)

Expand All

항목

유형

설명

meta

object

Additional information for creating a workflow instance.

payload

object

The input parameters to the workflow.

{
  "meta": {
    "payload": {
      "input": "value"
    }
  }
}

응답

Created

Response returned upon successful workflow instance creation.

Expand All

항목

유형

설명

<any-key>

{
  "data": {
    "id": "string"
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                          # Path parameters
export workflow_id="CHANGE_ME"
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/workflows/${workflow_id}/instances" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "meta": { "payload": { "input": "value" } } } EOF
// Execute a workflow returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_workflow_automation::WorkflowAutomationAPI;
use datadog_api_client::datadogV2::model::WorkflowInstanceCreateMeta;
use datadog_api_client::datadogV2::model::WorkflowInstanceCreateRequest;
use serde_json::Value;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
    let body =
        WorkflowInstanceCreateRequest::new().meta(WorkflowInstanceCreateMeta::new().payload(
            BTreeMap::from([("input".to_string(), Value::from("value"))]),
        ));
    let configuration = datadog::Configuration::new();
    let api = WorkflowAutomationAPI::with_config(configuration);
    let resp = api
        .create_workflow_instance("ccf73164-1998-4785-a7a3-8d06c7e5f558".to_string(), body)
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run

GET https://api.ap1.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}https://api.datadoghq.eu/api/v2/workflows/{workflow_id}/instances/{instance_id}https://api.ddog-gov.com/api/v2/workflows/{workflow_id}/instances/{instance_id}https://api.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}https://api.us3.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}https://api.us5.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}

개요

Get a specific execution of a given workflow. This API requires an application key scoped with the workflows_read permission. This endpoint requires the workflows_read authorization scope.

인수

Path Parameters

이름

유형

설명

workflow_id [required]

string

The ID of the workflow.

instance_id [required]

string

The ID of the workflow instance.

응답

OK

The state of the given workflow instance.

Expand All

항목

유형

설명

<any-key>

{
  "data": {
    "attributes": {
      "id": "string"
    }
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                  # Path parameters
export workflow_id="CHANGE_ME"
export instance_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/workflows/${workflow_id}/instances/${instance_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
// Get a workflow instance returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_workflow_automation::WorkflowAutomationAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = WorkflowAutomationAPI::with_config(configuration);
    let resp = api
        .get_workflow_instance(
            "ccf73164-1998-4785-a7a3-8d06c7e5f558".to_string(),
            "305a472b-71ab-4ce8-8f8d-75db635627b5".to_string(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

PUT https://api.ap1.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancelhttps://api.datadoghq.eu/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancelhttps://api.ddog-gov.com/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancelhttps://api.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancelhttps://api.us3.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancelhttps://api.us5.datadoghq.com/api/v2/workflows/{workflow_id}/instances/{instance_id}/cancel

개요

Cancels a specific execution of a given workflow. This API requires an application key scoped with the workflows_run permission.

인수

Path Parameters

이름

유형

설명

workflow_id [required]

string

The ID of the workflow.

instance_id [required]

string

The ID of the workflow instance.

응답

OK

Information about the canceled instance.

Expand All

항목

유형

설명

data

object

Data about the canceled instance.

id

string

The id of the canceled instance

{
  "data": {
    "id": "string"
  }
}

Bad Request

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Forbidden

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Not Found

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Too many requests

API error response.

Expand All

항목

유형

설명

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                  # Path parameters
export workflow_id="CHANGE_ME"
export instance_id="CHANGE_ME"
# Curl command
curl -X PUT "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/workflows/${workflow_id}/instances/${instance_id}/cancel" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
// Cancel a workflow instance returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_workflow_automation::WorkflowAutomationAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = WorkflowAutomationAPI::with_config(configuration);
    let resp = api
        .cancel_workflow_instance(
            "ccf73164-1998-4785-a7a3-8d06c7e5f558".to_string(),
            "305a472b-71ab-4ce8-8f8d-75db635627b5".to_string(),
        )
        .await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

First install the library and its dependencies and then save the example to src/main.rs and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run

PREVIEWING: esther/docs-7422-add-rsyslog-note