Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

are there any examples for DCO RestFul API usage? Something that contains user authentication and simple inventory search with a keyword

EcoStruxure IT forum

Schneider Electric support forum about installation and configuration for DCIM including EcoStruxure IT Expert, IT Advisor, Data Center Expert, and NetBotz

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • EcoStruxure IT
  • EcoStruxure IT forum
  • are there any examples for DCO RestFul API usage? Something that contains user authentication and simple inventory search wit...
Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
Cory_McDonald
Admiral Cory_McDonald Admiral
124
Jef
Admiral Jef Admiral
108
gsterling
Captain gsterling Captain
71
APC_Steve
Captain APC_Steve Captain
62
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to EcoStruxure IT forum
Solved
DCIM_Support
Picard DCIM_Support
Picard

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

0 Likes
11
1725
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

are there any examples for DCO RestFul API usage? Something that contains user authentication and simple inventory search with a keyword

(CID:122687586)

Labels
  • Labels:
  • Data Center Operation
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
DCIM_Support
Picard DCIM_Support
Picard

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

0 Likes
4
1725
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

Hi Vasileios Baousis

The links that Ed Tarento posted should get you started. Did you see the video on the first page: " Introduction to RESTful API"?

The following:

curl -X GET --header 'Accept: application/json' 'https://:@/api/v8.1/assets/search?q='

Will return information about the asset with the name 'assetname'. 

username and password are the credentials of the user that you want to use for your webservice calls. Server IP is the ip address of your DCO server. Finally assetname is the name of the asset you are looking for.

I added the -k option to allow an insecure connection (assuming that your server got the default self signed certificate)

Hope it helps.

     /Anders

 

(CID:122688107)

See Answer In Context

Reply

Link copied. Please paste this link to share this article on your social media post.

Replies 11
DCIM_Support
Picard DCIM_Support
Picard

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

0 Likes
2
1725
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

Hi Vasileios

Might not be the examples you're looking for but some useful links 

https://dcimsupport.apc.com/display/public/UADCO8x/DCO+web+service+API?queryString=DCO+api&queryStri...
https://dcimsupport.apc.com/DCOAPIdoc/#!/assets/searchAssets
Cheers

(CID:122687708)

Reply

Link copied. Please paste this link to share this article on your social media post.

DCIM_Support
Picard DCIM_Support
Picard

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

In response to DCIM_Support
0 Likes
0
1725
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

Thanks for your answer and the links. I have gone through these and I cannot see any meaningful example.

Let me explain : A very simple API call like 

curl -X GET --header 'Accept: application/json' 'https://DCO.somewhere.com/api/v8.1/assets/search?q=$ASSET_NAME'

it does not work from a system other than the system running DCO server. Does not make any sense to have an API that can be used only from the system running DCO server. 

 

The idea is that you can call the DCO API from any system (providing valid credentials -in my case I am the admin of the DCO) and retrieve some information from DCO.

I would like something like that to work 

curl --insecure  -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{
  "password": "$PASSWORD",
 "user": {
   "username": "$USENAME",
  }
}' '
https://DCO.somewhere.com/api/v8.1/assets/search?q=$ASSET_NAME'


Then I try this command I get 

ErrorUnauthorized

