Skip to content

create_deployment async

create_deployment(
    environment_id: Identifier,
    application_id: Identifier,
    application_version: Version,
    *,
    config_overrides: Optional[Asyncm2ClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateDeploymentResponse

Creates and starts a deployment to deploy an application into a runtime environment.

Parameters:

  • environment_id (Identifier) –

    The identifier of the runtime environment where you want to deploy this application.

  • application_id (Identifier) –

    The application identifier.

  • application_version (Version) –

    The version of the application to deploy.

  • client_token (Optional[ClientToken], default: None ) –

    Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create a deployment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.

Raises:

Source code in docs_src/capo_m2/_services/async_m2.py
async def create_deployment(
    self,
    environment_id: "capo_m2.types.identifier.Identifier",
    application_id: "capo_m2.types.identifier.Identifier",
    application_version: "capo_m2.types.version.Version",
    *,
    config_overrides: Optional[Asyncm2ClientConfig] = None,
    client_token: Optional["capo_m2.types.client_token.ClientToken"] = None,
) -> "capo_m2.types.create_deployment_response.CreateDeploymentResponse":
    """<p>Creates and starts a deployment to deploy an application into a runtime environment.</p>

    Args:
        environment_id: <p>The identifier of the runtime environment where you want to deploy this application.</p>
        application_id: <p>The application identifier.</p>
        application_version: <p>The version of the application to deploy.</p>
        client_token: <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create a deployment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires. </p>

    Raises:
        capo_m2.errors.access_denied_exception.AccessDeniedException: <p>The account or role doesn't have the right permissions to make the request.</p>
        capo_m2.errors.conflict_exception.ConflictException: <p>The parameters provided in the request conflict with existing resources.</p>
        capo_m2.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of the request.</p>
        capo_m2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_m2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>One or more quotas for Amazon Web Services Mainframe Modernization exceeds the limit.</p>
        capo_m2.errors.throttling_exception.ThrottlingException: <p>The number of requests made exceeds the limit.</p>
        capo_m2.errors.validation_exception.ValidationException: <p>One or more parameters provided in the request is not valid.</p>
        capo_m2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_m2.types.create_deployment_request.CreateDeploymentRequest]",
    ) -> AsyncOperationResponse[
        "capo_m2.types.create_deployment_response.CreateDeploymentResponse"
    ]:
        import capo_m2._operations.aws_supernova_control_plane_service.create_deployment

        (
            output,
            http_response,
        ) = await capo_m2._operations.aws_supernova_control_plane_service.create_deployment.async_create_deployment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDeployment")
    )
    input_: capo_m2.types.create_deployment_request.CreateDeploymentRequest = {
        "environment_id": environment_id,
        "application_id": application_id,
        "application_version": application_version,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output