Hi All,
I'm trying to use 'mgmt_cli' to add multiple hosts to our management server (81.10). I'm following the format in the 'Management API Reference'. I've created a .csv file and tried to import using --batch:
[Expert@mgmt:0]# mgmt_cli add host --batch cli_mgmt_test.csv:
At first this failed with the following error
---------------------------------------------START
Time: [22:34:12] 1/4/2023
---------------------------------------------
"Publish operation" failed (100%)
Publish failed, the following error has occurred:
tasks:
- task-id: "01234567-89ab-cdef-bfad-4320b3d28dca"
task-name: "Publish operation"
status: "failed"
progress-percentage: 100
suppressed: false
task-details:
- fault-message: "Publish cannot be performed without entering a session name and description."
--------------------------------------------------END
So I altered the command to include the session description:
[Expert@mgmt:0]# mgmt_cli set session description "API Session test" add host --batch cli_mgmt_test.csv
This time it failed with the following error:
--------------------------------------------------START
Line 2: code: "generic_err_invalid_parameter_name"
message: "Unrecognized parameter [ip-address]"
Line 3: code: "generic_err_invalid_parameter_name"
message: "Unrecognized parameter [ip-address]"
Line 4: code: "generic_err_invalid_parameter_name"
message: "Unrecognized parameter [ip-address]"
Line 5: code: "generic_err_invalid_parameter_name"
message: "Unrecognized parameter [ip-address]"
Executed command failed. Changes are discarded.
--------------------------------------------------END
My .csv look like this:
[Expert@mgmt:0]# cat cli_mgmt_test.csv
name,ip-address,color,comments
net-test.svr.1,169.254.0.1,red,this is a test -- delete once complete
net-test.svr.2,169.254.0.2,red,this is a test -- delete once complete
net-test.svr.3,169.254.0.3,red,this is a test -- delete once complete
net-test.svr.4,169.254.0.4,red,this is a test -- delete once complete
Any ideas why its not liking the ip-address? I've also tried using 'ipv4-address' with same failure. I'm able to create the hosts directly on Smartconsole but want to know how to create hosts via a batch script.
Thanks in advance.