# BigQuery Reservation API . projects . locations

## Instance Methods

Returns the capacityCommitments Resource.

Returns the reservations Resource.

Close httplib2 connections.

Retrieves a BI reservation.

Looks up assignments for a specified resource for a particular region. If the request is about a project: 1. Assignments created on the project will be returned if they exist. 2. Otherwise assignments created on the closest ancestor will be returned. 3. Assignments for different JobTypes will all be returned. The same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1. permission on the assignee will be verified in this API. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is `projects/*/locations/*`, instead of `projects/*/locations/*reservations/*`.

Retrieves the next page of results.

Deprecated: Looks up assignments for a specified resource for a particular region. If the request is about a project: 1. Assignments created on the project will be returned if they exist. 2. Otherwise assignments created on the closest ancestor will be returned. 3. Assignments for different JobTypes will all be returned. The same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1. permission on the assignee will be verified in this API. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is `projects/*/locations/*`, instead of `projects/*/locations/*reservations/*`. **Note** "-" cannot be used for projects nor locations.

Retrieves the next page of results.

Updates a BI reservation. Only fields specified in the `field_mask` are updated. A singleton BI reservation always exists with default size 0. In order to reserve BI capacity it needs to be updated to an amount greater than 0. In order to release BI capacity reservation size must be set to 0.

### Method Details

`close()`

    Close httplib2 connections.

`getBiReservation(name, x__xgafv=None)`

    Retrieves a BI reservation.

    Args:
      name: string, Required. Name of the requested reservation, for example: `projects/{project_id}/locations/{location_id}/biReservation` (required)
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Represents a BI Reservation.
      "name": "A String", # The resource name of the singleton BI reservation. Reservation names have the form `projects/{project_id}/locations/{location_id}/biReservation`.
      "preferredTables": [ # Preferred tables to use BI capacity for.
        { # Fully qualified reference to BigQuery table. Internally stored as google.cloud.bi.v1.BqTableReference.
          "datasetId": "A String", # The ID of the dataset in the above project.
          "projectId": "A String", # The assigned project ID of the project.
          "tableId": "A String", # The ID of the table in the above dataset.
        },
      ],
      "size": "A String", # Size of a reservation, in bytes.
      "updateTime": "A String", # Output only. The last update timestamp of a reservation.
    }

`searchAllAssignments(parent, pageSize=None, pageToken=None, query=None, x__xgafv=None)`

    Looks up assignments for a specified resource for a particular region. If the request is about a project: 1. Assignments created on the project will be returned if they exist. 2. Otherwise assignments created on the closest ancestor will be returned. 3. Assignments for different JobTypes will all be returned. The same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1. permission on the assignee will be verified in this API. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is `projects/*/locations/*`, instead of `projects/*/locations/*reservations/*`.

    Args:
      parent: string, Required. The resource name with location (project name could be the wildcard '-'), e.g.: `projects/-/locations/US`. (required)
      pageSize: integer, The maximum number of items to return per page.
      pageToken: string, The next_page_token value returned from a previous List request, if any.
      query: string, Please specify resource name as assignee in the query. Examples: * `assignee=projects/myproject` * `assignee=folders/123` * `assignee=organizations/456`
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # The response for ReservationService.SearchAllAssignments.
      "assignments": [ # List of assignments visible to the user.
        { # An assignment allows a project to submit jobs of a certain type using slots from the specified reservation.
          "assignee": "A String", # The resource which will use the reservation. E.g. `projects/myproject`, `folders/123`, or `organizations/456`.
          "jobType": "A String", # Which type of jobs will use the reservation.
          "name": "A String", # Output only. Name of the resource. E.g.: `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. The assignment_id must only contain lower case alphanumeric characters or dashes and the max length is 64 characters.
          "state": "A String", # Output only. State of the assignment.
        },
      ],
      "nextPageToken": "A String", # Token to retrieve the next page of results, or empty if there are no more results in the list.
    }

`searchAllAssignments_next()`

    Retrieves the next page of results.

            Args:
              previous_request: The request for the previous page. (required)
              previous_response: The response from the request for the previous page. (required)

            Returns:
              A request object that you can call 'execute()' on to request the next
              page. Returns None if there are no more items in the collection.

