Getting-started-with-Cisco-SD-WAN-REST-APIs icon indicating copy to clipboard operation
Getting-started-with-Cisco-SD-WAN-REST-APIs copied to clipboard

I keep getting the "CISCO SDWAN details must be set via environment variables before running."

Open annegentle opened this issue 4 years ago • 5 comments

I am super new to this. I keep getting the "CISCO SDWAN details must be set via environment variables before running." I know I need to have a file somewhere that has those variables. I have little to no idea where to go. This is a USER PROBLEM. Can you help give me a leg up to use this?

Originally posted by @RyanGuyCode in https://github.com/CiscoDevNet/Getting-started-with-Cisco-SD-WAN-REST-APIs/issues/3#issuecomment-742755400

annegentle avatar Dec 10 '20 22:12 annegentle

@bigevilbeard Do you mind taking a look? I looked into it and see these settings:

export vManage_IP=10.10.20.90
export vManage_PORT=8443
export vManage_USERNAME=admin
export vManage_PASSWORD=C1sco12345

So @ryanguycode, what you want to do in a Linux/Mac in Terminal is use those exact commands before you run any of the examples. These settings will give the script the credentials and settings for the DevNet Sandbox, but only for the one that's a Reservation-based Sandbox, which requires a VPN connection first. Refer to https://developer.cisco.com/docs/sandbox/ to get going, and the specific Sandbox is here: https://devnetsandbox.cisco.com/RM/Diagram/Index/c9679e49-6751-4f43-9bb4-9d7ee162b069?diagramType=Topology.

annegentle avatar Dec 18 '20 23:12 annegentle

I got you. It’s for the reservation system. I should have gotten it.

Warm Regards, Ryan Milton Network Engineer CCNA, CCNP, JNCIA, JNCIS-ENT, JNCIS-SEC On Dec 18, 2020, 5:01 PM -0600, Anne Gentle [email protected], wrote:

@bigevilbeardhttps://github.com/bigevilbeard Do you mind taking a look? I looked into it and see these settings:

export vManage_IP=10.10.20.90 export vManage_PORT=8443 export vManage_USERNAME=admin export vManage_PASSWORD=C1sco12345

So @RyanGuyCodehttps://github.com/RyanGuyCode, what you want to do in a Linux/Mac in Terminal is use those exact commands before you run any of the examples. These settings will give the script the credentials and settings for the DevNet Sandbox, but only for the one that's a Reservation-based Sandbox, which requires a VPN connection first. Refer to https://developer.cisco.com/docs/sandbox/ to get going, and the specific Sandbox is here: https://devnetsandbox.cisco.com/RM/Diagram/Index/c9679e49-6751-4f43-9bb4-9d7ee162b069?diagramType=Topology.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/CiscoDevNet/Getting-started-with-Cisco-SD-WAN-REST-APIs/issues/15#issuecomment-748360847, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFP52S2TRTYA3NB2IBAEWKLSVPNLXANCNFSM4UVVZVXQ.

RyanGuyCode avatar Dec 18 '20 23:12 RyanGuyCode

Not sure anyone even looks at this . . . however . . ..

How do you set the environmental variable on a PC . . .

N/M . . . I just hard set the variables in the code . . .

mupchu avatar Jul 31 '23 21:07 mupchu

I'm on Windows 11 and I searched for Environment Variables in the system settings. Then you can edit them. That lets the value be the same across the system, so it's probably worth while to set it there.

Windows Environment Variables

annegentle avatar Jul 31 '23 22:07 annegentle

You should be able to use the setx command on windows. The command setx is the equivalent of the command export on macOS. Both commands are used to set environmental variables.

The setx command has the following syntax:

setx [variable_name] [value] [/m]
  • variable_name is the name of the environmental variable.
  • value is the value of the environmental variable.
  • /m is an optional parameter that specifies that the environmental variable should be set for all users.

So for this lab example in Windows to set the environmental variables vManage_IP, vManage_PORT, vManage_USERNAME, and vManage_PASSWORD

setx vManage_IP 10.10.20.90
setx vManage_PORT 8443
setx vManage_USERNAME admin
setx vManage_PASSWORD C1sco12345

To see a list of all the environmental variables that are currently set on your PC, you can type the following command in the command prompt:

set

Hope this helps @mupchu :)

bigevilbeard avatar Aug 01 '23 07:08 bigevilbeard