Skip to content

Commit b5a9613

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
[REDHOSTS-612] Update Tags API Documentation (#3097)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 4ecf6d2 commit b5a9613

7 files changed

Lines changed: 63 additions & 61 deletions

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4219,14 +4219,14 @@ components:
42194219
type: boolean
42204220
type: object
42214221
HostTags:
4222-
description: Set of tags to associate with your host.
4222+
description: Host name and an array of its tags
42234223
properties:
42244224
host:
42254225
description: Your host name.
42264226
example: test.host
42274227
type: string
42284228
tags:
4229-
description: A list of tags to apply to the host.
4229+
description: A list of tags associated with a host.
42304230
items:
42314231
description: A given tag in a list.
42324232
example: environment:production
@@ -18972,18 +18972,18 @@ components:
1897218972
- match
1897318973
type: object
1897418974
TagToHosts:
18975-
description: In this object, the key is the tag, the value is a list of host
18976-
names that are reporting that tag.
18975+
description: In this object, the key is the tag, and the value is a list of
18976+
host names that are reporting that tag.
1897718977
properties:
1897818978
tags:
1897918979
additionalProperties:
18980-
description: A list of additional properties for tags.
18980+
description: A list of host names which contain this tag
1898118981
items:
1898218982
description: A given tag in a list.
1898318983
example: test.metric.host
1898418984
type: string
1898518985
type: array
18986-
description: A list of tags to apply to the host.
18986+
description: A mapping of tags to host names
1898718987
type: object
1898818988
type: object
1898918989
TargetFormatType:
@@ -36008,11 +36008,13 @@ paths:
3600836008
- synthetics_global_variable_write
3600936009
/api/v1/tags/hosts:
3601036010
get:
36011-
description: Return a mapping of tags to hosts for your whole infrastructure.
36011+
description: Returns a mapping of tags to hosts. For each tag, the response
36012+
returns a list of host names that contain this tag. There is a restriction
36013+
of 10k total host names from the org that can be attached to tags and returned.
3601236014
operationId: ListHostTags
3601336015
parameters:
36014-
- description: When specified, filters host list to those tags with the specified
36015-
source.
36016+
- description: Source to filter. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).
36017+
Use "user" source for custom-defined tags.
3601636018
in: query
3601736019
name: source
3601836020
required: false
@@ -36043,29 +36045,29 @@ paths:
3604336045
- apiKeyAuth: []
3604436046
appKeyAuth: []
3604536047
- AuthZ: []
36046-
summary: Get Tags
36048+
summary: Get All Host Tags
3604736049
tags:
3604836050
- Tags
3604936051
x-permission:
3605036052
operator: OPEN
3605136053
permissions: []
3605236054
/api/v1/tags/hosts/{host_name}:
3605336055
delete:
36054-
description: 'This endpoint allows you to remove all user-assigned tags
36056+
description: 'This endpoint allows you to remove all tags
3605536057

36056-
for a single host.'
36058+
for a single host. If no source is specified, only deletes from the source
36059+
"User".'
3605736060
operationId: DeleteHostTags
3605836061
parameters:
36059-
- description: This endpoint allows you to remove all user-assigned tags for
36060-
a single host.
36062+
- description: Specified host name to delete tags
3606136063
in: path
3606236064
name: host_name
3606336065
required: true
3606436066
schema:
3606536067
type: string
36066-
- description: 'The source of the tags (for example chef, puppet).
36067-
36068-
[Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).'
36068+
- description: Source of the tags to be deleted. [Complete list of source attribute
36069+
values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).
36070+
Use "user" source for custom-defined tags.
3606936071
in: query
3607036072
name: source
3607136073
required: false
@@ -36095,14 +36097,14 @@ paths:
3609536097
description: Return the list of tags that apply to a given host.
3609636098
operationId: GetHostTags
3609736099
parameters:
36098-
- description: When specified, filters list of tags to those tags with the specified
36099-
source.
36100+
- description: Name of the host to retrieve tags for
3610036101
in: path
3610136102
name: host_name
3610236103
required: true
3610336104
schema:
3610436105
type: string
36105-
- description: Source to filter.
36106+
- description: Source to filter. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).
36107+
Use "user" source for custom-defined tags.
3610636108
in: query
3610736109
name: source
3610836110
required: false
@@ -36129,25 +36131,25 @@ paths:
3612936131
description: Not Found
3613036132
'429':
3613136133
$ref: '#/components/responses/TooManyRequestsResponse'
36132-
summary: Get host tags
36134+
summary: Get Host Tags
3613336135
tags:
3613436136
- Tags
3613536137
post:
3613636138
description: 'This endpoint allows you to add new tags to a host,
3613736139

