-
Description: API for using provisioning templates in UFM (getting, adding, and refreshing templates).
-
Request URL:
/ufmRest/templates -
Main operations:
-
Get all templates
-
Get template
-
Add template
-
Delete template
-
Refresh templates list
-
Get All Templates
-
Description: Retrieves all templates.
-
Request URL:
GET /ufmRest/templates -
Optional request parameters:
"tags"
Comma seperated list of tags.
For example: .../templates?tags="switch,Mellanox""profile"
Profile of the template.
For example: .../templates?profile="ib""system_type"
Type of system.
For example: .../templates?system_type=Mellanox Switch -
Request data: N/A
-
Response:
[{ "matchingValidationTemplate": null, "description": "Shows SNMP settings and status", "filePath": "/opt/ufm/files/templates/pre-defined/Mellanox/Show-SNMP", "validationTemplate": null, "portProvisioning": null, "systemProfile": "", "parsingScript": null, "systemType": "Mellanox Switch", "owner": "*system*", "title": "Show-SNMP", "tags": "switch,Mellanox" }, { "matchingValidationTemplate": null, "description": "Displays health report.", "filePath": "/opt/ufm/files/templates/pre-defined/Mellanox/Show-Health-Report", "validationTemplate": null, "portProvisioning": null, "systemProfile": "", "parsingScript": null, "systemType": "Mellanox Switch", "owner": "*system*", "title": "Show-Health-Report", "tags": "switch,Mellanox" }, . . . -
Status codes:
-
200: Successful operation
-
Get Template
-
Description: Retrieves the content of a specific template.
-
Request URL:
GET /ufmRest/<templates>/<template_name> -
Request data: N/A
-
Response:
{ "matchingValidationTemplate": null, "description": "Shows SNMP settings and status", "filePath": "/opt/ufm/files/templates/pre-defined/Mellanox/Show-SNMP", "validationTemplate": null, "portProvisioning": null, "systemProfile": "", "content": [ "#!desc: Shows SNMP settings and status\n", "#!system_profile:\n", "#!system_type: mlnxos_switch\n", "#!update_conf: false\n", "#!owner: *system*\n", "show snmp\n" ], "parsingScript": null, "systemType": "Mellanox Switch", "owner": "*system*", "title": "Show-SNMP", "tags": "switch,Mellanox" } -
Status codes:
-
200: Successful operation
-
400: Template
<template_name>does not exist
-
Add Template
-
Description: Adds (creates) a user-defined template.
-
Request URL:
POST /ufmRest/<templates> -
Request data:
{ "title": "tenplate_title", "systemType": "Mellanox Switch", "content":["the content of the template"], "description": "template_description" } -
Response: The
Locationheader of the HTTP response contains the URI with the name of the created template, which is used for running the CLI command on the specified switches. -
Status codes:
-
201: Created
-
409: A template named
template_titlealready exists. Select a different name. -
400: Missing attributes:
attr_name
-
Delete Template
-
Description: Removes an existing template.
-
Request URL:
DELETE /ufmRest/<templates>/<template-id> -
Request data: N/A
-
Response: N/A
-
Status codes:
-
204: No content
-
Refresh Templates List
-
Description: Refreshes the templates list after you create a user-defined template.
-
Request URL:
POST /ufmRest/<templates>/refresh -
Request data: N/A
-
Response: N/A
-
Status codes:
-
200: OK
-
All Available Templates for Mellanox Switches
General Templates
|
Available Templates |
Description |
Arguments |
|
|---|---|---|---|
|
Globals |
Locals |
||
|
Disable-SNMP |
Disables SNMP on the switch |
|
|
|
Disable-SNMP-V3 |
Disables SNMP v3 |
user_name - username to use |
|
|
Disable-Telnet |
Disables the telnet service on the switch |
|
|
|
Enable-SNMP |
Enables SNMP and defines 'public' community string |
community_name - community name to enable |
|
|
Enable-SNMP-V3 |
Creates an SNMP v3 user 'admin' with predefined authentication and privacy passwords |
|
|
|
Enable-Telnet |
Enables the telnet service on the switch |
|
|
|
Install-License |
Installs a switch license |
license_key – license key to install |
|
|
Remove-SNMP-Host |
Removes a trap receiver |
IP_address – IP address of SNMP host to remove |
|
|
Reset-Counters |
Clears all the counters |
|
|
|
Set-CLI-Logout |
Sets default CLI log-out interval |
auto_logout_timeout – auto-logout timeout value (in minutes) |
|
|
Set-Email-Notifications |
Sets up an email server and a recipient for email notifications |
|
|
|
Set-Hostname |
Sets hostname of the switch |
|
switch_hostname – hostname to set |
|
Set-NTP-Server |
Sets up an NTP server, sets the time zone, and synchronizes the date |
|
|
|
Set-SNMP-V2c-Traps |
Adds a trap receiver for SNMP v2c traps with the given community |
|
|
|
Set-SNMP-V3-Traps |
Adds a trap receiver for SNMP v3 traps with username and predefined authentication and privacy passwords |
|
|
|
Show-Running-Config |
Shows the running configuration of the switch |
|
|
|
Show-SNMP |
Shows SNMP settings and status |
|
|
|
Show-SNMP-Host |
Shows the list of trap receivers |
|
|
|
Show-SNMP-User |
Shows the list of SNMP users |
|
|
|
Show-Power |
Displays power supplies and power usage |
|
|
|
Show-Fan |
Displays fan status and speed |
|
|
|
Show-Health-Report |
Displays health report |
|
|
|
Show-Voltage |
Displays the voltage level of the power supplies |
|
|
|
Show-Protocols |
Displays all protocols enabled in the system |
|
|
InfiniBand Templates
|
Available Templates |
Description |
|---|---|
|
Disable-SM |
Disables subnet manager |
|
Enable-SM |
Enables subnet manager |
Last updated: