Skip to content

delete_ops_item async

delete_ops_item(
    ops_item_id: OpsItemId, *, config_overrides: Optional[AsyncSSMClientConfig] = None
) -> DeleteOpsItemResponse

Delete an OpsItem. You must have permission in Identity and Access Management (IAM) to delete an OpsItem.

Note the following important information about this operation.

  • Deleting an OpsItem is irreversible. You can't restore a deleted OpsItem.

  • This operation uses an eventual consistency model, which means the system can take a few minutes to complete this operation. If you delete an OpsItem and immediately call, for example, GetOpsItem, the deleted OpsItem might still appear in the response.

  • This operation is idempotent. The system doesn't throw an exception if you repeatedly call this operation for the same OpsItem. If the first call is successful, all additional calls return the same successful response as the first call.

  • This operation doesn't support cross-account calls. A delegated administrator or management account can't delete OpsItems in other accounts, even if OpsCenter has been set up for cross-account administration. For more information about cross-account administration, see Setting up OpsCenter to centrally manage OpsItems across accounts in the Systems Manager User Guide.

Parameters:

  • ops_item_id (OpsItemId) –

    The ID of the OpsItem that you want to delete.

Raises:

Source code in docs_src/capo_ssm/_services/async_ssm.py
async def delete_ops_item(
    self,
    ops_item_id: "capo_ssm.types.ops_item_id.OpsItemId",
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
) -> "capo_ssm.types.delete_ops_item_response.DeleteOpsItemResponse":
    """<p>Delete an OpsItem. You must have permission in Identity and Access Management (IAM) to delete an OpsItem. </p> <important> <p>Note the following important information about this operation.</p> <ul> <li> <p>Deleting an OpsItem is irreversible. You can't restore a deleted OpsItem.</p> </li> <li> <p>This operation uses an <i>eventual consistency model</i>, which means the system can take a few minutes to complete this operation. If you delete an OpsItem and immediately call, for example, <a>GetOpsItem</a>, the deleted OpsItem might still appear in the response. </p> </li> <li> <p>This operation is idempotent. The system doesn't throw an exception if you repeatedly call this operation for the same OpsItem. If the first call is successful, all additional calls return the same successful response as the first call.</p> </li> <li> <p>This operation doesn't support cross-account calls. A delegated administrator or management account can't delete OpsItems in other accounts, even if OpsCenter has been set up for cross-account administration. For more information about cross-account administration, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-setting-up-cross-account.html">Setting up OpsCenter to centrally manage OpsItems across accounts</a> in the <i>Systems Manager User Guide</i>.</p> </li> </ul> </important>

    Args:
        ops_item_id: <p>The ID of the OpsItem that you want to delete.</p>

    Raises:
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.ops_item_invalid_parameter_exception.OpsItemInvalidParameterException: <p>A specified parameter argument isn't valid. Verify the available arguments and try again.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm.types.delete_ops_item_request.DeleteOpsItemRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.delete_ops_item_response.DeleteOpsItemResponse"
    ]:
        import capo_ssm._operations.amazon_ssm.delete_ops_item

        (
            output,
            http_response,
        ) = await capo_ssm._operations.amazon_ssm.delete_ops_item.async_delete_ops_item(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteOpsItem")
    )
    input_: capo_ssm.types.delete_ops_item_request.DeleteOpsItemRequest = {
        "ops_item_id": ops_item_id
    }

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