BigQuery Reservations API: Location EU not possible

Viewed 200

I'm having trouble with the BigQuery slot reservation API. It seems the only valid location I can input is "US". I'm getting "Location ID: EU is invalid.". However, reservations are definitely possible for EU in the Console as well. I've also tried regions and zones with no luck...

Example code:

region = 'EU'
admin_project_id = 'admin_project'

def api_builder():
    res_api = ReservationServiceClient()
    parent_arg = "projects/{}/locations/{}".format(
        admin_project_id, region)
    return(res_api, parent_arg)

def purchase_commitment(slots=500):
    api = api_builder()
    res_api = api[0]
    parent_arg = api[1]
    commit_config = CapacityCommitment(plan='FLEX', slot_count=slots)
    commit = res_api.create_capacity_commitment(parent=parent_arg,
                                                capacity_commitment=commit_config)
    print(commit)
    return commit.name

1 Answers
Related