Skip to main content

attachments

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

Overview

Nameattachments
TypeResource
Idgoogle.cloudsupport.attachments

Fields

NameDatatypeDescription
namestringOutput only. The resource name of the attachment.
createTimestringOutput only. The time at which the attachment 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.
filenamestringThe filename of the attachment (e.g. "graph.jpg").
mimeTypestringOutput only. The MIME type of the attachment (e.g. text/plain).
sizeBytesstringOutput only. The size of the attachment in bytes.

Methods

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

SELECT examples

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

SELECT
name,
createTime,
creator,
filename,
mimeType,
sizeBytes
FROM google.cloudsupport.attachments
WHERE parent = '{{ parent }}'
AND parentType = '{{ parentType }}';