コード例 #1
0
ファイル: destinations.py プロジェクト: kjylmr/guts
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import timeutils

from guts.api import extensions
from guts.api.openstack import wsgi
from guts import exception
from guts import objects
from guts import rpc

LOG = logging.getLogger(__name__)

CONF = cfg.CONF

authorize = extensions.extension_authorizer('migration', 'destinations')


class DestinationsController(wsgi.Controller):
    """The destination hypervisor API controller for the OpenStack API."""
    def __init__(self, ext_mgr):
        self.ext_mgr = ext_mgr
        super(DestinationsController, self).__init__()

    def _notify_source_error(self,
                             ctxt,
                             method,
                             err,
                             source=None,
                             id=None,
                             name=None):
コード例 #2
0
import webob

from oslo_config import cfg
from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi
from guts import exception
from guts import objects
from guts import rpc

LOG = logging.getLogger(__name__)

CONF = cfg.CONF

authorize = extensions.extension_authorizer('migration', 'volumes')


class VolumesController(wsgi.Controller):
    """The volume API controller for the OpenStack API."""
    def __init__(self, ext_mgr):
        self.ext_mgr = ext_mgr
        super(VolumesController, self).__init__()

    def _notify_source_error(self,
                             ctxt,
                             method,
                             err,
                             source=None,
                             id=None,
                             name=None):
コード例 #3
0
ファイル: networks.py プロジェクト: kjylmr/guts
import webob

from oslo_config import cfg
from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi
from guts import exception
from guts import objects
from guts import rpc

LOG = logging.getLogger(__name__)

CONF = cfg.CONF

authorize = extensions.extension_authorizer('migration', 'networks')


class NetworksController(wsgi.Controller):
    """The network API controller for the OpenStack API."""

    def __init__(self, ext_mgr):
        self.ext_mgr = ext_mgr
        super(NetworksController, self).__init__()

    def _notify_source_error(self, ctxt, method, err,
                             source=None, id=None, name=None):
        payload = dict(sources=source, name=name, id=id, error_message=err)
        rpc.get_notifier('source').error(ctxt, method, payload)

    def _notify_source_info(self, ctxt, method, source):
コード例 #4
0
ファイル: vm_actions.py プロジェクト: Vaidyanath/guts
#    License for the specific language governing permissions and limitations
#    under the License.


from oslo_config import cfg
from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi
from guts.migration import vms


CONF = cfg.CONF

LOG = logging.getLogger(__name__)
authorize = extensions.extension_authorizer('vms', '')


class VMActionsController(wsgi.Controller):
    def __init__(self):
        super(VMActionsController, self).__init__()

    @wsgi.action('os-fetch_vms')
    def _fetch_vms(self, req, id, body):
        context = req.environ['guts.context']
        vms.fetch_vms(context, id)


class Vm_actions(extensions.ExtensionDescriptor):
    """Enables source VM actions."""
コード例 #5
0
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from oslo_config import cfg
from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi

CONF = cfg.CONF

LOG = logging.getLogger(__name__)
authorize = extensions.extension_authorizer('sources', '')


class SourceActionsController(wsgi.Controller):
    def __init__(self):
        super(SourceActionsController, self).__init__()


class Source_actions(extensions.ExtensionDescriptor):
    """Enables source hypervisor actions."""

    name = "SourceActions"
    alias = "os-source-actions"
    namespace = ""
    updated = ""
コード例 #6
0
ファイル: source_actions.py プロジェクト: Vaidyanath/guts
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.


from oslo_config import cfg
from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi


CONF = cfg.CONF

LOG = logging.getLogger(__name__)
authorize = extensions.extension_authorizer('sources', '')


class SourceActionsController(wsgi.Controller):
    def __init__(self):
        super(SourceActionsController, self).__init__()


class Source_actions(extensions.ExtensionDescriptor):
    """Enables source hypervisor actions."""

    name = "SourceActions"
    alias = "os-source-actions"
    namespace = ""
    updated = ""
コード例 #7
0
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

from oslo_config import cfg
from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi

CONF = cfg.CONF

