Intégration PagerDuty

Configurez votre intégration Datadog/PagerDuty directement via l’API Datadog.

POST https://api.ap1.datadoghq.com/api/v1/integration/pagerduty/configuration/serviceshttps://api.datadoghq.eu/api/v1/integration/pagerduty/configuration/serviceshttps://api.ddog-gov.com/api/v1/integration/pagerduty/configuration/serviceshttps://api.datadoghq.com/api/v1/integration/pagerduty/configuration/serviceshttps://api.us3.datadoghq.com/api/v1/integration/pagerduty/configuration/serviceshttps://api.us5.datadoghq.com/api/v1/integration/pagerduty/configuration/services

Présentation

Créez un objet de service dans l’intégration PagerDuty. This endpoint requires the manage_integrations permission.

Requête

Body Data (required)

Corps de requête pour la création d’un objet de service.

Expand All

Champ

Type

Description

service_key [required]

string

Your service key in PagerDuty.

service_name [required]

string

Your service name associated with a service key in PagerDuty.

{
  "service_key": "",
  "service_name": ""
}

Réponse

OK

PagerDuty service object name.

Expand All

Champ

Type

Description

service_name [required]

string

Your service name associated service key in PagerDuty.

{
  "service_name": ""
}

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

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

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.pager_duty_integration_api import PagerDutyIntegrationApi
from datadog_api_client.v1.model.pager_duty_service import PagerDutyService

body = PagerDutyService(
    service_key="",
    service_name="",
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = PagerDutyIntegrationApi(api_client)
    response = api_instance.create_pager_duty_integration_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/v1/integration/pagerduty/configuration/services/{service_name}https://api.datadoghq.eu/api/v1/integration/pagerduty/configuration/services/{service_name}https://api.ddog-gov.com/api/v1/integration/pagerduty/configuration/services/{service_name}https://api.datadoghq.com/api/v1/integration/pagerduty/configuration/services/{service_name}https://api.us3.datadoghq.com/api/v1/integration/pagerduty/configuration/services/{service_name}https://api.us5.datadoghq.com/api/v1/integration/pagerduty/configuration/services/{service_name}

Présentation

Récupérez un nom de service dans l’intégration Datadog/PagerDuty. This endpoint requires the integrations_read permission.

Arguments

Paramètres du chemin

Nom

Type

Description

service_name [required]

string

The service name.

Réponse

OK

PagerDuty service object name.

Expand All

Champ

Type

Description

service_name [required]

string

Your service name associated service key in PagerDuty.

{
  "service_name": ""
}

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

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

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.pager_duty_integration_api import PagerDutyIntegrationApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = PagerDutyIntegrationApi(api_client)
    response = api_instance.get_pager_duty_integration_service(
        service_name="service_name",
    )

    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"

PUT https://api.ap1.datadoghq.com/api/v1/integration/pagerduty/configuration/services/{service_name}https://api.datadoghq.eu/api/v1/integration/pagerduty/configuration/services/{service_name}https://api.ddog-gov.com/api/v1/integration/pagerduty/configuration/services/{service_name}https://api.datadoghq.com/api/v1/integration/pagerduty/configuration/services/{service_name}https://api.us3.datadoghq.com/api/v1/integration/pagerduty/configuration/services/{service_name}https://api.us5.datadoghq.com/api/v1/integration/pagerduty/configuration/services/{service_name}

Présentation

Mettez à jour un objet de service unique dans l’intégration Datadog/PagerDuty. This endpoint requires the manage_integrations permission.

Arguments

Paramètres du chemin

Nom

Type

Description

service_name [required]

string

The service name

Requête

Body Data (required)

Corps de requête pour la mise à jour d’un objet de service existant.

Expand All

Champ

Type

Description

service_key [required]

string

Your service key in PagerDuty.

{
  "service_key": ""
}

Réponse

OK

Bad Request

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

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

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.pager_duty_integration_api import PagerDutyIntegrationApi
from datadog_api_client.v1.model.pager_duty_service_key import PagerDutyServiceKey

body = PagerDutyServiceKey(
    service_key="",
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = PagerDutyIntegrationApi(api_client)
    api_instance.update_pager_duty_integration_service(service_name="service_name", body=body)

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/v1/integration/pagerduty/configuration/services/{service_name}https://api.datadoghq.eu/api/v1/integration/pagerduty/configuration/services/{service_name}https://api.ddog-gov.com/api/v1/integration/pagerduty/configuration/services/{service_name}https://api.datadoghq.com/api/v1/integration/pagerduty/configuration/services/{service_name}https://api.us3.datadoghq.com/api/v1/integration/pagerduty/configuration/services/{service_name}https://api.us5.datadoghq.com/api/v1/integration/pagerduty/configuration/services/{service_name}

Présentation

Supprimez un objet de service unique dans l’intégration Datadog/PagerDuty. This endpoint requires the manage_integrations permission.

Arguments

Paramètres du chemin

Nom

Type

Description

service_name [required]

string

The service name

Réponse

No Content

Authentication error

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Item Not Found

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

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

Exemple de code

"""
Delete a single service object returns "No Content" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.pager_duty_integration_api import PagerDutyIntegrationApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = PagerDutyIntegrationApi(api_client)
    api_instance.delete_pager_duty_integration_service(
        service_name="service_name",
    )

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: domalessi/remove-preview-labels