创建新个案,并将其与某个父级相关联。
它必须设置以下字段:displayName
、description
、classification
和 priority
。如果您只是测试 API,并且不想将您的支持请求转送给客服人员,请设置 testCase=true
。
示例:
c网址:
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())
HTTP 请求
POST https://cloudsupport.googleapis.com/v2beta/{parent=*/*}/cases
网址采用 gRPC 转码语法。
路径参数
参数 | |
---|---|
parent |
必需。应在其下创建支持请求的父级的名称。 |
请求正文
请求正文包含一个 Case
实例。
响应正文
如果成功,响应正文将包含一个新创建的 Case
实例。
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/cloudsupport
https://www.googleapis.com/auth/cloud-platform
如需了解详情,请参阅身份验证概览。