Package cloud.google.com/go/monitoring/apiv3 (v1.24.3)

Note: To get more information about this package, such as access to older versions, viewthis package on pkg.go.dev.

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

Manages your Cloud Monitoring data and configurations. Most projects mustbe associated with a Workspace, with a few exceptions as noted on theindividual method pages. The table entries below are presented inalphabetical order, not in order of common use. For explanations of theconcepts found in the table entries, read the [Cloud Monitoringdocumentation](https://cloud.google.com/monitoring/docs).

Use of Context

The ctx passed to NewClient is used for authentication requests andfor 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 moreplease visit godoc.org/cloud.google.com/go.

Deprecated: Please use cloud.google.com/go/monitoring/apiv3/v2.

Functions

func DefaultAuthScopes (deprecated)

funcDefaultAuthScopes()[]string

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

func GroupGroupPath (deprecated)

funcGroupGroupPath(project,groupstring)string

GroupGroupPath returns the path for the group resource.

Deprecated: Use

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

instead.

func GroupProjectPath (deprecated)

funcGroupProjectPath(projectstring)string

GroupProjectPath returns the path for the project resource.

Deprecated: Use

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

instead.

func MetricMetricDescriptorPath (deprecated)

funcMetricMetricDescriptorPath(project,metricDescriptorstring)string

MetricMetricDescriptorPath returns the path for the metric descriptor resource.

Deprecated: Use

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

instead.

func MetricMonitoredResourceDescriptorPath (deprecated)

funcMetricMonitoredResourceDescriptorPath(project,monitoredResourceDescriptorstring)string

MetricMonitoredResourceDescriptorPath returns the path for the monitored resource descriptor resource.

Deprecated: Use

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

instead.

func MetricProjectPath (deprecated)

funcMetricProjectPath(projectstring)string

MetricProjectPath returns the path for the project resource.

Deprecated: Use

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

instead.

func UptimeCheckProjectPath (deprecated)

funcUptimeCheckProjectPath(projectstring)string

UptimeCheckProjectPath returns the path for the project resource.

Deprecated: Use

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

instead.

func UptimeCheckUptimeCheckConfigPath (deprecated)

funcUptimeCheckUptimeCheckConfigPath(project,uptimeCheckConfigstring)string

UptimeCheckUptimeCheckConfigPath returns the path for the uptime check config resource.

Deprecated: Use

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

instead.

AlertPolicyCallOptions (deprecated)

typeAlertPolicyCallOptionsstruct{ListAlertPolicies[]gax.CallOptionGetAlertPolicy[]gax.CallOptionCreateAlertPolicy[]gax.CallOptionDeleteAlertPolicy[]gax.CallOptionUpdateAlertPolicy[]gax.CallOption}

AlertPolicyCallOptions contains the retry settings for each method of AlertPolicyClient.

AlertPolicyClient (deprecated)

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

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

func NewAlertPolicyClient (deprecated)

funcNewAlertPolicyClient(ctxcontext.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 isa description of the conditions under which some aspect of yoursystem is considered to be “unhealthy” and the ways to notifypeople or services about this state. In addition to using this API, alertpolicies can also be managed throughStackdriver Monitoring (athttps://cloud.google.com/monitoring/docs/),which can be reached by clicking the “Monitoring” tab inCloud Console (athttps://console.cloud.google.com/).

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3")funcmain(){ctx:=context.Background()c,err:=monitoring.NewAlertPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use client._=c}

func (*AlertPolicyClient) Close (deprecated)

func(c*AlertPolicyClient)Close()error

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

func (*AlertPolicyClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated.

func (*AlertPolicyClient) CreateAlertPolicy (deprecated)

CreateAlertPolicy creates a new alerting policy.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewAlertPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.CreateAlertPolicyRequest{// TODO: Fill request struct fields.}resp,err:=c.CreateAlertPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*AlertPolicyClient) DeleteAlertPolicy (deprecated)

DeleteAlertPolicy deletes an alerting policy.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){ctx:=context.Background()c,err:=monitoring.NewAlertPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.DeleteAlertPolicyRequest{// TODO: Fill request struct fields.}err=c.DeleteAlertPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}}

func (*AlertPolicyClient) GetAlertPolicy (deprecated)

GetAlertPolicy gets a single alerting policy.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewAlertPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.GetAlertPolicyRequest{// TODO: Fill request struct fields.}resp,err:=c.GetAlertPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*AlertPolicyClient) ListAlertPolicies (deprecated)

ListAlertPolicies lists the existing alerting policies for the project.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb""google.golang.org/api/iterator")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"// import "google.golang.org/api/iterator"ctx:=context.Background()c,err:=monitoring.NewAlertPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.ListAlertPoliciesRequest{// TODO: Fill request struct fields.}it:=c.ListAlertPolicies(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}}

func (*AlertPolicyClient) UpdateAlertPolicy (deprecated)

UpdateAlertPolicy updates an alerting policy. You can either replace the entire policy witha new one or replace only certain fields in the current alerting policy byspecifying the fields to be updated via updateMask. Returns theupdated alerting policy.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewAlertPolicyClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.UpdateAlertPolicyRequest{// TODO: Fill request struct fields.}resp,err:=c.UpdateAlertPolicy(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

AlertPolicyIterator (deprecated)

typeAlertPolicyIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*monitoringpb.AlertPolicy,nextPageTokenstring,errerror)// contains filtered or unexported fields}

AlertPolicyIterator manages a stream of *monitoringpb.AlertPolicy.

func (*AlertPolicyIterator) Next (deprecated)

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*AlertPolicyIterator) PageInfo (deprecated)

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

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

GroupCallOptions (deprecated)

typeGroupCallOptionsstruct{ListGroups[]gax.CallOptionGetGroup[]gax.CallOptionCreateGroup[]gax.CallOptionUpdateGroup[]gax.CallOptionDeleteGroup[]gax.CallOptionListGroupMembers[]gax.CallOption}

GroupCallOptions contains the retry settings for each method of GroupClient.

GroupClient (deprecated)

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

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

func NewGroupClient (deprecated)

funcNewGroupClient(ctxcontext.Context,opts...option.ClientOption)(*GroupClient,error)

NewGroupClient creates a new group service client.

The Group API lets you inspect and manage yourgroups (at #google.monitoring.v3.Group).

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3")funcmain(){ctx:=context.Background()c,err:=monitoring.NewGroupClient(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use client._=c}

func (*GroupClient) Close (deprecated)

func(c*GroupClient)Close()error

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

func (*GroupClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated.

func (*GroupClient) CreateGroup (deprecated)

CreateGroup creates a new group.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewGroupClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.CreateGroupRequest{// TODO: Fill request struct fields.}resp,err:=c.CreateGroup(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*GroupClient) DeleteGroup (deprecated)

DeleteGroup deletes an existing group.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){ctx:=context.Background()c,err:=monitoring.NewGroupClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.DeleteGroupRequest{// TODO: Fill request struct fields.}err=c.DeleteGroup(ctx,req)iferr!=nil{// TODO: Handle error.}}

func (*GroupClient) GetGroup (deprecated)

GetGroup gets a single group.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewGroupClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.GetGroupRequest{// TODO: Fill request struct fields.}resp,err:=c.GetGroup(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*GroupClient) ListGroupMembers (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb""google.golang.org/api/iterator")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"// import "google.golang.org/api/iterator"ctx:=context.Background()c,err:=monitoring.NewGroupClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.ListGroupMembersRequest{// TODO: Fill request struct fields.}it:=c.ListGroupMembers(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}}

func (*GroupClient) ListGroups (deprecated)

ListGroups lists the existing groups.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb""google.golang.org/api/iterator")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"// import "google.golang.org/api/iterator"ctx:=context.Background()c,err:=monitoring.NewGroupClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.ListGroupsRequest{// TODO: Fill request struct fields.}it:=c.ListGroups(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}}

func (*GroupClient) UpdateGroup (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewGroupClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.UpdateGroupRequest{// TODO: Fill request struct fields.}resp,err:=c.UpdateGroup(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

GroupIterator (deprecated)

typeGroupIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*monitoringpb.Group,nextPageTokenstring,errerror)// contains filtered or unexported fields}

GroupIterator manages a stream of *monitoringpb.Group.

func (*GroupIterator) Next (deprecated)

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*GroupIterator) PageInfo (deprecated)

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

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

MetricCallOptions (deprecated)

typeMetricCallOptionsstruct{ListMonitoredResourceDescriptors[]gax.CallOptionGetMonitoredResourceDescriptor[]gax.CallOptionListMetricDescriptors[]gax.CallOptionGetMetricDescriptor[]gax.CallOptionCreateMetricDescriptor[]gax.CallOptionDeleteMetricDescriptor[]gax.CallOptionListTimeSeries[]gax.CallOptionCreateTimeSeries[]gax.CallOption}

MetricCallOptions contains the retry settings for each method of MetricClient.

MetricClient (deprecated)

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

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

func NewMetricClient (deprecated)

funcNewMetricClient(ctxcontext.Context,opts...option.ClientOption)(*MetricClient,error)

NewMetricClient creates a new metric service client.

Manages metric descriptors, monitored resource descriptors, andtime series data.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3")funcmain(){ctx:=context.Background()c,err:=monitoring.NewMetricClient(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use client._=c}

func (*MetricClient) Close (deprecated)

func(c*MetricClient)Close()error

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

func (*MetricClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated.

func (*MetricClient) CreateMetricDescriptor (deprecated)

CreateMetricDescriptor creates a new metric descriptor.User-created metric descriptors definecustom metrics (athttps://cloud.google.com/monitoring/custom-metrics).

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewMetricClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.CreateMetricDescriptorRequest{// TODO: Fill request struct fields.}resp,err:=c.CreateMetricDescriptor(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*MetricClient) CreateTimeSeries (deprecated)

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 isincluded in the error response.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){ctx:=context.Background()c,err:=monitoring.NewMetricClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.CreateTimeSeriesRequest{// TODO: Fill request struct fields.}err=c.CreateTimeSeries(ctx,req)iferr!=nil{// TODO: Handle error.}}

func (*MetricClient) DeleteMetricDescriptor (deprecated)

DeleteMetricDescriptor deletes a metric descriptor. Only user-createdcustom metrics (athttps://cloud.google.com/monitoring/custom-metrics) can bedeleted.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){ctx:=context.Background()c,err:=monitoring.NewMetricClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.DeleteMetricDescriptorRequest{// TODO: Fill request struct fields.}err=c.DeleteMetricDescriptor(ctx,req)iferr!=nil{// TODO: Handle error.}}

func (*MetricClient) GetMetricDescriptor (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewMetricClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.GetMetricDescriptorRequest{// TODO: Fill request struct fields.}resp,err:=c.GetMetricDescriptor(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*MetricClient) GetMonitoredResourceDescriptor (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewMetricClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.GetMonitoredResourceDescriptorRequest{// TODO: Fill request struct fields.}resp,err:=c.GetMonitoredResourceDescriptor(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*MetricClient) ListMetricDescriptors (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb""google.golang.org/api/iterator")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"// import "google.golang.org/api/iterator"ctx:=context.Background()c,err:=monitoring.NewMetricClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.ListMetricDescriptorsRequest{// TODO: Fill request struct fields.}it:=c.ListMetricDescriptors(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}}

func (*MetricClient) ListMonitoredResourceDescriptors (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb""google.golang.org/api/iterator")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"// import "google.golang.org/api/iterator"ctx:=context.Background()c,err:=monitoring.NewMetricClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.ListMonitoredResourceDescriptorsRequest{// TODO: Fill request struct fields.}it:=c.ListMonitoredResourceDescriptors(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}}

func (*MetricClient) ListTimeSeries (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb""google.golang.org/api/iterator")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"// import "google.golang.org/api/iterator"ctx:=context.Background()c,err:=monitoring.NewMetricClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.ListTimeSeriesRequest{// TODO: Fill request struct fields.}it:=c.ListTimeSeries(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}}

MetricDescriptorIterator (deprecated)

typeMetricDescriptorIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*metricpb.MetricDescriptor,nextPageTokenstring,errerror)// contains filtered or unexported fields}

MetricDescriptorIterator manages a stream of *metricpb.MetricDescriptor.

func (*MetricDescriptorIterator) Next (deprecated)

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*MetricDescriptorIterator) PageInfo (deprecated)

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

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

MonitoredResourceDescriptorIterator (deprecated)

typeMonitoredResourceDescriptorIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*monitoredrespb.MonitoredResourceDescriptor,nextPageTokenstring,errerror)// contains filtered or unexported fields}

MonitoredResourceDescriptorIterator manages a stream of *monitoredrespb.MonitoredResourceDescriptor.

func (*MonitoredResourceDescriptorIterator) Next (deprecated)

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*MonitoredResourceDescriptorIterator) PageInfo (deprecated)

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

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

MonitoredResourceIterator (deprecated)

typeMonitoredResourceIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*monitoredrespb.MonitoredResource,nextPageTokenstring,errerror)// contains filtered or unexported fields}

MonitoredResourceIterator manages a stream of *monitoredrespb.MonitoredResource.

func (*MonitoredResourceIterator) Next (deprecated)

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*MonitoredResourceIterator) PageInfo (deprecated)

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

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

NotificationChannelCallOptions (deprecated)

typeNotificationChannelCallOptionsstruct{ListNotificationChannelDescriptors[]gax.CallOptionGetNotificationChannelDescriptor[]gax.CallOptionListNotificationChannels[]gax.CallOptionGetNotificationChannel[]gax.CallOptionCreateNotificationChannel[]gax.CallOptionUpdateNotificationChannel[]gax.CallOptionDeleteNotificationChannel[]gax.CallOptionSendNotificationChannelVerificationCode[]gax.CallOptionGetNotificationChannelVerificationCode[]gax.CallOptionVerifyNotificationChannel[]gax.CallOption}

NotificationChannelCallOptions contains the retry settings for each method of NotificationChannelClient.

NotificationChannelClient (deprecated)

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

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

func NewNotificationChannelClient (deprecated)

funcNewNotificationChannelClient(ctxcontext.Context,opts...option.ClientOption)(*NotificationChannelClient,error)

NewNotificationChannelClient creates a new notification channel service client.

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3")funcmain(){ctx:=context.Background()c,err:=monitoring.NewNotificationChannelClient(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use client._=c}

func (*NotificationChannelClient) Close (deprecated)

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

func (*NotificationChannelClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated.

func (*NotificationChannelClient) CreateNotificationChannel (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewNotificationChannelClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.CreateNotificationChannelRequest{// TODO: Fill request struct fields.}resp,err:=c.CreateNotificationChannel(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*NotificationChannelClient) DeleteNotificationChannel (deprecated)

DeleteNotificationChannel deletes a notification channel.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){ctx:=context.Background()c,err:=monitoring.NewNotificationChannelClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.DeleteNotificationChannelRequest{// TODO: Fill request struct fields.}err=c.DeleteNotificationChannel(ctx,req)iferr!=nil{// TODO: Handle error.}}

func (*NotificationChannelClient) GetNotificationChannel (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewNotificationChannelClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.GetNotificationChannelRequest{// TODO: Fill request struct fields.}resp,err:=c.GetNotificationChannel(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*NotificationChannelClient) GetNotificationChannelDescriptor (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewNotificationChannelClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.GetNotificationChannelDescriptorRequest{// TODO: Fill request struct fields.}resp,err:=c.GetNotificationChannelDescriptor(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*NotificationChannelClient) GetNotificationChannelVerificationCode (deprecated)

GetNotificationChannelVerificationCode requests a verification code for an already verified channel that can thenbe used in a call to VerifyNotificationChannel() on a different channelwith an equivalent identity in the same or in a different project. Thismakes it possible to copy a channel between projects without requiringmanual reverification of the channel. If the channel is not in theverified state, this method will fail (in other words, this may only beused if the SendNotificationChannelVerificationCode andVerifyNotificationChannel paths have already been used to put the givenchannel into the verified state).

There is no guarantee that the verification codes returned by this methodwill be of a similar structure or form as the ones that are deliveredto the channel via SendNotificationChannelVerificationCode; whileVerifyNotificationChannel() will recognize both the codes delivered viaSendNotificationChannelVerificationCode() and returned fromGetNotificationChannelVerificationCode(), it is typically the case thatthe verification codes delivered viaSendNotificationChannelVerificationCode() will be shorter and alsohave a shorter expiration (e.g. codes such as “G-123456”) whereasGetVerificationCode() will typically return a much longer, websafe base64 encoded string that has a longer expiration time.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewNotificationChannelClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.GetNotificationChannelVerificationCodeRequest{// TODO: Fill request struct fields.}resp,err:=c.GetNotificationChannelVerificationCode(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*NotificationChannelClient) ListNotificationChannelDescriptors (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb""google.golang.org/api/iterator")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"// import "google.golang.org/api/iterator"ctx:=context.Background()c,err:=monitoring.NewNotificationChannelClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.ListNotificationChannelDescriptorsRequest{// TODO: Fill request struct fields.}it:=c.ListNotificationChannelDescriptors(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}}

func (*NotificationChannelClient) ListNotificationChannels (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb""google.golang.org/api/iterator")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"// import "google.golang.org/api/iterator"ctx:=context.Background()c,err:=monitoring.NewNotificationChannelClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.ListNotificationChannelsRequest{// TODO: Fill request struct fields.}it:=c.ListNotificationChannels(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}}

func (*NotificationChannelClient) SendNotificationChannelVerificationCode (deprecated)

SendNotificationChannelVerificationCode causes a verification code to be delivered to the channel. The codecan then be supplied in VerifyNotificationChannel to verify the channel.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){ctx:=context.Background()c,err:=monitoring.NewNotificationChannelClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.SendNotificationChannelVerificationCodeRequest{// TODO: Fill request struct fields.}err=c.SendNotificationChannelVerificationCode(ctx,req)iferr!=nil{// TODO: Handle error.}}

func (*NotificationChannelClient) UpdateNotificationChannel (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewNotificationChannelClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.UpdateNotificationChannelRequest{// TODO: Fill request struct fields.}resp,err:=c.UpdateNotificationChannel(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*NotificationChannelClient) VerifyNotificationChannel (deprecated)

VerifyNotificationChannel verifies a NotificationChannel by proving receipt of the codedelivered to the channel as a result of callingSendNotificationChannelVerificationCode.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewNotificationChannelClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.VerifyNotificationChannelRequest{// TODO: Fill request struct fields.}resp,err:=c.VerifyNotificationChannel(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

NotificationChannelDescriptorIterator (deprecated)

typeNotificationChannelDescriptorIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*monitoringpb.NotificationChannelDescriptor,nextPageTokenstring,errerror)// contains filtered or unexported fields}

NotificationChannelDescriptorIterator manages a stream of *monitoringpb.NotificationChannelDescriptor.

func (*NotificationChannelDescriptorIterator) Next (deprecated)

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*NotificationChannelDescriptorIterator) PageInfo (deprecated)

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

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

NotificationChannelIterator (deprecated)

typeNotificationChannelIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*monitoringpb.NotificationChannel,nextPageTokenstring,errerror)// contains filtered or unexported fields}

NotificationChannelIterator manages a stream of *monitoringpb.NotificationChannel.

func (*NotificationChannelIterator) Next (deprecated)

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*NotificationChannelIterator) PageInfo (deprecated)

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

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

ServiceIterator (deprecated)

typeServiceIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*monitoringpb.Service,nextPageTokenstring,errerror)// contains filtered or unexported fields}

ServiceIterator manages a stream of *monitoringpb.Service.

func (*ServiceIterator) Next (deprecated)

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*ServiceIterator) PageInfo (deprecated)

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

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

ServiceLevelObjectiveIterator (deprecated)

typeServiceLevelObjectiveIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*monitoringpb.ServiceLevelObjective,nextPageTokenstring,errerror)// contains filtered or unexported fields}

ServiceLevelObjectiveIterator manages a stream of *monitoringpb.ServiceLevelObjective.

func (*ServiceLevelObjectiveIterator) Next (deprecated)

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*ServiceLevelObjectiveIterator) PageInfo (deprecated)

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

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

ServiceMonitoringCallOptions (deprecated)

typeServiceMonitoringCallOptionsstruct{CreateService[]gax.CallOptionGetService[]gax.CallOptionListServices[]gax.CallOptionUpdateService[]gax.CallOptionDeleteService[]gax.CallOptionCreateServiceLevelObjective[]gax.CallOptionGetServiceLevelObjective[]gax.CallOptionListServiceLevelObjectives[]gax.CallOptionUpdateServiceLevelObjective[]gax.CallOptionDeleteServiceLevelObjective[]gax.CallOption}

ServiceMonitoringCallOptions contains the retry settings for each method of ServiceMonitoringClient.

ServiceMonitoringClient (deprecated)

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

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

func NewServiceMonitoringClient (deprecated)

funcNewServiceMonitoringClient(ctxcontext.Context,opts...option.ClientOption)(*ServiceMonitoringClient,error)

NewServiceMonitoringClient creates a new service monitoring service client.

The Cloud Monitoring Service-Oriented Monitoring API has endpoints formanaging and querying aspects of a workspace’s services. These include theService's monitored resources, its Service-Level Objectives, and a taxonomyof categorized Health Metrics.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3")funcmain(){ctx:=context.Background()c,err:=monitoring.NewServiceMonitoringClient(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use client._=c}

func (*ServiceMonitoringClient) Close (deprecated)

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

func (*ServiceMonitoringClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated.

func (*ServiceMonitoringClient) CreateService (deprecated)

CreateService create a Service.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewServiceMonitoringClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.CreateServiceRequest{// TODO: Fill request struct fields.}resp,err:=c.CreateService(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*ServiceMonitoringClient) CreateServiceLevelObjective (deprecated)

CreateServiceLevelObjective create a ServiceLevelObjective for the given Service.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewServiceMonitoringClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.CreateServiceLevelObjectiveRequest{// TODO: Fill request struct fields.}resp,err:=c.CreateServiceLevelObjective(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*ServiceMonitoringClient) DeleteService (deprecated)

DeleteService soft delete this Service.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){ctx:=context.Background()c,err:=monitoring.NewServiceMonitoringClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.DeleteServiceRequest{// TODO: Fill request struct fields.}err=c.DeleteService(ctx,req)iferr!=nil{// TODO: Handle error.}}

func (*ServiceMonitoringClient) DeleteServiceLevelObjective (deprecated)

DeleteServiceLevelObjective delete the given ServiceLevelObjective.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){ctx:=context.Background()c,err:=monitoring.NewServiceMonitoringClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.DeleteServiceLevelObjectiveRequest{// TODO: Fill request struct fields.}err=c.DeleteServiceLevelObjective(ctx,req)iferr!=nil{// TODO: Handle error.}}

func (*ServiceMonitoringClient) GetService (deprecated)

GetService get the named Service.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewServiceMonitoringClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.GetServiceRequest{// TODO: Fill request struct fields.}resp,err:=c.GetService(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*ServiceMonitoringClient) GetServiceLevelObjective (deprecated)

GetServiceLevelObjective get a ServiceLevelObjective by name.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewServiceMonitoringClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.GetServiceLevelObjectiveRequest{// TODO: Fill request struct fields.}resp,err:=c.GetServiceLevelObjective(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*ServiceMonitoringClient) ListServiceLevelObjectives (deprecated)

ListServiceLevelObjectives list the ServiceLevelObjectives for the given Service.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb""google.golang.org/api/iterator")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"// import "google.golang.org/api/iterator"ctx:=context.Background()c,err:=monitoring.NewServiceMonitoringClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.ListServiceLevelObjectivesRequest{// TODO: Fill request struct fields.}it:=c.ListServiceLevelObjectives(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}}

func (*ServiceMonitoringClient) ListServices (deprecated)

ListServices list Services for this workspace.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb""google.golang.org/api/iterator")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"// import "google.golang.org/api/iterator"ctx:=context.Background()c,err:=monitoring.NewServiceMonitoringClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.ListServicesRequest{// TODO: Fill request struct fields.}it:=c.ListServices(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}}

func (*ServiceMonitoringClient) UpdateService (deprecated)

UpdateService update this Service.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewServiceMonitoringClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.UpdateServiceRequest{// TODO: Fill request struct fields.}resp,err:=c.UpdateService(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*ServiceMonitoringClient) UpdateServiceLevelObjective (deprecated)

UpdateServiceLevelObjective update the given ServiceLevelObjective.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewServiceMonitoringClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.UpdateServiceLevelObjectiveRequest{// TODO: Fill request struct fields.}resp,err:=c.UpdateServiceLevelObjective(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

TimeSeriesIterator (deprecated)

typeTimeSeriesIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*monitoringpb.TimeSeries,nextPageTokenstring,errerror)// contains filtered or unexported fields}

TimeSeriesIterator manages a stream of *monitoringpb.TimeSeries.

func (*TimeSeriesIterator) Next (deprecated)

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*TimeSeriesIterator) PageInfo (deprecated)

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

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

UptimeCheckCallOptions (deprecated)

typeUptimeCheckCallOptionsstruct{ListUptimeCheckConfigs[]gax.CallOptionGetUptimeCheckConfig[]gax.CallOptionCreateUptimeCheckConfig[]gax.CallOptionUpdateUptimeCheckConfig[]gax.CallOptionDeleteUptimeCheckConfig[]gax.CallOptionListUptimeCheckIps[]gax.CallOption}

UptimeCheckCallOptions contains the retry settings for each method of UptimeCheckClient.

UptimeCheckClient (deprecated)

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

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

func NewUptimeCheckClient (deprecated)

funcNewUptimeCheckClient(ctxcontext.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 Uptimecheck is a piece of configuration that determines which resources andservices to monitor for availability. These configurations can also beconfigured interactively by navigating to the [Cloud Console](http://console.cloud.google.com (athttp://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

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3")funcmain(){ctx:=context.Background()c,err:=monitoring.NewUptimeCheckClient(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use client._=c}

func (*UptimeCheckClient) Close (deprecated)

func(c*UptimeCheckClient)Close()error

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

func (*UptimeCheckClient) Connection (deprecated)

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

Connection returns a connection to the API service.

Deprecated.

func (*UptimeCheckClient) CreateUptimeCheckConfig (deprecated)

CreateUptimeCheckConfig creates a new Uptime check configuration.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewUptimeCheckClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.CreateUptimeCheckConfigRequest{// TODO: Fill request struct fields.}resp,err:=c.CreateUptimeCheckConfig(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*UptimeCheckClient) DeleteUptimeCheckConfig (deprecated)

DeleteUptimeCheckConfig deletes an Uptime check configuration. Note that this method will failif the Uptime check configuration is referenced by an alert policy orother dependent configs that would be rendered invalid by the deletion.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){ctx:=context.Background()c,err:=monitoring.NewUptimeCheckClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.DeleteUptimeCheckConfigRequest{// TODO: Fill request struct fields.}err=c.DeleteUptimeCheckConfig(ctx,req)iferr!=nil{// TODO: Handle error.}}

func (*UptimeCheckClient) GetUptimeCheckConfig (deprecated)

GetUptimeCheckConfig gets a single Uptime check configuration.

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewUptimeCheckClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.GetUptimeCheckConfigRequest{// TODO: Fill request struct fields.}resp,err:=c.GetUptimeCheckConfig(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

func (*UptimeCheckClient) ListUptimeCheckConfigs (deprecated)

ListUptimeCheckConfigs lists the existing valid Uptime check configurations for the project(leaving out any invalid configurations).

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb""google.golang.org/api/iterator")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"// import "google.golang.org/api/iterator"ctx:=context.Background()c,err:=monitoring.NewUptimeCheckClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.ListUptimeCheckConfigsRequest{// TODO: Fill request struct fields.}it:=c.ListUptimeCheckConfigs(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}}

func (*UptimeCheckClient) ListUptimeCheckIps (deprecated)

ListUptimeCheckIps returns the list of IP addresses that checkers run from

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb""google.golang.org/api/iterator")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"// import "google.golang.org/api/iterator"ctx:=context.Background()c,err:=monitoring.NewUptimeCheckClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.ListUptimeCheckIpsRequest{// TODO: Fill request struct fields.}it:=c.ListUptimeCheckIps(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}}

func (*UptimeCheckClient) UpdateUptimeCheckConfig (deprecated)

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

Example

packagemainimport("context"monitoring"cloud.google.com/go/monitoring/apiv3""cloud.google.com/go/monitoring/apiv3/v2/monitoringpb")funcmain(){// import monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"ctx:=context.Background()c,err:=monitoring.NewUptimeCheckClient(ctx)iferr!=nil{// TODO: Handle error.}req:=&monitoringpb.UpdateUptimeCheckConfigRequest{// TODO: Fill request struct fields.}resp,err:=c.UpdateUptimeCheckConfig(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}

UptimeCheckConfigIterator (deprecated)

typeUptimeCheckConfigIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*monitoringpb.UptimeCheckConfig,nextPageTokenstring,errerror)// contains filtered or unexported fields}

UptimeCheckConfigIterator manages a stream of *monitoringpb.UptimeCheckConfig.

func (*UptimeCheckConfigIterator) Next (deprecated)

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*UptimeCheckConfigIterator) PageInfo (deprecated)

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

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

UptimeCheckIpIterator (deprecated)

typeUptimeCheckIpIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*monitoringpb.UptimeCheckIp,nextPageTokenstring,errerror)// contains filtered or unexported fields}

UptimeCheckIpIterator manages a stream of *monitoringpb.UptimeCheckIp.

func (*UptimeCheckIpIterator) Next (deprecated)

Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*UptimeCheckIpIterator) PageInfo (deprecated)

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

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

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-10-30 UTC.