すべてのプロダクト
Search
ドキュメントセンター

DataWorks:BatchCreateMetaEntities

最終更新日:Jun 11, 2026

メタデータエンティティをバッチで作成します。バッチ内のすべてのエンティティは同じエンティティタイプである必要があります。この操作は現在、カスタムタイプと拡張テーブルタイプ(データベースとテーブルを表す)のみをサポートしています。

操作説明

You must purchase DataWorks Professional Edition or a higher edition to use this operation.

今すぐお試しください

この API を OpenAPI Explorer でお試しください。手作業による署名は必要ありません。呼び出しに成功すると、入力したパラメーターに基づき、資格情報が組み込まれた SDK コードが自動的に生成されます。このコードをダウンロードしてローカルで使用できます。

テスト

RAM 認証

この操作の認証情報はありません。問題が発生した場合は、アカウントマネージャーにご連絡ください。

リクエスト構文

POST  HTTP/1.1

リクエストパラメーター

パラメーター

必須 / 任意

説明

Entities

array<object>

必須

エンティティリスト。バッチで最大 5 つのエンティティを作成できます。バッチ内のすべてのエンティティは同じ EntityType である必要があります。

[]

array<object>

任意

An object that represents a metadata entity.

EntityType

string

必須

The entity type. All entities in a batch must have the same type. The following types are supported:

  • Custom types, such as custom_entity-biz_api.

  • Extended table types. For example, if you have registered the custom_dw-table metadata entity type, you can create objects of the corresponding custom_dw-database (database) and custom_dw-table (table) types.

custom_entity-customer_api

Name

string

必須

The entity name. The name can contain uppercase letters, lowercase letters, digits, and underscores (_). It must start with a letter and not exceed 64 characters.

api_001

Comment

string

任意

The comment for the entity.

this is a comment

Attributes

object

任意

The entity attributes. Complex values must be serialized into a JSON string.

string

任意

An entity attribute.

key1

CustomAttributes

object

任意

The custom attribute values. The key is the identifier of the custom attribute, and the value is a single-element list.

重要 The custom attributes used here must be created in advance by using the CreateCustomAttribute API. For example, after you create a custom attribute with the ID custom-attribute:owner_name, you can configure the custom attribute by setting this parameter to {'owner_name': ['Bob']}.

array

任意

A list of custom attribute values.

string

任意

A custom attribute value.

value1

拡張データベース

EntityTypecustom_xxx-database に設定します。xxx プレースホルダーは、custom_xxx-table などのテーブルの既存の拡張エンティティ定義(EntityDef)から導出されます。

属性

属性キー必須タイプ説明
parentMetaEntityIdはいString親インスタンス ID。インスタンスレベルである必要があり、カタログ、データベース、スキーマ、テーブル、またはカラムの識別子を含めることはできません。
technicalMetadata.locationいいえStringデータベースのストレージロケーション。

拡張テーブル

EntityTypecustom_xxx-table に設定します。Attributes.columns パラメーターを使用してテーブルカラムも登録する必要があります。

属性

属性キー必須タイプ説明
parentMetaEntityIdはいString親データベース ID。データベースレベルである必要があります。
tableTypeいいえStringテーブルタイプ。このパラメーターを設定しない場合、デフォルト値 TABLE が使用されます。
partitionKeysいいえJSON 配列文字列パーティションキー。例: ["dt"]
technicalMetadata.locationいいえStringストレージロケーション。
technicalMetadata.compressedいいえBoolean string or JSON booleanデータが圧縮されているかどうかを指定します。
technicalMetadata.inputFormatいいえString入力フォーマット。
technicalMetadata.outputFormatいいえString出力フォーマット。
technicalMetadata.serializationLibraryいいえStringシリアライゼーション/デシリアライゼーション(SerDe)ライブラリ。
technicalMetadata.parametersいいえJSON オブジェクト文字列パラメーター情報。例: {"retention":"30"}
columnsいいえJSON 配列文字列埋め込みカラムのリスト。テーブル作成時に拡張カラムを登録するには、このパラメーターを使用します。

Attributes.columns

columns パラメーターは Attributes 内の JSON 配列文字列です。配列内の各オブジェクトは以下のフィールドをサポートしています:

