Documentation ¶
Overview ¶
Package securitycenter is an auto-generated package for the Security Command Center API.
Security Command Center API provides access to temporal views of assets and findings within an organization.
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 := securitycenter.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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.BatchCreateResourceValueConfigsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#BatchCreateResourceValueConfigsRequest. } resp, err := c.BatchCreateResourceValueConfigs(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 AttackPathIterator
- type BigQueryExportIterator
- type BulkMuteFindingsOperation
- func (op *BulkMuteFindingsOperation) Done() bool
- func (op *BulkMuteFindingsOperation) Metadata() (*emptypb.Empty, error)
- func (op *BulkMuteFindingsOperation) Name() string
- func (op *BulkMuteFindingsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*securitycenterpb.BulkMuteFindingsResponse, error)
- func (op *BulkMuteFindingsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*securitycenterpb.BulkMuteFindingsResponse, error)
- type CallOptions
- type Client
- func (c *Client) BatchCreateResourceValueConfigs(ctx context.Context, ...) (*securitycenterpb.BatchCreateResourceValueConfigsResponse, error)
- func (c *Client) BulkMuteFindings(ctx context.Context, req *securitycenterpb.BulkMuteFindingsRequest, ...) (*BulkMuteFindingsOperation, error)
- func (c *Client) BulkMuteFindingsOperation(name string) *BulkMuteFindingsOperation
- func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, ...) error
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) CreateBigQueryExport(ctx context.Context, req *securitycenterpb.CreateBigQueryExportRequest, ...) (*securitycenterpb.BigQueryExport, error)
- func (c *Client) CreateEventThreatDetectionCustomModule(ctx context.Context, ...) (*securitycenterpb.EventThreatDetectionCustomModule, error)
- func (c *Client) CreateFinding(ctx context.Context, req *securitycenterpb.CreateFindingRequest, ...) (*securitycenterpb.Finding, error)
- func (c *Client) CreateMuteConfig(ctx context.Context, req *securitycenterpb.CreateMuteConfigRequest, ...) (*securitycenterpb.MuteConfig, error)
- func (c *Client) CreateNotificationConfig(ctx context.Context, req *securitycenterpb.CreateNotificationConfigRequest, ...) (*securitycenterpb.NotificationConfig, error)
- func (c *Client) CreateSecurityHealthAnalyticsCustomModule(ctx context.Context, ...) (*securitycenterpb.SecurityHealthAnalyticsCustomModule, error)
- func (c *Client) CreateSource(ctx context.Context, req *securitycenterpb.CreateSourceRequest, ...) (*securitycenterpb.Source, error)
- func (c *Client) DeleteBigQueryExport(ctx context.Context, req *securitycenterpb.DeleteBigQueryExportRequest, ...) error
- func (c *Client) DeleteEventThreatDetectionCustomModule(ctx context.Context, ...) error
- func (c *Client) DeleteMuteConfig(ctx context.Context, req *securitycenterpb.DeleteMuteConfigRequest, ...) error
- func (c *Client) DeleteNotificationConfig(ctx context.Context, req *securitycenterpb.DeleteNotificationConfigRequest, ...) error
- func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, ...) error
- func (c *Client) DeleteResourceValueConfig(ctx context.Context, req *securitycenterpb.DeleteResourceValueConfigRequest, ...) error
- func (c *Client) DeleteSecurityHealthAnalyticsCustomModule(ctx context.Context, ...) error
- func (c *Client) GetBigQueryExport(ctx context.Context, req *securitycenterpb.GetBigQueryExportRequest, ...) (*securitycenterpb.BigQueryExport, error)
- func (c *Client) GetEffectiveEventThreatDetectionCustomModule(ctx context.Context, ...) (*securitycenterpb.EffectiveEventThreatDetectionCustomModule, error)
- func (c *Client) GetEffectiveSecurityHealthAnalyticsCustomModule(ctx context.Context, ...) (*securitycenterpb.EffectiveSecurityHealthAnalyticsCustomModule, error)
- func (c *Client) GetEventThreatDetectionCustomModule(ctx context.Context, ...) (*securitycenterpb.EventThreatDetectionCustomModule, error)
- func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *Client) GetMuteConfig(ctx context.Context, req *securitycenterpb.GetMuteConfigRequest, ...) (*securitycenterpb.MuteConfig, error)
- func (c *Client) GetNotificationConfig(ctx context.Context, req *securitycenterpb.GetNotificationConfigRequest, ...) (*securitycenterpb.NotificationConfig, error)
- func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *Client) GetOrganizationSettings(ctx context.Context, req *securitycenterpb.GetOrganizationSettingsRequest, ...) (*securitycenterpb.OrganizationSettings, error)
- func (c *Client) GetResourceValueConfig(ctx context.Context, req *securitycenterpb.GetResourceValueConfigRequest, ...) (*securitycenterpb.ResourceValueConfig, error)
- func (c *Client) GetSecurityHealthAnalyticsCustomModule(ctx context.Context, ...) (*securitycenterpb.SecurityHealthAnalyticsCustomModule, error)
- func (c *Client) GetSimulation(ctx context.Context, req *securitycenterpb.GetSimulationRequest, ...) (*securitycenterpb.Simulation, error)
- func (c *Client) GetSource(ctx context.Context, req *securitycenterpb.GetSourceRequest, ...) (*securitycenterpb.Source, error)
- func (c *Client) GetValuedResource(ctx context.Context, req *securitycenterpb.GetValuedResourceRequest, ...) (*securitycenterpb.ValuedResource, error)
- func (c *Client) GroupAssets(ctx context.Context, req *securitycenterpb.GroupAssetsRequest, ...) *GroupResultIteratordeprecated
- func (c *Client) GroupFindings(ctx context.Context, req *securitycenterpb.GroupFindingsRequest, ...) *GroupResultIterator
- func (c *Client) ListAssets(ctx context.Context, req *securitycenterpb.ListAssetsRequest, ...) *ListAssetsResponse_ListAssetsResultIteratordeprecated
- func (c *Client) ListAttackPaths(ctx context.Context, req *securitycenterpb.ListAttackPathsRequest, ...) *AttackPathIterator
- func (c *Client) ListBigQueryExports(ctx context.Context, req *securitycenterpb.ListBigQueryExportsRequest, ...) *BigQueryExportIterator
- 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) ListFindings(ctx context.Context, req *securitycenterpb.ListFindingsRequest, ...) *ListFindingsResponse_ListFindingsResultIterator
- func (c *Client) ListMuteConfigs(ctx context.Context, req *securitycenterpb.ListMuteConfigsRequest, ...) *MuteConfigIterator
- func (c *Client) ListNotificationConfigs(ctx context.Context, req *securitycenterpb.ListNotificationConfigsRequest, ...) *NotificationConfigIterator
- func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- func (c *Client) ListResourceValueConfigs(ctx context.Context, req *securitycenterpb.ListResourceValueConfigsRequest, ...) *ResourceValueConfigIterator
- func (c *Client) ListSecurityHealthAnalyticsCustomModules(ctx context.Context, ...) *SecurityHealthAnalyticsCustomModuleIterator
- func (c *Client) ListSources(ctx context.Context, req *securitycenterpb.ListSourcesRequest, ...) *SourceIterator
- func (c *Client) ListValuedResources(ctx context.Context, req *securitycenterpb.ListValuedResourcesRequest, ...) *ValuedResourceIterator
- func (c *Client) RunAssetDiscovery(ctx context.Context, req *securitycenterpb.RunAssetDiscoveryRequest, ...) (*RunAssetDiscoveryOperation, error)deprecated
- func (c *Client) RunAssetDiscoveryOperation(name string) *RunAssetDiscoveryOperation
- func (c *Client) SetFindingState(ctx context.Context, req *securitycenterpb.SetFindingStateRequest, ...) (*securitycenterpb.Finding, error)
- func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *Client) SetMute(ctx context.Context, req *securitycenterpb.SetMuteRequest, ...) (*securitycenterpb.Finding, error)
- func (c *Client) SimulateSecurityHealthAnalyticsCustomModule(ctx context.Context, ...) (*securitycenterpb.SimulateSecurityHealthAnalyticsCustomModuleResponse, error)
- func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, ...) (*iampb.TestIamPermissionsResponse, error)
- func (c *Client) UpdateBigQueryExport(ctx context.Context, req *securitycenterpb.UpdateBigQueryExportRequest, ...) (*securitycenterpb.BigQueryExport, error)
- func (c *Client) UpdateEventThreatDetectionCustomModule(ctx context.Context, ...) (*securitycenterpb.EventThreatDetectionCustomModule, error)
- func (c *Client) UpdateExternalSystem(ctx context.Context, req *securitycenterpb.UpdateExternalSystemRequest, ...) (*securitycenterpb.ExternalSystem, error)
- func (c *Client) UpdateFinding(ctx context.Context, req *securitycenterpb.UpdateFindingRequest, ...) (*securitycenterpb.Finding, error)
- func (c *Client) UpdateMuteConfig(ctx context.Context, req *securitycenterpb.UpdateMuteConfigRequest, ...) (*securitycenterpb.MuteConfig, error)
- func (c *Client) UpdateNotificationConfig(ctx context.Context, req *securitycenterpb.UpdateNotificationConfigRequest, ...) (*securitycenterpb.NotificationConfig, error)
- func (c *Client) UpdateOrganizationSettings(ctx context.Context, req *securitycenterpb.UpdateOrganizationSettingsRequest, ...) (*securitycenterpb.OrganizationSettings, error)
- func (c *Client) UpdateResourceValueConfig(ctx context.Context, req *securitycenterpb.UpdateResourceValueConfigRequest, ...) (*securitycenterpb.ResourceValueConfig, error)
- func (c *Client) UpdateSecurityHealthAnalyticsCustomModule(ctx context.Context, ...) (*securitycenterpb.SecurityHealthAnalyticsCustomModule, error)
- func (c *Client) UpdateSecurityMarks(ctx context.Context, req *securitycenterpb.UpdateSecurityMarksRequest, ...) (*securitycenterpb.SecurityMarks, error)
- func (c *Client) UpdateSource(ctx context.Context, req *securitycenterpb.UpdateSourceRequest, ...) (*securitycenterpb.Source, error)
- func (c *Client) ValidateEventThreatDetectionCustomModule(ctx context.Context, ...) (*securitycenterpb.ValidateEventThreatDetectionCustomModuleResponse, error)
- type EffectiveEventThreatDetectionCustomModuleIterator
- func (it *EffectiveEventThreatDetectionCustomModuleIterator) All() iter.Seq2[*securitycenterpb.EffectiveEventThreatDetectionCustomModule, error]
- func (it *EffectiveEventThreatDetectionCustomModuleIterator) Next() (*securitycenterpb.EffectiveEventThreatDetectionCustomModule, error)
- func (it *EffectiveEventThreatDetectionCustomModuleIterator) PageInfo() *iterator.PageInfo
- type EffectiveSecurityHealthAnalyticsCustomModuleIterator
- func (it *EffectiveSecurityHealthAnalyticsCustomModuleIterator) All() ...
- func (it *EffectiveSecurityHealthAnalyticsCustomModuleIterator) Next() (*securitycenterpb.EffectiveSecurityHealthAnalyticsCustomModule, error)
- func (it *EffectiveSecurityHealthAnalyticsCustomModuleIterator) PageInfo() *iterator.PageInfo
- type EventThreatDetectionCustomModuleIterator
- func (it *EventThreatDetectionCustomModuleIterator) All() iter.Seq2[*securitycenterpb.EventThreatDetectionCustomModule, error]
- func (it *EventThreatDetectionCustomModuleIterator) Next() (*securitycenterpb.EventThreatDetectionCustomModule, error)
- func (it *EventThreatDetectionCustomModuleIterator) PageInfo() *iterator.PageInfo
- type GroupResultIterator
- type ListAssetsResponse_ListAssetsResultIterator
- func (it *ListAssetsResponse_ListAssetsResultIterator) All() iter.Seq2[*securitycenterpb.ListAssetsResponse_ListAssetsResult, error]
- func (it *ListAssetsResponse_ListAssetsResultIterator) Next() (*securitycenterpb.ListAssetsResponse_ListAssetsResult, error)
- func (it *ListAssetsResponse_ListAssetsResultIterator) PageInfo() *iterator.PageInfo
- type ListFindingsResponse_ListFindingsResultIterator
- func (it *ListFindingsResponse_ListFindingsResultIterator) All() iter.Seq2[*securitycenterpb.ListFindingsResponse_ListFindingsResult, error]
- func (it *ListFindingsResponse_ListFindingsResultIterator) Next() (*securitycenterpb.ListFindingsResponse_ListFindingsResult, error)
- func (it *ListFindingsResponse_ListFindingsResultIterator) PageInfo() *iterator.PageInfo
- type MuteConfigIterator
- type NotificationConfigIterator
- type OperationIterator
- type ResourceValueConfigIterator
- type RunAssetDiscoveryOperation
- func (op *RunAssetDiscoveryOperation) Done() bool
- func (op *RunAssetDiscoveryOperation) Metadata() (*emptypb.Empty, error)
- func (op *RunAssetDiscoveryOperation) Name() string
- func (op *RunAssetDiscoveryOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*securitycenterpb.RunAssetDiscoveryResponse, error)
- func (op *RunAssetDiscoveryOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*securitycenterpb.RunAssetDiscoveryResponse, error)
- type SecurityHealthAnalyticsCustomModuleIterator
- func (it *SecurityHealthAnalyticsCustomModuleIterator) All() iter.Seq2[*securitycenterpb.SecurityHealthAnalyticsCustomModule, error]
- func (it *SecurityHealthAnalyticsCustomModuleIterator) Next() (*securitycenterpb.SecurityHealthAnalyticsCustomModule, error)
- func (it *SecurityHealthAnalyticsCustomModuleIterator) PageInfo() *iterator.PageInfo
- type SourceIterator
- type ValuedResourceIterator
Examples ¶
- Client.BatchCreateResourceValueConfigs
- Client.BulkMuteFindings
- Client.CancelOperation
- Client.CreateBigQueryExport
- Client.CreateEventThreatDetectionCustomModule
- Client.CreateFinding
- Client.CreateMuteConfig
- Client.CreateNotificationConfig
- Client.CreateSecurityHealthAnalyticsCustomModule
- Client.CreateSource
- Client.DeleteBigQueryExport
- Client.DeleteEventThreatDetectionCustomModule
- Client.DeleteMuteConfig
- Client.DeleteNotificationConfig
- Client.DeleteOperation
- Client.DeleteResourceValueConfig
- Client.DeleteSecurityHealthAnalyticsCustomModule
- Client.GetBigQueryExport
- Client.GetEffectiveEventThreatDetectionCustomModule
- Client.GetEffectiveSecurityHealthAnalyticsCustomModule
- Client.GetEventThreatDetectionCustomModule
- Client.GetIamPolicy
- Client.GetMuteConfig
- Client.GetNotificationConfig
- Client.GetOperation
- Client.GetOrganizationSettings
- Client.GetResourceValueConfig
- Client.GetSecurityHealthAnalyticsCustomModule
- Client.GetSimulation
- Client.GetSource
- Client.GetValuedResource
- Client.GroupAssets
- Client.GroupAssets (All)
- Client.GroupFindings
- Client.GroupFindings (All)
- Client.ListAssets
- Client.ListAssets (All)
- Client.ListAttackPaths
- Client.ListAttackPaths (All)
- Client.ListBigQueryExports
- Client.ListBigQueryExports (All)
- 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.ListFindings
- Client.ListFindings (All)
- Client.ListMuteConfigs
- Client.ListMuteConfigs (All)
- Client.ListNotificationConfigs
- Client.ListNotificationConfigs (All)
- Client.ListOperations
- Client.ListOperations (All)
- Client.ListResourceValueConfigs
- Client.ListResourceValueConfigs (All)
- Client.ListSecurityHealthAnalyticsCustomModules
- Client.ListSecurityHealthAnalyticsCustomModules (All)
- Client.ListSources
- Client.ListSources (All)
- Client.ListValuedResources
- Client.ListValuedResources (All)
- Client.RunAssetDiscovery
- Client.SetFindingState
- Client.SetIamPolicy
- Client.SetMute
- Client.SimulateSecurityHealthAnalyticsCustomModule
- Client.TestIamPermissions
- Client.UpdateBigQueryExport
- Client.UpdateEventThreatDetectionCustomModule
- Client.UpdateExternalSystem
- Client.UpdateFinding
- Client.UpdateMuteConfig
- Client.UpdateNotificationConfig
- Client.UpdateOrganizationSettings
- Client.UpdateResourceValueConfig
- Client.UpdateSecurityHealthAnalyticsCustomModule
- Client.UpdateSecurityMarks
- Client.UpdateSource
- 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 AttackPathIterator ¶ added in v1.33.0
type AttackPathIterator 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 []*securitycenterpb.AttackPath, nextPageToken string, err error) // contains filtered or unexported fields }
AttackPathIterator manages a stream of *securitycenterpb.AttackPath.
func (*AttackPathIterator) All ¶ added in v1.35.1
func (it *AttackPathIterator) All() iter.Seq2[*securitycenterpb.AttackPath, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*AttackPathIterator) Next ¶ added in v1.33.0
func (it *AttackPathIterator) Next() (*securitycenterpb.AttackPath, 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 (*AttackPathIterator) PageInfo ¶ added in v1.33.0
func (it *AttackPathIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type BigQueryExportIterator ¶ added in v1.5.0
type BigQueryExportIterator 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 []*securitycenterpb.BigQueryExport, nextPageToken string, err error) // contains filtered or unexported fields }
BigQueryExportIterator manages a stream of *securitycenterpb.BigQueryExport.
func (*BigQueryExportIterator) All ¶ added in v1.35.1
func (it *BigQueryExportIterator) All() iter.Seq2[*securitycenterpb.BigQueryExport, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*BigQueryExportIterator) Next ¶ added in v1.5.0
func (it *BigQueryExportIterator) Next() (*securitycenterpb.BigQueryExport, 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 (*BigQueryExportIterator) PageInfo ¶ added in v1.5.0
func (it *BigQueryExportIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type BulkMuteFindingsOperation ¶ added in v1.2.0
type BulkMuteFindingsOperation struct {
// contains filtered or unexported fields
}
BulkMuteFindingsOperation manages a long-running operation from BulkMuteFindings.
func (*BulkMuteFindingsOperation) Done ¶ added in v1.2.0
func (op *BulkMuteFindingsOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*BulkMuteFindingsOperation) Metadata ¶ added in v1.2.0
func (op *BulkMuteFindingsOperation) Metadata() (*emptypb.Empty, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*BulkMuteFindingsOperation) Name ¶ added in v1.2.0
func (op *BulkMuteFindingsOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*BulkMuteFindingsOperation) Poll ¶ added in v1.2.0
func (op *BulkMuteFindingsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*securitycenterpb.BulkMuteFindingsResponse, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*BulkMuteFindingsOperation) Wait ¶ added in v1.2.0
func (op *BulkMuteFindingsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*securitycenterpb.BulkMuteFindingsResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type CallOptions ¶
type CallOptions struct { BulkMuteFindings []gax.CallOption CreateSecurityHealthAnalyticsCustomModule []gax.CallOption CreateSource []gax.CallOption CreateFinding []gax.CallOption CreateMuteConfig []gax.CallOption CreateNotificationConfig []gax.CallOption DeleteMuteConfig []gax.CallOption DeleteNotificationConfig []gax.CallOption DeleteSecurityHealthAnalyticsCustomModule []gax.CallOption GetSimulation []gax.CallOption GetValuedResource []gax.CallOption GetBigQueryExport []gax.CallOption GetIamPolicy []gax.CallOption GetMuteConfig []gax.CallOption GetNotificationConfig []gax.CallOption GetOrganizationSettings []gax.CallOption GetEffectiveSecurityHealthAnalyticsCustomModule []gax.CallOption GetSecurityHealthAnalyticsCustomModule []gax.CallOption GetSource []gax.CallOption GroupAssets []gax.CallOption GroupFindings []gax.CallOption ListAssets []gax.CallOption ListDescendantSecurityHealthAnalyticsCustomModules []gax.CallOption ListFindings []gax.CallOption ListMuteConfigs []gax.CallOption ListNotificationConfigs []gax.CallOption ListEffectiveSecurityHealthAnalyticsCustomModules []gax.CallOption ListSecurityHealthAnalyticsCustomModules []gax.CallOption ListSources []gax.CallOption RunAssetDiscovery []gax.CallOption SetFindingState []gax.CallOption SetMute []gax.CallOption SetIamPolicy []gax.CallOption TestIamPermissions []gax.CallOption SimulateSecurityHealthAnalyticsCustomModule []gax.CallOption UpdateExternalSystem []gax.CallOption UpdateFinding []gax.CallOption UpdateMuteConfig []gax.CallOption UpdateNotificationConfig []gax.CallOption UpdateOrganizationSettings []gax.CallOption UpdateSecurityHealthAnalyticsCustomModule []gax.CallOption UpdateSource []gax.CallOption UpdateSecurityMarks []gax.CallOption CreateBigQueryExport []gax.CallOption DeleteBigQueryExport []gax.CallOption UpdateBigQueryExport []gax.CallOption ListBigQueryExports []gax.CallOption CreateEventThreatDetectionCustomModule []gax.CallOption DeleteEventThreatDetectionCustomModule []gax.CallOption GetEventThreatDetectionCustomModule []gax.CallOption ListDescendantEventThreatDetectionCustomModules []gax.CallOption ListEventThreatDetectionCustomModules []gax.CallOption UpdateEventThreatDetectionCustomModule []gax.CallOption ValidateEventThreatDetectionCustomModule []gax.CallOption GetEffectiveEventThreatDetectionCustomModule []gax.CallOption ListEffectiveEventThreatDetectionCustomModules []gax.CallOption BatchCreateResourceValueConfigs []gax.CallOption DeleteResourceValueConfig []gax.CallOption GetResourceValueConfig []gax.CallOption ListResourceValueConfigs []gax.CallOption UpdateResourceValueConfig []gax.CallOption ListValuedResources []gax.CallOption ListAttackPaths []gax.CallOption CancelOperation []gax.CallOption DeleteOperation []gax.CallOption GetOperation []gax.CallOption ListOperations []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 // LROClient is used internally to handle long-running operations. // It is exposed so that its CallOptions can be modified if required. // Users should not Close this client. LROClient *lroauto.OperationsClient // contains filtered or unexported fields }
Client is a client for interacting with Security Command Center API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
V1 APIs for Security Center service.
func NewClient ¶
NewClient creates a new security center client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
V1 APIs for Security Center service.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewRESTClient ¶ added in v1.18.0
NewRESTClient creates a new security center rest client.
V1 APIs for Security Center service.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/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 := securitycenter.NewRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*Client) BatchCreateResourceValueConfigs ¶ added in v1.33.0
func (c *Client) BatchCreateResourceValueConfigs(ctx context.Context, req *securitycenterpb.BatchCreateResourceValueConfigsRequest, opts ...gax.CallOption) (*securitycenterpb.BatchCreateResourceValueConfigsResponse, error)
BatchCreateResourceValueConfigs creates a ResourceValueConfig for an organization. Maps user’s tags to difference resource values for use by the attack path simulation.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.BatchCreateResourceValueConfigsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#BatchCreateResourceValueConfigsRequest. } resp, err := c.BatchCreateResourceValueConfigs(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) BulkMuteFindings ¶ added in v1.2.0
func (c *Client) BulkMuteFindings(ctx context.Context, req *securitycenterpb.BulkMuteFindingsRequest, opts ...gax.CallOption) (*BulkMuteFindingsOperation, error)
BulkMuteFindings kicks off an LRO to bulk mute findings for a parent based on a filter. The parent can be either an organization, folder or project. The findings matched by the filter will be muted after the LRO is done.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.BulkMuteFindingsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#BulkMuteFindingsRequest. } op, err := c.BulkMuteFindings(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) BulkMuteFindingsOperation ¶ added in v1.2.0
func (c *Client) BulkMuteFindingsOperation(name string) *BulkMuteFindingsOperation
BulkMuteFindingsOperation returns a new BulkMuteFindingsOperation from a given name. The name must be that of a previously created BulkMuteFindingsOperation, possibly from a different process.
func (*Client) CancelOperation ¶ added in v1.8.0
func (c *Client) CancelOperation(ctx context.Context, req *longrunningpb.CancelOperationRequest, opts ...gax.CallOption) error
CancelOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" securitycenter "cloud.google.com/go/securitycenter/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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.CancelOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest. } err = c.CancelOperation(ctx, req) if err != nil { // TODO: Handle error. } }
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) CreateBigQueryExport ¶ added in v1.5.0
func (c *Client) CreateBigQueryExport(ctx context.Context, req *securitycenterpb.CreateBigQueryExportRequest, opts ...gax.CallOption) (*securitycenterpb.BigQueryExport, error)
CreateBigQueryExport creates a BigQuery export.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.CreateBigQueryExportRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#CreateBigQueryExportRequest. } resp, err := c.CreateBigQueryExport(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateEventThreatDetectionCustomModule ¶ added in v1.33.0
func (c *Client) CreateEventThreatDetectionCustomModule(ctx context.Context, req *securitycenterpb.CreateEventThreatDetectionCustomModuleRequest, opts ...gax.CallOption) (*securitycenterpb.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" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.CreateEventThreatDetectionCustomModuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#CreateEventThreatDetectionCustomModuleRequest. } resp, err := c.CreateEventThreatDetectionCustomModule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateFinding ¶
func (c *Client) CreateFinding(ctx context.Context, req *securitycenterpb.CreateFindingRequest, opts ...gax.CallOption) (*securitycenterpb.Finding, error)
CreateFinding creates a finding. The corresponding source must exist for finding creation to succeed.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.CreateFindingRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#CreateFindingRequest. } resp, err := c.CreateFinding(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateMuteConfig ¶ added in v1.2.0
func (c *Client) CreateMuteConfig(ctx context.Context, req *securitycenterpb.CreateMuteConfigRequest, opts ...gax.CallOption) (*securitycenterpb.MuteConfig, error)
CreateMuteConfig creates a mute config.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.CreateMuteConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#CreateMuteConfigRequest. } resp, err := c.CreateMuteConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateNotificationConfig ¶
func (c *Client) CreateNotificationConfig(ctx context.Context, req *securitycenterpb.CreateNotificationConfigRequest, opts ...gax.CallOption) (*securitycenterpb.NotificationConfig, error)
CreateNotificationConfig creates a notification config.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.CreateNotificationConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#CreateNotificationConfigRequest. } resp, err := c.CreateNotificationConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateSecurityHealthAnalyticsCustomModule ¶ added in v1.20.0
func (c *Client) CreateSecurityHealthAnalyticsCustomModule(ctx context.Context, req *securitycenterpb.CreateSecurityHealthAnalyticsCustomModuleRequest, opts ...gax.CallOption) (*securitycenterpb.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" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.CreateSecurityHealthAnalyticsCustomModuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#CreateSecurityHealthAnalyticsCustomModuleRequest. } resp, err := c.CreateSecurityHealthAnalyticsCustomModule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateSource ¶
func (c *Client) CreateSource(ctx context.Context, req *securitycenterpb.CreateSourceRequest, opts ...gax.CallOption) (*securitycenterpb.Source, error)
CreateSource creates a source.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.CreateSourceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#CreateSourceRequest. } resp, err := c.CreateSource(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) DeleteBigQueryExport ¶ added in v1.5.0
func (c *Client) DeleteBigQueryExport(ctx context.Context, req *securitycenterpb.DeleteBigQueryExportRequest, opts ...gax.CallOption) error
DeleteBigQueryExport deletes an existing BigQuery export.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.DeleteBigQueryExportRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#DeleteBigQueryExportRequest. } err = c.DeleteBigQueryExport(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteEventThreatDetectionCustomModule ¶ added in v1.33.0
func (c *Client) DeleteEventThreatDetectionCustomModule(ctx context.Context, req *securitycenterpb.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" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.DeleteEventThreatDetectionCustomModuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#DeleteEventThreatDetectionCustomModuleRequest. } err = c.DeleteEventThreatDetectionCustomModule(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteMuteConfig ¶ added in v1.2.0
func (c *Client) DeleteMuteConfig(ctx context.Context, req *securitycenterpb.DeleteMuteConfigRequest, opts ...gax.CallOption) error
DeleteMuteConfig deletes an existing mute config.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.DeleteMuteConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#DeleteMuteConfigRequest. } err = c.DeleteMuteConfig(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteNotificationConfig ¶
func (c *Client) DeleteNotificationConfig(ctx context.Context, req *securitycenterpb.DeleteNotificationConfigRequest, opts ...gax.CallOption) error
DeleteNotificationConfig deletes a notification config.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.DeleteNotificationConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#DeleteNotificationConfigRequest. } err = c.DeleteNotificationConfig(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteOperation ¶ added in v1.8.0
func (c *Client) DeleteOperation(ctx context.Context, req *longrunningpb.DeleteOperationRequest, opts ...gax.CallOption) error
DeleteOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" securitycenter "cloud.google.com/go/securitycenter/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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.DeleteOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest. } err = c.DeleteOperation(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteResourceValueConfig ¶ added in v1.33.0
func (c *Client) DeleteResourceValueConfig(ctx context.Context, req *securitycenterpb.DeleteResourceValueConfigRequest, opts ...gax.CallOption) error
DeleteResourceValueConfig deletes a ResourceValueConfig.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.DeleteResourceValueConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#DeleteResourceValueConfigRequest. } err = c.DeleteResourceValueConfig(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteSecurityHealthAnalyticsCustomModule ¶ added in v1.20.0
func (c *Client) DeleteSecurityHealthAnalyticsCustomModule(ctx context.Context, req *securitycenterpb.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" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.DeleteSecurityHealthAnalyticsCustomModuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#DeleteSecurityHealthAnalyticsCustomModuleRequest. } err = c.DeleteSecurityHealthAnalyticsCustomModule(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) GetBigQueryExport ¶ added in v1.5.0
func (c *Client) GetBigQueryExport(ctx context.Context, req *securitycenterpb.GetBigQueryExportRequest, opts ...gax.CallOption) (*securitycenterpb.BigQueryExport, error)
GetBigQueryExport gets a BigQuery export.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GetBigQueryExportRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GetBigQueryExportRequest. } resp, err := c.GetBigQueryExport(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetEffectiveEventThreatDetectionCustomModule ¶ added in v1.33.0
func (c *Client) GetEffectiveEventThreatDetectionCustomModule(ctx context.Context, req *securitycenterpb.GetEffectiveEventThreatDetectionCustomModuleRequest, opts ...gax.CallOption) (*securitycenterpb.EffectiveEventThreatDetectionCustomModule, error)
GetEffectiveEventThreatDetectionCustomModule gets an effective Event Threat Detection custom module at the given level.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GetEffectiveEventThreatDetectionCustomModuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GetEffectiveEventThreatDetectionCustomModuleRequest. } resp, err := c.GetEffectiveEventThreatDetectionCustomModule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetEffectiveSecurityHealthAnalyticsCustomModule ¶ added in v1.20.0
func (c *Client) GetEffectiveSecurityHealthAnalyticsCustomModule(ctx context.Context, req *securitycenterpb.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest, opts ...gax.CallOption) (*securitycenterpb.EffectiveSecurityHealthAnalyticsCustomModule, error)
GetEffectiveSecurityHealthAnalyticsCustomModule retrieves an EffectiveSecurityHealthAnalyticsCustomModule.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GetEffectiveSecurityHealthAnalyticsCustomModuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GetEffectiveSecurityHealthAnalyticsCustomModuleRequest. } resp, err := c.GetEffectiveSecurityHealthAnalyticsCustomModule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetEventThreatDetectionCustomModule ¶ added in v1.33.0
func (c *Client) GetEventThreatDetectionCustomModule(ctx context.Context, req *securitycenterpb.GetEventThreatDetectionCustomModuleRequest, opts ...gax.CallOption) (*securitycenterpb.EventThreatDetectionCustomModule, error)
GetEventThreatDetectionCustomModule gets an Event Threat Detection custom module.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GetEventThreatDetectionCustomModuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GetEventThreatDetectionCustomModuleRequest. } resp, err := c.GetEventThreatDetectionCustomModule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetIamPolicy ¶
func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy on the specified Source.
Example ¶
package main import ( "context" iampb "cloud.google.com/go/iam/apiv1/iampb" securitycenter "cloud.google.com/go/securitycenter/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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iampb.GetIamPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#GetIamPolicyRequest. } resp, err := c.GetIamPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetMuteConfig ¶ added in v1.2.0
func (c *Client) GetMuteConfig(ctx context.Context, req *securitycenterpb.GetMuteConfigRequest, opts ...gax.CallOption) (*securitycenterpb.MuteConfig, error)
GetMuteConfig gets a mute config.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GetMuteConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GetMuteConfigRequest. } resp, err := c.GetMuteConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetNotificationConfig ¶
func (c *Client) GetNotificationConfig(ctx context.Context, req *securitycenterpb.GetNotificationConfigRequest, opts ...gax.CallOption) (*securitycenterpb.NotificationConfig, error)
GetNotificationConfig gets a notification config.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GetNotificationConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GetNotificationConfigRequest. } resp, err := c.GetNotificationConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetOperation ¶ added in v1.8.0
func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" securitycenter "cloud.google.com/go/securitycenter/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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.GetOperationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest. } resp, err := c.GetOperation(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetOrganizationSettings ¶
func (c *Client) GetOrganizationSettings(ctx context.Context, req *securitycenterpb.GetOrganizationSettingsRequest, opts ...gax.CallOption) (*securitycenterpb.OrganizationSettings, error)
GetOrganizationSettings gets the settings for an organization.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GetOrganizationSettingsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GetOrganizationSettingsRequest. } resp, err := c.GetOrganizationSettings(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetResourceValueConfig ¶ added in v1.33.0
func (c *Client) GetResourceValueConfig(ctx context.Context, req *securitycenterpb.GetResourceValueConfigRequest, opts ...gax.CallOption) (*securitycenterpb.ResourceValueConfig, error)
GetResourceValueConfig gets a ResourceValueConfig.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GetResourceValueConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GetResourceValueConfigRequest. } resp, err := c.GetResourceValueConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetSecurityHealthAnalyticsCustomModule ¶ added in v1.20.0
func (c *Client) GetSecurityHealthAnalyticsCustomModule(ctx context.Context, req *securitycenterpb.GetSecurityHealthAnalyticsCustomModuleRequest, opts ...gax.CallOption) (*securitycenterpb.SecurityHealthAnalyticsCustomModule, error)
GetSecurityHealthAnalyticsCustomModule retrieves a SecurityHealthAnalyticsCustomModule.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GetSecurityHealthAnalyticsCustomModuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GetSecurityHealthAnalyticsCustomModuleRequest. } resp, err := c.GetSecurityHealthAnalyticsCustomModule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetSimulation ¶ added in v1.33.0
func (c *Client) GetSimulation(ctx context.Context, req *securitycenterpb.GetSimulationRequest, opts ...gax.CallOption) (*securitycenterpb.Simulation, error)
GetSimulation get the simulation by name or the latest simulation for the given organization.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GetSimulationRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GetSimulationRequest. } resp, err := c.GetSimulation(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetSource ¶
func (c *Client) GetSource(ctx context.Context, req *securitycenterpb.GetSourceRequest, opts ...gax.CallOption) (*securitycenterpb.Source, error)
GetSource gets a source.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GetSourceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GetSourceRequest. } resp, err := c.GetSource(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetValuedResource ¶ added in v1.33.0
func (c *Client) GetValuedResource(ctx context.Context, req *securitycenterpb.GetValuedResourceRequest, opts ...gax.CallOption) (*securitycenterpb.ValuedResource, error)
GetValuedResource get the valued resource by name
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GetValuedResourceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GetValuedResourceRequest. } resp, err := c.GetValuedResource(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GroupAssets
deprecated
func (c *Client) GroupAssets(ctx context.Context, req *securitycenterpb.GroupAssetsRequest, opts ...gax.CallOption) *GroupResultIterator
GroupAssets filters an organization’s assets and groups them by their specified properties.
Deprecated: GroupAssets may be removed in a future version.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GroupAssetsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GroupAssetsRequest. } it := c.GroupAssets(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.(*securitycenterpb.GroupAssetsResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GroupAssetsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GroupAssetsRequest. } for resp, err := range c.GroupAssets(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) GroupFindings ¶
func (c *Client) GroupFindings(ctx context.Context, req *securitycenterpb.GroupFindingsRequest, opts ...gax.CallOption) *GroupResultIterator
GroupFindings filters an organization or source’s findings and groups them by their specified properties.
To group across all sources provide a - as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings, /v1/folders/{folder_id}/sources/-/findings, /v1/projects/{project_id}/sources/-/findings
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GroupFindingsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GroupFindingsRequest. } it := c.GroupFindings(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.(*securitycenterpb.GroupFindingsResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.GroupFindingsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#GroupFindingsRequest. } for resp, err := range c.GroupFindings(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListAssets
deprecated
func (c *Client) ListAssets(ctx context.Context, req *securitycenterpb.ListAssetsRequest, opts ...gax.CallOption) *ListAssetsResponse_ListAssetsResultIterator
ListAssets lists an organization’s assets.
Deprecated: ListAssets may be removed in a future version.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListAssetsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListAssetsRequest. } it := c.ListAssets(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.(*securitycenterpb.ListAssetsResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListAssetsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListAssetsRequest. } for resp, err := range c.ListAssets(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListAttackPaths ¶ added in v1.33.0
func (c *Client) ListAttackPaths(ctx context.Context, req *securitycenterpb.ListAttackPathsRequest, opts ...gax.CallOption) *AttackPathIterator
ListAttackPaths lists the attack paths for a set of simulation results or valued resources and filter.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListAttackPathsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListAttackPathsRequest. } it := c.ListAttackPaths(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.(*securitycenterpb.ListAttackPathsResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListAttackPathsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListAttackPathsRequest. } for resp, err := range c.ListAttackPaths(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListBigQueryExports ¶ added in v1.5.0
func (c *Client) ListBigQueryExports(ctx context.Context, req *securitycenterpb.ListBigQueryExportsRequest, opts ...gax.CallOption) *BigQueryExportIterator
ListBigQueryExports lists BigQuery exports. Note that when requesting BigQuery exports at a given level all exports under that level are also returned e.g. if requesting BigQuery exports under a folder, then all BigQuery exports immediately under the folder plus the ones created under the projects within the folder are returned.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListBigQueryExportsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListBigQueryExportsRequest. } it := c.ListBigQueryExports(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.(*securitycenterpb.ListBigQueryExportsResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListBigQueryExportsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListBigQueryExportsRequest. } for resp, err := range c.ListBigQueryExports(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListDescendantEventThreatDetectionCustomModules ¶ added in v1.33.0
func (c *Client) ListDescendantEventThreatDetectionCustomModules(ctx context.Context, req *securitycenterpb.ListDescendantEventThreatDetectionCustomModulesRequest, opts ...gax.CallOption) *EventThreatDetectionCustomModuleIterator
ListDescendantEventThreatDetectionCustomModules lists all resident Event Threat Detection custom modules under the given Resource Manager parent and its descendants.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListDescendantEventThreatDetectionCustomModulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#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.(*securitycenterpb.ListDescendantEventThreatDetectionCustomModulesResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListDescendantEventThreatDetectionCustomModulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListDescendantEventThreatDetectionCustomModulesRequest. } for resp, err := range c.ListDescendantEventThreatDetectionCustomModules(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListDescendantSecurityHealthAnalyticsCustomModules ¶ added in v1.20.0
func (c *Client) ListDescendantSecurityHealthAnalyticsCustomModules(ctx context.Context, req *securitycenterpb.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.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListDescendantSecurityHealthAnalyticsCustomModulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#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.(*securitycenterpb.ListDescendantSecurityHealthAnalyticsCustomModulesResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListDescendantSecurityHealthAnalyticsCustomModulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListDescendantSecurityHealthAnalyticsCustomModulesRequest. } for resp, err := range c.ListDescendantSecurityHealthAnalyticsCustomModules(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListEffectiveEventThreatDetectionCustomModules ¶ added in v1.33.0
func (c *Client) ListEffectiveEventThreatDetectionCustomModules(ctx context.Context, req *securitycenterpb.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" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListEffectiveEventThreatDetectionCustomModulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#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.(*securitycenterpb.ListEffectiveEventThreatDetectionCustomModulesResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListEffectiveEventThreatDetectionCustomModulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListEffectiveEventThreatDetectionCustomModulesRequest. } for resp, err := range c.ListEffectiveEventThreatDetectionCustomModules(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListEffectiveSecurityHealthAnalyticsCustomModules ¶ added in v1.20.0
func (c *Client) ListEffectiveSecurityHealthAnalyticsCustomModules(ctx context.Context, req *securitycenterpb.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.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#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.(*securitycenterpb.ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListEffectiveSecurityHealthAnalyticsCustomModulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListEffectiveSecurityHealthAnalyticsCustomModulesRequest. } for resp, err := range c.ListEffectiveSecurityHealthAnalyticsCustomModules(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListEventThreatDetectionCustomModules ¶ added in v1.33.0
func (c *Client) ListEventThreatDetectionCustomModules(ctx context.Context, req *securitycenterpb.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.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListEventThreatDetectionCustomModulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#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.(*securitycenterpb.ListEventThreatDetectionCustomModulesResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListEventThreatDetectionCustomModulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListEventThreatDetectionCustomModulesRequest. } for resp, err := range c.ListEventThreatDetectionCustomModules(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListFindings ¶
func (c *Client) ListFindings(ctx context.Context, req *securitycenterpb.ListFindingsRequest, opts ...gax.CallOption) *ListFindingsResponse_ListFindingsResultIterator
ListFindings lists an organization or source’s findings.
To list across all sources provide a - as the source id. Example: /v1/organizations/{organization_id}/sources/-/findings
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListFindingsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListFindingsRequest. } it := c.ListFindings(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.(*securitycenterpb.ListFindingsResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListFindingsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListFindingsRequest. } for resp, err := range c.ListFindings(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListMuteConfigs ¶ added in v1.2.0
func (c *Client) ListMuteConfigs(ctx context.Context, req *securitycenterpb.ListMuteConfigsRequest, opts ...gax.CallOption) *MuteConfigIterator
ListMuteConfigs lists mute configs.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListMuteConfigsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListMuteConfigsRequest. } it := c.ListMuteConfigs(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.(*securitycenterpb.ListMuteConfigsResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListMuteConfigsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListMuteConfigsRequest. } for resp, err := range c.ListMuteConfigs(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListNotificationConfigs ¶
func (c *Client) ListNotificationConfigs(ctx context.Context, req *securitycenterpb.ListNotificationConfigsRequest, opts ...gax.CallOption) *NotificationConfigIterator
ListNotificationConfigs lists notification configs.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListNotificationConfigsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListNotificationConfigsRequest. } it := c.ListNotificationConfigs(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.(*securitycenterpb.ListNotificationConfigsResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListNotificationConfigsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListNotificationConfigsRequest. } for resp, err := range c.ListNotificationConfigs(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListOperations ¶ added in v1.8.0
func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" securitycenter "cloud.google.com/go/securitycenter/apiv1" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } it := c.ListOperations(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp // If you need to access the underlying RPC response, // you can do so by casting the `Response` as below. // Otherwise, remove this line. Only populated after // first call to Next(). Not safe for concurrent access. _ = it.Response.(*longrunningpb.ListOperationsResponse) } }
Output:
Example (All) ¶
package main import ( "context" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" securitycenter "cloud.google.com/go/securitycenter/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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } for resp, err := range c.ListOperations(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListResourceValueConfigs ¶ added in v1.33.0
func (c *Client) ListResourceValueConfigs(ctx context.Context, req *securitycenterpb.ListResourceValueConfigsRequest, opts ...gax.CallOption) *ResourceValueConfigIterator
ListResourceValueConfigs lists all ResourceValueConfigs.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListResourceValueConfigsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListResourceValueConfigsRequest. } it := c.ListResourceValueConfigs(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.(*securitycenterpb.ListResourceValueConfigsResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListResourceValueConfigsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListResourceValueConfigsRequest. } for resp, err := range c.ListResourceValueConfigs(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListSecurityHealthAnalyticsCustomModules ¶ added in v1.20.0
func (c *Client) ListSecurityHealthAnalyticsCustomModules(ctx context.Context, req *securitycenterpb.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.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListSecurityHealthAnalyticsCustomModulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#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.(*securitycenterpb.ListSecurityHealthAnalyticsCustomModulesResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListSecurityHealthAnalyticsCustomModulesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListSecurityHealthAnalyticsCustomModulesRequest. } for resp, err := range c.ListSecurityHealthAnalyticsCustomModules(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListSources ¶
func (c *Client) ListSources(ctx context.Context, req *securitycenterpb.ListSourcesRequest, opts ...gax.CallOption) *SourceIterator
ListSources lists all sources belonging to an organization.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListSourcesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListSourcesRequest. } it := c.ListSources(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.(*securitycenterpb.ListSourcesResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListSourcesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListSourcesRequest. } for resp, err := range c.ListSources(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListValuedResources ¶ added in v1.33.0
func (c *Client) ListValuedResources(ctx context.Context, req *securitycenterpb.ListValuedResourcesRequest, opts ...gax.CallOption) *ValuedResourceIterator
ListValuedResources lists the valued resources for a set of simulation results and filter.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" "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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListValuedResourcesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListValuedResourcesRequest. } it := c.ListValuedResources(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.(*securitycenterpb.ListValuedResourcesResponse) } }
Output:
Example (All) ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ListValuedResourcesRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ListValuedResourcesRequest. } for resp, err := range c.ListValuedResources(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) RunAssetDiscovery
deprecated
func (c *Client) RunAssetDiscovery(ctx context.Context, req *securitycenterpb.RunAssetDiscoveryRequest, opts ...gax.CallOption) (*RunAssetDiscoveryOperation, error)
RunAssetDiscovery runs asset discovery. The discovery is tracked with a long-running operation.
This API can only be called with limited frequency for an organization. If it is called too frequently the caller will receive a TOO_MANY_REQUESTS error.
Deprecated: RunAssetDiscovery may be removed in a future version.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.RunAssetDiscoveryRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#RunAssetDiscoveryRequest. } op, err := c.RunAssetDiscovery(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) RunAssetDiscoveryOperation ¶
func (c *Client) RunAssetDiscoveryOperation(name string) *RunAssetDiscoveryOperation
RunAssetDiscoveryOperation returns a new RunAssetDiscoveryOperation from a given name. The name must be that of a previously created RunAssetDiscoveryOperation, possibly from a different process.
func (*Client) SetFindingState ¶
func (c *Client) SetFindingState(ctx context.Context, req *securitycenterpb.SetFindingStateRequest, opts ...gax.CallOption) (*securitycenterpb.Finding, error)
SetFindingState updates the state of a finding.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.SetFindingStateRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#SetFindingStateRequest. } resp, err := c.SetFindingState(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) SetIamPolicy ¶
func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy on the specified Source.
Example ¶
package main import ( "context" iampb "cloud.google.com/go/iam/apiv1/iampb" securitycenter "cloud.google.com/go/securitycenter/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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iampb.SetIamPolicyRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#SetIamPolicyRequest. } resp, err := c.SetIamPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) SetMute ¶ added in v1.2.0
func (c *Client) SetMute(ctx context.Context, req *securitycenterpb.SetMuteRequest, opts ...gax.CallOption) (*securitycenterpb.Finding, error)
SetMute updates the mute state of a finding.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.SetMuteRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#SetMuteRequest. } resp, err := c.SetMute(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) SimulateSecurityHealthAnalyticsCustomModule ¶ added in v1.24.0
func (c *Client) SimulateSecurityHealthAnalyticsCustomModule(ctx context.Context, req *securitycenterpb.SimulateSecurityHealthAnalyticsCustomModuleRequest, opts ...gax.CallOption) (*securitycenterpb.SimulateSecurityHealthAnalyticsCustomModuleResponse, error)
SimulateSecurityHealthAnalyticsCustomModule simulates a given SecurityHealthAnalyticsCustomModule and Resource.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.SimulateSecurityHealthAnalyticsCustomModuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#SimulateSecurityHealthAnalyticsCustomModuleRequest. } resp, err := c.SimulateSecurityHealthAnalyticsCustomModule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) TestIamPermissions ¶
func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns the permissions that a caller has on the specified source.
Example ¶
package main import ( "context" iampb "cloud.google.com/go/iam/apiv1/iampb" securitycenter "cloud.google.com/go/securitycenter/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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &iampb.TestIamPermissionsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/iam/apiv1/iampb#TestIamPermissionsRequest. } resp, err := c.TestIamPermissions(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateBigQueryExport ¶ added in v1.5.0
func (c *Client) UpdateBigQueryExport(ctx context.Context, req *securitycenterpb.UpdateBigQueryExportRequest, opts ...gax.CallOption) (*securitycenterpb.BigQueryExport, error)
UpdateBigQueryExport updates a BigQuery export.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.UpdateBigQueryExportRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#UpdateBigQueryExportRequest. } resp, err := c.UpdateBigQueryExport(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateEventThreatDetectionCustomModule ¶ added in v1.33.0
func (c *Client) UpdateEventThreatDetectionCustomModule(ctx context.Context, req *securitycenterpb.UpdateEventThreatDetectionCustomModuleRequest, opts ...gax.CallOption) (*securitycenterpb.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" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.UpdateEventThreatDetectionCustomModuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#UpdateEventThreatDetectionCustomModuleRequest. } resp, err := c.UpdateEventThreatDetectionCustomModule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateExternalSystem ¶ added in v1.2.0
func (c *Client) UpdateExternalSystem(ctx context.Context, req *securitycenterpb.UpdateExternalSystemRequest, opts ...gax.CallOption) (*securitycenterpb.ExternalSystem, error)
UpdateExternalSystem updates external system. This is for a given finding.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.UpdateExternalSystemRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#UpdateExternalSystemRequest. } resp, err := c.UpdateExternalSystem(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateFinding ¶
func (c *Client) UpdateFinding(ctx context.Context, req *securitycenterpb.UpdateFindingRequest, opts ...gax.CallOption) (*securitycenterpb.Finding, error)
UpdateFinding creates or updates a finding. The corresponding source must exist for a finding creation to succeed.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.UpdateFindingRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#UpdateFindingRequest. } resp, err := c.UpdateFinding(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateMuteConfig ¶ added in v1.2.0
func (c *Client) UpdateMuteConfig(ctx context.Context, req *securitycenterpb.UpdateMuteConfigRequest, opts ...gax.CallOption) (*securitycenterpb.MuteConfig, error)
UpdateMuteConfig updates a mute config.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.UpdateMuteConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#UpdateMuteConfigRequest. } resp, err := c.UpdateMuteConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateNotificationConfig ¶
func (c *Client) UpdateNotificationConfig(ctx context.Context, req *securitycenterpb.UpdateNotificationConfigRequest, opts ...gax.CallOption) (*securitycenterpb.NotificationConfig, error)
UpdateNotificationConfig updates a notification config. The following update fields are allowed: description, pubsub_topic, streaming_config.filter
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.UpdateNotificationConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#UpdateNotificationConfigRequest. } resp, err := c.UpdateNotificationConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateOrganizationSettings ¶
func (c *Client) UpdateOrganizationSettings(ctx context.Context, req *securitycenterpb.UpdateOrganizationSettingsRequest, opts ...gax.CallOption) (*securitycenterpb.OrganizationSettings, error)
UpdateOrganizationSettings updates an organization’s settings.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.UpdateOrganizationSettingsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#UpdateOrganizationSettingsRequest. } resp, err := c.UpdateOrganizationSettings(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateResourceValueConfig ¶ added in v1.33.0
func (c *Client) UpdateResourceValueConfig(ctx context.Context, req *securitycenterpb.UpdateResourceValueConfigRequest, opts ...gax.CallOption) (*securitycenterpb.ResourceValueConfig, error)
UpdateResourceValueConfig updates an existing ResourceValueConfigs with new rules.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.UpdateResourceValueConfigRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#UpdateResourceValueConfigRequest. } resp, err := c.UpdateResourceValueConfig(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateSecurityHealthAnalyticsCustomModule ¶ added in v1.20.0
func (c *Client) UpdateSecurityHealthAnalyticsCustomModule(ctx context.Context, req *securitycenterpb.UpdateSecurityHealthAnalyticsCustomModuleRequest, opts ...gax.CallOption) (*securitycenterpb.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" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.UpdateSecurityHealthAnalyticsCustomModuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#UpdateSecurityHealthAnalyticsCustomModuleRequest. } resp, err := c.UpdateSecurityHealthAnalyticsCustomModule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateSecurityMarks ¶
func (c *Client) UpdateSecurityMarks(ctx context.Context, req *securitycenterpb.UpdateSecurityMarksRequest, opts ...gax.CallOption) (*securitycenterpb.SecurityMarks, error)
UpdateSecurityMarks updates security marks.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.UpdateSecurityMarksRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#UpdateSecurityMarksRequest. } resp, err := c.UpdateSecurityMarks(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateSource ¶
func (c *Client) UpdateSource(ctx context.Context, req *securitycenterpb.UpdateSourceRequest, opts ...gax.CallOption) (*securitycenterpb.Source, error)
UpdateSource updates a source.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.UpdateSourceRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#UpdateSourceRequest. } resp, err := c.UpdateSource(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ValidateEventThreatDetectionCustomModule ¶ added in v1.33.0
func (c *Client) ValidateEventThreatDetectionCustomModule(ctx context.Context, req *securitycenterpb.ValidateEventThreatDetectionCustomModuleRequest, opts ...gax.CallOption) (*securitycenterpb.ValidateEventThreatDetectionCustomModuleResponse, error)
ValidateEventThreatDetectionCustomModule validates the given Event Threat Detection custom module.
Example ¶
package main import ( "context" securitycenter "cloud.google.com/go/securitycenter/apiv1" securitycenterpb "cloud.google.com/go/securitycenter/apiv1/securitycenterpb" ) 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 := securitycenter.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &securitycenterpb.ValidateEventThreatDetectionCustomModuleRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1/securitycenterpb#ValidateEventThreatDetectionCustomModuleRequest. } resp, err := c.ValidateEventThreatDetectionCustomModule(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type EffectiveEventThreatDetectionCustomModuleIterator ¶ added in v1.33.0
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 []*securitycenterpb.EffectiveEventThreatDetectionCustomModule, nextPageToken string, err error) // contains filtered or unexported fields }
EffectiveEventThreatDetectionCustomModuleIterator manages a stream of *securitycenterpb.EffectiveEventThreatDetectionCustomModule.
func (*EffectiveEventThreatDetectionCustomModuleIterator) All ¶ added in v1.35.1
func (it *EffectiveEventThreatDetectionCustomModuleIterator) All() iter.Seq2[*securitycenterpb.EffectiveEventThreatDetectionCustomModule, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EffectiveEventThreatDetectionCustomModuleIterator) Next ¶ added in v1.33.0
func (it *EffectiveEventThreatDetectionCustomModuleIterator) Next() (*securitycenterpb.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 ¶ added in v1.33.0
func (it *EffectiveEventThreatDetectionCustomModuleIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type EffectiveSecurityHealthAnalyticsCustomModuleIterator ¶ added in v1.20.0
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 []*securitycenterpb.EffectiveSecurityHealthAnalyticsCustomModule, nextPageToken string, err error) // contains filtered or unexported fields }
EffectiveSecurityHealthAnalyticsCustomModuleIterator manages a stream of *securitycenterpb.EffectiveSecurityHealthAnalyticsCustomModule.
func (*EffectiveSecurityHealthAnalyticsCustomModuleIterator) All ¶ added in v1.35.1
func (it *EffectiveSecurityHealthAnalyticsCustomModuleIterator) All() iter.Seq2[*securitycenterpb.EffectiveSecurityHealthAnalyticsCustomModule, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EffectiveSecurityHealthAnalyticsCustomModuleIterator) Next ¶ added in v1.20.0
func (it *EffectiveSecurityHealthAnalyticsCustomModuleIterator) Next() (*securitycenterpb.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 ¶ added in v1.20.0
func (it *EffectiveSecurityHealthAnalyticsCustomModuleIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type EventThreatDetectionCustomModuleIterator ¶ added in v1.33.0
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 []*securitycenterpb.EventThreatDetectionCustomModule, nextPageToken string, err error) // contains filtered or unexported fields }
EventThreatDetectionCustomModuleIterator manages a stream of *securitycenterpb.EventThreatDetectionCustomModule.
func (*EventThreatDetectionCustomModuleIterator) All ¶ added in v1.35.1
func (it *EventThreatDetectionCustomModuleIterator) All() iter.Seq2[*securitycenterpb.EventThreatDetectionCustomModule, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*EventThreatDetectionCustomModuleIterator) Next ¶ added in v1.33.0
func (it *EventThreatDetectionCustomModuleIterator) Next() (*securitycenterpb.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 ¶ added in v1.33.0
func (it *EventThreatDetectionCustomModuleIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type GroupResultIterator ¶
type GroupResultIterator 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 []*securitycenterpb.GroupResult, nextPageToken string, err error) // contains filtered or unexported fields }
GroupResultIterator manages a stream of *securitycenterpb.GroupResult.
func (*GroupResultIterator) All ¶ added in v1.35.1
func (it *GroupResultIterator) All() iter.Seq2[*securitycenterpb.GroupResult, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*GroupResultIterator) Next ¶
func (it *GroupResultIterator) Next() (*securitycenterpb.GroupResult, 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 (*GroupResultIterator) PageInfo ¶
func (it *GroupResultIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ListAssetsResponse_ListAssetsResultIterator ¶
type ListAssetsResponse_ListAssetsResultIterator 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 []*securitycenterpb.ListAssetsResponse_ListAssetsResult, nextPageToken string, err error) // contains filtered or unexported fields }
ListAssetsResponse_ListAssetsResultIterator manages a stream of *securitycenterpb.ListAssetsResponse_ListAssetsResult.
func (*ListAssetsResponse_ListAssetsResultIterator) All ¶ added in v1.35.1
func (it *ListAssetsResponse_ListAssetsResultIterator) All() iter.Seq2[*securitycenterpb.ListAssetsResponse_ListAssetsResult, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ListAssetsResponse_ListAssetsResultIterator) Next ¶
func (it *ListAssetsResponse_ListAssetsResultIterator) Next() (*securitycenterpb.ListAssetsResponse_ListAssetsResult, 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 (*ListAssetsResponse_ListAssetsResultIterator) PageInfo ¶
func (it *ListAssetsResponse_ListAssetsResultIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ListFindingsResponse_ListFindingsResultIterator ¶
type ListFindingsResponse_ListFindingsResultIterator 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 []*securitycenterpb.ListFindingsResponse_ListFindingsResult, nextPageToken string, err error) // contains filtered or unexported fields }
ListFindingsResponse_ListFindingsResultIterator manages a stream of *securitycenterpb.ListFindingsResponse_ListFindingsResult.
func (*ListFindingsResponse_ListFindingsResultIterator) All ¶ added in v1.35.1
func (it *ListFindingsResponse_ListFindingsResultIterator) All() iter.Seq2[*securitycenterpb.ListFindingsResponse_ListFindingsResult, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ListFindingsResponse_ListFindingsResultIterator) Next ¶
func (it *ListFindingsResponse_ListFindingsResultIterator) Next() (*securitycenterpb.ListFindingsResponse_ListFindingsResult, 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 (*ListFindingsResponse_ListFindingsResultIterator) PageInfo ¶
func (it *ListFindingsResponse_ListFindingsResultIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type MuteConfigIterator ¶ added in v1.2.0
type MuteConfigIterator 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 []*securitycenterpb.MuteConfig, nextPageToken string, err error) // contains filtered or unexported fields }
MuteConfigIterator manages a stream of *securitycenterpb.MuteConfig.
func (*MuteConfigIterator) All ¶ added in v1.35.1
func (it *MuteConfigIterator) All() iter.Seq2[*securitycenterpb.MuteConfig, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*MuteConfigIterator) Next ¶ added in v1.2.0
func (it *MuteConfigIterator) Next() (*securitycenterpb.MuteConfig, 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 (*MuteConfigIterator) PageInfo ¶ added in v1.2.0
func (it *MuteConfigIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type NotificationConfigIterator ¶
type NotificationConfigIterator 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 []*securitycenterpb.NotificationConfig, nextPageToken string, err error) // contains filtered or unexported fields }
NotificationConfigIterator manages a stream of *securitycenterpb.NotificationConfig.
func (*NotificationConfigIterator) All ¶ added in v1.35.1
func (it *NotificationConfigIterator) All() iter.Seq2[*securitycenterpb.NotificationConfig, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*NotificationConfigIterator) Next ¶
func (it *NotificationConfigIterator) Next() (*securitycenterpb.NotificationConfig, 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 (*NotificationConfigIterator) PageInfo ¶
func (it *NotificationConfigIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type OperationIterator ¶ added in v1.8.0
type OperationIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error) // contains filtered or unexported fields }
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All ¶ added in v1.35.1
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next ¶ added in v1.8.0
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo ¶ added in v1.8.0
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ResourceValueConfigIterator ¶ added in v1.33.0
type ResourceValueConfigIterator 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 []*securitycenterpb.ResourceValueConfig, nextPageToken string, err error) // contains filtered or unexported fields }
ResourceValueConfigIterator manages a stream of *securitycenterpb.ResourceValueConfig.
func (*ResourceValueConfigIterator) All ¶ added in v1.35.1
func (it *ResourceValueConfigIterator) All() iter.Seq2[*securitycenterpb.ResourceValueConfig, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ResourceValueConfigIterator) Next ¶ added in v1.33.0
func (it *ResourceValueConfigIterator) Next() (*securitycenterpb.ResourceValueConfig, 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 (*ResourceValueConfigIterator) PageInfo ¶ added in v1.33.0
func (it *ResourceValueConfigIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type RunAssetDiscoveryOperation ¶
type RunAssetDiscoveryOperation struct {
// contains filtered or unexported fields
}
RunAssetDiscoveryOperation manages a long-running operation from RunAssetDiscovery.
func (*RunAssetDiscoveryOperation) Done ¶
func (op *RunAssetDiscoveryOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*RunAssetDiscoveryOperation) Metadata ¶
func (op *RunAssetDiscoveryOperation) Metadata() (*emptypb.Empty, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*RunAssetDiscoveryOperation) Name ¶
func (op *RunAssetDiscoveryOperation) Name() string
Name returns the name of the long-running operation. The name is assigned by the server and is unique within the service from which the operation is created.
func (*RunAssetDiscoveryOperation) Poll ¶
func (op *RunAssetDiscoveryOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*securitycenterpb.RunAssetDiscoveryResponse, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the operation has completed with failure, the error is returned and op.Done will return true. If Poll succeeds and the operation has completed successfully, op.Done will return true, and the response of the operation is returned. If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*RunAssetDiscoveryOperation) Wait ¶
func (op *RunAssetDiscoveryOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*securitycenterpb.RunAssetDiscoveryResponse, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type SecurityHealthAnalyticsCustomModuleIterator ¶ added in v1.20.0
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 []*securitycenterpb.SecurityHealthAnalyticsCustomModule, nextPageToken string, err error) // contains filtered or unexported fields }
SecurityHealthAnalyticsCustomModuleIterator manages a stream of *securitycenterpb.SecurityHealthAnalyticsCustomModule.
func (*SecurityHealthAnalyticsCustomModuleIterator) All ¶ added in v1.35.1
func (it *SecurityHealthAnalyticsCustomModuleIterator) All() iter.Seq2[*securitycenterpb.SecurityHealthAnalyticsCustomModule, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SecurityHealthAnalyticsCustomModuleIterator) Next ¶ added in v1.20.0
func (it *SecurityHealthAnalyticsCustomModuleIterator) Next() (*securitycenterpb.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 ¶ added in v1.20.0
func (it *SecurityHealthAnalyticsCustomModuleIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SourceIterator ¶
type SourceIterator 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 []*securitycenterpb.Source, nextPageToken string, err error) // contains filtered or unexported fields }
SourceIterator manages a stream of *securitycenterpb.Source.
func (*SourceIterator) All ¶ added in v1.35.1
func (it *SourceIterator) All() iter.Seq2[*securitycenterpb.Source, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*SourceIterator) Next ¶
func (it *SourceIterator) Next() (*securitycenterpb.Source, 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 (*SourceIterator) PageInfo ¶
func (it *SourceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type ValuedResourceIterator ¶ added in v1.33.0
type ValuedResourceIterator 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 []*securitycenterpb.ValuedResource, nextPageToken string, err error) // contains filtered or unexported fields }
ValuedResourceIterator manages a stream of *securitycenterpb.ValuedResource.
func (*ValuedResourceIterator) All ¶ added in v1.35.1
func (it *ValuedResourceIterator) All() iter.Seq2[*securitycenterpb.ValuedResource, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ValuedResourceIterator) Next ¶ added in v1.33.0
func (it *ValuedResourceIterator) Next() (*securitycenterpb.ValuedResource, 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 (*ValuedResourceIterator) PageInfo ¶ added in v1.33.0
func (it *ValuedResourceIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.