Skip to content

create_case async

create_case(
    subject: Subject,
    communication_body: CommunicationBody,
    *,
    config_overrides: Optional[AsyncSupportClientConfig] = None,
    service_code: Optional[ServiceCode2] = None,
    severity_code: Optional[SeverityCode] = None,
    category_code: Optional[CategoryCode] = None,
    cc_email_addresses: Optional[CcEmailAddressList] = None,
    language: Optional[Language] = None,
    issue_type: Optional[IssueType] = None,
    attachment_set_id: Optional[AttachmentSetId] = None,
    upload_ids: Optional[UploadIds] = None,
    dry_run: Optional[NullableBooleanType] = None,
) -> CreateCaseResponse

Creates a case in the Amazon Web Services Support Center. This operation is similar to how you create a case in the Amazon Web Services Support Center Create Case page.

The Amazon Web Services Support API doesn't support requesting service limit increases. You can submit a service limit increase in the following ways:

Amazon Web Services Support automatically redacts sensitive information from support cases to protect your data. The following information is replaced with [REDACTED_BY_Amazon Web Services] and is not stored:

  • Amazon Web Services secret keys - The complete key is replaced. Example: [REDACTED_BY_Amazon Web Services]

  • Private keys - The complete key is replaced. Example: [REDACTED_BY_Amazon Web Services]

  • Credit card numbers - The number is redacted, but the last 4 digits remain. Example: [REDACTED_BY_Amazon Web Services]-7016

This sensitive information is never required by Amazon Web Services Support.

A successful CreateCase request returns a Amazon Web Services Support case number. You can use the DescribeCases operation and specify the case number to get existing Amazon Web Services Support cases. After you create a case, use the AddCommunicationToCase operation to add additional communication or attachments to an existing case.

The caseId is separate from the displayId that appears in the Amazon Web Services Support Center. Use the DescribeCases operation to get the displayId.

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

  • subject (Subject) –

    The title of the support case. The title appears in the Subject field on the Amazon Web Services Support Center Create Case page.

  • service_code (Optional[ServiceCode2], default: None ) –

    The code for the Amazon Web Services service. You can use the DescribeServices operation to get the possible serviceCode values.

  • severity_code (Optional[SeverityCode], default: None ) –

    A value that indicates the urgency of the case. This value determines the response time according to your service level agreement with Amazon Web Services Support. You can use the DescribeSeverityLevels operation to get the possible values for severityCode.

    For more information, see SeverityLevel and Choosing a Severity in the Amazon Web Services Support User Guide.

    The availability of severity levels depends on the support plan for the Amazon Web Services account.

  • category_code (Optional[CategoryCode], default: None ) –

    The category of problem for the support case. You also use the DescribeServices operation to get the category code for a service. Each Amazon Web Services service defines its own set of category codes.

  • communication_body (CommunicationBody) –

    The communication body text that describes the issue. This text appears in the Description field on the Amazon Web Services Support Center Create Case page.

  • cc_email_addresses (Optional[CcEmailAddressList], default: None ) –

    A list of email addresses that Amazon Web Services Support copies on case correspondence. Amazon Web Services Support identifies the account that creates the case when you specify your Amazon Web Services credentials in an HTTP POST method or use the Amazon Web Services SDKs.

  • language (Optional[Language], default: None ) –

    The language in which Amazon Web Services Support handles the case. Amazon Web Services Support currently supports Chinese (“zh”), English ("en"), Japanese ("ja") , Chinese ("zh"), Spanish ("es"), Portuguese ("pt"), French ("fr"), Korean (“ko”), and Turkish ("tr"). You must specify the ISO 639-1 code for the language parameter if you want support in that language.

  • issue_type (Optional[IssueType], default: None ) –

    The type of issue for the case. You can specify customer-service or technical. If you don't specify a value, the default is technical.

  • attachment_set_id (Optional[AttachmentSetId], default: None ) –

    The ID of a set of one or more attachments for the case. Create the set by using the AddAttachmentsToSet operation. Each attachment in the set must be 5 MB or smaller. To attach files larger than 5 MB, use uploadIds.

  • upload_ids (Optional[UploadIds], default: None ) –

    A list of upload IDs that identify attachments to add to the case. Each uploadId is returned by the GetAttachmentUploadLinks operation. The upload must reach the attachment-ready state by calling CompleteAttachmentUpload before it can be passed here. Use uploadIds to attach files of any supported size, including files larger than 5 MB.

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

    Specifies whether to validate the request without actually creating the case. When set to true, the request is validated but no case is created, 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 create_case(
    self,
    subject: "capo_support.types.subject.Subject",
    communication_body: "capo_support.types.communication_body.CommunicationBody",
    *,
    config_overrides: Optional[AsyncSupportClientConfig] = None,
    service_code: Optional["capo_support.types.service_code2.ServiceCode2"] = None,
    severity_code: Optional["capo_support.types.severity_code.SeverityCode"] = None,
    category_code: Optional["capo_support.types.category_code.CategoryCode"] = None,
    cc_email_addresses: Optional[
        "capo_support.types.cc_email_address_list.CcEmailAddressList"
    ] = None,
    language: Optional["capo_support.types.language.Language"] = None,
    issue_type: Optional["capo_support.types.issue_type.IssueType"] = None,
    attachment_set_id: Optional[
        "capo_support.types.attachment_set_id.AttachmentSetId"
    ] = None,
    upload_ids: Optional["capo_support.types.upload_ids.UploadIds"] = None,
    dry_run: Optional[
        "capo_support.types.nullable_boolean_type.NullableBooleanType"
    ] = None,
) -> "capo_support.types.create_case_response.CreateCaseResponse":
    """<p>Creates a case in the Amazon Web Services Support Center. This operation is similar to how you create a case in the Amazon Web Services Support Center <a href="https://console.aws.amazon.com/support/home#/case/create">Create Case</a> page.</p> <p>The Amazon Web Services Support API doesn't support requesting service limit increases. You can submit a service limit increase in the following ways: </p> <ul> <li> <p>Submit a request from the Amazon Web Services Support Center <a href="https://console.aws.amazon.com/support/home#/case/create">Create Case</a> page.</p> </li> <li> <p>Use the Service Quotas <a href="https://docs.aws.amazon.com/servicequotas/2019-06-24/apireference/API_RequestServiceQuotaIncrease.html">RequestServiceQuotaIncrease</a> operation.</p> </li> </ul> <important> <p>Amazon Web Services Support automatically redacts sensitive information from support cases to protect your data. The following information is replaced with <code>[REDACTED_BY_Amazon Web Services]</code> and is not stored:</p> <ul> <li> <p>Amazon Web Services secret keys - The complete key is replaced. Example: <code>[REDACTED_BY_Amazon Web Services]</code> </p> </li> <li> <p>Private keys - The complete key is replaced. Example: <code>[REDACTED_BY_Amazon Web Services]</code> </p> </li> <li> <p>Credit card numbers - The number is redacted, but the last 4 digits remain. Example: <code>[REDACTED_BY_Amazon Web Services]-7016</code> </p> </li> </ul> <p>This sensitive information is never required by Amazon Web Services Support.</p> </important> <p>A successful <code>CreateCase</code> request returns a Amazon Web Services Support case number. You can use the <a>DescribeCases</a> operation and specify the case number to get existing Amazon Web Services Support cases. After you create a case, use the <a>AddCommunicationToCase</a> operation to add additional communication or attachments to an existing case.</p> <p>The <code>caseId</code> is separate from the <code>displayId</code> that appears in the <a href="https://console.aws.amazon.com/support">Amazon Web Services Support Center</a>. Use the <a>DescribeCases</a> operation to get the <code>displayId</code>.</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:
        subject: <p>The title of the support case. The title appears in the <b>Subject</b> field on the Amazon Web Services Support Center <a href="https://console.aws.amazon.com/support/home#/case/create">Create Case</a> page.</p>
        service_code: <p>The code for the Amazon Web Services service. You can use the <a>DescribeServices</a> operation to get the possible <code>serviceCode</code> values.</p>
        severity_code: <p>A value that indicates the urgency of the case. This value determines the response time according to your service level agreement with Amazon Web Services Support. You can use the <a>DescribeSeverityLevels</a> operation to get the possible values for <code>severityCode</code>. </p> <p>For more information, see <a>SeverityLevel</a> and <a href="https://docs.aws.amazon.com/awssupport/latest/user/getting-started.html#choosing-severity">Choosing a Severity</a> in the <i>Amazon Web Services Support User Guide</i>.</p> <note> <p>The availability of severity levels depends on the support plan for the Amazon Web Services account.</p> </note>
        category_code: <p>The category of problem for the support case. You also use the <a>DescribeServices</a> operation to get the category code for a service. Each Amazon Web Services service defines its own set of category codes.</p>
        communication_body: <p>The communication body text that describes the issue. This text appears in the <b>Description</b> field on the Amazon Web Services Support Center <a href="https://console.aws.amazon.com/support/home#/case/create">Create Case</a> page.</p>
        cc_email_addresses: <p>A list of email addresses that Amazon Web Services Support copies on case correspondence. Amazon Web Services Support identifies the account that creates the case when you specify your Amazon Web Services credentials in an HTTP POST method or use the <a href="http://aws.amazon.com/tools/">Amazon Web Services SDKs</a>. </p>
        language: <p>The language in which Amazon Web Services Support handles the case. Amazon Web Services Support currently supports Chinese (“zh”), English ("en"), Japanese ("ja") , Chinese ("zh"), Spanish ("es"), Portuguese ("pt"), French ("fr"), Korean (“ko”), and Turkish ("tr"). You must specify the ISO 639-1 code for the <code>language</code> parameter if you want support in that language.</p>
        issue_type: <p>The type of issue for the case. You can specify <code>customer-service</code> or <code>technical</code>. If you don't specify a value, the default is <code>technical</code>.</p>
        attachment_set_id: <p>The ID of a set of one or more attachments for the case. Create the set by using the <a>AddAttachmentsToSet</a> operation. Each attachment in the set must be 5 MB or smaller. To attach files larger than 5 MB, use <code>uploadIds</code>.</p>
        upload_ids: <p>A list of upload IDs that identify attachments to add to the case. Each <code>uploadId</code> is returned by the <a>GetAttachmentUploadLinks</a> operation. The upload must reach the <code>attachment-ready</code> state by calling <a>CompleteAttachmentUpload</a> before it can be passed here. Use <code>uploadIds</code> to attach files of any supported size, including files larger than 5 MB.</p>
        dry_run: <p>Specifies whether to validate the request without actually creating the case. When set to <code>true</code>, the request is validated but no case is created, 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_set_expired.AttachmentSetExpired: <p>The expiration time of the attachment set has passed. The set expires 1 hour after it is created.</p>
        capo_support.errors.attachment_set_id_not_found.AttachmentSetIdNotFound: <p>An attachment set with the specified ID could not be found.</p>
        capo_support.errors.case_creation_limit_exceeded.CaseCreationLimitExceeded: <p>The case creation limit for the account 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.create_case_request.CreateCaseRequest]",
    ) -> AsyncOperationResponse[
        "capo_support.types.create_case_response.CreateCaseResponse"
    ]:
        import capo_support._operations.aws_support_20130415.create_case

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCase")
    )
    input_: capo_support.types.create_case_request.CreateCaseRequest = {
        "subject": subject,
        "communication_body": communication_body,
    }
    if service_code is not None:
        input_["service_code"] = service_code
    if severity_code is not None:
        input_["severity_code"] = severity_code
    if category_code is not None:
        input_["category_code"] = category_code
    if cc_email_addresses is not None:
        input_["cc_email_addresses"] = cc_email_addresses
    if language is not None:
        input_["language"] = language
    if issue_type is not None:
        input_["issue_type"] = issue_type
    if attachment_set_id is not None:
        input_["attachment_set_id"] = attachment_set_id
    if upload_ids is not None:
        input_["upload_ids"] = upload_ids
    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