パラメーター必須タイプ説明
nameはいStringカラム名。このプロパティが空の場合、カラムはスキップされます。
typeはいStringカラムタイプ。このプロパティが欠落している場合、システムは attributes.columns[i].type のエラーを報告します。
commentいいえStringカラムのコメント。
positionいいえIntegerカラムの位置。指定しない場合、デフォルトで配列インデックス i + 1 になります。
partitionKeyいいえBooleanカラムがパーティションキーかどうかを指定します。
primaryKeyいいえBooleanカラムがプライマリキーかどうかを指定します。
customAttributesいいえObjectカラムのカスタム属性値。

例.

拡張データベースの作成

{
  "Entities": [
    {
      "EntityType": "custom_demo-database",
      "Name": "ods",
      "Comment": "ODS データベース",
      "Attributes": {
        "parentMetaEntityId": "custom_demo:demo_source",
        "technicalMetadata.location": "oss://bucket/ods"
      },
      "CustomAttributes": {
        "biz_owner": ["data_team"]
      }
    }
  ]
}
```.

### 拡張テーブルとカラムの作成

```json
{
  "Entities": [
    {
      "EntityType": "custom_demo-table",
      "Name": "order_fact",
      "Comment": "注文ファクトテーブル",
      "Attributes": {
        "parentMetaEntityId": "custom_demo-database:demo_source::ods",
        "tableType": "TABLE",
        "partitionKeys": "[\"dt\"]",
        "technicalMetadata.location": "oss://bucket/ods/order_fact",
        "technicalMetadata.compressed": "true",
        "technicalMetadata.parameters": "{\"retention\":\"30\",\"bizDomain\":\"trade\"}",
        "columns": "[{\"name\":\"id\",\"type\":\"BIGINT\",\"comment\":\"プライマリキー\",\"position\":1,\"primaryKey\":true,\"customAttributes\":{\"security_level\":[\"P1\"]}},{\"name\":\"dt\",\"type\":\"STRING\",\"comment\":\"パーティション日付\",\"position\":2,\"partitionKey\":true}]"
      },
      "CustomAttributes": {
        "biz_owner": ["data_team"]
      }
    }
  ]
}
```.

## 使用上の注意

- 拡張データベースの `parentMetaEntityId` は、`custom_demo:demo_source` のようにインスタンスレベルである必要があります。

- 拡張テーブルの `parentMetaEntityId` は、`custom_demo-database:demo_source::ods` のようにデータベースレベルである必要があります。

- 親エンティティと子エンティティは同じ拡張ファミリーに属する必要があります。例えば、`custom_demo-table` エンティティの親は `custom_demo-database` エンティティである必要があります。

- `columns` パラメーターはテーブル作成時にのみ指定できます。`BatchCreateMetaEntities` 操作を使用して `custom_xxx-column` エンティティを個別に作成することはできません。

- 拡張エンティティの場合、書き込みパスは `MetaEntityDef.AttributeDefs` に基づいて `Attributes` パラメーター内の不明なキーを厳密にブロックしません。不明なキーは通常無視されます。

レスポンスフィールド

フィールド

説明

object

The response body.

RequestId

string

The request ID.

9E0C8E7A-C6BE-5A73-9562-2A030A80E8C6

Success

boolean

Indicates whether the request was successful. This parameter returns true even if creating some entities fails. To determine the outcome for each entity, check the Success and ErrorMessage fields in the Results array.

true

Results

array

A list of results for the batch creation operation. This list provides the success status and any error messages for each individual entity in the request.

MetaEntityWriteResult

The result of a single entity creation within the batch.

成功レスポンス

JSONJSON

{
  "RequestId": "9E0C8E7A-C6BE-5A73-9562-2A030A80E8C6",
  "Success": true,
  "Results": [
    {
      "Name": "entity_01",
      "EntityType": "custom_entity-demo",
      "Id": "custom_entity-demo:entity_01",
      "Success": true,
      "ErrorMessage": "The specified parameters are invalid."
    }
  ]
}

エラーコード

完全なリストについては、「エラーコード」をご参照ください。

変更履歴

完全なリストについては、「変更履歴」をご参照ください。