本文整理汇总了Python中archipelcore.archipelEntity.TNArchipelEntity.init_vocabulary方法的典型用法代码示例。如果您正苦于以下问题:Python TNArchipelEntity.init_vocabulary方法的具体用法?Python TNArchipelEntity.init_vocabulary怎么用?Python TNArchipelEntity.init_vocabulary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类archipelcore.archipelEntity.TNArchipelEntity
的用法示例。
在下文中一共展示了TNArchipelEntity.init_vocabulary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_vocabulary
# 需要导入模块: from archipelcore.archipelEntity import TNArchipelEntity [as 别名]
# 或者: from archipelcore.archipelEntity.TNArchipelEntity import init_vocabulary [as 别名]
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)