Declarative Native App manifest reference

提供商创建清单文件,作为 的一部分。

清单文件是基于文本的 `YAML<https://yaml.org/spec/>`_ 文件,文件名为:manifest.yml。它用于以声明方式与使用者共享数据,例如笔记本、表和视图。

清单文件还定义 应用程序角色,应用程序所有者可以使用这些角色来按角色向其组织团队中的团队共享应用程序数据和功能的子集。

有关开发应用程序包的信息,请参阅 Native Application Framework 的声明式共享中的应用程序包

Declarative Native App manifest

The general format of a Declarative Native App manifest contains:

manifest_version: # Added automatically. Don't include.
application_content: # Optional, describes associated app logic
roles: # Optional, describes roles associated with shared_content
shared_content: # Required, describes associated data to be shared
Copy

字段

Declarative Native App manifests include the following fields:

manifest_version 字段

当您发布应用程序包的新版本时,此字段会自动添加到清单文件中。

创建要包含在应用程序包中的清单文件时,不要包含此字段。不支持手动编辑此字段。

manifest_version 顶级字段(整型,必填)指定清单文件的版本号。

有关版本控制的更多信息,请参阅 Native Application Framework 中声明式共享中的包版本

application_content 字段

application_content 字段(列表,可选)定义应用程序以声明方式共享的捆绑内容。

此字段包括一个 notebooks 字段:

  • ``application_content.notebooks``(列表,必填):命名 笔记本 的列表。

application_content.notebooks.{named notebook} 字段

每个命名笔记本都支持以下名称值对:

  • ``main_file``(字符串,必填)交互式 Python 笔记本 (.ipynb) 文件的名称。

  • ``comment``(字符串,可选):用于描述笔记本的注释。

  • ``runtime_environment_version``(字符串,可选): 为笔记本执行上下文指定特定的 :ref:`运行时环境版本 <label-notebook_runtime_descriptions>`(如果适用于平台)。

  • roles (list, optional): A list of app roles that can grant access the notebook, for example, [sales,marketing]. When this field is empty ([]) or omitted, then only app owners and roles with granted IMPORTED PRIVILEGES receive access. The included roles must be defined in the top-level roles field.

application_context 示例

在此示例中,使用笔记本文件 NOTEBOOK1.ipynb 定义单个笔记本 salesbook,使用已知运行时 stable,并向被授予 salesmarketing 角色的人提供访问权限。

application_content:
    notebooks:
        - salesbook:
              roles: [sales, marketing]
              main_file: NOTEBOOK1.ipynb
              comment: Notebook1: Sales and marketing notebook
              runtime_environment_version: stable

roles:
  - sales:
  - marketing:
Copy

roles 字段

roles 顶级字段(列表,可选)定义 应用程序角色 列表。这些角色允许应用程序所有者向其组织提供应用程序中共享对象(如架构、表、视图和笔记本)的访问权限。

每个命名角色可以选择包含 comment,当应用程序所有者列出应用程序中的角色时,它会显示为描述。

这些角色在清单中由共享对象引用,位于命名的 notebookschematableview 级别。对于位于 tableview 级别的对象,角色还必须在 schema 级别指定。

备注

  • All content in the manifest is accessible to the app owner, the ACCOUNTADMIN, and to roles that are granted IMPORTED PRIVILEGES to the app.

  • 此清单文件中定义的对象名称用于运行时对象解析。如果提供商在未使用新版本更新清单文件的情况下更改对象名称,则使用者将无法访问该对象。

roles 示例

roles:
  - sales:
  - marketing:

application_content:
  notebooks:
    - salesbook:
        roles: [sales, marketing]
        main_file: NOTEBOOK1.ipynb
        comment: Sales and marketing notebook

