gocloud.google.com/go/irm/apiv1alpha2 Index | Examples | Files

package irm

import "cloud.google.com/go/irm/apiv1alpha2"

Package irm is an auto-generated package for the Stackdriver Incident Response & Management API.

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

Index

Examples

Functions

func DefaultAuthScopes

func DefaultAuthScopes() []string

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

Types

type AnnotationIterator

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

AnnotationIterator manages a stream of *irmpb.Annotation.

func (*AnnotationIterator) Next

func (it *AnnotationIterator) Next() (*irmpb.Annotation, 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 (*AnnotationIterator) PageInfo

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

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

type ArtifactIterator

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

ArtifactIterator manages a stream of *irmpb.Artifact.

func (*ArtifactIterator) Next

func (it *ArtifactIterator) Next() (*irmpb.Artifact, 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 (*ArtifactIterator) PageInfo

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

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

type IncidentCallOptions

type IncidentCallOptions struct {
	CreateIncident               []gax.CallOption
	GetIncident                  []gax.CallOption
	SearchIncidents              []gax.CallOption
	UpdateIncident               []gax.CallOption
	SearchSimilarIncidents       []gax.CallOption
	CreateAnnotation             []gax.CallOption
	ListAnnotations              []gax.CallOption
	CreateTag                    []gax.CallOption
	DeleteTag                    []gax.CallOption
	ListTags                     []gax.CallOption
	CreateSignal                 []gax.CallOption
	SearchSignals                []gax.CallOption
	GetSignal                    []gax.CallOption
	UpdateSignal                 []gax.CallOption
	EscalateIncident             []gax.CallOption
	CreateArtifact               []gax.CallOption
	ListArtifacts                []gax.CallOption
	UpdateArtifact               []gax.CallOption
	DeleteArtifact               []gax.CallOption
	SendShiftHandoff             []gax.CallOption
	CreateSubscription           []gax.CallOption
	UpdateSubscription           []gax.CallOption
	ListSubscriptions            []gax.CallOption
	DeleteSubscription           []gax.CallOption
	CreateIncidentRoleAssignment []gax.CallOption
	DeleteIncidentRoleAssignment []gax.CallOption
	ListIncidentRoleAssignments  []gax.CallOption
	RequestIncidentRoleHandover  []gax.CallOption
	ConfirmIncidentRoleHandover  []gax.CallOption
	ForceIncidentRoleHandover    []gax.CallOption
	CancelIncidentRoleHandover   []gax.CallOption
}

IncidentCallOptions contains the retry settings for each method of IncidentClient.

type IncidentClient

type IncidentClient struct {

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

IncidentClient is a client for interacting with Stackdriver Incident Response & Management API.

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

func NewIncidentClient

func NewIncidentClient(ctx context.Context, opts ...option.ClientOption) (*IncidentClient, error)

NewIncidentClient creates a new incident service client.

The Incident API for Incident Response & Management.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}
	// TODO: Use client.
	_ = c
}

func (*IncidentClient) CancelIncidentRoleHandover

CancelIncidentRoleHandover cancels a role handover. This will fail if the 'proposed_assignee' field of the IncidentRoleAssignment is not equal to the 'new_assignee' field of the request.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) Close

func (c *IncidentClient) Close() error

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

func (*IncidentClient) ConfirmIncidentRoleHandover

ConfirmIncidentRoleHandover confirms a role handover. This will fail if the 'proposed_assignee' field of the IncidentRoleAssignment is not equal to the 'new_assignee' field of the request. If the caller is not the new_assignee, ForceIncidentRoleHandover should be used instead.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) Connection

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

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

func (*IncidentClient) CreateAnnotation

func (c *IncidentClient) CreateAnnotation(ctx context.Context, req *irmpb.CreateAnnotationRequest, opts ...gax.CallOption) (*irmpb.Annotation, error)

CreateAnnotation creates an annotation on an existing incident. Only 'text/plain' and 'text/markdown' annotations can be created via this method.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) CreateArtifact

func (c *IncidentClient) CreateArtifact(ctx context.Context, req *irmpb.CreateArtifactRequest, opts ...gax.CallOption) (*irmpb.Artifact, error)

