Ejemplo n.º 1
0
 def waiter_names(self):
     """Returns a list of all available waiters."""
     config = self._get_waiter_config()
     if not config:
         return []
     model = waiter.WaiterModel(config)
     # Waiter configs is a dict, we just want the waiter names
     # which are the keys in the dict.
     return [xform_name(name) for name in model.waiter_names]
    def get_waiter(self, waiter_name):
        config = self._get_waiter_config()
        if not config:
            raise ValueError("Waiter does not exist: %s" % waiter_name)
        model = waiter.WaiterModel(config)
        mapping = {}
        for name in model.waiter_names:
            mapping[xform_name(name)] = name
        if waiter_name not in mapping:
            raise ValueError("Waiter does not exist: %s" % waiter_name)

        return waiter.create_waiter_with_client(mapping[waiter_name], model,
                                                self)
Ejemplo n.º 3
0
    def get_waiter(self, waiter_name):
        """Returns an object that can wait for some condition.

        :type waiter_name: str
        :param waiter_name: The name of the waiter to get. See the waiters
            section of the service docs for a list of available waiters.

        :returns: The specified waiter object.
        :rtype: ibm_botocore.waiter.Waiter
        """
        config = self._get_waiter_config()
        if not config:
            raise ValueError("Waiter does not exist: %s" % waiter_name)
        model = waiter.WaiterModel(config)
        mapping = {}
        for name in model.waiter_names:
            mapping[xform_name(name)] = name
        if waiter_name not in mapping:
            raise ValueError("Waiter does not exist: %s" % waiter_name)

        return waiter.create_waiter_with_client(
            mapping[waiter_name], model, self)
Ejemplo n.º 4
0
 def get_waiter_model(self, service_name, api_version=None):
     loader = self.get_component('data_loader')
     waiter_config = loader.load_service_model(service_name, 'waiters-2',
                                               api_version)
     return waiter.WaiterModel(waiter_config)