Documentation
¶
Overview ¶
Package apiv2_client provides an experimental combined client for interacting with the various RPC services that comprise the BigQuery v2 API surface. It simplifies interactions with the bigquery service by allowing the user to only manage a single unified client rather than instantiating multiple clients.
Index ¶
- type Client
- func (mc *Client) BatchDeleteRowAccessPolicies(ctx context.Context, req *bigquerypb.BatchDeleteRowAccessPoliciesRequest, ...) error
- func (mc *Client) CancelJob(ctx context.Context, req *bigquerypb.CancelJobRequest, opts ...gax.CallOption) (*bigquerypb.JobCancelResponse, error)
- func (mc *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (mc *Client) CreateRowAccessPolicy(ctx context.Context, req *bigquerypb.CreateRowAccessPolicyRequest, ...) (*bigquerypb.RowAccessPolicy, error)
- func (mc *Client) DeleteDataset(ctx context.Context, req *bigquerypb.DeleteDatasetRequest, ...) error
- func (mc *Client) DeleteJob(ctx context.Context, req *bigquerypb.DeleteJobRequest, opts ...gax.CallOption) error
- func (mc *Client) DeleteModel(ctx context.Context, req *bigquerypb.DeleteModelRequest, ...) error
- func (mc *Client) DeleteRoutine(ctx context.Context, req *bigquerypb.DeleteRoutineRequest, ...) error
- func (mc *Client) DeleteRowAccessPolicy(ctx context.Context, req *bigquerypb.DeleteRowAccessPolicyRequest, ...) error
- func (mc *Client) DeleteTable(ctx context.Context, req *bigquerypb.DeleteTableRequest, ...) error
- func (mc *Client) GetDataset(ctx context.Context, req *bigquerypb.GetDatasetRequest, opts ...gax.CallOption) (*bigquerypb.Dataset, error)
- func (mc *Client) GetJob(ctx context.Context, req *bigquerypb.GetJobRequest, opts ...gax.CallOption) (*bigquerypb.Job, error)
- func (mc *Client) GetModel(ctx context.Context, req *bigquerypb.GetModelRequest, opts ...gax.CallOption) (*bigquerypb.Model, error)
- func (mc *Client) GetQueryResults(ctx context.Context, req *bigquerypb.GetQueryResultsRequest, ...) (*bigquerypb.GetQueryResultsResponse, error)
- func (mc *Client) GetRoutine(ctx context.Context, req *bigquerypb.GetRoutineRequest, opts ...gax.CallOption) (*bigquerypb.Routine, error)
- func (mc *Client) GetRowAccessPolicy(ctx context.Context, req *bigquerypb.GetRowAccessPolicyRequest, ...) (*bigquerypb.RowAccessPolicy, error)
- func (mc *Client) GetServiceAccount(ctx context.Context, req *bigquerypb.GetServiceAccountRequest, ...) (*bigquerypb.GetServiceAccountResponse, error)
- func (mc *Client) GetTable(ctx context.Context, req *bigquerypb.GetTableRequest, opts ...gax.CallOption) (*bigquerypb.Table, error)
- func (mc *Client) InsertDataset(ctx context.Context, req *bigquerypb.InsertDatasetRequest, ...) (*bigquerypb.Dataset, error)
- func (mc *Client) InsertJob(ctx context.Context, req *bigquerypb.InsertJobRequest, opts ...gax.CallOption) (*bigquerypb.Job, error)
- func (mc *Client) InsertRoutine(ctx context.Context, req *bigquerypb.InsertRoutineRequest, ...) (*bigquerypb.Routine, error)
- func (mc *Client) InsertTable(ctx context.Context, req *bigquerypb.InsertTableRequest, ...) (*bigquerypb.Table, error)
- func (mc *Client) ListDatasets(ctx context.Context, req *bigquerypb.ListDatasetsRequest, ...) *bigquery.ListFormatDatasetIterator
- func (mc *Client) ListJobs(ctx context.Context, req *bigquerypb.ListJobsRequest, opts ...gax.CallOption) *bigquery.ListFormatJobIterator
- func (mc *Client) ListModels(ctx context.Context, req *bigquerypb.ListModelsRequest, opts ...gax.CallOption) *bigquery.ModelIterator
- func (mc *Client) ListRoutines(ctx context.Context, req *bigquerypb.ListRoutinesRequest, ...) *bigquery.RoutineIterator
- func (mc *Client) ListRowAccessPolicies(ctx context.Context, req *bigquerypb.ListRowAccessPoliciesRequest, ...) *bigquery.RowAccessPolicyIterator
- func (mc *Client) ListTables(ctx context.Context, req *bigquerypb.ListTablesRequest, opts ...gax.CallOption) *bigquery.ListFormatTableIterator
- func (mc *Client) PatchDataset(ctx context.Context, req *bigquerypb.UpdateOrPatchDatasetRequest, ...) (*bigquerypb.Dataset, error)
- func (mc *Client) PatchModel(ctx context.Context, req *bigquerypb.PatchModelRequest, opts ...gax.CallOption) (*bigquerypb.Model, error)
- func (mc *Client) PatchTable(ctx context.Context, req *bigquerypb.UpdateOrPatchTableRequest, ...) (*bigquerypb.Table, error)
- func (mc *Client) Query(ctx context.Context, req *bigquerypb.PostQueryRequest, opts ...gax.CallOption) (*bigquerypb.QueryResponse, error)
- func (mc *Client) UndeleteDataset(ctx context.Context, req *bigquerypb.UndeleteDatasetRequest, ...) (*bigquerypb.Dataset, error)
- func (mc *Client) UpdateDataset(ctx context.Context, req *bigquerypb.UpdateOrPatchDatasetRequest, ...) (*bigquerypb.Dataset, error)
- func (mc *Client) UpdateRoutine(ctx context.Context, req *bigquerypb.UpdateRoutineRequest, ...) (*bigquerypb.Routine, error)
- func (mc *Client) UpdateRowAccessPolicy(ctx context.Context, req *bigquerypb.UpdateRowAccessPolicyRequest, ...) (*bigquerypb.RowAccessPolicy, error)
- func (mc *Client) UpdateTable(ctx context.Context, req *bigquerypb.UpdateOrPatchTableRequest, ...) (*bigquerypb.Table, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the aggregate client which manages the various per-RPC service clients.
func NewClient ¶
NewClient creates a new Client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
func NewRESTClient ¶
NewRESTClient creates a new Client based on REST. The returned client must be Closed when it is done being used to clean up its underlying connections.
func (*Client) BatchDeleteRowAccessPolicies ¶
func (mc *Client) BatchDeleteRowAccessPolicies(ctx context.Context, req *bigquerypb.BatchDeleteRowAccessPoliciesRequest, opts ...gax.CallOption) error
BatchDeleteRowAccessPolicies deletes provided row access policies.
func (*Client) CancelJob ¶
func (mc *Client) CancelJob(ctx context.Context, req *bigquerypb.CancelJobRequest, opts ...gax.CallOption) (*bigquerypb.JobCancelResponse, error)
CancelJob requests that a job be cancelled. This call will return immediately, and the client will need to poll for the job status to see if the cancel completed successfully. Cancelled jobs may still incur costs.
func (*Client) Close ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection
deprecated
func (c *Client) Connection() *grpc.ClientConn
Deprecated: Connection() always returns nil. This method exists solely to satisfy the underlying per-RPC service interface(s) and should not be used.
func (*Client) CreateRowAccessPolicy ¶
func (mc *Client) CreateRowAccessPolicy(ctx context.Context, req *bigquerypb.CreateRowAccessPolicyRequest, opts ...gax.CallOption) (*bigquerypb.RowAccessPolicy, error)
CreateRowAccessPolicy creates a row access policy.
func (*Client) DeleteDataset ¶
func (mc *Client) DeleteDataset(ctx context.Context, req *bigquerypb.DeleteDatasetRequest, opts ...gax.CallOption) error
DeleteDataset deletes the dataset specified by the datasetId value. Before you can delete a dataset, you must delete all its tables, either manually or by specifying deleteContents. Immediately after deletion, you can create another dataset with the same name.
func (*Client) DeleteJob ¶
func (mc *Client) DeleteJob(ctx context.Context, req *bigquerypb.DeleteJobRequest, opts ...gax.CallOption) error
DeleteJob requests the deletion of the metadata of a job. This call returns when the job’s metadata is deleted.
func (*Client) DeleteModel ¶
func (mc *Client) DeleteModel(ctx context.Context, req *bigquerypb.DeleteModelRequest, opts ...gax.CallOption) error
DeleteModel deletes the model specified by modelId from the dataset.
func (*Client) DeleteRoutine ¶
func (mc *Client) DeleteRoutine(ctx context.Context, req *bigquerypb.DeleteRoutineRequest, opts ...gax.CallOption) error
DeleteRoutine deletes the routine specified by routineId from the dataset.
func (*Client) DeleteRowAccessPolicy ¶
func (mc *Client) DeleteRowAccessPolicy(ctx context.Context, req *bigquerypb.DeleteRowAccessPolicyRequest, opts ...gax.CallOption) error
DeleteRowAccessPolicy deletes a row access policy.
func (*Client) DeleteTable ¶
func (mc *Client) DeleteTable(ctx context.Context, req *bigquerypb.DeleteTableRequest, opts ...gax.CallOption) error
DeleteTable deletes the table specified by tableId from the dataset. If the table contains data, all the data will be deleted.
func (*Client) GetDataset ¶
func (mc *Client) GetDataset(ctx context.Context, req *bigquerypb.GetDatasetRequest, opts ...gax.CallOption) (*bigquerypb.Dataset, error)
GetDataset returns the dataset specified by datasetID.
func (*Client) GetJob ¶
func (mc *Client) GetJob(ctx context.Context, req *bigquerypb.GetJobRequest, opts ...gax.CallOption) (*bigquerypb.Job, error)
GetJob returns information about a specific job. Job information is available for a six month period after creation. Requires that you’re the person who ran the job, or have the Is Owner project role.
func (*Client) GetModel ¶
func (mc *Client) GetModel(ctx context.Context, req *bigquerypb.GetModelRequest, opts ...gax.CallOption) (*bigquerypb.Model, error)
GetModel gets the specified model resource by model ID.
func (*Client) GetQueryResults ¶
func (mc *Client) GetQueryResults(ctx context.Context, req *bigquerypb.GetQueryResultsRequest, opts ...gax.CallOption) (*bigquerypb.GetQueryResultsResponse, error)
GetQueryResults rPC to get the results of a query job.
func (*Client) GetRoutine ¶
func (mc *Client) GetRoutine(ctx context.Context, req *bigquerypb.GetRoutineRequest, opts ...gax.CallOption) (*bigquerypb.Routine, error)
GetRoutine gets the specified routine resource by routine ID.
func (*Client) GetRowAccessPolicy ¶
func (mc *Client) GetRowAccessPolicy(ctx context.Context, req *bigquerypb.GetRowAccessPolicyRequest, opts ...gax.CallOption) (*bigquerypb.RowAccessPolicy, error)
GetRowAccessPolicy gets the specified row access policy by policy ID.
func (*Client) GetServiceAccount ¶
func (mc *Client) GetServiceAccount(ctx context.Context, req *bigquerypb.GetServiceAccountRequest, opts ...gax.CallOption) (*bigquerypb.GetServiceAccountResponse, error)
GetServiceAccount rPC to get the service account for a project used for interactions with Google Cloud KMS
func (*Client) GetTable ¶
func (mc *Client) GetTable(ctx context.Context, req *bigquerypb.GetTableRequest, opts ...gax.CallOption) (*bigquerypb.Table, error)
GetTable gets the specified table resource by table ID. This method does not return the data in the table, it only returns the table resource, which describes the structure of this table.
func (*Client) InsertDataset ¶
func (mc *Client) InsertDataset(ctx context.Context, req *bigquerypb.InsertDatasetRequest, opts ...gax.CallOption) (*bigquerypb.Dataset, error)
InsertDataset creates a new empty dataset.
func (*Client) InsertJob ¶
func (mc *Client) InsertJob(ctx context.Context, req *bigquerypb.InsertJobRequest, opts ...gax.CallOption) (*bigquerypb.Job, error)
InsertJob starts a new asynchronous job.
This API has two different kinds of endpoint URIs, as this method supports a variety of use cases.
The Metadata URI is used for most interactions, as it accepts the job configuration directly. The Upload URI is ONLY for the case when you’re sending both a load job configuration and a data stream together. In this case, the Upload URI accepts the job configuration and the data as two distinct multipart MIME parts.
func (*Client) InsertRoutine ¶
func (mc *Client) InsertRoutine(ctx context.Context, req *bigquerypb.InsertRoutineRequest, opts ...gax.CallOption) (*bigquerypb.Routine, error)
InsertRoutine creates a new routine in the dataset.
func (*Client) InsertTable ¶
func (mc *Client) InsertTable(ctx context.Context, req *bigquerypb.InsertTableRequest, opts ...gax.CallOption) (*bigquerypb.Table, error)
InsertTable creates a new, empty table in the dataset.
func (*Client) ListDatasets ¶
func (mc *Client) ListDatasets(ctx context.Context, req *bigquerypb.ListDatasetsRequest, opts ...gax.CallOption) *bigquery.ListFormatDatasetIterator
ListDatasets lists all datasets in the specified project to which the user has been granted the READER dataset role.
func (*Client) ListJobs ¶
func (mc *Client) ListJobs(ctx context.Context, req *bigquerypb.ListJobsRequest, opts ...gax.CallOption) *bigquery.ListFormatJobIterator
ListJobs lists all jobs that you started in the specified project. Job information is available for a six month period after creation. The job list is sorted in reverse chronological order, by job creation time. Requires the Can View project role, or the Is Owner project role if you set the allUsers property.
func (*Client) ListModels ¶
func (mc *Client) ListModels(ctx context.Context, req *bigquerypb.ListModelsRequest, opts ...gax.CallOption) *bigquery.ModelIterator
ListModels lists all models in the specified dataset. Requires the READER dataset role. After retrieving the list of models, you can get information about a particular model by calling the models.get method.
func (*Client) ListRoutines ¶
func (mc *Client) ListRoutines(ctx context.Context, req *bigquerypb.ListRoutinesRequest, opts ...gax.CallOption) *bigquery.RoutineIterator
ListRoutines lists all routines in the specified dataset. Requires the READER dataset role.
func (*Client) ListRowAccessPolicies ¶
func (mc *Client) ListRowAccessPolicies(ctx context.Context, req *bigquerypb.ListRowAccessPoliciesRequest, opts ...gax.CallOption) *bigquery.RowAccessPolicyIterator
ListRowAccessPolicies lists all row access policies on the specified table.
func (*Client) ListTables ¶
func (mc *Client) ListTables(ctx context.Context, req *bigquerypb.ListTablesRequest, opts ...gax.CallOption) *bigquery.ListFormatTableIterator
ListTables lists all tables in the specified dataset. Requires the READER dataset role.
func (*Client) PatchDataset ¶
func (mc *Client) PatchDataset(ctx context.Context, req *bigquerypb.UpdateOrPatchDatasetRequest, opts ...gax.CallOption) (*bigquerypb.Dataset, error)
PatchDataset updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource. This method supports RFC5789 patch semantics.
func (*Client) PatchModel ¶
func (mc *Client) PatchModel(ctx context.Context, req *bigquerypb.PatchModelRequest, opts ...gax.CallOption) (*bigquerypb.Model, error)
PatchModel patch specific fields in the specified model.
func (*Client) PatchTable ¶
func (mc *Client) PatchTable(ctx context.Context, req *bigquerypb.UpdateOrPatchTableRequest, opts ...gax.CallOption) (*bigquerypb.Table, error)
PatchTable updates information in an existing table. The update method replaces the entire table resource, whereas the patch method only replaces fields that are provided in the submitted table resource. This method supports RFC5789 patch semantics.
func (*Client) Query ¶
func (mc *Client) Query(ctx context.Context, req *bigquerypb.PostQueryRequest, opts ...gax.CallOption) (*bigquerypb.QueryResponse, error)
Query runs a BigQuery SQL query synchronously and returns query results if the query completes within a specified timeout.
func (*Client) UndeleteDataset ¶
func (mc *Client) UndeleteDataset(ctx context.Context, req *bigquerypb.UndeleteDatasetRequest, opts ...gax.CallOption) (*bigquerypb.Dataset, error)
UndeleteDataset undeletes a dataset which is within time travel window based on datasetId. If a time is specified, the dataset version deleted at that time is undeleted, else the last live version is undeleted.
func (*Client) UpdateDataset ¶
func (mc *Client) UpdateDataset(ctx context.Context, req *bigquerypb.UpdateOrPatchDatasetRequest, opts ...gax.CallOption) (*bigquerypb.Dataset, error)
UpdateDataset updates information in an existing dataset. The update method replaces the entire dataset resource, whereas the patch method only replaces fields that are provided in the submitted dataset resource.
func (*Client) UpdateRoutine ¶
func (mc *Client) UpdateRoutine(ctx context.Context, req *bigquerypb.UpdateRoutineRequest, opts ...gax.CallOption) (*bigquerypb.Routine, error)
UpdateRoutine updates information in an existing routine. The update method replaces the entire Routine resource.
func (*Client) UpdateRowAccessPolicy ¶
func (mc *Client) UpdateRowAccessPolicy(ctx context.Context, req *bigquerypb.UpdateRowAccessPolicyRequest, opts ...gax.CallOption) (*bigquerypb.RowAccessPolicy, error)
UpdateRowAccessPolicy updates a row access policy.
func (*Client) UpdateTable ¶
func (mc *Client) UpdateTable(ctx context.Context, req *bigquerypb.UpdateOrPatchTableRequest, opts ...gax.CallOption) (*bigquerypb.Table, error)
UpdateTable updates information in an existing table. The update method replaces the entire Table resource, whereas the patch method only replaces fields that are provided in the submitted Table resource.