tag_resource
¶
tag_resource(
resource_arn: AmazonResourceName,
tags: TagList,
*,
config_overrides: Optional[ServiceDiscoveryClientConfig] = None,
) -> TagResourceResponse
Adds one or more tags to the specified resource.
Parameters:
-
resource_arn(AmazonResourceName) –The Amazon Resource Name (ARN) of the resource that you want to retrieve tags for.
-
tags(TagList) –The tags to add to the specified resource. Specifying the tag key is required. You can set the value of a tag to an empty string, but you can't set the value of a tag to null.
Raises:
-
InvalidInput–One or more specified values aren't valid. For example, a required value might be missing, a numeric value might be outside the allowed range, or a string value might exceed length constraints.
-
ResourceNotFoundException–The operation can't be completed because the resource was not found.
-
TooManyTagsException–The list of tags on the resource is over the quota. The maximum number of tags that can be applied to a resource is 50.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
TagResource example This example adds "Department" and "Project" tags to a resource.
>>> client.tag_resource(resource_arn='arn:aws:servicediscovery:us-east-1:123456789012:namespace/ns-ylexjili4cdxy3xm', tags=[{'Key': 'Department', 'Value': 'Engineering'}, {'Key': 'Project', 'Value': 'Zeta'}])
Source code in docs_src/capo_servicediscovery/_services/service_discovery.py
2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 | |