Skip to content

Commit 58f69c7

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

7 files changed

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

api/datadogV1/api_tags.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (r *CreateHostTagsOptionalParameters) WithSource(source string) *CreateHost
3434

3535
// CreateHostTags Add tags to a host.
3636
// This endpoint allows you to add new tags to a host,
37-
// optionally specifying where these tags come from.
37+
// 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".
3838
func (a *TagsApi) CreateHostTags(ctx _context.Context, hostName string, body HostTags, o ...CreateHostTagsOptionalParameters) (HostTags, *_nethttp.Response, error) {
3939
var (
4040
localVarHTTPMethod = _nethttp.MethodPost
@@ -143,8 +143,8 @@ func (r *DeleteHostTagsOptionalParameters) WithSource(source string) *DeleteHost
143143
}
144144

145145
// DeleteHostTags Remove host tags.
146-
// This endpoint allows you to remove all user-assigned tags
147-
// for a single host.
146+
// This endpoint allows you to remove all tags
147+
// for a single host. If no source is specified, only deletes from the source "User".
148148
func (a *TagsApi) DeleteHostTags(ctx _context.Context, hostName string, o ...DeleteHostTagsOptionalParameters) (*_nethttp.Response, error) {
149149
var (
150150
localVarHTTPMethod = _nethttp.MethodDelete
@@ -239,7 +239,7 @@ func (r *GetHostTagsOptionalParameters) WithSource(source string) *GetHostTagsOp
239239
return r
240240
}
241241

242-
// GetHostTags Get host tags.
242+
// GetHostTags Get Host Tags.
243243
// Return the list of tags that apply to a given host.
244244
func (a *TagsApi) GetHostTags(ctx _context.Context, hostName string, o ...GetHostTagsOptionalParameters) (HostTags, *_nethttp.Response, error) {
245245
var (
@@ -345,8 +345,8 @@ func (r *ListHostTagsOptionalParameters) WithSource(source string) *ListHostTags
345345
return r
346346
}
347347

348-
// ListHostTags Get Tags.
349-
// Return a mapping of tags to hosts for your whole infrastructure.
348+
// ListHostTags Get All Host Tags.
349+
// 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.
350350
func (a *TagsApi) ListHostTags(ctx _context.Context, o ...ListHostTagsOptionalParameters) (TagToHosts, *_nethttp.Response, error) {
351351
var (
352352
localVarHTTPMethod = _nethttp.MethodGet

api/datadogV1/model_host_tags.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import (
88
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
99
)
1010

11-
// HostTags Set of tags to associate with your host.
11+
// HostTags Host name and an array of its tags
1212
type HostTags struct {
1313
// Your host name.
1414
Host *string `json:"host,omitempty"`
15-
// A list of tags to apply to the host.
15+
// A list of tags associated with a host.
1616
Tags []string `json:"tags,omitempty"`
1717
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
1818
UnparsedObject map[string]interface{} `json:"-"`

api/datadogV1/model_tag_to_hosts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
99
)
1010

11-
// TagToHosts In this object, the key is the tag, the value is a list of host names that are reporting that tag.
11+
// TagToHosts In this object, the key is the tag, and the value is a list of host names that are reporting that tag.
1212
type TagToHosts struct {
13-
// A list of tags to apply to the host.
13+
// A mapping of tags to host names
1414
Tags map[string][]string `json:"tags,omitempty"`
1515
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
1616
UnparsedObject map[string]interface{} `json:"-"`

examples/v1/tags/GetHostTags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Get host tags returns "OK" response
1+
// Get Host Tags returns "OK" response
22

33
package main
44

examples/v1/tags/ListHostTags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Get Tags returns "OK" response
1+
// Get All Host Tags returns "OK" response
22

33
package main
44

tests/scenarios/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

0 commit comments

Comments
 (0)