AWS SDK for Go (PILOT)
API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see https://docs.aws.amazon.com/sdk-for-go/api/.

We welcome your feedback on this new version of the documentation. Send your comments to aws-sdkdocs-feedback@amazon.com.

Inspector

import "github.com/aws/aws-sdk-go/service/inspector"

type Inspector struct { *client.Client }

Inspector provides the API operation methods for making requests to Amazon Inspector. See this package's package overview docs for details on the service.

Inspector methods are safe to use concurrently. It is not safe to modify mutate any of the struct's properties though.

Client

Type: *client.Client

Method

AddAttributesToFindings

func (c *Inspector) AddAttributesToFindings(input *AddAttributesToFindingsInput) (*AddAttributesToFindingsOutput, error)

AddAttributesToFindings API operation for Amazon Inspector.

Assigns attributes (key and value pairs) to the findings that are specified by the ARNs of the findings.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation AddAttributesToFindings for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AddAttributesToFindings

Example

Inspector AddAttributesToFindings shared00

Add attributes to findings

Assigns attributes (key and value pairs) to the findings that are specified by the ARNs of the findings.

{ svc := inspector.New(session.New()) input := &inspector.AddAttributesToFindingsInput{ Attributes: []*inspector.Attribute{ { Key: aws.String("Example"), Value: aws.String("example"), }, }, FindingArns: []*string{ aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU"), }, } result, err := svc.AddAttributesToFindings(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

AddAttributesToFindingsRequest

func (c *Inspector) AddAttributesToFindingsRequest(input *AddAttributesToFindingsInput) (req *request.Request, output *AddAttributesToFindingsOutput)

AddAttributesToFindingsRequest generates a "aws/request.Request" representing the client's request for the AddAttributesToFindings operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See AddAttributesToFindings for more information on using the AddAttributesToFindings API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the AddAttributesToFindingsRequest method. req, resp := client.AddAttributesToFindingsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AddAttributesToFindings

AddAttributesToFindingsWithContext

func (c *Inspector) AddAttributesToFindingsWithContext(ctx aws.Context, input *AddAttributesToFindingsInput, opts ...request.Option) (*AddAttributesToFindingsOutput, error)

AddAttributesToFindingsWithContext is the same as AddAttributesToFindings with the addition of the ability to pass a context and additional request options.

See AddAttributesToFindings for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateAssessmentTarget

func (c *Inspector) CreateAssessmentTarget(input *CreateAssessmentTargetInput) (*CreateAssessmentTargetOutput, error)

CreateAssessmentTarget API operation for Amazon Inspector.

Creates a new assessment target using the ARN of the resource group that is generated by CreateResourceGroup. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target. If the service-linked role (https://docs.aws.amazon.com/inspector/latest/userguide/inspector_slr.html) isn’t already registered, this action also creates and registers a service-linked role to grant Amazon Inspector access to AWS Services needed to perform security assessments. You can create up to 50 assessment targets per AWS account. You can run up to 500 concurrent agents per AWS account. For more information, see Amazon Inspector Assessment Targets (https://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation CreateAssessmentTarget for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeLimitExceededException "LimitExceededException" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error code describes the limit exceeded.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeInvalidCrossAccountRoleException "InvalidCrossAccountRoleException" Amazon Inspector cannot assume the cross-account role that it needs to list your EC2 instances during the assessment run.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTarget

Example

Inspector CreateAssessmentTarget shared00

Create assessment target

Creates a new assessment target using the ARN of the resource group that is generated by CreateResourceGroup. You can create up to 50 assessment targets per AWS account. You can run up to 500 concurrent agents per AWS account.

{ svc := inspector.New(session.New()) input := &inspector.CreateAssessmentTargetInput{ AssessmentTargetName: aws.String("ExampleAssessmentTarget"), ResourceGroupArn: aws.String("arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-AB6DMKnv"), } result, err := svc.CreateAssessmentTarget(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeLimitExceededException: fmt.Println(inspector.ErrCodeLimitExceededException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeInvalidCrossAccountRoleException: fmt.Println(inspector.ErrCodeInvalidCrossAccountRoleException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateAssessmentTargetRequest

func (c *Inspector) CreateAssessmentTargetRequest(input *CreateAssessmentTargetInput) (req *request.Request, output *CreateAssessmentTargetOutput)

CreateAssessmentTargetRequest generates a "aws/request.Request" representing the client's request for the CreateAssessmentTarget operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateAssessmentTarget for more information on using the CreateAssessmentTarget API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateAssessmentTargetRequest method. req, resp := client.CreateAssessmentTargetRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTarget

CreateAssessmentTargetWithContext

func (c *Inspector) CreateAssessmentTargetWithContext(ctx aws.Context, input *CreateAssessmentTargetInput, opts ...request.Option) (*CreateAssessmentTargetOutput, error)

CreateAssessmentTargetWithContext is the same as CreateAssessmentTarget with the addition of the ability to pass a context and additional request options.

See CreateAssessmentTarget for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateAssessmentTemplate

func (c *Inspector) CreateAssessmentTemplate(input *CreateAssessmentTemplateInput) (*CreateAssessmentTemplateOutput, error)

CreateAssessmentTemplate API operation for Amazon Inspector.

Creates an assessment template for the assessment target that is specified by the ARN of the assessment target. If the service-linked role (https://docs.aws.amazon.com/inspector/latest/userguide/inspector_slr.html) isn’t already registered, this action also creates and registers a service-linked role to grant Amazon Inspector access to AWS Services needed to perform security assessments.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation CreateAssessmentTemplate for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeLimitExceededException "LimitExceededException" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error code describes the limit exceeded.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTemplate

Example

Inspector CreateAssessmentTemplate shared00

Create assessment template

Creates an assessment template for the assessment target that is specified by the ARN of the assessment target.

{ svc := inspector.New(session.New()) input := &inspector.CreateAssessmentTemplateInput{ AssessmentTargetArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX"), AssessmentTemplateName: aws.String("ExampleAssessmentTemplate"), DurationInSeconds: aws.Int64(180), RulesPackageArns: []*string{ aws.String("arn:aws:inspector:us-west-2:758058086616:rulespackage/0-11B9DBXp"), }, UserAttributesForFindings: []*inspector.Attribute{ { Key: aws.String("Example"), Value: aws.String("example"), }, }, } result, err := svc.CreateAssessmentTemplate(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeLimitExceededException: fmt.Println(inspector.ErrCodeLimitExceededException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateAssessmentTemplateRequest

func (c *Inspector) CreateAssessmentTemplateRequest(input *CreateAssessmentTemplateInput) (req *request.Request, output *CreateAssessmentTemplateOutput)

CreateAssessmentTemplateRequest generates a "aws/request.Request" representing the client's request for the CreateAssessmentTemplate operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateAssessmentTemplate for more information on using the CreateAssessmentTemplate API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateAssessmentTemplateRequest method. req, resp := client.CreateAssessmentTemplateRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTemplate

CreateAssessmentTemplateWithContext

func (c *Inspector) CreateAssessmentTemplateWithContext(ctx aws.Context, input *CreateAssessmentTemplateInput, opts ...request.Option) (*CreateAssessmentTemplateOutput, error)

CreateAssessmentTemplateWithContext is the same as CreateAssessmentTemplate with the addition of the ability to pass a context and additional request options.

See CreateAssessmentTemplate for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateExclusionsPreview

func (c *Inspector) CreateExclusionsPreview(input *CreateExclusionsPreviewInput) (*CreateExclusionsPreviewOutput, error)

CreateExclusionsPreview API operation for Amazon Inspector.

Starts the generation of an exclusions preview for the specified assessment template. The exclusions preview lists the potential exclusions (ExclusionPreview) that Inspector can detect before it runs the assessment.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation CreateExclusionsPreview for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodePreviewGenerationInProgressException "PreviewGenerationInProgressException" The request is rejected. The specified assessment template is currently generating an exclusions preview.

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateExclusionsPreview

CreateExclusionsPreviewRequest

func (c *Inspector) CreateExclusionsPreviewRequest(input *CreateExclusionsPreviewInput) (req *request.Request, output *CreateExclusionsPreviewOutput)

CreateExclusionsPreviewRequest generates a "aws/request.Request" representing the client's request for the CreateExclusionsPreview operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateExclusionsPreview for more information on using the CreateExclusionsPreview API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateExclusionsPreviewRequest method. req, resp := client.CreateExclusionsPreviewRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateExclusionsPreview

CreateExclusionsPreviewWithContext

func (c *Inspector) CreateExclusionsPreviewWithContext(ctx aws.Context, input *CreateExclusionsPreviewInput, opts ...request.Option) (*CreateExclusionsPreviewOutput, error)

CreateExclusionsPreviewWithContext is the same as CreateExclusionsPreview with the addition of the ability to pass a context and additional request options.

See CreateExclusionsPreview for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

CreateResourceGroup

func (c *Inspector) CreateResourceGroup(input *CreateResourceGroupInput) (*CreateResourceGroupOutput, error)

CreateResourceGroup API operation for Amazon Inspector.

Creates a resource group using the specified set of tags (key and value pairs) that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. The created resource group is then used to create an Amazon Inspector assessment target. For more information, see CreateAssessmentTarget.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation CreateResourceGroup for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeLimitExceededException "LimitExceededException" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error code describes the limit exceeded.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateResourceGroup

Example

Inspector CreateResourceGroup shared00

Create resource group

Creates a resource group using the specified set of tags (key and value pairs) that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. The created resource group is then used to create an Amazon Inspector assessment target.

{ svc := inspector.New(session.New()) input := &inspector.CreateResourceGroupInput{ ResourceGroupTags: []*inspector.ResourceGroupTag{ { Key: aws.String("Name"), Value: aws.String("example"), }, }, } result, err := svc.CreateResourceGroup(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeLimitExceededException: fmt.Println(inspector.ErrCodeLimitExceededException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

CreateResourceGroupRequest

func (c *Inspector) CreateResourceGroupRequest(input *CreateResourceGroupInput) (req *request.Request, output *CreateResourceGroupOutput)

CreateResourceGroupRequest generates a "aws/request.Request" representing the client's request for the CreateResourceGroup operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See CreateResourceGroup for more information on using the CreateResourceGroup API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the CreateResourceGroupRequest method. req, resp := client.CreateResourceGroupRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateResourceGroup

CreateResourceGroupWithContext

func (c *Inspector) CreateResourceGroupWithContext(ctx aws.Context, input *CreateResourceGroupInput, opts ...request.Option) (*CreateResourceGroupOutput, error)

CreateResourceGroupWithContext is the same as CreateResourceGroup with the addition of the ability to pass a context and additional request options.

See CreateResourceGroup for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteAssessmentRun

func (c *Inspector) DeleteAssessmentRun(input *DeleteAssessmentRunInput) (*DeleteAssessmentRunOutput, error)

DeleteAssessmentRun API operation for Amazon Inspector.

Deletes the assessment run that is specified by the ARN of the assessment run.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation DeleteAssessmentRun for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAssessmentRunInProgressException "AssessmentRunInProgressException" You cannot perform a specified action if an assessment run is currently in progress.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentRun

Example

Inspector DeleteAssessmentRun shared00

Delete assessment run

Deletes the assessment run that is specified by the ARN of the assessment run.

{ svc := inspector.New(session.New()) input := &inspector.DeleteAssessmentRunInput{ AssessmentRunArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-11LMTAVe"), } result, err := svc.DeleteAssessmentRun(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAssessmentRunInProgressException: fmt.Println(inspector.ErrCodeAssessmentRunInProgressException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteAssessmentRunRequest

func (c *Inspector) DeleteAssessmentRunRequest(input *DeleteAssessmentRunInput) (req *request.Request, output *DeleteAssessmentRunOutput)

DeleteAssessmentRunRequest generates a "aws/request.Request" representing the client's request for the DeleteAssessmentRun operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteAssessmentRun for more information on using the DeleteAssessmentRun API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteAssessmentRunRequest method. req, resp := client.DeleteAssessmentRunRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentRun

DeleteAssessmentRunWithContext

func (c *Inspector) DeleteAssessmentRunWithContext(ctx aws.Context, input *DeleteAssessmentRunInput, opts ...request.Option) (*DeleteAssessmentRunOutput, error)

DeleteAssessmentRunWithContext is the same as DeleteAssessmentRun with the addition of the ability to pass a context and additional request options.

See DeleteAssessmentRun for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteAssessmentTarget

func (c *Inspector) DeleteAssessmentTarget(input *DeleteAssessmentTargetInput) (*DeleteAssessmentTargetOutput, error)

DeleteAssessmentTarget API operation for Amazon Inspector.

Deletes the assessment target that is specified by the ARN of the assessment target.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation DeleteAssessmentTarget for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAssessmentRunInProgressException "AssessmentRunInProgressException" You cannot perform a specified action if an assessment run is currently in progress.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTarget

Example

Inspector DeleteAssessmentTarget shared00

Delete assessment target

Deletes the assessment target that is specified by the ARN of the assessment target.

{ svc := inspector.New(session.New()) input := &inspector.DeleteAssessmentTargetInput{ AssessmentTargetArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq"), } result, err := svc.DeleteAssessmentTarget(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAssessmentRunInProgressException: fmt.Println(inspector.ErrCodeAssessmentRunInProgressException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteAssessmentTargetRequest

func (c *Inspector) DeleteAssessmentTargetRequest(input *DeleteAssessmentTargetInput) (req *request.Request, output *DeleteAssessmentTargetOutput)

DeleteAssessmentTargetRequest generates a "aws/request.Request" representing the client's request for the DeleteAssessmentTarget operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteAssessmentTarget for more information on using the DeleteAssessmentTarget API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteAssessmentTargetRequest method. req, resp := client.DeleteAssessmentTargetRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTarget

DeleteAssessmentTargetWithContext

func (c *Inspector) DeleteAssessmentTargetWithContext(ctx aws.Context, input *DeleteAssessmentTargetInput, opts ...request.Option) (*DeleteAssessmentTargetOutput, error)

DeleteAssessmentTargetWithContext is the same as DeleteAssessmentTarget with the addition of the ability to pass a context and additional request options.

See DeleteAssessmentTarget for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DeleteAssessmentTemplate

func (c *Inspector) DeleteAssessmentTemplate(input *DeleteAssessmentTemplateInput) (*DeleteAssessmentTemplateOutput, error)

DeleteAssessmentTemplate API operation for Amazon Inspector.

Deletes the assessment template that is specified by the ARN of the assessment template.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation DeleteAssessmentTemplate for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAssessmentRunInProgressException "AssessmentRunInProgressException" You cannot perform a specified action if an assessment run is currently in progress.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTemplate

Example

Inspector DeleteAssessmentTemplate shared00

Delete assessment template

Deletes the assessment template that is specified by the ARN of the assessment template.

{ svc := inspector.New(session.New()) input := &inspector.DeleteAssessmentTemplateInput{ AssessmentTemplateArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T"), } result, err := svc.DeleteAssessmentTemplate(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAssessmentRunInProgressException: fmt.Println(inspector.ErrCodeAssessmentRunInProgressException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DeleteAssessmentTemplateRequest

func (c *Inspector) DeleteAssessmentTemplateRequest(input *DeleteAssessmentTemplateInput) (req *request.Request, output *DeleteAssessmentTemplateOutput)

DeleteAssessmentTemplateRequest generates a "aws/request.Request" representing the client's request for the DeleteAssessmentTemplate operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DeleteAssessmentTemplate for more information on using the DeleteAssessmentTemplate API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DeleteAssessmentTemplateRequest method. req, resp := client.DeleteAssessmentTemplateRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTemplate

DeleteAssessmentTemplateWithContext

func (c *Inspector) DeleteAssessmentTemplateWithContext(ctx aws.Context, input *DeleteAssessmentTemplateInput, opts ...request.Option) (*DeleteAssessmentTemplateOutput, error)

DeleteAssessmentTemplateWithContext is the same as DeleteAssessmentTemplate with the addition of the ability to pass a context and additional request options.

See DeleteAssessmentTemplate for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeAssessmentRuns

func (c *Inspector) DescribeAssessmentRuns(input *DescribeAssessmentRunsInput) (*DescribeAssessmentRunsOutput, error)

DescribeAssessmentRuns API operation for Amazon Inspector.

Describes the assessment runs that are specified by the ARNs of the assessment runs.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation DescribeAssessmentRuns for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentRuns

Example

Inspector DescribeAssessmentRuns shared00

Describte assessment runs

Describes the assessment runs that are specified by the ARNs of the assessment runs.

{ svc := inspector.New(session.New()) input := &inspector.DescribeAssessmentRunsInput{ AssessmentRunArns: []*string{ aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE"), }, } result, err := svc.DescribeAssessmentRuns(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeAssessmentRunsRequest

func (c *Inspector) DescribeAssessmentRunsRequest(input *DescribeAssessmentRunsInput) (req *request.Request, output *DescribeAssessmentRunsOutput)

DescribeAssessmentRunsRequest generates a "aws/request.Request" representing the client's request for the DescribeAssessmentRuns operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeAssessmentRuns for more information on using the DescribeAssessmentRuns API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeAssessmentRunsRequest method. req, resp := client.DescribeAssessmentRunsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentRuns

DescribeAssessmentRunsWithContext

func (c *Inspector) DescribeAssessmentRunsWithContext(ctx aws.Context, input *DescribeAssessmentRunsInput, opts ...request.Option) (*DescribeAssessmentRunsOutput, error)

DescribeAssessmentRunsWithContext is the same as DescribeAssessmentRuns with the addition of the ability to pass a context and additional request options.

See DescribeAssessmentRuns for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeAssessmentTargets

func (c *Inspector) DescribeAssessmentTargets(input *DescribeAssessmentTargetsInput) (*DescribeAssessmentTargetsOutput, error)

DescribeAssessmentTargets API operation for Amazon Inspector.

Describes the assessment targets that are specified by the ARNs of the assessment targets.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation DescribeAssessmentTargets for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTargets

Example

Inspector DescribeAssessmentTargets shared00

Describte assessment targets

Describes the assessment targets that are specified by the ARNs of the assessment targets.

{ svc := inspector.New(session.New()) input := &inspector.DescribeAssessmentTargetsInput{ AssessmentTargetArns: []*string{ aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq"), }, } result, err := svc.DescribeAssessmentTargets(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeAssessmentTargetsRequest

func (c *Inspector) DescribeAssessmentTargetsRequest(input *DescribeAssessmentTargetsInput) (req *request.Request, output *DescribeAssessmentTargetsOutput)

DescribeAssessmentTargetsRequest generates a "aws/request.Request" representing the client's request for the DescribeAssessmentTargets operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeAssessmentTargets for more information on using the DescribeAssessmentTargets API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeAssessmentTargetsRequest method. req, resp := client.DescribeAssessmentTargetsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTargets

DescribeAssessmentTargetsWithContext

func (c *Inspector) DescribeAssessmentTargetsWithContext(ctx aws.Context, input *DescribeAssessmentTargetsInput, opts ...request.Option) (*DescribeAssessmentTargetsOutput, error)

DescribeAssessmentTargetsWithContext is the same as DescribeAssessmentTargets with the addition of the ability to pass a context and additional request options.

See DescribeAssessmentTargets for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeAssessmentTemplates

func (c *Inspector) DescribeAssessmentTemplates(input *DescribeAssessmentTemplatesInput) (*DescribeAssessmentTemplatesOutput, error)

DescribeAssessmentTemplates API operation for Amazon Inspector.

Describes the assessment templates that are specified by the ARNs of the assessment templates.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation DescribeAssessmentTemplates for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTemplates

Example

Inspector DescribeAssessmentTemplates shared00

Describte assessment templates

Describes the assessment templates that are specified by the ARNs of the assessment templates.

{ svc := inspector.New(session.New()) input := &inspector.DescribeAssessmentTemplatesInput{ AssessmentTemplateArns: []*string{ aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw"), }, } result, err := svc.DescribeAssessmentTemplates(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeAssessmentTemplatesRequest

func (c *Inspector) DescribeAssessmentTemplatesRequest(input *DescribeAssessmentTemplatesInput) (req *request.Request, output *DescribeAssessmentTemplatesOutput)

DescribeAssessmentTemplatesRequest generates a "aws/request.Request" representing the client's request for the DescribeAssessmentTemplates operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeAssessmentTemplates for more information on using the DescribeAssessmentTemplates API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeAssessmentTemplatesRequest method. req, resp := client.DescribeAssessmentTemplatesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeAssessmentTemplates

DescribeAssessmentTemplatesWithContext

func (c *Inspector) DescribeAssessmentTemplatesWithContext(ctx aws.Context, input *DescribeAssessmentTemplatesInput, opts ...request.Option) (*DescribeAssessmentTemplatesOutput, error)

DescribeAssessmentTemplatesWithContext is the same as DescribeAssessmentTemplates with the addition of the ability to pass a context and additional request options.

See DescribeAssessmentTemplates for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeCrossAccountAccessRole

func (c *Inspector) DescribeCrossAccountAccessRole(input *DescribeCrossAccountAccessRoleInput) (*DescribeCrossAccountAccessRoleOutput, error)

DescribeCrossAccountAccessRole API operation for Amazon Inspector.

Describes the IAM role that enables Amazon Inspector to access your AWS account.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation DescribeCrossAccountAccessRole for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeCrossAccountAccessRole

Example

Inspector DescribeCrossAccountAccessRole shared00

Describte cross account access role

Describes the IAM role that enables Amazon Inspector to access your AWS account.

{ svc := inspector.New(session.New()) input := &inspector.DescribeCrossAccountAccessRoleInput{} result, err := svc.DescribeCrossAccountAccessRole(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeCrossAccountAccessRoleRequest

func (c *Inspector) DescribeCrossAccountAccessRoleRequest(input *DescribeCrossAccountAccessRoleInput) (req *request.Request, output *DescribeCrossAccountAccessRoleOutput)

DescribeCrossAccountAccessRoleRequest generates a "aws/request.Request" representing the client's request for the DescribeCrossAccountAccessRole operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeCrossAccountAccessRole for more information on using the DescribeCrossAccountAccessRole API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeCrossAccountAccessRoleRequest method. req, resp := client.DescribeCrossAccountAccessRoleRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeCrossAccountAccessRole

DescribeCrossAccountAccessRoleWithContext

func (c *Inspector) DescribeCrossAccountAccessRoleWithContext(ctx aws.Context, input *DescribeCrossAccountAccessRoleInput, opts ...request.Option) (*DescribeCrossAccountAccessRoleOutput, error)

DescribeCrossAccountAccessRoleWithContext is the same as DescribeCrossAccountAccessRole with the addition of the ability to pass a context and additional request options.

See DescribeCrossAccountAccessRole for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeExclusions

func (c *Inspector) DescribeExclusions(input *DescribeExclusionsInput) (*DescribeExclusionsOutput, error)

DescribeExclusions API operation for Amazon Inspector.

Describes the exclusions that are specified by the exclusions' ARNs.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation DescribeExclusions for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeExclusions

DescribeExclusionsRequest

func (c *Inspector) DescribeExclusionsRequest(input *DescribeExclusionsInput) (req *request.Request, output *DescribeExclusionsOutput)

DescribeExclusionsRequest generates a "aws/request.Request" representing the client's request for the DescribeExclusions operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeExclusions for more information on using the DescribeExclusions API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeExclusionsRequest method. req, resp := client.DescribeExclusionsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeExclusions

DescribeExclusionsWithContext

func (c *Inspector) DescribeExclusionsWithContext(ctx aws.Context, input *DescribeExclusionsInput, opts ...request.Option) (*DescribeExclusionsOutput, error)

DescribeExclusionsWithContext is the same as DescribeExclusions with the addition of the ability to pass a context and additional request options.

See DescribeExclusions for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeFindings

func (c *Inspector) DescribeFindings(input *DescribeFindingsInput) (*DescribeFindingsOutput, error)

DescribeFindings API operation for Amazon Inspector.

Describes the findings that are specified by the ARNs of the findings.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation DescribeFindings for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeFindings

Example

Inspector DescribeFindings shared00

Describe findings

Describes the findings that are specified by the ARNs of the findings.

{ svc := inspector.New(session.New()) input := &inspector.DescribeFindingsInput{ FindingArns: []*string{ aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4"), }, } result, err := svc.DescribeFindings(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeFindingsRequest

func (c *Inspector) DescribeFindingsRequest(input *DescribeFindingsInput) (req *request.Request, output *DescribeFindingsOutput)

DescribeFindingsRequest generates a "aws/request.Request" representing the client's request for the DescribeFindings operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeFindings for more information on using the DescribeFindings API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeFindingsRequest method. req, resp := client.DescribeFindingsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeFindings

DescribeFindingsWithContext

func (c *Inspector) DescribeFindingsWithContext(ctx aws.Context, input *DescribeFindingsInput, opts ...request.Option) (*DescribeFindingsOutput, error)

DescribeFindingsWithContext is the same as DescribeFindings with the addition of the ability to pass a context and additional request options.

See DescribeFindings for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeResourceGroups

func (c *Inspector) DescribeResourceGroups(input *DescribeResourceGroupsInput) (*DescribeResourceGroupsOutput, error)

DescribeResourceGroups API operation for Amazon Inspector.

Describes the resource groups that are specified by the ARNs of the resource groups.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation DescribeResourceGroups for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeResourceGroups

Example

Inspector DescribeResourceGroups shared00

Describe resource groups

Describes the resource groups that are specified by the ARNs of the resource groups.

{ svc := inspector.New(session.New()) input := &inspector.DescribeResourceGroupsInput{ ResourceGroupArns: []*string{ aws.String("arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI"), }, } result, err := svc.DescribeResourceGroups(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeResourceGroupsRequest

func (c *Inspector) DescribeResourceGroupsRequest(input *DescribeResourceGroupsInput) (req *request.Request, output *DescribeResourceGroupsOutput)

DescribeResourceGroupsRequest generates a "aws/request.Request" representing the client's request for the DescribeResourceGroups operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeResourceGroups for more information on using the DescribeResourceGroups API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeResourceGroupsRequest method. req, resp := client.DescribeResourceGroupsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeResourceGroups

DescribeResourceGroupsWithContext

func (c *Inspector) DescribeResourceGroupsWithContext(ctx aws.Context, input *DescribeResourceGroupsInput, opts ...request.Option) (*DescribeResourceGroupsOutput, error)

DescribeResourceGroupsWithContext is the same as DescribeResourceGroups with the addition of the ability to pass a context and additional request options.

See DescribeResourceGroups for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

DescribeRulesPackages

func (c *Inspector) DescribeRulesPackages(input *DescribeRulesPackagesInput) (*DescribeRulesPackagesOutput, error)

DescribeRulesPackages API operation for Amazon Inspector.

Describes the rules packages that are specified by the ARNs of the rules packages.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation DescribeRulesPackages for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeRulesPackages

Example

Inspector DescribeRulesPackages shared00

Describe rules packages

Describes the rules packages that are specified by the ARNs of the rules packages.

{ svc := inspector.New(session.New()) input := &inspector.DescribeRulesPackagesInput{ RulesPackageArns: []*string{ aws.String("arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ"), }, } result, err := svc.DescribeRulesPackages(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

DescribeRulesPackagesRequest

func (c *Inspector) DescribeRulesPackagesRequest(input *DescribeRulesPackagesInput) (req *request.Request, output *DescribeRulesPackagesOutput)

DescribeRulesPackagesRequest generates a "aws/request.Request" representing the client's request for the DescribeRulesPackages operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See DescribeRulesPackages for more information on using the DescribeRulesPackages API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the DescribeRulesPackagesRequest method. req, resp := client.DescribeRulesPackagesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeRulesPackages

DescribeRulesPackagesWithContext

func (c *Inspector) DescribeRulesPackagesWithContext(ctx aws.Context, input *DescribeRulesPackagesInput, opts ...request.Option) (*DescribeRulesPackagesOutput, error)

DescribeRulesPackagesWithContext is the same as DescribeRulesPackages with the addition of the ability to pass a context and additional request options.

See DescribeRulesPackages for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetAssessmentReport

func (c *Inspector) GetAssessmentReport(input *GetAssessmentReportInput) (*GetAssessmentReportOutput, error)

GetAssessmentReport API operation for Amazon Inspector.

Produces an assessment report that includes detailed and comprehensive results of a specified assessment run.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation GetAssessmentReport for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeAssessmentRunInProgressException "AssessmentRunInProgressException" You cannot perform a specified action if an assessment run is currently in progress.

  • ErrCodeUnsupportedFeatureException "UnsupportedFeatureException" Used by the GetAssessmentReport API. The request was rejected because you tried to generate a report for an assessment run that existed before reporting was supported in Amazon Inspector. You can only generate reports for assessment runs that took place or will take place after generating reports in Amazon Inspector became available.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/GetAssessmentReport

GetAssessmentReportRequest

func (c *Inspector) GetAssessmentReportRequest(input *GetAssessmentReportInput) (req *request.Request, output *GetAssessmentReportOutput)

GetAssessmentReportRequest generates a "aws/request.Request" representing the client's request for the GetAssessmentReport operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetAssessmentReport for more information on using the GetAssessmentReport API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetAssessmentReportRequest method. req, resp := client.GetAssessmentReportRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/GetAssessmentReport

GetAssessmentReportWithContext

func (c *Inspector) GetAssessmentReportWithContext(ctx aws.Context, input *GetAssessmentReportInput, opts ...request.Option) (*GetAssessmentReportOutput, error)

GetAssessmentReportWithContext is the same as GetAssessmentReport with the addition of the ability to pass a context and additional request options.

See GetAssessmentReport for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetExclusionsPreview

func (c *Inspector) GetExclusionsPreview(input *GetExclusionsPreviewInput) (*GetExclusionsPreviewOutput, error)

GetExclusionsPreview API operation for Amazon Inspector.

Retrieves the exclusions preview (a list of ExclusionPreview objects) specified by the preview token. You can obtain the preview token by running the CreateExclusionsPreview API.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation GetExclusionsPreview for usage and error information.

Returned Error Codes:

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/GetExclusionsPreview

GetExclusionsPreviewPages

func (c *Inspector) GetExclusionsPreviewPages(input *GetExclusionsPreviewInput, fn func(*GetExclusionsPreviewOutput, bool) bool) error

GetExclusionsPreviewPages iterates over the pages of a GetExclusionsPreview operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See GetExclusionsPreview method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a GetExclusionsPreview operation. pageNum := 0 err := client.GetExclusionsPreviewPages(params, func(page *GetExclusionsPreviewOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

GetExclusionsPreviewPagesWithContext

func (c *Inspector) GetExclusionsPreviewPagesWithContext(ctx aws.Context, input *GetExclusionsPreviewInput, fn func(*GetExclusionsPreviewOutput, bool) bool, opts ...request.Option) error

GetExclusionsPreviewPagesWithContext same as GetExclusionsPreviewPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetExclusionsPreviewRequest

func (c *Inspector) GetExclusionsPreviewRequest(input *GetExclusionsPreviewInput) (req *request.Request, output *GetExclusionsPreviewOutput)

GetExclusionsPreviewRequest generates a "aws/request.Request" representing the client's request for the GetExclusionsPreview operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetExclusionsPreview for more information on using the GetExclusionsPreview API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetExclusionsPreviewRequest method. req, resp := client.GetExclusionsPreviewRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/GetExclusionsPreview

GetExclusionsPreviewWithContext

func (c *Inspector) GetExclusionsPreviewWithContext(ctx aws.Context, input *GetExclusionsPreviewInput, opts ...request.Option) (*GetExclusionsPreviewOutput, error)

GetExclusionsPreviewWithContext is the same as GetExclusionsPreview with the addition of the ability to pass a context and additional request options.

See GetExclusionsPreview for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

GetTelemetryMetadata

func (c *Inspector) GetTelemetryMetadata(input *GetTelemetryMetadataInput) (*GetTelemetryMetadataOutput, error)

GetTelemetryMetadata API operation for Amazon Inspector.

Information about the data that is collected for the specified assessment run.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation GetTelemetryMetadata for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/GetTelemetryMetadata

Example

Inspector GetTelemetryMetadata shared00

Get telemetry metadata

Information about the data that is collected for the specified assessment run.

{ svc := inspector.New(session.New()) input := &inspector.GetTelemetryMetadataInput{ AssessmentRunArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE"), } result, err := svc.GetTelemetryMetadata(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

GetTelemetryMetadataRequest

func (c *Inspector) GetTelemetryMetadataRequest(input *GetTelemetryMetadataInput) (req *request.Request, output *GetTelemetryMetadataOutput)

GetTelemetryMetadataRequest generates a "aws/request.Request" representing the client's request for the GetTelemetryMetadata operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See GetTelemetryMetadata for more information on using the GetTelemetryMetadata API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the GetTelemetryMetadataRequest method. req, resp := client.GetTelemetryMetadataRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/GetTelemetryMetadata

GetTelemetryMetadataWithContext

func (c *Inspector) GetTelemetryMetadataWithContext(ctx aws.Context, input *GetTelemetryMetadataInput, opts ...request.Option) (*GetTelemetryMetadataOutput, error)

GetTelemetryMetadataWithContext is the same as GetTelemetryMetadata with the addition of the ability to pass a context and additional request options.

See GetTelemetryMetadata for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAssessmentRunAgents

func (c *Inspector) ListAssessmentRunAgents(input *ListAssessmentRunAgentsInput) (*ListAssessmentRunAgentsOutput, error)

ListAssessmentRunAgents API operation for Amazon Inspector.

Lists the agents of the assessment runs that are specified by the ARNs of the assessment runs.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation ListAssessmentRunAgents for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRunAgents

Example

Inspector ListAssessmentRunAgents shared00

List assessment run agents

Lists the agents of the assessment runs that are specified by the ARNs of the assessment runs.

{ svc := inspector.New(session.New()) input := &inspector.ListAssessmentRunAgentsInput{ AssessmentRunArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE"), MaxResults: aws.Int64(123), } result, err := svc.ListAssessmentRunAgents(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListAssessmentRunAgentsPages

func (c *Inspector) ListAssessmentRunAgentsPages(input *ListAssessmentRunAgentsInput, fn func(*ListAssessmentRunAgentsOutput, bool) bool) error

ListAssessmentRunAgentsPages iterates over the pages of a ListAssessmentRunAgents operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListAssessmentRunAgents method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListAssessmentRunAgents operation. pageNum := 0 err := client.ListAssessmentRunAgentsPages(params, func(page *ListAssessmentRunAgentsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListAssessmentRunAgentsPagesWithContext

func (c *Inspector) ListAssessmentRunAgentsPagesWithContext(ctx aws.Context, input *ListAssessmentRunAgentsInput, fn func(*ListAssessmentRunAgentsOutput, bool) bool, opts ...request.Option) error

ListAssessmentRunAgentsPagesWithContext same as ListAssessmentRunAgentsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAssessmentRunAgentsRequest

func (c *Inspector) ListAssessmentRunAgentsRequest(input *ListAssessmentRunAgentsInput) (req *request.Request, output *ListAssessmentRunAgentsOutput)

ListAssessmentRunAgentsRequest generates a "aws/request.Request" representing the client's request for the ListAssessmentRunAgents operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListAssessmentRunAgents for more information on using the ListAssessmentRunAgents API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListAssessmentRunAgentsRequest method. req, resp := client.ListAssessmentRunAgentsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRunAgents

ListAssessmentRunAgentsWithContext

func (c *Inspector) ListAssessmentRunAgentsWithContext(ctx aws.Context, input *ListAssessmentRunAgentsInput, opts ...request.Option) (*ListAssessmentRunAgentsOutput, error)

ListAssessmentRunAgentsWithContext is the same as ListAssessmentRunAgents with the addition of the ability to pass a context and additional request options.

See ListAssessmentRunAgents for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAssessmentRuns

func (c *Inspector) ListAssessmentRuns(input *ListAssessmentRunsInput) (*ListAssessmentRunsOutput, error)

ListAssessmentRuns API operation for Amazon Inspector.

Lists the assessment runs that correspond to the assessment templates that are specified by the ARNs of the assessment templates.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation ListAssessmentRuns for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRuns

Example

Inspector ListAssessmentRuns shared00

List assessment runs

Lists the assessment runs that correspond to the assessment templates that are specified by the ARNs of the assessment templates.

{ svc := inspector.New(session.New()) input := &inspector.ListAssessmentRunsInput{ AssessmentTemplateArns: []*string{ aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw"), }, MaxResults: aws.Int64(123), } result, err := svc.ListAssessmentRuns(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListAssessmentRunsPages

func (c *Inspector) ListAssessmentRunsPages(input *ListAssessmentRunsInput, fn func(*ListAssessmentRunsOutput, bool) bool) error

ListAssessmentRunsPages iterates over the pages of a ListAssessmentRuns operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListAssessmentRuns method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListAssessmentRuns operation. pageNum := 0 err := client.ListAssessmentRunsPages(params, func(page *ListAssessmentRunsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListAssessmentRunsPagesWithContext

func (c *Inspector) ListAssessmentRunsPagesWithContext(ctx aws.Context, input *ListAssessmentRunsInput, fn func(*ListAssessmentRunsOutput, bool) bool, opts ...request.Option) error

ListAssessmentRunsPagesWithContext same as ListAssessmentRunsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAssessmentRunsRequest

func (c *Inspector) ListAssessmentRunsRequest(input *ListAssessmentRunsInput) (req *request.Request, output *ListAssessmentRunsOutput)

ListAssessmentRunsRequest generates a "aws/request.Request" representing the client's request for the ListAssessmentRuns operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListAssessmentRuns for more information on using the ListAssessmentRuns API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListAssessmentRunsRequest method. req, resp := client.ListAssessmentRunsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentRuns

ListAssessmentRunsWithContext

func (c *Inspector) ListAssessmentRunsWithContext(ctx aws.Context, input *ListAssessmentRunsInput, opts ...request.Option) (*ListAssessmentRunsOutput, error)

ListAssessmentRunsWithContext is the same as ListAssessmentRuns with the addition of the ability to pass a context and additional request options.

See ListAssessmentRuns for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAssessmentTargets

func (c *Inspector) ListAssessmentTargets(input *ListAssessmentTargetsInput) (*ListAssessmentTargetsOutput, error)

ListAssessmentTargets API operation for Amazon Inspector.

Lists the ARNs of the assessment targets within this AWS account. For more information about assessment targets, see Amazon Inspector Assessment Targets (https://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html).

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation ListAssessmentTargets for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTargets

Example

Inspector ListAssessmentTargets shared00

List assessment targets

Lists the ARNs of the assessment targets within this AWS account.

{ svc := inspector.New(session.New()) input := &inspector.ListAssessmentTargetsInput{ MaxResults: aws.Int64(123), } result, err := svc.ListAssessmentTargets(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListAssessmentTargetsPages

func (c *Inspector) ListAssessmentTargetsPages(input *ListAssessmentTargetsInput, fn func(*ListAssessmentTargetsOutput, bool) bool) error

ListAssessmentTargetsPages iterates over the pages of a ListAssessmentTargets operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListAssessmentTargets method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListAssessmentTargets operation. pageNum := 0 err := client.ListAssessmentTargetsPages(params, func(page *ListAssessmentTargetsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListAssessmentTargetsPagesWithContext

func (c *Inspector) ListAssessmentTargetsPagesWithContext(ctx aws.Context, input *ListAssessmentTargetsInput, fn func(*ListAssessmentTargetsOutput, bool) bool, opts ...request.Option) error

ListAssessmentTargetsPagesWithContext same as ListAssessmentTargetsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAssessmentTargetsRequest

func (c *Inspector) ListAssessmentTargetsRequest(input *ListAssessmentTargetsInput) (req *request.Request, output *ListAssessmentTargetsOutput)

ListAssessmentTargetsRequest generates a "aws/request.Request" representing the client's request for the ListAssessmentTargets operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListAssessmentTargets for more information on using the ListAssessmentTargets API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListAssessmentTargetsRequest method. req, resp := client.ListAssessmentTargetsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTargets

ListAssessmentTargetsWithContext

func (c *Inspector) ListAssessmentTargetsWithContext(ctx aws.Context, input *ListAssessmentTargetsInput, opts ...request.Option) (*ListAssessmentTargetsOutput, error)

ListAssessmentTargetsWithContext is the same as ListAssessmentTargets with the addition of the ability to pass a context and additional request options.

See ListAssessmentTargets for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAssessmentTemplates

func (c *Inspector) ListAssessmentTemplates(input *ListAssessmentTemplatesInput) (*ListAssessmentTemplatesOutput, error)

ListAssessmentTemplates API operation for Amazon Inspector.

Lists the assessment templates that correspond to the assessment targets that are specified by the ARNs of the assessment targets.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation ListAssessmentTemplates for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTemplates

Example

Inspector ListAssessmentTemplates shared00

List assessment templates

Lists the assessment templates that correspond to the assessment targets that are specified by the ARNs of the assessment targets.

{ svc := inspector.New(session.New()) input := &inspector.ListAssessmentTemplatesInput{ AssessmentTargetArns: []*string{ aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq"), }, MaxResults: aws.Int64(123), } result, err := svc.ListAssessmentTemplates(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListAssessmentTemplatesPages

func (c *Inspector) ListAssessmentTemplatesPages(input *ListAssessmentTemplatesInput, fn func(*ListAssessmentTemplatesOutput, bool) bool) error

ListAssessmentTemplatesPages iterates over the pages of a ListAssessmentTemplates operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListAssessmentTemplates method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListAssessmentTemplates operation. pageNum := 0 err := client.ListAssessmentTemplatesPages(params, func(page *ListAssessmentTemplatesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListAssessmentTemplatesPagesWithContext

func (c *Inspector) ListAssessmentTemplatesPagesWithContext(ctx aws.Context, input *ListAssessmentTemplatesInput, fn func(*ListAssessmentTemplatesOutput, bool) bool, opts ...request.Option) error

ListAssessmentTemplatesPagesWithContext same as ListAssessmentTemplatesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListAssessmentTemplatesRequest

func (c *Inspector) ListAssessmentTemplatesRequest(input *ListAssessmentTemplatesInput) (req *request.Request, output *ListAssessmentTemplatesOutput)

ListAssessmentTemplatesRequest generates a "aws/request.Request" representing the client's request for the ListAssessmentTemplates operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListAssessmentTemplates for more information on using the ListAssessmentTemplates API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListAssessmentTemplatesRequest method. req, resp := client.ListAssessmentTemplatesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTemplates

ListAssessmentTemplatesWithContext

func (c *Inspector) ListAssessmentTemplatesWithContext(ctx aws.Context, input *ListAssessmentTemplatesInput, opts ...request.Option) (*ListAssessmentTemplatesOutput, error)

ListAssessmentTemplatesWithContext is the same as ListAssessmentTemplates with the addition of the ability to pass a context and additional request options.

See ListAssessmentTemplates for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListEventSubscriptions

func (c *Inspector) ListEventSubscriptions(input *ListEventSubscriptionsInput) (*ListEventSubscriptionsOutput, error)

ListEventSubscriptions API operation for Amazon Inspector.

Lists all the event subscriptions for the assessment template that is specified by the ARN of the assessment template. For more information, see SubscribeToEvent and UnsubscribeFromEvent.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation ListEventSubscriptions for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListEventSubscriptions

Example

Inspector ListEventSubscriptions shared00

List event subscriptions

Lists all the event subscriptions for the assessment template that is specified by the ARN of the assessment template.

{ svc := inspector.New(session.New()) input := &inspector.ListEventSubscriptionsInput{ MaxResults: aws.Int64(123), ResourceArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0"), } result, err := svc.ListEventSubscriptions(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListEventSubscriptionsPages

func (c *Inspector) ListEventSubscriptionsPages(input *ListEventSubscriptionsInput, fn func(*ListEventSubscriptionsOutput, bool) bool) error

ListEventSubscriptionsPages iterates over the pages of a ListEventSubscriptions operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListEventSubscriptions method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListEventSubscriptions operation. pageNum := 0 err := client.ListEventSubscriptionsPages(params, func(page *ListEventSubscriptionsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListEventSubscriptionsPagesWithContext

func (c *Inspector) ListEventSubscriptionsPagesWithContext(ctx aws.Context, input *ListEventSubscriptionsInput, fn func(*ListEventSubscriptionsOutput, bool) bool, opts ...request.Option) error

ListEventSubscriptionsPagesWithContext same as ListEventSubscriptionsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListEventSubscriptionsRequest

func (c *Inspector) ListEventSubscriptionsRequest(input *ListEventSubscriptionsInput) (req *request.Request, output *ListEventSubscriptionsOutput)

ListEventSubscriptionsRequest generates a "aws/request.Request" representing the client's request for the ListEventSubscriptions operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListEventSubscriptions for more information on using the ListEventSubscriptions API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListEventSubscriptionsRequest method. req, resp := client.ListEventSubscriptionsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListEventSubscriptions

ListEventSubscriptionsWithContext

func (c *Inspector) ListEventSubscriptionsWithContext(ctx aws.Context, input *ListEventSubscriptionsInput, opts ...request.Option) (*ListEventSubscriptionsOutput, error)

ListEventSubscriptionsWithContext is the same as ListEventSubscriptions with the addition of the ability to pass a context and additional request options.

See ListEventSubscriptions for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListExclusions

func (c *Inspector) ListExclusions(input *ListExclusionsInput) (*ListExclusionsOutput, error)

ListExclusions API operation for Amazon Inspector.

List exclusions that are generated by the assessment run.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation ListExclusions for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListExclusions

ListExclusionsPages

func (c *Inspector) ListExclusionsPages(input *ListExclusionsInput, fn func(*ListExclusionsOutput, bool) bool) error

ListExclusionsPages iterates over the pages of a ListExclusions operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListExclusions method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListExclusions operation. pageNum := 0 err := client.ListExclusionsPages(params, func(page *ListExclusionsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListExclusionsPagesWithContext

func (c *Inspector) ListExclusionsPagesWithContext(ctx aws.Context, input *ListExclusionsInput, fn func(*ListExclusionsOutput, bool) bool, opts ...request.Option) error

ListExclusionsPagesWithContext same as ListExclusionsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListExclusionsRequest

func (c *Inspector) ListExclusionsRequest(input *ListExclusionsInput) (req *request.Request, output *ListExclusionsOutput)

ListExclusionsRequest generates a "aws/request.Request" representing the client's request for the ListExclusions operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListExclusions for more information on using the ListExclusions API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListExclusionsRequest method. req, resp := client.ListExclusionsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListExclusions

ListExclusionsWithContext

func (c *Inspector) ListExclusionsWithContext(ctx aws.Context, input *ListExclusionsInput, opts ...request.Option) (*ListExclusionsOutput, error)

ListExclusionsWithContext is the same as ListExclusions with the addition of the ability to pass a context and additional request options.

See ListExclusions for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListFindings

func (c *Inspector) ListFindings(input *ListFindingsInput) (*ListFindingsOutput, error)

ListFindings API operation for Amazon Inspector.

Lists findings that are generated by the assessment runs that are specified by the ARNs of the assessment runs.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation ListFindings for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListFindings

Example

Inspector ListFindings shared00

List findings

Lists findings that are generated by the assessment runs that are specified by the ARNs of the assessment runs.

{ svc := inspector.New(session.New()) input := &inspector.ListFindingsInput{ AssessmentRunArns: []*string{ aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE"), }, MaxResults: aws.Int64(123), } result, err := svc.ListFindings(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListFindingsPages

func (c *Inspector) ListFindingsPages(input *ListFindingsInput, fn func(*ListFindingsOutput, bool) bool) error

ListFindingsPages iterates over the pages of a ListFindings operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListFindings method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListFindings operation. pageNum := 0 err := client.ListFindingsPages(params, func(page *ListFindingsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListFindingsPagesWithContext

func (c *Inspector) ListFindingsPagesWithContext(ctx aws.Context, input *ListFindingsInput, fn func(*ListFindingsOutput, bool) bool, opts ...request.Option) error

ListFindingsPagesWithContext same as ListFindingsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListFindingsRequest

func (c *Inspector) ListFindingsRequest(input *ListFindingsInput) (req *request.Request, output *ListFindingsOutput)

ListFindingsRequest generates a "aws/request.Request" representing the client's request for the ListFindings operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListFindings for more information on using the ListFindings API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListFindingsRequest method. req, resp := client.ListFindingsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListFindings

ListFindingsWithContext

func (c *Inspector) ListFindingsWithContext(ctx aws.Context, input *ListFindingsInput, opts ...request.Option) (*ListFindingsOutput, error)

ListFindingsWithContext is the same as ListFindings with the addition of the ability to pass a context and additional request options.

See ListFindings for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListRulesPackages

func (c *Inspector) ListRulesPackages(input *ListRulesPackagesInput) (*ListRulesPackagesOutput, error)

ListRulesPackages API operation for Amazon Inspector.

Lists all available Amazon Inspector rules packages.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation ListRulesPackages for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListRulesPackages

Example

Inspector ListRulesPackages shared00

List rules packages

Lists all available Amazon Inspector rules packages.

{ svc := inspector.New(session.New()) input := &inspector.ListRulesPackagesInput{ MaxResults: aws.Int64(123), } result, err := svc.ListRulesPackages(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListRulesPackagesPages

func (c *Inspector) ListRulesPackagesPages(input *ListRulesPackagesInput, fn func(*ListRulesPackagesOutput, bool) bool) error

ListRulesPackagesPages iterates over the pages of a ListRulesPackages operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See ListRulesPackages method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a ListRulesPackages operation. pageNum := 0 err := client.ListRulesPackagesPages(params, func(page *ListRulesPackagesOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

ListRulesPackagesPagesWithContext

func (c *Inspector) ListRulesPackagesPagesWithContext(ctx aws.Context, input *ListRulesPackagesInput, fn func(*ListRulesPackagesOutput, bool) bool, opts ...request.Option) error

ListRulesPackagesPagesWithContext same as ListRulesPackagesPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListRulesPackagesRequest

func (c *Inspector) ListRulesPackagesRequest(input *ListRulesPackagesInput) (req *request.Request, output *ListRulesPackagesOutput)

ListRulesPackagesRequest generates a "aws/request.Request" representing the client's request for the ListRulesPackages operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListRulesPackages for more information on using the ListRulesPackages API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListRulesPackagesRequest method. req, resp := client.ListRulesPackagesRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListRulesPackages

ListRulesPackagesWithContext

func (c *Inspector) ListRulesPackagesWithContext(ctx aws.Context, input *ListRulesPackagesInput, opts ...request.Option) (*ListRulesPackagesOutput, error)

ListRulesPackagesWithContext is the same as ListRulesPackages with the addition of the ability to pass a context and additional request options.

See ListRulesPackages for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

ListTagsForResource

func (c *Inspector) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error)

ListTagsForResource API operation for Amazon Inspector.

Lists all tags associated with an assessment template.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation ListTagsForResource for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListTagsForResource

Example

Inspector ListTagsForResource shared00

List tags for resource

Lists all tags associated with an assessment template.

{ svc := inspector.New(session.New()) input := &inspector.ListTagsForResourceInput{ ResourceArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-gcwFliYu"), } result, err := svc.ListTagsForResource(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

ListTagsForResourceRequest

func (c *Inspector) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput)

ListTagsForResourceRequest generates a "aws/request.Request" representing the client's request for the ListTagsForResource operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See ListTagsForResource for more information on using the ListTagsForResource API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the ListTagsForResourceRequest method. req, resp := client.ListTagsForResourceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListTagsForResource

ListTagsForResourceWithContext

func (c *Inspector) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error)

ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of the ability to pass a context and additional request options.

See ListTagsForResource for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

PreviewAgents

func (c *Inspector) PreviewAgents(input *PreviewAgentsInput) (*PreviewAgentsOutput, error)

PreviewAgents API operation for Amazon Inspector.

Previews the agents installed on the EC2 instances that are part of the specified assessment target.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation PreviewAgents for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeInvalidCrossAccountRoleException "InvalidCrossAccountRoleException" Amazon Inspector cannot assume the cross-account role that it needs to list your EC2 instances during the assessment run.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/PreviewAgents

Example

Inspector PreviewAgents shared00

Preview agents

Previews the agents installed on the EC2 instances that are part of the specified assessment target.

{ svc := inspector.New(session.New()) input := &inspector.PreviewAgentsInput{ MaxResults: aws.Int64(123), PreviewAgentsArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq"), } result, err := svc.PreviewAgents(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeInvalidCrossAccountRoleException: fmt.Println(inspector.ErrCodeInvalidCrossAccountRoleException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

PreviewAgentsPages

func (c *Inspector) PreviewAgentsPages(input *PreviewAgentsInput, fn func(*PreviewAgentsOutput, bool) bool) error

PreviewAgentsPages iterates over the pages of a PreviewAgents operation, calling the "fn" function with the response data for each page. To stop iterating, return false from the fn function.

See PreviewAgents method for more information on how to use this operation.

Note: This operation can generate multiple requests to a service.

// Example iterating over at most 3 pages of a PreviewAgents operation. pageNum := 0 err := client.PreviewAgentsPages(params, func(page *PreviewAgentsOutput, lastPage bool) bool { pageNum++ fmt.Println(page) return pageNum <= 3 })

See Also

For more information about using this API, see AWS API Documentation.

PreviewAgentsPagesWithContext

func (c *Inspector) PreviewAgentsPagesWithContext(ctx aws.Context, input *PreviewAgentsInput, fn func(*PreviewAgentsOutput, bool) bool, opts ...request.Option) error

PreviewAgentsPagesWithContext same as PreviewAgentsPages except it takes a Context and allows setting request options on the pages.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

PreviewAgentsRequest

func (c *Inspector) PreviewAgentsRequest(input *PreviewAgentsInput) (req *request.Request, output *PreviewAgentsOutput)

PreviewAgentsRequest generates a "aws/request.Request" representing the client's request for the PreviewAgents operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See PreviewAgents for more information on using the PreviewAgents API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the PreviewAgentsRequest method. req, resp := client.PreviewAgentsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/PreviewAgents

PreviewAgentsWithContext

func (c *Inspector) PreviewAgentsWithContext(ctx aws.Context, input *PreviewAgentsInput, opts ...request.Option) (*PreviewAgentsOutput, error)

PreviewAgentsWithContext is the same as PreviewAgents with the addition of the ability to pass a context and additional request options.

See PreviewAgents for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

RegisterCrossAccountAccessRole

func (c *Inspector) RegisterCrossAccountAccessRole(input *RegisterCrossAccountAccessRoleInput) (*RegisterCrossAccountAccessRoleOutput, error)

RegisterCrossAccountAccessRole API operation for Amazon Inspector.

Registers the IAM role that grants Amazon Inspector access to AWS Services needed to perform security assessments.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation RegisterCrossAccountAccessRole for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeInvalidCrossAccountRoleException "InvalidCrossAccountRoleException" Amazon Inspector cannot assume the cross-account role that it needs to list your EC2 instances during the assessment run.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RegisterCrossAccountAccessRole

Example

Inspector RegisterCrossAccountAccessRole shared00

Register cross account access role

Registers the IAM role that Amazon Inspector uses to list your EC2 instances at the start of the assessment run or when you call the PreviewAgents action.

{ svc := inspector.New(session.New()) input := &inspector.RegisterCrossAccountAccessRoleInput{ RoleArn: aws.String("arn:aws:iam::123456789012:role/inspector"), } result, err := svc.RegisterCrossAccountAccessRole(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeInvalidCrossAccountRoleException: fmt.Println(inspector.ErrCodeInvalidCrossAccountRoleException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

RegisterCrossAccountAccessRoleRequest

func (c *Inspector) RegisterCrossAccountAccessRoleRequest(input *RegisterCrossAccountAccessRoleInput) (req *request.Request, output *RegisterCrossAccountAccessRoleOutput)

RegisterCrossAccountAccessRoleRequest generates a "aws/request.Request" representing the client's request for the RegisterCrossAccountAccessRole operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See RegisterCrossAccountAccessRole for more information on using the RegisterCrossAccountAccessRole API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the RegisterCrossAccountAccessRoleRequest method. req, resp := client.RegisterCrossAccountAccessRoleRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RegisterCrossAccountAccessRole

RegisterCrossAccountAccessRoleWithContext

func (c *Inspector) RegisterCrossAccountAccessRoleWithContext(ctx aws.Context, input *RegisterCrossAccountAccessRoleInput, opts ...request.Option) (*RegisterCrossAccountAccessRoleOutput, error)

RegisterCrossAccountAccessRoleWithContext is the same as RegisterCrossAccountAccessRole with the addition of the ability to pass a context and additional request options.

See RegisterCrossAccountAccessRole for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

RemoveAttributesFromFindings

func (c *Inspector) RemoveAttributesFromFindings(input *RemoveAttributesFromFindingsInput) (*RemoveAttributesFromFindingsOutput, error)

RemoveAttributesFromFindings API operation for Amazon Inspector.

Removes entire attributes (key and value pairs) from the findings that are specified by the ARNs of the findings where an attribute with the specified key exists.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation RemoveAttributesFromFindings for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RemoveAttributesFromFindings

Example

Inspector RemoveAttributesFromFindings shared00

Remove attributes from findings

Removes entire attributes (key and value pairs) from the findings that are specified by the ARNs of the findings where an attribute with the specified key exists.

{ svc := inspector.New(session.New()) input := &inspector.RemoveAttributesFromFindingsInput{ AttributeKeys: []*string{ aws.String("key=Example,value=example"), }, FindingArns: []*string{ aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU"), }, } result, err := svc.RemoveAttributesFromFindings(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

RemoveAttributesFromFindingsRequest

func (c *Inspector) RemoveAttributesFromFindingsRequest(input *RemoveAttributesFromFindingsInput) (req *request.Request, output *RemoveAttributesFromFindingsOutput)

RemoveAttributesFromFindingsRequest generates a "aws/request.Request" representing the client's request for the RemoveAttributesFromFindings operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See RemoveAttributesFromFindings for more information on using the RemoveAttributesFromFindings API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the RemoveAttributesFromFindingsRequest method. req, resp := client.RemoveAttributesFromFindingsRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RemoveAttributesFromFindings

RemoveAttributesFromFindingsWithContext

func (c *Inspector) RemoveAttributesFromFindingsWithContext(ctx aws.Context, input *RemoveAttributesFromFindingsInput, opts ...request.Option) (*RemoveAttributesFromFindingsOutput, error)

RemoveAttributesFromFindingsWithContext is the same as RemoveAttributesFromFindings with the addition of the ability to pass a context and additional request options.

See RemoveAttributesFromFindings for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

SetTagsForResource

func (c *Inspector) SetTagsForResource(input *SetTagsForResourceInput) (*SetTagsForResourceOutput, error)

SetTagsForResource API operation for Amazon Inspector.

Sets tags (key and value pairs) to the assessment template that is specified by the ARN of the assessment template.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation SetTagsForResource for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SetTagsForResource

Example

Inspector SetTagsForResource shared00

Set tags for resource

Sets tags (key and value pairs) to the assessment template that is specified by the ARN of the assessment template.

{ svc := inspector.New(session.New()) input := &inspector.SetTagsForResourceInput{ ResourceArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0"), Tags: []*inspector.Tag{ { Key: aws.String("Example"), Value: aws.String("example"), }, }, } result, err := svc.SetTagsForResource(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

SetTagsForResourceRequest

func (c *Inspector) SetTagsForResourceRequest(input *SetTagsForResourceInput) (req *request.Request, output *SetTagsForResourceOutput)

SetTagsForResourceRequest generates a "aws/request.Request" representing the client's request for the SetTagsForResource operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See SetTagsForResource for more information on using the SetTagsForResource API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the SetTagsForResourceRequest method. req, resp := client.SetTagsForResourceRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SetTagsForResource

SetTagsForResourceWithContext

func (c *Inspector) SetTagsForResourceWithContext(ctx aws.Context, input *SetTagsForResourceInput, opts ...request.Option) (*SetTagsForResourceOutput, error)

SetTagsForResourceWithContext is the same as SetTagsForResource with the addition of the ability to pass a context and additional request options.

See SetTagsForResource for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

StartAssessmentRun

func (c *Inspector) StartAssessmentRun(input *StartAssessmentRunInput) (*StartAssessmentRunOutput, error)

StartAssessmentRun API operation for Amazon Inspector.

Starts the assessment run specified by the ARN of the assessment template. For this API to function properly, you must not exceed the limit of running up to 500 concurrent agents per AWS account.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation StartAssessmentRun for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeLimitExceededException "LimitExceededException" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error code describes the limit exceeded.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeInvalidCrossAccountRoleException "InvalidCrossAccountRoleException" Amazon Inspector cannot assume the cross-account role that it needs to list your EC2 instances during the assessment run.

  • ErrCodeAgentsAlreadyRunningAssessmentException "AgentsAlreadyRunningAssessmentException" You started an assessment run, but one of the instances is already participating in another assessment run.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StartAssessmentRun

Example

Inspector StartAssessmentRun shared00

Start assessment run

Starts the assessment run specified by the ARN of the assessment template. For this API to function properly, you must not exceed the limit of running up to 500 concurrent agents per AWS account.

{ svc := inspector.New(session.New()) input := &inspector.StartAssessmentRunInput{ AssessmentRunName: aws.String("examplerun"), AssessmentTemplateArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T"), } result, err := svc.StartAssessmentRun(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeLimitExceededException: fmt.Println(inspector.ErrCodeLimitExceededException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeInvalidCrossAccountRoleException: fmt.Println(inspector.ErrCodeInvalidCrossAccountRoleException, aerr.Error()) case inspector.ErrCodeAgentsAlreadyRunningAssessmentException: fmt.Println(inspector.ErrCodeAgentsAlreadyRunningAssessmentException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

StartAssessmentRunRequest

func (c *Inspector) StartAssessmentRunRequest(input *StartAssessmentRunInput) (req *request.Request, output *StartAssessmentRunOutput)

StartAssessmentRunRequest generates a "aws/request.Request" representing the client's request for the StartAssessmentRun operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See StartAssessmentRun for more information on using the StartAssessmentRun API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the StartAssessmentRunRequest method. req, resp := client.StartAssessmentRunRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StartAssessmentRun

StartAssessmentRunWithContext

func (c *Inspector) StartAssessmentRunWithContext(ctx aws.Context, input *StartAssessmentRunInput, opts ...request.Option) (*StartAssessmentRunOutput, error)

StartAssessmentRunWithContext is the same as StartAssessmentRun with the addition of the ability to pass a context and additional request options.

See StartAssessmentRun for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

StopAssessmentRun

func (c *Inspector) StopAssessmentRun(input *StopAssessmentRunInput) (*StopAssessmentRunOutput, error)

StopAssessmentRun API operation for Amazon Inspector.

Stops the assessment run that is specified by the ARN of the assessment run.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation StopAssessmentRun for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StopAssessmentRun

Example

Inspector StopAssessmentRun shared00

Stop assessment run

Stops the assessment run that is specified by the ARN of the assessment run.

{ svc := inspector.New(session.New()) input := &inspector.StopAssessmentRunInput{ AssessmentRunArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-11LMTAVe"), } result, err := svc.StopAssessmentRun(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

StopAssessmentRunRequest

func (c *Inspector) StopAssessmentRunRequest(input *StopAssessmentRunInput) (req *request.Request, output *StopAssessmentRunOutput)

StopAssessmentRunRequest generates a "aws/request.Request" representing the client's request for the StopAssessmentRun operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See StopAssessmentRun for more information on using the StopAssessmentRun API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the StopAssessmentRunRequest method. req, resp := client.StopAssessmentRunRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StopAssessmentRun

StopAssessmentRunWithContext

func (c *Inspector) StopAssessmentRunWithContext(ctx aws.Context, input *StopAssessmentRunInput, opts ...request.Option) (*StopAssessmentRunOutput, error)

StopAssessmentRunWithContext is the same as StopAssessmentRun with the addition of the ability to pass a context and additional request options.

See StopAssessmentRun for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

SubscribeToEvent

func (c *Inspector) SubscribeToEvent(input *SubscribeToEventInput) (*SubscribeToEventOutput, error)

SubscribeToEvent API operation for Amazon Inspector.

Enables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation SubscribeToEvent for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeLimitExceededException "LimitExceededException" The request was rejected because it attempted to create resources beyond the current AWS account limits. The error code describes the limit exceeded.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SubscribeToEvent

Example

Inspector SubscribeToEvent shared00

Subscribe to event

Enables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.

{ svc := inspector.New(session.New()) input := &inspector.SubscribeToEventInput{ Event: aws.String("ASSESSMENT_RUN_COMPLETED"), ResourceArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0"), TopicArn: aws.String("arn:aws:sns:us-west-2:123456789012:exampletopic"), } result, err := svc.SubscribeToEvent(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeLimitExceededException: fmt.Println(inspector.ErrCodeLimitExceededException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

SubscribeToEventRequest

func (c *Inspector) SubscribeToEventRequest(input *SubscribeToEventInput) (req *request.Request, output *SubscribeToEventOutput)

SubscribeToEventRequest generates a "aws/request.Request" representing the client's request for the SubscribeToEvent operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See SubscribeToEvent for more information on using the SubscribeToEvent API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the SubscribeToEventRequest method. req, resp := client.SubscribeToEventRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SubscribeToEvent

SubscribeToEventWithContext

func (c *Inspector) SubscribeToEventWithContext(ctx aws.Context, input *SubscribeToEventInput, opts ...request.Option) (*SubscribeToEventOutput, error)

SubscribeToEventWithContext is the same as SubscribeToEvent with the addition of the ability to pass a context and additional request options.

See SubscribeToEvent for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

UnsubscribeFromEvent

func (c *Inspector) UnsubscribeFromEvent(input *UnsubscribeFromEventInput) (*UnsubscribeFromEventOutput, error)

UnsubscribeFromEvent API operation for Amazon Inspector.

Disables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation UnsubscribeFromEvent for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UnsubscribeFromEvent

Example

Inspector UnsubscribeFromEvent shared00

Unsubscribe from event

Disables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.

{ svc := inspector.New(session.New()) input := &inspector.UnsubscribeFromEventInput{ Event: aws.String("ASSESSMENT_RUN_COMPLETED"), ResourceArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0"), TopicArn: aws.String("arn:aws:sns:us-west-2:123456789012:exampletopic"), } result, err := svc.UnsubscribeFromEvent(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

UnsubscribeFromEventRequest

func (c *Inspector) UnsubscribeFromEventRequest(input *UnsubscribeFromEventInput) (req *request.Request, output *UnsubscribeFromEventOutput)

UnsubscribeFromEventRequest generates a "aws/request.Request" representing the client's request for the UnsubscribeFromEvent operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See UnsubscribeFromEvent for more information on using the UnsubscribeFromEvent API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the UnsubscribeFromEventRequest method. req, resp := client.UnsubscribeFromEventRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UnsubscribeFromEvent

UnsubscribeFromEventWithContext

func (c *Inspector) UnsubscribeFromEventWithContext(ctx aws.Context, input *UnsubscribeFromEventInput, opts ...request.Option) (*UnsubscribeFromEventOutput, error)

UnsubscribeFromEventWithContext is the same as UnsubscribeFromEvent with the addition of the ability to pass a context and additional request options.

See UnsubscribeFromEvent for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

UpdateAssessmentTarget

func (c *Inspector) UpdateAssessmentTarget(input *UpdateAssessmentTargetInput) (*UpdateAssessmentTargetOutput, error)

UpdateAssessmentTarget API operation for Amazon Inspector.

Updates the assessment target that is specified by the ARN of the assessment target.

If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

Returns awserr.Error for service API and SDK errors. Use runtime type assertions with awserr.Error's Code and Message methods to get detailed information about the error.

See the AWS API reference guide for Amazon Inspector's API operation UpdateAssessmentTarget for usage and error information.

Returned Error Codes:

  • ErrCodeInternalException "InternalException" Internal server error.

  • ErrCodeInvalidInputException "InvalidInputException" The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

  • ErrCodeAccessDeniedException "AccessDeniedException" You do not have required permissions to access the requested resource.

  • ErrCodeNoSuchEntityException "NoSuchEntityException" The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

  • ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" The serice is temporary unavailable.

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UpdateAssessmentTarget

Example

Inspector UpdateAssessmentTarget shared00

Update assessment target

Updates the assessment target that is specified by the ARN of the assessment target.

{ svc := inspector.New(session.New()) input := &inspector.UpdateAssessmentTargetInput{ AssessmentTargetArn: aws.String("arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX"), AssessmentTargetName: aws.String("Example"), ResourceGroupArn: aws.String("arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-yNbgL5Pt"), } result, err := svc.UpdateAssessmentTarget(input) if err != nil { if aerr, ok := err.(awserr.Error); ok { switch aerr.Code() { case inspector.ErrCodeInternalException: fmt.Println(inspector.ErrCodeInternalException, aerr.Error()) case inspector.ErrCodeInvalidInputException: fmt.Println(inspector.ErrCodeInvalidInputException, aerr.Error()) case inspector.ErrCodeAccessDeniedException: fmt.Println(inspector.ErrCodeAccessDeniedException, aerr.Error()) case inspector.ErrCodeNoSuchEntityException: fmt.Println(inspector.ErrCodeNoSuchEntityException, aerr.Error()) case inspector.ErrCodeServiceTemporarilyUnavailableException: fmt.Println(inspector.ErrCodeServiceTemporarilyUnavailableException, aerr.Error()) default: fmt.Println(aerr.Error()) } } else { fmt.Println(err.Error()) } return } fmt.Println(result) }

UpdateAssessmentTargetRequest

func (c *Inspector) UpdateAssessmentTargetRequest(input *UpdateAssessmentTargetInput) (req *request.Request, output *UpdateAssessmentTargetOutput)

UpdateAssessmentTargetRequest generates a "aws/request.Request" representing the client's request for the UpdateAssessmentTarget operation. The "output" return value will be populated with the request's response once the request completes successfully.

Use "Send" method on the returned Request to send the API call to the service. the "output" return value is not valid until after Send returns without error.

See UpdateAssessmentTarget for more information on using the UpdateAssessmentTarget API call, and error handling.

This method is useful when you want to inject custom logic or configuration into the SDK's request lifecycle. Such as custom headers, or retry logic.

// Example sending a request using the UpdateAssessmentTargetRequest method. req, resp := client.UpdateAssessmentTargetRequest(params) err := req.Send() if err == nil { // resp is now filled fmt.Println(resp) }

See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UpdateAssessmentTarget

UpdateAssessmentTargetWithContext

func (c *Inspector) UpdateAssessmentTargetWithContext(ctx aws.Context, input *UpdateAssessmentTargetInput, opts ...request.Option) (*UpdateAssessmentTargetOutput, error)

UpdateAssessmentTargetWithContext is the same as UpdateAssessmentTarget with the addition of the ability to pass a context and additional request options.

See UpdateAssessmentTarget for details on how to use this API operation.

The context must be non-nil and will be used for request cancellation. If the context is nil a panic will occur. In the future the SDK may create sub-contexts for http.Requests. See https://golang.org/pkg/context/ for more information on using Contexts.

See Also

For more information about using this API, see AWS API Documentation.

On this page: