Create a new case and associate it with a parent. It must have the following fields set: display_name, description, classification, and priority. If you're just testing the API and don't want to route your case to an agent, set testCase=true. EXAMPLES: cURL: shell parent="projects/some-project" curl \ --request POST \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ --header 'Content-Type: application/json' \ --data '{ "display_name": "Test case created by me.", "description": "a random test case, feel free to close", "classification": { "id": "100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8" }, "time_zone": "-07:00", "subscriber_email_addresses": [ "foo@domain.com", "bar@domain.com" ], "testCase": true, "priority": "P3" }' \ "https://cloudsupport.googleapis.com/v2/$parent/cases" Python: python import googleapiclient.discovery api_version = "v2" supportApiService = googleapiclient.discovery.build( serviceName="cloudsupport", version=api_version, discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={api_version}", ) request = supportApiService.cases().create( parent="projects/some-project", body={ "displayName": "A Test Case", "description": "This is a test case.", "testCase": True, "priority": "P2", "classification": { "id": "100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8" }, }, ) print(request.execute())

Scopes

You will need authorization for the https://www.googleapis.com/auth/cloud-platform scope to make a valid call.

If unset, the scope for this method defaults to https://www.googleapis.com/auth/cloud-platform. You can set the scope for this method like this: cloudsupport2-beta --scope <scope> cases create ...

Required Scalar Argument

  • <parent> (string)
    • Required. The name of the parent under which the case should be created.

Required Request Value

The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.

For example, a structure like this:

Case:
  classification:
    display-name: string
    id: string
    product:
      product-line: string
      product-subline: string
  contact-email: string
  create-time: string
  creator:
    display-name: string
    email: string
    google-support: boolean
    username: string
  description: string
  display-name: string
  escalated: boolean
  language-code: string
  name: string
  priority: string
  severity: string
  state: string
  subscriber-email-addresses: [string]
  test-case: boolean
  time-zone: string
  update-time: string

can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.

  • -r .classification display-name=duo
    • A display name for the classification. The display name is not static and can change. To uniquely and consistently identify classifications, use the CaseClassification.id field.
  • id=ipsum
    • The unique ID for a classification. Must be specified for case creation. To retrieve valid classification IDs for case creation, use caseClassifications.search. Classification IDs returned by caseClassifications.search are guaranteed to be valid for at least 6 months. If a given classification is deactiveated, it will immediately stop being returned. After 6 months, case.create requests using the classification ID will fail.
  • product product-line=gubergren
    • The Product Line of the Product.
  • product-subline=lorem

    • The Product Subline of the Product, such as "Maps Billing".
  • ... contact-email=gubergren

    • A user-supplied email address to send case update notifications for. This should only be used in BYOID flows, where we cannot infer the user's email address directly from their EUCs.
  • create-time=eos
    • Output only. The time this case was created.
  • creator display-name=dolor
    • The name to display for the actor. If not provided, it is inferred from credentials supplied during case creation. When an email is provided, a display name must also be provided. This will be obfuscated if the user is a Google Support agent.
  • email=ea
    • The email address of the actor. If not provided, it is inferred from the credentials supplied during case creation. When a name is provided, an email must also be provided. If the user is a Google Support agent, this is obfuscated. This field is deprecated. Use username field instead.
  • google-support=true
    • Output only. Whether the actor is a Google support actor.
  • username=invidunt

    • Output only. The username of the actor. It may look like an email or other format provided by the identity provider. If not provided, it is inferred from the credentials supplied. When a name is provided, a username must also be provided. If the user is a Google Support agent, this will not be set.
  • .. description=amet

    • A broad description of the issue.
  • display-name=duo
    • The short summary of the issue reported in this case.
  • escalated=true
    • Whether the case is currently escalated.
  • language-code=sed
    • The language the user has requested to receive support in. This should be a BCP 47 language code (e.g., &#34;en&#34;, &#34;zh-CN&#34;, &#34;zh-TW&#34;, &#34;ja&#34;, &#34;ko&#34;). If no language or an unsupported language is specified, this field defaults to English (en). Language selection during case creation may affect your available support options. For a list of supported languages and their support working hours, see: https://cloud.google.com/support/docs/language-working-hours
  • name=ut
    • The resource name for the case.
  • priority=gubergren
    • The priority of this case.
  • severity=rebum.
    • REMOVED. The severity of this case. Use priority instead.
  • state=est
    • Output only. The current status of the support case.
  • subscriber-email-addresses=ipsum
    • The email addresses to receive updates on this case.
    • Each invocation of this argument appends the given value to the array.
  • test-case=true
    • Whether this case was created for internal API testing and should not be acted on by the support team.
  • time-zone=est
    • The timezone of the user who created the support case. It should be in a format IANA recognizes: https://www.iana.org/time-zones. There is no additional validation done by the API.
  • update-time=gubergren
    • Output only. The time this case was last updated.

About Cursors

The cursor position is key to comfortably set complex nested structures. The following rules apply:

  • The cursor position is always set relative to the current one, unless the field name starts with the . character. Fields can be nested such as in -r f.s.o .
  • The cursor position is set relative to the top-level structure if it starts with ., e.g. -r .s.s
  • You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify -r struct.sub_struct=bar.
  • You can move the cursor one level up by using ... Each additional . moves it up one additional level. E.g. ... would go three levels up.

Optional Output Flags

The method's return value a JSON encoded structure, which will be written to standard output by default.

  • -o out
    • out specifies the destination to which to write the server's result to. It will be a JSON-encoded structure. The destination may be - to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.

Optional General Properties

The following properties can configure any call, and are not specific to this method.

  • -p $-xgafv=string

    • V1 error format.
  • -p access-token=string

    • OAuth access token.
  • -p alt=string

    • Data format for response.
  • -p callback=string

    • JSONP
  • -p fields=string

    • Selector specifying which fields to include in a partial response.
  • -p key=string

    • API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
  • -p oauth-token=string

    • OAuth 2.0 token for the current user.
  • -p pretty-print=boolean

    • Returns response with indentations and line breaks.
  • -p quota-user=string

    • Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
  • -p upload-type=string

    • Legacy upload protocol for media (e.g. "media", "multipart").
  • -p upload-protocol=string

    • Upload protocol for media (e.g. "raw", "multipart").