go: cloud.google.com/go/monitoring/apiv3 Index | Examples | Files

package monitoring

import "cloud.google.com/go/monitoring/apiv3"

Package monitoring is an auto-generated package for the Stackdriver Monitoring API.

NOTE: This package is in alpha. It is not stable, and is likely to change.

Manages your Stackdriver Monitoring data and configurations. Most projects must be associated with a Stackdriver account, with a few exceptions as noted on the individual method pages.

Index

Examples

Package Files

alert_policy_client.go doc.go group_client.go metric_client.go notification_channel_client.go path_funcs.go uptime_check_client.go

func DefaultAuthScopes Uses

func DefaultAuthScopes() []string

DefaultAuthScopes reports the default set of authentication scopes to use with this package.

func GroupGroupPath Uses

func GroupGroupPath(project, group string) string

GroupGroupPath returns the path for the group resource.

Deprecated: Use

fmt.Sprintf("projects/%s/groups/%s", project, group)

instead.

func GroupProjectPath Uses

func GroupProjectPath(project string) string

GroupProjectPath returns the path for the project resource.

Deprecated: Use

fmt.Sprintf("projects/%s", project)

instead.

func MetricMetricDescriptorPath Uses

func MetricMetricDescriptorPath(project, metricDescriptor string) string

MetricMetricDescriptorPath returns the path for the metric descriptor resource.

Deprecated: Use

fmt.Sprintf("projects/%s/metricDescriptors/%s", project, metricDescriptor)

instead.

func MetricMonitoredResourceDescriptorPath Uses

func MetricMonitoredResourceDescriptorPath(project, monitoredResourceDescriptor string) string

MetricMonitoredResourceDescriptorPath returns the path for the monitored resource descriptor resource.

Deprecated: Use

fmt.Sprintf("projects/%s/monitoredResourceDescriptors/%s", project, monitoredResourceDescriptor)

instead.

func MetricProjectPath Uses

func MetricProjectPath(project string) string

MetricProjectPath returns the path for the project resource.

Deprecated: Use

fmt.Sprintf("projects/%s", project)

instead.

func UptimeCheckProjectPath Uses

func UptimeCheckProjectPath(project string) string

UptimeCheckProjectPath returns the path for the project resource.

Deprecated: Use

fmt.Sprintf("projects/%s", project)

instead.

func UptimeCheckUptimeCheckConfigPath Uses

func UptimeCheckUptimeCheckConfigPath(project, uptimeCheckConfig string) string

UptimeCheckUptimeCheckConfigPath returns the path for the uptime check config resource.

Deprecated: Use

fmt.Sprintf("projects/%s/uptimeCheckConfigs/%s", project, uptimeCheckConfig)

instead.

type AlertPolicyCallOptions Uses

type AlertPolicyCallOptions struct {
    ListAlertPolicies []gax.CallOption
    GetAlertPolicy    []gax.CallOption
    CreateAlertPolicy []gax.CallOption
    DeleteAlertPolicy []gax.CallOption
    UpdateAlertPolicy []gax.CallOption
}

AlertPolicyCallOptions contains the retry settings for each method of AlertPolicyClient.

type AlertPolicyClient Uses

