Skip to main content

comments

Creates, updates, deletes, gets or lists a comments resource.

Overview

Namecomments
TypeResource
Idgoogle.cloudsupport.comments

Fields

NameDatatypeDescription
namestringOutput only. Identifier. The resource name of the comment.
bodystringThe full comment body. Maximum of 12800 characters.
createTimestringOutput only. The time when the comment was created.
creatorobjectAn Actor represents an entity that performed an action. For example, an actor could be a user who posted a comment on a support case, a user who uploaded an attachment, or a service account that created a support case.
plainTextBodystringOutput only. DEPRECATED. DO NOT USE. A duplicate of the body field. This field is only present for legacy reasons.

Methods

NameAccessible byRequired ParamsDescription
listSELECTparent, parentTypeList 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())
createINSERTparent, parentTypeAdd 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())

SELECT examples

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())

SELECT
name,
body,
createTime,
creator,
plainTextBody
FROM google.cloudsupport.comments
WHERE parent = '{{ parent }}'
AND parentType = '{{ parentType }}';

INSERT example

Use the following StackQL query and manifest file to create a new comments resource.

/*+ create */
INSERT INTO google.cloudsupport.comments (
parent,
parentType,
body
)
SELECT
'{{ parent }}',
'{{ parentType }}',
'{{ body }}'
;