Namespace Google.Apis.CloudSupport.v2beta
Classes
CaseClassificationsResource
The "caseClassifications" collection of methods.
CaseClassificationsResource.SearchRequest
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())
CasesResource
The "cases" collection of methods.
CasesResource.AttachmentsResource
The "attachments" collection of methods.
CasesResource.AttachmentsResource.ListRequest
List all the attachments associated with a support case. EXAMPLES: cURL:
shell
case="projects/some-project/cases/23598314" curl \ --header "Authorization: Bearer $(gcloud auth
print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$case/attachments"
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() .attachments()
.list(parent="projects/some-project/cases/43595344") ) print(request.execute())
CasesResource.CloseRequest
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())
CasesResource.CommentsResource
The "comments" collection of methods.
CasesResource.CommentsResource.CreateRequest
Add a new comment to a case. The comment must have the following fields set: body
. EXAMPLES: cURL:
shell case="projects/some-project/cases/43591344" curl \ --request POST \ --header "Authorization:
Bearer $(gcloud auth print-access-token)" \ --header 'Content-Type: application/json' \ --data '{
"body": "This is a test comment." }' \ "https://cloudsupport.googleapis.com/v2/$case/comments"
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() .comments() .create(
parent="projects/some-project/cases/43595344", body={"body": "This is a test comment."}, ) )
print(request.execute())
CasesResource.CommentsResource.ListRequest
List all the comments associated with a case. EXAMPLES: cURL:
shell
case="projects/some-project/cases/43595344" curl \ --header "Authorization: Bearer $(gcloud auth
print-access-token)" \ "https://cloudsupport.googleapis.com/v2/$case/comments"
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() .comments() .list(parent="projects/some-project/cases/43595344") )
print(request.execute())
CasesResource.CreateRequest
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())
CasesResource.EscalateRequest
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:
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())
CasesResource.GetRequest
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())
CasesResource.ListRequest
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:
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())
CasesResource.PatchRequest
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())
CasesResource.SearchRequest
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:
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().search( parent="projects/some-project", query="state=OPEN" )
print(request.execute())
CasesResource.ShowFeedRequest
Show items in the feed of this case, including case emails, attachments, and comments.
CloudSupportBaseServiceRequest<TResponse>
A base abstract class for CloudSupport requests.
CloudSupportService
The CloudSupport Service.
CloudSupportService.Scope
Available OAuth 2.0 scopes for use with the Google Cloud Support API.
CloudSupportService.ScopeConstants
Available OAuth 2.0 scope constants for use with the Google Cloud Support API.
MediaResource
The "media" collection of methods.
MediaResource.DownloadRequest
Download a file attached to a case. Note: HTTP requests must append "?alt=media" to the URL. EXAMPLES: cURL:
shell name="projects/some-project/cases/43594844/attachments/0674M00000WijAnZAJ" curl \ --header
"Authorization: Bearer $(gcloud auth print-access-token)" \
"https://cloudsupport.googleapis.com/v2/$name:download?alt=media"
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.media().download(
name="projects/some-project/cases/43595344/attachments/0684M00000Pw6pHQAR" ) request.uri =
request.uri.split("?")[0] + "?alt=media" print(request.execute())
MediaResource.UploadMediaUpload
Upload media upload which supports resumable upload.
MediaResource.UploadRequest
Create a file attachment on a case or Cloud resource. The attachment must have the following fields set:
filename
. EXAMPLES: cURL:
shell echo "This text is in a file I'm uploading using CSAPI." \ >
"./example_file.txt" case="projects/some-project/cases/43594844" curl \ --header "Authorization: Bearer
$(gcloud auth print-access-token)" \ --data-binary @"./example_file.txt" \
"https://cloudsupport.googleapis.com/upload/v2beta/$case/attachments?attachment.filename=uploaded_via_curl.txt"
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}", )
file_path = "./example_file.txt" with open(file_path, "w") as file: file.write( "This text is inside a file
I'm going to upload using the Cloud Support API.", ) request = supportApiService.media().upload(
parent="projects/some-project/cases/43595344", media_body=file_path ) request.uri =
request.uri.split("?")[0] + "?attachment.filename=uploaded_via_python.txt" print(request.execute())
Enums
CaseClassificationsResource.SearchRequest.ProductProductLineEnum
The product line of the Product.
CasesResource.ListRequest.ProductLineEnum
The product line to request cases for. If unspecified, only Google Cloud cases will be returned.
CloudSupportBaseServiceRequest<TResponse>.AltEnum
Data format for response.
CloudSupportBaseServiceRequest<TResponse>.XgafvEnum
V1 error format.
MediaResource.UploadMediaUpload.AltEnum
Data format for response.
MediaResource.UploadMediaUpload.XgafvEnum
V1 error format.