~ubuntu-branches/ubuntu/vivid/openstack-trove/vivid

« back to all changes in this revision

Viewing changes to trove/guestagent/api.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, James Page
  • Date: 2015-04-15 14:03:27 UTC
  • mfrom: (1.1.16)
  • Revision ID: package-import@ubuntu.com-20150415140327-wwtye76elw9uu6ku
Tags: 2015.1~rc1-0ubuntu1
[ Chuck Short ]
* New upstream release.
  - d/control: Align with upstream dependencies.
  - d/p/fix-requirements.patch: Dropped
  - d/p/patch-default-config-file.patch: Rebased

[ James Page ]
* d/rules,control: Tweak unit test execution, add subunit to BD's.

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
    def prepare(self, memory_mb, packages, databases, users,
218
218
                device_path='/dev/vdb', mount_point='/mnt/volume',
219
219
                backup_info=None, config_contents=None, root_password=None,
220
 
                overrides=None, cluster_config=None):
 
220
                overrides=None, cluster_config=None, snapshot=None):
221
221
        """Make an asynchronous call to prepare the guest
222
222
           as a database container optionally includes a backup id for restores
223
223
        """
236
236
            device_path=device_path, mount_point=mount_point,
237
237
            backup_info=backup_info, config_contents=config_contents,
238
238
            root_password=root_password, overrides=overrides,
239
 
            cluster_config=cluster_config)
 
239
            cluster_config=cluster_config, snapshot=snapshot)
240
240
 
241
241
    def _create_guest_queue(self):
242
242
        """Call to construct, start and immediately stop rpc server in order
354
354
        self._cast("attach_replication_slave", self.version_cap,
355
355
                   snapshot=snapshot, slave_config=replica_config)
356
356
 
357
 
    def detach_replica(self):
 
357
    def detach_replica(self, for_failover=False):
358
358
        LOG.debug("Detaching replica %s from its replication source.", self.id)
359
359
        return self._call("detach_replica", AGENT_HIGH_TIMEOUT,
360
 
                          self.version_cap)
 
360
                          self.version_cap, for_failover=for_failover)
 
361
 
 
362
    def get_replica_context(self):
 
363
        LOG.debug("Getting replica context.")
 
364
        return self._call("get_replica_context",
 
365
                          AGENT_HIGH_TIMEOUT, self.version_cap)
 
366
 
 
367
    def attach_replica(self, replica_info, slave_config):
 
368
        LOG.debug("Attaching replica %s." % replica_info)
 
369
        self._call("attach_replica", AGENT_HIGH_TIMEOUT, self.version_cap,
 
370
                   replica_info=replica_info, slave_config=slave_config)
 
371
 
 
372
    def make_read_only(self, read_only):
 
373
        LOG.debug("Executing make_read_only(%s)" % read_only)
 
374
        self._call("make_read_only", AGENT_HIGH_TIMEOUT, self.version_cap,
 
375
                   read_only=read_only)
 
376
 
 
377
    def enable_as_master(self, replica_source_config):
 
378
        LOG.debug("Executing enable_as_master")
 
379
        self._call("enable_as_master", AGENT_HIGH_TIMEOUT, self.version_cap,
 
380
                   replica_source_config=replica_source_config)
 
381
 
 
382
    # DEPRECATED: Maintain for API Compatibility
 
383
    def get_txn_count(self):
 
384
        LOG.debug("Executing get_txn_count.")
 
385
        return self._call("get_txn_count",
 
386
                          AGENT_HIGH_TIMEOUT, self.version_cap)
 
387
 
 
388
    def get_last_txn(self):
 
389
        LOG.debug("Executing get_last_txn.")
 
390
        return self._call("get_last_txn",
 
391
                          AGENT_HIGH_TIMEOUT, self.version_cap)
 
392
 
 
393
    def get_latest_txn_id(self):
 
394
        LOG.debug("Executing get_latest_txn_id.")
 
395
        return self._call("get_latest_txn_id",
 
396
                          AGENT_HIGH_TIMEOUT, self.version_cap)
 
397
 
 
398
    def wait_for_txn(self, txn):
 
399
        LOG.debug("Executing wait_for_txn.")
 
400
        self._call("wait_for_txn", AGENT_HIGH_TIMEOUT, self.version_cap,
 
401
                   txn=txn)
361
402
 
362
403
    def cleanup_source_on_replica_detach(self, replica_info):
363
404
        LOG.debug("Cleaning up master %s on detach of replica.", self.id)
366
407
 
367
408
    def demote_replication_master(self):
368
409
        LOG.debug("Demoting instance %s to non-master.", self.id)
369
 
        self._call("demote_replication_master", AGENT_LOW_TIMEOUT,
 
410
        self._call("demote_replication_master", AGENT_HIGH_TIMEOUT,
370
411
                   self.version_cap)