class Cases extends Resource (View source)

The "cases" collection of methods.

Typical usage is:

 $cloudsupportService = new Google\Service\CloudSupport(...);
 $cases = $cloudsupportService->cases;

Methods

close(string $name, CloseCaseRequest $postBody, array $optParams = [])

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.co m/$discovery/rest?version={api_version}", ) request = supportApiService.cases().close( name="projects/some-project/cases/43595344" ) print(request.execute()) (cases.close)

create(string $parent, CloudsupportCase $postBody, array $optParams = [])

Create a new case and associate it with a parent. It must have the following fields set: display_name, description, classification, and priority.

escalate(string $name, EscalateCaseRequest $postBody, array $optParams = [])

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


--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.co
m/$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()) ``` (cases.escalate)

get(string $name, array $optParams = [])

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()) (cases.get)

listCases(string $parent, array $optParams = [])

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


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()) ``` (cases.listCases)

patch(string $name, CloudsupportCase $postBody, array $optParams = [])

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()) (cases.patch)

search(string $parent, array $optParams = [])

Search for cases using a query. EXAMPLES: cURL: shell parent="projects/some-project" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$parent/cases:search" Python:


supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport", version=api_version, discoveryServiceUrl=f"https:
//cloudsupport.googleapis.com/$discovery/rest?version={api_version}", )
request = supportApiService.cases().search( parent="projects/some-project",
query="state=OPEN" ) print(request.execute()) ``` (cases.search)

Details

CloudsupportCase close(string $name, CloseCaseRequest $postBody, array $optParams = [])

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.co m/$discovery/rest?version={api_version}", ) request = supportApiService.cases().close( name="projects/some-project/cases/43595344" ) print(request.execute()) (cases.close)

Parameters

string $name

Required. The name of the case to close.

CloseCaseRequest $postBody
array $optParams

Optional parameters.

Return Value

CloudsupportCase

Exceptions

Exception

CloudsupportCase create(string $parent, CloudsupportCase $postBody, array $optParams = [])

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": "100IK2AKCLHMGRJ9CDGMOCG P8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3M URR7DHII0GRCDTQM8" }, "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.co m/$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": "100IK2AKCLHMGR J9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN888 0G08I1H3MURR7DHII0GRCDTQM8" }, }, ) print(request.execute()) (cases.create)

Parameters

string $parent

Required. The name of the parent under which the case should be created.

CloudsupportCase $postBody
array $optParams

Optional parameters.

Return Value

CloudsupportCase

Exceptions

Exception

CloudsupportCase escalate(string $name, EscalateCaseRequest $postBody, array $optParams = [])

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


--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.co
m/$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()) ``` (cases.escalate)

Parameters

string $name

Required. The name of the case to be escalated.

EscalateCaseRequest $postBody
array $optParams

Optional parameters.

Return Value

CloudsupportCase

Exceptions

Exception

CloudsupportCase get(string $name, array $optParams = [])

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()) (cases.get)

Parameters

string $name

Required. The full name of a case to be retrieved.

array $optParams

Optional parameters.

Return Value

CloudsupportCase

Exceptions

Exception

ListCasesResponse listCases(string $parent, array $optParams = [])

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


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()) ``` (cases.listCases)

Parameters

string $parent

Required. The name of a parent to list cases under.

array $optParams

Optional parameters.

Return Value

ListCasesResponse

Exceptions

Exception

CloudsupportCase patch(string $name, CloudsupportCase $postBody, array $optParams = [])

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()) (cases.patch)

Parameters

string $name

The resource name for the case.

CloudsupportCase $postBody
array $optParams

Optional parameters.

Return Value

CloudsupportCase

Exceptions

Exception

Search for cases using a query. EXAMPLES: cURL: shell parent="projects/some-project" curl \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$parent/cases:search" Python:


supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport", version=api_version, discoveryServiceUrl=f"https:
//cloudsupport.googleapis.com/$discovery/rest?version={api_version}", )
request = supportApiService.cases().search( parent="projects/some-project",
query="state=OPEN" ) print(request.execute()) ``` (cases.search)

Parameters

string $parent

The name of the parent resource to search for cases under.

array $optParams

Optional parameters.

Return Value

SearchCasesResponse

Exceptions

Exception