The WSDL for inventory is still working in DCO ?(in https://dcimsupport.apc.com/display/public/DCIMDEVELOPER/StruxureWare+Data+Center+Operation+Web+Serv...) it says that is depricated and is replaced by the Asset Service but these is nothing in this page about the "Asset Service". Any documentation about the new calls would be helpful. 

 

Thanks in advance



 

(CID:122687984)

Reply

Link copied. Please paste this link to share this article on your social media post.

DCIM_Support
Picard DCIM_Support
Picard

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

In response to DCIM_Support
0 Likes
0
1725
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

The query https://DCO.somewhere.com/api/v8.1/assets/search?q=$ASSET_PROPERTY' always returns the first 50 items. Is there any way to increase the number of the return items? 

I have configured 300+ and I cannot get a full list of my Configuration Items (CIs) through the API!!! 

Thanks,

(CID:122692257)

Reply

Link copied. Please paste this link to share this article on your social media post.

DCIM_Support
Picard DCIM_Support
Picard

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

0 Likes
4
1726
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

Hi Vasileios Baousis

The links that Ed Tarento posted should get you started. Did you see the video on the first page: " Introduction to RESTful API"?

The following:

curl -X GET --header 'Accept: application/json' 'https://:@/api/v8.1/assets/search?q='

Will return information about the asset with the name 'assetname'. 

username and password are the credentials of the user that you want to use for your webservice calls. Server IP is the ip address of your DCO server. Finally assetname is the name of the asset you are looking for.

I added the -k option to allow an insecure connection (assuming that your server got the default self signed certificate)

Hope it helps.

     /Anders

 

(CID:122688107)

Reply

Link copied. Please paste this link to share this article on your social media post.

DCIM_Support
Picard DCIM_Support
Picard

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

In response to DCIM_Support
0 Likes
0
1725
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

I have tried all these options.... The only problem was that if the password contains some special characters (most security policies dictate to include special characters) the password has to be converted to a valid ASCII format.Therefore, I used something like https://www.w3schools.com/tags/ref_urlencode.asp 

and the curl commands works without a problem.

Thanks,

Vasilis 

(CID:122688245)

Reply

Link copied. Please paste this link to share this article on your social media post.

DCIM_Support
Picard DCIM_Support
Picard

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

In response to DCIM_Support
0 Likes
0
1725
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

Cool - now you can move on to building some good tools and utilities using the webservices !

/Anders

(CID:122688636)

Reply

Link copied. Please paste this link to share this article on your social media post.

DCIM_Support
Picard DCIM_Support
Picard

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

In response to DCIM_Support
0 Likes
0
1725
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-07-03 05:43 PM . Last Modified: ‎2024-04-08 12:06 AM

Hello again,

 

The query https://DCO.somewhere.com/api/v8.1/assets/search?q=$ASSET_PROPERTY' always returns the first 50 items. Is there any way to increase the number of the return items? 

I have configured 300+ and I cannot get a full list of my Configuration Items (CIs) through the API!!! 

Thanks,

(CID:122691218)

Reply

Link copied. Please paste this link to share this article on your social media post.

DCIM_Support
Picard DCIM_Support
Picard

Posted: ‎2020-07-03 05:44 PM . Last Modified: ‎2024-04-08 12:06 AM

In response to DCIM_Support
0 Likes
0
1725
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-07-03 05:44 PM . Last Modified: ‎2024-04-08 12:06 AM

For performance reasons the "GET /assets/search" API will not return more than 50 assets.

To get all assets you will have to do multiple requests. You can go through all assets by starting with the "GET /assets" request.

From the ids you get from that request you can then use the "GET /assets/{asset-id}" request with the include option children to get all the contained assets together with the ids of their children. With the ids of the children you can then again use the "GET /assets/{asset-id}" request to get the data about those assets.

(CID:123346463)

Reply

Link copied. Please paste this link to share this article on your social media post.

DCIM_Support
Picard DCIM_Support
Picard

Posted: ‎2020-07-03 05:44 PM . Last Modified: ‎2024-04-08 12:06 AM

0 Likes
1
1725
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-07-03 05:44 PM . Last Modified: ‎2024-04-08 12:06 AM

Don't have any inventory related stuff yet but below is a very rough Python program that reads a list of user accounts from a csv file and adds them as users. It's not complete but you should be able to see how the API call are made (if you know Python)

 

import requests
import logging
import csv

user_url = 'https://192.168.56.195/api/v8.1/users'
groups_url = 'http://192.168.56.195/api/v8.1/user-groups'
login_name = 'apc'
login_password = 'apc123'
import_file='C:\\Users\\mfoley\\PycharmProjects\\UserLoad\\userdata.csv'
logging.basicConfig(level=logging.DEBUG)

def main():
#fetch_groups()
 process_file()

def process_file():
logging.debug('Processing file ' + import_file)
with open(import_file) as csv_file:
reader = csv.DictReader(csv_file)

for row in reader:
logging.debug('Processing row number: %s : %s', reader.line_num, row)
user_name = row['username']
password = row['pw']
create_normal_user(user_name )

def create_normal_user(user_name):

payload = {'password': 'theB3st', 'user':{'username': user_name, 'email': 'wally'}}

r = requests.post(user_url, json=payload, auth=(login_name , login_password),verify=False )

if r.status_code != 204 :
logging.error('Failed to add:' + user_name + "Message:" + r.content)

print(r)

def create_ad_user(user_name😞
print('to do')

def fetch_groups():
r = requests.get(groups_url, auth=(login_name , login_password), verify=False)
data = r.json()
print(data)

def fetch_users():
r = requests.get(user_url, auth=(login_name , password),verify=False)
data = r.json()
print(data)


if __name__ == '__main__':
main()

(CID:122688426)

Reply

Link copied. Please paste this link to share this article on your social media post.

DCIM_Support
Picard DCIM_Support
Picard

Posted: ‎2020-07-03 05:44 PM . Last Modified: ‎2024-04-08 12:06 AM

In response to DCIM_Support
0 Likes
0
1725
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-07-03 05:44 PM . Last Modified: ‎2024-04-08 12:06 AM

The query https://DCO.somewhere.com/api/v8.1/assets/search?q=$ASSET_PROPERTY' always returns the first 50 items. Is there any way to increase the number of the return items? 

I have configured 300+ and I cannot get a full list of my Configuration Items (CIs) through the API!!! 

Thanks,

(CID:122692258)

Reply

Link copied. Please paste this link to share this article on your social media post.

DCIM_Support
Picard DCIM_Support
Picard

Posted: ‎2020-07-03 05:44 PM . Last Modified: ‎2023-10-22 04:25 AM

0 Likes
0
1726
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-07-03 05:44 PM . Last Modified: ‎2023-10-22 04:25 AM

superhero.png

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

Reply

Link copied. Please paste this link to share this article on your social media post.

To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

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.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of