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
5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 | |