Retrieves the exposure findings tied to a specific remediation target. Results are sorted by previous severity, highest first, and are paginated.
Parameters:
-
target_uid
(Optional[RemediationStringUid], default:
None
)
–
The unique identifier (ID) of an existing remediation target to list exposure findings for.
-
max_results
(Optional[MaxResults], default:
None
)
–
The maximum number of results to return. Valid range is 1-100. If you don't specify a value, the operation returns up to 25 results.
-
next_token
(Optional[NextToken], default:
None
)
–
The token used to paginate the exposures list returned. On your first call to ListExposuresByRemediationV2, omit this parameter or set it to NULL. For subsequent calls, use the NextToken value returned in the previous response to retrieve the next page of results.
Raises:
Source code in docs_src/capo_securityhub/_services/security_hub.py
| def list_exposures_by_remediation_v2(
self,
*,
config_overrides: Optional[SecurityHubClientConfig] = None,
target_uid: Optional[
"capo_securityhub.types.remediation_string_uid.RemediationStringUid"
] = None,
max_results: Optional["capo_securityhub.types.max_results.MaxResults"] = None,
next_token: Optional["capo_securityhub.types.next_token.NextToken"] = None,
) -> "capo_securityhub.types.list_exposures_by_remediation_v2_response.ListExposuresByRemediationV2Response":
"""<p>Retrieves the exposure findings tied to a specific remediation target. Results are sorted by previous severity, highest first, and are paginated.</p>
Args:
target_uid: <p>The unique identifier (ID) of an existing remediation target to list exposure findings for.</p>
max_results: <p>The maximum number of results to return. Valid range is 1-100. If you don't specify a value, the operation returns up to 25 results.</p>
next_token: <p>The token used to paginate the exposures list returned. On your first call to <code>ListExposuresByRemediationV2</code>, omit this parameter or set it to <code>NULL</code>. For subsequent calls, use the <code>NextToken</code> value returned in the previous response to retrieve the next page of results.</p>
Raises:
capo_securityhub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permission to perform the action specified in the request.</p>
capo_securityhub.errors.internal_server_exception.InternalServerException: <p> The request has failed due to an internal failure of the service. </p>
capo_securityhub.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because we can't find the specified resource.</p>
capo_securityhub.errors.throttling_exception.ThrottlingException: <p> The limit on the number of requests per second was exceeded. </p>
capo_securityhub.errors.validation_exception.ValidationException: <p>The request has failed validation because it's missing required fields or has invalid inputs.</p>
capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_securityhub.types.list_exposures_by_remediation_v2_request.ListExposuresByRemediationV2Request]",
) -> OperationResponse[
"capo_securityhub.types.list_exposures_by_remediation_v2_response.ListExposuresByRemediationV2Response"
]:
import capo_securityhub._operations.security_hub_api_service.list_exposures_by_remediation_v2
output, http_response = (
capo_securityhub._operations.security_hub_api_service.list_exposures_by_remediation_v2.list_exposures_by_remediation_v2(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListExposuresByRemediationV2")
)
input_: capo_securityhub.types.list_exposures_by_remediation_v2_request.ListExposuresByRemediationV2Request = {}
if target_uid is not None:
input_["target_uid"] = target_uid
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|