Action Connection

Action connections extend your installed integrations and allow you to take action in your third-party systems (e.g. AWS, GitLab, and Statuspage) with Datadog’s Workflow Automation and App Builder products.

Datadog’s Integrations automatically provide authentication for Slack, Microsoft Teams, PagerDuty, Opsgenie, JIRA, GitHub, and Statuspage. You do not need additional connections in order to access these tools within Workflow Automation and App Builder.

We offer granular access control for editing and resolving connections.

GET https://api.ap1.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.datadoghq.eu/api/v2/actions/connections/{connection_id}https://api.ddog-gov.com/api/v2/actions/connections/{connection_id}https://api.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.us3.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.us5.datadoghq.com/api/v2/actions/connections/{connection_id}

Overview

Get an existing Action Connection

Arguments

Path Parameters

Name

Type

Description

connection_id [required]

string

The ID of the action connection

Response

Successfully get Action Connection

The response for found connection

Expand All

Field

Type

Description

data

object

Data related to the connection.

attributes [required]

object

The definition of ActionConnectionAttributes object.

integration [required]

 <oneOf>

The definition of ActionConnectionIntegration object.

Option 1

object

The definition of AWSIntegration object.

credentials [required]

 <oneOf>

The definition of AWSCredentials object.

Option 1

object

The definition of AWSAssumeRole object.

account_id [required]

string

AWS account the connection is created for

external_id

string

External ID used to scope which connection can be used to assume the role

principal_id

string

AWS account that will assume the role

role [required]

string

Role to assume

type [required]

enum

The definition of AWSAssumeRoleType object. Allowed enum values: AWSAssumeRole

type [required]

enum

The definition of AWSIntegrationType object. Allowed enum values: AWS

Option 2

object

The definition of HTTPIntegration object.

base_url [required]

string

Base HTTP url for the integration

credentials [required]

 <oneOf>

The definition of HTTPCredentials object.

Option 1

object

The definition of HTTPTokenAuth object.

body

object

The definition of HTTPBody object.

content

string

Serialized body content

content_type

string

Content type of the body

headers

[object]

The HTTPTokenAuth headers.

name [required]

string

The HTTPHeader name.

value [required]

string

The HTTPHeader value.

tokens

[object]

The HTTPTokenAuth tokens.

name [required]

string

The HTTPToken name.

type [required]

enum

The definition of TokenType object. Allowed enum values: SECRET

value [required]

string

The HTTPToken value.

type [required]

enum

The definition of HTTPTokenAuthType object. Allowed enum values: HTTPTokenAuth

url_parameters

[object]

The HTTPTokenAuth url_parameters.

name [required]

string

Name for tokens.

value [required]

string

The UrlParam value.

type [required]

enum

The definition of HTTPIntegrationType object. Allowed enum values: HTTP

name [required]

string

Name of the connection

id

string

The connection identifier

type [required]

enum

The definition of ActionConnectionDataType object. Allowed enum values: action_connection

