Skip to main content

attachments

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

Overview

Nameattachments
TypeResource
Idgoogle.cloudsupport.attachments

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Identifier. The resource name of the attachment.
createTimestring (google-datetime)Output only. The time at which the attachment was created.
creatorobjectOutput only. The user who uploaded the attachment. Note, the name and email will be obfuscated if the attachment was uploaded by Google support. (id: Actor)
filenamestringThe filename of the attachment (e.g. "graph.jpg").
mimeTypestringOutput only. The MIME type of the attachment (e.g. text/plain).
sizeBytesstring (int64)Output only. The size of the attachment in bytes.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectparentType, parentpageSize, pageTokenList 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())

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
parentstring
parentTypestring
pageSizeinteger (int32)
pageTokenstring

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 parentType = '{{ parentType }}' -- required
AND parent = '{{ parent }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';