diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index d9bb88a10f27..660ab5044a3c 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -4179,7 +4179,7 @@ components: example: false type: boolean type: object - HostTags: + HostTagsInput: description: Set of tags to associate with your host. properties: host: @@ -4194,6 +4194,21 @@ components: type: string type: array type: object + HostTagsOutput: + description: Host name and an array of its tags + 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: @@ -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: @@ -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 total 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 @@ -35747,7 +35764,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: [] - summary: Get Tags + summary: Get All Host Tags tags: - Tags x-permission: @@ -35755,21 +35772,20 @@ paths: permissions: [] /api/v1/tags/hosts/{host_name}: delete: - description: 'This endpoint allows you to remove all user-assigned tags + description: 'This endpoint allows you to remove all tags - for a single host.' + for a single host. If no source is specified, only deletes tags with no source.' 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 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. in: query name: source required: false @@ -35799,14 +35815,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: Name of the host to retrieve tags for 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 @@ -35817,7 +35833,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/HostTags' + $ref: '#/components/schemas/HostTagsOutput' description: OK '403': content: @@ -35833,25 +35849,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 @@ -35862,7 +35876,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/HostTags' + $ref: '#/components/schemas/HostTagsInput' description: Update host tags request body. required: true responses: @@ -35870,7 +35884,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/HostTags' + $ref: '#/components/schemas/HostTagsOutput' description: Created '403': content: @@ -35896,16 +35910,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 @@ -35915,7 +35927,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/HostTags' + $ref: '#/components/schemas/HostTagsInput' description: Add tags to host required: true responses: @@ -35923,7 +35935,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/HostTags' + $ref: '#/components/schemas/HostTagsOutput' description: OK '403': content: @@ -38918,7 +38930,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/).' diff --git a/examples/v1/tags/CreateHostTags.ts b/examples/v1/tags/CreateHostTags.ts index 0dd319e377c5..a5dd0989dc96 100644 --- a/examples/v1/tags/CreateHostTags.ts +++ b/examples/v1/tags/CreateHostTags.ts @@ -17,7 +17,7 @@ const params: v1.TagsApiCreateHostTagsRequest = { apiInstance .createHostTags(params) - .then((data: v1.HostTags) => { + .then((data: v1.HostTagsOutput) => { console.log( "API called successfully. Returned data: " + JSON.stringify(data) ); diff --git a/examples/v1/tags/GetHostTags.ts b/examples/v1/tags/GetHostTags.ts index e96c5c517606..ba321a63fc85 100644 --- a/examples/v1/tags/GetHostTags.ts +++ b/examples/v1/tags/GetHostTags.ts @@ -1,5 +1,5 @@ /** - * Get host tags returns "OK" response + * Get Host Tags returns "OK" response */ import { client, v1 } from "@datadog/datadog-api-client"; @@ -13,7 +13,7 @@ const params: v1.TagsApiGetHostTagsRequest = { apiInstance .getHostTags(params) - .then((data: v1.HostTags) => { + .then((data: v1.HostTagsOutput) => { console.log( "API called successfully. Returned data: " + JSON.stringify(data) ); diff --git a/examples/v1/tags/ListHostTags.ts b/examples/v1/tags/ListHostTags.ts index 683847aec607..caff385b4f03 100644 --- a/examples/v1/tags/ListHostTags.ts +++ b/examples/v1/tags/ListHostTags.ts @@ -1,5 +1,5 @@ /** - * Get Tags returns "OK" response + * Get All Host Tags returns "OK" response */ import { client, v1 } from "@datadog/datadog-api-client"; diff --git a/examples/v1/tags/UpdateHostTags.ts b/examples/v1/tags/UpdateHostTags.ts index f49b7d612a43..eb1ce8cba5a7 100644 --- a/examples/v1/tags/UpdateHostTags.ts +++ b/examples/v1/tags/UpdateHostTags.ts @@ -17,7 +17,7 @@ const params: v1.TagsApiUpdateHostTagsRequest = { apiInstance .updateHostTags(params) - .then((data: v1.HostTags) => { + .then((data: v1.HostTagsOutput) => { console.log( "API called successfully. Returned data: " + JSON.stringify(data) ); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 58bddf5a680b..5111cc823746 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -2263,7 +2263,7 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { "type": "string", "format": "", }, - "operationResponseType": "HostTags", + "operationResponseType": "HostTagsOutput", }, "v1.UpdateHostTags": { "hostName": { @@ -2275,10 +2275,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { "format": "", }, "body": { - "type": "HostTags", + "type": "HostTagsInput", "format": "", }, - "operationResponseType": "HostTags", + "operationResponseType": "HostTagsOutput", }, "v1.CreateHostTags": { "hostName": { @@ -2290,10 +2290,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { "format": "", }, "body": { - "type": "HostTags", + "type": "HostTagsInput", "format": "", }, - "operationResponseType": "HostTags", + "operationResponseType": "HostTagsOutput", }, "v1.DeleteHostTags": { "hostName": { diff --git a/features/v1/tags.feature b/features/v1/tags.feature index 36e1eabfdc25..d6557ca18821 100644 --- a/features/v1/tags.feature +++ b/features/v1/tags.feature @@ -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 @@ -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 diff --git a/packages/datadog-api-client-v1/apis/TagsApi.ts b/packages/datadog-api-client-v1/apis/TagsApi.ts index 35aafd7b4df8..89acf064ddfc 100644 --- a/packages/datadog-api-client-v1/apis/TagsApi.ts +++ b/packages/datadog-api-client-v1/apis/TagsApi.ts @@ -17,13 +17,14 @@ import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; -import { HostTags } from "../models/HostTags"; +import { HostTagsInput } from "../models/HostTagsInput"; +import { HostTagsOutput } from "../models/HostTagsOutput"; import { TagToHosts } from "../models/TagToHosts"; export class TagsApiRequestFactory extends BaseAPIRequestFactory { public async createHostTags( hostName: string, - body: HostTags, + body: HostTagsInput, source?: string, _options?: Configuration ): Promise { @@ -67,7 +68,7 @@ export class TagsApiRequestFactory extends BaseAPIRequestFactory { ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( - ObjectSerializer.serialize(body, "HostTags", ""), + ObjectSerializer.serialize(body, "HostTagsInput", ""), contentType ); requestContext.setBody(serializedBody); @@ -204,7 +205,7 @@ export class TagsApiRequestFactory extends BaseAPIRequestFactory { public async updateHostTags( hostName: string, - body: HostTags, + body: HostTagsInput, source?: string, _options?: Configuration ): Promise { @@ -248,7 +249,7 @@ export class TagsApiRequestFactory extends BaseAPIRequestFactory { ]); requestContext.setHeaderParam("Content-Type", contentType); const serializedBody = ObjectSerializer.stringify( - ObjectSerializer.serialize(body, "HostTags", ""), + ObjectSerializer.serialize(body, "HostTagsInput", ""), contentType ); requestContext.setBody(serializedBody); @@ -271,15 +272,17 @@ export class TagsApiResponseProcessor { * @params response Response returned by the server for a request to createHostTags * @throws ApiException if the response code was not in [200, 299] */ - public async createHostTags(response: ResponseContext): Promise { + public async createHostTags( + response: ResponseContext + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 201) { - const body: HostTags = ObjectSerializer.deserialize( + const body: HostTagsOutput = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HostTags" - ) as HostTags; + "HostTagsOutput" + ) as HostTagsOutput; return body; } if ( @@ -309,11 +312,11 @@ export class TagsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: HostTags = ObjectSerializer.deserialize( + const body: HostTagsOutput = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HostTags", + "HostTagsOutput", "" - ) as HostTags; + ) as HostTagsOutput; return body; } @@ -382,15 +385,15 @@ export class TagsApiResponseProcessor { * @params response Response returned by the server for a request to getHostTags * @throws ApiException if the response code was not in [200, 299] */ - public async getHostTags(response: ResponseContext): Promise { + public async getHostTags(response: ResponseContext): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: HostTags = ObjectSerializer.deserialize( + const body: HostTagsOutput = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HostTags" - ) as HostTags; + "HostTagsOutput" + ) as HostTagsOutput; return body; } if ( @@ -420,11 +423,11 @@ export class TagsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: HostTags = ObjectSerializer.deserialize( + const body: HostTagsOutput = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HostTags", + "HostTagsOutput", "" - ) as HostTags; + ) as HostTagsOutput; return body; } @@ -502,15 +505,17 @@ export class TagsApiResponseProcessor { * @params response Response returned by the server for a request to updateHostTags * @throws ApiException if the response code was not in [200, 299] */ - public async updateHostTags(response: ResponseContext): Promise { + public async updateHostTags( + response: ResponseContext + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 201) { - const body: HostTags = ObjectSerializer.deserialize( + const body: HostTagsOutput = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HostTags" - ) as HostTags; + "HostTagsOutput" + ) as HostTagsOutput; return body; } if ( @@ -540,11 +545,11 @@ export class TagsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: HostTags = ObjectSerializer.deserialize( + const body: HostTagsOutput = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HostTags", + "HostTagsOutput", "" - ) as HostTags; + ) as HostTagsOutput; return body; } @@ -558,18 +563,17 @@ export class TagsApiResponseProcessor { export interface TagsApiCreateHostTagsRequest { /** - * This endpoint allows you to add new tags to a host, optionally specifying where the tags came from. + * Specified host name to add new tags * @type string */ hostName: string; /** * Update host tags request body. - * @type HostTags + * @type HostTagsInput */ - body: HostTags; + body: HostTagsInput; /** - * The source of the tags. - * [Complete list of source attribute values](https://docs.datadoghq.com/integrations/faq/list-of-api-source-attribute-value). + * 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. * @type string */ source?: string; @@ -577,13 +581,12 @@ export interface TagsApiCreateHostTagsRequest { export interface TagsApiDeleteHostTagsRequest { /** - * This endpoint allows you to remove all user-assigned tags for a single host. + * Specified host name to delete tags * @type string */ hostName: string; /** - * 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). + * 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. * @type string */ source?: string; @@ -591,12 +594,12 @@ export interface TagsApiDeleteHostTagsRequest { export interface TagsApiGetHostTagsRequest { /** - * When specified, filters list of tags to those tags with the specified source. + * Name of the host to retrieve tags for * @type string */ hostName: string; /** - * Source to filter. + * 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. * @type string */ source?: string; @@ -604,7 +607,7 @@ export interface TagsApiGetHostTagsRequest { export interface TagsApiListHostTagsRequest { /** - * When specified, filters host list to those tags with the specified source. + * 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. * @type string */ source?: string; @@ -612,18 +615,17 @@ export interface TagsApiListHostTagsRequest { export interface TagsApiUpdateHostTagsRequest { /** - * This endpoint allows you to update/replace all in an integration source with those supplied in the request. + * Specified host name to change tags * @type string */ hostName: string; /** * Add tags to host - * @type HostTags + * @type HostTagsInput */ - body: HostTags; + body: HostTagsInput; /** - * 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) + * 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. * @type string */ source?: string; @@ -648,13 +650,13 @@ export class TagsApi { /** * 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. * @param param The request object */ public createHostTags( param: TagsApiCreateHostTagsRequest, options?: Configuration - ): Promise { + ): Promise { const requestContextPromise = this.requestFactory.createHostTags( param.hostName, param.body, @@ -671,8 +673,8 @@ export class TagsApi { } /** - * This endpoint allows you to remove all user-assigned tags - * for a single host. + * This endpoint allows you to remove all tags + * for a single host. If no source is specified, only deletes tags with no source. * @param param The request object */ public deleteHostTags( @@ -700,7 +702,7 @@ export class TagsApi { public getHostTags( param: TagsApiGetHostTagsRequest, options?: Configuration - ): Promise { + ): Promise { const requestContextPromise = this.requestFactory.getHostTags( param.hostName, param.source, @@ -716,7 +718,7 @@ export class TagsApi { } /** - * Return a mapping of tags to hosts for your whole infrastructure. + * 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. * @param param The request object */ public listHostTags( @@ -744,7 +746,7 @@ export class TagsApi { public updateHostTags( param: TagsApiUpdateHostTagsRequest, options?: Configuration - ): Promise { + ): Promise { const requestContextPromise = this.requestFactory.updateHostTags( param.hostName, param.body, diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index de7810e2a7cc..04b299cdaaad 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -505,7 +505,8 @@ export { HostMetaInstallMethod } from "./models/HostMetaInstallMethod"; export { HostMetrics } from "./models/HostMetrics"; export { HostMuteResponse } from "./models/HostMuteResponse"; export { HostMuteSettings } from "./models/HostMuteSettings"; -export { HostTags } from "./models/HostTags"; +export { HostTagsInput } from "./models/HostTagsInput"; +export { HostTagsOutput } from "./models/HostTagsOutput"; export { HostTotals } from "./models/HostTotals"; export { HourlyUsageAttributionBody } from "./models/HourlyUsageAttributionBody"; export { HourlyUsageAttributionMetadata } from "./models/HourlyUsageAttributionMetadata"; diff --git a/packages/datadog-api-client-v1/models/HostTags.ts b/packages/datadog-api-client-v1/models/HostTagsInput.ts similarity index 94% rename from packages/datadog-api-client-v1/models/HostTags.ts rename to packages/datadog-api-client-v1/models/HostTagsInput.ts index 3cd0a8e39434..363b7f42829c 100644 --- a/packages/datadog-api-client-v1/models/HostTags.ts +++ b/packages/datadog-api-client-v1/models/HostTagsInput.ts @@ -9,7 +9,7 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; /** * Set of tags to associate with your host. */ -export class HostTags { +export class HostTagsInput { /** * Your host name. */ @@ -53,7 +53,7 @@ export class HostTags { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return HostTags.attributeTypeMap; + return HostTagsInput.attributeTypeMap; } public constructor() {} diff --git a/packages/datadog-api-client-v1/models/HostTagsOutput.ts b/packages/datadog-api-client-v1/models/HostTagsOutput.ts new file mode 100644 index 000000000000..7a129f0a5819 --- /dev/null +++ b/packages/datadog-api-client-v1/models/HostTagsOutput.ts @@ -0,0 +1,60 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Host name and an array of its tags + */ +export class HostTagsOutput { + /** + * Your host name. + */ + "host"?: string; + /** + * A list of tags attached to a given host. + */ + "tags"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + host: { + baseName: "host", + type: "string", + }, + tags: { + baseName: "tags", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return HostTagsOutput.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index 353dc1d85e2b..b8604ae7c07e 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -117,7 +117,8 @@ import { HostMetaInstallMethod } from "./HostMetaInstallMethod"; import { HostMetrics } from "./HostMetrics"; import { HostMuteResponse } from "./HostMuteResponse"; import { HostMuteSettings } from "./HostMuteSettings"; -import { HostTags } from "./HostTags"; +import { HostTagsInput } from "./HostTagsInput"; +import { HostTagsOutput } from "./HostTagsOutput"; import { HostTotals } from "./HostTotals"; import { HourlyUsageAttributionBody } from "./HourlyUsageAttributionBody"; import { HourlyUsageAttributionMetadata } from "./HourlyUsageAttributionMetadata"; @@ -1857,7 +1858,8 @@ const typeMap: { [index: string]: any } = { HostMetrics: HostMetrics, HostMuteResponse: HostMuteResponse, HostMuteSettings: HostMuteSettings, - HostTags: HostTags, + HostTagsInput: HostTagsInput, + HostTagsOutput: HostTagsOutput, HostTotals: HostTotals, HourlyUsageAttributionBody: HourlyUsageAttributionBody, HourlyUsageAttributionMetadata: HourlyUsageAttributionMetadata, diff --git a/packages/datadog-api-client-v1/models/TagToHosts.ts b/packages/datadog-api-client-v1/models/TagToHosts.ts index ce8406c72a50..c0c14db07041 100644 --- a/packages/datadog-api-client-v1/models/TagToHosts.ts +++ b/packages/datadog-api-client-v1/models/TagToHosts.ts @@ -7,11 +7,11 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; /** - * In this object, the key is the tag, the value is a list of host names that are reporting that tag. + * In this object, the key is the tag, and the value is a list of host names that are reporting that tag. */ export class TagToHosts { /** - * A list of tags to apply to the host. + * A mapping of tags to host names */ "tags"?: { [key: string]: Array };