type AlertPolicyClient struct {

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

AlertPolicyClient is a client for interacting with Stackdriver Monitoring API.

func NewAlertPolicyClient Uses

func NewAlertPolicyClient(ctx context.Context, opts ...option.ClientOption) (*AlertPolicyClient, error)

NewAlertPolicyClient creates a new alert policy service client.

The AlertPolicyService API is used to manage (list, create, delete, edit) alert policies in Stackdriver Monitoring. An alerting policy is a description of the conditions under which some aspect of your system is considered to be "unhealthy" and the ways to notify people or services about this state. In addition to using this API, alert policies can also be managed through Stackdriver Monitoring (at https://cloud.google.com/monitoring/docs/), which can be reached by clicking the "Monitoring" tab in Cloud Console (at https://console.cloud.google.com/).

Code:

ctx := context.Background()
c, err := monitoring.NewAlertPolicyClient(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use client.
_ = c

func (*AlertPolicyClient) Close Uses

func (c *AlertPolicyClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*AlertPolicyClient) Connection Uses

func (c *AlertPolicyClient) Connection() *grpc.ClientConn

Connection returns the client's connection to the API service.

func (*AlertPolicyClient) CreateAlertPolicy Uses

func (c *AlertPolicyClient) CreateAlertPolicy(ctx context.Context, req *monitoringpb.CreateAlertPolicyRequest, opts ...gax.CallOption) (*monitoringpb.AlertPolicy, error)

CreateAlertPolicy creates a new alerting policy.

Code:

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

req := &monitoringpb.CreateAlertPolicyRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.CreateAlertPolicy(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*AlertPolicyClient) DeleteAlertPolicy Uses

func (c *AlertPolicyClient) DeleteAlertPolicy(ctx context.Context, req *monitoringpb.DeleteAlertPolicyRequest, opts ...gax.CallOption) error

DeleteAlertPolicy deletes an alerting policy.

Code:

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

req := &monitoringpb.DeleteAlertPolicyRequest{
    // TODO: Fill request struct fields.
}
err = c.DeleteAlertPolicy(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*AlertPolicyClient) GetAlertPolicy Uses

func (c *AlertPolicyClient) GetAlertPolicy(ctx context.Context, req *monitoringpb.GetAlertPolicyRequest, opts ...gax.CallOption) (*monitoringpb.AlertPolicy, error)

GetAlertPolicy gets a single alerting policy.

Code:

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

req := &monitoringpb.GetAlertPolicyRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.GetAlertPolicy(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*AlertPolicyClient) ListAlertPolicies Uses

func (c *AlertPolicyClient) ListAlertPolicies(ctx context.Context, req *monitoringpb.ListAlertPoliciesRequest, opts ...gax.CallOption) *AlertPolicyIterator

ListAlertPolicies lists the existing alerting policies for the project.

Code:

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

req := &monitoringpb.ListAlertPoliciesRequest{
    // TODO: Fill request struct fields.
}
it := c.ListAlertPolicies(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

func (*AlertPolicyClient) UpdateAlertPolicy Uses

func (c *AlertPolicyClient) UpdateAlertPolicy(ctx context.Context, req *monitoringpb.UpdateAlertPolicyRequest, opts ...gax.CallOption) (*monitoringpb.AlertPolicy, error)

UpdateAlertPolicy updates an alerting policy. You can either replace the entire policy with a new one or replace only certain fields in the current alerting policy by specifying the fields to be updated via updateMask. Returns the updated alerting policy.

Code:

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

req := &monitoringpb.UpdateAlertPolicyRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.UpdateAlertPolicy(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

type AlertPolicyIterator Uses

type AlertPolicyIterator struct {

    // 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 []*monitoringpb.AlertPolicy, nextPageToken string, err error)
    // contains filtered or unexported fields
}

AlertPolicyIterator manages a stream of *monitoringpb.AlertPolicy.

func (*AlertPolicyIterator) Next Uses

func (it *AlertPolicyIterator) Next() (*monitoringpb.AlertPolicy, 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 (*AlertPolicyIterator) PageInfo Uses

func (it *AlertPolicyIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type GroupCallOptions Uses

type GroupCallOptions struct {
    ListGroups       []gax.CallOption
    GetGroup         []gax.CallOption
    CreateGroup      []gax.CallOption
    UpdateGroup      []gax.CallOption
    DeleteGroup      []gax.CallOption
    ListGroupMembers []gax.CallOption
}

GroupCallOptions contains the retry settings for each method of GroupClient.

type GroupClient Uses

type GroupClient struct {

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

GroupClient is a client for interacting with Stackdriver Monitoring API.

func NewGroupClient Uses

func NewGroupClient(ctx context.Context, opts ...option.ClientOption) (*GroupClient, error)

NewGroupClient creates a new group service client.

The Group API lets you inspect and manage your groups (at google.monitoring.v3.Group).

A group is a named filter that is used to identify a collection of monitored resources. Groups are typically used to mirror the physical and/or logical topology of the environment. Because group membership is computed dynamically, monitored resources that are started in the future are automatically placed in matching groups. By using a group to name monitored resources in, for example, an alert policy, the target of that alert policy is updated automatically as monitored resources are added and removed from the infrastructure.

Code:

ctx := context.Background()
c, err := monitoring.NewGroupClient(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use client.
_ = c

func (*GroupClient) Close Uses

func (c *GroupClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*GroupClient) Connection Uses

func (c *GroupClient) Connection() *grpc.ClientConn

Connection returns the client's connection to the API service.

func (*GroupClient) CreateGroup Uses

func (c *GroupClient) CreateGroup(ctx context.Context, req *monitoringpb.CreateGroupRequest, opts ...gax.CallOption) (*monitoringpb.Group, error)

CreateGroup creates a new group.

Code:

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

req := &monitoringpb.CreateGroupRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.CreateGroup(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*GroupClient) DeleteGroup Uses

func (c *GroupClient) DeleteGroup(ctx context.Context, req *monitoringpb.DeleteGroupRequest, opts ...gax.CallOption) error

DeleteGroup deletes an existing group.

Code:

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

req := &monitoringpb.DeleteGroupRequest{
    // TODO: Fill request struct fields.
}
err = c.DeleteGroup(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*GroupClient) GetGroup Uses

func (c *GroupClient) GetGroup(ctx context.Context, req *monitoringpb.GetGroupRequest, opts ...gax.CallOption) (*monitoringpb.Group, error)

GetGroup gets a single group.

Code:

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

req := &monitoringpb.GetGroupRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.GetGroup(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*GroupClient) ListGroupMembers Uses

func (c *GroupClient) ListGroupMembers(ctx context.Context, req *monitoringpb.ListGroupMembersRequest, opts ...gax.CallOption) *MonitoredResourceIterator

ListGroupMembers lists the monitored resources that are members of a group.

Code:

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

req := &monitoringpb.ListGroupMembersRequest{
    // TODO: Fill request struct fields.
}
it := c.ListGroupMembers(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

func (*GroupClient) ListGroups Uses

func (c *GroupClient) ListGroups(ctx context.Context, req *monitoringpb.ListGroupsRequest, opts ...gax.CallOption) *GroupIterator

ListGroups lists the existing groups.

Code:

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

req := &monitoringpb.ListGroupsRequest{
    // TODO: Fill request struct fields.
}
it := c.ListGroups(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

func (*GroupClient) UpdateGroup Uses

func (c *GroupClient) UpdateGroup(ctx context.Context, req *monitoringpb.UpdateGroupRequest, opts ...gax.CallOption) (*monitoringpb.Group, error)

UpdateGroup updates an existing group. You can change any group attributes except name.

Code:

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

req := &monitoringpb.UpdateGroupRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.UpdateGroup(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

type GroupIterator Uses

type GroupIterator struct {

    // 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 []*monitoringpb.Group, nextPageToken string, err error)
    // contains filtered or unexported fields
}

GroupIterator manages a stream of *monitoringpb.Group.

func (*GroupIterator) Next Uses

func (it *GroupIterator) Next() (*monitoringpb.Group, 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 (*GroupIterator) PageInfo Uses

func (it *GroupIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type MetricCallOptions Uses

type MetricCallOptions struct {
    ListMonitoredResourceDescriptors []gax.CallOption
    GetMonitoredResourceDescriptor   []gax.CallOption
    ListMetricDescriptors            []gax.CallOption
    GetMetricDescriptor              []gax.CallOption
    CreateMetricDescriptor           []gax.CallOption
    DeleteMetricDescriptor           []gax.CallOption
    ListTimeSeries                   []gax.CallOption
    CreateTimeSeries                 []gax.CallOption
}

MetricCallOptions contains the retry settings for each method of MetricClient.

type MetricClient Uses

type MetricClient struct {

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

MetricClient is a client for interacting with Stackdriver Monitoring API.

func NewMetricClient Uses

func NewMetricClient(ctx context.Context, opts ...option.ClientOption) (*MetricClient, error)

NewMetricClient creates a new metric service client.

Manages metric descriptors, monitored resource descriptors, and time series data.

Code:

ctx := context.Background()
c, err := monitoring.NewMetricClient(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use client.
_ = c

func (*MetricClient) Close Uses

func (c *MetricClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*MetricClient) Connection Uses

func (c *MetricClient) Connection() *grpc.ClientConn

Connection returns the client's connection to the API service.

func (*MetricClient) CreateMetricDescriptor Uses

func (c *MetricClient) CreateMetricDescriptor(ctx context.Context, req *monitoringpb.CreateMetricDescriptorRequest, opts ...gax.CallOption) (*metricpb.MetricDescriptor, error)

CreateMetricDescriptor creates a new metric descriptor. User-created metric descriptors define custom metrics (at /monitoring/custom-metrics).

Code:

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

req := &monitoringpb.CreateMetricDescriptorRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.CreateMetricDescriptor(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*MetricClient) CreateTimeSeries Uses

func (c *MetricClient) CreateTimeSeries(ctx context.Context, req *monitoringpb.CreateTimeSeriesRequest, opts ...gax.CallOption) error

CreateTimeSeries creates or adds data to one or more time series. The response is empty if all time series in the request were written. If any time series could not be written, a corresponding failure message is included in the error response.

Code:

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

req := &monitoringpb.CreateTimeSeriesRequest{
    // TODO: Fill request struct fields.
}
err = c.CreateTimeSeries(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*MetricClient) DeleteMetricDescriptor Uses

func (c *MetricClient) DeleteMetricDescriptor(ctx context.Context, req *monitoringpb.DeleteMetricDescriptorRequest, opts ...gax.CallOption) error

DeleteMetricDescriptor deletes a metric descriptor. Only user-created custom metrics (at /monitoring/custom-metrics) can be deleted.

Code:

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

req := &monitoringpb.DeleteMetricDescriptorRequest{
    // TODO: Fill request struct fields.
}
err = c.DeleteMetricDescriptor(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*MetricClient) GetMetricDescriptor Uses

func (c *MetricClient) GetMetricDescriptor(ctx context.Context, req *monitoringpb.GetMetricDescriptorRequest, opts ...gax.CallOption) (*metricpb.MetricDescriptor, error)

GetMetricDescriptor gets a single metric descriptor. This method does not require a Stackdriver account.

Code:

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

req := &monitoringpb.GetMetricDescriptorRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.GetMetricDescriptor(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*MetricClient) GetMonitoredResourceDescriptor Uses

func (c *MetricClient) GetMonitoredResourceDescriptor(ctx context.Context, req *monitoringpb.GetMonitoredResourceDescriptorRequest, opts ...gax.CallOption) (*monitoredrespb.MonitoredResourceDescriptor, error)

GetMonitoredResourceDescriptor gets a single monitored resource descriptor. This method does not require a Stackdriver account.

Code:

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

req := &monitoringpb.GetMonitoredResourceDescriptorRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.GetMonitoredResourceDescriptor(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*MetricClient) ListMetricDescriptors Uses

func (c *MetricClient) ListMetricDescriptors(ctx context.Context, req *monitoringpb.ListMetricDescriptorsRequest, opts ...gax.CallOption) *MetricDescriptorIterator

ListMetricDescriptors lists metric descriptors that match a filter. This method does not require a Stackdriver account.

Code:

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

req := &monitoringpb.ListMetricDescriptorsRequest{
    // TODO: Fill request struct fields.
}
it := c.ListMetricDescriptors(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

func (*MetricClient) ListMonitoredResourceDescriptors Uses

func (c *MetricClient) ListMonitoredResourceDescriptors(ctx context.Context, req *monitoringpb.ListMonitoredResourceDescriptorsRequest, opts ...gax.CallOption) *MonitoredResourceDescriptorIterator

ListMonitoredResourceDescriptors lists monitored resource descriptors that match a filter. This method does not require a Stackdriver account.

Code:

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

req := &monitoringpb.ListMonitoredResourceDescriptorsRequest{
    // TODO: Fill request struct fields.
}
it := c.ListMonitoredResourceDescriptors(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

func (*MetricClient) ListTimeSeries Uses

func (c *MetricClient) ListTimeSeries(ctx context.Context, req *monitoringpb.ListTimeSeriesRequest, opts ...gax.CallOption) *TimeSeriesIterator

ListTimeSeries lists time series that match a filter. This method does not require a Stackdriver account.

Code:

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

req := &monitoringpb.ListTimeSeriesRequest{
    // TODO: Fill request struct fields.
}
it := c.ListTimeSeries(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

type MetricDescriptorIterator Uses

type MetricDescriptorIterator struct {

    // 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 []*metricpb.MetricDescriptor, nextPageToken string, err error)
    // contains filtered or unexported fields
}

MetricDescriptorIterator manages a stream of *metricpb.MetricDescriptor.

func (*MetricDescriptorIterator) Next Uses

func (it *MetricDescriptorIterator) Next() (*metricpb.MetricDescriptor, 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 (*MetricDescriptorIterator) PageInfo Uses

func (it *MetricDescriptorIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type MonitoredResourceDescriptorIterator Uses

type MonitoredResourceDescriptorIterator struct {

    // 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 []*monitoredrespb.MonitoredResourceDescriptor, nextPageToken string, err error)
    // contains filtered or unexported fields
}

MonitoredResourceDescriptorIterator manages a stream of *monitoredrespb.MonitoredResourceDescriptor.

func (*MonitoredResourceDescriptorIterator) Next Uses

func (it *MonitoredResourceDescriptorIterator) Next() (*monitoredrespb.MonitoredResourceDescriptor, 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 (*MonitoredResourceDescriptorIterator) PageInfo Uses

func (it *MonitoredResourceDescriptorIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type MonitoredResourceIterator Uses

type MonitoredResourceIterator struct {

    // 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 []*monitoredrespb.MonitoredResource, nextPageToken string, err error)
    // contains filtered or unexported fields
}

MonitoredResourceIterator manages a stream of *monitoredrespb.MonitoredResource.

func (*MonitoredResourceIterator) Next Uses

func (it *MonitoredResourceIterator) Next() (*monitoredrespb.MonitoredResource, 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 (*MonitoredResourceIterator) PageInfo Uses

func (it *MonitoredResourceIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type NotificationChannelCallOptions Uses

type NotificationChannelCallOptions struct {
    ListNotificationChannelDescriptors []gax.CallOption
    GetNotificationChannelDescriptor   []gax.CallOption
    ListNotificationChannels           []gax.CallOption
    GetNotificationChannel             []gax.CallOption
    CreateNotificationChannel          []gax.CallOption
    UpdateNotificationChannel          []gax.CallOption
    DeleteNotificationChannel          []gax.CallOption
}

NotificationChannelCallOptions contains the retry settings for each method of NotificationChannelClient.

type NotificationChannelClient Uses

type NotificationChannelClient struct {

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

NotificationChannelClient is a client for interacting with Stackdriver Monitoring API.

func NewNotificationChannelClient Uses

func NewNotificationChannelClient(ctx context.Context, opts ...option.ClientOption) (*NotificationChannelClient, error)

NewNotificationChannelClient creates a new notification channel service client.

The Notification Channel API provides access to configuration that controls how messages related to incidents are sent.

Code:

ctx := context.Background()
c, err := monitoring.NewNotificationChannelClient(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use client.
_ = c

func (*NotificationChannelClient) Close Uses

func (c *NotificationChannelClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*NotificationChannelClient) Connection Uses

func (c *NotificationChannelClient) Connection() *grpc.ClientConn

Connection returns the client's connection to the API service.

func (*NotificationChannelClient) CreateNotificationChannel Uses

func (c *NotificationChannelClient) CreateNotificationChannel(ctx context.Context, req *monitoringpb.CreateNotificationChannelRequest, opts ...gax.CallOption) (*monitoringpb.NotificationChannel, error)

CreateNotificationChannel creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or pagerduty service.

Code:

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

req := &monitoringpb.CreateNotificationChannelRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.CreateNotificationChannel(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*NotificationChannelClient) DeleteNotificationChannel Uses

func (c *NotificationChannelClient) DeleteNotificationChannel(ctx context.Context, req *monitoringpb.DeleteNotificationChannelRequest, opts ...gax.CallOption) error

DeleteNotificationChannel deletes a notification channel.

Code:

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

req := &monitoringpb.DeleteNotificationChannelRequest{
    // TODO: Fill request struct fields.
}
err = c.DeleteNotificationChannel(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*NotificationChannelClient) GetNotificationChannel Uses

func (c *NotificationChannelClient) GetNotificationChannel(ctx context.Context, req *monitoringpb.GetNotificationChannelRequest, opts ...gax.CallOption) (*monitoringpb.NotificationChannel, error)

GetNotificationChannel gets a single notification channel. The channel includes the relevant configuration details with which the channel was created. However, the response may truncate or omit passwords, API keys, or other private key matter and thus the response may not be 100% identical to the information that was supplied in the call to the create method.

Code:

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

req := &monitoringpb.GetNotificationChannelRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.GetNotificationChannel(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*NotificationChannelClient) GetNotificationChannelDescriptor Uses

func (c *NotificationChannelClient) GetNotificationChannelDescriptor(ctx context.Context, req *monitoringpb.GetNotificationChannelDescriptorRequest, opts ...gax.CallOption) (*monitoringpb.NotificationChannelDescriptor, error)

GetNotificationChannelDescriptor gets a single channel descriptor. The descriptor indicates which fields are expected / permitted for a notification channel of the given type.

Code:

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

req := &monitoringpb.GetNotificationChannelDescriptorRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.GetNotificationChannelDescriptor(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*NotificationChannelClient) ListNotificationChannelDescriptors Uses

func (c *NotificationChannelClient) ListNotificationChannelDescriptors(ctx context.Context, req *monitoringpb.ListNotificationChannelDescriptorsRequest, opts ...gax.CallOption) *NotificationChannelDescriptorIterator

ListNotificationChannelDescriptors lists the descriptors for supported channel types. The use of descriptors makes it possible for new channel types to be dynamically added.

Code:

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

req := &monitoringpb.ListNotificationChannelDescriptorsRequest{
    // TODO: Fill request struct fields.
}
it := c.ListNotificationChannelDescriptors(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

func (*NotificationChannelClient) ListNotificationChannels Uses

func (c *NotificationChannelClient) ListNotificationChannels(ctx context.Context, req *monitoringpb.ListNotificationChannelsRequest, opts ...gax.CallOption) *NotificationChannelIterator

ListNotificationChannels lists the notification channels that have been created for the project.

Code:

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

req := &monitoringpb.ListNotificationChannelsRequest{
    // TODO: Fill request struct fields.
}
it := c.ListNotificationChannels(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

func (*NotificationChannelClient) UpdateNotificationChannel Uses

func (c *NotificationChannelClient) UpdateNotificationChannel(ctx context.Context, req *monitoringpb.UpdateNotificationChannelRequest, opts ...gax.CallOption) (*monitoringpb.NotificationChannel, error)

UpdateNotificationChannel updates a notification channel. Fields not specified in the field mask remain unchanged.

Code:

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

req := &monitoringpb.UpdateNotificationChannelRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.UpdateNotificationChannel(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

type NotificationChannelDescriptorIterator Uses

type NotificationChannelDescriptorIterator struct {

    // 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 []*monitoringpb.NotificationChannelDescriptor, nextPageToken string, err error)
    // contains filtered or unexported fields
}

NotificationChannelDescriptorIterator manages a stream of *monitoringpb.NotificationChannelDescriptor.

func (*NotificationChannelDescriptorIterator) Next Uses

func (it *NotificationChannelDescriptorIterator) Next() (*monitoringpb.NotificationChannelDescriptor, 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 (*NotificationChannelDescriptorIterator) PageInfo Uses

func (it *NotificationChannelDescriptorIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type NotificationChannelIterator Uses

type NotificationChannelIterator struct {

    // 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 []*monitoringpb.NotificationChannel, nextPageToken string, err error)
    // contains filtered or unexported fields
}

NotificationChannelIterator manages a stream of *monitoringpb.NotificationChannel.

func (*NotificationChannelIterator) Next Uses

func (it *NotificationChannelIterator) Next() (*monitoringpb.NotificationChannel, 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 (*NotificationChannelIterator) PageInfo Uses

func (it *NotificationChannelIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type TimeSeriesIterator Uses

type TimeSeriesIterator struct {

    // 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 []*monitoringpb.TimeSeries, nextPageToken string, err error)
    // contains filtered or unexported fields
}

TimeSeriesIterator manages a stream of *monitoringpb.TimeSeries.

func (*TimeSeriesIterator) Next Uses

func (it *TimeSeriesIterator) Next() (*monitoringpb.TimeSeries, 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 (*TimeSeriesIterator) PageInfo Uses

func (it *TimeSeriesIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type UptimeCheckCallOptions Uses

type UptimeCheckCallOptions struct {
    ListUptimeCheckConfigs  []gax.CallOption
    GetUptimeCheckConfig    []gax.CallOption
    CreateUptimeCheckConfig []gax.CallOption
    UpdateUptimeCheckConfig []gax.CallOption
    DeleteUptimeCheckConfig []gax.CallOption
    ListUptimeCheckIps      []gax.CallOption
}

UptimeCheckCallOptions contains the retry settings for each method of UptimeCheckClient.

type UptimeCheckClient Uses

type UptimeCheckClient struct {

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

UptimeCheckClient is a client for interacting with Stackdriver Monitoring API.

func NewUptimeCheckClient Uses

func NewUptimeCheckClient(ctx context.Context, opts ...option.ClientOption) (*UptimeCheckClient, error)

NewUptimeCheckClient creates a new uptime check service client.

The UptimeCheckService API is used to manage (list, create, delete, edit) uptime check configurations in the Stackdriver Monitoring product. An uptime check is a piece of configuration that determines which resources and services to monitor for availability. These configurations can also be configured interactively by navigating to the [Cloud Console] (http://console.cloud.google.com), selecting the appropriate project, clicking on "Monitoring" on the left-hand side to navigate to Stackdriver, and then clicking on "Uptime".

Code:

ctx := context.Background()
c, err := monitoring.NewUptimeCheckClient(ctx)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use client.
_ = c

func (*UptimeCheckClient) Close Uses

func (c *UptimeCheckClient) Close() error

Close closes the connection to the API service. The user should invoke this when the client is no longer required.

func (*UptimeCheckClient) Connection Uses

func (c *UptimeCheckClient) Connection() *grpc.ClientConn

Connection returns the client's connection to the API service.

func (*UptimeCheckClient) CreateUptimeCheckConfig Uses

func (c *UptimeCheckClient) CreateUptimeCheckConfig(ctx context.Context, req *monitoringpb.CreateUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error)

CreateUptimeCheckConfig creates a new uptime check configuration.

Code:

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

req := &monitoringpb.CreateUptimeCheckConfigRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.CreateUptimeCheckConfig(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*UptimeCheckClient) DeleteUptimeCheckConfig Uses

func (c *UptimeCheckClient) DeleteUptimeCheckConfig(ctx context.Context, req *monitoringpb.DeleteUptimeCheckConfigRequest, opts ...gax.CallOption) error

DeleteUptimeCheckConfig deletes an uptime check configuration. Note that this method will fail if the uptime check configuration is referenced by an alert policy or other dependent configs that would be rendered invalid by the deletion.

Code:

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

req := &monitoringpb.DeleteUptimeCheckConfigRequest{
    // TODO: Fill request struct fields.
}
err = c.DeleteUptimeCheckConfig(ctx, req)
if err != nil {
    // TODO: Handle error.
}

func (*UptimeCheckClient) GetUptimeCheckConfig Uses

func (c *UptimeCheckClient) GetUptimeCheckConfig(ctx context.Context, req *monitoringpb.GetUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error)

GetUptimeCheckConfig gets a single uptime check configuration.

Code:

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

req := &monitoringpb.GetUptimeCheckConfigRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.GetUptimeCheckConfig(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

func (*UptimeCheckClient) ListUptimeCheckConfigs Uses

func (c *UptimeCheckClient) ListUptimeCheckConfigs(ctx context.Context, req *monitoringpb.ListUptimeCheckConfigsRequest, opts ...gax.CallOption) *UptimeCheckConfigIterator

ListUptimeCheckConfigs lists the existing valid uptime check configurations for the project, leaving out any invalid configurations.

Code:

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

req := &monitoringpb.ListUptimeCheckConfigsRequest{
    // TODO: Fill request struct fields.
}
it := c.ListUptimeCheckConfigs(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

func (*UptimeCheckClient) ListUptimeCheckIps Uses

func (c *UptimeCheckClient) ListUptimeCheckIps(ctx context.Context, req *monitoringpb.ListUptimeCheckIpsRequest, opts ...gax.CallOption) *UptimeCheckIpIterator

ListUptimeCheckIps returns the list of IPs that checkers run from

Code:

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

req := &monitoringpb.ListUptimeCheckIpsRequest{
    // TODO: Fill request struct fields.
}
it := c.ListUptimeCheckIps(ctx, req)
for {
    resp, err := it.Next()
    if err == iterator.Done {
        break
    }
    if err != nil {
        // TODO: Handle error.
    }
    // TODO: Use resp.
    _ = resp
}

func (*UptimeCheckClient) UpdateUptimeCheckConfig Uses

func (c *UptimeCheckClient) UpdateUptimeCheckConfig(ctx context.Context, req *monitoringpb.UpdateUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error)

UpdateUptimeCheckConfig updates an uptime check configuration. You can either replace the entire configuration with a new one or replace only certain fields in the current configuration by specifying the fields to be updated via "updateMask". Returns the updated configuration.

Code:

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

req := &monitoringpb.UpdateUptimeCheckConfigRequest{
    // TODO: Fill request struct fields.
}
resp, err := c.UpdateUptimeCheckConfig(ctx, req)
if err != nil {
    // TODO: Handle error.
}
// TODO: Use resp.
_ = resp

type UptimeCheckConfigIterator Uses

type UptimeCheckConfigIterator struct {

    // 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 []*monitoringpb.UptimeCheckConfig, nextPageToken string, err error)
    // contains filtered or unexported fields
}

UptimeCheckConfigIterator manages a stream of *monitoringpb.UptimeCheckConfig.

func (*UptimeCheckConfigIterator) Next Uses

func (it *UptimeCheckConfigIterator) Next() (*monitoringpb.UptimeCheckConfig, 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 (*UptimeCheckConfigIterator) PageInfo Uses

func (it *UptimeCheckConfigIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

type UptimeCheckIpIterator Uses

type UptimeCheckIpIterator struct {

    // 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 []*monitoringpb.UptimeCheckIp, nextPageToken string, err error)
    // contains filtered or unexported fields
}

UptimeCheckIpIterator manages a stream of *monitoringpb.UptimeCheckIp.

func (*UptimeCheckIpIterator) Next Uses

func (it *UptimeCheckIpIterator) Next() (*monitoringpb.UptimeCheckIp, 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 (*UptimeCheckIpIterator) PageInfo Uses

func (it *UptimeCheckIpIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. See the google.golang.org/api/iterator package for details.

Package monitoring imports 14 packages (graph) and is imported by 15 packages. Updated 2018-04-21. Refresh now. Tools for package owners.