Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 47 additions & 35 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4154,7 +4154,7 @@ components:
example: false
type: boolean
type: object
HostTags:
HostTagsInput:
description: Set of tags to associate with your host.
properties:
host:
Expand All @@ -4169,6 +4169,21 @@ components:
type: string
type: array
type: object
HostTagsOutput:
description: Set of tags to associate with your host.
properties:
host:
description: Your host name.
example: test.host
type: string
tags:
description: A list of tags attached to a given host.
items:
description: A given tag in a list.
example: environment:production
type: string
type: array
type: object
HostTotals:
description: Total number of host currently monitored by Datadog.
properties:
Expand Down Expand Up @@ -18664,18 +18679,18 @@ components:
- match
type: object
TagToHosts:
description: In this object, the key is the tag, the value is a list of host
names that are reporting that tag.
description: In this object, the key is the tag, and the value is a list of
host names that are reporting that tag.
properties:
tags:
additionalProperties:
description: A list of additional properties for tags.
description: A list of host names which contain this tag
items:
description: A given tag in a list.
example: test.metric.host
type: string
type: array
description: A list of tags to apply to the host.
description: A mapping of tags
type: object
type: object
TargetFormatType:
Expand Down Expand Up @@ -35627,11 +35642,13 @@ paths:
- synthetics_global_variable_write
/api/v1/tags/hosts:
get:
description: Return a mapping of tags to hosts for your whole infrastructure.
description: 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 host names from the org that can be attached to tags and returned.
operationId: ListHostTags
parameters:
- description: When specified, filters host list to those tags with the specified
source.
- description: 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.
in: query
name: source
required: false
Expand Down Expand Up @@ -35662,7 +35679,7 @@ paths:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Get Tags
summary: Get All Host Tags
tags:
- Tags
x-permission:
Expand All @@ -35675,16 +35692,14 @@ paths:
for a single host.'
operationId: DeleteHostTags
parameters:
- description: This endpoint allows you to remove all user-assigned tags for
a single host.
- description: Specified host name to delete tags
in: path
name: host_name
required: true
schema:
type: string
- description: 'The source of the tags (for example chef, puppet).

[Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).'
- description: 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.
in: query
name: source
required: false
Expand Down Expand Up @@ -35714,14 +35729,14 @@ paths:
description: Return the list of tags that apply to a given host.
operationId: GetHostTags
parameters:
- description: When specified, filters list of tags to those tags with the specified
source.
- description: Specified host name to view tags
in: path
name: host_name
required: true
schema:
type: string
- description: Source to filter.
- description: 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.
in: query
name: source
required: false
Expand All @@ -35732,7 +35747,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/HostTags'
$ref: '#/components/schemas/HostTagsOutput'
description: OK
'403':
content:
Expand All @@ -35748,25 +35763,23 @@ paths:
description: Not Found
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Get host tags
summary: Get Host Tags
tags:
- Tags
post:
description: 'This endpoint allows you to add new tags to a host,

optionally specifying where these tags come from.'
optionally specifying what source these tags come from.'
operationId: CreateHostTags
parameters:
- description: This endpoint allows you to add new tags to a host, optionally
specifying where the tags came from.
- description: Specified host name to add new tags
in: path
name: host_name
required: true
schema:
type: string
- description: 'The source of the tags.

[Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value).'
- description: 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.
example: chef
in: query
name: source
Expand All @@ -35777,15 +35790,15 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/HostTags'
$ref: '#/components/schemas/HostTagsInput'
description: Update host tags request body.
required: true
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/HostTags'
$ref: '#/components/schemas/HostTagsOutput'
description: Created
'403':
content:
Expand All @@ -35811,16 +35824,14 @@ paths:
an integration source with those supplied in the request.'
operationId: UpdateHostTags
parameters:
- description: This endpoint allows you to update/replace all in an integration
source with those supplied in the request.
- description: Specified host name to change tags
in: path
name: host_name
required: true
schema:
type: string
- description: 'The source of the tags (for example chef, puppet).

[Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value)'
- description: 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.
in: query
name: source
required: false
Expand All @@ -35830,15 +35841,15 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/HostTags'
$ref: '#/components/schemas/HostTagsInput'
description: Add tags to host
required: true
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/HostTags'
$ref: '#/components/schemas/HostTagsOutput'
description: OK
'403':
content:
Expand Down Expand Up @@ -38833,7 +38844,8 @@ tags:

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

users, feed, chef, puppet, git, bitbucket, fabric, capistrano, etc.
users, feed, chef, puppet, git, bitbucket, fabric, capistrano, etc. [Complete
list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value)


Read more about tags on [Getting Started with Tags](https://docs.datadoghq.com/getting_started/tagging/).'
Expand Down
11 changes: 7 additions & 4 deletions examples/v1/tags/CreateHostTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.TagsApi;
import com.datadog.api.client.v1.model.HostTags;
import com.datadog.api.client.v1.model.HostTagsInput;
import com.datadog.api.client.v1.model.HostTagsOutput;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
TagsApi apiInstance = new TagsApi(defaultClient);

HostTags body =
new HostTags().host("test.host").tags(Collections.singletonList("environment:production"));
HostTagsInput body =
new HostTagsInput()
.host("test.host")
.tags(Collections.singletonList("environment:production"));

try {
HostTags result = apiInstance.createHostTags("host_name", body);
HostTagsOutput result = apiInstance.createHostTags("host_name", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TagsApi#createHostTags");
Expand Down
6 changes: 3 additions & 3 deletions examples/v1/tags/GetHostTags.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Get host tags returns "OK" response
// Get Host Tags returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.TagsApi;
import com.datadog.api.client.v1.model.HostTags;
import com.datadog.api.client.v1.model.HostTagsOutput;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
TagsApi apiInstance = new TagsApi(defaultClient);

try {
HostTags result = apiInstance.getHostTags("host_name");
HostTagsOutput result = apiInstance.getHostTags("host_name");
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TagsApi#getHostTags");
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/tags/ListHostTags.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Get Tags returns "OK" response
// Get All Host Tags returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
Expand Down
11 changes: 7 additions & 4 deletions examples/v1/tags/UpdateHostTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v1.api.TagsApi;
import com.datadog.api.client.v1.model.HostTags;
import com.datadog.api.client.v1.model.HostTagsInput;
import com.datadog.api.client.v1.model.HostTagsOutput;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
TagsApi apiInstance = new TagsApi(defaultClient);

HostTags body =
new HostTags().host("test.host").tags(Collections.singletonList("environment:production"));
HostTagsInput body =
new HostTagsInput()
.host("test.host")
.tags(Collections.singletonList("environment:production"));

try {
HostTags result = apiInstance.updateHostTags("host_name", body);
HostTagsOutput result = apiInstance.updateHostTags("host_name", body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling TagsApi#updateHostTags");
Expand Down
Loading
Loading