Gets information about CloudHSM clusters.
This is a paginated operation, which means that each response might contain only a subset of all the clusters. When the response contains only a subset of clusters, it includes a NextToken value. Use this value in a subsequent DescribeClusters request to get more clusters. When you receive a response with no NextToken (or an empty or null value), that means there are no more clusters to get.
Cross-account use: No. You cannot perform this operation on CloudHSM clusters in a different Amazon Web Services account.
Parameters:
-
filters
(Optional[Filters], default:
None
)
–
One or more filters to limit the items returned in the response.
Use the clusterIds filter to return only the specified clusters. Specify clusters by their cluster identifier (ID).
Use the vpcIds filter to return only the clusters in the specified virtual private clouds (VPCs). Specify VPCs by their VPC identifier (ID).
Use the states filter to return only clusters that match the specified state.
-
next_token
(Optional[NextToken], default:
None
)
–
The NextToken value that you received in the previous response. Use this value to get more clusters.
-
max_results
(Optional[ClustersMaxSize], default:
None
)
–
The maximum number of clusters to return in the response. When there are more clusters than the number you specify, the response contains a NextToken value.
Raises:
Source code in docs_src/capo_cloudhsm_v2/_services/cloud_hsmv2.py
| def describe_clusters(
self,
*,
config_overrides: Optional[CloudHSMV2ClientConfig] = None,
filters: Optional["capo_cloudhsm_v2.types.filters.Filters"] = None,
next_token: Optional["capo_cloudhsm_v2.types.next_token.NextToken"] = None,
max_results: Optional[
"capo_cloudhsm_v2.types.clusters_max_size.ClustersMaxSize"
] = None,
) -> "capo_cloudhsm_v2.types.describe_clusters_response.DescribeClustersResponse":
"""<p>Gets information about CloudHSM clusters.</p> <p>This is a paginated operation, which means that each response might contain only a subset of all the clusters. When the response contains only a subset of clusters, it includes a <code>NextToken</code> value. Use this value in a subsequent <code>DescribeClusters</code> request to get more clusters. When you receive a response with no <code>NextToken</code> (or an empty or null value), that means there are no more clusters to get.</p> <p> <b>Cross-account use:</b> No. You cannot perform this operation on CloudHSM clusters in a different Amazon Web Services account.</p>
Args:
filters: <p>One or more filters to limit the items returned in the response.</p> <p>Use the <code>clusterIds</code> filter to return only the specified clusters. Specify clusters by their cluster identifier (ID).</p> <p>Use the <code>vpcIds</code> filter to return only the clusters in the specified virtual private clouds (VPCs). Specify VPCs by their VPC identifier (ID).</p> <p>Use the <code>states</code> filter to return only clusters that match the specified state.</p>
next_token: <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more clusters.</p>
max_results: <p>The maximum number of clusters to return in the response. When there are more clusters than the number you specify, the response contains a <code>NextToken</code> value.</p>
Raises:
capo_cloudhsm_v2.errors.cloud_hsm_access_denied_exception.CloudHsmAccessDeniedException: <p>The request was rejected because the requester does not have permission to perform the requested operation.</p>
capo_cloudhsm_v2.errors.cloud_hsm_internal_failure_exception.CloudHsmInternalFailureException: <p>The request was rejected because of an CloudHSM internal failure. The request can be retried.</p>
capo_cloudhsm_v2.errors.cloud_hsm_invalid_request_exception.CloudHsmInvalidRequestException: <p>The request was rejected because it is not a valid request.</p>
capo_cloudhsm_v2.errors.cloud_hsm_service_exception.CloudHsmServiceException: <p>The request was rejected because an error occurred.</p>
capo_cloudhsm_v2.errors.cloud_hsm_tag_exception.CloudHsmTagException: <p>The request was rejected because of a tagging failure. Verify the tag conditions in all applicable policies, and then retry the request.</p>
capo_cloudhsm_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudhsm_v2.types.describe_clusters_request.DescribeClustersRequest]",
) -> OperationResponse[
"capo_cloudhsm_v2.types.describe_clusters_response.DescribeClustersResponse"
]:
import capo_cloudhsm_v2._operations.baldr_api_service.describe_clusters
output, http_response = (
capo_cloudhsm_v2._operations.baldr_api_service.describe_clusters.describe_clusters(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeClusters")
)
input_: capo_cloudhsm_v2.types.describe_clusters_request.DescribeClustersRequest = {}
if filters is not None:
input_["filters"] = filters
if next_token is not None:
input_["next_token"] = next_token
if max_results is not None:
input_["max_results"] = max_results
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|