LOG = logging.getLogger(__name__)
authorize = extensions.extension_authorizer('types', '')


class TypeActionsController(wsgi.Controller):
    def __init__(self):
        super(TypeActionsController, self).__init__()


class Type_actions(extensions.ExtensionDescriptor):
    """Enables source hypervisor type actions."""

    name = "TypeActions"
    alias = "os-type-actions"
    namespace = ""
    updated = ""
コード例 #8
0
ファイル: services.py プロジェクト: curx/guts
from oslo_utils import timeutils
import webob.exc

from guts.api import extensions
from guts.api.openstack import wsgi
from guts.api import xmlutil
from guts import exception
from guts.i18n import _
from guts import objects
from guts import utils


CONF = cfg.CONF

LOG = logging.getLogger(__name__)
authorize = extensions.extension_authorizer("migration", "services")


class ServicesIndexTemplate(xmlutil.TemplateBuilder):
    def construct(self):
        root = xmlutil.TemplateElement("services")
        elem = xmlutil.SubTemplateElement(root, "service", selector="services")
        elem.set("binary")
        elem.set("host")
        elem.set("status")
        elem.set("state")
        elem.set("update_at")
        elem.set("disabled_reason")

        return xmlutil.MasterTemplate(root, 1)
コード例 #9
0
import webob

from oslo_config import cfg
from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi
from guts import exception
from guts import objects
from guts import rpc

LOG = logging.getLogger(__name__)

CONF = cfg.CONF

authorize = extensions.extension_authorizer('migration', 'instances')


class InstancesController(wsgi.Controller):
    """The instance API controller for the OpenStack API."""
    def __init__(self, ext_mgr):
        self.ext_mgr = ext_mgr
        super(InstancesController, self).__init__()

    def _notify_source_error(self,
                             ctxt,
                             method,
                             err,
                             source=None,
                             id=None,
                             name=None):
コード例 #10
0
import webob

from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi
from guts.api.views import sources as views_sources
from guts import exception
from guts.migration import sources
from guts.migration import vms
from guts import rpc
from guts import utils

LOG = logging.getLogger(__name__)

authorize = extensions.extension_authorizer('migration', 'sources_manage')


class SourcesController(wsgi.Controller):
    """The source hypervisor API controller for the OpenStack API."""
    _view_builder_class = views_sources.ViewBuilder

    def __init__(self, ext_mgr):
        self.ext_mgr = ext_mgr
        super(SourcesController, self).__init__()

    def _notify_source_error(self, ctxt, method, err,
                             source=None, id=None, name=None):
        payload = dict(sources=source, name=name, id=id, error_message=err)
        rpc.get_notifier('source').error(ctxt, method, payload)
コード例 #11
0
ファイル: sources.py プロジェクト: kjylmr/guts
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import timeutils

from guts.api import extensions
from guts.api.openstack import wsgi
from guts import exception
from guts import objects
from guts import rpc

LOG = logging.getLogger(__name__)

CONF = cfg.CONF

authorize = extensions.extension_authorizer('migration', 'sources')


class SourcesController(wsgi.Controller):
    """The source hypervisor API controller for the OpenStack API."""

    def __init__(self, ext_mgr):
        self.ext_mgr = ext_mgr
        super(SourcesController, self).__init__()

    def _notify_source_error(self, ctxt, method, err,
                             source=None, id=None, name=None):
        payload = dict(sources=source, name=name, id=id, error_message=err)
        rpc.get_notifier('source').error(ctxt, method, payload)

    def _notify_source_info(self, ctxt, method, source):
コード例 #12
0
ファイル: type_actions.py プロジェクト: Vaidyanath/guts
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.


from oslo_config import cfg
from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi


CONF = cfg.CONF

LOG = logging.getLogger(__name__)
authorize = extensions.extension_authorizer('types', '')


class TypeActionsController(wsgi.Controller):
    def __init__(self):
        super(TypeActionsController, self).__init__()


class Type_actions(extensions.ExtensionDescriptor):
    """Enables source hypervisor type actions."""

    name = "TypeActions"
    alias = "os-type-actions"
    namespace = ""
    updated = ""
