This page is not yet available in Spanish. We are working on its translation.
If you have any questions or feedback about our current translation project, feel free to reach out to us!

Fastly Integration

Manage your Datadog Fastly integration accounts and services directly through the Datadog API. See the Fastly integration page for more information.

GET https://api.ap1.datadoghq.com/api/v2/integrations/fastly/accountshttps://api.datadoghq.eu/api/v2/integrations/fastly/accountshttps://api.ddog-gov.com/api/v2/integrations/fastly/accountshttps://api.datadoghq.com/api/v2/integrations/fastly/accountshttps://api.us3.datadoghq.com/api/v2/integrations/fastly/accountshttps://api.us5.datadoghq.com/api/v2/integrations/fastly/accounts

Información general

List Fastly accounts. This endpoint requires the integrations_read permission.

Respuesta

OK

The expected response schema when getting Fastly accounts.

Expand All

Campo

Tipo

Descripción

data

[object]

The JSON:API data schema.

attributes [required]

object

Attributes object of a Fastly account.

name [required]

string

The name of the Fastly account.

services

[object]

A list of services belonging to the parent account.

id [required]

string

The ID of the Fastly service

tags

[string]

A list of tags for the Fastly service.

id [required]

string

The ID of the Fastly account, a hash of the account name.

type [required]

enum

The JSON:API type for this API. Should always be fastly-accounts. Allowed enum values: fastly-accounts

default: fastly-accounts

