Update Asset Tree

Update the information of an asset tree.

Operation Permissions

Required Authorization

Required Operation Permission

Asset Tree

Full Access

Request Format

POST https://{apigw-address}/asset-tree-service/v2.1/asset-trees?action=update

Request Parameters (URI)

Name

Location (Path/Query)

Mandatory/Optional

Data Type

Description

orgId

Query

Mandatory

String

The organization ID which the asset belongs to. How to get orgId>>

Request Parameters (Body)

Name

Mandatory/Optional

Data Type

Description

treeUpdateInfo

Mandatory

TreeUpdateVo Struct

The details to be provided when updating an asset tree. For more details, see TreeUpdateVo Struct>>

TreeUpdateVo Struct

Note

When updating asset trees, it is mandatory to specify either name or tag.

Name

Mandatory/Optional

Data Type

Description

treeId

Mandatory

String

The asset tree ID.

name

Optional (See Note above)

StringI18n

Specify the asset tree’s name in its respective locale’s language. For more details on the structure and locales supported, see Internationalized name struct>>

tags

Optional (See Note above)

Tag Struct

User-defined tags. (The Key and Value are of String type.) For details, see How to use tags>>

Error Codes

Code

Message

Description

99400

Invalid arguments

The request parameter is invalid. Check the request parameters.

99500

System error

Internal server error. Contact EnOS support.

Samples

Request Sample

url: https://{apigw-address}/asset-tree-service/v2.1/asset-trees?action=update&orgId=yourOrgId
method: POST
requestBody:
{
"treeUpdateInfo":{
    "treeId": "H4yVDl2U",
    "name": {
        "defaultValue": "Tree Name",
        "i18nValue":{
            "en_US":"EN Tree Name",
            "zh_CN":"名字"
        }
    },
    "tags":{
        "tag1":"Tag 1"
    }
}

Return Sample

{
  "code": 0,
  "msg": "OK",
  "requestId": "01b5477a-374e-49a0-8b68-7dbfe8f0b74f",
  "data": null
}

SDK Samples


You can access the SDK samples for Asset Tree Service on GitHub: