Package chronicle is an auto-generated package for the Chronicle API.
The Google Cloud Security Operations API, popularly known as the Chronicle API, serves endpoints that enable security analysts to analyze and mitigate a security threat throughout its lifecycle
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/chronicle/apiv1@latest ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := chronicle.NewDataAccessControlClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req := &chroniclepb.CreateDataAccessLabelRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#CreateDataAccessLabelRequest. } resp, err := c.CreateDataAccessLabel(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewDataAccessControlClient is used for authentication requests and for 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.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
CreateRetrohuntOperation
type CreateRetrohuntOperation struct {
// contains filtered or unexported fields
}
CreateRetrohuntOperation manages a long-running operation from CreateRetrohunt.
func (*CreateRetrohuntOperation) Done
func (op *CreateRetrohuntOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateRetrohuntOperation) Metadata
func (op *CreateRetrohuntOperation) Metadata() (*chroniclepb.RetrohuntMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateRetrohuntOperation) Name
func (op *CreateRetrohuntOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateRetrohuntOperation) Poll
func (op *CreateRetrohuntOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*chroniclepb.Retrohunt, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateRetrohuntOperation) Wait
func (op *CreateRetrohuntOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*chroniclepb.Retrohunt, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DataAccessControlCallOptions
type DataAccessControlCallOptions struct {
CreateDataAccessLabel []gax.CallOption
GetDataAccessLabel []gax.CallOption
ListDataAccessLabels []gax.CallOption
UpdateDataAccessLabel []gax.CallOption
DeleteDataAccessLabel []gax.CallOption
CreateDataAccessScope []gax.CallOption
GetDataAccessScope []gax.CallOption
ListDataAccessScopes []gax.CallOption
UpdateDataAccessScope []gax.CallOption
DeleteDataAccessScope []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
DataAccessControlCallOptions contains the retry settings for each method of DataAccessControlClient.
DataAccessControlClient
type DataAccessControlClient struct {
// The call options for this service.
CallOptions *DataAccessControlCallOptions
// contains filtered or unexported fields
}
DataAccessControlClient is a client for interacting with Chronicle API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
DataAccessControlService exposes resources and endpoints related to data access control.
func NewDataAccessControlClient
func NewDataAccessControlClient(ctx context.Context, opts ...option.ClientOption) (*DataAccessControlClient, error)
NewDataAccessControlClient creates a new data access control service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
DataAccessControlService exposes resources and endpoints related to data access control.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewDataAccessControlRESTClient
func NewDataAccessControlRESTClient(ctx context.Context, opts ...option.ClientOption) (*DataAccessControlClient, error)
NewDataAccessControlRESTClient creates a new data access control service rest client.
DataAccessControlService exposes resources and endpoints related to data access control.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*DataAccessControlClient) CancelOperation
func (c *DataAccessControlClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*DataAccessControlClient) Close
func (c *DataAccessControlClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*DataAccessControlClient) Connection (deprecated)
func (c *DataAccessControlClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*DataAccessControlClient) CreateDataAccessLabel
func (c *DataAccessControlClient) CreateDataAccessLabel(ctx context.Context, req *chroniclepb.CreateDataAccessLabelRequest, opts ...gax.CallOption) (*chroniclepb.DataAccessLabel, error)
CreateDataAccessLabel creates a data access label. Data access labels are applied to incoming event data and selected in data access scopes (another resource), and only users with scopes containing the label can see data with that label. Currently, the data access label resource only includes custom labels, which are labels that correspond to UDM queries over event data.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.CreateDataAccessLabelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#CreateDataAccessLabelRequest.
}
resp, err := c.CreateDataAccessLabel(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataAccessControlClient) CreateDataAccessScope
func (c *DataAccessControlClient) CreateDataAccessScope(ctx context.Context, req *chroniclepb.CreateDataAccessScopeRequest, opts ...gax.CallOption) (*chroniclepb.DataAccessScope, error)
CreateDataAccessScope creates a data access scope. Data access scope is a combination of allowed and denied labels attached to a permission group. If a scope has allowed labels A and B and denied labels C and D, then the group of people attached to the scope will have permissions to see all events labeled with A or B (or both) and not labeled with either C or D.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.CreateDataAccessScopeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#CreateDataAccessScopeRequest.
}
resp, err := c.CreateDataAccessScope(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataAccessControlClient) DeleteDataAccessLabel
func (c *DataAccessControlClient) DeleteDataAccessLabel(ctx context.Context, req *chroniclepb.DeleteDataAccessLabelRequest, opts ...gax.CallOption) error
DeleteDataAccessLabel deletes a data access label. When a label is deleted, new data that enters in the system will not receive the label, but the label will not be removed from old data that still refers to it.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.DeleteDataAccessLabelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#DeleteDataAccessLabelRequest.
}
err = c.DeleteDataAccessLabel(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*DataAccessControlClient) DeleteDataAccessScope
func (c *DataAccessControlClient) DeleteDataAccessScope(ctx context.Context, req *chroniclepb.DeleteDataAccessScopeRequest, opts ...gax.CallOption) error
DeleteDataAccessScope deletes a data access scope.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.DeleteDataAccessScopeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#DeleteDataAccessScopeRequest.
}
err = c.DeleteDataAccessScope(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*DataAccessControlClient) DeleteOperation
func (c *DataAccessControlClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*DataAccessControlClient) GetDataAccessLabel
func (c *DataAccessControlClient) GetDataAccessLabel(ctx context.Context, req *chroniclepb.GetDataAccessLabelRequest, opts ...gax.CallOption) (*chroniclepb.DataAccessLabel, error)
GetDataAccessLabel gets a data access label.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.GetDataAccessLabelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#GetDataAccessLabelRequest.
}
resp, err := c.GetDataAccessLabel(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataAccessControlClient) GetDataAccessScope
func (c *DataAccessControlClient) GetDataAccessScope(ctx context.Context, req *chroniclepb.GetDataAccessScopeRequest, opts ...gax.CallOption) (*chroniclepb.DataAccessScope, error)
GetDataAccessScope retrieves an existing data access scope.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.GetDataAccessScopeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#GetDataAccessScopeRequest.
}
resp, err := c.GetDataAccessScope(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataAccessControlClient) GetOperation
func (c *DataAccessControlClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataAccessControlClient) ListDataAccessLabels
func (c *DataAccessControlClient) ListDataAccessLabels(ctx context.Context, req *chroniclepb.ListDataAccessLabelsRequest, opts ...gax.CallOption) *DataAccessLabelIterator
ListDataAccessLabels lists all data access labels for the customer.
Examples
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListDataAccessLabelsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListDataAccessLabelsRequest.
}
it := c.ListDataAccessLabels(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*chroniclepb.ListDataAccessLabelsResponse)
}
}
all
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListDataAccessLabelsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListDataAccessLabelsRequest.
}
for resp, err := range c.ListDataAccessLabels(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DataAccessControlClient) ListDataAccessScopes
func (c *DataAccessControlClient) ListDataAccessScopes(ctx context.Context, req *chroniclepb.ListDataAccessScopesRequest, opts ...gax.CallOption) *DataAccessScopeIterator
ListDataAccessScopes lists all existing data access scopes for the customer.
Examples
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListDataAccessScopesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListDataAccessScopesRequest.
}
it := c.ListDataAccessScopes(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*chroniclepb.ListDataAccessScopesResponse)
}
}
all
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListDataAccessScopesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListDataAccessScopesRequest.
}
for resp, err := range c.ListDataAccessScopes(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DataAccessControlClient) ListOperations
func (c *DataAccessControlClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
all
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*DataAccessControlClient) UpdateDataAccessLabel
func (c *DataAccessControlClient) UpdateDataAccessLabel(ctx context.Context, req *chroniclepb.UpdateDataAccessLabelRequest, opts ...gax.CallOption) (*chroniclepb.DataAccessLabel, error)
UpdateDataAccessLabel updates a data access label.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.UpdateDataAccessLabelRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#UpdateDataAccessLabelRequest.
}
resp, err := c.UpdateDataAccessLabel(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*DataAccessControlClient) UpdateDataAccessScope
func (c *DataAccessControlClient) UpdateDataAccessScope(ctx context.Context, req *chroniclepb.UpdateDataAccessScopeRequest, opts ...gax.CallOption) (*chroniclepb.DataAccessScope, error)
UpdateDataAccessScope updates a data access scope.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewDataAccessControlClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.UpdateDataAccessScopeRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#UpdateDataAccessScopeRequest.
}
resp, err := c.UpdateDataAccessScope(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
DataAccessLabelIterator
type DataAccessLabelIterator struct {
// 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.
Response interface{}
// 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 []*chroniclepb.DataAccessLabel, nextPageToken string, err error)
// contains filtered or unexported fields
}
DataAccessLabelIterator manages a stream of *chroniclepb.DataAccessLabel.
func (*DataAccessLabelIterator) All
func (it *DataAccessLabelIterator) All() iter.Seq2[*chroniclepb.DataAccessLabel, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DataAccessLabelIterator) Next
func (it *DataAccessLabelIterator) Next() (*chroniclepb.DataAccessLabel, 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 (*DataAccessLabelIterator) PageInfo
func (it *DataAccessLabelIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
DataAccessScopeIterator
type DataAccessScopeIterator struct {
// 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.
Response interface{}
// 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 []*chroniclepb.DataAccessScope, nextPageToken string, err error)
// contains filtered or unexported fields
}
DataAccessScopeIterator manages a stream of *chroniclepb.DataAccessScope.
func (*DataAccessScopeIterator) All
func (it *DataAccessScopeIterator) All() iter.Seq2[*chroniclepb.DataAccessScope, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*DataAccessScopeIterator) Next
func (it *DataAccessScopeIterator) Next() (*chroniclepb.DataAccessScope, 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 (*DataAccessScopeIterator) PageInfo
func (it *DataAccessScopeIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
EntityCallOptions
type EntityCallOptions struct {
GetWatchlist []gax.CallOption
ListWatchlists []gax.CallOption
CreateWatchlist []gax.CallOption
UpdateWatchlist []gax.CallOption
DeleteWatchlist []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
EntityCallOptions contains the retry settings for each method of EntityClient.
EntityClient
type EntityClient struct {
// The call options for this service.
CallOptions *EntityCallOptions
// contains filtered or unexported fields
}
EntityClient is a client for interacting with Chronicle API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
EntityService contains apis for finding entities.
func NewEntityClient
func NewEntityClient(ctx context.Context, opts ...option.ClientOption) (*EntityClient, error)
NewEntityClient creates a new entity service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
EntityService contains apis for finding entities.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewEntityClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewEntityRESTClient
func NewEntityRESTClient(ctx context.Context, opts ...option.ClientOption) (*EntityClient, error)
NewEntityRESTClient creates a new entity service rest client.
EntityService contains apis for finding entities.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewEntityRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*EntityClient) CancelOperation
func (c *EntityClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewEntityClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*EntityClient) Close
func (c *EntityClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*EntityClient) Connection (deprecated)
func (c *EntityClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*EntityClient) CreateWatchlist
func (c *EntityClient) CreateWatchlist(ctx context.Context, req *chroniclepb.CreateWatchlistRequest, opts ...gax.CallOption) (*chroniclepb.Watchlist, error)
CreateWatchlist creates a watchlist for the given instance. Note that there can be at most 200 watchlists per instance.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewEntityClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.CreateWatchlistRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#CreateWatchlistRequest.
}
resp, err := c.CreateWatchlist(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EntityClient) DeleteOperation
func (c *EntityClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewEntityClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*EntityClient) DeleteWatchlist
func (c *EntityClient) DeleteWatchlist(ctx context.Context, req *chroniclepb.DeleteWatchlistRequest, opts ...gax.CallOption) error
DeleteWatchlist deletes the watchlist for the given instance.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewEntityClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.DeleteWatchlistRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#DeleteWatchlistRequest.
}
err = c.DeleteWatchlist(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*EntityClient) GetOperation
func (c *EntityClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewEntityClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EntityClient) GetWatchlist
func (c *EntityClient) GetWatchlist(ctx context.Context, req *chroniclepb.GetWatchlistRequest, opts ...gax.CallOption) (*chroniclepb.Watchlist, error)
GetWatchlist gets watchlist details for the given watchlist ID.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewEntityClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.GetWatchlistRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#GetWatchlistRequest.
}
resp, err := c.GetWatchlist(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*EntityClient) ListOperations
func (c *EntityClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewEntityClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
all
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewEntityClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EntityClient) ListWatchlists
func (c *EntityClient) ListWatchlists(ctx context.Context, req *chroniclepb.ListWatchlistsRequest, opts ...gax.CallOption) *WatchlistIterator
ListWatchlists lists all watchlists for the given instance.
Examples
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewEntityClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListWatchlistsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListWatchlistsRequest.
}
it := c.ListWatchlists(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*chroniclepb.ListWatchlistsResponse)
}
}
all
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewEntityClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListWatchlistsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListWatchlistsRequest.
}
for resp, err := range c.ListWatchlists(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*EntityClient) UpdateWatchlist
func (c *EntityClient) UpdateWatchlist(ctx context.Context, req *chroniclepb.UpdateWatchlistRequest, opts ...gax.CallOption) (*chroniclepb.Watchlist, error)
UpdateWatchlist updates the watchlist for the given instance.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewEntityClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.UpdateWatchlistRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#UpdateWatchlistRequest.
}
resp, err := c.UpdateWatchlist(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
InstanceCallOptions
type InstanceCallOptions struct {
GetInstance []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
InstanceCallOptions contains the retry settings for each method of InstanceClient.
InstanceClient
type InstanceClient struct {
// The call options for this service.
CallOptions *InstanceCallOptions
// contains filtered or unexported fields
}
InstanceClient is a client for interacting with Chronicle API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
InstanceService provides the entry interface for the Chronicle API.
func NewInstanceClient
func NewInstanceClient(ctx context.Context, opts ...option.ClientOption) (*InstanceClient, error)
NewInstanceClient creates a new instance service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
InstanceService provides the entry interface for the Chronicle API.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewInstanceClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewInstanceRESTClient
func NewInstanceRESTClient(ctx context.Context, opts ...option.ClientOption) (*InstanceClient, error)
NewInstanceRESTClient creates a new instance service rest client.
InstanceService provides the entry interface for the Chronicle API.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewInstanceRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*InstanceClient) CancelOperation
func (c *InstanceClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewInstanceClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceClient) Close
func (c *InstanceClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*InstanceClient) Connection (deprecated)
func (c *InstanceClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*InstanceClient) DeleteOperation
func (c *InstanceClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewInstanceClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*InstanceClient) GetInstance
func (c *InstanceClient) GetInstance(ctx context.Context, req *chroniclepb.GetInstanceRequest, opts ...gax.CallOption) (*chroniclepb.Instance, error)
GetInstance gets a Instance.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewInstanceClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.GetInstanceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#GetInstanceRequest.
}
resp, err := c.GetInstance(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstanceClient) GetOperation
func (c *InstanceClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewInstanceClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*InstanceClient) ListOperations
func (c *InstanceClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewInstanceClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
all
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewInstanceClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
OperationIterator
type OperationIterator struct {
// 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.
Response interface{}
// 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 []*longrunningpb.Operation, nextPageToken string, err error)
// contains filtered or unexported fields
}
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next
func (it *OperationIterator) Next() (*longrunningpb.Operation, 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 (*OperationIterator) PageInfo
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ReferenceListCallOptions
type ReferenceListCallOptions struct {
GetReferenceList []gax.CallOption
ListReferenceLists []gax.CallOption
CreateReferenceList []gax.CallOption
UpdateReferenceList []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
ReferenceListCallOptions contains the retry settings for each method of ReferenceListClient.
ReferenceListClient
type ReferenceListClient struct {
// The call options for this service.
CallOptions *ReferenceListCallOptions
// contains filtered or unexported fields
}
ReferenceListClient is a client for interacting with Chronicle API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
ReferenceListService provides an interface for managing reference lists.
func NewReferenceListClient
func NewReferenceListClient(ctx context.Context, opts ...option.ClientOption) (*ReferenceListClient, error)
NewReferenceListClient creates a new reference list service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
ReferenceListService provides an interface for managing reference lists.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewReferenceListClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewReferenceListRESTClient
func NewReferenceListRESTClient(ctx context.Context, opts ...option.ClientOption) (*ReferenceListClient, error)
NewReferenceListRESTClient creates a new reference list service rest client.
ReferenceListService provides an interface for managing reference lists.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewReferenceListRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*ReferenceListClient) CancelOperation
func (c *ReferenceListClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewReferenceListClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ReferenceListClient) Close
func (c *ReferenceListClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*ReferenceListClient) Connection (deprecated)
func (c *ReferenceListClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*ReferenceListClient) CreateReferenceList
func (c *ReferenceListClient) CreateReferenceList(ctx context.Context, req *chroniclepb.CreateReferenceListRequest, opts ...gax.CallOption) (*chroniclepb.ReferenceList, error)
CreateReferenceList creates a new reference list.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewReferenceListClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.CreateReferenceListRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#CreateReferenceListRequest.
}
resp, err := c.CreateReferenceList(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReferenceListClient) DeleteOperation
func (c *ReferenceListClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewReferenceListClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*ReferenceListClient) GetOperation
func (c *ReferenceListClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewReferenceListClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReferenceListClient) GetReferenceList
func (c *ReferenceListClient) GetReferenceList(ctx context.Context, req *chroniclepb.GetReferenceListRequest, opts ...gax.CallOption) (*chroniclepb.ReferenceList, error)
GetReferenceList gets a single reference list.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewReferenceListClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.GetReferenceListRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#GetReferenceListRequest.
}
resp, err := c.GetReferenceList(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*ReferenceListClient) ListOperations
func (c *ReferenceListClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewReferenceListClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
all
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewReferenceListClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ReferenceListClient) ListReferenceLists
func (c *ReferenceListClient) ListReferenceLists(ctx context.Context, req *chroniclepb.ListReferenceListsRequest, opts ...gax.CallOption) *ReferenceListIterator
ListReferenceLists lists a collection of reference lists.
Examples
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewReferenceListClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListReferenceListsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListReferenceListsRequest.
}
it := c.ListReferenceLists(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*chroniclepb.ListReferenceListsResponse)
}
}
all
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewReferenceListClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListReferenceListsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListReferenceListsRequest.
}
for resp, err := range c.ListReferenceLists(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*ReferenceListClient) UpdateReferenceList
func (c *ReferenceListClient) UpdateReferenceList(ctx context.Context, req *chroniclepb.UpdateReferenceListRequest, opts ...gax.CallOption) (*chroniclepb.ReferenceList, error)
UpdateReferenceList updates an existing reference list.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewReferenceListClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.UpdateReferenceListRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#UpdateReferenceListRequest.
}
resp, err := c.UpdateReferenceList(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
ReferenceListIterator
type ReferenceListIterator struct {
// 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.
Response interface{}
// 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 []*chroniclepb.ReferenceList, nextPageToken string, err error)
// contains filtered or unexported fields
}
ReferenceListIterator manages a stream of *chroniclepb.ReferenceList.
func (*ReferenceListIterator) All
func (it *ReferenceListIterator) All() iter.Seq2[*chroniclepb.ReferenceList, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ReferenceListIterator) Next
func (it *ReferenceListIterator) Next() (*chroniclepb.ReferenceList, 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 (*ReferenceListIterator) PageInfo
func (it *ReferenceListIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
RetrohuntIterator
type RetrohuntIterator struct {
// 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.
Response interface{}
// 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 []*chroniclepb.Retrohunt, nextPageToken string, err error)
// contains filtered or unexported fields
}
RetrohuntIterator manages a stream of *chroniclepb.Retrohunt.
func (*RetrohuntIterator) All
func (it *RetrohuntIterator) All() iter.Seq2[*chroniclepb.Retrohunt, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RetrohuntIterator) Next
func (it *RetrohuntIterator) Next() (*chroniclepb.Retrohunt, 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 (*RetrohuntIterator) PageInfo
func (it *RetrohuntIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
RuleCallOptions
type RuleCallOptions struct {
CreateRule []gax.CallOption
GetRule []gax.CallOption
ListRules []gax.CallOption
UpdateRule []gax.CallOption
DeleteRule []gax.CallOption
ListRuleRevisions []gax.CallOption
CreateRetrohunt []gax.CallOption
GetRetrohunt []gax.CallOption
ListRetrohunts []gax.CallOption
GetRuleDeployment []gax.CallOption
ListRuleDeployments []gax.CallOption
UpdateRuleDeployment []gax.CallOption
CancelOperation []gax.CallOption
DeleteOperation []gax.CallOption
GetOperation []gax.CallOption
ListOperations []gax.CallOption
}
RuleCallOptions contains the retry settings for each method of RuleClient.
RuleClient
type RuleClient struct {
// The call options for this service.
CallOptions *RuleCallOptions
// LROClient is used internally to handle long-running operations.
// It is exposed so that its CallOptions can be modified if required.
// Users should not Close this client.
LROClient *lroauto.OperationsClient
// contains filtered or unexported fields
}
RuleClient is a client for interacting with Chronicle API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
RuleService provides interface for user-created rules.
func NewRuleClient
func NewRuleClient(ctx context.Context, opts ...option.ClientOption) (*RuleClient, error)
NewRuleClient creates a new rule service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
RuleService provides interface for user-created rules.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewRuleRESTClient
func NewRuleRESTClient(ctx context.Context, opts ...option.ClientOption) (*RuleClient, error)
NewRuleRESTClient creates a new rule service rest client.
RuleService provides interface for user-created rules.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*RuleClient) CancelOperation
func (c *RuleClient) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.CancelOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.
}
err = c.CancelOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*RuleClient) Close
func (c *RuleClient) Close() error
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*RuleClient) Connection (deprecated)
func (c *RuleClient) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*RuleClient) CreateRetrohunt
func (c *RuleClient) CreateRetrohunt(ctx context.Context, req *chroniclepb.CreateRetrohuntRequest, opts ...gax.CallOption) (*CreateRetrohuntOperation, error)
CreateRetrohunt create a Retrohunt.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.CreateRetrohuntRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#CreateRetrohuntRequest.
}
op, err := c.CreateRetrohunt(ctx, req)
if err != nil {
// TODO: Handle error.
}
resp, err := op.Wait(ctx)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RuleClient) CreateRetrohuntOperation
func (c *RuleClient) CreateRetrohuntOperation(name string) *CreateRetrohuntOperation
CreateRetrohuntOperation returns a new CreateRetrohuntOperation from a given name. The name must be that of a previously created CreateRetrohuntOperation, possibly from a different process.
func (*RuleClient) CreateRule
func (c *RuleClient) CreateRule(ctx context.Context, req *chroniclepb.CreateRuleRequest, opts ...gax.CallOption) (*chroniclepb.Rule, error)
CreateRule creates a new Rule.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.CreateRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#CreateRuleRequest.
}
resp, err := c.CreateRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RuleClient) DeleteOperation
func (c *RuleClient) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.DeleteOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.
}
err = c.DeleteOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*RuleClient) DeleteRule
func (c *RuleClient) DeleteRule(ctx context.Context, req *chroniclepb.DeleteRuleRequest, opts ...gax.CallOption) error
DeleteRule deletes a Rule.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.DeleteRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#DeleteRuleRequest.
}
err = c.DeleteRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*RuleClient) GetOperation
func (c *RuleClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.GetOperationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.
}
resp, err := c.GetOperation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RuleClient) GetRetrohunt
func (c *RuleClient) GetRetrohunt(ctx context.Context, req *chroniclepb.GetRetrohuntRequest, opts ...gax.CallOption) (*chroniclepb.Retrohunt, error)
GetRetrohunt get a Retrohunt.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.GetRetrohuntRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#GetRetrohuntRequest.
}
resp, err := c.GetRetrohunt(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RuleClient) GetRule
func (c *RuleClient) GetRule(ctx context.Context, req *chroniclepb.GetRuleRequest, opts ...gax.CallOption) (*chroniclepb.Rule, error)
GetRule gets a Rule.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.GetRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#GetRuleRequest.
}
resp, err := c.GetRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RuleClient) GetRuleDeployment
func (c *RuleClient) GetRuleDeployment(ctx context.Context, req *chroniclepb.GetRuleDeploymentRequest, opts ...gax.CallOption) (*chroniclepb.RuleDeployment, error)
GetRuleDeployment gets a RuleDeployment.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.GetRuleDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#GetRuleDeploymentRequest.
}
resp, err := c.GetRuleDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RuleClient) ListOperations
func (c *RuleClient) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Examples
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
it := c.ListOperations(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*longrunningpb.ListOperationsResponse)
}
}
all
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &longrunningpb.ListOperationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.
}
for resp, err := range c.ListOperations(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RuleClient) ListRetrohunts
func (c *RuleClient) ListRetrohunts(ctx context.Context, req *chroniclepb.ListRetrohuntsRequest, opts ...gax.CallOption) *RetrohuntIterator
ListRetrohunts list Retrohunts.
Examples
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListRetrohuntsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListRetrohuntsRequest.
}
it := c.ListRetrohunts(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*chroniclepb.ListRetrohuntsResponse)
}
}
all
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListRetrohuntsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListRetrohuntsRequest.
}
for resp, err := range c.ListRetrohunts(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RuleClient) ListRuleDeployments
func (c *RuleClient) ListRuleDeployments(ctx context.Context, req *chroniclepb.ListRuleDeploymentsRequest, opts ...gax.CallOption) *RuleDeploymentIterator
ListRuleDeployments lists RuleDeployments across all Rules.
Examples
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListRuleDeploymentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListRuleDeploymentsRequest.
}
it := c.ListRuleDeployments(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*chroniclepb.ListRuleDeploymentsResponse)
}
}
all
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListRuleDeploymentsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListRuleDeploymentsRequest.
}
for resp, err := range c.ListRuleDeployments(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RuleClient) ListRuleRevisions
func (c *RuleClient) ListRuleRevisions(ctx context.Context, req *chroniclepb.ListRuleRevisionsRequest, opts ...gax.CallOption) *RuleIterator
ListRuleRevisions lists all revisions of the rule.
Examples
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListRuleRevisionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListRuleRevisionsRequest.
}
it := c.ListRuleRevisions(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*chroniclepb.ListRuleRevisionsResponse)
}
}
all
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListRuleRevisionsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListRuleRevisionsRequest.
}
for resp, err := range c.ListRuleRevisions(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RuleClient) ListRules
func (c *RuleClient) ListRules(ctx context.Context, req *chroniclepb.ListRulesRequest, opts ...gax.CallOption) *RuleIterator
ListRules lists Rules.
Examples
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
"google.golang.org/api/iterator"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListRulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListRulesRequest.
}
it := c.ListRules(ctx, req)
for {
resp, err := it.Next()
if err == iterator.Done {
break
}
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
// If you need to access the underlying RPC response,
// you can do so by casting the `Response` as below.
// Otherwise, remove this line. Only populated after
// first call to Next(). Not safe for concurrent access.
_ = it.Response.(*chroniclepb.ListRulesResponse)
}
}
all
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.ListRulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#ListRulesRequest.
}
for resp, err := range c.ListRules(ctx, req).All() {
if err != nil {
// TODO: Handle error and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
func (*RuleClient) UpdateRule
func (c *RuleClient) UpdateRule(ctx context.Context, req *chroniclepb.UpdateRuleRequest, opts ...gax.CallOption) (*chroniclepb.Rule, error)
UpdateRule updates a Rule.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.UpdateRuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#UpdateRuleRequest.
}
resp, err := c.UpdateRule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*RuleClient) UpdateRuleDeployment
func (c *RuleClient) UpdateRuleDeployment(ctx context.Context, req *chroniclepb.UpdateRuleDeploymentRequest, opts ...gax.CallOption) (*chroniclepb.RuleDeployment, error)
UpdateRuleDeployment updates a RuleDeployment. Failures are not necessarily atomic. If there is a request to update multiple fields, and any update to a single field fails, an error will be returned, but other fields may remain successfully updated.
Example
package main
import (
"context"
chronicle "cloud.google.com/go/chronicle/apiv1"
chroniclepb "cloud.google.com/go/chronicle/apiv1/chroniclepb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := chronicle.NewRuleClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &chroniclepb.UpdateRuleDeploymentRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/chronicle/apiv1/chroniclepb#UpdateRuleDeploymentRequest.
}
resp, err := c.UpdateRuleDeployment(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
RuleDeploymentIterator
type RuleDeploymentIterator struct {
// 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.
Response interface{}
// 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 []*chroniclepb.RuleDeployment, nextPageToken string, err error)
// contains filtered or unexported fields
}
RuleDeploymentIterator manages a stream of *chroniclepb.RuleDeployment.
func (*RuleDeploymentIterator) All
func (it *RuleDeploymentIterator) All() iter.Seq2[*chroniclepb.RuleDeployment, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RuleDeploymentIterator) Next
func (it *RuleDeploymentIterator) Next() (*chroniclepb.RuleDeployment, 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 (*RuleDeploymentIterator) PageInfo
func (it *RuleDeploymentIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
RuleIterator
type RuleIterator struct {
// 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.
Response interface{}
// 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 []*chroniclepb.Rule, nextPageToken string, err error)
// contains filtered or unexported fields
}
RuleIterator manages a stream of *chroniclepb.Rule.
func (*RuleIterator) All
func (it *RuleIterator) All() iter.Seq2[*chroniclepb.Rule, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*RuleIterator) Next
func (it *RuleIterator) Next() (*chroniclepb.Rule, 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 (*RuleIterator) PageInfo
func (it *RuleIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
WatchlistIterator
type WatchlistIterator struct {
// 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.
Response interface{}
// 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 []*chroniclepb.Watchlist, nextPageToken string, err error)
// contains filtered or unexported fields
}
WatchlistIterator manages a stream of *chroniclepb.Watchlist.
func (*WatchlistIterator) All
func (it *WatchlistIterator) All() iter.Seq2[*chroniclepb.Watchlist, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*WatchlistIterator) Next
func (it *WatchlistIterator) Next() (*chroniclepb.Watchlist, 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 (*WatchlistIterator) PageInfo
func (it *WatchlistIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.