Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84766members
354199posts

DCO REST API and customPropertyKeys

EcoStruxure IT forum

A support forum for Data Center Operation, Data Center Expert, and EcoStruxure IT product users to share knowledge on installation, configuration, and general product use.

Solved
DCIM_Support
Picard
Picard
0 Likes
4
363

DCO REST API and customPropertyKeys

This question was originally posted on DCIM Support by soeren.corneliussen on 2018-04-23


Hi

I am trying to export the customProperties using the REST API. (e.g. using https://x.x.x.x/api/current/assets/search). But I have a problem separating the names and values in the output, because the REST API outputs following strings.

Example:

"customPropertyKeys": "Type Serienummer Systemejer H-nummer",         "customPropertyValues": "Server KD1N2PG Infrastruktur H01160",

 

The customproperties are well structures within Struxurware. E.g

Name1 : Value1

Name2 : Value2

 

But as you probably guess then there is a problem in using " " in the name og values. E.g.

Name 1 : Value1

Name2 : Value 2

 

This will result in following  output from the REST API

"customPropertyKeys": "Name 1 Name2",

"customPropertyValues": "Value1 Value 2"

 

How on earth can you now separate these name/value pairs? If you separate on spaces, then you get it wrong.. 🙂

Name  : Value1

1     : Value

Name2 : 2

 

Have I missed something? Or should we just not used spaces in the customproperties?

(CID:130098190)


Accepted Solutions
DCIM_Support
Picard
Picard
0 Likes
1
363

Re: DCO REST API and customPropertyKeys

This answer was originally posted on DCIM Support by Christopherus Laurentius on 2018-04-24


Not a direct asset search, but you can differentiate all the custom properties of an asset using GET /assets/{asset-id} with type specified as custom_properties.It requires 2 call:

  1. Get the asset id using get/assets/search
  2. Get the custom properties & values of that asset id using GET /assets/{asset-id} with type specified as custom_properties

 

Example in pictorial form, easier 😀

In DCO:

From RESTful api using GET/assets/ search

As you said, there is no way to tell which value, due to space.

Use this just to get the asset id only.

Using GET/assets/{asset-id} with type specified as custom_properties

Individual custom properties & its values are listed separately

Response:

(CID:130098578)

See Answer In Context

4 Replies 4
DCIM_Support
Picard
Picard
0 Likes
0
363

Re: DCO REST API and customPropertyKeys

This comment was originally posted on DCIM Support by Ed Tarento on 2018-04-23


Hi soeren.corneliussen

What tool / language are you using to extract / unpack this data?

(CID:130682405)

DCIM_Support
Picard
Picard
0 Likes
1
364

Re: DCO REST API and customPropertyKeys

This answer was originally posted on DCIM Support by Christopherus Laurentius on 2018-04-24


Not a direct asset search, but you can differentiate all the custom properties of an asset using GET /assets/{asset-id} with type specified as custom_properties.It requires 2 call:

  1. Get the asset id using get/assets/search
  2. Get the custom properties & values of that asset id using GET /assets/{asset-id} with type specified as custom_properties

 

Example in pictorial form, easier 😀

In DCO:

From RESTful api using GET/assets/ search

As you said, there is no way to tell which value, due to space.

Use this just to get the asset id only.

Using GET/assets/{asset-id} with type specified as custom_properties

Individual custom properties & its values are listed separately

Response:

(CID:130098578)

DCIM_Support
Picard
Picard
0 Likes
0
363

Re: DCO REST API and customPropertyKeys

This comment was originally posted on DCIM Support by soeren.corneliussen on 2018-04-24


Thanks Christopherus.

That was an excellent answer!

(CID:130682403)

DCIM_Support
Picard
Picard
0 Likes
0
363

🔒 Closed

This question is closed for comments. You're welcome to start a new topic if you have further comments on this issue.