Skip to main content

apis

Creates, updates, deletes, gets or lists an apis resource.

Overview

Nameapis
TypeResource
Iddatadog.catalog.apis

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uuid)API identifier. (example: 90646597-5fdb-4a17-a240-647003f8c028)
attributesobjectAttributes for ListAPIsResponseData.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_apisselectregionquery, page[limit], page[offset]List APIs and their IDs.
create_open_apiinsertregionCreate a new API from the OpenAPI specification given.
See the API Catalog documentation for additional
information about the possible metadata.
It returns the created API ID.
update_open_apireplaceid, regionUpdate information about a specific API. The given content will replace all API content of the given ID.
The ID is returned by the create API, or can be found in the URL in the API catalog UI.
delete_open_apideleteid, regionDelete a specific API by ID.
get_open_apiexecid, regionRetrieve information about a specific API in OpenAPI format file.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
idstring (uuid)ID of the API to retrieve
regionstring(default: datadoghq.com)
page[limit]integer (int64)Number of items per page.
page[offset]integer (int64)Offset for pagination.
querystringFilter APIs by name

SELECT examples

List APIs and their IDs.

SELECT
id,
attributes
FROM datadog.catalog.apis
WHERE region = '{{ region }}' -- required
AND query = '{{ query }}'
AND page[limit] = '{{ page[limit] }}'
AND page[offset] = '{{ page[offset] }}'
;

INSERT examples

Create a new API from the OpenAPI specification given.
See the API Catalog documentation for additional
information about the possible metadata.
It returns the created API ID.

INSERT INTO datadog.catalog.apis (
data__openapi_spec_file,
region
)
SELECT
'{{ openapi_spec_file }}',
'{{ region }}'
RETURNING
data
;

REPLACE examples

Update information about a specific API. The given content will replace all API content of the given ID.
The ID is returned by the create API, or can be found in the URL in the API catalog UI.

REPLACE datadog.catalog.apis
SET
data__openapi_spec_file = '{{ openapi_spec_file }}'
WHERE
id = '{{ id }}' --required
AND region = '{{ region }}' --required
RETURNING
data;

DELETE examples

Delete a specific API by ID.

DELETE FROM datadog.catalog.apis
WHERE id = '{{ id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Retrieve information about a specific API in OpenAPI format file.

EXEC datadog.catalog.apis.get_open_api 
@id='{{ id }}' --required,
@region='{{ region }}' --required
;