コード例 #13
0
ファイル: services.py プロジェクト: aptira/guts
from oslo_utils import timeutils
import webob.exc

from guts.api import extensions
from guts.api.openstack import wsgi
from guts.api import xmlutil
from guts import exception
from guts.i18n import _
from guts import objects
from guts import utils


CONF = cfg.CONF

LOG = logging.getLogger(__name__)
authorize = extensions.extension_authorizer('migration', 'services')


class ServicesIndexTemplate(xmlutil.TemplateBuilder):
    def construct(self):
        root = xmlutil.TemplateElement('services')
        elem = xmlutil.SubTemplateElement(root, 'service', selector='services')
        elem.set('binary')
        elem.set('host')
        elem.set('status')
        elem.set('state')
        elem.set('update_at')
        elem.set('disabled_reason')

        return xmlutil.MasterTemplate(root, 1)
コード例 #14
0
ファイル: migration_actions.py プロジェクト: Vaidyanath/guts
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.


from oslo_config import cfg
from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi


CONF = cfg.CONF

LOG = logging.getLogger(__name__)
authorize = extensions.extension_authorizer('migrations', '')


class MigrationActionsController(wsgi.Controller):
    def __init__(self):
        super(MigrationActionsController, self).__init__()


class Migration_actions(extensions.ExtensionDescriptor):
    """Enables migration actions."""

    name = "MigrationActions"
    alias = "os-migration-actions"
    namespace = ""
    updated = ""
コード例 #15
0
ファイル: migrations.py プロジェクト: curx/guts
import six
import webob

from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi
from guts.api.views import migrations as views_migrations
from guts import exception
from guts.migration import migrations
from guts import rpc
from guts import utils

LOG = logging.getLogger(__name__)

authorize = extensions.extension_authorizer('migration', 'migrations_manage')


class MigrationsController(wsgi.Controller):
    """The migration API controller for the OpenStack API."""
    _view_builder_class = views_migrations.ViewBuilder

    def __init__(self, ext_mgr):
        self.ext_mgr = ext_mgr
        super(MigrationsController, self).__init__()

    def _notify_migration_error(self, ctxt, method, err,
                                migration=None, id=None, name=None):
        payload = dict(migrations=migration, name=name, id=id,
                       error_message=err)
        rpc.get_notifier('migration').error(ctxt, method, payload)
コード例 #16
0
ファイル: instances.py プロジェクト: kjylmr/guts
import webob

from oslo_config import cfg
from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi
from guts import exception
from guts import objects
from guts import rpc

LOG = logging.getLogger(__name__)

CONF = cfg.CONF

authorize = extensions.extension_authorizer('migration', 'instances')


class InstancesController(wsgi.Controller):
    """The instance API controller for the OpenStack API."""

    def __init__(self, ext_mgr):
        self.ext_mgr = ext_mgr
        super(InstancesController, self).__init__()

    def _notify_source_error(self, ctxt, method, err,
                             source=None, id=None, name=None):
        payload = dict(sources=source, name=name, id=id, error_message=err)
        rpc.get_notifier('source').error(ctxt, method, payload)

    def _notify_source_info(self, ctxt, method, source):
コード例 #17
0
import webob
from webob import exc

from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi
from guts.api.views import vms as views_vms
from guts import exception
from guts.migration import vms
from guts import rpc

LOG = logging.getLogger(__name__)

authorize = extensions.extension_authorizer('migration', 'vms_manage')


class VMsController(wsgi.Controller):
    """The source VM API controller for the OpenStack API."""
    _view_builder_class = views_vms.ViewBuilder

    def __init__(self, ext_mgr):
        self.ext_mgr = ext_mgr
        super(VMsController, self).__init__()

    def _notify_vm_error(self, ctxt, method, err, vm=None, id=None, name=None):
        payload = dict(vms=vm, name=name, id=id, error_message=err)
        rpc.get_notifier('vm').error(ctxt, method, payload)

    def _notify_vm_info(self, ctxt, method, vm):
