MCPcopy Index your code
hub / github.com/aws/aws-cli / list_api_versions

Method list_api_versions

awscli/botocore/loaders.py:326–353  ·  view source on GitHub ↗

List all API versions available for a particular service type :type service_name: str :param service_name: The name of the service :type type_name: str :param type_name: The type name for the service (i.e service-2, paginators-1, etc.) :rtype: l

(self, service_name, type_name)

Source from the content-addressed store, hash-verified

324
325 @instance_cache
326 def list_api_versions(self, service_name, type_name):
327 """List all API versions available for a particular service type
328
329 :type service_name: str
330 :param service_name: The name of the service
331
332 :type type_name: str
333 :param type_name: The type name for the service (i.e service-2,
334 paginators-1, etc.)
335
336 :rtype: list
337 :return: A list of API version strings in sorted order.
338
339 """
340 known_api_versions = set()
341 for possible_path in self._potential_locations(
342 service_name, must_exist=True, is_dir=True
343 ):
344 for dirname in os.listdir(possible_path):
345 full_path = os.path.join(possible_path, dirname, type_name)
346 # Only add to the known_api_versions if the directory
347 # contains a service-2, paginators-1, etc. file corresponding
348 # to the type_name passed in.
349 if self.file_loader.exists(full_path):
350 known_api_versions.add(dirname)
351 if not known_api_versions:
352 raise DataNotFoundError(data_path=service_name)
353 return sorted(known_api_versions)
354
355 @instance_cache
356 def load_service_model(self, service_name, type_name, api_version=None):

Calls 4

_potential_locationsMethod · 0.95
DataNotFoundErrorClass · 0.90
existsMethod · 0.80
addMethod · 0.45