Search Client#

Client for interacting with the Google Cloud search API.

class, credentials=None, http=None)[source]#

Bases: gcloud.client.JSONClient

Client to bundle configuration needed for API requests.

  • project (string) – the project which the client acts on behalf of. Will be passed when creating a index. If not passed, falls back to the default inferred from the environment.
  • credentials (oauth2client.client.OAuth2Credentials or NoneType) – The OAuth2 Credentials to use for the connection owned by this client. If not passed (and if no http object is passed), falls back to the default inferred from the environment.
  • http (httplib2.Http or class that defines request().) – An optional HTTP object to make requests. If not passed, an http object is created that is bound to the credentials for the current object.

Construct an index bound to this client.

Parameters:name (string) – Name of the index.
Returns:a new Index instance
list_indexes(max_results=None, page_token=None, view=None, prefix=None)[source]#

List indexes for the project associated with this client.


  • max_results (int) – maximum number of indexes to return, If not passed, defaults to a value set by the API.
  • page_token (string) – opaque marker for the next “page” of indexes. If not passed, the API will return the first page of indexes.
  • view (string) – One of ‘ID_ONLY’ (return only the index ID; the default) or ‘FULL’ (return information on indexed fields).
  • prefix (string) – return only indexes whose ID starts with prefix.
Return type:

tuple, (list, str)


list of gcloud.dns.index.Index, plus a “next page token” string: if the token is not None, indicates that more indexes can be retrieved with another call (pass that value as page_token).


Create / interact with gcloud search connections.

class, http=None)[source]#

Bases: gcloud.connection.JSONConnection

A connection to Google Cloud Search via the JSON REST API.


The base of the API call URL.

API_URL_TEMPLATE = '{api_base_url}/{api_version}{path}'#

A template for the URL of a particular API call.


The version of the API, used in building the API call’s URL.

SCOPE = ('',)#

The scopes required for authenticating as a Cloud Search consumer.