UpdateMetaEntity

更新时间:
复制 MD 格式

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

张三

Custom entities

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

Field Supported Description
Comment Yes Updates the entity comment.
Attributes Yes The key must be defined in the corresponding MetaEntityDef.AttributeDefs. Providing an unknown key returns an error.
CustomAttributes Yes The key must be a custom attribute that applies to this entity type.

Attribute rules

Item Description
Update semantics This is a patch operation. Only the keys provided in the request are updated. Existing attributes are retained.
Delete attribute To delete an attribute, set its value to null. This removes the key from the entity's attributes.
Required attribute The system returns an error if you attempt to delete or clear a required attribute.
ENUM attribute The value must be one of the allowed values defined in AttributeDef.AllowedValues.
DATE attribute The value must be a millisecond timestamp.
ARRAY/JSON attribute The value must be provided as a JSON string because the API accepts all parameters as 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 key Supported Type/format Description
technicalMetadata.location Yes String Updates the storage location of the database. This corresponds to the location field in Elasticsearch.
parentMetaEntityId No - The parent-child relationship cannot be updated. Providing this key returns an error.
Other keys No - 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 key Supported Type/format Description
tableType Yes String Updates the table type.
partitionKeys Yes JSON array string or String If you provide an array, the system joins the items with commas to create the final string. For example, ["dt","hh"] becomes dt,hh.
technicalMetadata.owner Yes String Updates the owner.
technicalMetadata.location Yes String Updates the storage location.
technicalMetadata.compressed Yes Boolean Supports true and false.
technicalMetadata.inputFormat Yes String Updates the InputFormat.
technicalMetadata.outputFormat Yes String Updates the OutputFormat.
technicalMetadata.serializationLibrary Yes String Updates the SerDe class.
technicalMetadata.parameters Yes JSON object string or String If you provide a JSON object, the system serializes it into a string and writes it to the parameters attribute.
parentMetaEntityId No - The parent database cannot be updated. Providing this key returns an error.
columns No - You cannot modify the column list using the UpdateMetaEntity operation. Instead, update each column entity individually.
Other keys No - 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 key Supported Type/format Description
type Yes String Updates the column type.
position Yes Integer Updates the column position.
partitionKey Yes Boolean Sets whether the column is a partition key. This corresponds to the isPartitionKey field in Elasticsearch.
primaryKey Yes Boolean Sets whether the column is a primary key. This corresponds to the isPrimaryKey field in Elasticsearch.
foreignKey Yes Boolean Sets whether the column is a foreign key. This corresponds to the isForeignKey field in Elasticsearch.
parentMetaEntityId No - The parent table cannot be updated. Providing this key returns an error.
Other keys No - 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

Item Conclusion
Modify entity name Not supported. The name is derived from the Id.
Modify EntityType Not supported. The type is derived from the Id.
Modify parent entity Not supported. Providing attributes.parentMetaEntityId returns an error.
Modify column list Not supported. Providing attributes.columns returns an error.
Create new columns Not 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 result of the update 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.