Skip to content

delete_service_environment async

delete_service_environment(
    *,
    config_overrides: Optional[AsyncBatchClientConfig] = None,
    service_environment: Optional[String] = None,
) -> DeleteServiceEnvironmentResponse

Deletes a Service environment. Before you can delete a service environment, you must first set its state to DISABLED with the UpdateServiceEnvironment API operation and disassociate it from any job queues with the UpdateJobQueue API operation.

Parameters:

  • service_environment (Optional[String], default: None ) –

    The name or ARN of the service environment to delete.

Raises:

  • ClientException –

    These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Another cause is specifying an identifier that's not valid.

  • ServerException –

    These errors are usually caused by a server issue.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_batch/_services/async_batch.py
async def delete_service_environment(
    self,
    *,
    config_overrides: Optional[AsyncBatchClientConfig] = None,
    service_environment: Optional["capo_batch.types.string.String"] = None,
) -> "capo_batch.types.delete_service_environment_response.DeleteServiceEnvironmentResponse":
    """<p>Deletes a Service environment. Before you can delete a service environment, you must first set its state to <code>DISABLED</code> with the <code>UpdateServiceEnvironment</code> API operation and disassociate it from any job queues with the <code>UpdateJobQueue</code> API operation.</p>

    Args:
        service_environment: <p>The name or ARN of the service environment to delete.</p>

    Raises:
        capo_batch.errors.client_exception.ClientException: <p>These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Another cause is specifying an identifier that's not valid.</p>
        capo_batch.errors.server_exception.ServerException: <p>These errors are usually caused by a server issue.</p>
        capo_batch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_batch.types.delete_service_environment_request.DeleteServiceEnvironmentRequest]",
    ) -> AsyncOperationResponse[
        "capo_batch.types.delete_service_environment_response.DeleteServiceEnvironmentResponse"
    ]:
        import capo_batch._operations.aws_batch_v20160810.delete_service_environment

        (
            output,
            http_response,
        ) = await capo_batch._operations.aws_batch_v20160810.delete_service_environment.async_delete_service_environment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteServiceEnvironment")
    )
    input_: capo_batch.types.delete_service_environment_request.DeleteServiceEnvironmentRequest = {}
    if service_environment is not None:
        input_["service_environment"] = service_environment

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