组织列表清单引用¶
作为提供商,您可以使用组织列表在组织内安全地共享数据产品。要以编程方式创建组织列表,需要使用 YAML (https://yaml.org/spec/ (https://yaml.org/spec/)) 编写的清单。下面介绍清单的整体格式以及清单的每个字段,包括细节和示例。
组织列表字段是较大 列表清单引用 的一部分。要以编程方式添加或修改组织列表字段,请使用 ALTER LISTING 和 DESCRIBE LISTING 命令查找和修改列表清单。
组织列表清单¶
备注
组织列表字段有两种:
可选 – 组织列表的可选字段。
必填 – 组织列表的必填字段。
组织列表列表的一般格式为:
#
# Organization listing manifest
#
title: <Required listing title>
description: <listing description>
resources: <optional listing resources>
listing_terms: <optional listing terms>
data_dictionary: <optional data dictionary>
usage_examples: <optional usage examples>
data_attributes: <optional data attributes>
organization_profile: <Optional custom organization profile. Default "INTERNAL">
organization_targets:
- # Required
support_contact: "<support email address>"
- # Required
approver_contact: "<approver email address"
- # Required when the organization_targets includes the organization_targets.discover field
locations:
- # Optional list of regions to share into.
auto_fulfillment:
- # Required when the target accounts are outside the provider's region, otherwise optional.
组织列表字段¶
组织列表清单包括前缀,后跟是一组必填和可选字段。
组织列表前缀¶
每个组织列表清单采用以下字段开头:
resources¶
列表资源。
可选 resources 字段包含以下名称/值对:
resources.documentation`(字符串,必填):指向您网站上的页面的完全限定链接,其中包含有关列表的更详细文档。必须以 :code:`http或https开头。:code:`resources.media`(字符串,可选):指向列表的不公开或公开 YouTube 视频的完全限定链接。
For more information about the type of information you can include with this field, see 详细信息.
resources 示例¶
. . .
resources:
documentation: https://www.example.com/documentation/
media: https://www.youtube.com/watch?v=MEFlT3dc3uc
. . .
listing_terms¶
定义列表的服务条款。
可选 listing_terms 字段包含以下名称/值对:
listing_terms.typeCUSTOM- OnlyCUSTOMis supported. Iflisting_terms.typeis specified, then you must also specify a value forlisting_terms.link.
listing_terms.link:指向提供商列表条款的完全限定链接,必须以http或https开头。
For more information, refer to Terms of Service in the table in 基本信息.
备注
使用者可以以编程方式接受列表条款。如需更多信息,请联系 Snowflake 支持部门。
listing_terms 示例¶
. . .
listing_terms:
type: "CUSTOM"
link: "http://example.com/my/listing/terms"
. . .
data_dictionary¶
可选 data_dictionary 字段提供有关列表中对象的数据预览和列类型的信息。
data_dictionary 字段包含由最多五个数据字典条目组成的列表:
data_dictionary.featured`(使用 :code:`data_dictionary时为必填):必须是“featured”。data_dictionary.featured.database`(使用 :code:`data_dictionary时为必填):数据库名称。data_dictionary.featured.objects`(使用 :code:`data_dictionary时为必填):包含以下名称/值对:
有关更多信息,请参阅 数据产品 – 数据字典。
data_dictionary 示例¶
. . .
data_dictionary:
featured:
database: "WEATHERDATA"
objects:
- name: "GLOBAL_WEATHER"
schema: "PUBLIC"
domain: "TABLE"
- name: "GLOBAL_WEATHER_REPORT"
schema: "PUBLIC"
domain: "TABLE"
. . .
usage_examples¶
可选 usage_examples 字段包含以下名称/值对的列表:
:code:`usage.title`(字符串,必填):使用示例标题。最大长度为 110 个字符。
:code:`usage.description`(字符串,可选):使用示例的描述。最大长度为 300 个字符。
:code:`usage.query`(字符串,必填):与使用示例相关联的查询。最大长度为 30000 个字符。
有关更多信息,请参阅 示例 SQL 查询。
usage_examples 示例¶
. . .
usage_examples:
- title: "Return all weather for the US"
description: "Example of how to select weather information for the United States"
query: "select * from weather where country_code='USA'";
. . .
data_attributes¶
数据属性为使用者提供列表信息。
可选 data_attributes 字段包含以下名称/值对:
:code:`data_attributes.refresh_rate`(必填)
以下其中一项: 指定数据产品在 Snowflake 中的更新频率。
CONTINUOUSLY
HOURLY
DAILY
WEEKLY
MONTHLY
QUARTERLY
ANNUALLY
STATIC
:code:`data_attributes.geography`(必填):
指定数据产品的地理信息。
:code:`granularity`(字符串,必填)
数据集的地理覆盖范围。
以下其中一项:
LATITUDE_LONGITUDE
ADDRESS
POSTAL_CODE
CITY
COUNTY
STATE
COUNTRY
REGION_CONTINENT
:code:`geo_option`(字符串,必填)
以下其中一项:
NOT_APPLICABLE
GLOBAL
COUNTRIES
coverage`(是否必填取决于选择的 :code:`geo_option):states(list of states) containing any list of valid U.S. state names.
Or
continents(list of continents):以下任何一项:
ASIA
EUROPE
AFRICA
NORTH AMERICA
SOUTH AMERICA
OCEANIA
ANTARCTICA
:code:`time`(必填):
指定数据产品的时间段。
:code:`granularity`(必填)
以下其中一项:
EVENT_BASED
HOURLY
DAILY
WEEKLY
MONTHLY
YEARLY
:code:`time_range`(必填),包含以下名称/值对:
value`(当 :code:`time_frame为 NEXT/LAST 时为必填,整型)。范围是 1 到 100。start_time`(当 :code:`time_frame为 BETWEEN 时为必填,字符串日期)。数据产品的开始时间。格式为 MM-DD-YYYY。end_time`(当 :code:`time_frame为 BETWEEN 时为必填,字符串日期),格式为 MM-DD-YYYY。
For additional information on data product attributes, see 数据产品 – 属性.
data_attributes 示例¶
. . .
data_attributes:
refresh_rate: DAILY
geography:
granularity:
- REGION_CONTINENT
geo_option: COUNTRIES
coverage:
continents:
ASIA:
- INDIA
- CHINA
NORTH AMERICA:
- UNITED STATES
- CANADA
EUROPE:
- UNITED KINGDOM
time:
granularity: MONTHLY
time_range:
time_frame: LAST
unit: MONTHS
value: 6
organization_targets¶
必填 organization_targets 字段定义谁可以发现和访问列表。
包含 discovery 和 access 字段,必须指定其中一个字段。
discoveryRequired when
accessisn't specified, but otherwise optional. Defines who can discover the listing. When not present no accounts can discover the listing.accessRequired when
discoveryisn't specified, but otherwise optional. Defines who can access the listing.
discovery 和 access,都包含相同的子字段。
要么:
all_internal_accounts : {true | false}When
true, all internal accounts can find or access the listing. Whenfalseno accounts can find or access the listing.- 或者是一个账户数组,后跟指定账户中的可选
roles数组。 - account: "<account_name>"
当 roles 存在时,它会指定账户中可以访问或发现列表的角色列表。例如:
. . .
roles: [ 'role1','role2']. . .
organization_target 示例¶
以下示例显示 discovery 和 access 字段的各种组合。
All internal accounts in the organization can discover and access the listing¶
. . .
organization_targets:
discovery:
- all_internal_accounts : true
access:
- all_internal_accounts : true
. . .
可发现,但只有有限的账户可以访问¶
All internal accounts within the organization can discover the listing, but only finance accounts can access the listing.
. . .
organization_targets:
discovery:
- all_internal_accounts : true
access:
- account: 'finance'
. . .
可发现,但只有指定账户可以访问¶
All internal accounts within the organization can discover the listing, but only accounts in the finance or credit account can access the listing.
. . .
organization_targets:
discovery:
- all_internal_accounts : true
access:
- account: 'finance'
- account: 'credit'
. . .
可发现,但只有有限的账户和特定角色可以访问¶
All internal accounts within the organization can discover the listing,
but only accounts in the finance account which have the accounting or debit role can access the listing.
. . .
organization_targets:
discovery:
- all_internal_accounts : true
access:
- account: 'finance'
roles: [ 'accounting','debit']
. . .
support_contact¶
与列表相关联的支持信息的电子邮件地址。
Required when the discovery field is specified.
. . .
support_contact: "support@exampledomain.com"
. . .
approver_contact¶
列表批准者的电子邮件地址。
Required when the discovery field is specified.
. . . approver_contact: "approver@exampledomain.com" . . .
locations¶
指定可以发现或访问列表的 可选 locations。
The access_regions field is required when locations is specified and it must include one of the following sub-fields:
ALL– 所有地区都可以发现或访问列表。带有
PUBLIC前缀的区域名称数组可以发现或访问列表。例如access_regions: - name: PUBLIC.AWS_US_WEST_2。. . . locations: access_regions: - name: "<names | ALL>" . . .
有关区域的完整列表,请参阅 SHOW REGIONS。