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.
Posted: 2020-07-04 04:48 PM
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)
Posted: 2020-07-04 04:48 PM
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:
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)
Posted: 2020-07-04 04:48 PM
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)
Posted: 2020-07-04 04:48 PM
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:
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)
Posted: 2020-07-04 04:48 PM
This comment was originally posted on DCIM Support by soeren.corneliussen on 2018-04-24
Thanks Christopherus.
That was an excellent answer!
(CID:130682403)
Posted: 2020-07-04 04:48 PM
This question is closed for comments. You're welcome to start a new topic if you have further comments on this issue.
Create your free account or log in to subscribe to the forum - and gain access to more than 10,000+ support articles along with insights from experts and peers.