WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
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 @@ -4179,7 +4179,7 @@ components:
example: false
type: boolean
type: object
HostTags:
HostTagsInput:
description: Set of tags to associate with your host.
properties:
host:
Expand All @@ -4194,6 +4194,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 @@ -18689,18 +18704,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 to host names
type: object
type: object
TargetFormatType:
Expand Down Expand Up @@ -35712,11 +35727,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 @@ -35747,7 +35764,7 @@ paths:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Get Tags
summary: Get All Host Tags
tags:
- Tags
x-permission:
Expand All @@ -35760,16 +35777,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 @@ -35799,14 +35814,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 @@ -35817,7 +35832,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/HostTags'
$ref: '#/components/schemas/HostTagsOutput'
description: OK
'403':
content:
Expand All @@ -35833,25 +35848,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 @@ -35862,15 +35875,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 @@ -35896,16 +35909,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 @@ -35915,15 +35926,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 @@ -38918,7 +38929,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. Find a complete
list of source type names under [API Source Attributes](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
2 changes: 1 addition & 1 deletion examples/v1/tags/CreateHostTags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::TagsAPI.new

body = DatadogAPIClient::V1::HostTags.new({
body = DatadogAPIClient::V1::HostTagsInput.new({
host: "test.host",
tags: [
"environment:production",
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/tags/GetHostTags.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Get host tags returns "OK" response
# Get Host Tags returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::TagsAPI.new
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/tags/ListHostTags.rb
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

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::TagsAPI.new
Expand Down
2 changes: 1 addition & 1 deletion examples/v1/tags/UpdateHostTags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "datadog_api_client"
api_instance = DatadogAPIClient::V1::TagsAPI.new

body = DatadogAPIClient::V1::HostTags.new({
body = DatadogAPIClient::V1::HostTagsInput.new({
host: "test.host",
tags: [
"environment:production",
Expand Down
4 changes: 2 additions & 2 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -819,12 +819,12 @@
"v1.CreateHostTags" => {
"host_name" => "String",
"source" => "String",
"body" => "HostTags",
"body" => "HostTagsInput",
},
"v1.UpdateHostTags" => {
"host_name" => "String",
"source" => "String",
"body" => "HostTags",
"body" => "HostTagsInput",
},
"v1.CreateUser" => {
"body" => "User",
Expand Down
15 changes: 9 additions & 6 deletions features/v1/tags.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ Feature: Tags
tags to a particular host. The component of your infrastructure
responsible for a tag is identified by a source. For example, some valid
sources include nagios, hudson, jenkins, users, feed, chef, puppet, git,
bitbucket, fabric, capistrano, etc. Read more about tags on [Getting
Started with Tags](https://docs.datadoghq.com/getting_started/tagging/).
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). Read more about tags on [Getting Started with
Tags](https://docs.datadoghq.com/getting_started/tagging/).

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

@generated @skip @team:DataDog/core-index
Scenario: Get Tags returns "Not Found" response
Scenario: Get All Host Tags returns "Not Found" response
Given new "ListHostTags" request
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/core-index
Scenario: Get Tags returns "OK" response
Scenario: Get All Host Tags returns "OK" response
Given new "ListHostTags" request
When the request is sent
Then the response status is 200 OK

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

@generated @skip @team:DataDog/core-index
Scenario: Get host tags returns "OK" response
Scenario: Get Host Tags returns "OK" response
Given new "GetHostTags" request
And request contains "host_name" parameter from "REPLACE.ME"
When the request is sent
Expand Down
3 changes: 2 additions & 1 deletion lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ def overrides
"v1.host_metrics" => "HostMetrics",
"v1.host_mute_response" => "HostMuteResponse",
"v1.host_mute_settings" => "HostMuteSettings",
"v1.host_tags" => "HostTags",
"v1.host_tags_input" => "HostTagsInput",
"v1.host_tags_output" => "HostTagsOutput",
"v1.host_totals" => "HostTotals",
"v1.hourly_usage_attribution_body" => "HourlyUsageAttributionBody",
"v1.hourly_usage_attribution_metadata" => "HourlyUsageAttributionMetadata",
Expand Down
Loading
Loading