image image image image image

YOU ARE VIEWING AN OUTDATED DOCUMENT.

On This Page

  • 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
    • Remove template
    • Refresh templates list

Get All Templates

  • Description – this interface is used to retrieve 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 – this interface is used to retrieve 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 – this interface is used to add/create a new 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 – HTTP Response Location Header will contain URI with template name created for running the CLI command on the specified switches

  • Status Codes
    • 201 – created

    • 409 – template with a name 'template_title' already exists. Please select a different name.

    • 400 – missing attribute(s) : attr_name

Delete Template

  • Description – this API is used to remove 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 – this interface is used to refresh the templates list, after a new user-defined template was created
  • 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 TemplatesDescriptionArguments
GlobalsLocals

Disable-SNMP

Disables SNMP on the switch



Disable-SNMP-V3Disables SNMP v3

user_name - username to use


Disable-TelnetDisables the telnet service on the switch

Enable-SNMPEnables SNMP and defines 'public' community stringcommunity_name - community name to enable

Enable-SNMP-V3

Creates an SNMP v3 user 'admin' with predefined authentication and privacy passwords
  • user_name – username to use
  • authentication_password – authentication password
  • user_name – username to use

Enable-Telnet

Enables the telnet service on the switch

Install-License

Installing Switch licenselicense_key – license key to install

Remove-SNMP-Host

Removes a trap-receiverIP_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

  • email_address – recipient e-mail address
  • IP_address – IP address of mail server

Set-HostnameSets 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

  • NTP_server_IP – NTP server address
  • time_zone – timezone name

Set-SNMP-V2c-Traps

Adds a trap-receiver for SNMP v2c traps with given community

  • community_name – community name to use
  • IP_address – address of trap receiver

Set-SNMP-V3-Traps

Adds a trap-receiver for SNMP v3 traps with username and predefined authentication and privacy passwords

  • private_password – privacy password to use
  • user_name – username to use
  • authentication_password – authentication password to use
  • IP_address – address of traps receiver

Show-Running-ConfigShows the running configuration of the switch

Show-SNMPShows SNMP settings and status

Show-SNMP-HostShows list of trap-receivers

Show-SNMP-UserShows the list of SNMP users

Show-PowerDisplays power supplies and power usage

Show-FanDisplays fans status and speed

Show-Health-ReportDisplays health report

Show-VoltageDisplays power supplies voltage level

Show-Protocols

Displays all protocols enabled in the system



InfiniBand Templates

Available TemplatesDescription
Disable-SMDisables subnet manager
Enable-SMEnables subnet manager