Skip to content

InspectorClient#

Index > Inspector > InspectorClient

Auto-generated documentation for Inspector type annotations stubs module mypy-boto3-inspector.

InspectorClient#

Type annotations and code completion for boto3.client("inspector"). boto3 documentation

# InspectorClient usage example

from boto3.session import Session
from mypy_boto3_inspector.client import InspectorClient

def get_inspector_client() -> InspectorClient:
    return Session().client("inspector")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("inspector").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("inspector")

try:
    do_something(client)
except (
    client.exceptions.AccessDeniedException,
    client.exceptions.AgentsAlreadyRunningAssessmentException,
    client.exceptions.AssessmentRunInProgressException,
    client.exceptions.ClientError,
    client.exceptions.InternalException,
    client.exceptions.InvalidCrossAccountRoleException,
    client.exceptions.InvalidInputException,
    client.exceptions.LimitExceededException,
    client.exceptions.NoSuchEntityException,
    client.exceptions.PreviewGenerationInProgressException,
    client.exceptions.ServiceTemporarilyUnavailableException,
    client.exceptions.UnsupportedFeatureException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_inspector.client import Exceptions

def handle_error(exc: Exceptions.AccessDeniedException) -> None:
    ...

Methods#

add_attributes_to_findings#

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

Type annotations and code completion for boto3.client("inspector").add_attributes_to_findings method. boto3 documentation

# add_attributes_to_findings method definition

def add_attributes_to_findings(
    self,
    *,
    findingArns: Sequence[str],
    attributes: Sequence[AttributeTypeDef],  # (1)
) -> AddAttributesToFindingsResponseTypeDef:  # (2)
    ...
  1. See AttributeTypeDef
  2. See AddAttributesToFindingsResponseTypeDef
# add_attributes_to_findings method usage example with argument unpacking

kwargs: AddAttributesToFindingsRequestRequestTypeDef = {  # (1)
    "findingArns": ...,
    "attributes": ...,
}

parent.add_attributes_to_findings(**kwargs)
  1. See AddAttributesToFindingsRequestRequestTypeDef

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("inspector").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close#

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("inspector").close method. boto3 documentation

# close method definition

def close(
    self,
) -> None:
    ...

create_assessment_target#

Creates a new assessment target using the ARN of the resource group that is generated by CreateResourceGroup.

Type annotations and code completion for boto3.client("inspector").create_assessment_target method. boto3 documentation

# create_assessment_target method definition

def create_assessment_target(
    self,
    *,
    assessmentTargetName: str,
    resourceGroupArn: str = ...,
) -> CreateAssessmentTargetResponseTypeDef:  # (1)
    ...
  1. See CreateAssessmentTargetResponseTypeDef
# create_assessment_target method usage example with argument unpacking

kwargs: CreateAssessmentTargetRequestRequestTypeDef = {  # (1)
    "assessmentTargetName": ...,
}

parent.create_assessment_target(**kwargs)
  1. See CreateAssessmentTargetRequestRequestTypeDef

create_assessment_template#

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

Type annotations and code completion for boto3.client("inspector").create_assessment_template method. boto3 documentation

# create_assessment_template method definition

def create_assessment_template(
    self,
    *,
    assessmentTargetArn: str,
    assessmentTemplateName: str,
    durationInSeconds: int,
    rulesPackageArns: Sequence[str],
    userAttributesForFindings: Sequence[AttributeTypeDef] = ...,  # (1)
) -> CreateAssessmentTemplateResponseTypeDef:  # (2)
    ...
  1. See AttributeTypeDef
  2. See CreateAssessmentTemplateResponseTypeDef
# create_assessment_template method usage example with argument unpacking

kwargs: CreateAssessmentTemplateRequestRequestTypeDef = {  # (1)
    "assessmentTargetArn": ...,
    "assessmentTemplateName": ...,
    "durationInSeconds": ...,
    "rulesPackageArns": ...,
}

parent.create_assessment_template(**kwargs)
  1. See CreateAssessmentTemplateRequestRequestTypeDef

create_exclusions_preview#

Starts the generation of an exclusions preview for the specified assessment template.

Type annotations and code completion for boto3.client("inspector").create_exclusions_preview method. boto3 documentation

# create_exclusions_preview method definition

def create_exclusions_preview(
    self,
    *,
    assessmentTemplateArn: str,
) -> CreateExclusionsPreviewResponseTypeDef:  # (1)
    ...
  1. See CreateExclusionsPreviewResponseTypeDef
# create_exclusions_preview method usage example with argument unpacking

kwargs: CreateExclusionsPreviewRequestRequestTypeDef = {  # (1)
    "assessmentTemplateArn": ...,
}

parent.create_exclusions_preview(**kwargs)
  1. See CreateExclusionsPreviewRequestRequestTypeDef

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.

Type annotations and code completion for boto3.client("inspector").create_resource_group method. boto3 documentation

# create_resource_group method definition

def create_resource_group(
    self,
    *,
    resourceGroupTags: Sequence[ResourceGroupTagTypeDef],  # (1)
) -> CreateResourceGroupResponseTypeDef:  # (2)
    ...
  1. See ResourceGroupTagTypeDef
  2. See CreateResourceGroupResponseTypeDef
# create_resource_group method usage example with argument unpacking

kwargs: CreateResourceGroupRequestRequestTypeDef = {  # (1)
    "resourceGroupTags": ...,
}

parent.create_resource_group(**kwargs)
  1. See CreateResourceGroupRequestRequestTypeDef

delete_assessment_run#

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

Type annotations and code completion for boto3.client("inspector").delete_assessment_run method. boto3 documentation

# delete_assessment_run method definition

def delete_assessment_run(
    self,
    *,
    assessmentRunArn: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_assessment_run method usage example with argument unpacking

kwargs: DeleteAssessmentRunRequestRequestTypeDef = {  # (1)
    "assessmentRunArn": ...,
}

parent.delete_assessment_run(**kwargs)
  1. See DeleteAssessmentRunRequestRequestTypeDef

delete_assessment_target#

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

Type annotations and code completion for boto3.client("inspector").delete_assessment_target method. boto3 documentation

# delete_assessment_target method definition

def delete_assessment_target(
    self,
    *,
    assessmentTargetArn: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_assessment_target method usage example with argument unpacking

kwargs: DeleteAssessmentTargetRequestRequestTypeDef = {  # (1)
    "assessmentTargetArn": ...,
}

parent.delete_assessment_target(**kwargs)
  1. See DeleteAssessmentTargetRequestRequestTypeDef

delete_assessment_template#

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

Type annotations and code completion for boto3.client("inspector").delete_assessment_template method. boto3 documentation

# delete_assessment_template method definition

def delete_assessment_template(
    self,
    *,
    assessmentTemplateArn: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
# delete_assessment_template method usage example with argument unpacking

kwargs: DeleteAssessmentTemplateRequestRequestTypeDef = {  # (1)
    "assessmentTemplateArn": ...,
}

parent.delete_assessment_template(**kwargs)
  1. See DeleteAssessmentTemplateRequestRequestTypeDef

describe_assessment_runs#

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

Type annotations and code completion for boto3.client("inspector").describe_assessment_runs method. boto3 documentation

# describe_assessment_runs method definition

def describe_assessment_runs(
    self,
    *,
    assessmentRunArns: Sequence[str],
) -> DescribeAssessmentRunsResponseTypeDef:  # (1)
    ...
  1. See DescribeAssessmentRunsResponseTypeDef
# describe_assessment_runs method usage example with argument unpacking

kwargs: DescribeAssessmentRunsRequestRequestTypeDef = {  # (1)
    "assessmentRunArns": ...,
}

parent.describe_assessment_runs(**kwargs)
  1. See DescribeAssessmentRunsRequestRequestTypeDef

describe_assessment_targets#

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

Type annotations and code completion for boto3.client("inspector").describe_assessment_targets method. boto3 documentation

# describe_assessment_targets method definition

def describe_assessment_targets(
    self,
    *,
    assessmentTargetArns: Sequence[str],
) -> DescribeAssessmentTargetsResponseTypeDef:  # (1)
    ...
  1. See DescribeAssessmentTargetsResponseTypeDef
# describe_assessment_targets method usage example with argument unpacking

kwargs: DescribeAssessmentTargetsRequestRequestTypeDef = {  # (1)
    "assessmentTargetArns": ...,
}

parent.describe_assessment_targets(**kwargs)
  1. See DescribeAssessmentTargetsRequestRequestTypeDef

describe_assessment_templates#

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

Type annotations and code completion for boto3.client("inspector").describe_assessment_templates method. boto3 documentation

# describe_assessment_templates method definition

def describe_assessment_templates(
    self,
    *,
    assessmentTemplateArns: Sequence[str],
) -> DescribeAssessmentTemplatesResponseTypeDef:  # (1)
    ...
  1. See DescribeAssessmentTemplatesResponseTypeDef
# describe_assessment_templates method usage example with argument unpacking

kwargs: DescribeAssessmentTemplatesRequestRequestTypeDef = {  # (1)
    "assessmentTemplateArns": ...,
}

parent.describe_assessment_templates(**kwargs)
  1. See DescribeAssessmentTemplatesRequestRequestTypeDef

describe_cross_account_access_role#

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

Type annotations and code completion for boto3.client("inspector").describe_cross_account_access_role method. boto3 documentation

# describe_cross_account_access_role method definition

def describe_cross_account_access_role(
    self,
) -> DescribeCrossAccountAccessRoleResponseTypeDef:  # (1)
    ...
  1. See DescribeCrossAccountAccessRoleResponseTypeDef

describe_exclusions#

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

Type annotations and code completion for boto3.client("inspector").describe_exclusions method.