示例#1
0
    def test_add_instances(self):
        """Test adding instances."""
        api, mock_proxy = self.mock_api()
        job_key = AuroraJobKey("foo", "role", "env", "name")
        mock_proxy.addInstances.return_value = self.create_simple_success_response(
        )
        api.add_instances(job_key, 1, 10)

        mock_proxy.addInstances.assert_called_once_with(
            InstanceKey(jobKey=job_key.to_thrift(), instanceId=1), 10)
示例#2
0
 def add_instances(self, job_key, instance_id, count):
     key = InstanceKey(jobKey=job_key.to_thrift(), instanceId=instance_id)
     log.info(
         "Adding %s instances to %s using the task config of instance %s" %
         (count, job_key, instance_id))
     return self._scheduler_proxy.addInstances(key, count)