Image Management
The following are the Image Management REST APIs:
Status
The following table details the API Response code, status and, the HTTPS methods.
|
|
|
200 |
OK |
GET |
202 |
Accepted |
POST PUT DELETE |
400 |
Bad Request |
GET POST PUT DELETE |
401 |
Unauthorized |
GET POST PUT DELETE |
403 |
Forbidden |
GET POST PUT DELETE |
404 |
Not Found |
GET POST PUT DELETE |
405 |
Method Not Allowed |
GET POST PUT DELETE |
500 |
Internal Server Error |
GET POST PUT DELETE |
Mandatory Field Class table
filter
|
|
|
|
entity |
String |
Mandatory |
The value must be ethswitch, to get switch details |
filterAttributes |
HashMap<String,String> |
Mandatory |
Name value pair for filtering services. For Image image management key value pair will be "capability" and "ISSU" respectively. |
job
|
|
|
|
saverunningConfig |
boolean |
Optional |
Saves the running configuration to switch, if value is true. |
concurrentExec |
boolean |
Mandatory |
Upgrade occurs concurrently, if the value is true. |
executeImmediately |
boolean |
Mandatory |
Upgrade begins immediately if the value is true. The upgrade process will be scheduled for a later time. |
comments |
String |
Optional |
Any comments for the upgrade task |
jobType |
integer |
Mandatory |
0 for image upgrade, 2 for compatibility check |
id |
integer |
Mandatory |
-1 for new job creation. Job Id of the compatibility job for upgrading image. |
taskList |
List<ImageInstallTask> |
Mandatory |
Information on images for different devices. |
imageInstallTask
|
|
|
|
kickStartImage |
String |
Mandatory |
Kickstart image for compatibility check or upgrade. |
systemImageFile |
String |
Mandatory |
System image for compatibility check or upgrade. |
installLog |
String |
Optional |
Contains install log from the device |
compatibilty_log |
String |
Optional |
Contains compatibility check log from the device |
statusDescr |
String |
Optional |
Description on the status. |
compatibilty_desc |
String |
Optional |
-1 for new job creation. Job Id of the compatibility job for upgrading image. |
strStatus |
String |
Optional |
Status of the image upgrade task. |
strCompStatus |
String |
Optional |
Status of the compatibility check task. |
jobId |
Integer |
Mandatory |
Job Id of the parent Job. -1 initially when the job is not yet created. |
scheduledTime |
Timestamp |
Optional |
Timestamp at which image upgrade needs to be triggered. |
completedTime |
Timestamp |
Optional |
Time at which the compatibility check or image upgrade is completed. |
parallelLineCardUpgrade |
boolean |
Optional |
True when the line cards needs to be upgraded parallel. |
id |
long |
Mandatory |
-1 initially. Task id once the job is created. |
ethswitch_id |
long |
Mandatory |
Ethswitch id for the switch. |
hostName |
String |
Mandatory |
Host name of the device |
ipAddress |
String |
Mandatory |
IP address of the device |
platform |
String |
Mandatory |
Nexus Platform of the device |
version |
String |
Mandatory |
NXOS version of the device |
serverName |
String |
Optional |
Server from where images needs to be installed. |
type |
Enum |
Optional |
Type of the image source. It can be either SERVER or DEVICE. |
status |
Enum |
Optional |
Status of image upgrade |
compatibility_status |
Enum |
Optional |
Status of compatibility check. |
SMUInstallTask
|
|
|
|
packageName |
String |
Mandatory |
Name of the SMU package. Comma seperated in case of multiple packages. |
ipAddress |
String |
Mandatory |
IP Address of the device. |
statusDescr |
String |
Optional |
Description for the status |
type |
Enum |
Optional |
"DEVICE" when the SMU package is on the device. "SERVER" if its on remote server. |
serverName |
String |
Optional |
Name of the server from where the image needs to be installed. |
platform |
String |
Mandatory |
Platform of the device. |
hostName |
String |
Mandatory |
Hostname of the device. |
completedTime |
TimeStamp |
Optional |
Time at which SMU installation completes. |
id |
long |
Mandatory |
-1 while trigerring SMU. |
ethSwitch_id |
long |
Mandatory |
Switch id from db. |
status |
Enum |
Optional |
Status of SMU task |
jobtype |
integer |
Mandatory |
0 for SMU install and 1 for uninstallation. |
SMUInfo
|
|
|
|
switch_id |
long |
Mandatory |
Ethswitch ID of the switch. |
packages |
Set<String> |
Mandatory |
SMU packages installed on the switch |
GIRInfo
|
|
|
|
switch_id |
long |
Mandatory |
Ethswitch ID of the switch. |
bMaintenanceMode |
boolean |
Mandatory |
True if switch is in maintenance mode. |
maintenanceMode |
String |
Mandatory |
Indicates of the switch is in isolate or shut down mode. Other wise NA |
bSuccess |
boolean |
Optional |
True if the system mode change is successful. |
statusDesc |
String |
Mandatory |
Description of the status |
hostName |
String |
Mandatory |
Hostname of the device |
platform |
String |
Mandatory |
Platform of the device |
ipAddress |
String |
Mandatory |
IP address of the device |
GIRInfoList
|
|
|
|
girList |
List<GIRInfo> |
Mandatory |
List of GIRInfo |
Status
The following table details the API Response code, status and, the HTTPS methods.
|
|
|
200 |
OK |
GET |
202 |
Accepted |
POST PUT DELETE |
400 |
Bad Request |
GET POST PUT DELETE |
401 |
Unauthorized |
GET POST PUT DELETE |
403 |
Forbidden |
GET POST PUT DELETE |
404 |
Not Found |
GET POST PUT DELETE |
405 |
Method Not Allowed |
GET POST PUT DELETE |
500 |
Internal Server Error |
GET POST PUT DELETE |
Get valid switches for Image Management
Resource Name
/inventory/switches/
Description
Returns all valid switches that are qualified for image upgrade.
URL
https://dcnm-ip/fm/fmrest/inventory/switches/
Return Value
Format: JSON
Type: List of Object
|
|
|
Response |
O |
Response Object with switch information in string. |
Trigger compatibility check
Resource Name
/imagemanagement/job
Description
Triggers compatibility check on the device and returns the job ID
URL
https://dcnm-ip/fm/fmrest/imagemanagement/job
Parameter
|
|
|
saverunningConfig |
boolean |
Saves the running configuration to switch if value is true. |
concurrentExec |
boolean |
Upgrade will happen concurrently if the value is true. |
executeImmediately |
boolean |
Upgrade will happen immediately if true. Otherwise will be scheduled. |
comments |
string |
Any comments for the upgrade task. |
jobType |
integer |
0 for image upgrade, 2 for compatibility check |
id |
integer |
-1 for new job creation. Job Id of the compatibility job for upgrading image. |
taskList |
List<ImageInstallTask> |
Information on images for different devices. |
Return Value
Format: JSON
Type: Long
|
|
|
|
|
Job ID of the new compatibility task |
Get compatibility check/image upgrade status
Resource Name
/imagemanagement/job/{Job-id}
Description
Gets the compatibility check status
URL
https://dcnm-ip/fm/fmrest/imagemanagement/job/{job-id}
Return Value
Format: JSON
Type: ImageInstallTaskList
|
|
|
Response |
O |
Response Object with Job status as List of ImageInstallTask. |
Trigger Image upgrade check
Resource Name
/imagemanagement/job
Description
Triggers compatibility check on the device and returns the job ID
URL
https://dcnm-ip/fm/fmrest/imagemanagement/job
Return Value
Format: JSON
Type: Long
|
|
|
Response |
O |
Response Object with Job Id information as long. |
Get all upgrade and compatibility check jobs
Resource Name
/imagemanagement/jobs
Description
Gets the compatibility check status
URL
https://dcnm-ip/fm/fmrest/imagemanagement/jobs
Return Value
Format: JSON
Type: List of Job
|
|
|
Response |
O |
Response Object with list of Job object. |
Resource Name
/smu/activate
Description
Installs patch
URL
https://dcnm-ip/fm/fmrest/smu/activate
Parameter
|
|
|
SMUInstallJob |
O |
List of SMUInstallTask |
Return Value
Format: JSON
Type: smuTask
|
|
|
Response |
O |
Response Object with list of SMUInstallTask |
Resource Name
/smu/deactivate
Description
Installs patch
URL
https://dcnm-ip/fm/fmrest/smu/deactivate
Parameter
|
|
|
SMUInstallJob |
O |
List of SMUInstallTask |
Return Value
Format: JSON
Type: smuTask
|
|
|
Response |
O |
Response Object with list of SMUInstallTask |
Get all active SMU packages for a switches
Resource Name
/smu/getactive
Description
Gets the active SMU packages for a switch
URL
https://dcnm-ip/fm/fmrest/imagemanagement/jobs
Parameter
|
|
|
EthSwitchList |
O |
List of all Ethernet Switch IDs |
Return Value
Format: JSON
Type: List of SMUInfo
|
|
|
Response |
O |
Response Object with list of SMUInfo |
Get GIR status for all the switches
Resource Name
/imagemanagement/allsystemmode
Description
Gets the maintenance status for all the switches
URL
https://dcnm-ip/fm/fmrest/imagemanagement/allsystemmode
Return Value
Format: JSON
Type: List of GIRInfo
|
|
|
Response |
O |
Response Object with list of GIRInfo |
Toggle GIR status for all the switches
Resource Name
/imagemanagement/toggle
Description
Gets the maintenance status for all the switches
URL
https://dcnm-ip/fm/fmrest/imagemanagement/allsystemmode
Parameter
|
|
|
GIRInfoList |
O |
List of GIRInfo |
Return Value
Format: JSON
Type: List of GIRInfo
|
|
|
Response |
O |
Response Object with list of GIRInfo |
Resource Name
/imagemanagement/job
Description
Triggers image upgrade on the device and returns the Job ID.
URL
https://dcnm-ip/fm/fmrest/imagemanagement/job
Return Value
Format: JSON
Type: List of GIRInfo
|
|
|
Response |
O |
Response Object with Job Id information as long. |
Resource Name
/repomanagement/fetchfirstlevelfiles
Description
Gets the contents of the bootflash directory.
URL
https://dcnm-ip/fm/fmrest/repomanagement/fetchfirstlevelfiles?type=DEVICE&include=true&ip=<Device-Ip>&id=<Folder-Name>&path=<Parent_Directory_Path>
Return Value
Format: JSON
Type: List of GIRInfo
|
|
|
Response |
O |
Response Object with FolderContent embedded as entity. |
Get available and total space
Resource Name
/repomanagement/fetchdirsize
Description
Gets the available and total space for bootflash directory.
URL
https://dcnm-ip/fm/fmrest/repomanagement/fetchdirsize?type=DEVICE&include=true&ip=<Device-Ip>&id=bootflash:&path=%2FFLASH%2F&start=0
Return Value
Format: JSON
Type: List of GIRInfo
|
|
|
Response |
O |
Response Object with list of RepositoryFile embedded as entity. |
Delete files from the Bootflash
Resource Name
/repomanagement/file
Description
Delete files from bootflash directory.
URL
https://dcnm-ip/fm/fmrest/repomanagement/file?path=<File_To_Be_Deleted>&ip=<DEVICE_IP>&userId=<DCNM_USER>&type=DEVICE
Return Value
Format: JSON
Type: List of GIRInfo
|
|
|
Response |
O |
Response Object with integer value embedded as entity. |
Get server contents in case of SFTP and SCP
Resource Name
/repomanagement/fetchfirstlevelfiles
Description
Gets the contents of the SFTP and SCP directory.
URL
https://dcnm-ip/fm/fmrest/repomanagement/fetchfirstlevelfiles?type=SERVER&include=true&serverName=<Repository_Name>&id=<Folder-Name>&path=<Parent_Directory_Path>
Parameter
|
|
|
GIRInfoList |
O |
List of GIRInfo |
Return Value
Format: JSON
Type: List of GIRInfo
|
|
|
Response |
O |
Response Object with list of GIRInfo |