36138-
optionally specifying where these tags come from.'
36140+
optionally specifying what source these tags come from. If tags already exist,
36141+
appends new tags to the tag list. If no source is specified, defaults to "user".'
3613936142
operationId: CreateHostTags
3614036143
parameters:
36141-
- description: This endpoint allows you to add new tags to a host, optionally
36142-
specifying where the tags came from.
36144+
- description: Specified host name to add new tags
3614336145
in: path
3614436146
name: host_name
3614536147
required: true
3614636148
schema:
3614736149
type: string
36148-
- description: 'The source of the tags.
36149-
36150-
[Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).'
36150+
- description: Source to add tags. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).
36151+
Use "user" source for custom-defined tags. If no source is specified, defaults
36152+
to "user".
3615136153
example: chef
3615236154
in: query
3615336155
name: source
@@ -36192,16 +36194,15 @@ paths:
3619236194
an integration source with those supplied in the request.'
3619336195
operationId: UpdateHostTags
3619436196
parameters:
36195-
- description: This endpoint allows you to update/replace all in an integration
36196-
source with those supplied in the request.
36197+
- description: Specified host name to change tags
3619736198
in: path
3619836199
name: host_name
3619936200
required: true
3620036201
schema:
3620136202
type: string
36202-
- description: 'The source of the tags (for example chef, puppet).
36203-
36204-
[Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value)'
36203+
- description: Source to update tags. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).
36204+
Use "user" source for custom-defined tags. If no source specified, defaults
36205+
to "user".
3620536206
in: query
3620636207
name: source
3620736208
required: false
@@ -39217,7 +39218,8 @@ tags:
3921739218

3921839219
by a source. For example, some valid sources include nagios, hudson, jenkins,
3921939220

39220-
users, feed, chef, puppet, git, bitbucket, fabric, capistrano, etc.
39221+
users, feed, chef, puppet, git, bitbucket, fabric, capistrano, etc. Find a complete
39222+
list of source type names under [API Source Attributes](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).
3922139223

3922239224