CreateArtifact creates a new artifact.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) CreateIncident

func (c *IncidentClient) CreateIncident(ctx context.Context, req *irmpb.CreateIncidentRequest, opts ...gax.CallOption) (*irmpb.Incident, error)

CreateIncident creates a new incident.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) CreateIncidentRoleAssignment

CreateIncidentRoleAssignment creates a role assignment on an existing incident. Normally, the user field will be set when assigning a role to oneself, and the next field will be set when proposing another user as the assignee. Setting the next field directly to a user other than oneself is equivalent to proposing and force-assigning the role to the user.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) CreateSignal

func (c *IncidentClient) CreateSignal(ctx context.Context, req *irmpb.CreateSignalRequest, opts ...gax.CallOption) (*irmpb.Signal, error)

CreateSignal creates a new signal.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) CreateSubscription

func (c *IncidentClient) CreateSubscription(ctx context.Context, req *irmpb.CreateSubscriptionRequest, opts ...gax.CallOption) (*irmpb.Subscription, error)

CreateSubscription creates a new subscription. This will fail if: a. there are too many (50) subscriptions in the incident already b. a subscription using the given channel already exists

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) CreateTag

func (c *IncidentClient) CreateTag(ctx context.Context, req *irmpb.CreateTagRequest, opts ...gax.CallOption) (*irmpb.Tag, error)

CreateTag creates a tag on an existing incident.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) DeleteArtifact

func (c *IncidentClient) DeleteArtifact(ctx context.Context, req *irmpb.DeleteArtifactRequest, opts ...gax.CallOption) error

DeleteArtifact deletes an existing artifact.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) DeleteIncidentRoleAssignment

func (c *IncidentClient) DeleteIncidentRoleAssignment(ctx context.Context, req *irmpb.DeleteIncidentRoleAssignmentRequest, opts ...gax.CallOption) error

DeleteIncidentRoleAssignment deletes an existing role assignment.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) DeleteSubscription

func (c *IncidentClient) DeleteSubscription(ctx context.Context, req *irmpb.DeleteSubscriptionRequest, opts ...gax.CallOption) error

DeleteSubscription deletes an existing subscription.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) DeleteTag

func (c *IncidentClient) DeleteTag(ctx context.Context, req *irmpb.DeleteTagRequest, opts ...gax.CallOption) error

DeleteTag deletes an existing tag.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) EscalateIncident

EscalateIncident escalates an incident.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) ForceIncidentRoleHandover

ForceIncidentRoleHandover forces a role handover. This will fail if the 'proposed_assignee' field of the IncidentRoleAssignment is not equal to the 'new_assignee' field of the request. If the caller is the new_assignee, ConfirmIncidentRoleHandover should be used instead.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) GetIncident

func (c *IncidentClient) GetIncident(ctx context.Context, req *irmpb.GetIncidentRequest, opts ...gax.CallOption) (*irmpb.Incident, error)

GetIncident returns an incident by name.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) GetSignal

func (c *IncidentClient) GetSignal(ctx context.Context, req *irmpb.GetSignalRequest, opts ...gax.CallOption) (*irmpb.Signal, error)

GetSignal returns a signal by name.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) ListAnnotations

ListAnnotations lists annotations that are part of an incident. No assumptions should be made on the content-type of the annotation returned.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"
	"google.golang.org/api/iterator"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) ListArtifacts

ListArtifacts returns a list of artifacts for an incident.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"
	"google.golang.org/api/iterator"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) ListIncidentRoleAssignments

ListIncidentRoleAssignments lists role assignments that are part of an incident.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"
	"google.golang.org/api/iterator"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) ListSubscriptions

ListSubscriptions returns a list of subscriptions for an incident.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"
	"google.golang.org/api/iterator"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) ListTags

func (c *IncidentClient) ListTags(ctx context.Context, req *irmpb.ListTagsRequest, opts ...gax.CallOption) *TagIterator

ListTags lists tags that are part of an incident.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"
	"google.golang.org/api/iterator"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) RequestIncidentRoleHandover

RequestIncidentRoleHandover starts a role handover. The proposed assignee will receive an email notifying them of the assignment. This will fail if a role handover is already pending.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) SearchIncidents

