Skip to content

describe_attachment async

describe_attachment(
    attachment_id: AttachmentId,
    *,
    config_overrides: Optional[AsyncSupportClientConfig] = None,
    dry_run: Optional[NullableBooleanType] = None,
) -> DescribeAttachmentResponse

Returns the attachment that has the specified ID. Attachments can include screenshots, error logs, or other files that describe your issue. Attachment IDs are generated by the case management system when you add an attachment to a case or case communication. Attachment IDs are returned in the AttachmentDetails objects that are returned by the DescribeCommunications operation.

  • You must have an Amazon Web Services Business Support+, Amazon Web Services Enterprise Support, or Amazon Web Services Unified Operations plan to use the Amazon Web Services Support API. If you're in an Amazon Web Services Region that doesn't offer one of these Amazon Web Services Support plans, or if you haven't transitioned to one of these plans, you can use the Amazon Web Services Support API with a Business, Enterprise On-Ramp, or Enterprise Support plan.

  • If you call the Amazon Web Services Support API from an account that doesn't have an Amazon Web Services Business Support+, Amazon Web Services Enterprise Support, or Amazon Web Services Unified Operations plan, the SubscriptionRequiredException error message appears. For information about changing your support plan, see Amazon Web Services Support.

DescribeAttachment can't return attachments larger than 5 MB. If the specified attachmentId refers to an attachment larger than 5 MB, the request fails with InvalidParameterValueException.

To download an attachment of any size, including attachments larger than 5 MB, use GetAttachmentDownloadLink. GetAttachmentDownloadLink returns an Amazon S3 presigned URL that you can use to download the attachment directly.

Parameters:

  • attachment_id (AttachmentId) –

    The ID of the attachment to return. Attachment IDs are returned by the DescribeCommunications operation.

    If the specified attachment is larger than 5 MB, this operation returns InvalidParameterValueException. To download attachments larger than 5 MB, use GetAttachmentDownloadLink.

  • dry_run (Optional[NullableBooleanType], default: None ) –

    Specifies whether to validate the request without actually retrieving the attachment. When set to true, the request is validated but no attachment content is returned, and the operation returns a DryRunOperationException. When omitted or set to false, the request runs normally.

Raises:

Source code in docs_src/capo_support/_services/async_support.py
async def describe_attachment(
    self,
    attachment_id: "capo_support.types.attachment_id.AttachmentId",
    *,
    config_overrides: Optional[AsyncSupportClientConfig] = None,
    dry_run: Optional[
        "capo_support.types.nullable_boolean_type.NullableBooleanType"
    ] = None,
) -> "capo_support.types.describe_attachment_response.DescribeAttachmentResponse":
    """<p>Returns the attachment that has the specified ID. Attachments can include screenshots, error logs, or other files that describe your issue. Attachment IDs are generated by the case management system when you add an attachment to a case or case communication. Attachment IDs are returned in the <a>AttachmentDetails</a> objects that are returned by the <a>DescribeCommunications</a> operation.</p> <note> <ul> <li> <p>You must have an Amazon Web Services Business Support+, Amazon Web Services Enterprise Support, or Amazon Web Services Unified Operations plan to use the Amazon Web Services Support API. If you're in an Amazon Web Services Region that doesn't offer one of these Amazon Web Services Support plans, or if you haven't transitioned to one of these plans, you can use the Amazon Web Services Support API with a Business, Enterprise On-Ramp, or Enterprise Support plan.</p> </li> <li> <p>If you call the Amazon Web Services Support API from an account that doesn't have an Amazon Web Services Business Support+, Amazon Web Services Enterprise Support, or Amazon Web Services Unified Operations plan, the <code>SubscriptionRequiredException</code> error message appears. For information about changing your support plan, see <a href="http://aws.amazon.com/premiumsupport/">Amazon Web Services Support</a>.</p> </li> </ul> </note> <important> <p> <code>DescribeAttachment</code> can't return attachments larger than 5 MB. If the specified <code>attachmentId</code> refers to an attachment larger than 5 MB, the request fails with <code>InvalidParameterValueException</code>.</p> <p>To download an attachment of any size, including attachments larger than 5 MB, use <a>GetAttachmentDownloadLink</a>. <code>GetAttachmentDownloadLink</code> returns an Amazon S3 presigned URL that you can use to download the attachment directly.</p> </important>

    Args:
        attachment_id: <p>The ID of the attachment to return. Attachment IDs are returned by the <a>DescribeCommunications</a> operation.</p> <p>If the specified attachment is larger than 5 MB, this operation returns <code>InvalidParameterValueException</code>. To download attachments larger than 5 MB, use <a>GetAttachmentDownloadLink</a>.</p>
        dry_run: <p>Specifies whether to validate the request without actually retrieving the attachment. When set to <code>true</code>, the request is validated but no attachment content is returned, and the operation returns a <code>DryRunOperationException</code>. When omitted or set to <code>false</code>, the request runs normally.</p>

    Raises:
        capo_support.errors.attachment_id_not_found.AttachmentIdNotFound: <p>An attachment with the specified ID could not be found.</p>
        capo_support.errors.describe_attachment_limit_exceeded.DescribeAttachmentLimitExceeded: <p>The limit for the number of <a>DescribeAttachment</a> requests in a short period of time has been exceeded.</p>
        capo_support.errors.dry_run_operation_exception.DryRunOperationException: <p>The request was valid, but the operation wasn't performed because <code>dryRun</code> was set to <code>true</code>.</p>
        capo_support.errors.internal_server_error.InternalServerError: <p>An internal server error occurred.</p>
        capo_support.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_support.types.describe_attachment_request.DescribeAttachmentRequest]",
    ) -> AsyncOperationResponse[
        "capo_support.types.describe_attachment_response.DescribeAttachmentResponse"
    ]:
        import capo_support._operations.aws_support_20130415.describe_attachment

        (
            output,
            http_response,
        ) = await capo_support._operations.aws_support_20130415.describe_attachment.async_describe_attachment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeAttachment")
    )
    input_: capo_support.types.describe_attachment_request.DescribeAttachmentRequest = {
        "attachment_id": attachment_id
    }
    if dry_run is not None:
        input_["dry_run"] = dry_run

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