Skip to main content
  • Place orders quickly and easily
  • View orders and track your shipping status
  • Create and access a list of your products
  • Manage your Dell EMC sites, products, and product-level contacts using Company Administration.

Dell EMC SmartFabric OS10 User Guide Release 10.5.1

PDF

Translated RESTCONF requests example

Config command

 OS10# cli mode rest-translate
Commands executed in this mode will not alter current system state.
Do you want to proceed? [confirm yes/no]:yes
REST-TRANSLATE-OS10# configure terminal

CLI command:

configure terminal

Restconf request(s):

curl -i -k -H "Accept: application/json" -u $USER_NAME:$PASSWORD -X GET https://$MGMT_IP/restconf/data/dell-mgmt-cm:cms

REST-TRANSLATE-OS10(config)# interface ethernet 1/1/1

CLI command:

interface ethernet 1/1/1

Restconf request(s):

curl -i -k -H "Accept: application/json" -H "Content-Type: application/json" -u $USER_NAME:$PASSWORD -d '{"ietf-interfaces:interfaces":{"interface":[{"name":"ethernet1/1/1","type":"iana-if-type:ethernetCsmacd"}]}}' -X PATCH https://$MGMT_IP/restconf/data/ietf-interfaces:interfaces

REST-TRANSLATE-OS10(conf-if-eth1/1/1)# description "ethernet 1/1/1"

CLI command:

description "ethernet 1/1/1"

Restconf request(s):

curl -i -k -H "Accept: application/json" -H "Content-Type: application/json" -u $USER_NAME:$PASSWORD -d '{"ietf-interfaces:interfaces":{"interface":[{"name":"ethernet1/1/1","description":"ethernet 1/1/1"}]}}' -X PATCH https://$MGMT_IP/restconf/data/ietf-interfaces:interfaces

REST-TRANSLATE-OS10(conf-if-eth1/1/1)# no description

CLI command:

no description

Restconf request(s):

curl -i -k -H "Accept: application/json" -H "Content-Type: application/json" -u $USER_NAME:$PASSWORD -X DELETE https://$MGMT_IP/restconf/data/ietf-interfaces:interfaces/interface=ethernet1%2F1%2F1/description

curl -i -k -H "Accept: application/json" -H "Content-Type: application/json" -u $USER_NAME:$PASSWORD -d '{"ietf-interfaces:interfaces":{"interface":[{"name":"ethernet1/1/1"}]}}' -X PATCH https://$MGMT_IP/restconf/data/ietf-interfaces:interfaces

REST-TRANSLATE-OS10(conf-if-eth1/1/1)# exit

Show command

REST-TRANSLATE-OS10# show version

CLI command:

show version

Restconf request(s):

curl -i -k -H "Accept: application/json" -u $USER_NAME:$PASSWORD -X GET https://$MGMT_IP/restconf/data/dell-system-software:system-sw-state/sw-version

curl -i -k -H "Accept: application/json" -u $USER_NAME:$PASSWORD -X GET https://$MGMT_IP/restconf/data/dell-system:system-state/system-status
Action/RPC based command
 OS10# cli mode rest-translate
Commands executed in this mode will not alter current system state.
Do you want to proceed? [confirm yes/no]:yes
REST-TRANSLATE-OS10# configure terminal

CLI command:

ztd cancel

Restconf request(s):

curl -i -k -H "Accept: application/json" -H "Content-Type: application/json" -u $USER_NAME:$PASSWORD -d '{"input":{"action":"cancel"}}' -X POST https://$MGMT_IP/restconf/operations/dell-ztd:ztd-action

REST-TRANSLATE-OS10#

CLI commands generate Multiple RESTCONF requests:

  • If the command updates multiple objects (within same module or across modules), the command translates into multiple RESTCONF requests. It is because the target resource in the URI can only be a single object.
  • If the command performs multiple operations in a single request (merge and delete on leafs), the CLI first generates a DELETE request and then PATCH with the remaining objects.

Certain CLI commands require user confirmation (yes or no). Enter Yes to view the RESTCONF translation for the commands.

Some CLI commands generate multiple RESTCONF requests. Use certain requests according to the Notes information displayed along with the translation. For example, reload command generates request for both save running to start up config and reload operation. The Notes information provides meaningful messages to the user to use the translated RESTCONF messages.

 OS10# cli mode rest-translate
Commands executed in this mode will not alter current system state.
Do you want to proceed? [confirm yes/no]:no
OS10# reload

CLI command:

reload

Restconf request(s):

curl -i -k -H"Accept: application/json"-H"Content-Type: application/json"-u $USER_NAME:$PASSWORD -d'{"dell-ztd:input":{"action":"disable"}}'-X POST https://$MGMT_IP/restconf/operations/dell-ztd:ztd-action

curl -i -k -H"Accept: application/json"-H"Content-Type: application/json"-u $USER_NAME:$PASSWORD -d'{"input":{"target":"startup", "source":"running"}}'-X POST https://$MGMT_IP/restconf/operations/copy-config

curl -i -k -H"Accept: application/json"-H"Content-Type: application/json"-u $USER_NAME:$PASSWORD -d'{"dell-node-management:input":{"reboot":"cold","reboot-reason":"CLI reload"}}'-X POST https://$MGMT_IP/restconf/operations/dell-node-management:reload-system
NOTE: Before triggering reload, disable ZTD and save running to start up.

The following is another example with Notes information for the requests. The last RESTCONF request is applicable on certain available conditions.

 OS10# cli mode rest-translate
Commands executed in this mode will not alter current system state.
Do you want to proceed? [confirm yes/no]:yes
REST-TRANSLATE-OS10# configure terminal

CLI command:

configure terminal

Restconf request(s):

curl -i -k -H "Accept: application/json" -u $USER_NAME:$PASSWORD -X GET https://$MGMT_IP/restconf/data/dell-mgmt-cm:cms

REST-TRANSLATE-OS10(config)# interface ethernet 1/1/1

CLI command:

interface ethernet 1/1/1

Restconf request(s):

curl -i -k -H "Accept: application/json" -H "Content-Type: application/json" -u $USER_NAME:$PASSWORD -d '{"ietf-interfaces:interfaces":{"interface":[{"name":"ethernet1/1/1","type":"iana-if-type:ethernetCsmacd"}]}}' -X PATCH https://$MGMT_IP/restconf/data/ietf-interfaces:interfaces

REST-TRANSLATE-OS10(conf-if)# no ip ospf 1 area 100"

CLI command:

no ip ospf 1 area 100

Restconf request(s):

curl -i -k -H"Accept: application/json"-H"Content-Type: application/json"-u $USER_NAME:$PASSWORD -X DELETE https://$MGMT_IP/restconf/data/ietf-interfaces:interfaces/interface/dell-ospf-v2:ospf-info/dell-ospf-v2:proc-id

curl -i -k -H"Accept: application/json"-H"Content-Type: application/json"-u $USER_NAME:$PASSWORD -X DELETE https://$MGMT_IP/restconf/data/ietf-interfaces:interfaces/interface/dell-ospf-v2:ospf-info/dell-ospf-v2:area-id

curl -i -k -H"Accept: application/json"-H"Content-Type: application/json"-u $USER_NAME:$PASSWORD -X DELETE https://$MGMT_IP/restconf/data/ietf-interfaces:interfaces/interface/dell-ospf-v2:ospf-info
NOTE: Container removal is valid only when it is empty.

Rate this content

Accurate
Useful
Easy to understand
Was this article helpful?
0/3000 characters
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please provide ratings (1-5 stars).
  Please select whether the article was helpful or not.
  Comments cannot contain these special characters: <>()\