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
5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 | |