Lists the synchronization statuses of the resources covered by the specified deployment. You can filter the results by synchronization status and page through them.
Parameters:
-
deployment_identifier
(DeploymentIdentifier)
–
The identifier of the deployment to list synchronization statuses for. This is the deployment's Amazon Resource Name (ARN).
-
synchronization_status
(Optional[SynchronizationStatus], default:
None
)
–
Filters the results by synchronization status, such as IN_SYNC or OUT_OF_SYNC.
-
max_results
(Optional[MaxResults], default:
None
)
–
The maximum number of results to return in a single call. Valid range: 1-100. To retrieve the remaining results, use the returned nextToken value in a subsequent call.
-
next_token
(Optional[NextToken], default:
None
)
–
The token for the next page of results. To retrieve the next page, call the operation again and provide this value. When there are no more results, this value is null.
Raises:
-
AccessDeniedException
–
You do not have sufficient permissions to perform this action.
-
InternalServerException
–
The request processing failed because of an internal error in the service. This is a retryable error.
-
ResourceNotFoundException
–
The specified resource was not found. Verify that the resource identifier is correct and that the resource exists, then try your request again.
-
ThrottlingException
–
The request was denied because of request throttling. Reduce your request rate and try again.
-
ValidationException
–
The request failed validation. For details, see the reason and fieldList members of the response.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
List out-of-sync resources for a deployment
Lists the resources tracked by a deployment that are out of sync, including the structured reason. Here a CloudFront distribution has no web ACL where the policy requires one.
>>> await client.list_resource_synchronization_statuses(deployment_identifier='arn:aws:network-security-manager:us-east-1:123456789012:deployment:def456', synchronization_status='OUT_OF_SYNC', max_results=10)
Source code in docs_src/capo_network_security_manager/_services/async_network_security_manager.py
| async def list_resource_synchronization_statuses(
self,
deployment_identifier: "capo_network_security_manager.types.deployment_identifier.DeploymentIdentifier",
*,
config_overrides: Optional[AsyncNetworkSecurityManagerClientConfig] = None,
synchronization_status: Optional[
"capo_network_security_manager.types.synchronization_status.SynchronizationStatus"
] = None,
max_results: Optional[
"capo_network_security_manager.types.max_results.MaxResults"
] = None,
next_token: Optional[
"capo_network_security_manager.types.next_token.NextToken"
] = None,
) -> "capo_network_security_manager.types.list_resource_synchronization_statuses_output.ListResourceSynchronizationStatusesOutput":
"""<p>Lists the synchronization statuses of the resources covered by the specified deployment. You can filter the results by synchronization status and page through them.</p>
Args:
deployment_identifier: <p>The identifier of the deployment to list synchronization statuses for. This is the deployment's Amazon Resource Name (ARN).</p>
synchronization_status: <p>Filters the results by synchronization status, such as <code>IN_SYNC</code> or <code>OUT_OF_SYNC</code>.</p>
max_results: <p>The maximum number of results to return in a single call. Valid range: 1-100. To retrieve the remaining results, use the returned <code>nextToken</code> value in a subsequent call.</p>
next_token: <p>The token for the next page of results. To retrieve the next page, call the operation again and provide this value. When there are no more results, this value is null.</p>
Raises:
capo_network_security_manager.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
capo_network_security_manager.errors.internal_server_exception.InternalServerException: <p>The request processing failed because of an internal error in the service. This is a retryable error.</p>
capo_network_security_manager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found. Verify that the resource identifier is correct and that the resource exists, then try your request again.</p>
capo_network_security_manager.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling. Reduce your request rate and try again.</p>
capo_network_security_manager.errors.validation_exception.ValidationException: <p>The request failed validation. For details, see the <code>reason</code> and <code>fieldList</code> members of the response.</p>
capo_network_security_manager.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
List out-of-sync resources for a deployment
Lists the resources tracked by a deployment that are out of sync, including the structured reason. Here a CloudFront distribution has no web ACL where the policy requires one.
>>> await client.list_resource_synchronization_statuses(deployment_identifier='arn:aws:network-security-manager:us-east-1:123456789012:deployment:def456', synchronization_status='OUT_OF_SYNC', max_results=10)
"""
async def _handler(
req: "AsyncOperationRequest[capo_network_security_manager.types.list_resource_synchronization_statuses_input.ListResourceSynchronizationStatusesInput]",
) -> AsyncOperationResponse[
"capo_network_security_manager.types.list_resource_synchronization_statuses_output.ListResourceSynchronizationStatusesOutput"
]:
import capo_network_security_manager._operations.piccolo_customer_api_service.list_resource_synchronization_statuses
(
output,
http_response,
) = await capo_network_security_manager._operations.piccolo_customer_api_service.list_resource_synchronization_statuses.async_list_resource_synchronization_statuses(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListResourceSynchronizationStatuses")
)
input_: capo_network_security_manager.types.list_resource_synchronization_statuses_input.ListResourceSynchronizationStatusesInput = {
"deployment_identifier": deployment_identifier
}
if synchronization_status is not None:
input_["synchronization_status"] = synchronization_status
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|