コード例 #18
0
ファイル: destinations.py プロジェクト: kjylmr/guts
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import timeutils

from guts.api import extensions
from guts.api.openstack import wsgi
from guts import exception
from guts import objects
from guts import rpc

LOG = logging.getLogger(__name__)

CONF = cfg.CONF

authorize = extensions.extension_authorizer('migration', 'destinations')


class DestinationsController(wsgi.Controller):
    """The destination hypervisor API controller for the OpenStack API."""

    def __init__(self, ext_mgr):
        self.ext_mgr = ext_mgr
        super(DestinationsController, self).__init__()

    def _notify_source_error(self, ctxt, method, err,
                             source=None, id=None, name=None):
        payload = dict(sources=source, name=name, id=id, error_message=err)
        rpc.get_notifier('source').error(ctxt, method, payload)

    def _notify_source_info(self, ctxt, method, source):
コード例 #19
0
ファイル: networks.py プロジェクト: kjylmr/guts
import webob

from oslo_config import cfg
from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi
from guts import exception
from guts import objects
from guts import rpc

LOG = logging.getLogger(__name__)

CONF = cfg.CONF

authorize = extensions.extension_authorizer('migration', 'networks')


class NetworksController(wsgi.Controller):
    """The network API controller for the OpenStack API."""
    def __init__(self, ext_mgr):
        self.ext_mgr = ext_mgr
        super(NetworksController, self).__init__()

    def _notify_source_error(self,
                             ctxt,
                             method,
                             err,
                             source=None,
                             id=None,
                             name=None):
コード例 #20
0
ファイル: volumes.py プロジェクト: kjylmr/guts
import webob

from oslo_config import cfg
from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi
from guts import exception
from guts import objects
from guts import rpc

LOG = logging.getLogger(__name__)

CONF = cfg.CONF

authorize = extensions.extension_authorizer('migration', 'volumes')


class VolumesController(wsgi.Controller):
    """The volume API controller for the OpenStack API."""

    def __init__(self, ext_mgr):
        self.ext_mgr = ext_mgr
        super(VolumesController, self).__init__()

    def _notify_source_error(self, ctxt, method, err,
                             source=None, id=None, name=None):
        payload = dict(sources=source, name=name, id=id, error_message=err)
        rpc.get_notifier('source').error(ctxt, method, payload)

    def _notify_source_info(self, ctxt, method, source):
コード例 #21
0
from oslo_utils import timeutils
import webob.exc

from guts.api import extensions
from guts.api.openstack import wsgi
from guts.api import xmlutil
from guts import exception
from guts.i18n import _
from guts import objects
from guts import utils


CONF = cfg.CONF

LOG = logging.getLogger(__name__)
authorize = extensions.extension_authorizer('migration', 'services')


class ServicesIndexTemplate(xmlutil.TemplateBuilder):
    def construct(self):
        root = xmlutil.TemplateElement('services')
        elem = xmlutil.SubTemplateElement(root, 'service', selector='services')
        elem.set('binary')
        elem.set('host')
        elem.set('status')
        elem.set('state')
        elem.set('update_at')
        elem.set('disabled_reason')

        return xmlutil.MasterTemplate(root, 1)
コード例 #22
0
ファイル: resources.py プロジェクト: kjylmr/guts
import webob

from oslo_config import cfg
from oslo_log import log as logging

from guts.api import extensions
from guts.api.openstack import wsgi
from guts import exception
from guts import objects
from guts import rpc

LOG = logging.getLogger(__name__)

CONF = cfg.CONF

authorize = extensions.extension_authorizer('migration', 'resources')


class ResourcesController(wsgi.Controller):
    """The resource API controller for the OpenStack API."""

    def __init__(self, ext_mgr):
        self.ext_mgr = ext_mgr
        super(ResourcesController, self).__init__()

    def _notify_source_error(self, ctxt, method, err,
                             source=None, id=None, name=None):
        payload = dict(sources=source, name=name, id=id, error_message=err)
        rpc.get_notifier('source').error(ctxt, method, payload)

    def _notify_source_info(self, ctxt, method, source):