dina
dina

Reputation: 4289

how to add `maximumBillingTier` to query

here is is in the docs, but where do I add it to the query?

curl  -X POST \
-H "Authorization: Bearer <your_oauth2_token>" -H "Content-Length: 8" \
-H "Content-Type: application/json" \
'https://www.googleapis.com/bigquery/v2/projects/my-project/queries' \
-d "{ 
  timeoutMs: 600000,
  queryParameters: [],
  query:
   'SELECT * FROM [my-project:Views.TEST_11]',
  maxResults: 0,
  kind: 'bigquery#queryRequest'
}
"

is it part of the body?

-d "{
  ...
  ..
  maximumBillingTier: '2',
"

it does not seem to be part of the QueryRequest body

Upvotes: 0

Views: 66

Answers (1)

ebeltran
ebeltran

Reputation: 469

You are trying to use jobs.query API; however, this uses the object QueryRequest which doesn't have the maximumBillingTier option, to use this option you should to use the jobs.insert API instead.

The body for jobs.insert should look like this:

{
  "configuration": {
    "query": {
      "query": "Select * from mydataset.mytable",
      "maximumBillingTier": 1
    }
  }
}

Upvotes: 1

Related Questions