PowerAruba / PowerArubaCX

PowerShell module to manage ArubaCX switches
Apache License 2.0
14 stars 5 forks source link

Write Memory #57

Closed fre4ki closed 2 years ago

fre4ki commented 2 years ago

Hey Alexis,

how can i intiate a "write memory" after i created some stuff?

Thank you!

Andy

alagoutte commented 2 years ago

it is WIP (#44)

but you can use copy the running on the startup

Invoke-ArubaCXRestMethod "/configs/startup-config?from=%2Frest%2Fv10.09%2Fconfigs%2Frunning-config" -method "PUT"
fre4ki commented 2 years ago

Will not work, the message is:

Exception: C:\Users\username\Documents\PowerShell\Modules\PowerArubaCX\0.5.0\Private\RestMethod.ps1:80 Line | 80 | … Throw "Not Connected. Connect to the Switch with Connect- … | ~~~~~~~~~~~~~ | Not Connected. Connect to the Switch with Connect-ArubaCX <<<

But i add a vlan with the command before, which was successful?

I'm, using variables, which i ask the steps before

Add-ArubaCXVlans -id $vlan_id -Name $vlan_name -connection $acx01

I tried this commands (installed switch-version FL.10.07.0061):

Invoke-ArubaCXRestMethod "/configs/startup-config?from=%2Frest%2Fv10.09%2Fconfigs%2Frunning-config" -method "PUT" and Invoke-ArubaCXRestMethod "/configs/startup-config?from=%2Frest%2Fv10.07%2Fconfigs%2Frunning-config" -method "PUT"

fre4ki commented 2 years ago

ok, maybe i forgotten the -connection parameter for the Invoke-ArubaCXRestMethod command (-DefaultConnection:$false)

Now i get:

Exception: C:\Users\username\Documents\PowerShell\Modules\PowerArubaCX\0.5.0\Private\RestMethod.ps1:134 Line | 134 | throw "Unable to use ArubaCX API" | ~~~~~~~~~ | Unable to use ArubaCX API <<<

I tried:

Invoke-ArubaCXRestMethod "/configs/startup-config?from=%2Frest%2Fv10.09%2Fconfigs%2Frunning-config" -method "PUT" -connection $acx01

and

Invoke-ArubaCXRestMethod "/configs/startup-config?from=%2Frest%2Fv10.07%2Fconfigs%2Frunning-config" -method "PUT" -connection $acx01

Is this command supported with Firmware 10.07?

alagoutte commented 2 years ago

What PowerShell release ?

I will check with firmware 10.07...

alagoutte commented 2 years ago

Ok, there is no config with 10.07 but fullconfigs...

can you try

Invoke-ArubaCXRestMethod "fullconfigs/startup-config?from=%2Frest%2Fv10.04%2Ffullconfigs%2Frunning-config" -method "PUT"
fre4ki commented 2 years ago

Great, it works. Thank you!!