Skip to main content

cases

Creates, updates, deletes, gets or lists a cases resource.

Overview

Namecases
TypeResource
Idgoogle.cloudsupport.cases

Fields

NameDatatypeDescription
namestringThe resource name for the case.
descriptionstringA broad description of the issue.
classificationobjectA Case Classification represents the topic that a case is about. It's very important to use accurate classifications, because they're used to route your cases to specialists who can help you. A classification always has an ID that is its unique identifier. A valid ID is required when creating a case.
contactEmailstringA 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.
createTimestringOutput only. The time this case was created.
creatorobjectAn Actor represents an entity that performed an action. For example, an actor could be a user who posted a comment on a support case, a user who uploaded an attachment, or a service account that created a support case.
displayNamestringThe short summary of the issue reported in this case.
escalatedbooleanWhether the case is currently escalated.
languageCodestringThe language the user has requested to receive support in. This should be a BCP 47 language code (e.g., "en", "zh-CN", "zh-TW", "ja", "ko"). 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
prioritystringThe priority of this case.
statestringOutput only. The current status of the support case.
subscriberEmailAddressesarrayThe email addresses to receive updates on this case.
testCasebooleanWhether this case was created for internal API testing and should not be acted on by the support team.
timeZonestringThe 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.
updateTimestringOutput only. The time this case was last updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTnameRetrieve a case. EXAMPLES: cURL: shell case="projects/some-project/cases/16033687" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$case" 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().get( name="projects/some-project/cases/43595344", ) print(request.execute())
listSELECTparent, parentTypeRetrieve all cases under a parent, but not its children. For example, listing cases under an organization only returns the cases that are directly parented by that organization. To retrieve cases under an organization and its projects, use cases.search. EXAMPLES: cURL: shell parent="projects/some-project" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "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().list(parent="projects/some-project") print(request.execute())
createINSERTparent, parentTypeCreate 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())
patchUPDATEnameUpdate a case. Only some fields can be updated. EXAMPLES: cURL: shell case="projects/some-project/cases/43595344" curl \ --request PATCH \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ --header "Content-Type: application/json" \ --data '{ "priority": "P1" }' \ "https://cloudsupport.googleapis.com/v2/$case?updateMask=priority" 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().patch( name="projects/some-project/cases/43112854", body={ "displayName": "This is Now a New Title", "priority": "P2", }, ) print(request.execute())
escalateEXECnameEscalate a case, starting the Google Cloud Support escalation management process. This operation is only available for some support services. Go to https://cloud.google.com/support and look for 'Technical support escalations' in the feature list to find out which ones let you do that. EXAMPLES: cURL: shell case="projects/some-project/cases/43595344" curl \ --request POST \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ --header "Content-Type: application/json" \ --data '{ "escalation": { "reason": "BUSINESS_IMPACT", "justification": "This is a test escalation." } }' \ "https://cloudsupport.googleapis.com/v2/$case:escalate" 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().escalate( name="projects/some-project/cases/43595344", body={ "escalation": { "reason": "BUSINESS_IMPACT", "justification": "This is a test escalation.", }, }, ) print(request.execute())

SELECT examples

Retrieve a case. EXAMPLES: cURL: shell case="projects/some-project/cases/16033687" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$case" 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().get( name="projects/some-project/cases/43595344", ) print(request.execute())

SELECT
name,
description,
classification,
contactEmail,
createTime,
creator,
displayName,
escalated,
languageCode,
priority,
state,
subscriberEmailAddresses,
testCase,
timeZone,
updateTime
FROM google.cloudsupport.cases
WHERE name = '{{ name }}';

INSERT example

Use the following StackQL query and manifest file to create a new cases resource.

/*+ create */
INSERT INTO google.cloudsupport.cases (
parent,
parentType,
languageCode,
classification,
contactEmail,
escalated,
description,
priority,
name,
testCase,
timeZone,
creator,
subscriberEmailAddresses,
displayName
)
SELECT
'{{ parent }}',
'{{ parentType }}',
'{{ languageCode }}',
'{{ classification }}',
'{{ contactEmail }}',
{{ escalated }},
'{{ description }}',
'{{ priority }}',
'{{ name }}',
{{ testCase }},
'{{ timeZone }}',
'{{ creator }}',
'{{ subscriberEmailAddresses }}',
'{{ displayName }}'
;

UPDATE example

Updates a cases resource.

/*+ update */
UPDATE google.cloudsupport.cases
SET
languageCode = '{{ languageCode }}',
classification = '{{ classification }}',
contactEmail = '{{ contactEmail }}',
escalated = true|false,
description = '{{ description }}',
priority = '{{ priority }}',
name = '{{ name }}',
testCase = true|false,
timeZone = '{{ timeZone }}',
creator = '{{ creator }}',
subscriberEmailAddresses = '{{ subscriberEmailAddresses }}',
displayName = '{{ displayName }}'
WHERE
name = '{{ name }}';