Documentation ¶
Overview ¶
Package servicemanagement is an auto-generated package for the Service Management API.
Google Service Management allows service producers to publish their services on Google Cloud Platform so that they can be discovered and used by service consumers.
Use of Context ¶
The ctx passed to NewClient 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.
Index ¶
- func DefaultAuthScopes() []string
- type CreateServiceOperation
- func (op *CreateServiceOperation) Done() bool
- func (op *CreateServiceOperation) Metadata() (*servicemanagementpb.OperationMetadata, error)
- func (op *CreateServiceOperation) Name() string
- func (op *CreateServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.ManagedService, error)
- func (op *CreateServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.ManagedService, error)
- type CreateServiceRolloutOperation
- func (op *CreateServiceRolloutOperation) Done() bool
- func (op *CreateServiceRolloutOperation) Metadata() (*servicemanagementpb.OperationMetadata, error)
- func (op *CreateServiceRolloutOperation) Name() string
- func (op *CreateServiceRolloutOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.Rollout, error)
- func (op *CreateServiceRolloutOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.Rollout, error)
- type DeleteServiceOperation
- func (op *DeleteServiceOperation) Done() bool
- func (op *DeleteServiceOperation) Metadata() (*servicemanagementpb.OperationMetadata, error)
- func (op *DeleteServiceOperation) Name() string
- func (op *DeleteServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type DisableServiceOperation
- func (op *DisableServiceOperation) Done() bool
- func (op *DisableServiceOperation) Metadata() (*servicemanagementpb.OperationMetadata, error)
- func (op *DisableServiceOperation) Name() string
- func (op *DisableServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.DisableServiceResponse, error)
- func (op *DisableServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.DisableServiceResponse, error)
- type EnableServiceOperation
- func (op *EnableServiceOperation) Done() bool
- func (op *EnableServiceOperation) Metadata() (*servicemanagementpb.OperationMetadata, error)
- func (op *EnableServiceOperation) Name() string
- func (op *EnableServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.EnableServiceResponse, error)
- func (op *EnableServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.EnableServiceResponse, error)
- type ManagedServiceIterator
- type RolloutIterator
- type ServiceIterator
- type ServiceManagerCallOptions
- type ServiceManagerClient
- func (c *ServiceManagerClient) Close() error
- func (c *ServiceManagerClient) Connection() *grpc.ClientConn
- func (c *ServiceManagerClient) CreateService(ctx context.Context, req *servicemanagementpb.CreateServiceRequest, ...) (*CreateServiceOperation, error)
- func (c *ServiceManagerClient) CreateServiceConfig(ctx context.Context, req *servicemanagementpb.CreateServiceConfigRequest, ...) (*serviceconfigpb.Service, error)
- func (c *ServiceManagerClient) CreateServiceOperation(name string) *CreateServiceOperation
- func (c *ServiceManagerClient) CreateServiceRollout(ctx context.Context, req *servicemanagementpb.CreateServiceRolloutRequest, ...) (*CreateServiceRolloutOperation, error)
- func (c *ServiceManagerClient) CreateServiceRolloutOperation(name string) *CreateServiceRolloutOperation
- func (c *ServiceManagerClient) DeleteService(ctx context.Context, req *servicemanagementpb.DeleteServiceRequest, ...) (*DeleteServiceOperation, error)
- func (c *ServiceManagerClient) DeleteServiceOperation(name string) *DeleteServiceOperation
- func (c *ServiceManagerClient) DisableService(ctx context.Context, req *servicemanagementpb.DisableServiceRequest, ...) (*DisableServiceOperation, error)deprecated
- func (c *ServiceManagerClient) DisableServiceOperation(name string) *DisableServiceOperation
- func (c *ServiceManagerClient) EnableService(ctx context.Context, req *servicemanagementpb.EnableServiceRequest, ...) (*EnableServiceOperation, error)deprecated
- func (c *ServiceManagerClient) EnableServiceOperation(name string) *EnableServiceOperation
- func (c *ServiceManagerClient) GenerateConfigReport(ctx context.Context, req *servicemanagementpb.GenerateConfigReportRequest, ...) (*servicemanagementpb.GenerateConfigReportResponse, error)
- func (c *ServiceManagerClient) GetService(ctx context.Context, req *servicemanagementpb.GetServiceRequest, ...) (*servicemanagementpb.ManagedService, error)
- func (c *ServiceManagerClient) GetServiceConfig(ctx context.Context, req *servicemanagementpb.GetServiceConfigRequest, ...) (*serviceconfigpb.Service, error)
- func (c *ServiceManagerClient) GetServiceRollout(ctx context.Context, req *servicemanagementpb.GetServiceRolloutRequest, ...) (*servicemanagementpb.Rollout, error)
- func (c *ServiceManagerClient) ListServiceConfigs(ctx context.Context, req *servicemanagementpb.ListServiceConfigsRequest, ...) *ServiceIterator
- func (c *ServiceManagerClient) ListServiceRollouts(ctx context.Context, req *servicemanagementpb.ListServiceRolloutsRequest, ...) *RolloutIterator
- func (c *ServiceManagerClient) ListServices(ctx context.Context, req *servicemanagementpb.ListServicesRequest, ...) *ManagedServiceIterator
- func (c *ServiceManagerClient) SubmitConfigSource(ctx context.Context, req *servicemanagementpb.SubmitConfigSourceRequest, ...) (*SubmitConfigSourceOperation, error)
- func (c *ServiceManagerClient) SubmitConfigSourceOperation(name string) *SubmitConfigSourceOperation
- func (c *ServiceManagerClient) UndeleteService(ctx context.Context, req *servicemanagementpb.UndeleteServiceRequest, ...) (*UndeleteServiceOperation, error)
- func (c *ServiceManagerClient) UndeleteServiceOperation(name string) *UndeleteServiceOperation
- type SubmitConfigSourceOperation
- func (op *SubmitConfigSourceOperation) Done() bool
- func (op *SubmitConfigSourceOperation) Metadata() (*servicemanagementpb.OperationMetadata, error)
- func (op *SubmitConfigSourceOperation) Name() string
- func (op *SubmitConfigSourceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.SubmitConfigSourceResponse, error)
- func (op *SubmitConfigSourceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.SubmitConfigSourceResponse, error)
- type UndeleteServiceOperation
- func (op *UndeleteServiceOperation) Done() bool
- func (op *UndeleteServiceOperation) Metadata() (*servicemanagementpb.OperationMetadata, error)
- func (op *UndeleteServiceOperation) Name() string
- func (op *UndeleteServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.UndeleteServiceResponse, error)
- func (op *UndeleteServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.UndeleteServiceResponse, error)
Examples ¶
- NewServiceManagerClient
- ServiceManagerClient.CreateService
- ServiceManagerClient.CreateServiceConfig
- ServiceManagerClient.CreateServiceRollout
- ServiceManagerClient.DeleteService
- ServiceManagerClient.DisableService
- ServiceManagerClient.EnableService
- ServiceManagerClient.GenerateConfigReport
- ServiceManagerClient.GetService
- ServiceManagerClient.GetServiceConfig
- ServiceManagerClient.GetServiceRollout
- ServiceManagerClient.ListServiceConfigs
- ServiceManagerClient.ListServiceRollouts
- ServiceManagerClient.ListServices
- ServiceManagerClient.SubmitConfigSource
- ServiceManagerClient.UndeleteService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type 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() (*servicemanagementpb.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) (*servicemanagementpb.ManagedService, 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) (*servicemanagementpb.ManagedService, 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.
type CreateServiceRolloutOperation ¶
type CreateServiceRolloutOperation struct {
// contains filtered or unexported fields
}
CreateServiceRolloutOperation manages a long-running operation from CreateServiceRollout.
func (*CreateServiceRolloutOperation) Done ¶
func (op *CreateServiceRolloutOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateServiceRolloutOperation) Metadata ¶
func (op *CreateServiceRolloutOperation) Metadata() (*servicemanagementpb.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 (*CreateServiceRolloutOperation) Name ¶
func (op *CreateServiceRolloutOperation) 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 (*CreateServiceRolloutOperation) Poll ¶
func (op *CreateServiceRolloutOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.Rollout, 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 (*CreateServiceRolloutOperation) Wait ¶
func (op *CreateServiceRolloutOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.Rollout, 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.
type 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() (*servicemanagementpb.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.
type DisableServiceOperation ¶
type DisableServiceOperation struct {
// contains filtered or unexported fields
}
DisableServiceOperation manages a long-running operation from DisableService.
func (*DisableServiceOperation) Done ¶
func (op *DisableServiceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DisableServiceOperation) Metadata ¶
func (op *DisableServiceOperation) Metadata() (*servicemanagementpb.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 (*DisableServiceOperation) Name ¶
func (op *DisableServiceOperation) 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 (*DisableServiceOperation) Poll ¶
func (op *DisableServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.DisableServiceResponse, 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 (*DisableServiceOperation) Wait ¶
func (op *DisableServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.DisableServiceResponse, 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.
type EnableServiceOperation ¶
type EnableServiceOperation struct {
// contains filtered or unexported fields
}
EnableServiceOperation manages a long-running operation from EnableService.
func (*EnableServiceOperation) Done ¶
func (op *EnableServiceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*EnableServiceOperation) Metadata ¶
func (op *EnableServiceOperation) Metadata() (*servicemanagementpb.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 (*EnableServiceOperation) Name ¶
func (op *EnableServiceOperation) 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 (*EnableServiceOperation) Poll ¶
func (op *EnableServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.EnableServiceResponse, 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 (*EnableServiceOperation) Wait ¶
func (op *EnableServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.EnableServiceResponse, 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.
type ManagedServiceIterator ¶
type ManagedServiceIterator 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 []*servicemanagementpb.ManagedService, nextPageToken string, err error) // contains filtered or unexported fields }
ManagedServiceIterator manages a stream of *servicemanagementpb.ManagedService.
func (*ManagedServiceIterator) Next ¶
func (it *ManagedServiceIterator) Next() (*servicemanagementpb.ManagedService, 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 (*ManagedServiceIterator) PageInfo ¶
func (it *ManagedServiceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RolloutIterator ¶
type RolloutIterator 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 []*servicemanagementpb.Rollout, nextPageToken string, err error) // contains filtered or unexported fields }
RolloutIterator manages a stream of *servicemanagementpb.Rollout.
func (*RolloutIterator) Next ¶
func (it *RolloutIterator) Next() (*servicemanagementpb.Rollout, 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 (*RolloutIterator) PageInfo ¶
func (it *RolloutIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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 []*serviceconfigpb.Service, nextPageToken string, err error) // contains filtered or unexported fields }
ServiceIterator manages a stream of *serviceconfigpb.Service.
func (*ServiceIterator) Next ¶
func (it *ServiceIterator) Next() (*serviceconfigpb.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.
type ServiceManagerCallOptions ¶
type ServiceManagerCallOptions struct { ListServices []gax.CallOption GetService []gax.CallOption CreateService []gax.CallOption DeleteService []gax.CallOption UndeleteService []gax.CallOption ListServiceConfigs []gax.CallOption GetServiceConfig []gax.CallOption CreateServiceConfig []gax.CallOption SubmitConfigSource []gax.CallOption ListServiceRollouts []gax.CallOption GetServiceRollout []gax.CallOption CreateServiceRollout []gax.CallOption GenerateConfigReport []gax.CallOption EnableService []gax.CallOption DisableService []gax.CallOption }
ServiceManagerCallOptions contains the retry settings for each method of ServiceManagerClient.
type ServiceManagerClient ¶
type ServiceManagerClient struct { // The call options for this service. CallOptions *ServiceManagerCallOptions // 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 }
ServiceManagerClient is a client for interacting with Service Management API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Google Service Management API (at https://cloud.google.com/service-management/overview)
func NewServiceManagerClient ¶
func NewServiceManagerClient(ctx context.Context, opts ...option.ClientOption) (*ServiceManagerClient, error)
NewServiceManagerClient creates a new service manager client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Google Service Management API (at https://cloud.google.com/service-management/overview)
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*ServiceManagerClient) Close ¶
func (c *ServiceManagerClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ServiceManagerClient) Connection ¶
func (c *ServiceManagerClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*ServiceManagerClient) CreateService ¶
func (c *ServiceManagerClient) CreateService(ctx context.Context, req *servicemanagementpb.CreateServiceRequest, opts ...gax.CallOption) (*CreateServiceOperation, error)
CreateService creates a new managed service. Please note one producer project can own no more than 20 services.
Operation<response: ManagedService>
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.CreateServiceRequest{ // TODO: Fill request struct fields. } 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 }
Output:
func (*ServiceManagerClient) CreateServiceConfig ¶
func (c *ServiceManagerClient) CreateServiceConfig(ctx context.Context, req *servicemanagementpb.CreateServiceConfigRequest, opts ...gax.CallOption) (*serviceconfigpb.Service, error)
CreateServiceConfig creates a new service configuration (version) for a managed service. This method only stores the service configuration. To roll out the service configuration to backend systems please call CreateServiceRollout.
Only the 100 most recent service configurations and ones referenced by existing rollouts are kept for each service. The rest will be deleted eventually.
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.CreateServiceConfigRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateServiceConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ServiceManagerClient) CreateServiceOperation ¶
func (c *ServiceManagerClient) 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 (*ServiceManagerClient) CreateServiceRollout ¶
func (c *ServiceManagerClient) CreateServiceRollout(ctx context.Context, req *servicemanagementpb.CreateServiceRolloutRequest, opts ...gax.CallOption) (*CreateServiceRolloutOperation, error)
CreateServiceRollout creates a new service configuration rollout. Based on rollout, the Google Service Management will roll out the service configurations to different backend services. For example, the logging configuration will be pushed to Google Cloud Logging.
Please note that any previous pending and running Rollouts and associated Operations will be automatically cancelled so that the latest Rollout will not be blocked by previous Rollouts.
Only the 100 most recent (in any state) and the last 10 successful (if not already part of the set of 100 most recent) rollouts are kept for each service. The rest will be deleted eventually.
Operation<response: Rollout>
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.CreateServiceRolloutRequest{ // TODO: Fill request struct fields. } op, err := c.CreateServiceRollout(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ServiceManagerClient) CreateServiceRolloutOperation ¶
func (c *ServiceManagerClient) CreateServiceRolloutOperation(name string) *CreateServiceRolloutOperation
CreateServiceRolloutOperation returns a new CreateServiceRolloutOperation from a given name. The name must be that of a previously created CreateServiceRolloutOperation, possibly from a different process.
func (*ServiceManagerClient) DeleteService ¶
func (c *ServiceManagerClient) DeleteService(ctx context.Context, req *servicemanagementpb.DeleteServiceRequest, opts ...gax.CallOption) (*DeleteServiceOperation, error)
DeleteService deletes a managed service. This method will change the service to the Soft-Delete state for 30 days. Within this period, service producers may call UndeleteService to restore the service. After 30 days, the service will be permanently deleted.
Operation<response: google.protobuf.Empty>
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.DeleteServiceRequest{ // TODO: Fill request struct fields. } op, err := c.DeleteService(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*ServiceManagerClient) DeleteServiceOperation ¶
func (c *ServiceManagerClient) 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 (*ServiceManagerClient) DisableService
deprecated
func (c *ServiceManagerClient) DisableService(ctx context.Context, req *servicemanagementpb.DisableServiceRequest, opts ...gax.CallOption) (*DisableServiceOperation, error)
DisableService disables a service for a project, so it can no longer be be used for the project. It prevents accidental usage that may cause unexpected billing charges or security leaks.
Operation<response: DisableServiceResponse>
Deprecated: DisableService may be removed in a future version.
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.DisableServiceRequest{ // TODO: Fill request struct fields. } op, err := c.DisableService(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ServiceManagerClient) DisableServiceOperation ¶
func (c *ServiceManagerClient) DisableServiceOperation(name string) *DisableServiceOperation
DisableServiceOperation returns a new DisableServiceOperation from a given name. The name must be that of a previously created DisableServiceOperation, possibly from a different process.
func (*ServiceManagerClient) EnableService
deprecated
func (c *ServiceManagerClient) EnableService(ctx context.Context, req *servicemanagementpb.EnableServiceRequest, opts ...gax.CallOption) (*EnableServiceOperation, error)
EnableService enables a service for a project, so it can be used for the project. See Cloud Auth Guide (at https://cloud.google.com/docs/authentication) for more information.
Operation<response: EnableServiceResponse>
Deprecated: EnableService may be removed in a future version.
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.EnableServiceRequest{ // TODO: Fill request struct fields. } op, err := c.EnableService(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ServiceManagerClient) EnableServiceOperation ¶
func (c *ServiceManagerClient) EnableServiceOperation(name string) *EnableServiceOperation
EnableServiceOperation returns a new EnableServiceOperation from a given name. The name must be that of a previously created EnableServiceOperation, possibly from a different process.
func (*ServiceManagerClient) GenerateConfigReport ¶
func (c *ServiceManagerClient) GenerateConfigReport(ctx context.Context, req *servicemanagementpb.GenerateConfigReportRequest, opts ...gax.CallOption) (*servicemanagementpb.GenerateConfigReportResponse, error)
GenerateConfigReport generates and returns a report (errors, warnings and changes from existing configurations) associated with GenerateConfigReportRequest.new_value
If GenerateConfigReportRequest.old_value is specified, GenerateConfigReportRequest will contain a single ChangeReport based on the comparison between GenerateConfigReportRequest.new_value and GenerateConfigReportRequest.old_value. If GenerateConfigReportRequest.old_value is not specified, this method will compare GenerateConfigReportRequest.new_value with the last pushed service configuration.
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.GenerateConfigReportRequest{ // TODO: Fill request struct fields. } resp, err := c.GenerateConfigReport(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ServiceManagerClient) GetService ¶
func (c *ServiceManagerClient) GetService(ctx context.Context, req *servicemanagementpb.GetServiceRequest, opts ...gax.CallOption) (*servicemanagementpb.ManagedService, error)
GetService gets a managed service. Authentication is required unless the service is public.
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.GetServiceRequest{ // TODO: Fill request struct fields. } resp, err := c.GetService(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ServiceManagerClient) GetServiceConfig ¶
func (c *ServiceManagerClient) GetServiceConfig(ctx context.Context, req *servicemanagementpb.GetServiceConfigRequest, opts ...gax.CallOption) (*serviceconfigpb.Service, error)
GetServiceConfig gets a service configuration (version) for a managed service.
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.GetServiceConfigRequest{ // TODO: Fill request struct fields. } resp, err := c.GetServiceConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ServiceManagerClient) GetServiceRollout ¶
func (c *ServiceManagerClient) GetServiceRollout(ctx context.Context, req *servicemanagementpb.GetServiceRolloutRequest, opts ...gax.CallOption) (*servicemanagementpb.Rollout, error)
GetServiceRollout gets a service configuration rollout.
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.GetServiceRolloutRequest{ // TODO: Fill request struct fields. } resp, err := c.GetServiceRollout(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ServiceManagerClient) ListServiceConfigs ¶
func (c *ServiceManagerClient) ListServiceConfigs(ctx context.Context, req *servicemanagementpb.ListServiceConfigsRequest, opts ...gax.CallOption) *ServiceIterator
ListServiceConfigs lists the history of the service configuration for a managed service, from the newest to the oldest.
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" "google.golang.org/api/iterator" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.ListServiceConfigsRequest{ // TODO: Fill request struct fields. } it := c.ListServiceConfigs(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*ServiceManagerClient) ListServiceRollouts ¶
func (c *ServiceManagerClient) ListServiceRollouts(ctx context.Context, req *servicemanagementpb.ListServiceRolloutsRequest, opts ...gax.CallOption) *RolloutIterator
ListServiceRollouts lists the history of the service configuration rollouts for a managed service, from the newest to the oldest.
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" "google.golang.org/api/iterator" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.ListServiceRolloutsRequest{ // TODO: Fill request struct fields. } it := c.ListServiceRollouts(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*ServiceManagerClient) ListServices ¶
func (c *ServiceManagerClient) ListServices(ctx context.Context, req *servicemanagementpb.ListServicesRequest, opts ...gax.CallOption) *ManagedServiceIterator
ListServices lists managed services.
Returns all public services. For authenticated users, also returns all services the calling user has “servicemanagement.services.get” permission for.
BETA: If the caller specifies the consumer_id, it returns only the services enabled on the consumer. The consumer_id must have the format of “project:{PROJECT-ID}”.
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" "google.golang.org/api/iterator" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.ListServicesRequest{ // TODO: Fill request struct fields. } 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 } }
Output:
func (*ServiceManagerClient) SubmitConfigSource ¶
func (c *ServiceManagerClient) SubmitConfigSource(ctx context.Context, req *servicemanagementpb.SubmitConfigSourceRequest, opts ...gax.CallOption) (*SubmitConfigSourceOperation, error)
SubmitConfigSource creates a new service configuration (version) for a managed service based on user-supplied configuration source files (for example: OpenAPI Specification). This method stores the source configurations as well as the generated service configuration. To rollout the service configuration to other services, please call CreateServiceRollout.
Only the 100 most recent configuration sources and ones referenced by existing service configurtions are kept for each service. The rest will be deleted eventually.
Operation<response: SubmitConfigSourceResponse>
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.SubmitConfigSourceRequest{ // TODO: Fill request struct fields. } op, err := c.SubmitConfigSource(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ServiceManagerClient) SubmitConfigSourceOperation ¶
func (c *ServiceManagerClient) SubmitConfigSourceOperation(name string) *SubmitConfigSourceOperation
SubmitConfigSourceOperation returns a new SubmitConfigSourceOperation from a given name. The name must be that of a previously created SubmitConfigSourceOperation, possibly from a different process.
func (*ServiceManagerClient) UndeleteService ¶
func (c *ServiceManagerClient) UndeleteService(ctx context.Context, req *servicemanagementpb.UndeleteServiceRequest, opts ...gax.CallOption) (*UndeleteServiceOperation, error)
UndeleteService revives a previously deleted managed service. The method restores the service using the configuration at the time the service was deleted. The target service must exist and must have been deleted within the last 30 days.
Operation<response: UndeleteServiceResponse>
Example ¶
package main import ( "context" servicemanagement "cloud.google.com/go/servicemanagement/apiv1" servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1" ) func main() { ctx := context.Background() c, err := servicemanagement.NewServiceManagerClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &servicemanagementpb.UndeleteServiceRequest{ // TODO: Fill request struct fields. } op, err := c.UndeleteService(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*ServiceManagerClient) UndeleteServiceOperation ¶
func (c *ServiceManagerClient) UndeleteServiceOperation(name string) *UndeleteServiceOperation
UndeleteServiceOperation returns a new UndeleteServiceOperation from a given name. The name must be that of a previously created UndeleteServiceOperation, possibly from a different process.
type SubmitConfigSourceOperation ¶
type SubmitConfigSourceOperation struct {
// contains filtered or unexported fields
}
SubmitConfigSourceOperation manages a long-running operation from SubmitConfigSource.
func (*SubmitConfigSourceOperation) Done ¶
func (op *SubmitConfigSourceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*SubmitConfigSourceOperation) Metadata ¶
func (op *SubmitConfigSourceOperation) Metadata() (*servicemanagementpb.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 (*SubmitConfigSourceOperation) Name ¶
func (op *SubmitConfigSourceOperation) 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 (*SubmitConfigSourceOperation) Poll ¶
func (op *SubmitConfigSourceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.SubmitConfigSourceResponse, 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 (*SubmitConfigSourceOperation) Wait ¶
func (op *SubmitConfigSourceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.SubmitConfigSourceResponse, 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.
type UndeleteServiceOperation ¶
type UndeleteServiceOperation struct {
// contains filtered or unexported fields
}
UndeleteServiceOperation manages a long-running operation from UndeleteService.
func (*UndeleteServiceOperation) Done ¶
func (op *UndeleteServiceOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*UndeleteServiceOperation) Metadata ¶
func (op *UndeleteServiceOperation) Metadata() (*servicemanagementpb.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 (*UndeleteServiceOperation) Name ¶
func (op *UndeleteServiceOperation) 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 (*UndeleteServiceOperation) Poll ¶
func (op *UndeleteServiceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.UndeleteServiceResponse, 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 (*UndeleteServiceOperation) Wait ¶
func (op *UndeleteServiceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*servicemanagementpb.UndeleteServiceResponse, 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.