`searchAssignments(parent, pageSize=None, pageToken=None, query=None, x__xgafv=None)`

    Deprecated: Looks up assignments for a specified resource for a particular region. If the request is about a project: 1. Assignments created on the project will be returned if they exist. 2. Otherwise assignments created on the closest ancestor will be returned. 3. Assignments for different JobTypes will all be returned. The same logic applies if the request is about a folder. If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors). Comparing to ListAssignments, there are some behavior differences: 1. permission on the assignee will be verified in this API. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is `projects/*/locations/*`, instead of `projects/*/locations/*reservations/*`. **Note** "-" cannot be used for projects nor locations.

    Args:
      parent: string, Required. The resource name of the admin project(containing project and location), e.g.: `projects/myproject/locations/US`. (required)
      pageSize: integer, The maximum number of items to return per page.
      pageToken: string, The next_page_token value returned from a previous List request, if any.
      query: string, Please specify resource name as assignee in the query. Examples: * `assignee=projects/myproject` * `assignee=folders/123` * `assignee=organizations/456`
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # The response for ReservationService.SearchAssignments.
      "assignments": [ # List of assignments visible to the user.
        { # An assignment allows a project to submit jobs of a certain type using slots from the specified reservation.
          "assignee": "A String", # The resource which will use the reservation. E.g. `projects/myproject`, `folders/123`, or `organizations/456`.
          "jobType": "A String", # Which type of jobs will use the reservation.
          "name": "A String", # Output only. Name of the resource. E.g.: `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. The assignment_id must only contain lower case alphanumeric characters or dashes and the max length is 64 characters.
          "state": "A String", # Output only. State of the assignment.
        },
      ],
      "nextPageToken": "A String", # Token to retrieve the next page of results, or empty if there are no more results in the list.
    }

`searchAssignments_next()`

    Retrieves the next page of results.

            Args:
              previous_request: The request for the previous page. (required)
              previous_response: The response from the request for the previous page. (required)

            Returns:
              A request object that you can call 'execute()' on to request the next
              page. Returns None if there are no more items in the collection.

`updateBiReservation(name, body=None, updateMask=None, x__xgafv=None)`

    Updates a BI reservation. Only fields specified in the `field_mask` are updated. A singleton BI reservation always exists with default size 0. In order to reserve BI capacity it needs to be updated to an amount greater than 0. In order to release BI capacity reservation size must be set to 0.

    Args:
      name: string, The resource name of the singleton BI reservation. Reservation names have the form `projects/{project_id}/locations/{location_id}/biReservation`. (required)
      body: object, The request body.
        The object takes the form of:

    { # Represents a BI Reservation.
      "name": "A String", # The resource name of the singleton BI reservation. Reservation names have the form `projects/{project_id}/locations/{location_id}/biReservation`.
      "preferredTables": [ # Preferred tables to use BI capacity for.
        { # Fully qualified reference to BigQuery table. Internally stored as google.cloud.bi.v1.BqTableReference.
          "datasetId": "A String", # The ID of the dataset in the above project.
          "projectId": "A String", # The assigned project ID of the project.
          "tableId": "A String", # The ID of the table in the above dataset.
        },
      ],
      "size": "A String", # Size of a reservation, in bytes.
      "updateTime": "A String", # Output only. The last update timestamp of a reservation.
    }

      updateMask: string, A list of fields to be updated in this request.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Represents a BI Reservation.
      "name": "A String", # The resource name of the singleton BI reservation. Reservation names have the form `projects/{project_id}/locations/{location_id}/biReservation`.
      "preferredTables": [ # Preferred tables to use BI capacity for.
        { # Fully qualified reference to BigQuery table. Internally stored as google.cloud.bi.v1.BqTableReference.
          "datasetId": "A String", # The ID of the dataset in the above project.
          "projectId": "A String", # The assigned project ID of the project.
          "tableId": "A String", # The ID of the table in the above dataset.
        },
      ],
      "size": "A String", # Size of a reservation, in bytes.
      "updateTime": "A String", # Output only. The last update timestamp of a reservation.
    }