UpdateMetaEntity - 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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

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 relationships are determined by the ID and cannot be modified by using this operation.

custom_entity-customer_api:api_001

Comment

string

No

The comment.

this is a comment

Attributes

object

No

The entity attributes. Complex values must be serialized as JSON strings.

[]

string

No

The entity attribute value.

value

CustomAttributes

object

No

The custom attribute values. The key is the identifier of a custom attribute, and the value contains at most one element. An empty list indicates that the attribute value is deleted.

[]

array

No

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

string

No

The custom attribute value.

John

Custom entities

EntityType uses custom_entity-<name>. The following content can be updated:

ColumnSupportedDescription
CommentYesUpdates the entity comment.
AttributesYesThe key must exist in the corresponding MetaEntityDef.AttributeDefs. An unknown key returns an error.
CustomAttributesYesThe key must be a custom attribute definition applicable to the entity type.

Attributes rules

ItemDescription
Update semanticsPatch semantics. Only the keys that are passed in are updated, and other existing attributes are retained.
Deleting an attributeIf a key is passed in with a value of null, the key is deleted from the entity attributes.
Required attributesIf a required attribute is deleted or cleared, the merged result is validated and an error is returned.
ENUM attributesThe value must be in AttributeDef.AllowedValues.
DATE attributesThe value must be a millisecond timestamp.
ARRAY/JSON attributesBecause the OpenAPI input parameter is a string, you typically need to pass a JSON string.

Example:

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

Extended table type: Database objects

Applicable to custom_<name>-database.

Attributes keySupportedType/FormatDescription
technicalMetadata.locationYesStringUpdates the storage location of the database, which corresponds to the ES column location.
parentMetaEntityIdNo-Parent-child relationships cannot be updated. Passing this parameter returns an error.
Other keysNo-Updating keys outside the allowlist of shared entities returns an error.

Extended table type: Table objects

Applicable to custom_<name>-table.

Attributes keySupportedType/FormatDescription
tableTypeYesStringUpdates the table type.
partitionKeysYesJSON Array string or StringWhen an array is passed in, the values are concatenated with commas before being written. For example, ["dt","hh"] is written as 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 StringWhen a JSON Object is passed in, it is serialized as a string and written to parameters.
parentMetaEntityIdNo-The parent database cannot be updated. Passing this parameter returns an error.
columnsNo-You cannot modify the column list by using UpdateMetaEntity. Update the column entity instead.
Other keysNo-Updating keys outside the allowlist of shared entities 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"]
  }
}

Extended table type: Column objects

Applicable to custom_<name>-column.

Attributes keySupportedType/FormatDescription
typeYesStringUpdates the column type.
positionYesIntegerUpdates the column position.
partitionKeyYesBooleanUpdates whether the column is a partition key, which corresponds to the ES column isPartitionKey.
primaryKeyYesBooleanUpdates whether the column is a primary key, which corresponds to the ES column isPrimaryKey.
foreignKeyYesBooleanUpdates whether the column is a foreign key, which corresponds to the ES column isForeignKey.
parentMetaEntityIdNo-The parent table cannot be updated. Passing this parameter returns an error.
Other keysNo-Updating keys outside the allowlist of shared entities returns an error.

An error is returned 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 or commonly misused items

ItemResult
Modify entity nameNot supported. The name is derived from Id.
Modify EntityTypeNot supported. The type is derived from Id.
Modify parent entityNot supported. Passing attributes.parentMetaEntityId returns an error.
Modify column listNot supported. Passing attributes.columns returns an error.
Create new columnsNot supported. Columns for extended tables must be provided by using Attributes.columns in BatchCreateMetaEntities when the table is created.

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

AASFDFSDFG-DFSDF-DFSDFD-SDFSDF

Success

boolean

Indicates whether the request was successful.

true

Result

object

The updated entity or the write result.

Id

string

The entity ID.

custom_entity-customer_api:api_001

Success

boolean

Indicates whether the operation 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.