Create a single-physical-table service unit

更新时间:
复制 MD 格式

A single-physical-table service unit configures metadata for a physical table in a business data source. You can then use the service unit to develop APIs that access data in the table.

Prerequisites

  • A service unit group has been created. For more information, see Create a service unit group.

  • If the data source type is HBase 0.9.4/1.1.x/1.2.1/2.x, Elasticsearch, or MongoDB, you must create metadata. For more information, see Create metadata.

Limitations

Permissions

Both project administrators and developers can create service units.

Step 1: Select the service unit type

  1. On the Dataphin homepage, choose Service > API Development from the top navigation bar.

  2. In the upper-left corner, select a project. In the navigation pane on the left, click Service Unit. On the Service Unit page, click + Create Service Unit.

  3. In the Create Service Unit dialog box, select Single-Physical-Table Service Unit.

Step 2: Configure the service unit parameters

  1. On the Create Service Unit page, configure the basic information and fields for the service unit.

    1. Configure basic information

      Parameter

      Description

      Service unit name

      The name of the service unit. The name must meet the following requirements:

      • Can contain only letters, digits, and underscores (_).

      • Must start with a letter.

      • Must be 4 to 64 characters in length.

      Service unit group

      Select an existing service unit group.

      mode

      A mode is used to define whether a service unit reads data from a development data source or a production data source. The modes include the Basic and Dev-Prod modes:

      • Basic: The service unit can read data only from a production data source.

      • Dev-Prod: The service unit can read data from both a development data source and a production data source.

      You can check whether your data source is a development or production data source on the data source page.

      Physical table

      You can filter physical tables by data source type and data source. You can also click Add Data Source to add a new business data source to use for creating the service unit. For a list of supported data sources, see Data sources supported by Data Service.

      Service unit description

      Enter a brief description of the service unit. The description can be up to 128 characters long.

      Maximum rows returned

      By default, the maximum number of returned rows is 1,000. You can increase this value to a maximum of 10,000.

      This parameter limits the number of rows returned by an API query to prevent Dataphin from using excessive memory. To retrieve more data, you can modify the PageSize parameter in the SDK when you call an API.

      If a service unit with similar basic information already exists, Dataphin displays its name. You can view the details of this service unit in the service unit list. To proceed with creating a new service unit, click Continue to Create to go to the Configure Service Unit Fields page.

    2. Configure service unit fields.

      Parameter

      Description

      Service unit field type

      Supported types include Double, Float, String, Date, Boolean, Int, Long, Short, Byte, BigDecimal, and Binary. Select a parameter type that corresponds to the field type in your business data table.

      If the field type in your business data table is not listed, we recommend that you select String.

      Service unit field

      • You can select specific fields from the source table to use as service unit fields. If new fields are added to the source table, you can select them when you edit the service unit.

      • Map the fields from the data source to field names in the service unit. You can customize the field names based on your business needs. The name must meet the following requirements:

        • Can contain only letters, digits, and underscores (_).

        • Must start with a letter.

        • Must be 4 to 64 characters in length.

      • When you edit the service unit, you can remove fields that have been deleted from the source table. This prevents APIs created from this service unit from failing due to missing fields.

      Service unit field description

      Enter a brief description for the service unit field.

      After configuring the fields, click Data Preview at the bottom to view the corresponding business data. A maximum of 1,000 rows are returned.

    3. Based on the selected physical table, the system automatically parses the associated row-level permission information, including the permission name, description, control field, data source environment, associated table, and associated field. You can also perform the following actions:

      • Enable or disable row-level permission: Controls the permission's active state and its visibility in the service unit details.

      • Create Row-Level Permission: You must have permission to create row-level permissions. Clicking this button redirects you to the row-level permission creation page in Management Center > Permission Management, where you can create a row-level permission.

        Note
        • The row-level permission feature requires a paid add-on service.

        • API call results may differ depending on the permissions applied.

        • When the mode is Basic, row-level permissions for physical tables in the production environment are displayed. When the mode is Dev-Prod, permissions for tables in both the development and production environments are displayed.

        • If row-level permission is enabled for a published service unit, any API created from that unit is subject to the corresponding permission controls.

        • If you create or delete a row-level permission associated with a published service unit in Management Center > Permission Management, the change takes effect automatically for all APIs based on that unit. You do not need to republish the APIs.

        • The selected physical table is subject to its associated row-level permission controls, regardless of whether its fields are used by an API or added to the service unit.

  2. Click Submit to create the single-physical-table service unit.

What to do next

  • On the Service Unit page, find your service unit, click the image.png icon in the Actions column, and select Publish. This action publishes the service unit to the production environment. You can then create APIs based on this service unit. For more information, see Create an API.

  • After a service unit is created, you can manage it on the Service Unit page. Available actions include editing, publishing, and deleting. For more information, see Manage service units.