DEPRECATED - CreateTags is deprecated and not maintained. To create tags for EFS resources, use the API action.
Creates or overwrites tags associated with a file system. Each tag is a key-value pair. If a tag key specified in the request already exists on the file system, this operation overwrites its value with the value provided in the request. If you add the Name tag to your file system, Amazon EFS returns it in the response to the DescribeFileSystems operation.
This operation requires permission for the elasticfilesystem:CreateTags action.
Parameters:
-
file_system_id
(FileSystemId)
–
The ID of the file system whose tags you want to modify (String). This operation modifies the tags only, not the file system.
-
tags
(Tags)
–
An array of Tag objects to add. Each Tag object is a key-value pair.
Raises:
-
BadRequest
–
Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.
-
FileSystemNotFound
–
Returned if the specified FileSystemId value doesn't exist in the requester's Amazon Web Services account.
-
InternalServerError
–
Returned if an error occurred on the server side.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
To create a new tag
This operation creates a new tag for an EFS file system.
>>> await client.create_tags(file_system_id='fs-01234567', tags=[{'Key': 'Name', 'Value': 'MyFileSystem'}])
Source code in docs_src/capo_efs/_services/async_efs.py
| async def create_tags(
self,
file_system_id: "capo_efs.types.file_system_id.FileSystemId",
tags: "capo_efs.types.tags.Tags",
*,
config_overrides: Optional[AsyncEFSClientConfig] = None,
) -> None:
"""<note> <p>DEPRECATED - <code>CreateTags</code> is deprecated and not maintained. To create tags for EFS resources, use the API action.</p> </note> <p>Creates or overwrites tags associated with a file system. Each tag is a key-value pair. If a tag key specified in the request already exists on the file system, this operation overwrites its value with the value provided in the request. If you add the <code>Name</code> tag to your file system, Amazon EFS returns it in the response to the <a>DescribeFileSystems</a> operation. </p> <p>This operation requires permission for the <code>elasticfilesystem:CreateTags</code> action.</p>
Args:
file_system_id: <p>The ID of the file system whose tags you want to modify (String). This operation modifies the tags only, not the file system.</p>
tags: <p>An array of <code>Tag</code> objects to add. Each <code>Tag</code> object is a key-value pair. </p>
Raises:
capo_efs.errors.bad_request.BadRequest: <p>Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.</p>
capo_efs.errors.file_system_not_found.FileSystemNotFound: <p>Returned if the specified <code>FileSystemId</code> value doesn't exist in the requester's Amazon Web Services account.</p>
capo_efs.errors.internal_server_error.InternalServerError: <p>Returned if an error occurred on the server side.</p>
capo_efs.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To create a new tag
This operation creates a new tag for an EFS file system.
>>> await client.create_tags(file_system_id='fs-01234567', tags=[{'Key': 'Name', 'Value': 'MyFileSystem'}])
"""
async def _handler(
req: "AsyncOperationRequest[capo_efs.types.create_tags_request.CreateTagsRequest]",
) -> AsyncOperationResponse[None]:
import capo_efs._operations.magnolio_api_service_v20150201.create_tags
(
output,
http_response,
) = await capo_efs._operations.magnolio_api_service_v20150201.create_tags.async_create_tags(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateTags")
)
input_: capo_efs.types.create_tags_request.CreateTagsRequest = {
"file_system_id": file_system_id,
"tags": tags,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|