list_resources
async
¶
list_resources(
*,
config_overrides: Optional[AsyncResourceExplorer2ClientConfig] = None,
filters: Optional[SearchFilter] = None,
max_results: Optional[int] = None,
view_arn: Optional[str] = None,
next_token: Optional[str] = None,
) -> ListResourcesOutput
Returns a list of resources and their details that match the specified criteria. This query must use a view. If you don’t explicitly specify a view, then Resource Explorer uses the default view for the Amazon Web Services Region in which you call this operation.
Parameters:
-
filters(Optional[SearchFilter], default:None) –An array of strings that specify which resources are included in the results of queries made using this view. When you use this view in a Search operation, the filter string is combined with the search's
QueryStringparameter using a logicalANDoperator.For information about the supported syntax, see Search query reference for Resource Explorer in the Amazon Web Services Resource Explorer User Guide.
This query string in the context of this operation supports only filter prefixes with optional operators. It doesn't support free-form text. For example, the string
region:us* service:ec2 -tag:stage=prodincludes all Amazon EC2 resources in any Amazon Web Services Region that begins with the lettersusand is not tagged with a keyStagethat has the valueprod. -
max_results(Optional[int], default:None) –The maximum number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value appropriate to the operation. If additional items exist beyond those included in the current response, the
NextTokenresponse element is present and has a value (is not null). Include that value as theNextTokenrequest parameter in the next call to the operation to get the next part of the results.An API operation can return fewer results than the maximum even when there are more results available. You should check
NextTokenafter every operation to ensure that you receive all of the results. -
view_arn(Optional[str], default:None) –Specifies the Amazon resource name (ARN) of the view to use for the query. If you don't specify a value for this parameter, then the operation automatically uses the default view for the Amazon Web Services Region in which you called this operation. If the Region either doesn't have a default view or if you don't have permission to use the default view, then the operation fails with a 401 Unauthorized exception.
-
next_token(Optional[str], default:None) –The parameter for receiving additional results if you receive a
NextTokenresponse in a previous request. ANextTokenresponse indicates that more output is available. Set this parameter to the value of the previous call'sNextTokenresponse to indicate where the output should continue from. The pagination tokens expire after 24 hours.The
ListResourcesoperation does not generate aNextTokenif you setMaxResultsto 1000.
Raises:
-
AccessDeniedException–The credentials that you used to call this operation don't have the minimum required permissions.
-
InternalServerException–The request failed because of internal service error. Try your request again later.
-
ResourceNotFoundException–You specified a resource that doesn't exist. Check the ID or ARN that you used to identity the resource, and try again.
-
ThrottlingException–The request failed because you exceeded a rate limit for this operation. For more information, see Quotas for Resource Explorer.
-
UnauthorizedException–The principal making the request isn't permitted to perform the operation.
-
ValidationException–You provided an invalid value for one of the operation's parameters. Check the syntax for the operation, and try again.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_resource_explorer_2/_services/async_resource_explorer2.py
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 | |