logo
Report Vulnerabilities
2.1.0
English
menu
EnOS Asset Tree Service API

EnOS Asset Tree Service API

Overview

  • Asset Tree Service Overview

API Reference

  • Asset Tree
    • Create Asset Tree
    • Create Asset Tree and Link an Asset
      • Operation Permissions
      • Request Format
      • Request Parameters (URI)
      • Request Parameters (Body)
      • Response Parameters
      • Error Codes
      • Samples
        • Request Sample
        • Return Sample
        • Java SDK Sample
    • Delete Asset Tree
    • Get Asset Tree
    • Search Asset Tree
    • Update Asset Tree
  • Asset Tree Node

Other References

  • About EnOS API
  • How to Invoke an EnOS API
  • About Asset Trees

Last Updated 2024-08-21

The availability of EnOS functions is subject to licenses and access permissions. Contact your system administrator if certain functions are not available in your environment.
  • Documentation
  • Asset Tree
  • Create Asset Tree and Link an Asset
  • Edit

Create Asset Tree and Link an Asset¶

Create an asset tree and link an existing asset as the root node of the asset tree. The asset to be linked can be a device asset or a non-device (logical) asset.

Operation Permissions¶

Required Authorization

Required Operation Permission

Asset Tree Management

Full Access

Request Format¶

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

Request Parameters (URI)¶

Note

Use one of the following methods to identify the asset to be linked.

  • Include the assetId in the request

  • Include both productKey and deviceKey in the request

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

assetId

Query

Optional (See Note above)

String

The asset ID. How to get assetID>>

productKey

Query

Optional (See Note above)

String

The product key. To be used with deviceKey .

deviceKey

Query

Optional (See Note above)

String

The device key. To be used with productKey .

Request Parameters (Body)¶

Name

Mandatory/Optional

Data Type

Description

tree

Optional

TreeCreateVo Struct

The details of the asset tree to be created. For more details, see TreeCreateVo Struct

Response Parameters¶

Name

Data Type

Description

data

String

The created asset tree ID.

Error Codes¶

Code

Message

Description

17772

The quota of tree reaches ceiling

Number of trees already reaches maximum of the OU.

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=associate&orgId=yourOrgId&assetId=yourAssetId
method: POST
requestBody:
{
    "tree":{
        "name":{
            "defaultValue":"Name"
        }
    }
}

Return Sample¶

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

Java SDK Sample¶

package com.envisioniot.enos.asset_tree_service;

import com.envision.apim.poseidon.config.PConfig;
import com.envision.apim.poseidon.core.Poseidon;
import com.envisioniot.enos.api.common.constant.request.Pagination;
import com.envisioniot.enos.api.common.constant.request.Projection;
import com.envisioniot.enos.asset_tree_service.v2_1.*;
import com.envisioniot.enos.asset_tree_service.vo.*;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;

public class AssetTreeTest {
    private static String AccessKey = "yourAccessKey";
    private static String SecretKey = "yourSecretKey";
    private static String OrgId = "yourOrgId";
    private static String ServerUrl = "yourServerUrl";

    @Test
    public void testAssociateTree() {
        AssociateTreeRequest request = new AssociateTreeRequest();
        TreeCreateVo tree = new TreeCreateVo();
        I18nVo treeName = new I18nVo();
        treeName.setDefaultValue("treeDefaultName");
        tree.setName(treeName);
        request.setTree(tree);
        request.setOrgId(OrgId);
        request.setAssetId("yourAssetId");
        AssociateTreeResponse response = Poseidon.config(PConfig.init().appKey(AccessKey).appSecret(SecretKey).debug())
            .url(ServerUrl)
            .getResponse(request, AssociateTreeResponse.class);
    }
}
Previous Next

Preview:

0  words
Comments
  • Latest
  • Oldest
No comments yet.
On this page
    • Operation Permissions
    • Request Format
    • Request Parameters (URI)
    • Request Parameters (Body)
    • Response Parameters
    • Error Codes
    • Samples
      • Request Sample
      • Return Sample
      • Java SDK Sample
© 2025 Univers. All Rights Reserved. | Privacy Notice User Agreement