Esempio n. 1
0
    def init_vocabulary(self):
        """
        Initialize the base vocabulary.
        """
        TNArchipelEntity.init_vocabulary(self)
        registrar_items = [
            {
                "commands": ["capabilities"],
                "parameters": [],
                "method": self.message_capabilities,
                "permissions": ["capabilities"],
                "description": "Get my libvirt capabilities",
            },
            {
                "commands": ["libvirt uri"],
                "parameters": [],
                "method": self.message_libvirt_uri,
                "permissions": ["uri"],
                "description": "Get my libvirt URI",
            },
            {
                "commands": ["ip"],
                "parameters": [],
                "method": self.message_ip,
                "permissions": ["ip"],
                "description": "Get my IP address",
            },
            {
                "commands": ["roster", "vms", "virtual machines", "domains"],
                "parameters": [],
                "method": self.message_roster,
                "permissions": ["rostervm"],
                "description": "Get the content of my roster",
            },
            {
                "commands": ["alloc"],
                "parameters": [
                    {"name": "name", "description": "The name of the vm. If not given, it will be generated"}
                ],
                "method": self.message_alloc,
                "permissions": ["alloc"],
                "description": "Allocate a new virtual machine",
            },
            {
                "commands": ["free"],
                "parameters": [{"name": "identifier", "description": "The name or the UUID of the vm to free"}],
                "method": self.message_free,
                "permissions": ["free"],
                "description": "Free a virtual machine",
            },
            {
                "commands": ["clone"],
                "parameters": [{"name": "identifier", "description": "The name or the UUID of the vm to clone"}],
                "method": self.message_clone,
                "permissions": ["clone"],
                "description": "Clone a virtual machine",
            },
        ]

        self.add_message_registrar_items(registrar_items)
Esempio n. 2
0
    def init_vocabulary(self):
        """
        Initialize the base vocabulary.
        """
        TNArchipelEntity.init_vocabulary(self)
        registrar_items = [{
            "commands": ["capabilities"],
            "parameters": [],
            "method": self.message_capabilities,
            "permissions": ["capabilities"],
            "description": "Get my libvirt capabilities"
        }, {
            "commands": ["libvirt uri", "migration info"],
            "parameters": [],
            "method": self.message_migration_info,
            "permissions": ["migrationinfo"],
            "description": "Get my migration informations"
        }, {
            "commands": ["ip"],
            "parameters": [],
            "method": self.message_ip,
            "permissions": ["ip"],
            "description": "Get my IP address"
        }, {
            "commands": ["roster", "vms", "virtual machines", "domains"],
            "parameters": [],
            "method":
            self.message_roster,
            "permissions": ["rostervm"],
            "description":
            "Get the content of my roster"
        }, {
            "commands": ["alloc"],
            "parameters": [{
                "name":
                "name",
                "description":
                "The name of the vm. If not given, it will be generated"
            }],
            "method":
            self.message_alloc,
            "permissions": ["alloc"],
            "description":
            "Allocate a new virtual machine"
        }, {
            "commands": ["free"],
            "parameters": [{
                "name":
                "identifier",
                "description":
                "The name or the UUID of the vm to free"
            }],
            "method":
            self.message_free,
            "permissions": ["free"],
            "description":
            "Free a virtual machine"
        }, {
            "commands": ["clone"],
            "parameters": [{
                "name":
                "identifier",
                "description":
                "The name or the UUID of the vm to clone"
            }],
            "method":
            self.message_clone,
            "permissions": ["clone"],
            "description":
            "Clone a virtual machine"
        }]

        self.add_message_registrar_items(registrar_items)