Opsgenie Integration

Configure your Datadog Opsgenie integration directly through the Datadog API.

GET https://api.ap1.datadoghq.com/api/v2/integration/opsgenie/serviceshttps://api.datadoghq.eu/api/v2/integration/opsgenie/serviceshttps://api.ddog-gov.com/api/v2/integration/opsgenie/serviceshttps://api.datadoghq.com/api/v2/integration/opsgenie/serviceshttps://api.us3.datadoghq.com/api/v2/integration/opsgenie/serviceshttps://api.us5.datadoghq.com/api/v2/integration/opsgenie/services

개요

Get a list of all services from the Datadog Opsgenie integration. This endpoint requires the integrations_read permission.

응답

OK

Response with a list of Opsgenie services.

Expand All

항목

유형

설명

data [required]

[object]

An array of Opsgenie services.

attributes [required]

object

The attributes from an Opsgenie service response.

custom_url

string

The custom URL for a custom region.

name

string

The name for the Opsgenie service.

region

enum

The region for the Opsgenie service. Allowed enum values: us,eu,custom

id [required]

string

The ID of the Opsgenie service.

type [required]

enum

Opsgenie service resource type. Allowed enum values: opsgenie-service

default: opsgenie-service

{
  "data": [
    {
      "attributes": {
        "custom_url": null,
        "name": "fake-opsgenie-service-name",
        "region": "us"
      },
      "id": "596da4af-0563-4097-90ff-07230c3f9db3",
      "type": "opsgenie-service"
    }
  ]
}

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"
  ]
}

코드 사례

"""
Get all service objects returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.opsgenie_integration_api import OpsgenieIntegrationApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = OpsgenieIntegrationApi(api_client)
    response = api_instance.list_opsgenie_services()

    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"

POST https://api.ap1.datadoghq.com/api/v2/integration/opsgenie/serviceshttps://api.datadoghq.eu/api/v2/integration/opsgenie/serviceshttps://api.ddog-gov.com/api/v2/integration/opsgenie/serviceshttps://api.datadoghq.com/api/v2/integration/opsgenie/serviceshttps://api.us3.datadoghq.com/api/v2/integration/opsgenie/serviceshttps://api.us5.datadoghq.com/api/v2/integration/opsgenie/services

개요

Create a new service object in the Opsgenie integration. This endpoint requires the manage_integrations permission.

요청

Body Data (required)

Opsgenie service payload

Expand All

항목

유형

설명

data [required]

object

Opsgenie service data for a create request.

attributes [required]

object

The Opsgenie service attributes for a create request.

custom_url

string

The custom URL for a custom region.

name [required]

string

The name for the Opsgenie service.

opsgenie_api_key [required]

string

The Opsgenie API key for your Opsgenie service.

region [required]

enum

The region for the Opsgenie service. Allowed enum values: us,eu,custom

type [required]

enum

Opsgenie service resource type. Allowed enum values: opsgenie-service

default: opsgenie-service

{
  "data": {
    "attributes": {
      "name": "Example-Opsgenie-Integration",
      "opsgenie_api_key": "00000000-0000-0000-0000-000000000000",
      "region": "us"
    },
    "type": "opsgenie-service"
  }
}

응답

CREATED

Response of an Opsgenie service.

Expand All

항목

유형

설명

data [required]

object

Opsgenie service data from a response.

attributes [required]

object

The attributes from an Opsgenie service response.

custom_url

string

The custom URL for a custom region.

name

string

The name for the Opsgenie service.

region

enum

The region for the Opsgenie service. Allowed enum values: us,eu,custom

id [required]

string

The ID of the Opsgenie service.

type [required]

enum

Opsgenie service resource type. Allowed enum values: opsgenie-service

default: opsgenie-service

{
  "data": {
    "attributes": {
      "custom_url": null,
      "name": "fake-opsgenie-service-name",
      "region": "us"
    },
    "id": "596da4af-0563-4097-90ff-07230c3f9db3",
    "type": "opsgenie-service"
  }
}

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"
  ]
}

Conflict

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"
  ]
}

코드 사례

"""
Create a new service object returns "CREATED" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.opsgenie_integration_api import OpsgenieIntegrationApi
from datadog_api_client.v2.model.opsgenie_service_create_attributes import OpsgenieServiceCreateAttributes
from datadog_api_client.v2.model.opsgenie_service_create_data import OpsgenieServiceCreateData
from datadog_api_client.v2.model.opsgenie_service_create_request import OpsgenieServiceCreateRequest
from datadog_api_client.v2.model.opsgenie_service_region_type import OpsgenieServiceRegionType
from datadog_api_client.v2.model.opsgenie_service_type import OpsgenieServiceType

