1 Oracle ZFS Storage Appliance 概述
浏览器用户界面 (Browser User Interface, BUI)
CLI 中的一个核心原则就是执行命令时所在的上下文。上下文指定可管理系统的哪些元素,以及可使用哪些命令。上下文采用树结构,在该结构中,上下文本身可能包含嵌套的上下文,并且该结构通常是 BUI 中视图结构的镜像。
登录时的初始上下文是根上下文,充当所有上下文的父代或祖先。要导航到某个上下文,请将该上下文的名称作为命令执行。例如,在浏览器Chapter 4, 网络配置视图中提供的功能在 CLI 的 configuration 上下文中提供。从根上下文中,可以通过直接键入某个上下文来访问该上下文:
dory:> configuration dory:configuration>
请注意,提示符将发生更改,在提示符中的冒号和大于号之间提供上下文,以反映上下文。
show 命令显示子上下文。例如,从 configuration 上下文中:
dory:configuration> show Children: net => Configure networking services => Configure services version => Display system version users => Configure administrative users roles => Configure administrative roles preferences => Configure user preferences alerts => Configure alerts storage => Configure Storage
这些子上下文对应于在浏览器中的Chapter 6, 存储区域网络配置视图下提供的视图,包括Chapter 4, 网络配置、Chapter 11, ZFSSA 服务和Chapter 7, 用户配置、首选项Chapter 8, 设置 ZFSSA 首选项等。要选择这些子上下文之一,请键入其名称:
dory:configuration> preferences dory:configuration preferences>
可通过指定使用空格分隔的中间上下文直接从祖先导航到某个后代上下文。例如,要直接从根上下文导航到 configuration preferences,直接键入即可:
dory:> configuration preferences dory:configuration preferences>
有些子上下文是动态的,因为它们不是对应于浏览器中的固定视图,而是对应于用户或系统创建的动态实体。要导航到这些上下文,请使用 select 命令,后跟动态上下文的名称。给定上下文中包含的动态上下文的名称可以使用 list 命令显示。例如,users 上下文是一个静态上下文,但是每个用户都是独立的动态上下文。
dory:> configuration users dory:configuration users> list NAME USERNAME UID TYPE John Doe bmc 12345 Dir Super-User root 0 Loc
要选择名为 bmc 的用户,请发出 select bmc 命令:
dory:configuration users> select bmc dory:configuration users bmc>
另外,在某些上下文中,可以使用 select 和 destroy 根据实体的属性选择实体。例如,可以通过发出以下命令在 maintenance logs system 上下文中选择 reboot 模块发布的日志条目:
dory:maintenance logs system> select module=reboot dory:maintenance logs system entry-034> show Properties: timestamp = 2010-8-14 06:24:41 module = reboot priority = crit text = initiated by root on /dev/console syslogd: going down on signal 15
和其他命令一样,select 可以附加到更改上下文的命令中。例如,要从根上下文中选择名为 bmc 的用户:
dory:> configuration users select bmc dory:configuration users bmc>
使用 last 命令导航到上一个选定或创建的上下文。当前仅在复制操作上下文中实施此命令。
下例创建了一个复制操作,然后使用 last 和 get id 命令检索此复制操作 ID。然后选择不同的操作,并使用 last 和 get id 命令检索最后一次访问的复制操作的 ID。
dory:shares p1/share replication> list TARGET STATUS NEXT action-000 oakmeal idle Sync now action-001 dory idle Sync now dory:shares p1/share replication> create dory:shares p1/share action (uncommitted)> set target=dory target = dory (uncommitted) dory:shares p1/share action (uncommitted)> set pool=p0 pool = p0 (uncommitted) dory:shares p1/share action (uncommitted)> commit dory:shares p1/share replication> last dory:shares p1/share action-002> get id id = 7034367a-d4d8-e26f-fa93-c3b454e3b595 dory:shares p1/share action-002> done dory:shares p1/share replication> select action-000 dory:shares p1/share action-000> get id id = 9895d9f4-7b23-ebe1-faf2-d85a581e3dff dory:shares p1/share action-000> done dory:shares p1/share replication> last get id id = 9895d9f4-7b23-ebe1-faf2-d85a581e3dff dory:shares p1/share replication>