{
  "data": [
    {
      "attributes": {
        "name": "test-name",
        "services": [
          {
            "id": "6abc7de6893AbcDe9fghIj",
            "tags": [
              "myTag",
              "myTag2:myValue"
            ]
          }
        ]
      },
      "id": "abc123",
      "type": "fastly-accounts"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

"""
List Fastly accounts returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = FastlyIntegrationApi(api_client)
    response = api_instance.list_fastly_accounts()

    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/integrations/fastly/accountshttps://api.datadoghq.eu/api/v2/integrations/fastly/accountshttps://api.ddog-gov.com/api/v2/integrations/fastly/accountshttps://api.datadoghq.com/api/v2/integrations/fastly/accountshttps://api.us3.datadoghq.com/api/v2/integrations/fastly/accountshttps://api.us5.datadoghq.com/api/v2/integrations/fastly/accounts

Información general

Create a Fastly account. This endpoint requires the manage_integrations permission.

Solicitud

Body Data (required)

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object for creating a Fastly account.

attributes [required]

object

Attributes object for creating a Fastly account.

api_key [required]

string

The API key for the Fastly account.

name [required]

string

The name of the Fastly account.

services

[object]

A list of services belonging to the parent account.

id [required]

string

The ID of the Fastly service

tags

[string]

A list of tags for the Fastly service.

type [required]

enum

The JSON:API type for this API. Should always be fastly-accounts. Allowed enum values: fastly-accounts

default: fastly-accounts

{
  "data": {
    "attributes": {
      "api_key": "ExampleFastlyIntegration",
      "name": "Example-Fastly-Integration",
      "services": []
    },
    "type": "fastly-accounts"
  }
}

Respuesta

CREATED

The expected response schema when getting a Fastly account.

Expand All

Campo

Tipo

Descripción

data

object

Data object of a Fastly account.

attributes [required]

object

Attributes object of a Fastly account.

name [required]

string

The name of the Fastly account.

services

[object]

A list of services belonging to the parent account.

id [required]

string

The ID of the Fastly service

tags

[string]

A list of tags for the Fastly service.

id [required]

string

The ID of the Fastly account, a hash of the account name.

type [required]

enum

The JSON:API type for this API. Should always be fastly-accounts. Allowed enum values: fastly-accounts

default: fastly-accounts

{
  "data": {
    "attributes": {
      "name": "test-name",
      "services": [
        {
          "id": "6abc7de6893AbcDe9fghIj",
          "tags": [
            "myTag",
            "myTag2:myValue"
          ]
        }
      ]
    },
    "id": "abc123",
    "type": "fastly-accounts"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

"""
Add Fastly account returns "CREATED" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi
from datadog_api_client.v2.model.fastly_account_create_request import FastlyAccountCreateRequest
from datadog_api_client.v2.model.fastly_account_create_request_attributes import FastlyAccountCreateRequestAttributes
from datadog_api_client.v2.model.fastly_account_create_request_data import FastlyAccountCreateRequestData
from datadog_api_client.v2.model.fastly_account_type import FastlyAccountType

body = FastlyAccountCreateRequest(
    data=FastlyAccountCreateRequestData(
        attributes=FastlyAccountCreateRequestAttributes(
            api_key="ExampleFastlyIntegration",
            name="Example-Fastly-Integration",
            services=[],
        ),
        type=FastlyAccountType.FASTLY_ACCOUNTS,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = FastlyIntegrationApi(api_client)
    response = api_instance.create_fastly_account(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/integrations/fastly/accounts/{account_id}https://api.datadoghq.eu/api/v2/integrations/fastly/accounts/{account_id}https://api.ddog-gov.com/api/v2/integrations/fastly/accounts/{account_id}https://api.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}https://api.us3.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}https://api.us5.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}

Información general

Get a Fastly account. This endpoint requires the integrations_read permission.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

account_id [required]

string

Fastly Account id.

Respuesta

OK

The expected response schema when getting a Fastly account.

Expand All

Campo

Tipo

Descripción

data

object

Data object of a Fastly account.

attributes [required]

object

Attributes object of a Fastly account.

name [required]

string

The name of the Fastly account.

services

[object]

A list of services belonging to the parent account.

id [required]

string

The ID of the Fastly service

tags

[string]

A list of tags for the Fastly service.

id [required]

string

The ID of the Fastly account, a hash of the account name.

type [required]

enum

The JSON:API type for this API. Should always be fastly-accounts. Allowed enum values: fastly-accounts

default: fastly-accounts

{
  "data": {
    "attributes": {
      "name": "test-name",
      "services": [
        {
          "id": "6abc7de6893AbcDe9fghIj",
          "tags": [
            "myTag",
            "myTag2:myValue"
          ]
        }
      ]
    },
    "id": "abc123",
    "type": "fastly-accounts"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

"""
Get Fastly account returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi

# there is a valid "fastly_account" in the system
FASTLY_ACCOUNT_DATA_ID = environ["FASTLY_ACCOUNT_DATA_ID"]

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = FastlyIntegrationApi(api_client)
    response = api_instance.get_fastly_account(
        account_id=FASTLY_ACCOUNT_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/integrations/fastly/accounts/{account_id}https://api.datadoghq.eu/api/v2/integrations/fastly/accounts/{account_id}https://api.ddog-gov.com/api/v2/integrations/fastly/accounts/{account_id}https://api.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}https://api.us3.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}https://api.us5.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}

Información general

Update a Fastly account. This endpoint requires the manage_integrations permission.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

account_id [required]

string

Fastly Account id.

Solicitud

Body Data (required)

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object for updating a Fastly account.

attributes

object

Attributes object for updating a Fastly account.

api_key

string

The API key of the Fastly account.

name

string

The name of the Fastly account.

type

enum

The JSON:API type for this API. Should always be fastly-accounts. Allowed enum values: fastly-accounts

default: fastly-accounts

{
  "data": {
    "attributes": {
      "api_key": "update-secret"
    },
    "type": "fastly-accounts"
  }
}

Respuesta

OK

The expected response schema when getting a Fastly account.

Expand All

Campo

Tipo

Descripción

data

object

Data object of a Fastly account.

attributes [required]

object

Attributes object of a Fastly account.

name [required]

string

The name of the Fastly account.

services

[object]

A list of services belonging to the parent account.

id [required]

string

The ID of the Fastly service

tags

[string]

A list of tags for the Fastly service.

id [required]

string

The ID of the Fastly account, a hash of the account name.

type [required]

enum

The JSON:API type for this API. Should always be fastly-accounts. Allowed enum values: fastly-accounts

default: fastly-accounts

{
  "data": {
    "attributes": {
      "name": "test-name",
      "services": [
        {
          "id": "6abc7de6893AbcDe9fghIj",
          "tags": [
            "myTag",
            "myTag2:myValue"
          ]
        }
      ]
    },
    "id": "abc123",
    "type": "fastly-accounts"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

"""
Update Fastly account returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi
from datadog_api_client.v2.model.fastly_account_type import FastlyAccountType
from datadog_api_client.v2.model.fastly_account_update_request import FastlyAccountUpdateRequest
from datadog_api_client.v2.model.fastly_account_update_request_attributes import FastlyAccountUpdateRequestAttributes
from datadog_api_client.v2.model.fastly_account_update_request_data import FastlyAccountUpdateRequestData

# there is a valid "fastly_account" in the system
FASTLY_ACCOUNT_DATA_ID = environ["FASTLY_ACCOUNT_DATA_ID"]

body = FastlyAccountUpdateRequest(
    data=FastlyAccountUpdateRequestData(
        attributes=FastlyAccountUpdateRequestAttributes(
            api_key="update-secret",
        ),
        type=FastlyAccountType.FASTLY_ACCOUNTS,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = FastlyIntegrationApi(api_client)
    response = api_instance.update_fastly_account(account_id=FASTLY_ACCOUNT_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/integrations/fastly/accounts/{account_id}https://api.datadoghq.eu/api/v2/integrations/fastly/accounts/{account_id}https://api.ddog-gov.com/api/v2/integrations/fastly/accounts/{account_id}https://api.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}https://api.us3.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}https://api.us5.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}

Información general

Delete a Fastly account. This endpoint requires the manage_integrations permission.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

account_id [required]

string

Fastly Account id.

Respuesta

OK

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

"""
Delete Fastly account returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = FastlyIntegrationApi(api_client)
    api_instance.delete_fastly_account(
        account_id="account_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"

GET https://api.ap1.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/serviceshttps://api.datadoghq.eu/api/v2/integrations/fastly/accounts/{account_id}/serviceshttps://api.ddog-gov.com/api/v2/integrations/fastly/accounts/{account_id}/serviceshttps://api.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/serviceshttps://api.us3.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/serviceshttps://api.us5.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/services

Información general

List Fastly services for an account. This endpoint requires the integrations_read permission.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

account_id [required]

string

Fastly Account id.

Respuesta

OK

The expected response schema when getting Fastly services.

Expand All

Campo

Tipo

Descripción

data

[object]

The JSON:API data schema.

attributes

object

Attributes object for Fastly service requests.

tags

[string]

A list of tags for the Fastly service.

id [required]

string

The ID of the Fastly service.

type [required]

enum

The JSON:API type for this API. Should always be fastly-services. Allowed enum values: fastly-services

default: fastly-services

{
  "data": [
    {
      "attributes": {
        "tags": [
          "myTag",
          "myTag2:myValue"
        ]
      },
      "id": "abc123",
      "type": "fastly-services"
    }
  ]
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

"""
List Fastly services returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = FastlyIntegrationApi(api_client)
    response = api_instance.list_fastly_services(
        account_id="account_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"

POST https://api.ap1.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/serviceshttps://api.datadoghq.eu/api/v2/integrations/fastly/accounts/{account_id}/serviceshttps://api.ddog-gov.com/api/v2/integrations/fastly/accounts/{account_id}/serviceshttps://api.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/serviceshttps://api.us3.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/serviceshttps://api.us5.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/services

Información general

Create a Fastly service for an account. This endpoint requires the manage_integrations permission.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

account_id [required]

string

Fastly Account id.

Solicitud

Body Data (required)

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object for Fastly service requests.

attributes

object

Attributes object for Fastly service requests.

tags

[string]

A list of tags for the Fastly service.

id [required]

string

The ID of the Fastly service.

type [required]

enum

The JSON:API type for this API. Should always be fastly-services. Allowed enum values: fastly-services

default: fastly-services

{
  "data": {
    "attributes": {
      "tags": [
        "myTag",
        "myTag2:myValue"
      ]
    },
    "id": "abc123",
    "type": "fastly-services"
  }
}

Respuesta

CREATED

The expected response schema when getting a Fastly service.

Expand All

Campo

Tipo

Descripción

data

object

Data object for Fastly service requests.

attributes

object

Attributes object for Fastly service requests.

tags

[string]

A list of tags for the Fastly service.

id [required]

string

The ID of the Fastly service.

type [required]

enum

The JSON:API type for this API. Should always be fastly-services. Allowed enum values: fastly-services

default: fastly-services

{
  "data": {
    "attributes": {
      "tags": [
        "myTag",
        "myTag2:myValue"
      ]
    },
    "id": "abc123",
    "type": "fastly-services"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

"""
Add Fastly service returns "CREATED" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi
from datadog_api_client.v2.model.fastly_service_attributes import FastlyServiceAttributes
from datadog_api_client.v2.model.fastly_service_data import FastlyServiceData
from datadog_api_client.v2.model.fastly_service_request import FastlyServiceRequest
from datadog_api_client.v2.model.fastly_service_type import FastlyServiceType

body = FastlyServiceRequest(
    data=FastlyServiceData(
        attributes=FastlyServiceAttributes(
            tags=[
                "myTag",
                "myTag2:myValue",
            ],
        ),
        id="abc123",
        type=FastlyServiceType.FASTLY_SERVICES,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = FastlyIntegrationApi(api_client)
    response = api_instance.create_fastly_service(account_id="account_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"

GET https://api.ap1.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.datadoghq.eu/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.ddog-gov.com/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.us3.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.us5.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}

Información general

Get a Fastly service for an account. This endpoint requires the integrations_read permission.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

account_id [required]

string

Fastly Account id.

service_id [required]

string

Fastly Service ID.

Respuesta

OK

The expected response schema when getting a Fastly service.

Expand All

Campo

Tipo

Descripción

data

object

Data object for Fastly service requests.

attributes

object

Attributes object for Fastly service requests.

tags

[string]

A list of tags for the Fastly service.

id [required]

string

The ID of the Fastly service.

type [required]

enum

The JSON:API type for this API. Should always be fastly-services. Allowed enum values: fastly-services

default: fastly-services

{
  "data": {
    "attributes": {
      "tags": [
        "myTag",
        "myTag2:myValue"
      ]
    },
    "id": "abc123",
    "type": "fastly-services"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

"""
Get Fastly service returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = FastlyIntegrationApi(api_client)
    response = api_instance.get_fastly_service(
        account_id="account_id",
        service_id="service_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/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.datadoghq.eu/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.ddog-gov.com/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.us3.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.us5.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}

Información general

Update a Fastly service for an account. This endpoint requires the manage_integrations permission.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

account_id [required]

string

Fastly Account id.

service_id [required]

string

Fastly Service ID.

Solicitud

Body Data (required)

Expand All

Campo

Tipo

Descripción

data [required]

object

Data object for Fastly service requests.

attributes

object

Attributes object for Fastly service requests.

tags

[string]

A list of tags for the Fastly service.

id [required]

string

The ID of the Fastly service.

type [required]

enum

The JSON:API type for this API. Should always be fastly-services. Allowed enum values: fastly-services

default: fastly-services

{
  "data": {
    "attributes": {
      "tags": [
        "myTag",
        "myTag2:myValue"
      ]
    },
    "id": "abc123",
    "type": "fastly-services"
  }
}

Respuesta

OK

The expected response schema when getting a Fastly service.

Expand All

Campo

Tipo

Descripción

data

object

Data object for Fastly service requests.

attributes

object

Attributes object for Fastly service requests.

tags

[string]

A list of tags for the Fastly service.

id [required]

string

The ID of the Fastly service.

type [required]

enum

The JSON:API type for this API. Should always be fastly-services. Allowed enum values: fastly-services

default: fastly-services

{
  "data": {
    "attributes": {
      "tags": [
        "myTag",
        "myTag2:myValue"
      ]
    },
    "id": "abc123",
    "type": "fastly-services"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

"""
Update Fastly service returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi
from datadog_api_client.v2.model.fastly_service_attributes import FastlyServiceAttributes
from datadog_api_client.v2.model.fastly_service_data import FastlyServiceData
from datadog_api_client.v2.model.fastly_service_request import FastlyServiceRequest
from datadog_api_client.v2.model.fastly_service_type import FastlyServiceType

body = FastlyServiceRequest(
    data=FastlyServiceData(
        attributes=FastlyServiceAttributes(
            tags=[
                "myTag",
                "myTag2:myValue",
            ],
        ),
        id="abc123",
        type=FastlyServiceType.FASTLY_SERVICES,
    ),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = FastlyIntegrationApi(api_client)
    response = api_instance.update_fastly_service(account_id="account_id", service_id="service_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/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.datadoghq.eu/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.ddog-gov.com/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.us3.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}https://api.us5.datadoghq.com/api/v2/integrations/fastly/accounts/{account_id}/services/{service_id}

Información general

Delete a Fastly service for an account. This endpoint requires the manage_integrations permission.

Argumentos

Parámetros de ruta

Nombre

Tipo

Descripción

account_id [required]

string

Fastly Account id.

service_id [required]

string

Fastly Service ID.

Respuesta

OK

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

"""
Delete Fastly service returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.fastly_integration_api import FastlyIntegrationApi

configuration = Configuration()
with ApiClient(configuration) as api_client:
    api_instance = FastlyIntegrationApi(api_client)
    api_instance.delete_fastly_service(
        account_id="account_id",
        service_id="service_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"