Skip to content

get_attachment_upload_links

get_attachment_upload_links(
    file_name: FileName,
    *,
    config_overrides: Optional[SupportClientConfig] = None,
    file_size_bytes: Optional[FileSize] = None,
    upload_id: Optional[UploadId] = None,
    upload_range: Optional[UploadRange] = None,
    dry_run: Optional[NullableBooleanType] = None,
) -> GetAttachmentUploadLinksResponse

Returns one or more presigned upload URLs for uploading a large file attachment to a support case by using a multipart upload workflow. The maximum file size that you can upload with this workflow is 150 MB, and parts can be up to 100 MB each. Initiate a new upload by providing fileName and fileSizeBytes; the response returns a unique uploadId, the part size, the total number of parts, and a list of presigned upload URLs for the requested range of parts. A maximum of 10 upload URLs are returned per call. To retrieve more upload URLs for an upload that's already in progress, call GetAttachmentUploadLinks again with the existing uploadId and a new uploadRange.

Upload each part to its presigned URL by using HTTP PUT and capture the ETag from the response. After you upload all parts, call CompleteAttachmentUpload with the uploadId and the list of part indexes and ETags to finalize the upload. You can then attach the upload to a case by passing the uploadId in the uploadIds parameter of CreateCase or AddCommunicationToCase. To monitor progress before completion, call DescribeAttachmentUploadStatus.

  • 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.

Parameters:

  • file_name (FileName) –

    The name of the file to upload, including the file extension. This value is required when you initiate a new upload.

  • file_size_bytes (Optional[FileSize], default: None ) –

    The total size of the file in bytes. The service uses this value to calculate the total number of parts and the size of each part. Required when you initiate a new upload (when uploadId isn't provided). Valid range: 1 to 157,286,400 bytes (approximately 150 MB).

  • upload_id (Optional[UploadId], default: None ) –

    The unique identifier of an in-progress multipart upload, returned by a previous call to GetAttachmentUploadLinks. Specify uploadId to retrieve additional presigned upload URLs for an upload that has already been initiated. Required when fileSizeBytes isn't provided. Length: 1 to 2,048 characters.

  • upload_range (Optional[UploadRange], default: None ) –

    The range of part indexes for which to return presigned upload URLs. Use this parameter to page through the upload URLs for a large file across multiple calls. If you omit this parameter, the service determines the range to return.

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

    Specifies whether to validate the request without actually generating upload URLs. When set to true, the request is validated but no URLs are 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/support.py
def get_attachment_upload_links(
    self,
    file_name: "capo_support.types.file_name.FileName",
    *,
    config_overrides: Optional[SupportClientConfig] = None,
    file_size_bytes: Optional["capo_support.types.file_size.FileSize"] = None,
    upload_id: Optional["capo_support.types.upload_id.UploadId"] = None,
    upload_range: Optional["capo_support.types.upload_range.UploadRange"] = None,
    dry_run: Optional[
        "capo_support.types.nullable_boolean_type.NullableBooleanType"
    ] = None,
) -> "capo_support.types.get_attachment_upload_links_response.GetAttachmentUploadLinksResponse":
    """<p>Returns one or more presigned upload URLs for uploading a large file attachment to a support case by using a multipart upload workflow. The maximum file size that you can upload with this workflow is 150 MB, and parts can be up to 100 MB each. Initiate a new upload by providing <code>fileName</code> and <code>fileSizeBytes</code>; the response returns a unique <code>uploadId</code>, the part size, the total number of parts, and a list of presigned upload URLs for the requested range of parts. A maximum of 10 upload URLs are returned per call. To retrieve more upload URLs for an upload that's already in progress, call <code>GetAttachmentUploadLinks</code> again with the existing <code>uploadId</code> and a new <code>uploadRange</code>.</p> <p>Upload each part to its presigned URL by using HTTP <code>PUT</code> and capture the ETag from the response. After you upload all parts, call <a>CompleteAttachmentUpload</a> with the <code>uploadId</code> and the list of part indexes and ETags to finalize the upload. You can then attach the upload to a case by passing the <code>uploadId</code> in the <code>uploadIds</code> parameter of <a>CreateCase</a> or <a>AddCommunicationToCase</a>. To monitor progress before completion, call <a>DescribeAttachmentUploadStatus</a>.</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>

    Args:
        file_name: <p>The name of the file to upload, including the file extension. This value is required when you initiate a new upload.</p>
        file_size_bytes: <p>The total size of the file in bytes. The service uses this value to calculate the total number of parts and the size of each part. Required when you initiate a new upload (when <code>uploadId</code> isn't provided). Valid range: 1 to 157,286,400 bytes (approximately 150 MB).</p>
        upload_id: <p>The unique identifier of an in-progress multipart upload, returned by a previous call to <code>GetAttachmentUploadLinks</code>. Specify <code>uploadId</code> to retrieve additional presigned upload URLs for an upload that has already been initiated. Required when <code>fileSizeBytes</code> isn't provided. Length: 1 to 2,048 characters.</p>
        upload_range: <p>The range of part indexes for which to return presigned upload URLs. Use this parameter to page through the upload URLs for a large file across multiple calls. If you omit this parameter, the service determines the range to return.</p>
        dry_run: <p>Specifies whether to validate the request without actually generating upload URLs. When set to <code>true</code>, the request is validated but no URLs are 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.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.upload_id_not_found.UploadIdNotFound: <p>The specified <code>uploadId</code> couldn't be located.</p>
        capo_support.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_support.types.get_attachment_upload_links_request.GetAttachmentUploadLinksRequest]",
    ) -> OperationResponse[
        "capo_support.types.get_attachment_upload_links_response.GetAttachmentUploadLinksResponse"
    ]:
        import capo_support._operations.aws_support_20130415.get_attachment_upload_links

        output, http_response = (
            capo_support._operations.aws_support_20130415.get_attachment_upload_links.get_attachment_upload_links(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetAttachmentUploadLinks")
    )
    input_: capo_support.types.get_attachment_upload_links_request.GetAttachmentUploadLinksRequest = {
        "file_name": file_name
    }
    if file_size_bytes is not None:
        input_["file_size_bytes"] = file_size_bytes
    if upload_id is not None:
        input_["upload_id"] = upload_id
    if upload_range is not None:
        input_["upload_range"] = upload_range
    if dry_run is not None:
        input_["dry_run"] = dry_run

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output