func (c *IncidentClient) SearchIncidents(ctx context.Context, req *irmpb.SearchIncidentsRequest, opts ...gax.CallOption) *IncidentIterator

SearchIncidents returns a list of incidents. Incidents are ordered by start time, with the most recent incidents first.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"
	"google.golang.org/api/iterator"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) SearchSignals

func (c *IncidentClient) SearchSignals(ctx context.Context, req *irmpb.SearchSignalsRequest, opts ...gax.CallOption) *SignalIterator

SearchSignals lists signals that are part of an incident. Signals are returned in reverse chronological order.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"
	"google.golang.org/api/iterator"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) SearchSimilarIncidents

SearchSimilarIncidents returns a list of incidents that are "similar" to the specified incident or signal. This functionality is provided on a best-effort basis and the definition of "similar" is subject to change.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"
	"google.golang.org/api/iterator"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) SendShiftHandoff

SendShiftHandoff sends a summary of the shift for oncall handoff.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) UpdateArtifact

func (c *IncidentClient) UpdateArtifact(ctx context.Context, req *irmpb.UpdateArtifactRequest, opts ...gax.CallOption) (*irmpb.Artifact, error)

UpdateArtifact updates an existing artifact.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) UpdateIncident

func (c *IncidentClient) UpdateIncident(ctx context.Context, req *irmpb.UpdateIncidentRequest, opts ...gax.CallOption) (*irmpb.Incident, error)

UpdateIncident updates an existing incident.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) UpdateSignal

func (c *IncidentClient) UpdateSignal(ctx context.Context, req *irmpb.UpdateSignalRequest, opts ...gax.CallOption) (*irmpb.Signal, error)

UpdateSignal updates an existing signal (for example, to assign/unassign it to an incident).

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

func (*IncidentClient) UpdateSubscription

func (c *IncidentClient) UpdateSubscription(ctx context.Context, req *irmpb.UpdateSubscriptionRequest, opts ...gax.CallOption) (*irmpb.Subscription, error)

UpdateSubscription updates a subscription.

Example

Code:play 

package main

import (
	"context"

	irm "cloud.google.com/go/irm/apiv1alpha2"

	irmpb "google.golang.org/genproto/googleapis/cloud/irm/v1alpha2"
)

func main() {
	ctx := context.Background()
	c, err := irm.NewIncidentClient(ctx)
	if err != nil {
		// TODO: Handle error.
	}

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

type IncidentIterator

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

IncidentIterator manages a stream of *irmpb.Incident.

func (*IncidentIterator) Next

func (it *IncidentIterator) Next() (*irmpb.Incident, 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 (*IncidentIterator) PageInfo

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

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

type IncidentRoleAssignmentIterator

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

IncidentRoleAssignmentIterator manages a stream of *irmpb.IncidentRoleAssignment.

func (*IncidentRoleAssignmentIterator) Next

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

func (*IncidentRoleAssignmentIterator) PageInfo

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

type SearchSimilarIncidentsResponse_ResultIterator

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

SearchSimilarIncidentsResponse_ResultIterator manages a stream of *irmpb.SearchSimilarIncidentsResponse_Result.

func (*SearchSimilarIncidentsResponse_ResultIterator) Next

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

func (*SearchSimilarIncidentsResponse_ResultIterator) PageInfo

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

type SignalIterator

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

SignalIterator manages a stream of *irmpb.Signal.

func (*SignalIterator) Next

func (it *SignalIterator) Next() (*irmpb.Signal, 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 (*SignalIterator) PageInfo

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

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

type SubscriptionIterator

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

SubscriptionIterator manages a stream of *irmpb.Subscription.

func (*SubscriptionIterator) Next

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

func (*SubscriptionIterator) PageInfo

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

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

type TagIterator

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

TagIterator manages a stream of *irmpb.Tag.

func (*TagIterator) Next

func (it *TagIterator) Next() (*irmpb.Tag, 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 (*TagIterator) PageInfo

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

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

Source Files

doc.go incident_client.go

Version
v0.37.0
Published
Mar 11, 2019
Platform
js/wasm
Imports
15 packages
Last checked
21 minutes ago

Tools for package owners.