Buat kasus baru dan kaitkan dengan orang tua.
File harus memiliki kolom berikut: displayName
, description
, classification
, dan priority
. Jika Anda hanya menguji API dan tidak ingin mengarahkan kasus Anda ke agen, tetapkan testCase=true
.
CONTOH:
{i>cURL<i}:
parent="projects/some-project"
curl \
--request POST \
--header "Authorization: Bearer $(gcloud auth print-access-token)" \
--header 'Content-Type: application/json' \
--data '{
"displayName": "Test case created by me.",
"description": "a random test case, feel free to close",
"classification": {
"id":
"100IK2AKCLHMGRJ9CDGMOCGP8DM6UTB4BT262T31BT1M2T31DHNMENPO6KS36CPJ786L2TBFEHGN6NPI64R3CDHN8880G08I1H3MURR7DHII0GRCDTQM8"
},
"timeZone": "-07:00",
"subscriberEmailAddresses": [
"foo@domain.com",
"bar@domain.com"
],
"testCase": true,
"priority": "P3"
}' \
"https://cloudsupport.googleapis.com/v2/$parent/cases"
Python:
import googleapiclient.discovery
apiVersion = "v2"
supportApiService = googleapiclient.discovery.build(
serviceName="cloudsupport",
version=apiVersion,
discoveryServiceUrl=f"https://cloudsupport.googleapis.com/$discovery/rest?version={apiVersion}",
)
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())
Permintaan HTTP
POST https://cloudsupport.googleapis.com/v2beta/{parent=*/*}/cases
URL menggunakan sintaks gRPC Transcoding.
Parameter jalur
Parameter | |
---|---|
parent |
Wajib. Nama induk yang akan digunakan untuk membuat kasus. |
Isi permintaan
Isi permintaan memuat instance Case
.
Isi respons
Jika berhasil, isi respons memuat instance Case
yang baru dibuat.
Cakupan otorisasi
Memerlukan salah satu cakupan OAuth berikut:
https://www.googleapis.com/auth/cloudsupport
https://www.googleapis.com/auth/cloud-platform
Untuk informasi selengkapnya, lihat Ringkasan Autentikasi.