Revision c465e496 snf-cyclades-app/synnefo/logic/rapi.py

b/snf-cyclades-app/synnefo/logic/rapi.py
546 546
                             ("/%s/instances/%s/deactivate-disks" %
547 547
                              (GANETI_RAPI_VERSION, instance)), None, None)
548 548

  
549
  def SnapshotInstance(self, instance, snapshot_name, dry_run=False):
550
    """Replaces disks on an instance.
551

  
552
    @type instance: str
553
    @param instance: instance whose disks to replace
554
    @type snapshot_name: str
555
    @param snapshot_name: name of the new snapshot
556

  
557
    @rtype: string
558
    @return: job id
559

  
560
    """
561

  
562
    body = {
563
      "disks": [(0, {"snapshot_name": snapshot_name})],
564
      }
565

  
566
    query = []
567
    _AppendDryRunIf(query, dry_run)
568

  
569
    return self._SendRequest(HTTP_PUT,
570
                             ("/%s/instances/%s/snapshot" %
571
                              (GANETI_RAPI_VERSION, instance)), query, body)
572

  
549 573
  def RecreateInstanceDisks(self, instance, disks=None, nodes=None):
550 574
    """Recreate an instance's disks.
551 575

  

Also available in: Unified diff