UpdateMetaEntity

Updated at:

Updates a metadata entity. You can update custom entities or objects of the extended table type, such as databases, tables, and columns.

Operation description

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

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dataworks:UpdateMetaEntity

update

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

Id

string

Yes

The ID of the entity to update. The entity name, entity type, and parent-child relationship are determined by the ID and cannot be modified using this operation.

custom_entity-customer_api:api_001

Comment

string

No

The comment on the entity.

this is a comment

Attributes

object

No

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

[]

string

No

The value of the entity attribute.

value

CustomAttributes

object

No

The custom attribute values. Each key specifies a custom attribute, and its value is an array that can contain at most one item. To delete an attribute value, provide an empty array.

[]

array

No

An array of custom attribute values. Currently, only single-value arrays are supported.

string

No

The custom attribute value.

Zhang San

Custom entities

For custom entities, set EntityType to custom_entity-<name>. You can update the following items:

FieldSupportedDescription
CommentYesUpdates the entity comment.
AttributesYesThe key must be defined in the corresponding MetaEntityDef.AttributeDefs. Providing an unknown key returns an error.
CustomAttributesYesThe key must be a custom attribute that applies to this entity type.

Attribute rules

ItemDescription
Update semanticsThis is a patch operation. Only the keys provided in the request are updated. Existing attributes are retained.
Delete attributeTo delete an attribute, set its value to null. This removes the key from the entity's attributes.
Required attributeIf a required attribute is deleted or cleared, the system validates the merged result and returns an error.
ENUM attributeThe value must be one of the allowed values defined in AttributeDef.AllowedValues.
DATE attributeThe value must be a millisecond timestamp.
ARRAY/JSON attributeBecause the OpenAPI input values are strings, ARRAY/JSON attribute values usually need to be provided as JSON strings.

Example:

{
  "Comment": "Updated custom entity",
  "Attributes": {
    "level": "L2",
    "profile": "{\"owner\":\"data_team\"}"
  },
  "CustomAttributes": {
    "biz_owner": ["data_team"]
  }
}

Database object of the extended table type

Applies to custom_<name>-database.

Attributes keySupportedType/formatDescription
technicalMetadata.locationYesStringUpdates the storage location of the database. This corresponds to the location field in Elasticsearch.
parentMetaEntityIdNo-The parent-child relationship cannot be updated. Providing this key returns an error.
Other keysNo-For a shared entity, updating keys that are not on the whitelist returns an error.

Table object of the extended table type

Applies to custom_<name>-table.

Attributes keySupportedType/formatDescription
tableTypeYesStringUpdates the table type.
partitionKeysYesJSON array string or StringIf you provide an array, the system joins the items with commas to create the final string. For example, ["dt","hh"] becomes dt,hh.
technicalMetadata.ownerYesStringUpdates the owner.
technicalMetadata.locationYesStringUpdates the storage location.
technicalMetadata.compressedYesBooleanSupports true and false.
technicalMetadata.inputFormatYesStringUpdates the InputFormat.
technicalMetadata.outputFormatYesStringUpdates the OutputFormat.
technicalMetadata.serializationLibraryYesStringUpdates the SerDe class.
technicalMetadata.parametersYesJSON object string or StringIf you provide a JSON object, the system serializes it into a string and writes it to the parameters attribute.
parentMetaEntityIdNo-The parent database cannot be updated. Providing this key returns an error.
columnsNo-You cannot modify the column list using the UpdateMetaEntity operation. Instead, update each column entity individually.
Other keysNo-For a shared entity, updating keys that are not on the whitelist returns an error.

Example:

{
  "Comment": "Updated table description",
  "Attributes": {
    "tableType": "VIEW",
    "partitionKeys": "[\"dt\"]",
    "technicalMetadata.location": "oss://bucket/ods/order_fact",
    "technicalMetadata.compressed": "true",
    "technicalMetadata.parameters": "{\"retention\":\"30\"}"
  },
  "CustomAttributes": {
    "biz_owner": ["data_team"]
  }
}

Column object of the extended table type

Applies to custom_<name>-column.

Attributes keySupportedType/formatDescription
typeYesStringUpdates the column type.
positionYesIntegerUpdates the column position.
partitionKeyYesBooleanSets whether the column is a partition key. This corresponds to the isPartitionKey field in Elasticsearch.
primaryKeyYesBooleanSets whether the column is a primary key. This corresponds to the isPrimaryKey field in Elasticsearch.
foreignKeyYesBooleanSets whether the column is a foreign key. This corresponds to the isForeignKey field in Elasticsearch.
parentMetaEntityIdNo-The parent table cannot be updated. Providing this key returns an error.
Other keysNo-For a shared entity, updating keys that are not on the whitelist returns an error.

The request fails if the parent table does not exist, does not belong to the current tenant, or does not have inline columns.

Example:

{
  "Comment": "Order ID",
  "Attributes": {
    "type": "BIGINT",
    "position": "1",
    "primaryKey": "true"
  },
  "CustomAttributes": {
    "security_level": ["P1"]
  }
}

Unsupported operations

ItemConclusion
Modify entity nameNot supported. The name is derived from the Id.
Modify EntityTypeNot supported. The type is derived from the Id.
Modify parent entityNot supported. Providing attributes.parentMetaEntityId returns an error.
Modify column listNot supported. Providing attributes.columns returns an error.
Create new columnsNot supported. To add columns to an extended table, specify them in the Attributes.columns parameter when you create the table using the BatchCreateMetaEntities operation.

Response elements

Element

Type

Description

Example

object

The data returned in the response.

RequestId

string

The ID of the request.

AASFDFSDFG-DFSDF-DFSDFD-SDFSDF

Success

boolean

Indicates whether the request was successful.

true

Result

object

The updated entity or the result of the write operation.

Id

string

The ID of the entity.

custom_entity-customer_api:api_001

Success

boolean

Indicates whether the update was successful.

true

Examples

Success response

JSON format

{
  "RequestId": "AASFDFSDFG-DFSDF-DFSDFD-SDFSDF",
  "Success": true,
  "Result": {
    "Id": "custom_entity-customer_api:api_001",
    "Success": true
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.