Skip to content

Commit 5a2b1fb

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add new endpoint to upsert/list/delete custom kinds (#2311)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent cc0bd4d commit 5a2b1fb

21 files changed

+1381
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-06-06 14:53:28.796747",
8-
"spec_repo_commit": "e591d5d4"
7+
"regenerated": "2025-06-06 17:43:43.689332",
8+
"spec_repo_commit": "01341d5b"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-06 14:53:28.812809",
13-
"spec_repo_commit": "e591d5d4"
12+
"regenerated": "2025-06-06 17:43:43.707291",
13+
"spec_repo_commit": "01341d5b"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,14 @@ components:
563563
required: true
564564
schema:
565565
type: string
566+
KindID:
567+
description: Entity kind.
568+
in: path
569+
name: kind_id
570+
required: true
571+
schema:
572+
example: my-job
573+
type: string
566574
MetricID:
567575
description: The name of the log-based metric.
568576
in: path
@@ -19303,6 +19311,90 @@ components:
1930319311
- index
1930419312
- caseIndex
1930519313
type: object
19314+
KindAttributes:
19315+
description: Kind attributes.
19316+
properties:
19317+
description:
19318+
description: Short description of the kind.
19319+
type: string
19320+
displayName:
19321+
description: User friendly name of the kind.
19322+
type: string
19323+
name:
19324+
description: The kind name.
19325+
example: my-job
19326+
minLength: 1
19327+
type: string
19328+
type: object
19329+
KindData:
19330+
description: Schema that defines the structure of a Kind object in the Software
19331+
Catalog.
19332+
properties:
19333+
attributes:
19334+
$ref: '#/components/schemas/KindAttributes'
19335+
id:
19336+
description: A read-only globally unique identifier for the entity generated
19337+
by Datadog. User supplied values are ignored.
19338+
example: 4b163705-23c0-4573-b2fb-f6cea2163fcb
19339+
minLength: 1
19340+
type: string
19341+
meta:
19342+
$ref: '#/components/schemas/KindMetadata'
19343+
type:
19344+
description: Kind.
19345+
type: string
19346+
type: object
19347+
KindMetadata:
19348+
description: Kind metadata.
19349+
properties:
19350+
createdAt:
19351+
description: The creation time.
19352+
type: string
19353+
modifiedAt:
19354+
description: The modification time.
19355+
type: string
19356+
type: object
19357+
KindObj:
19358+
description: Schema for kind.
19359+
properties:
19360+
description:
19361+
description: Short description of the kind.
19362+
type: string
19363+
displayName:
19364+
description: The display name of the kind. Automatically generated if not
19365+
provided.
19366+
type: string
19367+
kind:
19368+
description: The name of the kind to create or update. This must be in kebab-case
19369+
format.
19370+
example: my-job
19371+
type: string
19372+
required:
19373+
- kind
19374+
type: object
19375+
KindRaw:
19376+
description: Kind definition in raw JSON or YAML representation.
19377+
example: 'kind: service
19378+
19379+
displayName: Service
19380+
19381+
description: A service entity in the catalog.
19382+
19383+
'
19384+
type: string
19385+
KindResponseData:
19386+
description: List of kind responses.
19387+
items:
19388+
$ref: '#/components/schemas/KindData'
19389+
type: array
19390+
KindResponseMeta:
19391+
description: Kind response metadata.
19392+
properties:
19393+
count:
19394+
description: Total kinds count.
19395+
format: int64
19396+
type: integer
19397+
type: object
1930619398
Layer:
1930719399
description: Encapsulates a layer resource, holding attributes like rotation
1930819400
details, plus relationships to the members covering that layer.
@@ -19789,6 +19881,14 @@ components:
1978919881
meta:
1979019882
$ref: '#/components/schemas/HistoricalJobListMeta'
1979119883
type: object
19884+
ListKindCatalogResponse:
19885+
description: List kind response.
19886+
properties:
19887+
data:
19888+
$ref: '#/components/schemas/KindResponseData'
19889+
meta:
19890+
$ref: '#/components/schemas/KindResponseMeta'
19891+
type: object
1979219892
ListPipelinesResponse:
1979319893
description: Represents the response payload containing a list of pipelines
1979419894
and associated metadata.
@@ -39531,6 +39631,19 @@ components:
3953139631
description: Upsert entity response included item.
3953239632
oneOf:
3953339633
- $ref: '#/components/schemas/EntityResponseIncludedSchema'
39634+
UpsertCatalogKindRequest:
39635+
description: Create or update kind request.
39636+
oneOf:
39637+
- $ref: '#/components/schemas/KindObj'
39638+
- $ref: '#/components/schemas/KindRaw'
39639+
UpsertCatalogKindResponse:
39640+
description: Upsert kind response.
39641+
properties:
39642+
data:
39643+
$ref: '#/components/schemas/KindResponseData'
39644+
meta:
39645+
$ref: '#/components/schemas/KindResponseMeta'
39646+
type: object
3953439647
Urgency:
3953539648
description: Specifies the level of urgency for a routing rule (low, high, or
3953639649
dynamic).
@@ -43768,6 +43881,105 @@ paths:
4376843881
summary: Delete a single entity
4376943882
tags:
4377043883
- Software Catalog
43884+
/api/v2/catalog/kind:
43885+
get:
43886+
description: Get a list of entity kinds from Software Catalog.
43887+
operationId: ListCatalogKind
43888+
parameters:
43889+
- $ref: '#/components/parameters/PageOffset'
43890+
- description: Maximum number of kinds in the response.
43891+
example: 100
43892+
in: query
43893+
name: page[limit]
43894+
required: false
43895+
schema:
43896+
default: 100
43897+
format: int64
43898+
type: integer
43899+
- $ref: '#/components/parameters/FilterByID'
43900+
- $ref: '#/components/parameters/FilterByName'
43901+
responses:
43902+
'200':
43903+
content:
43904+
application/json:
43905+
schema:
43906+
$ref: '#/components/schemas/ListKindCatalogResponse'
43907+
description: OK
43908+
'400':
43909+
$ref: '#/components/responses/BadRequestResponse'
43910+
'403':
43911+
$ref: '#/components/responses/ForbiddenResponse'
43912+
'429':
43913+
$ref: '#/components/responses/TooManyRequestsResponse'
43914+
security:
43915+
- apiKeyAuth: []
43916+
appKeyAuth: []
43917+
- AuthZ:
43918+
- apm_service_catalog_read
43919+
summary: Get a list of entity kinds
43920+
tags:
43921+
- Software Catalog
43922+
x-pagination:
43923+
limitParam: page[limit]
43924+
pageOffsetParam: page[offset]
43925+
resultsPath: data
43926+
post:
43927+
description: Create or update kinds in Software Catalog.
43928+
operationId: UpsertCatalogKind
43929+
requestBody:
43930+
content:
43931+
application/json:
43932+
schema:
43933+
$ref: '#/components/schemas/UpsertCatalogKindRequest'
43934+
description: Kind YAML or JSON.
43935+
required: true
43936+
responses:
43937+
'202':
43938+
content:
43939+
application/json:
43940+
schema:
43941+
$ref: '#/components/schemas/UpsertCatalogKindResponse'
43942+
description: ACCEPTED
43943+
'400':
43944+
$ref: '#/components/responses/BadRequestResponse'
43945+
'403':
43946+
$ref: '#/components/responses/ForbiddenResponse'
43947+
'429':
43948+
$ref: '#/components/responses/TooManyRequestsResponse'
43949+
security:
43950+
- apiKeyAuth: []
43951+
appKeyAuth: []
43952+
- AuthZ:
43953+
- apm_service_catalog_write
43954+
summary: Create or update kinds
43955+
tags:
43956+
- Software Catalog
43957+
x-codegen-request-body-name: body
43958+
/api/v2/catalog/kind/{kind_id}:
43959+
delete:
43960+
description: Delete a single kind in Software Catalog.
43961+
operationId: DeleteCatalogKind
43962+
parameters:
43963+
- $ref: '#/components/parameters/KindID'
43964+
responses:
43965+
'204':
43966+
description: OK
43967+
'400':
43968+
$ref: '#/components/responses/BadRequestResponse'
43969+
'403':
43970+
$ref: '#/components/responses/ForbiddenResponse'
43971+
'404':
43972+
$ref: '#/components/responses/NotFoundResponse'
43973+
'429':
43974+
$ref: '#/components/responses/TooManyRequestsResponse'
43975+
security:
43976+
- apiKeyAuth: []
43977+
appKeyAuth: []
43978+
- AuthZ:
43979+
- apm_service_catalog_write
43980+
summary: Delete a single kind
43981+
tags:
43982+
- Software Catalog
4377143983
/api/v2/catalog/relation:
4377243984
get:
4377343985
description: Get a list of entity relations from Software Catalog.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Delete a single kind returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.SoftwareCatalogApi(configuration);
9+
10+
const params: v2.SoftwareCatalogApiDeleteCatalogKindRequest = {
11+
kindId: "my-job",
12+
};
13+
14+
apiInstance
15+
.deleteCatalogKind(params)
16+
.then((data: any) => {
17+
console.log(
18+
"API called successfully. Returned data: " + JSON.stringify(data)
19+
);
20+
})
21+
.catch((error: any) => console.error(error));
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Get a list of entity kinds returns "OK" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.SoftwareCatalogApi(configuration);
9+
10+
apiInstance
11+
.listCatalogKind()
12+
.then((data: v2.ListKindCatalogResponse) => {
13+
console.log(
14+
"API called successfully. Returned data: " + JSON.stringify(data)
15+
);
16+
})
17+
.catch((error: any) => console.error(error));
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Get a list of entity kinds returns "OK" response with pagination
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.SoftwareCatalogApi(configuration);
9+
10+
(async () => {
11+
try {
12+
for await (const item of apiInstance.listCatalogKindWithPagination()) {
13+
console.log(item);
14+
}
15+
} catch (error) {
16+
console.error(error);
17+
}
18+
})();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Create or update kinds returns "ACCEPTED" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.SoftwareCatalogApi(configuration);
9+
10+
const params: v2.SoftwareCatalogApiUpsertCatalogKindRequest = {
11+
body: {
12+
kind: "my-job",
13+
},
14+
};
15+
16+
apiInstance
17+
.upsertCatalogKind(params)
18+
.then((data: v2.UpsertCatalogKindResponse) => {
19+
console.log(
20+
"API called successfully. Returned data: " + JSON.stringify(data)
21+
);
22+
})
23+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3097,6 +3097,39 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
30973097
},
30983098
"operationResponseType": "void",
30993099
},
3100+
"v2.ListCatalogKind": {
3101+
"pageOffset": {
3102+
"type": "number",
3103+
"format": "int64",
3104+
},
3105+
"pageLimit": {
3106+
"type": "number",
3107+
"format": "int64",
3108+
},
3109+
"filterId": {
3110+
"type": "string",
3111+
"format": "",
3112+
},
3113+
"filterName": {
3114+
"type": "string",
3115+
"format": "",
3116+
},
3117+
"operationResponseType": "ListKindCatalogResponse",
3118+
},
3119+
"v2.UpsertCatalogKind": {
3120+
"body": {
3121+
"type": "UpsertCatalogKindRequest",
3122+
"format": "",
3123+
},
3124+
"operationResponseType": "UpsertCatalogKindResponse",
3125+
},
3126+
"v2.DeleteCatalogKind": {
3127+
"kindId": {
3128+
"type": "string",
3129+
"format": "",
3130+
},
3131+
"operationResponseType": "void",
3132+
},
31003133
"v2.ListCatalogRelation": {
31013134
"pageOffset": {
31023135
"type": "number",

0 commit comments

Comments
 (0)