EcoStruxure IT forum
Schneider Electric support forum about installation and configuration for DCIM including EcoStruxure IT Expert, IT Advisor, Data Center Expert, and NetBotz
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-07-04 04:48 PM . Last Modified: 2024-04-05 12:07 AM
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)
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-07-04 04:48 PM . Last Modified: 2024-04-05 12:07 AM
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)
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-07-04 04:48 PM . Last Modified: 2024-04-05 12:07 AM
Hi soeren.corneliussen
What tool / language are you using to extract / unpack this data?
(CID:130682405)
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-07-04 04:48 PM . Last Modified: 2024-04-05 12:07 AM
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)
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-07-04 04:48 PM . Last Modified: 2024-04-05 12:07 AM
Thanks Christopherus.
That was an excellent answer!
(CID:130682403)
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-07-04 04:48 PM . Last Modified: 2023-10-22 01:39 AM
This question is closed for comments. You're welcome to start a new topic if you have further comments on this issue.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.