I have to fetch billing data from BigQuery table in which the billing export was done. I have the project Id and Data set ID. To achieve this I followed these steps:
1. Fetched the list of tables present in that dataset and checked that table name matches with "gcp_billing_export_resource_v1_".
2. If that table name matches to the above value then i considered this as the billing export table. but here's the problem.I am able to create a table with this prefix and with same schema in that scenario i have two tables here. How to verify which one is valid?
As in GCP doc table name structure is mentioned like "gcp_billing_export_resource_v1_<BILLING_ACCOUNT_ID>" so that i tried to get BILLING ACCOUNT ID for the project. but that also failing.
the code is :
GetProjectBillingInfoRequest request = GetProjectBillingInfoRequest.newBuilder().setName(ProjectBillingInfoName.of("PROJECT_NAME_HERE").toString()).build();
CloudBillingClient billing = CloudBillingClient.create(settings);
billing.getProjectBillingInfo(request);
in the above code i am getting this error
"com.google.api.gax.rpc.InvalidArgumentException: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Request contains an invalid argument."
So I am not able to verify the table that is the one configured for billing export.
What is the change required to achieve this?
Thank you,
cloudGeek