body = OpsgenieServiceCreateRequest(
    data=OpsgenieServiceCreateData(
        attributes=OpsgenieServiceCreateAttributes(
            name="Example-Opsgenie-Integration",
            opsgenie_api_key="00000000-0000-0000-0000-000000000000",
            region=OpsgenieServiceRegionType.US,
        ),
        type=OpsgenieServiceType.OPSGENIE_SERVICE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = OpsgenieIntegrationApi(api_client)
    response = api_instance.create_opsgenie_service(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"

GET https://api.ap1.datadoghq.com/api/v2/integration/opsgenie/services/{integration_service_id}https://api.datadoghq.eu/api/v2/integration/opsgenie/services/{integration_service_id}https://api.ddog-gov.com/api/v2/integration/opsgenie/services/{integration_service_id}https://api.datadoghq.com/api/v2/integration/opsgenie/services/{integration_service_id}https://api.us3.datadoghq.com/api/v2/integration/opsgenie/services/{integration_service_id}https://api.us5.datadoghq.com/api/v2/integration/opsgenie/services/{integration_service_id}

개요

Get a single service from the Datadog Opsgenie integration. This endpoint requires the integrations_read permission.

인수

경로 파라미터

이름

유형

설명

integration_service_id [required]

string

The UUID of the service.

응답

OK

Response of an Opsgenie service.

Expand All

항목

유형

설명

data [required]

object

Opsgenie service data from a response.

attributes [required]

object

The attributes from an Opsgenie service response.

custom_url

string

The custom URL for a custom region.

name

string

The name for the Opsgenie service.

region

enum

The region for the Opsgenie service. Allowed enum values: us,eu,custom

id [required]

string

The ID of the Opsgenie service.

type [required]

enum

Opsgenie service resource type. Allowed enum values: opsgenie-service

default: opsgenie-service

{
  "data": {
    "attributes": {
      "custom_url": null,
      "name": "fake-opsgenie-service-name",
      "region": "us"
    },
    "id": "596da4af-0563-4097-90ff-07230c3f9db3",
    "type": "opsgenie-service"
  }
}

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"
  ]
}

Conflict

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"
  ]
}

코드 사례

