Cisco Cloud Services Platform REST API Guide

Transcription

Cisco Cloud Services Platform REST APIGuideFirst Published: 2018-10-15Last Updated: 2020-12-21Cisco Systems, Inc.1www.cisco.com

Cisco Cloud Services Platform REST API GuideInformation About the Cisco CSP REST APIContentsContents . 2Information About the Cisco CSP REST API . 8Supported Response Formats . 8Supported Response Formats in Release 2.1.0 and Later Releases. 8Supported Response Formats in Release 1.0 and 2.0.0 . 8List of Available Modules . 9REST APIs . 10Authentication, Authorization, and Accounting (AAA) APIs . 10Get Information About AAA Authentication Server Configuration and Caching Timeout . 10Specify the AAA Authentication Server . 11Specify the Timeout for AAA Authentication Response . 11Banner APIs . 12Configure the Pre-Login Banner . 12Delete the Pre-Login Banner . 13Configure the MOTD Banner . 14Delete the MOTD Banner. 15Configuration File APIs. 15Save a Running Configuration . 15Load a Saved Configuration . 16Cluster APIs . 17Get Information About Clusters . 17Create a Cluster . 18Add Members to a Cluster . 19Replace Cluster Members . 20Delete a Member from a Cluster . 22Delete a Cluster . 23Enable Node Failure detection and VNF Service migration . 24Update Node Eviction Parameters . 25Enable Storage Network . 26Enable Configuration Sync for Cluster . 27Update Configuration Sync . 28Collected Package API . 29Factory Default Reset API . 302

Cisco Cloud Services Platform REST API GuideInformation About the Cisco CSP REST APIInstallation and Upgrade APIs . 31Patch Upgrade APIs. 34Patch Upgrade Cisco CSP 2100 Release Notes. 34Patch Upgrade Cisco CSP 2100 software. 35Check Status of Patch Upgrade . 36NTP Server APIs . 36Get Information About NTP Servers . 36Get Information About NTP Server Status. 37Add an NTP Server. 38Delete an NTP Server . 38Port Isolation APIs. 39Get Status Information About Port Isolation of VNF. 39Enable or Disable Port Isolation of VNF. 39OVS DPDK APIs . 40Get Status Information About OVS DPDK . 40Enable or Disable OVS with DPDK. 41pNIC APIs . 41Get Information About pNICs . 41Get Statistics for pNICs . 43Modify a pNIC. 44Get Information about LLDP Configuration . 47Enable or Disable LLDP. 48Create a Port Channel . 49Assign a pNIC to a Port Channel. 50Configure Link State Tracking of Individual pNIC . 51Delete a Port Channel . 51Get Description About an Individual pNIC . 52Configure Description of an Individual pNIC . 53Modify the Description of an Individual pNIC . 53Delete the Description of an Individual pNIC . 54Get Information About LLDP Neighbors . 55Configure Card Mode of an Individual pNIC . 57RADIUS APIs . 58Get Information About the RADIUS Servers. 583

Cisco Cloud Services Platform REST API GuideInformation About the Cisco CSP REST APIAdd a RADIUS Server . 59Configure Timeout Duration . 60Configure Retransmit Count . 61Delete a RADIUS Server . 61Repository APIs . 62Get Information About All Files . 62Get Information About a File . 63Get Information About a Remote File . 63Copy Files to Cisco CSP 2100 . 64Create New Text File . 65Copy Files from Cisco CSP 2100 (Release 2.2.3 and Later Releases) . 66Copy Files from Cisco CSP 2100 (Release 2.2.2) . 67Delete an Image File . 69Rename an Image File . 69Resource APIs . 70Get Information About a Resource . 70Modify a Resource. 71Delete a Configured Resource Feature . 75Configure ACL Access for the Management Interface . 76Configure break . 78Add an NFS Storage Space . 79Delete an NFS Storage Space . 80Get Information About the CSP 2100 Version . 81Get Description About the CSP 2100 Resource . 81Configure Description of the CSP 2100 Resource . 82Modify the Description of the CSP 2100 Resource . 82Delete the Description of the CSP 2100 Resource . 83Services APIs . 83Get Information About Services . 83Create or Import a Service . 85Retain UUID of a Service . 93Get Description About a Service . 94Modify the Description of a Service. 94Delete the Description of a Service . 954

