Update dependencies

This commit is contained in:
Alexander Neumann
2017-09-13 14:09:48 +02:00
parent f3b49987f8
commit fda563d606
926 changed files with 189726 additions and 98666 deletions
+1 -2
View File
@@ -31,8 +31,7 @@ func insertXGoog(ctx context.Context, val []string) context.Context {
return metadata.NewOutgoingContext(ctx, md)
}
// DefaultAuthScopes reports the authentication scopes required
// by this package.
// DefaultAuthScopes reports the default set of authentication scopes to use with this package.
func DefaultAuthScopes() []string {
return []string{
"https://www.googleapis.com/auth/cloud-platform",
@@ -35,12 +35,6 @@ import (
"google.golang.org/grpc/codes"
)
var (
instanceAdminProjectPathTemplate = gax.MustCompilePathTemplate("projects/{project}")
instanceAdminInstanceConfigPathTemplate = gax.MustCompilePathTemplate("projects/{project}/instanceConfigs/{instance_config}")
instanceAdminInstancePathTemplate = gax.MustCompilePathTemplate("projects/{project}/instances/{instance}")
)
// InstanceAdminCallOptions contains the retry settings for each method of InstanceAdminClient.
type InstanceAdminCallOptions struct {
ListInstanceConfigs []gax.CallOption
@@ -145,7 +139,7 @@ func NewInstanceAdminClient(ctx context.Context, opts ...option.ClientOption) (*
instanceAdminClient: instancepb.NewInstanceAdminClient(conn),
}
c.SetGoogleClientInfo()
c.setGoogleClientInfo()
c.LROClient, err = lroauto.NewOperationsClient(ctx, option.WithGRPCConn(conn))
if err != nil {
@@ -171,10 +165,10 @@ func (c *InstanceAdminClient) Close() error {
return c.conn.Close()
}
// SetGoogleClientInfo sets the name and version of the application in
// setGoogleClientInfo sets the name and version of the application in
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *InstanceAdminClient) SetGoogleClientInfo(keyval ...string) {
func (c *InstanceAdminClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", version.Go()}, keyval...)
kv = append(kv, "gapic", version.Repo, "gax", gax.Version, "grpc", grpc.Version)
c.xGoogHeader = []string{gax.XGoogHeader(kv...)}
@@ -182,37 +176,30 @@ func (c *InstanceAdminClient) SetGoogleClientInfo(keyval ...string) {
// InstanceAdminProjectPath returns the path for the project resource.
func InstanceAdminProjectPath(project string) string {
path, err := instanceAdminProjectPathTemplate.Render(map[string]string{
"project": project,
})
if err != nil {
panic(err)
}
return path
return "" +
"projects/" +
project +
""
}
// InstanceAdminInstanceConfigPath returns the path for the instance config resource.
func InstanceAdminInstanceConfigPath(project, instanceConfig string) string {
path, err := instanceAdminInstanceConfigPathTemplate.Render(map[string]string{
"project": project,
"instance_config": instanceConfig,
})
if err != nil {
panic(err)
}
return path
return "" +
"projects/" +
project +
"/instanceConfigs/" +
instanceConfig +
""
}
// InstanceAdminInstancePath returns the path for the instance resource.
func InstanceAdminInstancePath(project, instance string) string {
path, err := instanceAdminInstancePathTemplate.Render(map[string]string{
"project": project,
"instance": instance,
})
if err != nil {
panic(err)
}
return path
return "" +
"projects/" +
project +
"/instances/" +
instance +
""
}
// ListInstanceConfigs lists the supported instance configurations for a given project.
@@ -321,31 +308,36 @@ func (c *InstanceAdminClient) GetInstance(ctx context.Context, req *instancepb.G
// returned [long-running operation][google.longrunning.Operation]
// can be used to track the progress of preparing the new
// instance. The instance name is assigned by the caller. If the
// named instance already exists, `CreateInstance` returns
// `ALREADY_EXISTS`.
// named instance already exists, CreateInstance returns
// ALREADY_EXISTS.
//
// Immediately upon completion of this request:
//
// * The instance is readable via the API, with all requested attributes
// but no allocated resources. Its state is `CREATING`.
// The instance is readable via the API, with all requested attributes
// but no allocated resources. Its state is CREATING.
//
// Until completion of the returned operation:
//
// * Cancelling the operation renders the instance immediately unreadable
// via the API.
// * The instance can be deleted.
// * All other attempts to modify the instance are rejected.
// Cancelling the operation renders the instance immediately unreadable
// via the API.
//
// The instance can be deleted.
//
// All other attempts to modify the instance are rejected.
//
// Upon completion of the returned operation:
//
// * Billing for all successfully-allocated resources begins (some types
// may have lower than the requested levels).
// * Databases can be created in the instance.
// * The instance's allocated resource levels are readable via the API.
// * The instance's state becomes `READY`.
// Billing for all successfully-allocated resources begins (some types
// may have lower than the requested levels).
//
// Databases can be created in the instance.
//
// The instance's allocated resource levels are readable via the API.
//
// The instance's state becomes READY.
//
// The returned [long-running operation][google.longrunning.Operation] will
// have a name of the format `<instance_name>/operations/<operation_id>` and
// have a name of the format <instance_name>/operations/<operation_id> and
// can be used to track creation of the instance. The
// [metadata][google.longrunning.Operation.metadata] field type is
// [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata].
@@ -372,41 +364,45 @@ func (c *InstanceAdminClient) CreateInstance(ctx context.Context, req *instancep
// as requested. The returned [long-running
// operation][google.longrunning.Operation] can be used to track the
// progress of updating the instance. If the named instance does not
// exist, returns `NOT_FOUND`.
// exist, returns NOT_FOUND.
//
// Immediately upon completion of this request:
//
// * For resource types for which a decrease in the instance's allocation
// has been requested, billing is based on the newly-requested level.
// For resource types for which a decrease in the instance's allocation
// has been requested, billing is based on the newly-requested level.
//
// Until completion of the returned operation:
//
// * Cancelling the operation sets its metadata's
// [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], and begins
// restoring resources to their pre-request values. The operation
// is guaranteed to succeed at undoing all resource changes,
// after which point it terminates with a `CANCELLED` status.
// * All other attempts to modify the instance are rejected.
// * Reading the instance via the API continues to give the pre-request
// resource levels.
// Cancelling the operation sets its metadata's
// [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], and begins
// restoring resources to their pre-request values. The operation
// is guaranteed to succeed at undoing all resource changes,
// after which point it terminates with a CANCELLED status.
//
// All other attempts to modify the instance are rejected.
//
// Reading the instance via the API continues to give the pre-request
// resource levels.
//
// Upon completion of the returned operation:
//
// * Billing begins for all successfully-allocated resources (some types
// may have lower than the requested levels).
// * All newly-reserved resources are available for serving the instance's
// tables.
// * The instance's new resource levels are readable via the API.
// Billing begins for all successfully-allocated resources (some types
// may have lower than the requested levels).
//
// All newly-reserved resources are available for serving the instance's
// tables.
//
// The instance's new resource levels are readable via the API.
//
// The returned [long-running operation][google.longrunning.Operation] will
// have a name of the format `<instance_name>/operations/<operation_id>` and
// have a name of the format <instance_name>/operations/<operation_id> and
// can be used to track the instance modification. The
// [metadata][google.longrunning.Operation.metadata] field type is
// [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata].
// The [response][google.longrunning.Operation.response] field type is
// [Instance][google.spanner.admin.instance.v1.Instance], if successful.
//
// Authorization requires `spanner.instances.update` permission on
// Authorization requires spanner.instances.update permission on
// resource [name][google.spanner.admin.instance.v1.Instance.name].
func (c *InstanceAdminClient) UpdateInstance(ctx context.Context, req *instancepb.UpdateInstanceRequest, opts ...gax.CallOption) (*UpdateInstanceOperation, error) {
ctx = insertXGoog(ctx, c.xGoogHeader)
@@ -429,13 +425,13 @@ func (c *InstanceAdminClient) UpdateInstance(ctx context.Context, req *instancep
//
// Immediately upon completion of the request:
//
// * Billing ceases for all of the instance's reserved resources.
// Billing ceases for all of the instance's reserved resources.
//
// Soon afterward:
//
// * The instance and *all of its databases* immediately and
// irrevocably disappear from the API. All data in the databases
// is permanently deleted.
// The instance and all of its databases immediately and
// irrevocably disappear from the API. All data in the databases
// is permanently deleted.
func (c *InstanceAdminClient) DeleteInstance(ctx context.Context, req *instancepb.DeleteInstanceRequest, opts ...gax.CallOption) error {
ctx = insertXGoog(ctx, c.xGoogHeader)
opts = append(c.CallOptions.DeleteInstance[0:len(c.CallOptions.DeleteInstance):len(c.CallOptions.DeleteInstance)], opts...)
@@ -450,7 +446,7 @@ func (c *InstanceAdminClient) DeleteInstance(ctx context.Context, req *instancep
// SetIamPolicy sets the access control policy on an instance resource. Replaces any
// existing policy.
//
// Authorization requires `spanner.instances.setIamPolicy` on
// Authorization requires spanner.instances.setIamPolicy on
// [resource][google.iam.v1.SetIamPolicyRequest.resource].
func (c *InstanceAdminClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
ctx = insertXGoog(ctx, c.xGoogHeader)
@@ -470,7 +466,7 @@ func (c *InstanceAdminClient) SetIamPolicy(ctx context.Context, req *iampb.SetIa
// GetIamPolicy gets the access control policy for an instance resource. Returns an empty
// policy if an instance exists but does not have a policy set.
//
// Authorization requires `spanner.instances.getIamPolicy` on
// Authorization requires spanner.instances.getIamPolicy on
// [resource][google.iam.v1.GetIamPolicyRequest.resource].
func (c *InstanceAdminClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) {
ctx = insertXGoog(ctx, c.xGoogHeader)
@@ -490,7 +486,7 @@ func (c *InstanceAdminClient) GetIamPolicy(ctx context.Context, req *iampb.GetIa
// TestIamPermissions returns permissions that the caller has on the specified instance resource.
//
// Attempting this RPC on a non-existent Cloud Spanner instance resource will
// result in a NOT_FOUND error if the user has `spanner.instances.list`
// result in a NOT_FOUND error if the user has spanner.instances.list
// permission on the containing Google Cloud Project. Otherwise returns an
// empty set of permissions.
func (c *InstanceAdminClient) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error) {
@@ -610,7 +606,7 @@ func (c *InstanceAdminClient) CreateInstanceOperation(name string) *CreateInstan
// See documentation of Poll for error-handling information.
func (op *CreateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*instancepb.Instance, error) {
var resp instancepb.Instance
if err := op.lro.Wait(ctx, &resp, opts...); err != nil {
if err := op.lro.WaitWithInterval(ctx, &resp, 45000*time.Millisecond, opts...); err != nil {
return nil, err
}
return &resp, nil
@@ -679,7 +675,7 @@ func (c *InstanceAdminClient) UpdateInstanceOperation(name string) *UpdateInstan
// See documentation of Poll for error-handling information.
func (op *UpdateInstanceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*instancepb.Instance, error) {
var resp instancepb.Instance
if err := op.lro.Wait(ctx, &resp, opts...); err != nil {
if err := op.lro.WaitWithInterval(ctx, &resp, 45000*time.Millisecond, opts...); err != nil {
return nil, err
}
return &resp, nil