Billing Usage API, gRPC: MetadataService.GetResourceIDs
GetResourceIDs returns all resource IDs for a specific billing account and date range
with pagination support.
This method retrieves a list of all resource IDs that have usage records
within the specified date range and billing account. The results can be
filtered by a case-insensitive substring search on the resource ID.
Implementation details:
- Filtering is done using case-insensitive substring matching
- Only resource IDs with actual usage in the period are returned
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 GetResourceIDs (GetResourceIDsRequest) returns (GetResourceIDsResponse)
GetResourceIDsRequest
{
"billing_account_id": "string",
"start_date": "google.protobuf.Timestamp",
"end_date": "google.protobuf.Timestamp",
"resource_id": "string",
"page_size": "int64",
"page_token": "string"
}
GetResourceIDsRequest request for retrieving resource IDs.
This message defines the parameters needed to fetch and filter resource IDs
associated with a billing account within a date range.
|
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. |
|
resource_id |
string Optional. Resource ID pattern for search filtering. |
|
page_size |
int64 Optional. Page size for paginated results. |
|
page_token |
string Optional. Page token for paginated results. |
GetResourceIDsResponse
{
"resource_ids": [
"string"
],
"next_page_token": "string"
}
Response for resource IDs request.
This message contains a list of resource IDs that match the search criteria
specified in the request, along with pagination information.
|
Field |
Description |
|
resource_ids[] |
string List of resource IDs matching the request criteria. |
|
next_page_token |
string Token for getting the next page of results. It should be passed verbatim in subsequent requests. |