UNPKG

16.5 kBTypeScriptView Raw
1import {Request} from '../lib/request';
2import {Response} from '../lib/response';
3import {AWSError} from '../lib/error';
4import {Service} from '../lib/service';
5import {ServiceConfigurationOptions} from '../lib/service';
6import {ConfigBase as Config} from '../lib/config';
7interface Blob {}
8declare class ResourceGroupsTaggingAPI extends Service {
9 /**
10 * Constructs a service object. This object has one method for each API operation.
11 */
12 constructor(options?: ResourceGroupsTaggingAPI.Types.ClientConfiguration)
13 config: Config & ResourceGroupsTaggingAPI.Types.ClientConfiguration;
14 /**
15 * Returns all the tagged resources that are associated with the specified tags (keys and values) located in the specified region for the AWS account. The tags and the resource types that you specify in the request are known as filters. The response includes all tags that are associated with the requested resources. If no filter is provided, this action returns a paginated resource list with the associated tags.
16 */
17 getResources(params: ResourceGroupsTaggingAPI.Types.GetResourcesInput, callback?: (err: AWSError, data: ResourceGroupsTaggingAPI.Types.GetResourcesOutput) => void): Request<ResourceGroupsTaggingAPI.Types.GetResourcesOutput, AWSError>;
18 /**
19 * Returns all the tagged resources that are associated with the specified tags (keys and values) located in the specified region for the AWS account. The tags and the resource types that you specify in the request are known as filters. The response includes all tags that are associated with the requested resources. If no filter is provided, this action returns a paginated resource list with the associated tags.
20 */
21 getResources(callback?: (err: AWSError, data: ResourceGroupsTaggingAPI.Types.GetResourcesOutput) => void): Request<ResourceGroupsTaggingAPI.Types.GetResourcesOutput, AWSError>;
22 /**
23 * Returns all tag keys in the specified region for the AWS account.
24 */
25 getTagKeys(params: ResourceGroupsTaggingAPI.Types.GetTagKeysInput, callback?: (err: AWSError, data: ResourceGroupsTaggingAPI.Types.GetTagKeysOutput) => void): Request<ResourceGroupsTaggingAPI.Types.GetTagKeysOutput, AWSError>;
26 /**
27 * Returns all tag keys in the specified region for the AWS account.
28 */
29 getTagKeys(callback?: (err: AWSError, data: ResourceGroupsTaggingAPI.Types.GetTagKeysOutput) => void): Request<ResourceGroupsTaggingAPI.Types.GetTagKeysOutput, AWSError>;
30 /**
31 * Returns all tag values for the specified key in the specified region for the AWS account.
32 */
33 getTagValues(params: ResourceGroupsTaggingAPI.Types.GetTagValuesInput, callback?: (err: AWSError, data: ResourceGroupsTaggingAPI.Types.GetTagValuesOutput) => void): Request<ResourceGroupsTaggingAPI.Types.GetTagValuesOutput, AWSError>;
34 /**
35 * Returns all tag values for the specified key in the specified region for the AWS account.
36 */
37 getTagValues(callback?: (err: AWSError, data: ResourceGroupsTaggingAPI.Types.GetTagValuesOutput) => void): Request<ResourceGroupsTaggingAPI.Types.GetTagValuesOutput, AWSError>;
38 /**
39 * Applies one or more tags to the specified resources. Note the following: Not all resources can have tags. For a list of resources that support tagging, see Supported Resources in the AWS Resource Groups and Tag Editor User Guide. Each resource can have up to 50 tags. For other limits, see Tag Restrictions in the Amazon EC2 User Guide for Linux Instances. You can only tag resources that are located in the specified region for the AWS account. To add tags to a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for adding tags. For more information, see Obtaining Permissions for Tagging in the AWS Resource Groups and Tag Editor User Guide.
40 */
41 tagResources(params: ResourceGroupsTaggingAPI.Types.TagResourcesInput, callback?: (err: AWSError, data: ResourceGroupsTaggingAPI.Types.TagResourcesOutput) => void): Request<ResourceGroupsTaggingAPI.Types.TagResourcesOutput, AWSError>;
42 /**
43 * Applies one or more tags to the specified resources. Note the following: Not all resources can have tags. For a list of resources that support tagging, see Supported Resources in the AWS Resource Groups and Tag Editor User Guide. Each resource can have up to 50 tags. For other limits, see Tag Restrictions in the Amazon EC2 User Guide for Linux Instances. You can only tag resources that are located in the specified region for the AWS account. To add tags to a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for adding tags. For more information, see Obtaining Permissions for Tagging in the AWS Resource Groups and Tag Editor User Guide.
44 */
45 tagResources(callback?: (err: AWSError, data: ResourceGroupsTaggingAPI.Types.TagResourcesOutput) => void): Request<ResourceGroupsTaggingAPI.Types.TagResourcesOutput, AWSError>;
46 /**
47 * Removes the specified tags from the specified resources. When you specify a tag key, the action removes both that key and its associated value. The operation succeeds even if you attempt to remove tags from a resource that were already removed. Note the following: To remove tags from a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for removing tags. For more information, see Obtaining Permissions for Tagging in the AWS Resource Groups and Tag Editor User Guide. You can only tag resources that are located in the specified region for the AWS account.
48 */
49 untagResources(params: ResourceGroupsTaggingAPI.Types.UntagResourcesInput, callback?: (err: AWSError, data: ResourceGroupsTaggingAPI.Types.UntagResourcesOutput) => void): Request<ResourceGroupsTaggingAPI.Types.UntagResourcesOutput, AWSError>;
50 /**
51 * Removes the specified tags from the specified resources. When you specify a tag key, the action removes both that key and its associated value. The operation succeeds even if you attempt to remove tags from a resource that were already removed. Note the following: To remove tags from a resource, you need the necessary permissions for the service that the resource belongs to as well as permissions for removing tags. For more information, see Obtaining Permissions for Tagging in the AWS Resource Groups and Tag Editor User Guide. You can only tag resources that are located in the specified region for the AWS account.
52 */
53 untagResources(callback?: (err: AWSError, data: ResourceGroupsTaggingAPI.Types.UntagResourcesOutput) => void): Request<ResourceGroupsTaggingAPI.Types.UntagResourcesOutput, AWSError>;
54}
55declare namespace ResourceGroupsTaggingAPI {
56 export type AmazonResourceType = string;
57 export type ErrorCode = "InternalServiceException"|"InvalidParameterException"|string;
58 export type ErrorMessage = string;
59 export type FailedResourcesMap = {[key: string]: FailureInfo};
60 export interface FailureInfo {
61 /**
62 * The HTTP status code of the common error.
63 */
64 StatusCode?: StatusCode;
65 /**
66 * The code of the common error. Valid values include InternalServiceException, InvalidParameterException, and any valid error code returned by the AWS service that hosts the resource that you want to tag.
67 */
68 ErrorCode?: ErrorCode;
69 /**
70 * The message of the common error.
71 */
72 ErrorMessage?: ErrorMessage;
73 }
74 export interface GetResourcesInput {
75 /**
76 * A string that indicates that additional data is available. Leave this value empty for your initial request. If the response includes a PaginationToken, use that string for this value to request an additional page of data.
77 */
78 PaginationToken?: PaginationToken;
79 /**
80 * A list of tags (keys and values). A request can include up to 50 keys, and each key can include up to 20 values. If you specify multiple filters connected by an AND operator in a single request, the response returns only those resources that are associated with every specified filter. If you specify multiple filters connected by an OR operator in a single request, the response returns all resources that are associated with at least one or possibly more of the specified filters.
81 */
82 TagFilters?: TagFilterList;
83 /**
84 * A limit that restricts the number of resources returned by GetResources in paginated output. You can set ResourcesPerPage to a minimum of 1 item and the maximum of 50 items.
85 */
86 ResourcesPerPage?: ResourcesPerPage;
87 /**
88 * A limit that restricts the number of tags (key and value pairs) returned by GetResources in paginated output. A resource with no tags is counted as having one tag (one key and value pair). GetResources does not split a resource and its associated tags across pages. If the specified TagsPerPage would cause such a break, a PaginationToken is returned in place of the affected resource and its tags. Use that token in another request to get the remaining data. For example, if you specify a TagsPerPage of 100 and the account has 22 resources with 10 tags each (meaning that each resource has 10 key and value pairs), the output will consist of 3 pages, with the first page displaying the first 10 resources, each with its 10 tags, the second page displaying the next 10 resources each with its 10 tags, and the third page displaying the remaining 2 resources, each with its 10 tags. You can set TagsPerPage to a minimum of 100 items and the maximum of 500 items.
89 */
90 TagsPerPage?: TagsPerPage;
91 /**
92 * The constraints on the resources that you want returned. The format of each resource type is service[:resourceType]. For example, specifying a resource type of ec2 returns all tagged Amazon EC2 resources (which includes tagged EC2 instances). Specifying a resource type of ec2:instance returns only EC2 instances. The string for each service name and resource type is the same as that embedded in a resource's Amazon Resource Name (ARN). Consult the AWS General Reference for the following: For a list of service name strings, see AWS Service Namespaces. For resource type strings, see Example ARNs. For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces.
93 */
94 ResourceTypeFilters?: ResourceTypeFilterList;
95 }
96 export interface GetResourcesOutput {
97 /**
98 * A string that indicates that the response contains more data than can be returned in a single response. To receive additional data, specify this string for the PaginationToken value in a subsequent request.
99 */
100 PaginationToken?: PaginationToken;
101 /**
102 * A list of resource ARNs and the tags (keys and values) associated with each.
103 */
104 ResourceTagMappingList?: ResourceTagMappingList;
105 }
106 export interface GetTagKeysInput {
107 /**
108 * A string that indicates that additional data is available. Leave this value empty for your initial request. If the response includes a PaginationToken, use that string for this value to request an additional page of data.
109 */
110 PaginationToken?: PaginationToken;
111 }
112 export interface GetTagKeysOutput {
113 /**
114 * A string that indicates that the response contains more data than can be returned in a single response. To receive additional data, specify this string for the PaginationToken value in a subsequent request.
115 */
116 PaginationToken?: PaginationToken;
117 /**
118 * A list of all tag keys in the AWS account.
119 */
120 TagKeys?: TagKeyList;
121 }
122 export interface GetTagValuesInput {
123 /**
124 * A string that indicates that additional data is available. Leave this value empty for your initial request. If the response includes a PaginationToken, use that string for this value to request an additional page of data.
125 */
126 PaginationToken?: PaginationToken;
127 /**
128 * The key for which you want to list all existing values in the specified region for the AWS account.
129 */
130 Key: TagKey;
131 }
132 export interface GetTagValuesOutput {
133 /**
134 * A string that indicates that the response contains more data than can be returned in a single response. To receive additional data, specify this string for the PaginationToken value in a subsequent request.
135 */
136 PaginationToken?: PaginationToken;
137 /**
138 * A list of all tag values for the specified key in the AWS account.
139 */
140 TagValues?: TagValuesOutputList;
141 }
142 export type PaginationToken = string;
143 export type ResourceARN = string;
144 export type ResourceARNList = ResourceARN[];
145 export interface ResourceTagMapping {
146 /**
147 * An array of resource ARN(s).
148 */
149 ResourceARN?: ResourceARN;
150 /**
151 * The tags that have been applied to one or more AWS resources.
152 */
153 Tags?: TagList;
154 }
155 export type ResourceTagMappingList = ResourceTagMapping[];
156 export type ResourceTypeFilterList = AmazonResourceType[];
157 export type ResourcesPerPage = number;
158 export type StatusCode = number;
159 export interface Tag {
160 /**
161 * One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.
162 */
163 Key: TagKey;
164 /**
165 * The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
166 */
167 Value: TagValue;
168 }
169 export interface TagFilter {
170 /**
171 * One part of a key-value pair that make up a tag. A key is a general label that acts like a category for more specific tag values.
172 */
173 Key?: TagKey;
174 /**
175 * The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
176 */
177 Values?: TagValueList;
178 }
179 export type TagFilterList = TagFilter[];
180 export type TagKey = string;
181 export type TagKeyList = TagKey[];
182 export type TagKeyListForUntag = TagKey[];
183 export type TagList = Tag[];
184 export type TagMap = {[key: string]: TagValue};
185 export interface TagResourcesInput {
186 /**
187 * A list of ARNs. An ARN (Amazon Resource Name) uniquely identifies a resource. You can specify a minimum of 1 and a maximum of 20 ARNs (resources) to tag. An ARN can be set to a maximum of 1600 characters. For more information, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.
188 */
189 ResourceARNList: ResourceARNList;
190 /**
191 * The tags that you want to add to the specified resources. A tag consists of a key and a value that you define.
192 */
193 Tags: TagMap;
194 }
195 export interface TagResourcesOutput {
196 /**
197 * Details of resources that could not be tagged. An error code, status code, and error message are returned for each failed item.
198 */
199 FailedResourcesMap?: FailedResourcesMap;
200 }
201 export type TagValue = string;
202 export type TagValueList = TagValue[];
203 export type TagValuesOutputList = TagValue[];
204 export type TagsPerPage = number;
205 export interface UntagResourcesInput {
206 /**
207 * A list of ARNs. An ARN (Amazon Resource Name) uniquely identifies a resource. You can specify a minimum of 1 and a maximum of 20 ARNs (resources) to untag. An ARN can be set to a maximum of 1600 characters. For more information, see Amazon Resource Names (ARNs) and AWS Service Namespaces in the AWS General Reference.
208 */
209 ResourceARNList: ResourceARNList;
210 /**
211 * A list of the tag keys that you want to remove from the specified resources.
212 */
213 TagKeys: TagKeyListForUntag;
214 }
215 export interface UntagResourcesOutput {
216 /**
217 * Details of resources that could not be untagged. An error code, status code, and error message are returned for each failed item.
218 */
219 FailedResourcesMap?: FailedResourcesMap;
220 }
221 /**
222 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
223 */
224 export type apiVersion = "2017-01-26"|"latest"|string;
225 export interface ClientApiVersions {
226 /**
227 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
228 */
229 apiVersion?: apiVersion;
230 }
231 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
232 /**
233 * Contains interfaces for use with the ResourceGroupsTaggingAPI client.
234 */
235 export import Types = ResourceGroupsTaggingAPI;
236}
237export = ResourceGroupsTaggingAPI;