This API works with the following fleet types: EC2
Retrieves a fresh set of credentials for use when uploading a new set of game build files to Amazon GameLift Servers's Amazon S3. This is done as part of the build creation process; see CreateBuild.
To request new credentials, specify the build ID as returned with an initial CreateBuild request. If successful, a new set of credentials are returned, along with the S3 storage location associated with the build ID.
Learn more
Create a Build with Files in S3
All APIs by task
Parameters:
-
build_id
(Optional[BuildIdOrArn], default:
None
)
–
A unique identifier for the build to get credentials for. You can use either the build ID or ARN value.
Raises:
-
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.
-
NotFoundException
–
The requested resource was not found. The resource was either not created yet or deleted.
-
UnauthorizedException
–
The client failed authentication. Clients should not retry such requests.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_gamelift/_services/game_lift.py
| def request_upload_credentials(
self,
*,
config_overrides: Optional[GameLiftClientConfig] = None,
build_id: Optional["capo_gamelift.types.build_id_or_arn.BuildIdOrArn"] = None,
) -> "capo_gamelift.types.request_upload_credentials_output.RequestUploadCredentialsOutput":
"""<p> <b>This API works with the following fleet types:</b> EC2</p> <p>Retrieves a fresh set of credentials for use when uploading a new set of game build files to Amazon GameLift Servers's Amazon S3. This is done as part of the build creation process; see <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateBuild.html">CreateBuild</a>.</p> <p>To request new credentials, specify the build ID as returned with an initial <code>CreateBuild</code> request. If successful, a new set of credentials are returned, along with the S3 storage location associated with the build ID.</p> <p> <b>Learn more</b> </p> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-cli-uploading.html#gamelift-build-cli-uploading-create-build"> Create a Build with Files in S3</a> </p> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a> </p>
Args:
build_id: <p>A unique identifier for the build to get credentials for. You can use either the build ID or ARN value. </p>
Raises:
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.not_found_exception.NotFoundException: <p>The requested resource was not found. The resource was either not created yet or deleted.</p>
capo_gamelift.errors.unauthorized_exception.UnauthorizedException: <p>The client failed authentication. Clients should not retry such requests.</p>
capo_gamelift.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_gamelift.types.request_upload_credentials_input.RequestUploadCredentialsInput]",
) -> OperationResponse[
"capo_gamelift.types.request_upload_credentials_output.RequestUploadCredentialsOutput"
]:
import capo_gamelift._operations.game_lift.request_upload_credentials
output, http_response = (
capo_gamelift._operations.game_lift.request_upload_credentials.request_upload_credentials(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_gamelift.types.request_upload_credentials_output.RequestUploadCredentialsOutput",
) -> dict[str, Any]:
import capo_gamelift.types.request_upload_credentials_output
return (
capo_gamelift.types.request_upload_credentials_output.redact_sensitive(
output
)
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("RequestUploadCredentials", redact_output=_redact_output),
)
input_: capo_gamelift.types.request_upload_credentials_input.RequestUploadCredentialsInput = {}
if build_id is not None:
input_["build_id"] = build_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|