Deletes the specified tags from an SageMaker resource.
To list a resource's tags, use the ListTags API.
When you call this API to delete tags from a hyperparameter tuning job, the deleted tags are not removed from training jobs that the hyperparameter tuning job launched before you called this API.
When you call this API to delete tags from a SageMaker Domain or User Profile, the deleted tags are not removed from Apps that the SageMaker Domain or User Profile launched before you called this API.
Parameters:
-
resource_arn
(Optional[ResourceArn], default:
None
)
–
The Amazon Resource Name (ARN) of the resource whose tags you want to delete.
-
tag_keys
(Optional[TagKeyList], default:
None
)
–
An array or one or more tag keys to delete.
Raises:
Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
| async def delete_tags(
self,
*,
config_overrides: Optional[AsyncSageMakerClientConfig] = None,
resource_arn: Optional["capo_sagemaker.types.resource_arn.ResourceArn"] = None,
tag_keys: Optional["capo_sagemaker.types.tag_key_list.TagKeyList"] = None,
) -> "capo_sagemaker.types.delete_tags_output.DeleteTagsOutput":
"""<p>Deletes the specified tags from an SageMaker resource.</p> <p>To list a resource's tags, use the <code>ListTags</code> API. </p> <note> <p>When you call this API to delete tags from a hyperparameter tuning job, the deleted tags are not removed from training jobs that the hyperparameter tuning job launched before you called this API.</p> </note> <note> <p>When you call this API to delete tags from a SageMaker Domain or User Profile, the deleted tags are not removed from Apps that the SageMaker Domain or User Profile launched before you called this API.</p> </note>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the resource whose tags you want to delete.</p>
tag_keys: <p>An array or one or more tag keys to delete.</p>
Raises:
capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_sagemaker.types.delete_tags_input.DeleteTagsInput]",
) -> AsyncOperationResponse[
"capo_sagemaker.types.delete_tags_output.DeleteTagsOutput"
]:
import capo_sagemaker._operations.sage_maker.delete_tags
(
output,
http_response,
) = await capo_sagemaker._operations.sage_maker.delete_tags.async_delete_tags(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteTags")
)
input_: capo_sagemaker.types.delete_tags_input.DeleteTagsInput = {}
if resource_arn is not None:
input_["resource_arn"] = resource_arn
if tag_keys is not None:
input_["tag_keys"] = tag_keys
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|