Struct rustyspanner::client::Client [−][src]
pub struct Client { /* fields omitted */ }
Client for interacting with Cloud Spanner API.
Methods
impl Client
[src]
impl Client
pub fn new(project_id: String) -> Self
[src]
pub fn new(project_id: String) -> Self
Initializes a new Client with a given project_id
.
Arguments
project_id
- ThisString
represents the project id to work with. Note: Don't confuse the project id with the project name.
Return value
A Client
connected to a specified project.
pub fn project_name(&self) -> String
[src]
pub fn project_name(&self) -> String
Project name to be used with Spanner APIs.
The project name is of form:
projects/{project_id}
Return value
A String
representing the project name to be used with the Cloud Spanner
Admin API RPC service.
pub fn id(&self) -> &String
[src]
pub fn id(&self) -> &String
pub fn instance_admin_api(&self) -> &InstanceAdminClient
[src]
pub fn instance_admin_api(&self) -> &InstanceAdminClient
Helper for session-related API calls.
pub fn database_admin_api(&self) -> &DatabaseAdminClient
[src]
pub fn database_admin_api(&self) -> &DatabaseAdminClient
Helpers for session-related API calls.
pub fn list_instance_configs(
&mut self,
page_size: Option<i32>,
page_token: Option<String>
) -> ListInstanceConfigs
[src]
pub fn list_instance_configs(
&mut self,
page_size: Option<i32>,
page_token: Option<String>
) -> ListInstanceConfigs
List available instance configutations for the client's project.
See RPC docs
Arguments
-
page_size
- (Optional) Maximum number of results to return. -
page_token
- (Optional) Token for fetching next page of results.
Return value
A ListInstanceConfigs
struct with the result.
pub fn instance(
&self,
instance_id: String,
config_name: Option<String>,
display_name: Option<String>,
node_count: Option<i32>
) -> Instance
[src]
pub fn instance(
&self,
instance_id: String,
config_name: Option<String>,
display_name: Option<String>,
node_count: Option<i32>
) -> Instance
Factory to create a instance associated with this client.
Arguments
-
instance_id
- The ID of the instance. -
config_name
- (Optional) Name of the instance configuration used to set up instance's cluster, in the form:projects/<project_id>/instanceConfigs/<config>
. Required for instances which do not yet exist. -
display_name
- (Optional) The display name for the instance in the Cloud Console UI. (Must be between 4 and 30 characters.) If this value is not set in the constructor, will fall back to the instance ID. -
node_count
- (Optional) The number of nodes in the instance's cluster; used to set up the instance's cluster.
Return value
An Instance
owned by this client.
pub fn list_instances(
&mut self,
filter: Option<String>,
page_size: Option<i32>,
page_token: Option<String>
) -> ListInstances
[src]
pub fn list_instances(
&mut self,
filter: Option<String>,
page_size: Option<i32>,
page_token: Option<String>
) -> ListInstances
List instances for the client's project.
See RPC docs
Arguments
-
filter
- (Optional) Filter to select instances listed. See theListIntancesRequest
docs above for examples. -
page_size
- (Optional) Maximum number of results to return. -
page_token
- (Optional) Token for fetching next page of results.
Return value
A ListInstances
struct with the result.