Documentation ¶
Overview ¶
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 ¶
- func DefaultAuthScopes() []string
- func GroupGroupPath(project, group string) stringdeprecated
- func GroupProjectPath(project string) stringdeprecated
- func MetricMetricDescriptorPath(project, metricDescriptor string) stringdeprecated
- func MetricMonitoredResourceDescriptorPath(project, monitoredResourceDescriptor string) stringdeprecated
- func MetricProjectPath(project string) stringdeprecated
- func UptimeCheckProjectPath(project string) stringdeprecated
- func UptimeCheckUptimeCheckConfigPath(project, uptimeCheckConfig string) stringdeprecated
- type GroupCallOptions
- type GroupClient
- func (c *GroupClient) Close() error
- func (c *GroupClient) Connection() *grpc.ClientConn
- func (c *GroupClient) CreateGroup(ctx context.Context, req *monitoringpb.CreateGroupRequest, ...) (*monitoringpb.Group, error)
- func (c *GroupClient) DeleteGroup(ctx context.Context, req *monitoringpb.DeleteGroupRequest, ...) error
- func (c *GroupClient) GetGroup(ctx context.Context, req *monitoringpb.GetGroupRequest, opts ...gax.CallOption) (*monitoringpb.Group, error)
- func (c *GroupClient) ListGroupMembers(ctx context.Context, req *monitoringpb.ListGroupMembersRequest, ...) *MonitoredResourceIterator
- func (c *GroupClient) ListGroups(ctx context.Context, req *monitoringpb.ListGroupsRequest, ...) *GroupIterator
- func (c *GroupClient) UpdateGroup(ctx context.Context, req *monitoringpb.UpdateGroupRequest, ...) (*monitoringpb.Group, error)
- type GroupIterator
- type MetricCallOptions
- type MetricClient
- func (c *MetricClient) Close() error
- func (c *MetricClient) Connection() *grpc.ClientConn
- func (c *MetricClient) CreateMetricDescriptor(ctx context.Context, req *monitoringpb.CreateMetricDescriptorRequest, ...) (*metricpb.MetricDescriptor, error)
- func (c *MetricClient) CreateTimeSeries(ctx context.Context, req *monitoringpb.CreateTimeSeriesRequest, ...) error
- func (c *MetricClient) DeleteMetricDescriptor(ctx context.Context, req *monitoringpb.DeleteMetricDescriptorRequest, ...) error
- func (c *MetricClient) GetMetricDescriptor(ctx context.Context, req *monitoringpb.GetMetricDescriptorRequest, ...) (*metricpb.MetricDescriptor, error)
- func (c *MetricClient) GetMonitoredResourceDescriptor(ctx context.Context, req *monitoringpb.GetMonitoredResourceDescriptorRequest, ...) (*monitoredrespb.MonitoredResourceDescriptor, error)
- func (c *MetricClient) ListMetricDescriptors(ctx context.Context, req *monitoringpb.ListMetricDescriptorsRequest, ...) *MetricDescriptorIterator
- func (c *MetricClient) ListMonitoredResourceDescriptors(ctx context.Context, req *monitoringpb.ListMonitoredResourceDescriptorsRequest, ...) *MonitoredResourceDescriptorIterator
- func (c *MetricClient) ListTimeSeries(ctx context.Context, req *monitoringpb.ListTimeSeriesRequest, ...) *TimeSeriesIterator
- type MetricDescriptorIterator
- type MonitoredResourceDescriptorIterator
- type MonitoredResourceIterator
- type TimeSeriesIterator
- type UptimeCheckCallOptions
- type UptimeCheckClient
- func (c *UptimeCheckClient) Close() error
- func (c *UptimeCheckClient) Connection() *grpc.ClientConn
- func (c *UptimeCheckClient) CreateUptimeCheckConfig(ctx context.Context, req *monitoringpb.CreateUptimeCheckConfigRequest, ...) (*monitoringpb.UptimeCheckConfig, error)
- func (c *UptimeCheckClient) DeleteUptimeCheckConfig(ctx context.Context, req *monitoringpb.DeleteUptimeCheckConfigRequest, ...) error
- func (c *UptimeCheckClient) GetUptimeCheckConfig(ctx context.Context, req *monitoringpb.GetUptimeCheckConfigRequest, ...) (*monitoringpb.UptimeCheckConfig, error)
- func (c *UptimeCheckClient) ListUptimeCheckConfigs(ctx context.Context, req *monitoringpb.ListUptimeCheckConfigsRequest, ...) *UptimeCheckConfigIterator
- func (c *UptimeCheckClient) ListUptimeCheckIps(ctx context.Context, req *monitoringpb.ListUptimeCheckIpsRequest, ...) *UptimeCheckIpIterator
- func (c *UptimeCheckClient) UpdateUptimeCheckConfig(ctx context.Context, req *monitoringpb.UpdateUptimeCheckConfigRequest, ...) (*monitoringpb.UptimeCheckConfig, error)
- type UptimeCheckConfigIterator
- type UptimeCheckIpIterator
Examples ¶
- GroupClient.CreateGroup
- GroupClient.DeleteGroup
- GroupClient.GetGroup
- GroupClient.ListGroupMembers
- GroupClient.ListGroups
- GroupClient.UpdateGroup
- MetricClient.CreateMetricDescriptor
- MetricClient.CreateTimeSeries
- MetricClient.DeleteMetricDescriptor
- MetricClient.GetMetricDescriptor
- MetricClient.GetMonitoredResourceDescriptor
- MetricClient.ListMetricDescriptors
- MetricClient.ListMonitoredResourceDescriptors
- MetricClient.ListTimeSeries
- NewGroupClient
- NewMetricClient
- NewUptimeCheckClient
- UptimeCheckClient.CreateUptimeCheckConfig
- UptimeCheckClient.DeleteUptimeCheckConfig
- UptimeCheckClient.GetUptimeCheckConfig
- UptimeCheckClient.ListUptimeCheckConfigs
- UptimeCheckClient.ListUptimeCheckIps
- UptimeCheckClient.UpdateUptimeCheckConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶ added in v0.8.0
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
func GroupGroupPath
deprecated
func GroupProjectPath
deprecated
func MetricMetricDescriptorPath
deprecated
added in
v0.3.0
func MetricMonitoredResourceDescriptorPath
deprecated
MetricMonitoredResourceDescriptorPath returns the path for the monitored resource descriptor resource.
Deprecated: Use
fmt.Sprintf("projects/%s/monitoredResourceDescriptors/%s", project, monitoredResourceDescriptor)
instead.
func MetricProjectPath
deprecated
func UptimeCheckProjectPath
deprecated
added in
v0.18.0
func UptimeCheckUptimeCheckConfigPath
deprecated
added in
v0.18.0
Types ¶
type GroupCallOptions ¶
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 ¶
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 ¶
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.
Example ¶
ctx := context.Background() c, err := monitoring.NewGroupClient(ctx) if err != nil { // TODO: Handle error. } // TODO: Use client. _ = c
Output:
func (*GroupClient) Close ¶
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 ¶
func (c *GroupClient) Connection() *grpc.ClientConn
Connection returns the client's connection to the API service.
func (*GroupClient) CreateGroup ¶
func (c *GroupClient) CreateGroup(ctx context.Context, req *monitoringpb.CreateGroupRequest, opts ...gax.CallOption) (*monitoringpb.Group, error)
CreateGroup creates a new group.
Example ¶
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
Output:
func (*GroupClient) DeleteGroup ¶
func (c *GroupClient) DeleteGroup(ctx context.Context, req *monitoringpb.DeleteGroupRequest, opts ...gax.CallOption) error
DeleteGroup deletes an existing group.
Example ¶
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. }
Output:
func (*GroupClient) GetGroup ¶
func (c *GroupClient) GetGroup(ctx context.Context, req *monitoringpb.GetGroupRequest, opts ...gax.CallOption) (*monitoringpb.Group, error)
GetGroup gets a single group.
Example ¶
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
Output:
func (*GroupClient) ListGroupMembers ¶
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.
Example ¶
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 }
Output:
func (*GroupClient) ListGroups ¶
func (c *GroupClient) ListGroups(ctx context.Context, req *monitoringpb.ListGroupsRequest, opts ...gax.CallOption) *GroupIterator
ListGroups lists the existing groups.
Example ¶
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 }
Output:
func (*GroupClient) UpdateGroup ¶
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.
Example ¶
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
Output:
type GroupIterator ¶
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 ¶
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 ¶ added in v0.3.0
func (it *GroupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type MetricCallOptions ¶
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 ¶
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 ¶
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.
Example ¶
ctx := context.Background() c, err := monitoring.NewMetricClient(ctx) if err != nil { // TODO: Handle error. } // TODO: Use client. _ = c
Output:
func (*MetricClient) Close ¶
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 ¶
func (c *MetricClient) Connection() *grpc.ClientConn
Connection returns the client's connection to the API service.
func (*MetricClient) CreateMetricDescriptor ¶
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).
Example ¶
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
Output:
func (*MetricClient) CreateTimeSeries ¶
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.
Example ¶
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. }
Output:
func (*MetricClient) DeleteMetricDescriptor ¶
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.
Example ¶
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. }
Output:
func (*MetricClient) GetMetricDescriptor ¶
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.
Example ¶
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
Output:
func (*MetricClient) GetMonitoredResourceDescriptor ¶
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.
Example ¶
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
Output:
func (*MetricClient) ListMetricDescriptors ¶
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.
Example ¶
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 }
Output:
func (*MetricClient) ListMonitoredResourceDescriptors ¶
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.
Example ¶
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 }
Output:
func (*MetricClient) ListTimeSeries ¶
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.
Example ¶
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 }
Output:
type MetricDescriptorIterator ¶
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 ¶
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 ¶ added in v0.3.0
func (it *MetricDescriptorIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type MonitoredResourceDescriptorIterator ¶
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 ¶
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 ¶ added in v0.3.0
func (it *MonitoredResourceDescriptorIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type MonitoredResourceIterator ¶
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 ¶
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 ¶ added in v0.3.0
func (it *MonitoredResourceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TimeSeriesIterator ¶
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 ¶
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 ¶ added in v0.3.0
func (it *TimeSeriesIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type UptimeCheckCallOptions ¶ added in v0.18.0
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 ¶ added in v0.18.0
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 ¶ added in v0.18.0
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".
Example ¶
ctx := context.Background() c, err := monitoring.NewUptimeCheckClient(ctx) if err != nil { // TODO: Handle error. } // TODO: Use client. _ = c
Output:
func (*UptimeCheckClient) Close ¶ added in v0.18.0
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 ¶ added in v0.18.0
func (c *UptimeCheckClient) Connection() *grpc.ClientConn
Connection returns the client's connection to the API service.
func (*UptimeCheckClient) CreateUptimeCheckConfig ¶ added in v0.18.0
func (c *UptimeCheckClient) CreateUptimeCheckConfig(ctx context.Context, req *monitoringpb.CreateUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error)
CreateUptimeCheckConfig creates a new uptime check configuration.
Example ¶
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
Output:
func (*UptimeCheckClient) DeleteUptimeCheckConfig ¶ added in v0.18.0
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.
Example ¶
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. }
Output:
func (*UptimeCheckClient) GetUptimeCheckConfig ¶ added in v0.18.0
func (c *UptimeCheckClient) GetUptimeCheckConfig(ctx context.Context, req *monitoringpb.GetUptimeCheckConfigRequest, opts ...gax.CallOption) (*monitoringpb.UptimeCheckConfig, error)
GetUptimeCheckConfig gets a single uptime check configuration.
Example ¶
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
Output:
func (*UptimeCheckClient) ListUptimeCheckConfigs ¶ added in v0.18.0
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.
Example ¶
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 }
Output:
func (*UptimeCheckClient) ListUptimeCheckIps ¶ added in v0.18.0
func (c *UptimeCheckClient) ListUptimeCheckIps(ctx context.Context, req *monitoringpb.ListUptimeCheckIpsRequest, opts ...gax.CallOption) *UptimeCheckIpIterator
ListUptimeCheckIps returns the list of IPs that checkers run from
Example ¶
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 }
Output:
func (*UptimeCheckClient) UpdateUptimeCheckConfig ¶ added in v0.18.0
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.
Example ¶
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
Output:
type UptimeCheckConfigIterator ¶ added in v0.18.0
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 ¶ added in v0.18.0
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 ¶ added in v0.18.0
func (it *UptimeCheckConfigIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type UptimeCheckIpIterator ¶ added in v0.18.0
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 ¶ added in v0.18.0
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 ¶ added in v0.18.0
func (it *UptimeCheckIpIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.