Billing Usage API, gRPC: MetadataService.GetCloud
GetCloud returns available folders for specified clouds within a billing account
with optional filtering by cloud IDs, folder IDs and pagination support.
This method returns a hierarchical view of clouds and their folders that the user
has access to within the specified date range. Results can be filtered by
specific cloud IDs and/or folder IDs, and pagination is supported for handling
large result sets.
Implementation details:
- The method result does not contain empty cloud id information
- Filtering is done using case-insensitive substring matching
- Only clouds with at least one folder are included in the response
- Folder pagination is based on folder IDs, ordered alphabetically
- NextPageToken is only returned when there are more results available
- Base64-encoded page tokens are used for pagination state
Error handling:
- Returns INVALID_ARGUMENT if the request parameters fail validation
- Returns UNAUTHENTICATED if the user is not authenticated or the billing account does not exist
- Returns PERMISSION_DENIED if the user lacks required permissions
- Returns INTERNAL for internal server errors
Required permissions:
billing.accounts.getReporton the specified billing account
gRPC request
rpc GetCloud (GetCloudRequest) returns (GetCloudResponse)
GetCloudRequest
{
"billing_account_id": "string",
"start_date": "google.protobuf.Timestamp",
"end_date": "google.protobuf.Timestamp",
"cloud_ids": [
"string"
],
"folder_ids": [
"string"
],
"page_size": "int64",
"page_token": "string"
}
Request for retrieving folder metadata
|
Field |
Description |
|
billing_account_id |
string Required field. Required. Billing account identifier. |
|
start_date |
Required field. Start date for data retrieval. |
|
end_date |
Required field. End date for data retrieval. |
|
cloud_ids[] |
string Optional. List of cloud IDs to filter clouds by. |
|
folder_ids[] |
string Optional. List of folder IDs to filter folders by. |
|
page_size |
int64 Optional. Page size for paginated results. |
|
page_token |
string Optional. Page token for paginated results. |
GetCloudResponse
{
"items": [
{
"cloud": {
"id": "string",
"name": "string"
},
"folders": [
{
"id": "string",
"name": "string"
}
]
}
],
"next_page_token": "string"
}
Response for cloud metadata request
|
Field |
Description |
|
items[] |
List of clouds matching the request criteria Note: only clouds with at least one folder are included in the response. |
|
next_page_token |
string Token for getting the next page of results. It should be passed verbatim in subsequent requests. |
CloudInfo
Information about a cloud and its folders
|
Field |
Description |
|
cloud |
Cloud information |
|
folders[] |
List of folders belonging to this cloud Only folders that had usage during the specified date range are included. |
Cloud
Represents a cloud entity
|
Field |
Description |
|
id |
string Unique identifier of the cloud entity. |
|
name |
string Human-readable display name of the cloud. |
Folder
Represents a folder entity
|
Field |
Description |
|
id |
string Unique identifier of the folder entity. |
|
name |
string Human-readable display name of the folder. |