Skip to content

Commit d3ebd57

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

6 files changed

Lines changed: 62 additions & 60 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/).'

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

services/tags/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ tags to a particular host.
1010

1111
The component of your infrastructure responsible for a tag is identified
1212
by a source. For example, some valid sources include nagios, hudson, jenkins,
13-
users, feed, chef, puppet, git, bitbucket, fabric, capistrano, etc.
13+
users, feed, chef, puppet, git, bitbucket, fabric, capistrano, etc. Find a complete list of source type names under [API Source Attributes](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).
1414

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

services/tags/src/v1/TagsApi.ts

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

613613
export interface TagsApiCreateHostTagsRequest {
614614
/**
615-
* This endpoint allows you to add new tags to a host, optionally specifying where the tags came from.
615+
* Specified host name to add new tags
616616
* @type string
617617
*/
618618
hostName: string;
@@ -622,51 +622,49 @@ export interface TagsApiCreateHostTagsRequest {
622622
*/
623623
body: HostTags;
624624
/**
625-
* The source of the tags.
626-
* [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).
625+
* 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".
627626
* @type string
628627
*/
629628
source?: string;
630629
}
631630

632631
export interface TagsApiDeleteHostTagsRequest {
633632
/**
634-
* This endpoint allows you to remove all user-assigned tags for a single host.
633+
* Specified host name to delete tags
635634
* @type string
636635
*/
637636
hostName: string;
638637
/**
639-
* The source of the tags (for example chef, puppet).
640-
* [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).
638+
* 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.
641639
* @type string
642640
*/
643641
source?: string;
644642
}
645643

646644
export interface TagsApiGetHostTagsRequest {
647645
/**
648-
* When specified, filters list of tags to those tags with the specified source.
646+
* Name of the host to retrieve tags for
649647
* @type string
650648
*/
651649
hostName: string;
652650
/**
653-
* Source to filter.
651+
* 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.
654652
* @type string
655653
*/
656654
source?: string;
657655
}
658656

659657
export interface TagsApiListHostTagsRequest {
660658
/**
661-
* When specified, filters host list to those tags with the specified source.
659+
* 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.
662660
* @type string
663661
*/
664662
source?: string;
665663
}
666664

667665
export interface TagsApiUpdateHostTagsRequest {
668666
/**
669-
* This endpoint allows you to update/replace all in an integration source with those supplied in the request.
667+
* Specified host name to change tags
670668
* @type string
671669
*/
672670
hostName: string;
@@ -676,8 +674,7 @@ export interface TagsApiUpdateHostTagsRequest {
676674
*/
677675
body: HostTags;
678676
/**
679-
* The source of the tags (for example chef, puppet).
680-
* [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value)
677+
* 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".
681678
* @type string
682679
*/
683680
source?: string;
@@ -704,7 +701,7 @@ export class TagsApi {
704701

705702
/**
706703
* This endpoint allows you to add new tags to a host,
707-
* optionally specifying where these tags come from.
704+
* 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".
708705
* @param param The request object
709706
*/
710707
public createHostTags(
@@ -727,8 +724,8 @@ export class TagsApi {
727724
}
728725

729726
/**
730-
* This endpoint allows you to remove all user-assigned tags
731-
* for a single host.
727+
* This endpoint allows you to remove all tags
728+
* for a single host. If no source is specified, only deletes from the source "User".
732729
* @param param The request object
733730
*/
734731
public deleteHostTags(
@@ -772,7 +769,7 @@ export class TagsApi {
772769
}
773770

774771
/**
775-
* Return a mapping of tags to hosts for your whole infrastructure.
772+
* 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.
776773
* @param param The request object
777774
*/
778775
public listHostTags(

services/tags/src/v1/models/HostTags.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { AttributeTypeMap } from "@datadog/datadog-api-client";
22

33
/**
4-
* Set of tags to associate with your host.
4+
* Host name and an array of its tags
55
*/
66
export class HostTags {
77
/**
88
* Your host name.
99
*/
1010
"host"?: string;
1111
/**
12-
* A list of tags to apply to the host.
12+
* A list of tags associated with a host.
1313
*/
1414
"tags"?: Array<string>;
1515
/**

services/tags/src/v1/models/TagToHosts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { AttributeTypeMap } from "@datadog/datadog-api-client";
22

33
/**
4-
* In this object, the key is the tag, the value is a list of host names that are reporting that tag.
4+
* In this object, the key is the tag, and the value is a list of host names that are reporting that tag.
55
*/
66
export class TagToHosts {
77
/**
8-
* A list of tags to apply to the host.
8+
* A mapping of tags to host names
99
*/
1010
"tags"?: { [key: string]: Array<string> };
1111
/**

0 commit comments

Comments
 (0)