Service Management API v1 - Package cloud.google.com/go/servicemanagement/apiv1 (v0.76.0)

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 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

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

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

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

Done reports whether the long-running operation has completed.

func (*CreateServiceRolloutOperation) Metadata

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

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

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

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

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

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

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

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

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

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

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

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

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

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 {

	// LROClient is used internally to handle longrunning operations.
	// It is exposed so that its CallOptions can be modified if required.
	// Users should not Close this client.
	LROClient *lroauto.OperationsClient

	// The call options for this service.
	CallOptions *ServiceManagerCallOptions
	// contains filtered or unexported fields
}

ServiceManagerClient is a client for interacting with .

Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.

func NewServiceManagerClient

func NewServiceManagerClient(ctx context.Context, opts ...option.ClientOption) (*ServiceManagerClient, error)

NewServiceManagerClient creates a new service manager client.

Google Service Management API (at /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.
	}
	// 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

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() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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>

Example

package main

import (
	"context"

	servicemanagement "cloud.google.com/go/servicemanagement/apiv1"

	servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"
)

func main() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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>

Example

package main

import (
	"context"

	servicemanagement "cloud.google.com/go/servicemanagement/apiv1"

	servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"
)

func main() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"
	// import "google.golang.org/api/iterator"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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() {
	// import servicemanagementpb "google.golang.org/genproto/googleapis/api/servicemanagement/v1"

	ctx := context.Background()
	c, err := servicemanagement.NewServiceManagerClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

	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

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

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

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

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

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

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

Wait blocks until the long-running operation is completed, returning the response and any errors encountered.

See documentation of Poll for error-handling information.