WEB开发网
开发学院服务器云计算 管理私有云:WebSphere CloudBurst Appliance 命令... 阅读

管理私有云:WebSphere CloudBurst Appliance 命令行界面简介

 2009-09-28 00:00:00 来源:WEB开发网   
核心提示: 清单 6. 使用 JSON 创建一个新用户 - 命令>>>cloudburst.users<<{"username":"newuser","fullname":"PatternDeployer&q

清单 6. 使用 JSON 创建一个新用户 - 命令

>>> cloudburst.users << {"username":"newuser", "fullname":"Pattern Deployer", 
... "password":"password", "email":"newuser@mycompany.com"} 

清单 7. 使用 JSON 创建一个新用户 - 输出

{ 
 "currentmessage": "RM02013", 
 "currentmessage_text": "User has not logged in yet", 
 "currentstatus": "RM01062", 
 "currentstatus_text": "Inactive", 
 "email": "newuser@mycompany.com", 
 "fullname": "Pattern Deployer", 
 "groups": (nested object), 
 "id": 3, 
 "parts": (nested object), 
 "password": (write-only), 
 "patterns": (nested object), 
 "roles": (nested object), 
 "scripts": (nested object), 
 "username": "newuser", 
 "virtualimages": (nested object), 
 "virtualsystems": (nested object) 
} 

CLI 还提供了一个非常方便的 help 函数,您可以对资源、资源集合和这些项的方法调用该函数:

对于资源和资源集合,help 函数提供了项的简短摘要以及可用的属性和方法。

对于方法,help 提供了方法摘要和方法接受的输入。

清单 8 和 9 展示了如何使用 help 方法找到与某个管理程序资源相关的属性和方法。

清单 8. 使用 help 函数 - 命令

>>> help(cloudburst.hypervisors[0]) 

清单 9. 使用 help 函数 - 输出

A Hypervisor object represents a particular hypervisor defined on the 
CloudBurst appliance. Use the Hypervisor object to query and 
manipulate the hypervisor definition on the appliance. Attributes of 
the hypervisor and relationships between the hypervisor and other 
resources on the CloudBurst appliance are represented as Jython 
attributes on the Hypervisor object. Manipulate these Jython 
attributes using standard Jython mechanisms to make changes to the 
corresponding data on the CloudBurst appliance. 
 
Additional help is available for the following methods: 
  acceptCertificate, __contains__, __delattr__, delete, discover, __eq__, 
  __hash__, isMaintenance, isStarted, isStatusTransient, maintenance, 
  __nonzero__, refresh, __repr__, start, __str__, __unicode__, waitFor 
 
Additional help is available for the following properties: 
  address, certificate, certified, cloud, created, currentmessage, 
  currentmessage_text, currentstatus, currentstatus_text, desiredstatus, 
  desiredstatus_text, id, name, networks, password, storage, type, updated, 
  userid 
 
Remember to append an underscore to the property name when asking for 
help using a specific instance of a resource rather than the class. 
For example, "help(cloudburst.pattern.name)" or "help(mypattern.name_)" 
will work, but "help(mypattern.name)" will resolve the name of the pattern 
referenced by mypattern and attempt to provide help for the resulting 
string rather than the property itself.

上一页  2 3 4 5 6 7 8 9 10  下一页

Tags:管理 私有 WebSphere

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接