question

sergeyrar avatar image
sergeyrar asked

How to bring a port online via REST API

I'm trying to create some basic automation via REST API,

And want to configure some port properties (IP address etc) to verify ping

When I get port properties via GET, the status of the port is "offline"

{"Active":"true","AppendLocationToPortName":"true","IsFlexEthernetClient":"false","IsFlexEthernetPhy":"false","IsFlexEthernetPort":"false","IsPgaPort":"true","Layer3Type":"IPV4","LicensedPhys":"ETHERNET_COPPER","Location":"//192.168.10.221/1/1","Name":"Port //1/1 (offline)","Online":"false","PortGroupSize":"0","SupportedPhys":"ETHERNET_COPPER","TestModuleProfile":"","UseDefaultHost":"true","children":"host1 systemresourcemanager1 generator1 analyzer1 capture1 arpcache1 arpndreport1 pingreport1 igmpportconfig1 mldportconfig1 oseportconfig1 ovsdbportconfig1 opflexportconfig1 vxlanportconfig1 ieee1588v2portconfig1 qbvstreamconfig1 stpportconfig1 dhcpv4portconfig1 dhcpv6portconfig1 saaportconfig1 roeportconfig1 l2tpportconfig1 pppoxportconfig1 pppprotocolconfig1 ancpportconfig1 cuspportconfig1 eoamportconfig1 appperfportconfig1 vqanalyzer1 enhancedl47portconfig1 autosartimesyncportconfig1 ethernetcopper1","parent":"project1"}

In order for the automation to work, the port has to be online (right?).

When trying to bring the port "online" via PUT request - I get the following message:

curl -X PUT  \
> -H "X-STC-API-Session: Session1 - sergey" \
> -d online=true \
> http://192.168.10.71:8888/stcapi/objects//port1
{"message":"STC exception: in config: couldn't set the read only attribute -online","code":1001,"data":{"function":"config"}}

What am I doing wrong?

Thanks!

rest apiport reservationport
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.