This API works with the following fleet types: Anywhere
Creates a custom location for use in an Anywhere fleet.
Parameters:
-
location_name
(Optional[CustomInputLocationStringModel], default:
None
)
–
A descriptive name for the custom location.
-
tags
(Optional[TagList], default:
None
)
–
A list of labels to assign to the new resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources is useful for resource management, access management, and cost allocation. For more information, see Tagging Amazon Web Services Resources in the Amazon Web Services General Reference.
Raises:
-
ConflictException
–
The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.
-
InternalServiceException
–
The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.
-
InvalidRequestException
–
One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.
-
LimitExceededException
–
The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying.
-
TaggingFailedException
–
The requested tagging operation did not succeed. This may be due to invalid tag format or the maximum tag limit may have been exceeded. Resolve the issue before retrying.
-
UnauthorizedException
–
The client failed authentication. Clients should not retry such requests.
-
UnsupportedRegionException
–
The requested operation is not supported in the Region specified.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_gamelift/_services/async_game_lift.py
| async def create_location(
self,
*,
config_overrides: Optional[AsyncGameLiftClientConfig] = None,
location_name: Optional[
"capo_gamelift.types.custom_input_location_string_model.CustomInputLocationStringModel"
] = None,
tags: Optional["capo_gamelift.types.tag_list.TagList"] = None,
) -> "capo_gamelift.types.create_location_output.CreateLocationOutput":
"""<p> <b>This API works with the following fleet types:</b> Anywhere</p> <p>Creates a custom location for use in an Anywhere fleet.</p>
Args:
location_name: <p>A descriptive name for the custom location.</p>
tags: <p>A list of labels to assign to the new resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources is useful for resource management, access management, and cost allocation. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html"> Tagging Amazon Web Services Resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
Raises:
capo_gamelift.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.</p> <p></p>
capo_gamelift.errors.internal_service_exception.InternalServiceException: <p>The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.</p>
capo_gamelift.errors.invalid_request_exception.InvalidRequestException: <p>One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.</p>
capo_gamelift.errors.limit_exceeded_exception.LimitExceededException: <p>The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying.</p>
capo_gamelift.errors.tagging_failed_exception.TaggingFailedException: <p>The requested tagging operation did not succeed. This may be due to invalid tag format or the maximum tag limit may have been exceeded. Resolve the issue before retrying.</p>
capo_gamelift.errors.unauthorized_exception.UnauthorizedException: <p>The client failed authentication. Clients should not retry such requests.</p>
capo_gamelift.errors.unsupported_region_exception.UnsupportedRegionException: <p>The requested operation is not supported in the Region specified.</p>
capo_gamelift.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_gamelift.types.create_location_input.CreateLocationInput]",
) -> AsyncOperationResponse[
"capo_gamelift.types.create_location_output.CreateLocationOutput"
]:
import capo_gamelift._operations.game_lift.create_location
(
output,
http_response,
) = await capo_gamelift._operations.game_lift.create_location.async_create_location(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateLocation")
)
input_: capo_gamelift.types.create_location_input.CreateLocationInput = {}
if location_name is not None:
input_["location_name"] = location_name
if tags is not None:
input_["tags"] = tags
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|