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
84631members
353955posts

Anyway to use rack power distribution unit application apis from an angular front end?

APC UPS Data Center & Enterprise Solutions Forum

Schneider Electric support forum for our Data Center and Business Power UPS, UPS Accessories, Software, Services, and associated commercial products designed to share knowledge, installation, and configuration.

Solved
agalu129_apc
Ensign
Ensign
0 Likes
3
411

Anyway to use rack power distribution unit application apis from an angular front end?

This was originally posted on APC forums on 12/7/2020


Hi there,

I'm working on an application that will be able to control power switches located on the rack power distribution unit application. Is there anyway to whitelist my angular front end application so that i can make post and get requests to the rack power distribution unit application apis? I tried calling the apis but keep getting an "No Access-Control_Allow-Headers" error. I looked further into this and it seems my frontend requires a nmc object key that is used in the endpoint. (e.g http://xxx.xx.xxx.xx/NMC/kQtlr8AEz8bRMchJ73RGiA/home.htm . But I'm not sure on how to retrieve this key as I assume this key is retrieved when logging into the application. I also tried calling the login apis first but still get Access-Control-Allow-Headers errors. Any help would be great.

 


Accepted Solutions
BillP
Administrator Administrator
Administrator
0 Likes
0
411

Re: Anyway to use rack power distribution unit application apis from an angular front end?

This reply was originally posted by Gavan on APC forums on 12/11/2020


The easiest way is to log into the PDU via SSH and then issue the ? command, some commands are slightly different for different units and firmwares:

apc>?

System Commands:
---------------------------------------------------------------------------
For command help: command ?

? about alarmcount boot bye cd
clrrst console date delete dir dns
eapol email eventlog exit firewall format
ftp help lang lastrst ledblink logzip
netstat ntp ping portspeed prompt pwd
quit radius reboot resetToDef session smtp
snmp snmptrap snmpv3 system tcpip tcpip6
user userdflt web whoami xferINI xferStatus

Device Commands:
---------------------------------------------------------------------------
alarmList bkLowLoad bkNearOver bkOverLoad bkReading bkPeakCurr
bkRestrictn devLowLoad devNearOver devOverLoad devReading devPeakLoad
devStartDly dispID humAlGen humLow humMin humHyst
humReading humStatus lcd lcdBlink logToFlash olAssignUsr
olCancelCmd olDlyOff olDlyOn olDlyReboot olGroups olName
olOff olOffDelay olOn olOnDelay olRbootTime olReboot
olStatus olUnasgnUsr phLowLoad phNearOver phOverLoad phReading
phPeakCurr phRestrictn prodInfo sensorName tempAlGen tempHigh
tempMax tempHyst tempPeak tempReading tempStatus userAdd
userDelete userList userPasswd

apc>olOff ?
Usage: olOff -- Turn an outlet or group of outlets off.
The id# may be from 1 up to 32 depending on NPS group size.
olOff [:]

 

-Gavan

See Answer In Context

3 Replies 3
BillP
Administrator Administrator
Administrator
0 Likes
0
411

Re: Anyway to use rack power distribution unit application apis from an angular front end?

This reply was originally posted by Gavan on APC forums on 12/8/2020


I don't think this method is supported but for what your trying to accomplish I'd recommend using either an SSH script that will log-in and run the command to control the outlets or using SNMP to turn the outlets on or off.

-Gavan

agalu129_apc
Ensign
Ensign
0 Likes
0
412

Re: Anyway to use rack power distribution unit application apis from an angular front end?

This was originally posted on APC forums on 12/10/2020


I've opted to use a nodejs server to that communicates with the pdu whenever my web app makes a request. The nodejs server will send ssh commands to the pdu. I was wondering though if there is any documentation on what ssh commands I can use to communicate with the pdu to login, turn on/off switches?

 

Thanks for the help,

Albert

BillP
Administrator Administrator
Administrator
0 Likes
0
412

Re: Anyway to use rack power distribution unit application apis from an angular front end?

This reply was originally posted by Gavan on APC forums on 12/11/2020


The easiest way is to log into the PDU via SSH and then issue the ? command, some commands are slightly different for different units and firmwares:

apc>?

System Commands:
---------------------------------------------------------------------------
For command help: command ?

? about alarmcount boot bye cd
clrrst console date delete dir dns
eapol email eventlog exit firewall format
ftp help lang lastrst ledblink logzip
netstat ntp ping portspeed prompt pwd
quit radius reboot resetToDef session smtp
snmp snmptrap snmpv3 system tcpip tcpip6
user userdflt web whoami xferINI xferStatus

Device Commands:
---------------------------------------------------------------------------
alarmList bkLowLoad bkNearOver bkOverLoad bkReading bkPeakCurr
bkRestrictn devLowLoad devNearOver devOverLoad devReading devPeakLoad
devStartDly dispID humAlGen humLow humMin humHyst
humReading humStatus lcd lcdBlink logToFlash olAssignUsr
olCancelCmd olDlyOff olDlyOn olDlyReboot olGroups olName
olOff olOffDelay olOn olOnDelay olRbootTime olReboot
olStatus olUnasgnUsr phLowLoad phNearOver phOverLoad phReading
phPeakCurr phRestrictn prodInfo sensorName tempAlGen tempHigh
tempMax tempHyst tempPeak tempReading tempStatus userAdd
userDelete userList userPasswd

apc>olOff ?
Usage: olOff -- Turn an outlet or group of outlets off.
The id# may be from 1 up to 32 depending on NPS group size.
olOff [:]

 

-Gavan