cases
Creates, updates, deletes, gets or lists a cases
resource.
Overview
Name | cases |
Type | Resource |
Id | google.cloudsupport.cases |
Fields
The following fields are returned by SELECT
queries:
- get
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The resource name for the case. |
classification | object | The issue classification applicable to this case. (id: CaseClassification) |
contactEmail | string | 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. |
createTime | string (google-datetime) | Output only. The time this case was created. |
creator | object | The user who created the case. Note: The name and email will be obfuscated if the case was created by Google Support. (id: Actor) |
description | string | A broad description of the issue. |
displayName | string | The short summary of the issue reported in this case. |
escalated | boolean | Whether the case is currently escalated. |
languageCode | string | The 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 |
priority | string | The priority of this case. |
state | string | Output only. The current status of the support case. |
subscriberEmailAddresses | array | The email addresses to receive updates on this case. |
testCase | boolean | Whether this case was created for internal API testing and should not be acted on by the support team. |
timeZone | string | 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. |
updateTime | string (google-datetime) | Output only. The time this case was last updated. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | name | 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()) | |
create | insert | parentType , parent | 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()) | |
patch | update | name | updateMask | Update 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()) |
close | exec | name | Close a case. EXAMPLES: cURL: shell case="projects/some-project/cases/43595344" curl \ --request POST \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$case:close" 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().close( name="projects/some-project/cases/43595344" ) print(request.execute()) | |
search | exec | query , pageSize , pageToken | Retrieve valid classifications to use when creating a support case. Classifications are hierarchical. Each classification is a string containing all levels of the hierarchy separated by " > " . For example, "Technical Issue > Compute > Compute Engine" . Classification IDs returned by this endpoint are valid for at least six months. When a classification is deactivated, this endpoint immediately stops returning it. After six months, case.create requests using the classification will fail. EXAMPLES: cURL: shell curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ 'https://cloudsupport.googleapis.com/v2/caseClassifications:search?query=display_name:"*Compute%20Engine*"' Python: python import googleapiclient.discovery supportApiService = googleapiclient.discovery.build( serviceName="cloudsupport", version="v2", discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=v2", ) request = supportApiService.caseClassifications().search( query='display_name:"*Compute Engine*"' ) print(request.execute()) |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
name | string | |
parent | string | |
parentType | string | |
pageSize | integer (int32) | |
pageToken | string | |
query | string | |
updateMask | string (google-fieldmask) |
SELECT
examples
- get
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,
classification,
contactEmail,
createTime,
creator,
description,
displayName,
escalated,
languageCode,
priority,
state,
subscriberEmailAddresses,
testCase,
timeZone,
updateTime
FROM google.cloudsupport.cases
WHERE name = '{{ name }}' -- required;
INSERT
examples
- create
- Manifest
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())
INSERT INTO google.cloudsupport.cases (
data__name,
data__displayName,
data__description,
data__classification,
data__timeZone,
data__subscriberEmailAddresses,
data__creator,
data__contactEmail,
data__escalated,
data__testCase,
data__languageCode,
data__priority,
parentType,
parent
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ description }}',
'{{ classification }}',
'{{ timeZone }}',
'{{ subscriberEmailAddresses }}',
'{{ creator }}',
'{{ contactEmail }}',
{{ escalated }},
{{ testCase }},
'{{ languageCode }}',
'{{ priority }}',
'{{ parentType }}',
'{{ parent }}'
RETURNING
name,
classification,
contactEmail,
createTime,
creator,
description,
displayName,
escalated,
languageCode,
priority,
state,
subscriberEmailAddresses,
testCase,
timeZone,
updateTime
;
# Description fields are for documentation purposes
- name: cases
props:
- name: parentType
value: string
description: Required parameter for the cases resource.
- name: parent
value: string
description: Required parameter for the cases resource.
- name: name
value: string
description: >
Identifier. The resource name for the case.
- name: displayName
value: string
description: >
The short summary of the issue reported in this case.
- name: description
value: string
description: >
A broad description of the issue.
- name: classification
value: object
description: >
The issue classification applicable to this case.
- name: timeZone
value: string
description: >
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.
- name: subscriberEmailAddresses
value: array
description: >
The email addresses to receive updates on this case.
- name: creator
value: object
description: >
The user who created the case. Note: The name and email will be obfuscated if the case was created by Google Support.
- name: contactEmail
value: string
description: >
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.
- name: escalated
value: boolean
description: >
Whether the case is currently escalated.
- name: testCase
value: boolean
description: >
Whether this case was created for internal API testing and should not be acted on by the support team.
- name: languageCode
value: string
description: >
The 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
- name: priority
value: string
description: >
The priority of this case.
valid_values: ['PRIORITY_UNSPECIFIED', 'P0', 'P1', 'P2', 'P3', 'P4']
UPDATE
examples
- patch
Update 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())
UPDATE google.cloudsupport.cases
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__classification = '{{ classification }}',
data__timeZone = '{{ timeZone }}',
data__subscriberEmailAddresses = '{{ subscriberEmailAddresses }}',
data__creator = '{{ creator }}',
data__contactEmail = '{{ contactEmail }}',
data__escalated = {{ escalated }},
data__testCase = {{ testCase }},
data__languageCode = '{{ languageCode }}',
data__priority = '{{ priority }}'
WHERE
name = '{{ name }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
classification,
contactEmail,
createTime,
creator,
description,
displayName,
escalated,
languageCode,
priority,
state,
subscriberEmailAddresses,
testCase,
timeZone,
updateTime;
Lifecycle Methods
- close
- search
Close a case. EXAMPLES: cURL: shell case="projects/some-project/cases/43595344" curl \ --request POST \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$case:close"
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().close( name="projects/some-project/cases/43595344" ) print(request.execute())
EXEC google.cloudsupport.cases.close
@name='{{ name }}' --required;
Retrieve valid classifications to use when creating a support case. Classifications are hierarchical. Each classification is a string containing all levels of the hierarchy separated by " > "
. For example, "Technical Issue > Compute > Compute Engine"
. Classification IDs returned by this endpoint are valid for at least six months. When a classification is deactivated, this endpoint immediately stops returning it. After six months, case.create
requests using the classification will fail. EXAMPLES: cURL: shell curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ 'https://cloudsupport.googleapis.com/v2/caseClassifications:search?query=display_name:"*Compute%20Engine*"'
Python: python import googleapiclient.discovery supportApiService = googleapiclient.discovery.build( serviceName="cloudsupport", version="v2", discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version=v2", ) request = supportApiService.caseClassifications().search( query='display_name:"*Compute Engine*"' ) print(request.execute())
EXEC google.cloudsupport.cases.search
@query='{{ query }}',
@pageSize='{{ pageSize }}',
@pageToken='{{ pageToken }}';