"""
Get a single service object returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.opsgenie_integration_api import OpsgenieIntegrationApi

# there is a valid "opsgenie_service" in the system
OPSGENIE_SERVICE_DATA_ID = environ["OPSGENIE_SERVICE_DATA_ID"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = OpsgenieIntegrationApi(api_client)
    response = api_instance.get_opsgenie_service(
        integration_service_id=OPSGENIE_SERVICE_DATA_ID,
    )

    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"

PATCH https://api.ap1.datadoghq.com/api/v2/integration/opsgenie/services/{integration_service_id}https://api.datadoghq.eu/api/v2/integration/opsgenie/services/{integration_service_id}https://api.ddog-gov.com/api/v2/integration/opsgenie/services/{integration_service_id}https://api.datadoghq.com/api/v2/integration/opsgenie/services/{integration_service_id}https://api.us3.datadoghq.com/api/v2/integration/opsgenie/services/{integration_service_id}https://api.us5.datadoghq.com/api/v2/integration/opsgenie/services/{integration_service_id}

개요

Update a single service object in the Datadog Opsgenie integration. This endpoint requires the manage_integrations permission.

인수

경로 파라미터

이름

유형

설명

integration_service_id [required]

string

The UUID of the service.

요청

Body Data (required)

Opsgenie service payload.

Expand All

항목

유형

설명

data [required]

object

Opsgenie service for an update request.

attributes [required]

object

The Opsgenie service attributes for an update request.

custom_url

string

The custom URL for a custom region.

name

string

The name for the Opsgenie service.

opsgenie_api_key

string

The Opsgenie API key for your Opsgenie service.

region

enum

The region for the Opsgenie service. Allowed enum values: us,eu,custom

id [required]

string

The ID of the Opsgenie service.

type [required]

enum

Opsgenie service resource type. Allowed enum values: opsgenie-service

default: opsgenie-service

{
  "data": {
    "attributes": {
      "name": "fake-opsgenie-service-name--updated",
      "opsgenie_api_key": "00000000-0000-0000-0000-000000000000",
      "region": "eu"
    },
    "id": "596da4af-0563-4097-90ff-07230c3f9db3",
    "type": "opsgenie-service"
  }
}

응답

OK

Response of an Opsgenie service.

Expand All

항목

유형

설명

data [required]

object

Opsgenie service data from a response.

attributes [required]

object

The attributes from an Opsgenie service response.

custom_url

string

The custom URL for a custom region.

name

string

The name for the Opsgenie service.

region

enum

The region for the Opsgenie service. Allowed enum values: us,eu,custom

id [required]

string

The ID of the Opsgenie service.

type [required]

enum

Opsgenie service resource type. Allowed enum values: opsgenie-service

default: opsgenie-service

{
  "data": {
    "attributes": {
      "custom_url": null,
      "name": "fake-opsgenie-service-name",
      "region": "us"
    },
    "id": "596da4af-0563-4097-90ff-07230c3f9db3",
    "type": "opsgenie-service"
  }
}

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"
  ]
}

Conflict

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"
  ]
}

코드 사례

"""
Update a single service object returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.opsgenie_integration_api import OpsgenieIntegrationApi
from datadog_api_client.v2.model.opsgenie_service_region_type import OpsgenieServiceRegionType
from datadog_api_client.v2.model.opsgenie_service_type import OpsgenieServiceType
from datadog_api_client.v2.model.opsgenie_service_update_attributes import OpsgenieServiceUpdateAttributes
from datadog_api_client.v2.model.opsgenie_service_update_data import OpsgenieServiceUpdateData
from datadog_api_client.v2.model.opsgenie_service_update_request import OpsgenieServiceUpdateRequest

# there is a valid "opsgenie_service" in the system
OPSGENIE_SERVICE_DATA_ATTRIBUTES_NAME = environ["OPSGENIE_SERVICE_DATA_ATTRIBUTES_NAME"]
OPSGENIE_SERVICE_DATA_ID = environ["OPSGENIE_SERVICE_DATA_ID"]

body = OpsgenieServiceUpdateRequest(
    data=OpsgenieServiceUpdateData(
        attributes=OpsgenieServiceUpdateAttributes(
            name="fake-opsgenie-service-name--updated",
            opsgenie_api_key="00000000-0000-0000-0000-000000000000",
            region=OpsgenieServiceRegionType.EU,
        ),
        id=OPSGENIE_SERVICE_DATA_ID,
        type=OpsgenieServiceType.OPSGENIE_SERVICE,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = OpsgenieIntegrationApi(api_client)
    response = api_instance.update_opsgenie_service(integration_service_id=OPSGENIE_SERVICE_DATA_ID, 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"

DELETE https://api.ap1.datadoghq.com/api/v2/integration/opsgenie/services/{integration_service_id}https://api.datadoghq.eu/api/v2/integration/opsgenie/services/{integration_service_id}https://api.ddog-gov.com/api/v2/integration/opsgenie/services/{integration_service_id}https://api.datadoghq.com/api/v2/integration/opsgenie/services/{integration_service_id}https://api.us3.datadoghq.com/api/v2/integration/opsgenie/services/{integration_service_id}https://api.us5.datadoghq.com/api/v2/integration/opsgenie/services/{integration_service_id}

개요

Delete a single service object in the Datadog Opsgenie integration. This endpoint requires the manage_integrations permission.

인수

경로 파라미터

이름

유형

설명

integration_service_id [required]

string

The UUID of the service.

응답

OK

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"
  ]
}

코드 사례

"""
Delete a single service object returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.opsgenie_integration_api import OpsgenieIntegrationApi

# there is a valid "opsgenie_service" in the system
OPSGENIE_SERVICE_DATA_ID = environ["OPSGENIE_SERVICE_DATA_ID"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = OpsgenieIntegrationApi(api_client)
    api_instance.delete_opsgenie_service(
        integration_service_id=OPSGENIE_SERVICE_DATA_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"

PREVIEWING: dgreen15/github-error-fix
Your Privacy Choices