list_services
async
¶
list_services(
*,
config_overrides: Optional[AsyncECSClientConfig] = None,
cluster: Optional[String] = None,
next_token: Optional[String] = None,
max_results: Optional[BoxedInteger] = None,
launch_type: Optional[LaunchType] = None,
scheduling_strategy: Optional[SchedulingStrategy] = None,
resource_management_type: Optional[ResourceManagementType] = None,
) -> ListServicesResponse
Returns a list of services. You can filter the results by cluster, launch type, and scheduling strategy.
Parameters:
-
cluster(Optional[String], default:None) –The short name or full Amazon Resource Name (ARN) of the cluster to use when filtering the
ListServicesresults. If you do not specify a cluster, the default cluster is assumed. -
next_token(Optional[String], default:None) –The
nextTokenvalue returned from aListServicesrequest indicating that more results are available to fulfill the request and further calls will be needed. IfmaxResultswas provided, it is possible the number of results to be fewer thanmaxResults.This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
-
max_results(Optional[BoxedInteger], default:None) –The maximum number of service results that
ListServicesreturned in paginated output. When this parameter is used,ListServicesonly returnsmaxResultsresults in a single page along with anextTokenresponse element. The remaining results of the initial request can be seen by sending anotherListServicesrequest with the returnednextTokenvalue. This value can be between 1 and 100. If this parameter isn't used, thenListServicesreturns up to 10 results and anextTokenvalue if applicable. -
launch_type(Optional[LaunchType], default:None) –The launch type to use when filtering the
ListServicesresults. -
scheduling_strategy(Optional[SchedulingStrategy], default:None) –The scheduling strategy to use when filtering the
ListServicesresults. -
resource_management_type(Optional[ResourceManagementType], default:None) –The resourceManagementType type to use when filtering the
ListServicesresults.
Raises:
-
AccessDeniedException–You don't have authorization to perform the requested action.
-
ClientException–These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.
-
ClusterNotFoundException–The specified cluster wasn't found. You can view your available clusters with ListClusters. Amazon ECS clusters are Region specific.
-
InvalidParameterException–The specified parameter isn't valid. Review the available parameters for the API request.
For more information about service event errors, see Amazon ECS service event messages.
-
ServerException–These errors are usually caused by a server issue.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To list the services in a cluster This example lists the services running in the default cluster for an account.
Source code in docs_src/capo_ecs/_services/async_ecs.py
4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 | |