- 0.116.0 (latest)
- 0.115.1
- 0.114.0
- 0.113.0
- 0.112.2
- 0.111.0
- 0.110.10
- 0.109.0
- 0.108.0
- 0.107.0
- 0.106.0
- 0.105.0
- 0.104.0
- 0.103.0
- 0.102.1
- 0.101.1
- 0.100.2
- 0.99.0
- 0.98.0
- 0.97.0
- 0.96.0
- 0.95.0
- 0.94.1
- 0.93.3
- 0.92.3
- 0.91.1
- 0.90.0
- 0.89.0
- 0.88.0
- 0.87.0
- 0.86.0
- 0.85.0
- 0.84.0
- 0.83.0
- 0.82.0
- 0.81.0
- 0.80.0
- 0.79.0
- 0.78.0
- 0.77.0
- 0.76.0
- 0.75.0
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.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
}
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
}
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
}
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
}
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.
}
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
}
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
}
}
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
}
}
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
}
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
}
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.
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.
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.