shared_content:
  databases:
    - sales:
        schemas:
          - orders:
              roles: [sales, marketing]
              tables:
                - january_2025:        # App owners/assignees only
                - february_2025:
                    roles: [sales]     # Accessible to sales only
                - march_2025:
                    roles: [marketing] # Accessible to marketing only
    - customer_info:
        schemas:
          - customer_contact:
              roles: [customer_support]
              views:
                - customer_address:
                    roles: [customer_support] # Accessible to customer_support
                - customer_details:
                    roles: []                 # App owners/assignees only
Copy

有关角色的详细信息,请参阅 应用程序角色

shared_content 字段

shared_content 字段(列表,必填)定义应用程序以声明方式共享的数据库列表。每个数据库都包含命名 schemas 列表。每个架构可以包含命名 tables 列表和 views 列表。

此字段包括一个 notebooks 字段:

  • ``shared_content.databases``(列表,必填):要共享的命名数据库实例和基础对象的列表。在此示例中,清单添加了一个名为 sales: 的数据库。

shared_content.databases.{named database} 字段

每个命名数据库都支持以下名称值对:

  • ``schemas``(列表,必填): 数据库中的架构列表。

shared_content.required_databases.{named database} field

The required_databases field (list, optional) defines a list of databases that are dependencies of the shared databases. These databases are referenced by views in the shared databases, but are not shared directly. Including a database in the required_databases is similar to referencing a database using the REFERENCE_USAGE privilege in traditional Secure Data Sharing. For information about the REFERENCE_USAGE privilege and how dependent databases are shared in traditional data sharing, see Share data from multiple databases.

schemas.{named schema} 字段

每个命名架构都支持以下名称值对:

  • ``tables``(列表,[OneOfRequired]):命名表的列表。

  • ``views``(列表,[OneOfRequired]):命名视图的列表。

  • roles (list, optional): A list of app roles that the objects in the schema can use, for example, [sales,marketing]. When this field is empty ([]) or omitted, then only app owners and roles with granted IMPORTED PRIVILEGES receive access. The included roles must be defined in the top-level roles field.

[OneOfRequired] (1,2,3)

至少其中 tablesviews 为必填项。

tables.{named table} 字段

每个命名表(列表,必填)都支持以下名称值对:

views.{named view} 字段

每个命名视图(列表,必填 [OneOfRequired]):支持以下名称值对:

shared_content 示例

在此示例中,公开了两个数据库:salescustomer_info。在这些数据库中,会显示 orders.[january_2025|february_2025] 表以及 customer_contact.customer_address 视图。

Two required databases are also exposed: sales_projections and customer_analytics. These databases can be referenced by views in the shared databases, but are not shared directly.

roles:
  - sales:
  - marketing:

shared_content:
  required_databases:
    sales_projections
    customer_analytics
  databases:
    - sales:
        schemas:
          - orders:
              roles: [sales, marketing]
              tables:
                - january_2025:        # App owners/assignees only
                - february_2025:
                    roles: [sales]     # Accessible to sales only
                - march_2025:
                    roles: [marketing] # Accessible to marketing only
    - customer_info:
        schemas:
          - customer_contact:
              roles: [customer_support]
              views:
                - customer_address:
                    roles: [customer_support] # Accessible to customer_support
                - customer_details:
                    roles: []                 # App owners/assignees only
Copy

清单文件示例

The following code block is an example of a Declarative Native App manifest file:

manifest_version: 2

roles:
  - VIEWER:
      comment: "The VIEWER role provides access to only one view."
  - ANALYST:
      comment: "The ANALYST role provides access to both views and the table."

shared_content:
  databases:
    - SNAF_POPULATION_DB:
        schemas:
          - DATA_SCHEMA:
              roles: [VIEWER, ANALYST]
              tables:
                - COUNTRY_POP_BY_YEAR:
                    roles: [ANALYST]
              views:
                - COUNTRY_POP_BY_YEAR_2000:
                    roles: [VIEWER, ANALYST]

application_content:
  notebooks:
      - intro_notebook:
          roles: [VIEWER, ANALYST]
          main_file: INTRO_NB.ipynb
      - analyst_notebook:
          roles: [ANALYST]
          main_file: ANALYST_NB.ipynb
Copy
语言: 中文