Declarative Native App manifest reference

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

The manifest file is a text-based YAML (https://yaml.org/spec/) file, with the filename: manifest.yml. It's used to declaratively share data and logic with consumers, such as notebooks, user-defined functions, stored procedures, tables, and views.

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

有关开发应用程序包的信息,请参阅 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 to 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,当应用程序所有者列出应用程序中的角色时,它会显示为描述。

These roles are referenced in the manifest by shared objects, at the named notebook, schema, table, view, or semantic_view level. For objects at the table or view level, roles must also be specified at the schema level.

备注

  • 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 (List, required): A list of named database instances and the underlying objects to share. In the example below, the manifest adds a database named 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. When your application shares data from multiple databases, you must explicitly list all additional databases that are referenced by objects in your shared content under the required_databases field. This ensures that the application can be deployed successfully in other regions where these databases may not exist by default. Including a database in the required_databases field 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} 字段

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

[OneOfRequired] (1,2,3,4,5,6,7,8,9,10)

at least one of tables, views, semantic_views, functions, or procedures is required.

tables.{named table} 字段

Each named standard or dynamic table (List, required [OneOfRequired] ) supports the following name value pair:

备注

Shared dynamic tables replicated to remote regions are read-only and do not refresh automatically. Data freshness depends on the replication frequency from the source, and underlying source objects do not need to be replicated. For details, see 复制的注意事项.

views.{named view} 字段

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

functions.{named function} field

Each named function (List, required [OneOfRequired] ): supports the following name value pair:

procedures.{named procedure} field

Each named stored procedure (List, required [OneOfRequired] ): supports the following name value pair:

semantic_views.{named semantic view} field

Each named semantic view (List, required [OneOfRequired] ): supports the following name value pair:

  • roles (list, optional): A list of app roles that can access the semantic view; for example, [sales]. Note that, when sharing a semantic view, its referenced tables or views must be shared as well. 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 and included in the {named schema}.roles field.

shared_content 示例

In this example, two databases are exposed: sales and customer_info. Within these databases the orders.[january_2025|february_2025] tables are exposed as well as the customer_contact.customer_address view.

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.

Note that data and code objects must be in different schemas.

manifest_version: 2

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

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]
          - LOGIC_SCHEMA:
              roles: [ANALYST]
              tables:
                - POPULATION_DYNAMIC_TABLE:
                    roles: [ANALYST]
              functions:
                - POPULATION_ANALYSIS_FUNCTION(NUMBER):
                    roles: [ANALYST]
              procedures:
                - POPULATION_ANALYSIS_PROCEDURE():
                    roles: [ANALYST]
application_content:
  notebooks:
      - intro_notebook:
          roles: [VIEWER, ANALYST]
          main_file: INTRO_NB.ipynb
      - analyst_notebook:
          roles: [ANALYST]
          main_file: ANALYST_NB.ipynb
Copy
语言: 中文