Package metastore is an auto-generated package for the Dataproc Metastore API.
The Dataproc Metastore API is used to manage the lifecycle and configuration of metastore services.
NOTE : This package is in beta . It is not stable , and may be subject to changes .
Example usage
To get started with this package, create a client.
ctx := context . Background () // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c , err := metastore . NewDataprocMetastoreClient ( ctx ) if err != nil { // TODO: Handle error. } defer c . Close ()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client.
ctx := context . Background () // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c , err := metastore . NewDataprocMetastoreClient ( ctx ) if err != nil { // TODO: Handle error. } defer c . Close () req := & metastorepb . ListServicesRequest { // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#ListServicesRequest. } it := c . ListServices ( ctx , req ) for { resp , err := it . Next () if err == iterator . Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Use of Context
The ctx passed to NewDataprocMetastoreClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
For information about setting deadlines, reusing contexts, and more please visit https://pkg.go.dev/cloud.google.com/go .
Functions
func DefaultAuthScopes
func
DefaultAuthScopes
()
[]
string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
BackupIterator
type
BackupIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
metastorepb
.
Backup
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
BackupIterator manages a stream of *metastorepb.Backup.
func (*BackupIterator) Next
func
(
it
*
BackupIterator
)
Next
()
(
*
metastorepb
.
Backup
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*BackupIterator) PageInfo
func
(
it
*
BackupIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
CreateBackupOperation
type
CreateBackupOperation
struct
{
// contains filtered or unexported fields
}
CreateBackupOperation manages a long-running operation from CreateBackup.
func (*CreateBackupOperation) Done
func
(
op
*
CreateBackupOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*CreateBackupOperation) Metadata
func
(
op
*
CreateBackupOperation
)
Metadata
()
(
*
metastorepb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateBackupOperation) Name
func
(
op
*
CreateBackupOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateBackupOperation) Poll
func
(
op
*
CreateBackupOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Backup
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateBackupOperation) Wait
func
(
op
*
CreateBackupOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Backup
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateFederationOperation
type
CreateFederationOperation
struct
{
// contains filtered or unexported fields
}
CreateFederationOperation manages a long-running operation from CreateFederation.
func (*CreateFederationOperation) Done
func
(
op
*
CreateFederationOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*CreateFederationOperation) Metadata
func
(
op
*
CreateFederationOperation
)
Metadata
()
(
*
metastorepb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateFederationOperation) Name
func
(
op
*
CreateFederationOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateFederationOperation) Poll
func
(
op
*
CreateFederationOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Federation
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateFederationOperation) Wait
func
(
op
*
CreateFederationOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Federation
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateMetadataImportOperation
type
CreateMetadataImportOperation
struct
{
// contains filtered or unexported fields
}
CreateMetadataImportOperation manages a long-running operation from CreateMetadataImport.
func (*CreateMetadataImportOperation) Done
func
(
op
*
CreateMetadataImportOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*CreateMetadataImportOperation) Metadata
func
(
op
*
CreateMetadataImportOperation
)
Metadata
()
(
*
metastorepb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateMetadataImportOperation) Name
func
(
op
*
CreateMetadataImportOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateMetadataImportOperation) Poll
func
(
op
*
CreateMetadataImportOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
MetadataImport
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateMetadataImportOperation) Wait
func
(
op
*
CreateMetadataImportOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
MetadataImport
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateServiceOperation
type
CreateServiceOperation
struct
{
// contains filtered or unexported fields
}
CreateServiceOperation manages a long-running operation from CreateService.
func (*CreateServiceOperation) Done
func
(
op
*
CreateServiceOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*CreateServiceOperation) Metadata
func
(
op
*
CreateServiceOperation
)
Metadata
()
(
*
metastorepb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateServiceOperation) Name
func
(
op
*
CreateServiceOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateServiceOperation) Poll
func
(
op
*
CreateServiceOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Service
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateServiceOperation) Wait
func
(
op
*
CreateServiceOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Service
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DataprocMetastoreCallOptions
type
DataprocMetastoreCallOptions
struct
{
ListServices
[]
gax
.
CallOption
GetService
[]
gax
.
CallOption
CreateService
[]
gax
.
CallOption
UpdateService
[]
gax
.
CallOption
DeleteService
[]
gax
.
CallOption
ListMetadataImports
[]
gax
.
CallOption
GetMetadataImport
[]
gax
.
CallOption
CreateMetadataImport
[]
gax
.
CallOption
UpdateMetadataImport
[]
gax
.
CallOption
ExportMetadata
[]
gax
.
CallOption
RestoreService
[]
gax
.
CallOption
ListBackups
[]
gax
.
CallOption
GetBackup
[]
gax
.
CallOption
CreateBackup
[]
gax
.
CallOption
DeleteBackup
[]
gax
.
CallOption
GetLocation
[]
gax
.
CallOption
ListLocations
[]
gax
.
CallOption
GetIamPolicy
[]
gax
.
CallOption
SetIamPolicy
[]
gax
.
CallOption
TestIamPermissions
[]
gax
.
CallOption
DeleteOperation
[]
gax
.
CallOption
GetOperation
[]
gax
.
CallOption
ListOperations
[]
gax
.
CallOption
}
DataprocMetastoreCallOptions contains the retry settings for each method of DataprocMetastoreClient.
DataprocMetastoreClient
type
DataprocMetastoreClient
struct
{
// The call options for this service.
CallOptions
*
DataprocMetastoreCallOptions
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient
*
lroauto
.
OperationsClient
// contains filtered or unexported fields
}
DataprocMetastoreClient is a client for interacting with Dataproc Metastore API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Configures and manages metastore services. Metastore services are fully managed, highly available, autoscaled, autohealing, OSS-native deployments of technical metadata management software. Each metastore service exposes a network endpoint through which metadata queries are served. Metadata queries can originate from a variety of sources, including Apache Hive, Apache Presto, and Apache Spark.
The Dataproc Metastore API defines the following resource model:
The service works with a collection of Google Cloud projects, named:
/projects/*
Each project has a collection of available locations, named: /locations/*
(a location must refer to a Google Cloud region)
Each location has a collection of services, named: /services/*
Dataproc Metastore services are resources with names of the form:
/projects/{project_number}/locations/{location_id}/services/{service_id}.
func NewDataprocMetastoreClient
func
NewDataprocMetastoreClient
(
ctx
context
.
Context
,
opts
...
option
.
ClientOption
)
(
*
DataprocMetastoreClient
,
error
)
NewDataprocMetastoreClient creates a new dataproc metastore client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Configures and manages metastore services. Metastore services are fully managed, highly available, autoscaled, autohealing, OSS-native deployments of technical metadata management software. Each metastore service exposes a network endpoint through which metadata queries are served. Metadata queries can originate from a variety of sources, including Apache Hive, Apache Presto, and Apache Spark.
The Dataproc Metastore API defines the following resource model:
The service works with a collection of Google Cloud projects, named:
/projects/*
Each project has a collection of available locations, named: /locations/*
(a location must refer to a Google Cloud region)
Each location has a collection of services, named: /services/*
Dataproc Metastore services are resources with names of the form:
/projects/{project_number}/locations/{location_id}/services/{service_id}.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
// TODO: Use client.
_
=
c
}
func NewDataprocMetastoreRESTClient
func
NewDataprocMetastoreRESTClient
(
ctx
context
.
Context
,
opts
...
option
.
ClientOption
)
(
*
DataprocMetastoreClient
,
error
)
NewDataprocMetastoreRESTClient creates a new dataproc metastore rest client.
Configures and manages metastore services. Metastore services are fully managed, highly available, autoscaled, autohealing, OSS-native deployments of technical metadata management software. Each metastore service exposes a network endpoint through which metadata queries are served. Metadata queries can originate from a variety of sources, including Apache Hive, Apache Presto, and Apache Spark.
The Dataproc Metastore API defines the following resource model:
The service works with a collection of Google Cloud projects, named:
/projects/*
Each project has a collection of available locations, named: /locations/*
(a location must refer to a Google Cloud region)
Each location has a collection of services, named: /services/*
Dataproc Metastore services are resources with names of the form:
/projects/{project_number}/locations/{location_id}/services/{service_id}.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreRESTClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
// TODO: Use client.
_
=
c
}
func (*DataprocMetastoreClient) Close
func
(
c
*
DataprocMetastoreClient
)
Close
()
error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*DataprocMetastoreClient) Connection (deprecated)
func
(
c
*
DataprocMetastoreClient
)
Connection
()
*
grpc
.
ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*DataprocMetastoreClient) CreateBackup
func
(
c
*
DataprocMetastoreClient
)
CreateBackup
(
ctx
context
.
Context
,
req
*
metastorepb
.
CreateBackupRequest
,
opts
...
gax
.
CallOption
)
(
*
CreateBackupOperation
,
error
)
CreateBackup creates a new backup in a given project and location.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
CreateBackupRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#CreateBackupRequest.
}
op
,
err
:=
c
.
CreateBackup
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) CreateBackupOperation
func
(
c
*
DataprocMetastoreClient
)
CreateBackupOperation
(
name
string
)
*
CreateBackupOperation
CreateBackupOperation returns a new CreateBackupOperation from a given name. The name must be that of a previously created CreateBackupOperation, possibly from a different process.
func (*DataprocMetastoreClient) CreateMetadataImport
func
(
c
*
DataprocMetastoreClient
)
CreateMetadataImport
(
ctx
context
.
Context
,
req
*
metastorepb
.
CreateMetadataImportRequest
,
opts
...
gax
.
CallOption
)
(
*
CreateMetadataImportOperation
,
error
)
CreateMetadataImport creates a new MetadataImport in a given project and location.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
CreateMetadataImportRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#CreateMetadataImportRequest.
}
op
,
err
:=
c
.
CreateMetadataImport
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) CreateMetadataImportOperation
func
(
c
*
DataprocMetastoreClient
)
CreateMetadataImportOperation
(
name
string
)
*
CreateMetadataImportOperation
CreateMetadataImportOperation returns a new CreateMetadataImportOperation from a given name. The name must be that of a previously created CreateMetadataImportOperation, possibly from a different process.
func (*DataprocMetastoreClient) CreateService
func
(
c
*
DataprocMetastoreClient
)
CreateService
(
ctx
context
.
Context
,
req
*
metastorepb
.
CreateServiceRequest
,
opts
...
gax
.
CallOption
)
(
*
CreateServiceOperation
,
error
)
CreateService creates a metastore service in a project and location.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
CreateServiceRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#CreateServiceRequest.
}
op
,
err
:=
c
.
CreateService
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) CreateServiceOperation
func
(
c
*
DataprocMetastoreClient
)
CreateServiceOperation
(
name
string
)
*
CreateServiceOperation
CreateServiceOperation returns a new CreateServiceOperation from a given name. The name must be that of a previously created CreateServiceOperation, possibly from a different process.
func (*DataprocMetastoreClient) DeleteBackup
func
(
c
*
DataprocMetastoreClient
)
DeleteBackup
(
ctx
context
.
Context
,
req
*
metastorepb
.
DeleteBackupRequest
,
opts
...
gax
.
CallOption
)
(
*
DeleteBackupOperation
,
error
)
DeleteBackup deletes a single backup.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
DeleteBackupRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#DeleteBackupRequest.
}
op
,
err
:=
c
.
DeleteBackup
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
err
=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
}
func (*DataprocMetastoreClient) DeleteBackupOperation
func
(
c
*
DataprocMetastoreClient
)
DeleteBackupOperation
(
name
string
)
*
DeleteBackupOperation
DeleteBackupOperation returns a new DeleteBackupOperation from a given name. The name must be that of a previously created DeleteBackupOperation, possibly from a different process.
func (*DataprocMetastoreClient) DeleteOperation
func
(
c
*
DataprocMetastoreClient
)
DeleteOperation
(
ctx
context
.
Context
,
req
*
longrunningpb
.
DeleteOperationRequest
,
opts
...
gax
.
CallOption
)
error
DeleteOperation is a utility method from google.longrunning.Operations.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
longrunningpb
"google.golang.org/genproto/googleapis/longrunning"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& longrunningpb
.
DeleteOperationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest.
}
err
=
c
.
DeleteOperation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
}
func (*DataprocMetastoreClient) DeleteService
func
(
c
*
DataprocMetastoreClient
)
DeleteService
(
ctx
context
.
Context
,
req
*
metastorepb
.
DeleteServiceRequest
,
opts
...
gax
.
CallOption
)
(
*
DeleteServiceOperation
,
error
)
DeleteService deletes a single service.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
DeleteServiceRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#DeleteServiceRequest.
}
op
,
err
:=
c
.
DeleteService
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
err
=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
}
func (*DataprocMetastoreClient) DeleteServiceOperation
func
(
c
*
DataprocMetastoreClient
)
DeleteServiceOperation
(
name
string
)
*
DeleteServiceOperation
DeleteServiceOperation returns a new DeleteServiceOperation from a given name. The name must be that of a previously created DeleteServiceOperation, possibly from a different process.
func (*DataprocMetastoreClient) ExportMetadata
func
(
c
*
DataprocMetastoreClient
)
ExportMetadata
(
ctx
context
.
Context
,
req
*
metastorepb
.
ExportMetadataRequest
,
opts
...
gax
.
CallOption
)
(
*
ExportMetadataOperation
,
error
)
ExportMetadata exports metadata from a service.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
ExportMetadataRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#ExportMetadataRequest.
}
op
,
err
:=
c
.
ExportMetadata
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) ExportMetadataOperation
func
(
c
*
DataprocMetastoreClient
)
ExportMetadataOperation
(
name
string
)
*
ExportMetadataOperation
ExportMetadataOperation returns a new ExportMetadataOperation from a given name. The name must be that of a previously created ExportMetadataOperation, possibly from a different process.
func (*DataprocMetastoreClient) GetBackup
func
(
c
*
DataprocMetastoreClient
)
GetBackup
(
ctx
context
.
Context
,
req
*
metastorepb
.
GetBackupRequest
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Backup
,
error
)
GetBackup gets details of a single backup.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
GetBackupRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#GetBackupRequest.
}
resp
,
err
:=
c
.
GetBackup
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) GetIamPolicy
func
(
c
*
DataprocMetastoreClient
)
GetIamPolicy
(
ctx
context
.
Context
,
req
*
iampb
.
GetIamPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
iampb
.
Policy
,
error
)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
iampb
"google.golang.org/genproto/googleapis/iam/v1"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& iampb
.
GetIamPolicyRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#GetIamPolicyRequest.
}
resp
,
err
:=
c
.
GetIamPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) GetLocation
func
(
c
*
DataprocMetastoreClient
)
GetLocation
(
ctx
context
.
Context
,
req
*
locationpb
.
GetLocationRequest
,
opts
...
gax
.
CallOption
)
(
*
locationpb
.
Location
,
error
)
GetLocation gets information about a location.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
locationpb
"google.golang.org/genproto/googleapis/cloud/location"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& locationpb
.
GetLocationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp
,
err
:=
c
.
GetLocation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) GetMetadataImport
func
(
c
*
DataprocMetastoreClient
)
GetMetadataImport
(
ctx
context
.
Context
,
req
*
metastorepb
.
GetMetadataImportRequest
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
MetadataImport
,
error
)
GetMetadataImport gets details of a single import.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
GetMetadataImportRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#GetMetadataImportRequest.
}
resp
,
err
:=
c
.
GetMetadataImport
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) GetOperation
func
(
c
*
DataprocMetastoreClient
)
GetOperation
(
ctx
context
.
Context
,
req
*
longrunningpb
.
GetOperationRequest
,
opts
...
gax
.
CallOption
)
(
*
longrunningpb
.
Operation
,
error
)
GetOperation is a utility method from google.longrunning.Operations.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
longrunningpb
"google.golang.org/genproto/googleapis/longrunning"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& longrunningpb
.
GetOperationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest.
}
resp
,
err
:=
c
.
GetOperation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) GetService
func
(
c
*
DataprocMetastoreClient
)
GetService
(
ctx
context
.
Context
,
req
*
metastorepb
.
GetServiceRequest
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Service
,
error
)
GetService gets the details of a single service.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
GetServiceRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#GetServiceRequest.
}
resp
,
err
:=
c
.
GetService
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) ListBackups
func
(
c
*
DataprocMetastoreClient
)
ListBackups
(
ctx
context
.
Context
,
req
*
metastorepb
.
ListBackupsRequest
,
opts
...
gax
.
CallOption
)
*
BackupIterator
ListBackups lists backups in a service.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
"google.golang.org/api/iterator"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
ListBackupsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#ListBackupsRequest.
}
it
:=
c
.
ListBackups
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*DataprocMetastoreClient) ListLocations
func
(
c
*
DataprocMetastoreClient
)
ListLocations
(
ctx
context
.
Context
,
req
*
locationpb
.
ListLocationsRequest
,
opts
...
gax
.
CallOption
)
*
LocationIterator
ListLocations lists information about the supported locations for this service.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
"google.golang.org/api/iterator"
locationpb
"google.golang.org/genproto/googleapis/cloud/location"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& locationpb
.
ListLocationsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it
:=
c
.
ListLocations
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*DataprocMetastoreClient) ListMetadataImports
func
(
c
*
DataprocMetastoreClient
)
ListMetadataImports
(
ctx
context
.
Context
,
req
*
metastorepb
.
ListMetadataImportsRequest
,
opts
...
gax
.
CallOption
)
*
MetadataImportIterator
ListMetadataImports lists imports in a service.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
"google.golang.org/api/iterator"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
ListMetadataImportsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#ListMetadataImportsRequest.
}
it
:=
c
.
ListMetadataImports
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*DataprocMetastoreClient) ListOperations
func
(
c
*
DataprocMetastoreClient
)
ListOperations
(
ctx
context
.
Context
,
req
*
longrunningpb
.
ListOperationsRequest
,
opts
...
gax
.
CallOption
)
*
OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
"google.golang.org/api/iterator"
longrunningpb
"google.golang.org/genproto/googleapis/longrunning"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& longrunningpb
.
ListOperationsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest.
}
it
:=
c
.
ListOperations
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*DataprocMetastoreClient) ListServices
func
(
c
*
DataprocMetastoreClient
)
ListServices
(
ctx
context
.
Context
,
req
*
metastorepb
.
ListServicesRequest
,
opts
...
gax
.
CallOption
)
*
ServiceIterator
ListServices lists services in a project and location.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
"google.golang.org/api/iterator"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
ListServicesRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#ListServicesRequest.
}
it
:=
c
.
ListServices
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*DataprocMetastoreClient) RestoreService
func
(
c
*
DataprocMetastoreClient
)
RestoreService
(
ctx
context
.
Context
,
req
*
metastorepb
.
RestoreServiceRequest
,
opts
...
gax
.
CallOption
)
(
*
RestoreServiceOperation
,
error
)
RestoreService restores a service from a backup.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
RestoreServiceRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#RestoreServiceRequest.
}
op
,
err
:=
c
.
RestoreService
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) RestoreServiceOperation
func
(
c
*
DataprocMetastoreClient
)
RestoreServiceOperation
(
name
string
)
*
RestoreServiceOperation
RestoreServiceOperation returns a new RestoreServiceOperation from a given name. The name must be that of a previously created RestoreServiceOperation, possibly from a different process.
func (*DataprocMetastoreClient) SetIamPolicy
func
(
c
*
DataprocMetastoreClient
)
SetIamPolicy
(
ctx
context
.
Context
,
req
*
iampb
.
SetIamPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
iampb
.
Policy
,
error
)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
iampb
"google.golang.org/genproto/googleapis/iam/v1"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& iampb
.
SetIamPolicyRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#SetIamPolicyRequest.
}
resp
,
err
:=
c
.
SetIamPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) TestIamPermissions
func
(
c
*
DataprocMetastoreClient
)
TestIamPermissions
(
ctx
context
.
Context
,
req
*
iampb
.
TestIamPermissionsRequest
,
opts
...
gax
.
CallOption
)
(
*
iampb
.
TestIamPermissionsResponse
,
error
)
TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
iampb
"google.golang.org/genproto/googleapis/iam/v1"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& iampb
.
TestIamPermissionsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#TestIamPermissionsRequest.
}
resp
,
err
:=
c
.
TestIamPermissions
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) UpdateMetadataImport
func
(
c
*
DataprocMetastoreClient
)
UpdateMetadataImport
(
ctx
context
.
Context
,
req
*
metastorepb
.
UpdateMetadataImportRequest
,
opts
...
gax
.
CallOption
)
(
*
UpdateMetadataImportOperation
,
error
)
UpdateMetadataImport updates a single import. Only the description field of MetadataImport is supported to be updated.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
UpdateMetadataImportRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#UpdateMetadataImportRequest.
}
op
,
err
:=
c
.
UpdateMetadataImport
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) UpdateMetadataImportOperation
func
(
c
*
DataprocMetastoreClient
)
UpdateMetadataImportOperation
(
name
string
)
*
UpdateMetadataImportOperation
UpdateMetadataImportOperation returns a new UpdateMetadataImportOperation from a given name. The name must be that of a previously created UpdateMetadataImportOperation, possibly from a different process.
func (*DataprocMetastoreClient) UpdateService
func
(
c
*
DataprocMetastoreClient
)
UpdateService
(
ctx
context
.
Context
,
req
*
metastorepb
.
UpdateServiceRequest
,
opts
...
gax
.
CallOption
)
(
*
UpdateServiceOperation
,
error
)
UpdateService updates the parameters of a single service.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
UpdateServiceRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#UpdateServiceRequest.
}
op
,
err
:=
c
.
UpdateService
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreClient) UpdateServiceOperation
func
(
c
*
DataprocMetastoreClient
)
UpdateServiceOperation
(
name
string
)
*
UpdateServiceOperation
UpdateServiceOperation returns a new UpdateServiceOperation from a given name. The name must be that of a previously created UpdateServiceOperation, possibly from a different process.
DataprocMetastoreFederationCallOptions
type
DataprocMetastoreFederationCallOptions
struct
{
ListFederations
[]
gax
.
CallOption
GetFederation
[]
gax
.
CallOption
CreateFederation
[]
gax
.
CallOption
UpdateFederation
[]
gax
.
CallOption
DeleteFederation
[]
gax
.
CallOption
GetLocation
[]
gax
.
CallOption
ListLocations
[]
gax
.
CallOption
GetIamPolicy
[]
gax
.
CallOption
SetIamPolicy
[]
gax
.
CallOption
TestIamPermissions
[]
gax
.
CallOption
DeleteOperation
[]
gax
.
CallOption
GetOperation
[]
gax
.
CallOption
ListOperations
[]
gax
.
CallOption
}
DataprocMetastoreFederationCallOptions contains the retry settings for each method of DataprocMetastoreFederationClient.
DataprocMetastoreFederationClient
type
DataprocMetastoreFederationClient
struct
{
// The call options for this service.
CallOptions
*
DataprocMetastoreFederationCallOptions
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient
*
lroauto
.
OperationsClient
// contains filtered or unexported fields
}
DataprocMetastoreFederationClient is a client for interacting with Dataproc Metastore API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Configures and manages metastore federation services. Dataproc Metastore Federation Service allows federating a collection of backend metastores like BigQuery, Dataplex Lakes, and other Dataproc Metastores. The Federation Service exposes a gRPC URL through which metadata from the backend metastores are served at query time.
The Dataproc Metastore Federation API defines the following resource model:
The service works with a collection of Google Cloud projects.
Each project has a collection of available locations.
Each location has a collection of federations.
Dataproc Metastore Federations are resources with names of the
form:
projects/{project_number}/locations/{location_id}/federations/{federation_id}.
func NewDataprocMetastoreFederationClient
func
NewDataprocMetastoreFederationClient
(
ctx
context
.
Context
,
opts
...
option
.
ClientOption
)
(
*
DataprocMetastoreFederationClient
,
error
)
NewDataprocMetastoreFederationClient creates a new dataproc metastore federation client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Configures and manages metastore federation services. Dataproc Metastore Federation Service allows federating a collection of backend metastores like BigQuery, Dataplex Lakes, and other Dataproc Metastores. The Federation Service exposes a gRPC URL through which metadata from the backend metastores are served at query time.
The Dataproc Metastore Federation API defines the following resource model:
The service works with a collection of Google Cloud projects.
Each project has a collection of available locations.
Each location has a collection of federations.
Dataproc Metastore Federations are resources with names of the
form:
projects/{project_number}/locations/{location_id}/federations/{federation_id}.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
// TODO: Use client.
_
=
c
}
func NewDataprocMetastoreFederationRESTClient
func
NewDataprocMetastoreFederationRESTClient
(
ctx
context
.
Context
,
opts
...
option
.
ClientOption
)
(
*
DataprocMetastoreFederationClient
,
error
)
NewDataprocMetastoreFederationRESTClient creates a new dataproc metastore federation rest client.
Configures and manages metastore federation services. Dataproc Metastore Federation Service allows federating a collection of backend metastores like BigQuery, Dataplex Lakes, and other Dataproc Metastores. The Federation Service exposes a gRPC URL through which metadata from the backend metastores are served at query time.
The Dataproc Metastore Federation API defines the following resource model:
The service works with a collection of Google Cloud projects.
Each project has a collection of available locations.
Each location has a collection of federations.
Dataproc Metastore Federations are resources with names of the
form:
projects/{project_number}/locations/{location_id}/federations/{federation_id}.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationRESTClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
// TODO: Use client.
_
=
c
}
func (*DataprocMetastoreFederationClient) Close
func
(
c
*
DataprocMetastoreFederationClient
)
Close
()
error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*DataprocMetastoreFederationClient) Connection (deprecated)
func
(
c
*
DataprocMetastoreFederationClient
)
Connection
()
*
grpc
.
ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*DataprocMetastoreFederationClient) CreateFederation
func
(
c
*
DataprocMetastoreFederationClient
)
CreateFederation
(
ctx
context
.
Context
,
req
*
metastorepb
.
CreateFederationRequest
,
opts
...
gax
.
CallOption
)
(
*
CreateFederationOperation
,
error
)
CreateFederation creates a metastore federation in a project and location.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
CreateFederationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#CreateFederationRequest.
}
op
,
err
:=
c
.
CreateFederation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreFederationClient) CreateFederationOperation
func
(
c
*
DataprocMetastoreFederationClient
)
CreateFederationOperation
(
name
string
)
*
CreateFederationOperation
CreateFederationOperation returns a new CreateFederationOperation from a given name. The name must be that of a previously created CreateFederationOperation, possibly from a different process.
func (*DataprocMetastoreFederationClient) DeleteFederation
func
(
c
*
DataprocMetastoreFederationClient
)
DeleteFederation
(
ctx
context
.
Context
,
req
*
metastorepb
.
DeleteFederationRequest
,
opts
...
gax
.
CallOption
)
(
*
DeleteFederationOperation
,
error
)
DeleteFederation deletes a single federation.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
DeleteFederationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#DeleteFederationRequest.
}
op
,
err
:=
c
.
DeleteFederation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
err
=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
}
func (*DataprocMetastoreFederationClient) DeleteFederationOperation
func
(
c
*
DataprocMetastoreFederationClient
)
DeleteFederationOperation
(
name
string
)
*
DeleteFederationOperation
DeleteFederationOperation returns a new DeleteFederationOperation from a given name. The name must be that of a previously created DeleteFederationOperation, possibly from a different process.
func (*DataprocMetastoreFederationClient) DeleteOperation
func
(
c
*
DataprocMetastoreFederationClient
)
DeleteOperation
(
ctx
context
.
Context
,
req
*
longrunningpb
.
DeleteOperationRequest
,
opts
...
gax
.
CallOption
)
error
DeleteOperation is a utility method from google.longrunning.Operations.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
longrunningpb
"google.golang.org/genproto/googleapis/longrunning"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& longrunningpb
.
DeleteOperationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#DeleteOperationRequest.
}
err
=
c
.
DeleteOperation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
}
func (*DataprocMetastoreFederationClient) GetFederation
func
(
c
*
DataprocMetastoreFederationClient
)
GetFederation
(
ctx
context
.
Context
,
req
*
metastorepb
.
GetFederationRequest
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Federation
,
error
)
GetFederation gets the details of a single federation.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
GetFederationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#GetFederationRequest.
}
resp
,
err
:=
c
.
GetFederation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreFederationClient) GetIamPolicy
func
(
c
*
DataprocMetastoreFederationClient
)
GetIamPolicy
(
ctx
context
.
Context
,
req
*
iampb
.
GetIamPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
iampb
.
Policy
,
error
)
GetIamPolicy gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
iampb
"google.golang.org/genproto/googleapis/iam/v1"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& iampb
.
GetIamPolicyRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#GetIamPolicyRequest.
}
resp
,
err
:=
c
.
GetIamPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreFederationClient) GetLocation
func
(
c
*
DataprocMetastoreFederationClient
)
GetLocation
(
ctx
context
.
Context
,
req
*
locationpb
.
GetLocationRequest
,
opts
...
gax
.
CallOption
)
(
*
locationpb
.
Location
,
error
)
GetLocation gets information about a location.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
locationpb
"google.golang.org/genproto/googleapis/cloud/location"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& locationpb
.
GetLocationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp
,
err
:=
c
.
GetLocation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreFederationClient) GetOperation
func
(
c
*
DataprocMetastoreFederationClient
)
GetOperation
(
ctx
context
.
Context
,
req
*
longrunningpb
.
GetOperationRequest
,
opts
...
gax
.
CallOption
)
(
*
longrunningpb
.
Operation
,
error
)
GetOperation is a utility method from google.longrunning.Operations.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
longrunningpb
"google.golang.org/genproto/googleapis/longrunning"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& longrunningpb
.
GetOperationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest.
}
resp
,
err
:=
c
.
GetOperation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreFederationClient) ListFederations
func
(
c
*
DataprocMetastoreFederationClient
)
ListFederations
(
ctx
context
.
Context
,
req
*
metastorepb
.
ListFederationsRequest
,
opts
...
gax
.
CallOption
)
*
FederationIterator
ListFederations lists federations in a project and location.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
"google.golang.org/api/iterator"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
ListFederationsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#ListFederationsRequest.
}
it
:=
c
.
ListFederations
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*DataprocMetastoreFederationClient) ListLocations
func
(
c
*
DataprocMetastoreFederationClient
)
ListLocations
(
ctx
context
.
Context
,
req
*
locationpb
.
ListLocationsRequest
,
opts
...
gax
.
CallOption
)
*
LocationIterator
ListLocations lists information about the supported locations for this service.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
"google.golang.org/api/iterator"
locationpb
"google.golang.org/genproto/googleapis/cloud/location"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& locationpb
.
ListLocationsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it
:=
c
.
ListLocations
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*DataprocMetastoreFederationClient) ListOperations
func
(
c
*
DataprocMetastoreFederationClient
)
ListOperations
(
ctx
context
.
Context
,
req
*
longrunningpb
.
ListOperationsRequest
,
opts
...
gax
.
CallOption
)
*
OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
"google.golang.org/api/iterator"
longrunningpb
"google.golang.org/genproto/googleapis/longrunning"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& longrunningpb
.
ListOperationsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#ListOperationsRequest.
}
it
:=
c
.
ListOperations
(
ctx
,
req
)
for
{
resp
,
err
:=
it
.
Next
()
if
err
==
iterator
.
Done
{
break
}
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
}
func (*DataprocMetastoreFederationClient) SetIamPolicy
func
(
c
*
DataprocMetastoreFederationClient
)
SetIamPolicy
(
ctx
context
.
Context
,
req
*
iampb
.
SetIamPolicyRequest
,
opts
...
gax
.
CallOption
)
(
*
iampb
.
Policy
,
error
)
SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
iampb
"google.golang.org/genproto/googleapis/iam/v1"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& iampb
.
SetIamPolicyRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#SetIamPolicyRequest.
}
resp
,
err
:=
c
.
SetIamPolicy
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreFederationClient) TestIamPermissions
func
(
c
*
DataprocMetastoreFederationClient
)
TestIamPermissions
(
ctx
context
.
Context
,
req
*
iampb
.
TestIamPermissionsRequest
,
opts
...
gax
.
CallOption
)
(
*
iampb
.
TestIamPermissionsResponse
,
error
)
TestIamPermissions returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may “fail open” without warning.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
iampb
"google.golang.org/genproto/googleapis/iam/v1"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& iampb
.
TestIamPermissionsRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/iam/v1#TestIamPermissionsRequest.
}
resp
,
err
:=
c
.
TestIamPermissions
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreFederationClient) UpdateFederation
func
(
c
*
DataprocMetastoreFederationClient
)
UpdateFederation
(
ctx
context
.
Context
,
req
*
metastorepb
.
UpdateFederationRequest
,
opts
...
gax
.
CallOption
)
(
*
UpdateFederationOperation
,
error
)
UpdateFederation updates the fields of a federation.
Example
package
main
import
(
"context"
metastore
"cloud.google.com/go/metastore/apiv1beta"
metastorepb
"cloud.google.com/go/metastore/apiv1beta/metastorepb"
)
func
main
()
{
ctx
:=
context
.
Background
()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c
,
err
:=
metastore
.
NewDataprocMetastoreFederationClient
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
defer
c
.
Close
()
req
:=
& metastorepb
.
UpdateFederationRequest
{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/metastore/apiv1beta/metastorepb#UpdateFederationRequest.
}
op
,
err
:=
c
.
UpdateFederation
(
ctx
,
req
)
if
err
!=
nil
{
// TODO: Handle error.
}
resp
,
err
:=
op
.
Wait
(
ctx
)
if
err
!=
nil
{
// TODO: Handle error.
}
// TODO: Use resp.
_
=
resp
}
func (*DataprocMetastoreFederationClient) UpdateFederationOperation
func
(
c
*
DataprocMetastoreFederationClient
)
UpdateFederationOperation
(
name
string
)
*
UpdateFederationOperation
UpdateFederationOperation returns a new UpdateFederationOperation from a given name. The name must be that of a previously created UpdateFederationOperation, possibly from a different process.
DeleteBackupOperation
type
DeleteBackupOperation
struct
{
// contains filtered or unexported fields
}
DeleteBackupOperation manages a long-running operation from DeleteBackup.
func (*DeleteBackupOperation) Done
func
(
op
*
DeleteBackupOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*DeleteBackupOperation) Metadata
func
(
op
*
DeleteBackupOperation
)
Metadata
()
(
*
metastorepb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteBackupOperation) Name
func
(
op
*
DeleteBackupOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteBackupOperation) Poll
func
(
op
*
DeleteBackupOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteBackupOperation) Wait
func
(
op
*
DeleteBackupOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteFederationOperation
type
DeleteFederationOperation
struct
{
// contains filtered or unexported fields
}
DeleteFederationOperation manages a long-running operation from DeleteFederation.
func (*DeleteFederationOperation) Done
func
(
op
*
DeleteFederationOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*DeleteFederationOperation) Metadata
func
(
op
*
DeleteFederationOperation
)
Metadata
()
(
*
metastorepb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteFederationOperation) Name
func
(
op
*
DeleteFederationOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteFederationOperation) Poll
func
(
op
*
DeleteFederationOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteFederationOperation) Wait
func
(
op
*
DeleteFederationOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteServiceOperation
type
DeleteServiceOperation
struct
{
// contains filtered or unexported fields
}
DeleteServiceOperation manages a long-running operation from DeleteService.
func (*DeleteServiceOperation) Done
func
(
op
*
DeleteServiceOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*DeleteServiceOperation) Metadata
func
(
op
*
DeleteServiceOperation
)
Metadata
()
(
*
metastorepb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteServiceOperation) Name
func
(
op
*
DeleteServiceOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteServiceOperation) Poll
func
(
op
*
DeleteServiceOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteServiceOperation) Wait
func
(
op
*
DeleteServiceOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
ExportMetadataOperation
type
ExportMetadataOperation
struct
{
// contains filtered or unexported fields
}
ExportMetadataOperation manages a long-running operation from ExportMetadata.
func (*ExportMetadataOperation) Done
func
(
op
*
ExportMetadataOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*ExportMetadataOperation) Metadata
func
(
op
*
ExportMetadataOperation
)
Metadata
()
(
*
metastorepb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*ExportMetadataOperation) Name
func
(
op
*
ExportMetadataOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*ExportMetadataOperation) Poll
func
(
op
*
ExportMetadataOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
MetadataExport
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*ExportMetadataOperation) Wait
func
(
op
*
ExportMetadataOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
MetadataExport
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
FederationIterator
type
FederationIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
metastorepb
.
Federation
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
FederationIterator manages a stream of *metastorepb.Federation.
func (*FederationIterator) Next
func
(
it
*
FederationIterator
)
Next
()
(
*
metastorepb
.
Federation
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*FederationIterator) PageInfo
func
(
it
*
FederationIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
LocationIterator
type
LocationIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
locationpb
.
Location
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) Next
func
(
it
*
LocationIterator
)
Next
()
(
*
locationpb
.
Location
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo
func
(
it
*
LocationIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
MetadataImportIterator
type
MetadataImportIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
metastorepb
.
MetadataImport
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
MetadataImportIterator manages a stream of *metastorepb.MetadataImport.
func (*MetadataImportIterator) Next
func
(
it
*
MetadataImportIterator
)
Next
()
(
*
metastorepb
.
MetadataImport
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*MetadataImportIterator) PageInfo
func
(
it
*
MetadataImportIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
OperationIterator
type
OperationIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
longrunningpb
.
Operation
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) Next
func
(
it
*
OperationIterator
)
Next
()
(
*
longrunningpb
.
Operation
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo
func
(
it
*
OperationIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
RestoreServiceOperation
type
RestoreServiceOperation
struct
{
// contains filtered or unexported fields
}
RestoreServiceOperation manages a long-running operation from RestoreService.
func (*RestoreServiceOperation) Done
func
(
op
*
RestoreServiceOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*RestoreServiceOperation) Metadata
func
(
op
*
RestoreServiceOperation
)
Metadata
()
(
*
metastorepb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*RestoreServiceOperation) Name
func
(
op
*
RestoreServiceOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*RestoreServiceOperation) Poll
func
(
op
*
RestoreServiceOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Restore
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*RestoreServiceOperation) Wait
func
(
op
*
RestoreServiceOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Restore
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
ServiceIterator
type
ServiceIterator
struct
{
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response
interface
{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch
func
(
pageSize
int
,
pageToken
string
)
(
results
[]
*
metastorepb
.
Service
,
nextPageToken
string
,
err
error
)
// contains filtered or unexported fields
}
ServiceIterator manages a stream of *metastorepb.Service.
func (*ServiceIterator) Next
func
(
it
*
ServiceIterator
)
Next
()
(
*
metastorepb
.
Service
,
error
)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ServiceIterator) PageInfo
func
(
it
*
ServiceIterator
)
PageInfo
()
*
iterator
.
PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
UpdateFederationOperation
type
UpdateFederationOperation
struct
{
// contains filtered or unexported fields
}
UpdateFederationOperation manages a long-running operation from UpdateFederation.
func (*UpdateFederationOperation) Done
func
(
op
*
UpdateFederationOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*UpdateFederationOperation) Metadata
func
(
op
*
UpdateFederationOperation
)
Metadata
()
(
*
metastorepb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateFederationOperation) Name
func
(
op
*
UpdateFederationOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateFederationOperation) Poll
func
(
op
*
UpdateFederationOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Federation
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateFederationOperation) Wait
func
(
op
*
UpdateFederationOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Federation
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UpdateMetadataImportOperation
type
UpdateMetadataImportOperation
struct
{
// contains filtered or unexported fields
}
UpdateMetadataImportOperation manages a long-running operation from UpdateMetadataImport.
func (*UpdateMetadataImportOperation) Done
func
(
op
*
UpdateMetadataImportOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*UpdateMetadataImportOperation) Metadata
func
(
op
*
UpdateMetadataImportOperation
)
Metadata
()
(
*
metastorepb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateMetadataImportOperation) Name
func
(
op
*
UpdateMetadataImportOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateMetadataImportOperation) Poll
func
(
op
*
UpdateMetadataImportOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
MetadataImport
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateMetadataImportOperation) Wait
func
(
op
*
UpdateMetadataImportOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
MetadataImport
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UpdateServiceOperation
type
UpdateServiceOperation
struct
{
// contains filtered or unexported fields
}
UpdateServiceOperation manages a long-running operation from UpdateService.
func (*UpdateServiceOperation) Done
func
(
op
*
UpdateServiceOperation
)
Done
()
bool
Done reports whether the long-running operation has completed.
func (*UpdateServiceOperation) Metadata
func
(
op
*
UpdateServiceOperation
)
Metadata
()
(
*
metastorepb
.
OperationMetadata
,
error
)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateServiceOperation) Name
func
(
op
*
UpdateServiceOperation
)
Name
()
string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateServiceOperation) Poll
func
(
op
*
UpdateServiceOperation
)
Poll
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Service
,
error
)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateServiceOperation) Wait
func
(
op
*
UpdateServiceOperation
)
Wait
(
ctx
context
.
Context
,
opts
...
gax
.
CallOption
)
(
*
metastorepb
.
Service
,
error
)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.