本文整理匯總了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)