Cisco Cloud Services Platform REST API GuideInformation About the Cisco CSP REST APIModify the Emulator-Pin of a Service . 95Get Mapping Information Between Physical CPUs and Virtual CPUs. 96Export a Service. 97Cancel Exporting a Service . 98Assign vNICs to a Service . 98SPAN and TCPDump vNICs . 101Get Information About vNIC, VF MAC Addresses, and SRIOV Interfaces . 102Assign Serial Port to a Service . 105Add VM Monitoring to a Service . 106Get VM Monitoring Information About a Service . 107Create VNF User Groups . 108Delete VNF User Group from Service . 108Modify VNF User Group of Service . 109Add Storage Disks to a Service . 109Delete Storage Disks . 111Saving .img File of Services . 112Delete Services . 112Session APIs . 113Get Information About Configured Session Idle Timeout . 113Configure Session Idle Timeout . 113SNMP APIs . 114Get Information About SNMP Agents . 114Configure Engine ID of an SNMP Agent . 115Get Information About SNMP Communities . 115Create or Modify an SNMP Community . 116Delete an SNMP Community . 117Get Information About SNMP Groups . 117Create or Modify an SNMP Group. 118Delete SNMP Groups . 120Get Information About SNMP Users . 120Create or Modify an SNMP User . 121Delete an SNMP User. 122Get Information About SNMP Hosts . 123Create or Modify an SNMP Host . 1245

Cisco Cloud Services Platform REST API GuideInformation About the Cisco CSP REST APIDelete SNMP Hosts . 125Configure an SNMP Trap . 125Get Information About SNMP Server Agents . 126Get Information About SNMP Server View . 127Create or Modify an SNMP Server View . 128Get Information About SNMP Server Community . 128Configuring an SNMP Server Community . 129Get Information About SNMP Server Group . 130Specifying an SNMP Server Group Name . 130Get Information About SNMP Server User . 132Configuring an SNMP Server User . 132Get Information About SNMP Server Host . 134Configuring an SNMP Server Host . 135Get Information About SNMP Server Contact. 136Configuring SNMP Server Contact Information . 137Get Information About SNMP Server Location . 137Configuring SNMP Server Location Information . 138Get Information About SNMP Server EngineID . 138Configuring SNMP Server EngineID Information . 139Get Information About SNMP Server enable. 139Configure SNMP Server Enable. 140Delete SNMP Traps . 140Get Information About SNMP Traps . 141System APIs . 142Get CPU Pinning Status . 142Enable or Disable CPU Pinning . 142Get Information About Disk I/O Statistics . 143TACACS APIs . 145Get Information About TACACS Servers . 145Add or Modify a TACACS Server . 146Delete a TACACS Server. 147Time Zone APIs. 148Get Information About the Time Zone . 148Configure the Time Zone for Cisco CSP 2100. 1496

Cisco Cloud Services Platform REST API GuideInformation About the Cisco CSP REST APIChange the Time Zone for Cisco CSP 2100. 149Delete the Configured Time Zone . 150Technical Support Information API . 151Generate Technical Support Information . 151User APIs . 151Get Information About the Cisco CSP 2100 Users . 151API History . 153Create a New User . 153Change a User’s Password . 154Release 2.2.2 and Later Releases. 154Release 2.1.0 . 154Change a User’s Group. 155Delete a User . 156Get Status Information about Password Expiry . 156Enable or Disable Password Expiry on CSP . 157Enable or Disable TPM based Disk Encryption . 157vNICs APIs . 158Get Statistics for vNICs . 158Get Bandwidth for vNICs . 160Configure vNIC Bandwidth. 161Get Adminstatus of vNICs . 161Configure vNIC Adminstatus . 162Start, Stop, Show Counters APIs . 163Obtaining Documentation and Submitting a Service Request . 1667

