Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(40)  |  Call(32)  |  Derive(0)  |  Import(8)

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/plankton/views.py   synnefo(Download)
from snf_django.lib import api
from snf_django.lib.api import faults
from synnefo.plankton.backend import PlanktonBackend
from synnefo.plankton.backend import split_url
 
 
    if location:
        with PlanktonBackend(request.user_uniq) as backend:
            image = backend.register(name, location, params)
    else:
    log.info("delete_image '%s'" % image_id)
    userid = request.user_uniq
    with PlanktonBackend(userid) as backend:
        backend.unregister(image_id)
    log.info("User '%s' deleted image '%s'" % (userid, image_id))
 
    log.debug('add_image_member %s %s', image_id, member)
    with PlanktonBackend(request.user_uniq) as backend:
        backend.add_user(image_id, member)
    return HttpResponse(status=204)
    """
 
    with PlanktonBackend(request.user_uniq) as backend:
        image = backend.get_image(image_id)
    return _create_image_response(image)

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/api/images.py   synnefo(Download)
    log.debug('list_images detail=%s', detail)
    since = utils.isoparse(request.GET.get('changes-since'))
    with backend.PlanktonBackend(request.user_uniq) as b:
        images = b.list_images()
        if since:
 
    log.debug('get_image_details %s', image_id)
    with backend.PlanktonBackend(request.user_uniq) as b:
        image = b.get_image(image_id)
    reply = image_to_dict(image)
 
    log.info('delete_image %s', image_id)
    with backend.PlanktonBackend(request.user_uniq) as b:
        b.unregister(image_id)
    log.info('User %s deleted image %s', request.user_uniq, image_id)
 
    log.debug('list_image_metadata %s', image_id)
    with backend.PlanktonBackend(request.user_uniq) as b:
        image = b.get_image(image_id)
    metadata = image['properties']
    req = utils.get_json_body(request)
    log.info('update_image_metadata %s %s', image_id, req)
    with backend.PlanktonBackend(request.user_uniq) as b:
        image = b.get_image(image_id)
        try:

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/volume/snapshots.py   synnefo(Download)
from django.db import transaction
from snf_django.lib.api import faults
from synnefo.plankton.backend import PlanktonBackend
from synnefo.logic import backend
from synnefo.volume import util
    size = volume.size << 30
 
    with PlanktonBackend(user_id) as pithos_backend:
        # move this to plankton backend
        snapshot_id = pithos_backend.backend.register_object_map(
    user_id = snapshot["owner"]
    log.info("Deleting snapshot '%s'", snapshot["location"])
    with PlanktonBackend(user_id) as pithos_backend:
        pithos_backend.delete_snapshot(snapshot["id"])
    return snapshot
        return
    user_id = snapshot["owner"]
    with PlanktonBackend(user_id) as b:
        return b.update_metadata(snapshot["id"], metadata)
 

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/volume/management/commands/snapshot-list.py   synnefo(Download)
 
from snf_django.management.utils import pprint_table
from synnefo.plankton.backend import PlanktonBackend
 
 
    def handle(self, **options):
        user = options['userid']
 
        with PlanktonBackend(user) as backend:
            snapshots = backend.list_snapshots(user)

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/plankton/management/commands/image-list.py   synnefo(Download)
from snf_django.management.commands import SynnefoCommand
from snf_django.management.utils import pprint_table
from synnefo.plankton.backend import PlanktonBackend
 
 
    def handle(self, **options):
        user = options['userid']
 
        with PlanktonBackend(user) as backend:
            images = backend._list_images(user)

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/volume/views.py   synnefo(Download)
def list_snapshots(request, detail=False):
    log.debug('list_snapshots detail=%s', detail)
    since = utils.isoparse(request.GET.get('changes-since'))
    with backend.PlanktonBackend(request.user_uniq) as b:
        snapshots = b.list_snapshots()
    meta_dict = utils.get_attribute(req, "metadata", required=True,
                                    attr_type=dict)
    with backend.PlanktonBackend(request.user_uniq) as b:
        b.update_properties(snapshot_id, meta_dict, replace=reset)
    snapshot = util.get_snapshot(request.user_uniq, snapshot_id)
    snapshot = util.get_snapshot(request.user_uniq, snapshot_id)
    if key in snapshot["properties"]:
        with backend.PlanktonBackend(request.user_uniq) as b:
            b.remove_property(snapshot_id, key)
    return HttpResponse(status=200)

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/volume/management/commands/snapshot-show.py   synnefo(Download)
 
from synnefo.management import common
from synnefo.plankton.backend import PlanktonBackend
from snf_django.management import utils
 
        userid = options["userid"]
 
        with PlanktonBackend(userid) as backend:
            snapshot = backend.get_snapshot(userid, snapshot_id)
        utils.pprint_table(out=self.stdout, table=[snapshot.values()],

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/plankton/management/commands/image-show.py   synnefo(Download)
 
from snf_django.management.commands import SynnefoCommand
from synnefo.plankton.backend import PlanktonBackend
from synnefo.management import common
from snf_django.management import utils
        #user_id = options["userid"]
 
        with PlanktonBackend(None) as backend:
            image = backend.get_image(image_id)
        utils.pprint_table(out=self.stdout, table=[image.values()],

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/volume/util.py   synnefo(Download)
def get_snapshot(user_id, snapshot_id, exception=faults.ItemNotFound):
    try:
        with backend.PlanktonBackend(user_id) as b:
            return b.get_snapshot(user_id, snapshot_id)
    except faults.ItemNotFound:
def update_snapshot_status(snapshot_id, user_id, status):
    with backend.PlanktonBackend(user_id) as b:
        return b.update_status(snapshot_id, status=status)
 

src/s/y/synnefo-HEAD/snf-cyclades-app/synnefo/api/util.py   synnefo(Download)
                               BridgePoolTable, MacPrefixPoolTable, IPAddress,
                               IPPoolTable)
from synnefo.plankton.backend import PlanktonBackend
 
from synnefo.cyclades_settings import cyclades_services, BASE_HOST
def get_image(image_id, user_id):
    """Return an Image instance or raise ItemNotFound."""
 
    with PlanktonBackend(user_id) as backend:
        return backend.get_image(image_id)

  1 | 2  Next