list_services
¶
list_services(
*,
config_overrides: Optional[ECSClientConfig] = 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/ecs.py
4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 | |