3922339225
Read more about tags on [Getting Started with Tags](https://docs.datadoghq.com/getting_started/tagging/).'

examples/v1/tags/GetHostTags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Get host tags returns "OK" response
2+
* Get Host Tags returns "OK" response
33
*/
44

55
import { client, v1 } from "@datadog/datadog-api-client";

examples/v1/tags/ListHostTags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Get Tags returns "OK" response
2+
* Get All Host Tags returns "OK" response
33
*/
44

55
import { client, v1 } from "@datadog/datadog-api-client";

features/v1/tags.feature

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ Feature: Tags
66
tags to a particular host. The component of your infrastructure
77
responsible for a tag is identified by a source. For example, some valid
88
sources include nagios, hudson, jenkins, users, feed, chef, puppet, git,
9-
bitbucket, fabric, capistrano, etc. Read more about tags on [Getting
10-
Started with Tags](https://docs.datadoghq.com/getting_started/tagging/).
9+
bitbucket, fabric, capistrano, etc. Find a complete list of source type
10+
names under [API Source
11+
Attributes](https://docs.datadoghq.com/integrations/faq/list-of-api-
12+
source-attribute-value). Read more about tags on [Getting Started with
13+
Tags](https://docs.datadoghq.com/getting_started/tagging/).
1114

1215
Background:
1316
Given a valid "apiKeyAuth" key in the system
@@ -31,26 +34,26 @@ Feature: Tags
3134
Then the response status is 404 Not Found
3235

3336
@generated @skip @team:DataDog/core-index
34-
Scenario: Get Tags returns "Not Found" response
37+
Scenario: Get All Host Tags returns "Not Found" response
3538
Given new "ListHostTags" request
3639
When the request is sent
3740
Then the response status is 404 Not Found
3841

3942
@generated @skip @team:DataDog/core-index
40-
Scenario: Get Tags returns "OK" response
43+
Scenario: Get All Host Tags returns "OK" response
4144
Given new "ListHostTags" request
4245
When the request is sent
4346
Then the response status is 200 OK
4447

4548
@generated @skip @team:DataDog/core-index
46-
Scenario: Get host tags returns "Not Found" response
49+
Scenario: Get Host Tags returns "Not Found" response
4750
Given new "GetHostTags" request
4851
And request contains "host_name" parameter from "REPLACE.ME"
4952
When the request is sent
5053
Then the response status is 404 Not Found
5154

5255
@generated @skip @team:DataDog/core-index
53-
Scenario: Get host tags returns "OK" response
56+
Scenario: Get Host Tags returns "OK" response
5457
Given new "GetHostTags" request
5558
And request contains "host_name" parameter from "REPLACE.ME"
5659
When the request is sent

packages/datadog-api-client-v1/apis/TagsApi.ts

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ export class TagsApiResponseProcessor {
558558

559559
export interface TagsApiCreateHostTagsRequest {
560560
/**
561-
* This endpoint allows you to add new tags to a host, optionally specifying where the tags came from.
561+
* Specified host name to add new tags
562562
* @type string
563563
*/
564564
hostName: string;
@@ -568,51 +568,49 @@ export interface TagsApiCreateHostTagsRequest {
568568
*/
569569
body: HostTags;
570570
/**
571-
* The source of the tags.
572-
* [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).
571+
* Source to add tags. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). Use "user" source for custom-defined tags. If no source is specified, defaults to "user".
573572
* @type string
574573
*/
575574
source?: string;
576575
}
577576

578577
export interface TagsApiDeleteHostTagsRequest {
579578
/**
580-
* This endpoint allows you to remove all user-assigned tags for a single host.
579+
* Specified host name to delete tags
581580
* @type string
582581
*/
583582
hostName: string;
584583
/**
585-
* The source of the tags (for example chef, puppet).
586-
* [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).
584+
* Source of the tags to be deleted. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). Use "user" source for custom-defined tags.
587585
* @type string
588586
*/
589587
source?: string;
590588
}
591589

592590
export interface TagsApiGetHostTagsRequest {
593591
/**
594-
* When specified, filters list of tags to those tags with the specified source.
592+
* Name of the host to retrieve tags for
595593
* @type string
596594
*/
597595
hostName: string;
598596
/**
599-
* Source to filter.
597+
* Source to filter. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). Use "user" source for custom-defined tags.
600598
* @type string
601599
*/
602600
source?: string;
603601
}
604602

605603
export interface TagsApiListHostTagsRequest {
606604
/**
607-
* When specified, filters host list to those tags with the specified source.
605+
* Source to filter. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). Use "user" source for custom-defined tags.
608606
* @type string
609607
*/
610608
source?: string;
611609
}
612610

613611
export interface TagsApiUpdateHostTagsRequest {
614612
/**
615-
* This endpoint allows you to update/replace all in an integration source with those supplied in the request.
613+
* Specified host name to change tags
616614
* @type string
617615
*/
618616
hostName: string;
@@ -622,8 +620,7 @@ export interface TagsApiUpdateHostTagsRequest {
622620
*/
623621
body: HostTags;
624622
/**
625-
* The source of the tags (for example chef, puppet).
626-
* [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value)
623+
* Source to update tags. [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). Use "user" source for custom-defined tags. If no source specified, defaults to "user".
627624
* @type string
628625
*/
629626
source?: string;
@@ -648,7 +645,7 @@ export class TagsApi {
648645

649646
/**
650647
* This endpoint allows you to add new tags to a host,
651-
* optionally specifying where these tags come from.
648+
* optionally specifying what source these tags come from. If tags already exist, appends new tags to the tag list. If no source is specified, defaults to "user".
652649
* @param param The request object
653650
*/
654651
public createHostTags(
@@ -671,8 +668,8 @@ export class TagsApi {
671668
}
672669

673670
/**
674-
* This endpoint allows you to remove all user-assigned tags
675-
* for a single host.
671+
* This endpoint allows you to remove all tags
672+
* for a single host. If no source is specified, only deletes from the source "User".
676673
* @param param The request object
677674
*/
678675
public deleteHostTags(
@@ -716,7 +713,7 @@ export class TagsApi {
716713
}
717714

718715
/**
719-
* Return a mapping of tags to hosts for your whole infrastructure.
716+
* Returns a mapping of tags to hosts. For each tag, the response returns a list of host names that contain this tag. There is a restriction of 10k total host names from the org that can be attached to tags and returned.
720717
* @param param The request object
721718
*/
722719
public listHostTags(

packages/datadog-api-client-v1/models/HostTags.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
88

99
/**
10-
* Set of tags to associate with your host.
10+
* Host name and an array of its tags
1111
*/
1212
export class HostTags {
1313
/**
1414
* Your host name.
1515
*/
1616
"host"?: string;
1717
/**
18-
* A list of tags to apply to the host.
18+
* A list of tags associated with a host.
1919
*/
2020
"tags"?: Array<string>;
2121

packages/datadog-api-client-v1/models/TagToHosts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
88

99
/**
10-
* In this object, the key is the tag, the value is a list of host names that are reporting that tag.
10+
* In this object, the key is the tag, and the value is a list of host names that are reporting that tag.
1111
*/
1212
export class TagToHosts {
1313
/**
14-
* A list of tags to apply to the host.
14+
* A mapping of tags to host names
1515
*/
1616
"tags"?: { [key: string]: Array<string> };
1717

0 commit comments

Comments
 (0)