Package securitycentermanagement is an auto-generated package for the Security Center Management API.
Management API for Security Command Center, a built-in security and risk management solution for Google Cloud. Use this API to programmatically update the settings and configuration of Security Command Center.
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.
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 := securitycentermanagement.NewClient(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.
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 := securitycentermanagement.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycentermanagementpb.CreateEventThreatDetectionCustomModuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#CreateEventThreatDetectionCustomModuleRequest. } resp, err := c.CreateEventThreatDetectionCustomModule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewClient 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.
CallOptions
type CallOptions struct {
ListEffectiveSecurityHealthAnalyticsCustomModules []gax.CallOption
GetEffectiveSecurityHealthAnalyticsCustomModule []gax.CallOption
ListSecurityHealthAnalyticsCustomModules []gax.CallOption
ListDescendantSecurityHealthAnalyticsCustomModules []gax.CallOption
GetSecurityHealthAnalyticsCustomModule []gax.CallOption
CreateSecurityHealthAnalyticsCustomModule []gax.CallOption
UpdateSecurityHealthAnalyticsCustomModule []gax.CallOption
DeleteSecurityHealthAnalyticsCustomModule []gax.CallOption
SimulateSecurityHealthAnalyticsCustomModule []gax.CallOption
ListEffectiveEventThreatDetectionCustomModules []gax.CallOption
GetEffectiveEventThreatDetectionCustomModule []gax.CallOption
ListEventThreatDetectionCustomModules []gax.CallOption
ListDescendantEventThreatDetectionCustomModules []gax.CallOption
GetEventThreatDetectionCustomModule []gax.CallOption
CreateEventThreatDetectionCustomModule []gax.CallOption
UpdateEventThreatDetectionCustomModule []gax.CallOption
DeleteEventThreatDetectionCustomModule []gax.CallOption
ValidateEventThreatDetectionCustomModule []gax.CallOption
GetSecurityCenterService []gax.CallOption
ListSecurityCenterServices []gax.CallOption
UpdateSecurityCenterService []gax.CallOption
GetLocation []gax.CallOption
ListLocations []gax.CallOption
}
CallOptions contains the retry settings for each method of Client.
Client
type Client struct {
// The call options for this service.
CallOptions *CallOptions
// contains filtered or unexported fields
}
Client is a client for interacting with Security Center Management API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Service describing handlers for resources
func NewClient
NewClient creates a new security center management client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Service describing handlers for resources
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewRESTClient
NewRESTClient creates a new security center management rest client.
Service describing handlers for resources
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/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 := securitycentermanagement.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*Client) Close
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection (deprecated)
func (c *Client) 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 (*Client) CreateEventThreatDetectionCustomModule
func (c *Client) CreateEventThreatDetectionCustomModule(ctx context.Context, req *securitycentermanagementpb.CreateEventThreatDetectionCustomModuleRequest, opts ...gax.CallOption) (*securitycentermanagementpb.EventThreatDetectionCustomModule, error)
CreateEventThreatDetectionCustomModule creates a resident Event Threat Detection custom module at the scope of the given Resource Manager parent, and also creates inherited custom modules for all descendants of the given parent. These modules are enabled by default.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.CreateEventThreatDetectionCustomModuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#CreateEventThreatDetectionCustomModuleRequest.
}
resp, err := c.CreateEventThreatDetectionCustomModule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateSecurityHealthAnalyticsCustomModule
func (c *Client) CreateSecurityHealthAnalyticsCustomModule(ctx context.Context, req *securitycentermanagementpb.CreateSecurityHealthAnalyticsCustomModuleRequest, opts ...gax.CallOption) (*securitycentermanagementpb.SecurityHealthAnalyticsCustomModule, error)
CreateSecurityHealthAnalyticsCustomModule creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.CreateSecurityHealthAnalyticsCustomModuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#CreateSecurityHealthAnalyticsCustomModuleRequest.
}
resp, err := c.CreateSecurityHealthAnalyticsCustomModule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) DeleteEventThreatDetectionCustomModule
func (c *Client) DeleteEventThreatDetectionCustomModule(ctx context.Context, req *securitycentermanagementpb.DeleteEventThreatDetectionCustomModuleRequest, opts ...gax.CallOption) error
DeleteEventThreatDetectionCustomModule deletes the specified Event Threat Detection custom module and all of its descendants in the Resource Manager hierarchy. This method is only supported for resident custom modules.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.DeleteEventThreatDetectionCustomModuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#DeleteEventThreatDetectionCustomModuleRequest.
}
err = c.DeleteEventThreatDetectionCustomModule(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) DeleteSecurityHealthAnalyticsCustomModule
func (c *Client) DeleteSecurityHealthAnalyticsCustomModule(ctx context.Context, req *securitycentermanagementpb.DeleteSecurityHealthAnalyticsCustomModuleRequest, opts ...gax.CallOption) error
DeleteSecurityHealthAnalyticsCustomModule deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.DeleteSecurityHealthAnalyticsCustomModuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#DeleteSecurityHealthAnalyticsCustomModuleRequest.
}
err = c.DeleteSecurityHealthAnalyticsCustomModule(ctx, req)
if err != nil {
// TODO: Handle error.
}
}
func (*Client) GetEffectiveEventThreatDetectionCustomModule
func (c *Client) GetEffectiveEventThreatDetectionCustomModule(ctx context.Context, req *securitycentermanagementpb.GetEffectiveEventThreatDetectionCustomModuleRequest, opts ...gax.CallOption) (*securitycentermanagementpb.EffectiveEventThreatDetectionCustomModule, error)
GetEffectiveEventThreatDetectionCustomModule gets an effective ETD custom module. Retrieves the effective module at the given level. The difference between an EffectiveCustomModule and a CustomModule is that the fields for an EffectiveCustomModule are computed from ancestors if needed. For example, the enablement_state for a CustomModule can be either ENABLED, DISABLED, or INHERITED. Where as the enablement_state for an EffectiveCustomModule is always computed to ENABLED or DISABLED (the effective enablement_state).
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.GetEffectiveEventThreatDetectionCustomModuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#GetEffectiveEventThreatDetectionCustomModuleRequest.
}
resp, err := c.GetEffectiveEventThreatDetectionCustomModule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetEffectiveSecurityHealthAnalyticsCustomModule
func (c *Client) GetEffectiveSecurityHealthAnalyticsCustomModule(ctx context.Context, req *securitycentermanagementpb.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, opts ...gax.CallOption) (*securitycentermanagementpb.EffectiveSecurityHealthAnalyticsCustomModule, error)
GetEffectiveSecurityHealthAnalyticsCustomModule gets details of a single EffectiveSecurityHealthAnalyticsCustomModule.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#GetEffectiveSecurityHealthAnalyticsCustomModuleRequest.
}
resp, err := c.GetEffectiveSecurityHealthAnalyticsCustomModule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetEventThreatDetectionCustomModule
func (c *Client) GetEventThreatDetectionCustomModule(ctx context.Context, req *securitycentermanagementpb.GetEventThreatDetectionCustomModuleRequest, opts ...gax.CallOption) (*securitycentermanagementpb.EventThreatDetectionCustomModule, error)
GetEventThreatDetectionCustomModule gets an Event Threat Detection custom module.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.GetEventThreatDetectionCustomModuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#GetEventThreatDetectionCustomModuleRequest.
}
resp, err := c.GetEventThreatDetectionCustomModule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetLocation
func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, opts ...gax.CallOption) (*locationpb.Location, error)
GetLocation gets information about a location.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.GetLocationRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.
}
resp, err := c.GetLocation(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetSecurityCenterService
func (c *Client) GetSecurityCenterService(ctx context.Context, req *securitycentermanagementpb.GetSecurityCenterServiceRequest, opts ...gax.CallOption) (*securitycentermanagementpb.SecurityCenterService, error)
GetSecurityCenterService gets service settings for the specified Security Command Center service.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.GetSecurityCenterServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#GetSecurityCenterServiceRequest.
}
resp, err := c.GetSecurityCenterService(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) GetSecurityHealthAnalyticsCustomModule
func (c *Client) GetSecurityHealthAnalyticsCustomModule(ctx context.Context, req *securitycentermanagementpb.GetSecurityHealthAnalyticsCustomModuleRequest, opts ...gax.CallOption) (*securitycentermanagementpb.SecurityHealthAnalyticsCustomModule, error)
GetSecurityHealthAnalyticsCustomModule retrieves a SecurityHealthAnalyticsCustomModule.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.GetSecurityHealthAnalyticsCustomModuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#GetSecurityHealthAnalyticsCustomModuleRequest.
}
resp, err := c.GetSecurityHealthAnalyticsCustomModule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) ListDescendantEventThreatDetectionCustomModules
func (c *Client) ListDescendantEventThreatDetectionCustomModules(ctx context.Context, req *securitycentermanagementpb.ListDescendantEventThreatDetectionCustomModulesRequest, opts ...gax.CallOption) *EventThreatDetectionCustomModuleIterator
ListDescendantEventThreatDetectionCustomModules lists all resident Event Threat Detection custom modules under the given Resource Manager parent and its descendants.
Examples
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
"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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListDescendantEventThreatDetectionCustomModulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListDescendantEventThreatDetectionCustomModulesRequest.
}
it := c.ListDescendantEventThreatDetectionCustomModules(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.(*securitycentermanagementpb.ListDescendantEventThreatDetectionCustomModulesResponse)
}
}
all
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListDescendantEventThreatDetectionCustomModulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListDescendantEventThreatDetectionCustomModulesRequest.
}
for resp, err := range c.ListDescendantEventThreatDetectionCustomModules(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListDescendantSecurityHealthAnalyticsCustomModules
func (c *Client) ListDescendantSecurityHealthAnalyticsCustomModules(ctx context.Context, req *securitycentermanagementpb.ListDescendantSecurityHealthAnalyticsCustomModulesRequest, opts ...gax.CallOption) *SecurityHealthAnalyticsCustomModuleIterator
ListDescendantSecurityHealthAnalyticsCustomModules returns a list of all resident SecurityHealthAnalyticsCustomModules under the given CRM parent and all of the parent’s CRM descendants.
Examples
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
"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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListDescendantSecurityHealthAnalyticsCustomModulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListDescendantSecurityHealthAnalyticsCustomModulesRequest.
}
it := c.ListDescendantSecurityHealthAnalyticsCustomModules(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.(*securitycentermanagementpb.ListDescendantSecurityHealthAnalyticsCustomModulesResponse)
}
}
all
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListDescendantSecurityHealthAnalyticsCustomModulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListDescendantSecurityHealthAnalyticsCustomModulesRequest.
}
for resp, err := range c.ListDescendantSecurityHealthAnalyticsCustomModules(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListEffectiveEventThreatDetectionCustomModules
func (c *Client) ListEffectiveEventThreatDetectionCustomModules(ctx context.Context, req *securitycentermanagementpb.ListEffectiveEventThreatDetectionCustomModulesRequest, opts ...gax.CallOption) *EffectiveEventThreatDetectionCustomModuleIterator
ListEffectiveEventThreatDetectionCustomModules lists all effective Event Threat Detection custom modules for the given parent. This includes resident modules defined at the scope of the parent along with modules inherited from its ancestors.
Examples
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
"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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListEffectiveEventThreatDetectionCustomModulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListEffectiveEventThreatDetectionCustomModulesRequest.
}
it := c.ListEffectiveEventThreatDetectionCustomModules(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.(*securitycentermanagementpb.ListEffectiveEventThreatDetectionCustomModulesResponse)
}
}
all
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListEffectiveEventThreatDetectionCustomModulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListEffectiveEventThreatDetectionCustomModulesRequest.
}
for resp, err := range c.ListEffectiveEventThreatDetectionCustomModules(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListEffectiveSecurityHealthAnalyticsCustomModules
func (c *Client) ListEffectiveSecurityHealthAnalyticsCustomModules(ctx context.Context, req *securitycentermanagementpb.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, opts ...gax.CallOption) *EffectiveSecurityHealthAnalyticsCustomModuleIterator
ListEffectiveSecurityHealthAnalyticsCustomModules returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors (no descendants).
Examples
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
"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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.
}
it := c.ListEffectiveSecurityHealthAnalyticsCustomModules(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.(*securitycentermanagementpb.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse)
}
}
all
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListEffectiveSecurityHealthAnalyticsCustomModulesRequest.
}
for resp, err := range c.ListEffectiveSecurityHealthAnalyticsCustomModules(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListEventThreatDetectionCustomModules
func (c *Client) ListEventThreatDetectionCustomModules(ctx context.Context, req *securitycentermanagementpb.ListEventThreatDetectionCustomModulesRequest, opts ...gax.CallOption) *EventThreatDetectionCustomModuleIterator
ListEventThreatDetectionCustomModules lists all Event Threat Detection custom modules for the given Resource Manager parent. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.
Examples
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
"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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListEventThreatDetectionCustomModulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListEventThreatDetectionCustomModulesRequest.
}
it := c.ListEventThreatDetectionCustomModules(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.(*securitycentermanagementpb.ListEventThreatDetectionCustomModulesResponse)
}
}
all
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListEventThreatDetectionCustomModulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListEventThreatDetectionCustomModulesRequest.
}
for resp, err := range c.ListEventThreatDetectionCustomModules(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListLocations
func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Examples
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
"google.golang.org/api/iterator"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
it := c.ListLocations(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.(*locationpb.ListLocationsResponse)
}
}
all
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
locationpb "google.golang.org/genproto/googleapis/cloud/location"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &locationpb.ListLocationsRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.
}
for resp, err := range c.ListLocations(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListSecurityCenterServices
func (c *Client) ListSecurityCenterServices(ctx context.Context, req *securitycentermanagementpb.ListSecurityCenterServicesRequest, opts ...gax.CallOption) *SecurityCenterServiceIterator
ListSecurityCenterServices returns a list of all Security Command Center services for the given parent.
Examples
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
"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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListSecurityCenterServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListSecurityCenterServicesRequest.
}
it := c.ListSecurityCenterServices(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.(*securitycentermanagementpb.ListSecurityCenterServicesResponse)
}
}
all
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListSecurityCenterServicesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListSecurityCenterServicesRequest.
}
for resp, err := range c.ListSecurityCenterServices(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) ListSecurityHealthAnalyticsCustomModules
func (c *Client) ListSecurityHealthAnalyticsCustomModules(ctx context.Context, req *securitycentermanagementpb.ListSecurityHealthAnalyticsCustomModulesRequest, opts ...gax.CallOption) *SecurityHealthAnalyticsCustomModuleIterator
ListSecurityHealthAnalyticsCustomModules returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors (no descendants).
Examples
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
"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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListSecurityHealthAnalyticsCustomModulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListSecurityHealthAnalyticsCustomModulesRequest.
}
it := c.ListSecurityHealthAnalyticsCustomModules(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.(*securitycentermanagementpb.ListSecurityHealthAnalyticsCustomModulesResponse)
}
}
all
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ListSecurityHealthAnalyticsCustomModulesRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ListSecurityHealthAnalyticsCustomModulesRequest.
}
for resp, err := range c.ListSecurityHealthAnalyticsCustomModules(ctx, req).All() {
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
}
func (*Client) SimulateSecurityHealthAnalyticsCustomModule
func (c *Client) SimulateSecurityHealthAnalyticsCustomModule(ctx context.Context, req *securitycentermanagementpb.SimulateSecurityHealthAnalyticsCustomModuleRequest, opts ...gax.CallOption) (*securitycentermanagementpb.SimulateSecurityHealthAnalyticsCustomModuleResponse, error)
SimulateSecurityHealthAnalyticsCustomModule simulates a given SecurityHealthAnalyticsCustomModule and Resource.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.SimulateSecurityHealthAnalyticsCustomModuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#SimulateSecurityHealthAnalyticsCustomModuleRequest.
}
resp, err := c.SimulateSecurityHealthAnalyticsCustomModule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateEventThreatDetectionCustomModule
func (c *Client) UpdateEventThreatDetectionCustomModule(ctx context.Context, req *securitycentermanagementpb.UpdateEventThreatDetectionCustomModuleRequest, opts ...gax.CallOption) (*securitycentermanagementpb.EventThreatDetectionCustomModule, error)
UpdateEventThreatDetectionCustomModule updates the Event Threat Detection custom module with the given name based on the given update mask. Updating the enablement state is supported for both resident and inherited modules (though resident modules cannot have an enablement state of “inherited”). Updating the display name or configuration of a module is supported for resident modules only. The type of a module cannot be changed.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.UpdateEventThreatDetectionCustomModuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#UpdateEventThreatDetectionCustomModuleRequest.
}
resp, err := c.UpdateEventThreatDetectionCustomModule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateSecurityCenterService
func (c *Client) UpdateSecurityCenterService(ctx context.Context, req *securitycentermanagementpb.UpdateSecurityCenterServiceRequest, opts ...gax.CallOption) (*securitycentermanagementpb.SecurityCenterService, error)
UpdateSecurityCenterService updates a Security Command Center service using the given update mask.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.UpdateSecurityCenterServiceRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#UpdateSecurityCenterServiceRequest.
}
resp, err := c.UpdateSecurityCenterService(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) UpdateSecurityHealthAnalyticsCustomModule
func (c *Client) UpdateSecurityHealthAnalyticsCustomModule(ctx context.Context, req *securitycentermanagementpb.UpdateSecurityHealthAnalyticsCustomModuleRequest, opts ...gax.CallOption) (*securitycentermanagementpb.SecurityHealthAnalyticsCustomModule, error)
UpdateSecurityHealthAnalyticsCustomModule updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of “inherited”). Updating the display name and custom config of a module is supported on resident modules only.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.UpdateSecurityHealthAnalyticsCustomModuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#UpdateSecurityHealthAnalyticsCustomModuleRequest.
}
resp, err := c.UpdateSecurityHealthAnalyticsCustomModule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) ValidateEventThreatDetectionCustomModule
func (c *Client) ValidateEventThreatDetectionCustomModule(ctx context.Context, req *securitycentermanagementpb.ValidateEventThreatDetectionCustomModuleRequest, opts ...gax.CallOption) (*securitycentermanagementpb.ValidateEventThreatDetectionCustomModuleResponse, error)
ValidateEventThreatDetectionCustomModule validates the given Event Threat Detection custom module.
Example
package main
import (
"context"
securitycentermanagement "cloud.google.com/go/securitycentermanagement/apiv1"
securitycentermanagementpb "cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb"
)
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 := securitycentermanagement.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &securitycentermanagementpb.ValidateEventThreatDetectionCustomModuleRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/securitycentermanagement/apiv1/securitycentermanagementpb#ValidateEventThreatDetectionCustomModuleRequest.
}
resp, err := c.ValidateEventThreatDetectionCustomModule(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
EffectiveEventThreatDetectionCustomModuleIterator
type EffectiveEventThreatDetectionCustomModuleIterator 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 []*securitycentermanagementpb.EffectiveEventThreatDetectionCustomModule, nextPageToken string, err error)
// contains filtered or unexported fields
}
EffectiveEventThreatDetectionCustomModuleIterator manages a stream of *securitycentermanagementpb.EffectiveEventThreatDetectionCustomModule.
func (*EffectiveEventThreatDetectionCustomModuleIterator) All
func (it *EffectiveEventThreatDetectionCustomModuleIterator) All() iter.Seq2[*securitycentermanagementpb.EffectiveEventThreatDetectionCustomModule, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EffectiveEventThreatDetectionCustomModuleIterator) Next
func (it *EffectiveEventThreatDetectionCustomModuleIterator) Next() (*securitycentermanagementpb.EffectiveEventThreatDetectionCustomModule, 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 (*EffectiveEventThreatDetectionCustomModuleIterator) PageInfo
func (it *EffectiveEventThreatDetectionCustomModuleIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
EffectiveSecurityHealthAnalyticsCustomModuleIterator
type EffectiveSecurityHealthAnalyticsCustomModuleIterator 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 []*securitycentermanagementpb.EffectiveSecurityHealthAnalyticsCustomModule, nextPageToken string, err error)
// contains filtered or unexported fields
}
EffectiveSecurityHealthAnalyticsCustomModuleIterator manages a stream of *securitycentermanagementpb.EffectiveSecurityHealthAnalyticsCustomModule.
func (*EffectiveSecurityHealthAnalyticsCustomModuleIterator) All
func (it *EffectiveSecurityHealthAnalyticsCustomModuleIterator) All() iter.Seq2[*securitycentermanagementpb.EffectiveSecurityHealthAnalyticsCustomModule, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EffectiveSecurityHealthAnalyticsCustomModuleIterator) Next
func (it *EffectiveSecurityHealthAnalyticsCustomModuleIterator) Next() (*securitycentermanagementpb.EffectiveSecurityHealthAnalyticsCustomModule, 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 (*EffectiveSecurityHealthAnalyticsCustomModuleIterator) PageInfo
func (it *EffectiveSecurityHealthAnalyticsCustomModuleIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
EventThreatDetectionCustomModuleIterator
type EventThreatDetectionCustomModuleIterator 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 []*securitycentermanagementpb.EventThreatDetectionCustomModule, nextPageToken string, err error)
// contains filtered or unexported fields
}
EventThreatDetectionCustomModuleIterator manages a stream of *securitycentermanagementpb.EventThreatDetectionCustomModule.
func (*EventThreatDetectionCustomModuleIterator) All
func (it *EventThreatDetectionCustomModuleIterator) All() iter.Seq2[*securitycentermanagementpb.EventThreatDetectionCustomModule, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EventThreatDetectionCustomModuleIterator) Next
func (it *EventThreatDetectionCustomModuleIterator) Next() (*securitycentermanagementpb.EventThreatDetectionCustomModule, 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 (*EventThreatDetectionCustomModuleIterator) PageInfo
func (it *EventThreatDetectionCustomModuleIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
LocationIterator
type LocationIterator 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 []*locationpb.Location, nextPageToken string, err error)
// contains filtered or unexported fields
}
LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LocationIterator) Next
func (it *LocationIterator) Next() (*locationpb.Location, 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 (*LocationIterator) PageInfo
func (it *LocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
SecurityCenterServiceIterator
type SecurityCenterServiceIterator 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 []*securitycentermanagementpb.SecurityCenterService, nextPageToken string, err error)
// contains filtered or unexported fields
}
SecurityCenterServiceIterator manages a stream of *securitycentermanagementpb.SecurityCenterService.
func (*SecurityCenterServiceIterator) All
func (it *SecurityCenterServiceIterator) All() iter.Seq2[*securitycentermanagementpb.SecurityCenterService, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SecurityCenterServiceIterator) Next
func (it *SecurityCenterServiceIterator) Next() (*securitycentermanagementpb.SecurityCenterService, 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 (*SecurityCenterServiceIterator) PageInfo
func (it *SecurityCenterServiceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
SecurityHealthAnalyticsCustomModuleIterator
type SecurityHealthAnalyticsCustomModuleIterator 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 []*securitycentermanagementpb.SecurityHealthAnalyticsCustomModule, nextPageToken string, err error)
// contains filtered or unexported fields
}
SecurityHealthAnalyticsCustomModuleIterator manages a stream of *securitycentermanagementpb.SecurityHealthAnalyticsCustomModule.
func (*SecurityHealthAnalyticsCustomModuleIterator) All
func (it *SecurityHealthAnalyticsCustomModuleIterator) All() iter.Seq2[*securitycentermanagementpb.SecurityHealthAnalyticsCustomModule, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SecurityHealthAnalyticsCustomModuleIterator) Next
func (it *SecurityHealthAnalyticsCustomModuleIterator) Next() (*securitycentermanagementpb.SecurityHealthAnalyticsCustomModule, 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 (*SecurityHealthAnalyticsCustomModuleIterator) PageInfo
func (it *SecurityHealthAnalyticsCustomModuleIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.