func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
CreateMonitoredProjectOperation manages a long-running operation from CreateMonitoredProject.
type CreateMonitoredProjectOperation struct {
// contains filtered or unexported fields
}
func (op *CreateMonitoredProjectOperation) Done() bool
Done reports whether the long-running operation has completed.
func (op *CreateMonitoredProjectOperation) Metadata() (*metricsscopepb.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 (op *CreateMonitoredProjectOperation) 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 (op *CreateMonitoredProjectOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*metricsscopepb.MonitoredProject, 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 (op *CreateMonitoredProjectOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*metricsscopepb.MonitoredProject, 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.
DeleteMonitoredProjectOperation manages a long-running operation from DeleteMonitoredProject.
type DeleteMonitoredProjectOperation struct {
// contains filtered or unexported fields
}
func (op *DeleteMonitoredProjectOperation) Done() bool
Done reports whether the long-running operation has completed.
func (op *DeleteMonitoredProjectOperation) Metadata() (*metricsscopepb.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 (op *DeleteMonitoredProjectOperation) 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 (op *DeleteMonitoredProjectOperation) 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 (op *DeleteMonitoredProjectOperation) 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.
MetricsScopesCallOptions contains the retry settings for each method of MetricsScopesClient.
type MetricsScopesCallOptions struct { GetMetricsScope []gax.CallOption ListMetricsScopesByMonitoredProject []gax.CallOption CreateMonitoredProject []gax.CallOption DeleteMonitoredProject []gax.CallOption }
MetricsScopesClient is a client for interacting with Cloud Monitoring API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Manages Cloud Monitoring Metrics Scopes, and the monitoring of Google Cloud projects and AWS accounts.
type MetricsScopesClient struct { // The call options for this service. CallOptions *MetricsScopesCallOptions // 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 }
func NewMetricsScopesClient(ctx context.Context, opts ...option.ClientOption) (*MetricsScopesClient, error)
NewMetricsScopesClient creates a new metrics scopes client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Manages Cloud Monitoring Metrics Scopes, and the monitoring of Google Cloud projects and AWS accounts.
▹ Example
func (c *MetricsScopesClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (c *MetricsScopesClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (c *MetricsScopesClient) CreateMonitoredProject(ctx context.Context, req *metricsscopepb.CreateMonitoredProjectRequest, opts ...gax.CallOption) (*CreateMonitoredProjectOperation, error)
CreateMonitoredProject adds a MonitoredProject with the given project ID to the specified Metrics Scope.
▹ Example
func (c *MetricsScopesClient) CreateMonitoredProjectOperation(name string) *CreateMonitoredProjectOperation
CreateMonitoredProjectOperation returns a new CreateMonitoredProjectOperation from a given name. The name must be that of a previously created CreateMonitoredProjectOperation, possibly from a different process.
func (c *MetricsScopesClient) DeleteMonitoredProject(ctx context.Context, req *metricsscopepb.DeleteMonitoredProjectRequest, opts ...gax.CallOption) (*DeleteMonitoredProjectOperation, error)
DeleteMonitoredProject deletes a MonitoredProject from the specified Metrics Scope.
▹ Example
func (c *MetricsScopesClient) DeleteMonitoredProjectOperation(name string) *DeleteMonitoredProjectOperation
DeleteMonitoredProjectOperation returns a new DeleteMonitoredProjectOperation from a given name. The name must be that of a previously created DeleteMonitoredProjectOperation, possibly from a different process.
func (c *MetricsScopesClient) GetMetricsScope(ctx context.Context, req *metricsscopepb.GetMetricsScopeRequest, opts ...gax.CallOption) (*metricsscopepb.MetricsScope, error)
GetMetricsScope returns a specific Metrics Scope.
▹ Example
func (c *MetricsScopesClient) ListMetricsScopesByMonitoredProject(ctx context.Context, req *metricsscopepb.ListMetricsScopesByMonitoredProjectRequest, opts ...gax.CallOption) (*metricsscopepb.ListMetricsScopesByMonitoredProjectResponse, error)
ListMetricsScopesByMonitoredProject returns a list of every Metrics Scope that a specific MonitoredProject has been added to. The metrics scope representing the specified monitored project will always be the first entry in the response.
▹ Example
Name | Synopsis |
---|---|
.. | |
metricsscopepb |