UpdateMetaEntity - UpdateMetaEntity
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
Test
RAM authorization
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:
| Column | Supported | Description |
Comment | Yes | Updates the entity comment. |
Attributes | Yes | The key must exist in the corresponding MetaEntityDef.AttributeDefs. An unknown key returns an error. |
CustomAttributes | Yes | The key must be a custom attribute definition applicable to the entity type. |
Attributes rules
| Item | Description |
| Update semantics | Patch semantics. Only the keys that are passed in are updated, and other existing attributes are retained. |
| Deleting an attribute | If a key is passed in with a value of null, the key is deleted from the entity attributes. |
| Required attributes | If a required attribute is deleted or cleared, the merged result is validated and an error is returned. |
| ENUM attributes | The value must be in AttributeDef.AllowedValues. |
| DATE attributes | The value must be a millisecond timestamp. |
| ARRAY/JSON attributes | Because 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 key | Supported | Type/Format | Description |
technicalMetadata.location | Yes | String | Updates the storage location of the database, which corresponds to the ES column location. |
parentMetaEntityId | No | - | Parent-child relationships cannot be updated. Passing this parameter returns an error. |
| Other keys | No | - | Updating keys outside the allowlist of shared entities returns an error. |
Extended table type: Table objects
Applicable to custom_<name>-table.
| Attributes key | Supported | Type/Format | Description |
tableType | Yes | String | Updates the table type. |
partitionKeys | Yes | JSON Array string or String | When an array is passed in, the values are concatenated with commas before being written. For example, ["dt","hh"] is written as 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 | When a JSON Object is passed in, it is serialized as a string and written to parameters. |
parentMetaEntityId | No | - | The parent database cannot be updated. Passing this parameter returns an error. |
columns | No | - | You cannot modify the column list by using UpdateMetaEntity. Update the column entity instead. |
| Other keys | No | - | 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 key | Supported | Type/Format | Description |
type | Yes | String | Updates the column type. |
position | Yes | Integer | Updates the column position. |
partitionKey | Yes | Boolean | Updates whether the column is a partition key, which corresponds to the ES column isPartitionKey. |
primaryKey | Yes | Boolean | Updates whether the column is a primary key, which corresponds to the ES column isPrimaryKey. |
foreignKey | Yes | Boolean | Updates whether the column is a foreign key, which corresponds to the ES column isForeignKey. |
parentMetaEntityId | No | - | The parent table cannot be updated. Passing this parameter returns an error. |
| Other keys | No | - | 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
| Item | Result |
| Modify entity name | Not supported. The name is derived from Id. |
| Modify EntityType | Not supported. The type is derived from Id. |
| Modify parent entity | Not supported. Passing attributes.parentMetaEntityId returns an error. |
| Modify column list | Not supported. Passing attributes.columns returns an error. |
| Create new columns | Not 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.