Documentation
¶
Overview ¶
Package securitycentermanagement is an auto-generated package for the Security Command 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.
// go get cloud.google.com/go/securitycentermanagement/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 := 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, mentioned above.
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.
Index ¶
- func DefaultAuthScopes() []string
- type CallOptions
- type Client
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) CreateEventThreatDetectionCustomModule(ctx context.Context, ...) (*securitycentermanagementpb.EventThreatDetectionCustomModule, error)
- func (c *Client) CreateSecurityHealthAnalyticsCustomModule(ctx context.Context, ...) (*securitycentermanagementpb.SecurityHealthAnalyticsCustomModule, error)
- func (c *Client) DeleteEventThreatDetectionCustomModule(ctx context.Context, ...) error
- func (c *Client) DeleteSecurityHealthAnalyticsCustomModule(ctx context.Context, ...) error
- func (c *Client) GetEffectiveEventThreatDetectionCustomModule(ctx context.Context, ...) (*securitycentermanagementpb.EffectiveEventThreatDetectionCustomModule, error)
- func (c *Client) GetEffectiveSecurityHealthAnalyticsCustomModule(ctx context.Context, ...) (*securitycentermanagementpb.EffectiveSecurityHealthAnalyticsCustomModule, ...)
- func (c *Client) GetEventThreatDetectionCustomModule(ctx context.Context, ...) (*securitycentermanagementpb.EventThreatDetectionCustomModule, error)
- func (c *Client) GetLocation(ctx context.Context, req *locationpb.GetLocationRequest, ...) (*locationpb.Location, error)
- func (c *Client) GetSecurityCenterService(ctx context.Context, ...) (*securitycentermanagementpb.SecurityCenterService, error)
- func (c *Client) GetSecurityHealthAnalyticsCustomModule(ctx context.Context, ...) (*securitycentermanagementpb.SecurityHealthAnalyticsCustomModule, error)
- func (c *Client) ListDescendantEventThreatDetectionCustomModules(ctx context.Context, ...) *EventThreatDetectionCustomModuleIterator
- func (c *Client) ListDescendantSecurityHealthAnalyticsCustomModules(ctx context.Context, ...) *SecurityHealthAnalyticsCustomModuleIterator
- func (c *Client) ListEffectiveEventThreatDetectionCustomModules(ctx context.Context, ...) *EffectiveEventThreatDetectionCustomModuleIterator
- func (c *Client) ListEffectiveSecurityHealthAnalyticsCustomModules(ctx context.Context, ...) *EffectiveSecurityHealthAnalyticsCustomModuleIterator
- func (c *Client) ListEventThreatDetectionCustomModules(ctx context.Context, ...) *EventThreatDetectionCustomModuleIterator
- func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *Client) ListSecurityCenterServices(ctx context.Context, ...) *SecurityCenterServiceIterator
- func (c *Client) ListSecurityHealthAnalyticsCustomModules(ctx context.Context, ...) *SecurityHealthAnalyticsCustomModuleIterator
- func (c *Client) SimulateSecurityHealthAnalyticsCustomModule(ctx context.Context, ...) (...)
- func (c *Client) UpdateEventThreatDetectionCustomModule(ctx context.Context, ...) (*securitycentermanagementpb.EventThreatDetectionCustomModule, error)
- func (c *Client) UpdateSecurityCenterService(ctx context.Context, ...) (*securitycentermanagementpb.SecurityCenterService, error)
- func (c *Client) UpdateSecurityHealthAnalyticsCustomModule(ctx context.Context, ...) (*securitycentermanagementpb.SecurityHealthAnalyticsCustomModule, error)
- func (c *Client) ValidateEventThreatDetectionCustomModule(ctx context.Context, ...) (*securitycentermanagementpb.ValidateEventThreatDetectionCustomModuleResponse, ...)
- type EffectiveEventThreatDetectionCustomModuleIterator
- func (it *EffectiveEventThreatDetectionCustomModuleIterator) All() ...
- func (it *EffectiveEventThreatDetectionCustomModuleIterator) Next() (*securitycentermanagementpb.EffectiveEventThreatDetectionCustomModule, error)
- func (it *EffectiveEventThreatDetectionCustomModuleIterator) PageInfo() *iterator.PageInfo
- type EffectiveSecurityHealthAnalyticsCustomModuleIterator
- func (it *EffectiveSecurityHealthAnalyticsCustomModuleIterator) All() ...
- func (it *EffectiveSecurityHealthAnalyticsCustomModuleIterator) Next() (*securitycentermanagementpb.EffectiveSecurityHealthAnalyticsCustomModule, ...)
- func (it *EffectiveSecurityHealthAnalyticsCustomModuleIterator) PageInfo() *iterator.PageInfo
- type EventThreatDetectionCustomModuleIterator
- func (it *EventThreatDetectionCustomModuleIterator) All() iter.Seq2[*securitycentermanagementpb.EventThreatDetectionCustomModule, error]
- func (it *EventThreatDetectionCustomModuleIterator) Next() (*securitycentermanagementpb.EventThreatDetectionCustomModule, error)
- func (it *EventThreatDetectionCustomModuleIterator) PageInfo() *iterator.PageInfo
- type LocationIterator
- type SecurityCenterServiceIterator
- type SecurityHealthAnalyticsCustomModuleIterator
Examples ¶
- Client.CreateEventThreatDetectionCustomModule
- Client.CreateSecurityHealthAnalyticsCustomModule
- Client.DeleteEventThreatDetectionCustomModule
- Client.DeleteSecurityHealthAnalyticsCustomModule
- Client.GetEffectiveEventThreatDetectionCustomModule
- Client.GetEffectiveSecurityHealthAnalyticsCustomModule
- Client.GetEventThreatDetectionCustomModule
- Client.GetLocation
- Client.GetSecurityCenterService
- Client.GetSecurityHealthAnalyticsCustomModule
- Client.ListDescendantEventThreatDetectionCustomModules
- Client.ListDescendantEventThreatDetectionCustomModules (All)
- Client.ListDescendantSecurityHealthAnalyticsCustomModules
- Client.ListDescendantSecurityHealthAnalyticsCustomModules (All)
- Client.ListEffectiveEventThreatDetectionCustomModules
- Client.ListEffectiveEventThreatDetectionCustomModules (All)
- Client.ListEffectiveSecurityHealthAnalyticsCustomModules
- Client.ListEffectiveSecurityHealthAnalyticsCustomModules (All)
- Client.ListEventThreatDetectionCustomModules
- Client.ListEventThreatDetectionCustomModules (All)
- Client.ListLocations
- Client.ListLocations (All)
- Client.ListSecurityCenterServices
- Client.ListSecurityCenterServices (All)
- Client.ListSecurityHealthAnalyticsCustomModules
- Client.ListSecurityHealthAnalyticsCustomModules (All)
- Client.SimulateSecurityHealthAnalyticsCustomModule
- Client.UpdateEventThreatDetectionCustomModule
- Client.UpdateSecurityCenterService
- Client.UpdateSecurityHealthAnalyticsCustomModule
- Client.ValidateEventThreatDetectionCustomModule
- NewClient
- NewRESTClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type 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.
type 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 Command 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
}
Output:
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
}
Output:
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 organization, folder, or project, and 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
}
Output:
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 organization, folder, or project, and also creates inherited SecurityHealthAnalyticsCustomModule resources for all folders and projects that are 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
}
Output:
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 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.
}
}
Output:
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 resource 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.
}
}
Output:
func (*Client) GetEffectiveEventThreatDetectionCustomModule ¶
func (c *Client) GetEffectiveEventThreatDetectionCustomModule(ctx context.Context, req *securitycentermanagementpb.GetEffectiveEventThreatDetectionCustomModuleRequest, opts ...gax.CallOption) (*securitycentermanagementpb.EffectiveEventThreatDetectionCustomModule, error)
GetEffectiveEventThreatDetectionCustomModule gets the effective Event Threat Detection custom module at the given level.
The difference between an EffectiveEventThreatDetectionCustomModule and an EventThreatDetectionCustomModule is that the fields for an EffectiveEventThreatDetectionCustomModule are computed from ancestors if needed. For example, the enablement state for an EventThreatDetectionCustomModule can be ENABLED, DISABLED, or INHERITED. In contrast, the enablement state for an EffectiveEventThreatDetectionCustomModule is always computed as ENABLED or DISABLED.
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
}
Output:
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
}
Output:
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
}
Output:
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
}
Output:
func (*Client) GetSecurityCenterService ¶ added in v0.2.0
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
}
Output:
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
}
Output:
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 for the given organization, folder, or project and its descendants.
Example ¶
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)
}
}
Output:
Example (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 and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) ListDescendantSecurityHealthAnalyticsCustomModules ¶
func (c *Client) ListDescendantSecurityHealthAnalyticsCustomModules(ctx context.Context, req *securitycentermanagementpb.ListDescendantSecurityHealthAnalyticsCustomModulesRequest, opts ...gax.CallOption) *SecurityHealthAnalyticsCustomModuleIterator
ListDescendantSecurityHealthAnalyticsCustomModules returns a list of all resident SecurityHealthAnalyticsCustomModule resources under the given organization, folder, or project and all of its descendants.
Example ¶
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)
}
}
Output:
Example (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 and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
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.
Example ¶
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)
}
}
Output:
Example (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 and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) ListEffectiveSecurityHealthAnalyticsCustomModules ¶
func (c *Client) ListEffectiveSecurityHealthAnalyticsCustomModules(ctx context.Context, req *securitycentermanagementpb.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest, opts ...gax.CallOption) *EffectiveSecurityHealthAnalyticsCustomModuleIterator
ListEffectiveSecurityHealthAnalyticsCustomModules returns a list of all EffectiveSecurityHealthAnalyticsCustomModule resources for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from ancestor organizations, folders, and projects (no descendants).
Example ¶
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)
}
}
Output:
Example (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 and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
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 organization, folder, or project. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.
Example ¶
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)
}
}
Output:
Example (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 and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
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.
Example ¶
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)
}
}
Output:
Example (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 and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) ListSecurityCenterServices ¶ added in v0.2.0
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.
Example ¶
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)
}
}
Output:
Example (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 and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) ListSecurityHealthAnalyticsCustomModules ¶
func (c *Client) ListSecurityHealthAnalyticsCustomModules(ctx context.Context, req *securitycentermanagementpb.ListSecurityHealthAnalyticsCustomModulesRequest, opts ...gax.CallOption) *SecurityHealthAnalyticsCustomModuleIterator
ListSecurityHealthAnalyticsCustomModules returns a list of all SecurityHealthAnalyticsCustomModule resources for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from ancestor organizations, folders, and projects (no descendants).
Example ¶
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)
}
}
Output:
Example (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 and break/return/continue. Iteration will stop after any error.
}
// TODO: Use resp.
_ = resp
}
}
Output:
func (*Client) SimulateSecurityHealthAnalyticsCustomModule ¶
func (c *Client) SimulateSecurityHealthAnalyticsCustomModule(ctx context.Context, req *securitycentermanagementpb.SimulateSecurityHealthAnalyticsCustomModuleRequest, opts ...gax.CallOption) (*securitycentermanagementpb.SimulateSecurityHealthAnalyticsCustomModuleResponse, error)
SimulateSecurityHealthAnalyticsCustomModule simulates the result of using a SecurityHealthAnalyticsCustomModule to check a 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
}
Output:
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
}
Output:
func (*Client) UpdateSecurityCenterService ¶ added in v0.2.0
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
}
Output:
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 configuration 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
}
Output:
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
}
Output:
type 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 ¶ added in v1.1.0
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.
type 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 ¶ added in v1.1.0
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.
type 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 ¶ added in v1.1.0
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.
type 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 ¶ added in v1.1.0
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.
type SecurityCenterServiceIterator ¶ added in v0.2.0
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 ¶ added in v1.1.0
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 ¶ added in v0.2.0
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 ¶ added in v0.2.0
func (it *SecurityCenterServiceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type 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 ¶ added in v1.1.0
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.