{
  "data": {
    "attributes": {
      "integration": {
        "credentials": {
          "account_id": "111222333444",
          "external_id": "33a1011635c44b38a064cf14e82e1d8f",
          "principal_id": "123456789012",
          "role": "my-role",
          "type": "AWSAssumeRole"
        },
        "type": "AWS"
      },
      "name": "My AWS Connection"
    },
    "id": "string",
    "type": "action_connection"
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too Many Request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                  # Path parameters
export connection_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/actions/connections/${connection_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Get an existing Action Connection returns "Successfully get Action Connection" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = ActionConnectionApi(api_client)
    response = api_instance.get_action_connection(
        connection_id="cb460d51-3c88-4e87-adac-d47131d0423d",
    )

    print(response)

Instructions

First install the library and its dependencies and then save the example to example.py 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>" python3 "example.py"
# Get an existing Action Connection returns "Successfully get Action Connection" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::ActionConnectionAPI.new
p api_instance.get_action_connection("cb460d51-3c88-4e87-adac-d47131d0423d")

Instructions

First install the library and its dependencies and then save the example to example.rb 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>" rb "example.rb"
// Get an existing Action Connection returns "Successfully get Action Connection" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewActionConnectionApi(apiClient)
	resp, r, err := api.GetActionConnection(ctx, "cb460d51-3c88-4e87-adac-d47131d0423d")

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ActionConnectionApi.GetActionConnection`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `ActionConnectionApi.GetActionConnection`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go 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>" go run "main.go"
// Get an existing Action Connection returns "Successfully get Action Connection" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ActionConnectionApi;
import com.datadog.api.client.v2.model.GetActionConnectionResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    ActionConnectionApi apiInstance = new ActionConnectionApi(defaultClient);

    try {
      GetActionConnectionResponse result =
          apiInstance.getActionConnection("cb460d51-3c88-4e87-adac-d47131d0423d");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ActionConnectionApi#getActionConnection");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java 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>" java "Example.java"
// Get an existing Action Connection returns "Successfully get Action Connection"
// response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_action_connection::ActionConnectionAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = ActionConnectionAPI::with_config(configuration);
    let resp = api
        .get_action_connection("cb460d51-3c88-4e87-adac-d47131d0423d".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
/**
 * Get an existing Action Connection returns "Successfully get Action Connection" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.ActionConnectionApi(configuration);

const params: v2.ActionConnectionApiGetActionConnectionRequest = {
  connectionId: "cb460d51-3c88-4e87-adac-d47131d0423d",
};

apiInstance
  .getActionConnection(params)
  .then((data: v2.GetActionConnectionResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts 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>" tsc "example.ts"

POST https://api.ap1.datadoghq.com/api/v2/actions/connectionshttps://api.datadoghq.eu/api/v2/actions/connectionshttps://api.ddog-gov.com/api/v2/actions/connectionshttps://api.datadoghq.com/api/v2/actions/connectionshttps://api.us3.datadoghq.com/api/v2/actions/connectionshttps://api.us5.datadoghq.com/api/v2/actions/connections

Overview

Create a new Action Connection

Request

Body Data (required)

Expand All

Field

Type

Description

data [required]

object

Data related to the connection.

attributes [required]

object

The definition of ActionConnectionAttributes object.

integration [required]

 <oneOf>

The definition of ActionConnectionIntegration object.

Option 1

object

The definition of AWSIntegration object.

credentials [required]

 <oneOf>

The definition of AWSCredentials object.

Option 1

object

The definition of AWSAssumeRole object.

account_id [required]

string

AWS account the connection is created for

external_id

string

External ID used to scope which connection can be used to assume the role

principal_id

string

AWS account that will assume the role

role [required]

string

Role to assume

type [required]

enum

The definition of AWSAssumeRoleType object. Allowed enum values: AWSAssumeRole

type [required]

enum

The definition of AWSIntegrationType object. Allowed enum values: AWS

Option 2

object

The definition of HTTPIntegration object.

base_url [required]

string

Base HTTP url for the integration

credentials [required]

 <oneOf>

The definition of HTTPCredentials object.

Option 1

object

The definition of HTTPTokenAuth object.

body

object

The definition of HTTPBody object.

content

string

Serialized body content

content_type

string

Content type of the body

headers

[object]

The HTTPTokenAuth headers.

name [required]

string

The HTTPHeader name.

value [required]

string

The HTTPHeader value.

tokens

[object]

The HTTPTokenAuth tokens.

name [required]

string

The HTTPToken name.

type [required]

enum

The definition of TokenType object. Allowed enum values: SECRET

value [required]

string

The HTTPToken value.

type [required]

enum

The definition of HTTPTokenAuthType object. Allowed enum values: HTTPTokenAuth

url_parameters

[object]

The HTTPTokenAuth url_parameters.

name [required]

string

Name for tokens.

value [required]

string

The UrlParam value.

type [required]

enum

The definition of HTTPIntegrationType object. Allowed enum values: HTTP

name [required]

string

Name of the connection

id

string

The connection identifier

type [required]

enum

The definition of ActionConnectionDataType object. Allowed enum values: action_connection

{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "Cassette Connection DELETE_ME",
      "integration": {
        "type": "AWS",
        "credentials": {
          "type": "AWSAssumeRole",
          "role": "MyRoleUpdated",
          "account_id": "123456789123"
        }
      }
    }
  }
}

Response

Successfully created Action Connection

The response for a created connection

Expand All

Field

Type

Description

data

object

Data related to the connection.

attributes [required]

object

The definition of ActionConnectionAttributes object.

integration [required]

 <oneOf>

The definition of ActionConnectionIntegration object.

Option 1

object

The definition of AWSIntegration object.

credentials [required]

 <oneOf>

The definition of AWSCredentials object.

Option 1

object

The definition of AWSAssumeRole object.

account_id [required]

string

AWS account the connection is created for

external_id

string

External ID used to scope which connection can be used to assume the role

principal_id

string

AWS account that will assume the role

role [required]

string

Role to assume

type [required]

enum

The definition of AWSAssumeRoleType object. Allowed enum values: AWSAssumeRole

type [required]

enum

The definition of AWSIntegrationType object. Allowed enum values: AWS

Option 2

object

The definition of HTTPIntegration object.

base_url [required]

string

Base HTTP url for the integration

credentials [required]

 <oneOf>

The definition of HTTPCredentials object.

Option 1

object

The definition of HTTPTokenAuth object.

body

object

The definition of HTTPBody object.

content

string

Serialized body content

content_type

string

Content type of the body

headers

[object]

The HTTPTokenAuth headers.

name [required]

string

The HTTPHeader name.

value [required]

string

The HTTPHeader value.

tokens

[object]

The HTTPTokenAuth tokens.

name [required]

string

The HTTPToken name.

type [required]

enum

The definition of TokenType object. Allowed enum values: SECRET

value [required]

string

The HTTPToken value.

type [required]

enum

The definition of HTTPTokenAuthType object. Allowed enum values: HTTPTokenAuth

url_parameters

[object]

The HTTPTokenAuth url_parameters.

name [required]

string

Name for tokens.

value [required]

string

The UrlParam value.

type [required]

enum

The definition of HTTPIntegrationType object. Allowed enum values: HTTP

name [required]

string

Name of the connection

id

string

The connection identifier

type [required]

enum

The definition of ActionConnectionDataType object. Allowed enum values: action_connection

{
  "data": {
    "attributes": {
      "integration": {
        "credentials": {
          "account_id": "111222333444",
          "external_id": "33a1011635c44b38a064cf14e82e1d8f",
          "principal_id": "123456789012",
          "role": "my-role",
          "type": "AWSAssumeRole"
        },
        "type": "AWS"
      },
      "name": "My AWS Connection"
    },
    "id": "string",
    "type": "action_connection"
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too Many Request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                          # 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/actions/connections" \ -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 { "data": { "type": "action_connection", "attributes": { "name": "Cassette Connection DELETE_ME", "integration": { "type": "AWS", "credentials": { "type": "AWSAssumeRole", "role": "MyRoleUpdated", "account_id": "123456789123" } } } } } EOF
// Create a new Action Connection returns "Successfully created Action Connection" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	body := datadogV2.CreateActionConnectionRequest{
		Data: datadogV2.ActionConnectionData{
			Type: datadogV2.ACTIONCONNECTIONDATATYPE_ACTION_CONNECTION,
			Attributes: datadogV2.ActionConnectionAttributes{
				Name: "Cassette Connection DELETE_ME",
				Integration: datadogV2.ActionConnectionIntegration{
					AWSIntegration: &datadogV2.AWSIntegration{
						Type: datadogV2.AWSINTEGRATIONTYPE_AWS,
						Credentials: datadogV2.AWSCredentials{
							AWSAssumeRole: &datadogV2.AWSAssumeRole{
								Type:      datadogV2.AWSASSUMEROLETYPE_AWSASSUMEROLE,
								Role:      "MyRoleUpdated",
								AccountId: "123456789123",
							}},
					}},
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewActionConnectionApi(apiClient)
	resp, r, err := api.CreateActionConnection(ctx, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ActionConnectionApi.CreateActionConnection`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `ActionConnectionApi.CreateActionConnection`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go 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>" go run "main.go"
// Create a new Action Connection returns "Successfully created Action Connection" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ActionConnectionApi;
import com.datadog.api.client.v2.model.AWSAssumeRole;
import com.datadog.api.client.v2.model.AWSAssumeRoleType;
import com.datadog.api.client.v2.model.AWSCredentials;
import com.datadog.api.client.v2.model.AWSIntegration;
import com.datadog.api.client.v2.model.AWSIntegrationType;
import com.datadog.api.client.v2.model.ActionConnectionAttributes;
import com.datadog.api.client.v2.model.ActionConnectionData;
import com.datadog.api.client.v2.model.ActionConnectionDataType;
import com.datadog.api.client.v2.model.ActionConnectionIntegration;
import com.datadog.api.client.v2.model.CreateActionConnectionRequest;
import com.datadog.api.client.v2.model.CreateActionConnectionResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    ActionConnectionApi apiInstance = new ActionConnectionApi(defaultClient);

    CreateActionConnectionRequest body =
        new CreateActionConnectionRequest()
            .data(
                new ActionConnectionData()
                    .type(ActionConnectionDataType.ACTION_CONNECTION)
                    .attributes(
                        new ActionConnectionAttributes()
                            .name("Cassette Connection DELETE_ME")
                            .integration(
                                new ActionConnectionIntegration(
                                    new AWSIntegration()
                                        .type(AWSIntegrationType.AWS)
                                        .credentials(
                                            new AWSCredentials(
                                                new AWSAssumeRole()
                                                    .type(AWSAssumeRoleType.AWSASSUMEROLE)
                                                    .role("MyRoleUpdated")
                                                    .accountId("123456789123")))))));

    try {
      CreateActionConnectionResponse result = apiInstance.createActionConnection(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ActionConnectionApi#createActionConnection");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java 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>" java "Example.java"
"""
Create a new Action Connection returns "Successfully created Action Connection" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi
from datadog_api_client.v2.model.action_connection_attributes import ActionConnectionAttributes
from datadog_api_client.v2.model.action_connection_data import ActionConnectionData
from datadog_api_client.v2.model.action_connection_data_type import ActionConnectionDataType
from datadog_api_client.v2.model.aws_assume_role import AWSAssumeRole
from datadog_api_client.v2.model.aws_assume_role_type import AWSAssumeRoleType
from datadog_api_client.v2.model.aws_integration import AWSIntegration
from datadog_api_client.v2.model.aws_integration_type import AWSIntegrationType
from datadog_api_client.v2.model.create_action_connection_request import CreateActionConnectionRequest

body = CreateActionConnectionRequest(
    data=ActionConnectionData(
        type=ActionConnectionDataType.ACTION_CONNECTION,
        attributes=ActionConnectionAttributes(
            name="Cassette Connection DELETE_ME",
            integration=AWSIntegration(
                type=AWSIntegrationType.AWS,
                credentials=AWSAssumeRole(
                    type=AWSAssumeRoleType.AWSASSUMEROLE,
                    role="MyRoleUpdated",
                    account_id="123456789123",
                ),
            ),
        ),
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = ActionConnectionApi(api_client)
    response = api_instance.create_action_connection(body=body)

    print(response)

Instructions

First install the library and its dependencies and then save the example to example.py 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>" python3 "example.py"
# Create a new Action Connection returns "Successfully created Action Connection" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::ActionConnectionAPI.new

body = DatadogAPIClient::V2::CreateActionConnectionRequest.new({
  data: DatadogAPIClient::V2::ActionConnectionData.new({
    type: DatadogAPIClient::V2::ActionConnectionDataType::ACTION_CONNECTION,
    attributes: DatadogAPIClient::V2::ActionConnectionAttributes.new({
      name: "Cassette Connection DELETE_ME",
      integration: DatadogAPIClient::V2::AWSIntegration.new({
        type: DatadogAPIClient::V2::AWSIntegrationType::AWS,
        credentials: DatadogAPIClient::V2::AWSAssumeRole.new({
          type: DatadogAPIClient::V2::AWSAssumeRoleType::AWSASSUMEROLE,
          role: "MyRoleUpdated",
          account_id: "123456789123",
        }),
      }),
    }),
  }),
})
p api_instance.create_action_connection(body)

Instructions

First install the library and its dependencies and then save the example to example.rb 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>" rb "example.rb"
// Create a new Action Connection returns "Successfully created Action Connection"
// response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_action_connection::ActionConnectionAPI;
use datadog_api_client::datadogV2::model::AWSAssumeRole;
use datadog_api_client::datadogV2::model::AWSAssumeRoleType;
use datadog_api_client::datadogV2::model::AWSCredentials;
use datadog_api_client::datadogV2::model::AWSIntegration;
use datadog_api_client::datadogV2::model::AWSIntegrationType;
use datadog_api_client::datadogV2::model::ActionConnectionAttributes;
use datadog_api_client::datadogV2::model::ActionConnectionData;
use datadog_api_client::datadogV2::model::ActionConnectionDataType;
use datadog_api_client::datadogV2::model::ActionConnectionIntegration;
use datadog_api_client::datadogV2::model::CreateActionConnectionRequest;

#[tokio::main]
async fn main() {
    let body = CreateActionConnectionRequest::new(ActionConnectionData::new(
        ActionConnectionAttributes::new(
            ActionConnectionIntegration::AWSIntegration(Box::new(AWSIntegration::new(
                AWSCredentials::AWSAssumeRole(Box::new(AWSAssumeRole::new(
                    "123456789123".to_string(),
                    "MyRoleUpdated".to_string(),
                    AWSAssumeRoleType::AWSASSUMEROLE,
                ))),
                AWSIntegrationType::AWS,
            ))),
            "Cassette Connection DELETE_ME".to_string(),
        ),
        ActionConnectionDataType::ACTION_CONNECTION,
    ));
    let configuration = datadog::Configuration::new();
    let api = ActionConnectionAPI::with_config(configuration);
    let resp = api.create_action_connection(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
/**
 * Create a new Action Connection returns "Successfully created Action Connection" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.ActionConnectionApi(configuration);

const params: v2.ActionConnectionApiCreateActionConnectionRequest = {
  body: {
    data: {
      type: "action_connection",
      attributes: {
        name: "Cassette Connection DELETE_ME",
        integration: {
          type: "AWS",
          credentials: {
            type: "AWSAssumeRole",
            role: "MyRoleUpdated",
            accountId: "123456789123",
          },
        },
      },
    },
  },
};

apiInstance
  .createActionConnection(params)
  .then((data: v2.CreateActionConnectionResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts 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>" tsc "example.ts"

PATCH https://api.ap1.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.datadoghq.eu/api/v2/actions/connections/{connection_id}https://api.ddog-gov.com/api/v2/actions/connections/{connection_id}https://api.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.us3.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.us5.datadoghq.com/api/v2/actions/connections/{connection_id}

Overview

Update an existing Action Connection

Arguments

Path Parameters

Name

Type

Description

connection_id [required]

string

The ID of the action connection

Request

Body Data (required)

Update an existing Action Connection request body

Expand All

Field

Type

Description

data [required]

object

Data related to the connection update.

attributes [required]

object

The definition of ActionConnectionAttributesUpdate object.

integration

 <oneOf>

The definition of ActionConnectionIntegrationUpdate object.

Option 1

object

The definition of AWSIntegrationUpdate object.

credentials

 <oneOf>

The definition of AWSCredentialsUpdate object.

Option 1

object

The definition of AWSAssumeRoleUpdate object.

account_id

string

AWS account the connection is created for

generate_new_external_id

boolean

The AWSAssumeRoleUpdate generate_new_external_id.

role

string

Role to assume

type [required]

enum

The definition of AWSAssumeRoleType object. Allowed enum values: AWSAssumeRole

type [required]

enum

The definition of AWSIntegrationType object. Allowed enum values: AWS

Option 2

object

The definition of HTTPIntegrationUpdate object.

base_url

string

Base HTTP url for the integration

credentials

 <oneOf>

The definition of HTTPCredentialsUpdate object.

Option 1

object

The definition of HTTPTokenAuthUpdate object.

body

object

The definition of HTTPBody object.

content

string

Serialized body content

content_type

string

Content type of the body

headers

[object]

The HTTPTokenAuthUpdate headers.

deleted

boolean

Should the header be deleted.

name [required]

string

The HTTPHeaderUpdate name.

value

string

The HTTPHeaderUpdate value.

tokens

[object]

The HTTPTokenAuthUpdate tokens.

deleted

boolean

Should the header be deleted.

name [required]

string

The HTTPToken name.

type [required]

enum

The definition of TokenType object. Allowed enum values: SECRET

value [required]

string

The HTTPToken value.

type [required]

enum

The definition of HTTPTokenAuthType object. Allowed enum values: HTTPTokenAuth

url_parameters

[object]

The HTTPTokenAuthUpdate url_parameters.

deleted

boolean

Should the header be deleted.

name [required]

string

Name for tokens.

value

string

The UrlParamUpdate value.

type [required]

enum

The definition of HTTPIntegrationType object. Allowed enum values: HTTP

name

string

Name of the connection

type [required]

enum

The definition of ActionConnectionDataType object. Allowed enum values: action_connection

{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "Cassette Connection",
      "integration": {
        "type": "AWS",
        "credentials": {
          "type": "AWSAssumeRole",
          "role": "MyRoleUpdated",
          "account_id": "123456789123"
        }
      }
    }
  }
}

Response

Successfully updated Action Connection

The response for an updated connection.

Expand All

Field

Type

Description

data

object

Data related to the connection.

attributes [required]

object

The definition of ActionConnectionAttributes object.

integration [required]

 <oneOf>

The definition of ActionConnectionIntegration object.

Option 1

object

The definition of AWSIntegration object.

credentials [required]

 <oneOf>

The definition of AWSCredentials object.

Option 1

object

The definition of AWSAssumeRole object.

account_id [required]

string

AWS account the connection is created for

external_id

string

External ID used to scope which connection can be used to assume the role

principal_id

string

AWS account that will assume the role

role [required]

string

Role to assume

type [required]

enum

The definition of AWSAssumeRoleType object. Allowed enum values: AWSAssumeRole

type [required]

enum

The definition of AWSIntegrationType object. Allowed enum values: AWS

Option 2

object

The definition of HTTPIntegration object.

base_url [required]

string

Base HTTP url for the integration

credentials [required]

 <oneOf>

The definition of HTTPCredentials object.

Option 1

object

The definition of HTTPTokenAuth object.

body

object

The definition of HTTPBody object.

content

string

Serialized body content

content_type

string

Content type of the body

headers

[object]

The HTTPTokenAuth headers.

name [required]

string

The HTTPHeader name.

value [required]

string

The HTTPHeader value.

tokens

[object]

The HTTPTokenAuth tokens.

name [required]

string

The HTTPToken name.

type [required]

enum

The definition of TokenType object. Allowed enum values: SECRET

value [required]

string

The HTTPToken value.

type [required]

enum

The definition of HTTPTokenAuthType object. Allowed enum values: HTTPTokenAuth

url_parameters

[object]

The HTTPTokenAuth url_parameters.

name [required]

string

Name for tokens.

value [required]

string

The UrlParam value.

type [required]

enum

The definition of HTTPIntegrationType object. Allowed enum values: HTTP

name [required]

string

Name of the connection

id

string

The connection identifier

type [required]

enum

The definition of ActionConnectionDataType object. Allowed enum values: action_connection

{
  "data": {
    "attributes": {
      "integration": {
        "credentials": {
          "account_id": "111222333444",
          "external_id": "33a1011635c44b38a064cf14e82e1d8f",
          "principal_id": "123456789012",
          "role": "my-role",
          "type": "AWSAssumeRole"
        },
        "type": "AWS"
      },
      "name": "My AWS Connection"
    },
    "id": "string",
    "type": "action_connection"
  }
}

Bad Request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too Many Request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                          # Path parameters
export connection_id="CHANGE_ME"
# Curl command
curl -X PATCH "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/actions/connections/${connection_id}" \ -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 { "data": { "type": "action_connection", "attributes": { "name": "Cassette Connection", "integration": { "type": "AWS", "credentials": { "type": "AWSAssumeRole", "role": "MyRoleUpdated", "account_id": "123456789123" } } } } } EOF
// Update an existing Action Connection returns "Successfully updated Action Connection" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	body := datadogV2.UpdateActionConnectionRequest{
		Data: datadogV2.ActionConnectionDataUpdate{
			Type: datadogV2.ACTIONCONNECTIONDATATYPE_ACTION_CONNECTION,
			Attributes: datadogV2.ActionConnectionAttributesUpdate{
				Name: datadog.PtrString("Cassette Connection"),
				Integration: &datadogV2.ActionConnectionIntegrationUpdate{
					AWSIntegrationUpdate: &datadogV2.AWSIntegrationUpdate{
						Type: datadogV2.AWSINTEGRATIONTYPE_AWS,
						Credentials: &datadogV2.AWSCredentialsUpdate{
							AWSAssumeRoleUpdate: &datadogV2.AWSAssumeRoleUpdate{
								Type:      datadogV2.AWSASSUMEROLETYPE_AWSASSUMEROLE,
								Role:      datadog.PtrString("MyRoleUpdated"),
								AccountId: datadog.PtrString("123456789123"),
							}},
					}},
			},
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewActionConnectionApi(apiClient)
	resp, r, err := api.UpdateActionConnection(ctx, "cb460d51-3c88-4e87-adac-d47131d0423d", body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ActionConnectionApi.UpdateActionConnection`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `ActionConnectionApi.UpdateActionConnection`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go 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>" go run "main.go"
// Update an existing Action Connection returns "Successfully updated Action Connection" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ActionConnectionApi;
import com.datadog.api.client.v2.model.AWSAssumeRoleType;
import com.datadog.api.client.v2.model.AWSAssumeRoleUpdate;
import com.datadog.api.client.v2.model.AWSCredentialsUpdate;
import com.datadog.api.client.v2.model.AWSIntegrationType;
import com.datadog.api.client.v2.model.AWSIntegrationUpdate;
import com.datadog.api.client.v2.model.ActionConnectionAttributesUpdate;
import com.datadog.api.client.v2.model.ActionConnectionDataType;
import com.datadog.api.client.v2.model.ActionConnectionDataUpdate;
import com.datadog.api.client.v2.model.ActionConnectionIntegrationUpdate;
import com.datadog.api.client.v2.model.UpdateActionConnectionRequest;
import com.datadog.api.client.v2.model.UpdateActionConnectionResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    ActionConnectionApi apiInstance = new ActionConnectionApi(defaultClient);

    UpdateActionConnectionRequest body =
        new UpdateActionConnectionRequest()
            .data(
                new ActionConnectionDataUpdate()
                    .type(ActionConnectionDataType.ACTION_CONNECTION)
                    .attributes(
                        new ActionConnectionAttributesUpdate()
                            .name("Cassette Connection")
                            .integration(
                                new ActionConnectionIntegrationUpdate(
                                    new AWSIntegrationUpdate()
                                        .type(AWSIntegrationType.AWS)
                                        .credentials(
                                            new AWSCredentialsUpdate(
                                                new AWSAssumeRoleUpdate()
                                                    .type(AWSAssumeRoleType.AWSASSUMEROLE)
                                                    .role("MyRoleUpdated")
                                                    .accountId("123456789123")))))));

    try {
      UpdateActionConnectionResponse result =
          apiInstance.updateActionConnection("cb460d51-3c88-4e87-adac-d47131d0423d", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ActionConnectionApi#updateActionConnection");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java 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>" java "Example.java"
"""
Update an existing Action Connection returns "Successfully updated Action Connection" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi
from datadog_api_client.v2.model.action_connection_attributes_update import ActionConnectionAttributesUpdate
from datadog_api_client.v2.model.action_connection_data_type import ActionConnectionDataType
from datadog_api_client.v2.model.action_connection_data_update import ActionConnectionDataUpdate
from datadog_api_client.v2.model.aws_assume_role_type import AWSAssumeRoleType
from datadog_api_client.v2.model.aws_assume_role_update import AWSAssumeRoleUpdate
from datadog_api_client.v2.model.aws_integration_type import AWSIntegrationType
from datadog_api_client.v2.model.aws_integration_update import AWSIntegrationUpdate
from datadog_api_client.v2.model.update_action_connection_request import UpdateActionConnectionRequest

body = UpdateActionConnectionRequest(
    data=ActionConnectionDataUpdate(
        type=ActionConnectionDataType.ACTION_CONNECTION,
        attributes=ActionConnectionAttributesUpdate(
            name="Cassette Connection",
            integration=AWSIntegrationUpdate(
                type=AWSIntegrationType.AWS,
                credentials=AWSAssumeRoleUpdate(
                    type=AWSAssumeRoleType.AWSASSUMEROLE,
                    role="MyRoleUpdated",
                    account_id="123456789123",
                ),
            ),
        ),
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = ActionConnectionApi(api_client)
    response = api_instance.update_action_connection(connection_id="cb460d51-3c88-4e87-adac-d47131d0423d", body=body)

    print(response)

Instructions

First install the library and its dependencies and then save the example to example.py 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>" python3 "example.py"
# Update an existing Action Connection returns "Successfully updated Action Connection" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::ActionConnectionAPI.new

body = DatadogAPIClient::V2::UpdateActionConnectionRequest.new({
  data: DatadogAPIClient::V2::ActionConnectionDataUpdate.new({
    type: DatadogAPIClient::V2::ActionConnectionDataType::ACTION_CONNECTION,
    attributes: DatadogAPIClient::V2::ActionConnectionAttributesUpdate.new({
      name: "Cassette Connection",
      integration: DatadogAPIClient::V2::AWSIntegrationUpdate.new({
        type: DatadogAPIClient::V2::AWSIntegrationType::AWS,
        credentials: DatadogAPIClient::V2::AWSAssumeRoleUpdate.new({
          type: DatadogAPIClient::V2::AWSAssumeRoleType::AWSASSUMEROLE,
          role: "MyRoleUpdated",
          account_id: "123456789123",
        }),
      }),
    }),
  }),
})
p api_instance.update_action_connection("cb460d51-3c88-4e87-adac-d47131d0423d", body)

Instructions

First install the library and its dependencies and then save the example to example.rb 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>" rb "example.rb"
// Update an existing Action Connection returns "Successfully updated Action
// Connection" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_action_connection::ActionConnectionAPI;
use datadog_api_client::datadogV2::model::AWSAssumeRoleType;
use datadog_api_client::datadogV2::model::AWSAssumeRoleUpdate;
use datadog_api_client::datadogV2::model::AWSCredentialsUpdate;
use datadog_api_client::datadogV2::model::AWSIntegrationType;
use datadog_api_client::datadogV2::model::AWSIntegrationUpdate;
use datadog_api_client::datadogV2::model::ActionConnectionAttributesUpdate;
use datadog_api_client::datadogV2::model::ActionConnectionDataType;
use datadog_api_client::datadogV2::model::ActionConnectionDataUpdate;
use datadog_api_client::datadogV2::model::ActionConnectionIntegrationUpdate;
use datadog_api_client::datadogV2::model::UpdateActionConnectionRequest;

#[tokio::main]
async fn main() {
    let body = UpdateActionConnectionRequest::new(ActionConnectionDataUpdate::new(
        ActionConnectionAttributesUpdate::new()
            .integration(ActionConnectionIntegrationUpdate::AWSIntegrationUpdate(
                Box::new(
                    AWSIntegrationUpdate::new(AWSIntegrationType::AWS).credentials(
                        AWSCredentialsUpdate::AWSAssumeRoleUpdate(Box::new(
                            AWSAssumeRoleUpdate::new(AWSAssumeRoleType::AWSASSUMEROLE)
                                .account_id("123456789123".to_string())
                                .role("MyRoleUpdated".to_string()),
                        )),
                    ),
                ),
            ))
            .name("Cassette Connection".to_string()),
        ActionConnectionDataType::ACTION_CONNECTION,
    ));
    let configuration = datadog::Configuration::new();
    let api = ActionConnectionAPI::with_config(configuration);
    let resp = api
        .update_action_connection("cb460d51-3c88-4e87-adac-d47131d0423d".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
/**
 * Update an existing Action Connection returns "Successfully updated Action Connection" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.ActionConnectionApi(configuration);

const params: v2.ActionConnectionApiUpdateActionConnectionRequest = {
  body: {
    data: {
      type: "action_connection",
      attributes: {
        name: "Cassette Connection",
        integration: {
          type: "AWS",
          credentials: {
            type: "AWSAssumeRole",
            role: "MyRoleUpdated",
            accountId: "123456789123",
          },
        },
      },
    },
  },
  connectionId: "cb460d51-3c88-4e87-adac-d47131d0423d",
};

apiInstance
  .updateActionConnection(params)
  .then((data: v2.UpdateActionConnectionResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts 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>" tsc "example.ts"

DELETE https://api.ap1.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.datadoghq.eu/api/v2/actions/connections/{connection_id}https://api.ddog-gov.com/api/v2/actions/connections/{connection_id}https://api.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.us3.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.us5.datadoghq.com/api/v2/actions/connections/{connection_id}

Overview

Delete an existing Action Connection This endpoint requires the connection_write permission.

Arguments

Path Parameters

Name

Type

Description

connection_id [required]

string

The ID of the action connection

Response

The resource was deleted successfully.

Forbidden

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Not Found

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too Many Request

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Code Example

                  # Path parameters
export connection_id="CHANGE_ME"
# Curl command
curl -X DELETE "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/actions/connections/${connection_id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"
"""
Delete an existing Action Connection returns "The resource was deleted successfully." response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = ActionConnectionApi(api_client)
    api_instance.delete_action_connection(
        connection_id="connection_id",
    )

Instructions

First install the library and its dependencies and then save the example to example.py 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>" python3 "example.py"
# Delete an existing Action Connection returns "The resource was deleted successfully." response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::ActionConnectionAPI.new
api_instance.delete_action_connection("connection_id")

Instructions

First install the library and its dependencies and then save the example to example.rb 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>" rb "example.rb"
// Delete an existing Action Connection returns "The resource was deleted successfully." response

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewActionConnectionApi(apiClient)
	r, err := api.DeleteActionConnection(ctx, "connection_id")

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ActionConnectionApi.DeleteActionConnection`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Instructions

First install the library and its dependencies and then save the example to main.go 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>" go run "main.go"
// Delete an existing Action Connection returns "The resource was deleted successfully." response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ActionConnectionApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    ActionConnectionApi apiInstance = new ActionConnectionApi(defaultClient);

    try {
      apiInstance.deleteActionConnection("connection_id");
    } catch (ApiException e) {
      System.err.println("Exception when calling ActionConnectionApi#deleteActionConnection");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

First install the library and its dependencies and then save the example to Example.java 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>" java "Example.java"
// Delete an existing Action Connection returns "The resource was deleted
// successfully." response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_action_connection::ActionConnectionAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = ActionConnectionAPI::with_config(configuration);
    let resp = api
        .delete_action_connection("connection_id".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
/**
 * Delete an existing Action Connection returns "The resource was deleted successfully." response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
const apiInstance = new v2.ActionConnectionApi(configuration);

const params: v2.ActionConnectionApiDeleteActionConnectionRequest = {
  connectionId: "connection_id",
};

apiInstance
  .deleteActionConnection(params)
  .then((data: any) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

First install the library and its dependencies and then save the example to example.ts 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>" tsc "example.ts"