Cisco Cloud Services Platform REST API GuideInformation About the Cisco CSP REST APIInformation About the Cisco CSP REST APIYou can perform operations on the Cisco Cloud Services Platform (Cisco CSP) objects using the Representational StateTransfer (REST) API. The Cisco CSP 2100 REST APIs support create, retrieve, update, and delete (CRUD) operations. Tocall any REST function, you can use tools such as a web browser, the cURL tool, or Windows PowerShell. If you areusing a web browser, type the URL. If you are using cURL or Windows PowerShell, use the following format:curlu username:password -X method https://ip-address:port number/api/module locatorNote: Starting with Release 2.1.0, Cisco CSP 2100 supports only port 443. Therefore, you do not need to specify theport number (port number).The module locator consists of two parts: a namespace and a module name.module locator : namespace/module nameThe namespace indicates the broader class of functions and the module name refers to the specific object. For example:curlu admin:admin -X GET https://10.10.10.2:443/api/running/clustersIn this example, running is the namespace and clusters is the module name.Supported Response FormatsSupported Response Formats in Release 2.1.0 and Later ReleasesStarting with Release 2.1.0, Cisco CSP 2100 supports only JSON format on port 443 for REST API response. You do notneed to specify the port number in the REST API.curl -u admin:admin -X GET https://10.10.10.2/api/running/pnics{"pnic:pnics": {"pnic": [{"name": "Eth4-0"}, {"name": "Eth4-1"}, {"name": "Eth4-2"}, {"name": "Eth4-3"},{"name": "Eth7-0"}, {"name": "Eth7-1"}]}}Supported Response Formats in Release 1.0 and 2.0.0Cisco CSP 2100 release 2.0.0 and 1.0 support the JSON and XML formats for REST API response. With port 443, JSONresponse format is supported. With port 8888, XML response format is supported. You need to specify the port numberin the REST API.JSON Response Format Examplecurl -u admin:admin -X GET https://10.10.10.2:443/api/running/pnics{"pnics": {"pnic": [{"name": "Eth4-0"}, {"name": "Eth4-1"}, {"name": "Eth4-2"}, {"name": "Eth4-3"},{"name": "Eth7-0"}, {"name": "Eth7-1"}]}}XML Response Format Examplecurl -u admin:admin -X GET https://10.10.10.2:8888/api/running/pnics pnics xmlns "http://www.cisco.com/ns/test/pnic" xmlns:y "http://tail-f.com/ns/rst" xmlns:pnic "http://www.cisco.com/ns/test/pnic" pnic name Eth4-0 /name /pnic pnic name Eth4-1 /name /pnic 8

Cisco Cloud Services Platform REST API GuideList of Available Modules pnic name Eth4-2 /name /pnic pnic name Eth4-3 /name /pnic pnic name Eth7-0 /name /pnic pnic name Eth7-1 /name /pnic /pnics List of Available ModulesTable 1. Available ModulesModuleDescription/api/running/security serversModule for specifying the server for AAA authentication, configuring aRADIUS or TACACS server./api/running/bannerModule for configuring a pre-login or MOTD banner./api/running/save-loadModule for saving a configuration to a file or loading a configuration froma file./api/running/clustersModule for creating, deleting, and modifying clusters and for retrievinginformation about clusters./api/running/systemModule for specifying the ISO installation mode./api/running/package-installModule for upgrading the Cisco CSP 2100 software and checking theupgrade status./api/running/ntpsModule for creating and deleting an NTP server and for retrievinginformation about an NTP server./api/operational/ntp statusModule for retrieving information about the NTP server status./api/running/pnicsModule for retrieving information about pNICs and modifying pNICs./api/operational/pnicsModule for retrieving statistics about pNICs./api/operational/lldpModule for retrieving LLDP neighbor information./api/operational/repositoryModule for retrieving information about repository files./api/running/resourcesModule for retrieving information about resources./api/running/running/clockModule for configuring and changing the time zone, and deleting theconfigured time zone./api/running/supportModule for creating technical support information.9

Cisco Cloud Services Platform REST API GuideREST APIsModuleDescription/api/running/servicesModule for creating, deleting, and modifying services and for retrievinginformation about services./api/running/snmpModule for creating, deleting, and modifying SNMP communities, groups,hosts, users, and traps./api/running/snmp-serverModule for creating, deleting and modifying SNMP view, community,group, user, host, and enabling traps. A new CLI that is compliant withthe IOS style CLI with read or write configuration./api/running/csp usersModule for creating, deleting, and modifying users./api/operational/vnicsModule for retrieving statistics about vNICs.REST APIsAuthentication, Authorization, and Accounting (AAA) APIsGet Information About AAA Authentication Server Configuration and Caching er/api/running/security servers/aaaDescriptionRetrieves information about the AAA authentication server and caching time.ParametersNoneExamplescurl -u admin:admin -X GET https://192.0.2.1/api/running/security servers/aaa{"security:aaa": {"authentication": "radius""caching": {"rest req caching tmput": 0"}}}API HistoryRelease2.7.0ModificationThe caching timeout parameter is introdu

Information About the Cisco CSP REST API 8 Information About the Cisco CSP REST API You can perform operations on the Cisco Cloud Services Platform (Cisco CSP) objects using the Representational State Transfer (REST) API. The Cisco CSP 2100 REST APIs support create, retrieve, update, and delete (CRUD) operations. To