Go to main content

Oracle® ZFS Storage Appliance 管理指南,发行版 OS8.8.0

退出打印视图

更新时间: 2018 年 11 月
 
 

创建模式 (CLI)

  1. 转至模式上下文 (shares schema)。
  2. 创建一个名为 "contact" 的新属性 (create contact)。
  3. 设置属性的说明 (set description="Owner Contact")。
  4. 设置属性的类型 (set type=EmailAddress)。
  5. 提交更改 (commit)。
  6. 转至现有的共享资源或项目。
  7. 设置 "custom:contact" 属性。
示例 16  示例模式

可以在 "Shares"(共享资源)> "Schema"(模式)下找到模式上下文。

carp:> shares schema
carp:shares schema> show
Properties:

NAME          TYPE          DESCRIPTION
owner         EmailAddress  Owner Contact

每个属性都是模式上下文的子代,使用属性名称作为标记。要创建属性,请使用 create 命令:

carp:shares schema> create department
carp:shares schema department (uncommitted)> get
                          type = String
                   description = department
carp:shares schema department (uncommitted)> set description="Department Code"
                   description = Department Code (uncommitted)
carp:shares schema department (uncommitted)> commit
carp:shares schema> 

在特定属性的上下文中,可使用标准 CLI 命令设置字段:

carp:shares schema> select owner
carp:shares schema owner> get
                          type = EmailAddress
                   description = Owner Contact
carp:shares schema owner> set description="Owner Contact Email"
                   description = Owner Contact Email (uncommitted)
carp:shares schema owner> commit

定义了定制属性后,访问这些属性的方式与访问名称 "custom:<property>" 下的任何其他属性相同:

carp:shares default> get
...
             custom:department = 123-45-6789
                  custom:owner = 
...
carp:shares default> set custom:owner=bob@corp
                  custom:owner = bob@corp (uncommitted)
carp:shares default> commit