Core REST API¶
-
class
hpsdnclient.core.
CoreMixin
(controller, auth)¶ Core REST API Methods
This class contains methods that call the Core REST API functions in the HP VAN SDN Controller
Application management
Authentication
- Controller management
- Logs
- Support Reports
Licensing
-
add_license
(key)¶ Add a new license
Parameters: key (str) – The license key to add
-
deactivate_license
(serial_no)¶ Deactivate a license
Parameters: serial_no (str) – The serial number of the license to deactivate
-
download_logs
()¶ Downloads log files for the controller team. The logs are a zip file containing an inner zip file of logs for each team member.This is saved to the path where the application is being run.
Returns: File path Return type: String
-
get_app_health
(app)¶ Get application health information as returned by the application
Parameters: app (str) – The application to query Returns: Application health information Return type: hpsdnclient.datatypes.AppHealth
-
get_app_info
(app)¶ Get information about the specified application
Parameters: app (str) – The application to query for information Returns: Application info Return type: hpsdnclient.datatypes.App
-
get_apps
()¶ Get a list of applications uploaded to the controller
Returns: List of applications Return type: list
-
get_install_id
()¶ Get install id
Returns: Install ID Return type: str
-
get_licence_detail
(serial_no)¶ Get a license details given its serial number
Parameters: serial_no (str) – The serial number to retrieve details for Returns: License details Return type: hpsdnclient.datatypes.License
-
get_licenses
(key=None)¶ Get all known licenses or find a specific license by key
Parameters: key (str) – A specific license key to find (Optional) Returns: A list of licenses Return type: list
-
get_support
(id=None, fields=None)¶ Generates a support report
Parameters: - id (str) – A comma seperated list of id’s to be returned (Optional)
- fields (str) – The fields to be returned (Optional)
Returns: The support report
Return type: hpsdnclient.datatypes.Support
-
login
(user, password)¶ Login to the controller. While not necessary (as the hp-sdn-client handles this for you) it’s included here for completeness
Parameters: - user (str) – Username
- password (str) – Password
Returns: Dictionary containing Token and Expiry Time
Return type: dict
-
logout
(token)¶ Logout of the controller Logs out the user with the supplied token
Parameters: token (str) – X-Auth-Token of the user to logout
-
manage_app
(app, action)¶ Install, Start or Stop an application on the controller
Parameters: - app (str) – The application to manage
- action (str) – The action to perform (“start”, “stop” or “install”)
-
uninstall_app
(app)¶ Uninstall and delete an application from the controller
Parameters: app (str) – The application to be uninstalled
-
upload_app
(app)¶ Upload an application to the controller
Parameters: app (filename) – The path to the file to be uploaded