Skip to content

Commit 903265d

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

20 files changed

+1954
-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:21.094407",
8-
"spec_repo_commit": "e591d5d4"
7+
"regenerated": "2025-06-06 17:43:35.331372",
8+
"spec_repo_commit": "01341d5b"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-06 14:53:21.112774",
13-
"spec_repo_commit": "e591d5d4"
12+
"regenerated": "2025-06-06 17:43:35.348469",
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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Delete a single kind returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_software_catalog::SoftwareCatalogAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
let configuration = datadog::Configuration::new();
8+
let api = SoftwareCatalogAPI::with_config(configuration);
9+
let resp = api.delete_catalog_kind("my-job".to_string()).await;
10+
if let Ok(value) = resp {
11+
println!("{:#?}", value);
12+
} else {
13+
println!("{:#?}", resp.unwrap_err());
14+
}
15+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Get a list of entity kinds returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_software_catalog::ListCatalogKindOptionalParams;
4+
use datadog_api_client::datadogV2::api_software_catalog::SoftwareCatalogAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let configuration = datadog::Configuration::new();
9+
let api = SoftwareCatalogAPI::with_config(configuration);
10+
let resp = api
11+
.list_catalog_kind(ListCatalogKindOptionalParams::default())
12+
.await;
13+
if let Ok(value) = resp {
14+
println!("{:#?}", value);
15+
} else {
16+
println!("{:#?}", resp.unwrap_err());
17+
}
18+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Get a list of entity kinds returns "OK" response with pagination
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_software_catalog::ListCatalogKindOptionalParams;
4+
use datadog_api_client::datadogV2::api_software_catalog::SoftwareCatalogAPI;
5+
use futures_util::pin_mut;
6+
use futures_util::stream::StreamExt;
7+
8+
#[tokio::main]
9+
async fn main() {
10+
let configuration = datadog::Configuration::new();
11+
let api = SoftwareCatalogAPI::with_config(configuration);
12+
let response = api.list_catalog_kind_with_pagination(ListCatalogKindOptionalParams::default());
13+
pin_mut!(response);
14+
while let Some(resp) = response.next().await {
15+
if let Ok(value) = resp {
16+
println!("{:#?}", value);
17+
} else {
18+
println!("{:#?}", resp.unwrap_err());
19+
}
20+
}
21+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Create or update kinds returns "ACCEPTED" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_software_catalog::SoftwareCatalogAPI;
4+
use datadog_api_client::datadogV2::model::KindObj;
5+
use datadog_api_client::datadogV2::model::UpsertCatalogKindRequest;
6+
7+
#[tokio::main]
8+
async fn main() {
9+
let body = UpsertCatalogKindRequest::KindObj(Box::new(KindObj::new("my-job".to_string())));
10+
let configuration = datadog::Configuration::new();
11+
let api = SoftwareCatalogAPI::with_config(configuration);
12+
let resp = api.upsert_catalog_kind(body).await;
13+
if let Ok(value) = resp {
14+
println!("{:#?}", value);
15+
} else {
16+
println!("{:#?}", resp.unwrap_err());
17+
}
18+
}

0 commit comments

Comments
 (0)