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

Dell SmartFabric OS10 User Guide Release 10.5.3

PDF

RESTCONF request of CLI command

OS10 enables you to find equivalent RESTCONF requests of the CLI commands. The cli mode rest-translate command enables the CLI-RESTCONF translation mode in the current session.

when the CLI commands run in the translation mode, the console displays the equivalent RESTCONF requests (CURL commands). You can use the CURL command with minimal modifications to the following:

  • $USER_NAME - username of any CLI user account
  • $PASSWORD - password of the CLI user account
  • $MGMT_IP - management IP address

The CURL commands for the CLI commands are appended to the file.

The show cli mode command displays the file name and path, which stores the translated RESTCONF requests. The file is available only during active CLI session. The show command also displays the current CLI mode (netconf/REST-TRANSLATE). When the session is in the translation mode, the prompt changes to REST-TRANSLATE-<hostname>.

REST-TRANSLATE-OS10# show cli mode
Current CLI session mode : rest-translate
Translated requests are available as supportbundle://restconf_requests_4105.txt
REST-TRANSLATE-OS10#

You can use the standard copy command to download the translated RESTCONF requests from OS10.

copy supportbundle://restconf_requests.txt <remote-file>

Use the CLI batch mode to translate multiple CLI commands to their equivalent RESTCONF requests.

batch <batch options>

The no cli mode command disables the RESTCONF translation mode and changes the CLI session into a normal mode (including the CLI prompt).

PATCH to POST operation

NOTE: If a PATCH request fails with an unknown-resource-instance error message when a PATCH request is made to a non-existing object, perform POST. To configure the PATCH:
  • Change the operation from PATCH to POST .
  • Change the URI as /restconf/data.

The following is an example of a PATCH and POST request:

PATCH request

curl -i -k -H "Accept: application/json" -H "Content-Type: application/json" -u $USER_NAME:$PASSWORD -d '{"dell-diffserv-classifier:classifier-entry":[{"name":"test","mtype":"qos","match":"match-any"}]}' -X PATCH https://$MGMT_IP/restconf/data/dell-diffserv-classifier:classifier-entry=test
Error
{"ietf-restconf:errors":{"error":[{"error-type":"rpc","error-tag":"invalid-value","error-app-tag":"data-invalid","error-path":"/classifier-entry","error-message":"unknown resource instance","error-info":{"bad-value":"/restconf/data/dell-diffserv-classifier:classifier-entry=test","error-number":388}}]}}

POST request

curl -i -k -H "Accept: application/json" -H "Content-Type: application/json" -u $USER_NAME:$PASSWORD -d '{"dell-diffserv-classifier:classifier-entry":[{"name":"test","mtype":"qos","match":"match-any"}]}' -X POST https://$MGMT_IP/restconf/data

PATCH failure case

You can perform a POST request if a PATCH request fails with a require-instance test failed error message when a PATCH request is made to a non-existing object. To configure the PATCH, change the operation from PATCH to POST.

The following is an example of a PATCH and POST request:

PATCH request

curl -i -k -H "Accept: application/json" -H "Content-Type: application/json" -u $USER_NAME:$PASSWORD -d '{"dell-bgp:bgp-router":{"vrf":[{"vrf-name":"default","local-as-number":"200"}]}}' -X PATCH https://$MGMT_IP/restconf/data/dell-bgp:bgp-router
Error
{"ietf-restconf:errors": {"error": [{"error-type":"rpc","error-tag":"data-missing","error-app-tag":"instance-required","error-message":"require-instance test failed","error-info": {"error-number":350}}]}

POST request

curl -i -k -H "Accept: application/json" -H "Content-Type: application/json" -u $USER_NAME:$PASSWORD -d '{"dell-bgp:bgp-router":{"vrf":[{"vrf-name":"default","local-as-number":"200"}]}}' -X POST https://$MGMT_IP/restconf/data/dell-bgp:bgp-router

Configuration notes

The "request-instance test failed" indicates that there is no target resource.

To create the target resource (dell-qos:trust-map-dot1p-to-tc-entry), use the POST request:
curl -i -k -H "Accept: application/json" -H "Content-Type:
application/json" -u $USER_NAME:$PASSWORD -X POST -d '{}' 
https://$MGMT_IP/restconf/data/dell-qos:trust-map-dot1p-to-tc-entry
To check if a target resource is available, use the GET request .
curl -i -k -H "Accept: application/json" -H "Content-Type:
application/json" -u $USER_NAME:$PASSWORD -X GET 
https://$MGMT_IP/restconf/data/dell-qos:trust-map-dot1p-to-tc-entry

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: <>()\