simplivity package¶
Subpackages¶
- simplivity.resources package
- Submodules
- simplivity.resources.backups module
- simplivity.resources.certificates module
- simplivity.resources.cluster_groups module
- simplivity.resources.datastores module
- simplivity.resources.external_stores module
- simplivity.resources.hosts module
- simplivity.resources.omnistack_clusters module
- simplivity.resources.policies module
- simplivity.resources.resource module
- simplivity.resources.tasks module
- simplivity.resources.virtual_machines module
- Module contents
Submodules¶
simplivity.connection module¶
This module maintains communication with SimplVity.
-
class
simplivity.connection.
Connection
(ovc_ip, ssl_bundle=False, timeout=None)[source]¶ Bases:
object
Helps to make connection with the OVC and do rest calls.
-
delete
(uri, custom_headers=None)[source]¶ Calls delete http method.
- Args:
uri: Resource URI. custom_headers: Custom headers to appened/update default headers.
- Returns:
tuple: Tuple with two members (HTTP response object and the response body in json).
-
do_http
(method, path, body, custom_headers=None, login=False)[source]¶ Makes http calls.
- Args:
method: HTTP methods (GET, POST, PUT, DELETE). path: URL body: Request body. custom_headers: Custom headers to update/append default headers. login: True if the call is for login and get the token.
- Returns:
tuple: Tuple with two members (HTTP response object and the response body in json).
-
get
(url)[source]¶ Calls get http method.
- Args:
url: Resource URL
- Returns:
tuple: Tuple with two members (HTTP response object and the response body in json).
- Raises:
HPESimpliVityException: if the response status is 400 and above
-
login
(username, password)[source]¶ Login using OVC username and password.
- Args:
username: OVC username password: OVC password
- Returns:
boolean: Returns True if login is successfull.
-
simplivity.exceptions module¶
Module to define SimpliVity exception classes.
-
exception
simplivity.exceptions.
HPESimpliVityAuthenticationError
(data, error=None)[source]¶ Bases:
simplivity.exceptions.HPESimpliVityException
SimpliVity Authentication Exception. The exception is raised when the credentials supplied is not valid.
- Attributes:
msg (str): Exception message.
-
exception
simplivity.exceptions.
HPESimpliVityException
(data, error=None)[source]¶ Bases:
Exception
SimpliVity base Exception.
- Attributes:
msg (str): Exception message. response (dict): SimpliVity rest response.
-
exception
simplivity.exceptions.
HPESimpliVityMethodNotSupportedError
(data, error=None)[source]¶ Bases:
simplivity.exceptions.HPESimpliVityException
SimpliVity Method not supported Exception. The exception is raised when the method is not supported on SimpliVity uri.
- Attributes:
msg (str): Exception message.
-
exception
simplivity.exceptions.
HPESimpliVityResourceNotFound
(data, error=None)[source]¶ Bases:
simplivity.exceptions.HPESimpliVityException
SimpliVity Resource Not Found Exception. The exception is raised when an associated resource was not found.
- Attributes:
msg (str): Exception message.
-
exception
simplivity.exceptions.
HPESimpliVityTaskError
(msg, error_code=None)[source]¶ Bases:
simplivity.exceptions.HPESimpliVityException
SimpliVity Task Error Exception.
- Attributes:
msg (str): Exception message. error_code (str): A code which uniquely identifies the specific error.
-
exception
simplivity.exceptions.
HPESimpliVityTimeout
(data, error=None)[source]¶ Bases:
simplivity.exceptions.HPESimpliVityException
SimpliVity Timeout Exception.
- Attributes:
msg (str): Exception message.
simplivity.ovc_client module¶
This module implements a common client for HPE SimpliVity resources.
-
class
simplivity.ovc_client.
OVC
(config)[source]¶ Bases:
object
Client class for all the resources.
-
property
backups
¶ Gets the Backups client.
- Returns:
Backups object
-
property
certificates
¶ Gets the certificates client.
- Returns:
Certificates object
-
property
cluster_groups
¶ Gets the cluster groups client.
- Returns:
ClusterGroups object
-
property
connection
¶ Gets the underlying OVC connection used by the OVC client.
- Returns:
Connection object
-
property
datastores
¶ Gets the Datastores client.
- Returns:
Datastores object
-
property
external_stores
¶ Gets the External stores client.
- Returns:
External stores object
-
classmethod
from_environment_variables
()[source]¶ Construct OVC Client using environment variables.
- Returns:
OVC object
-
classmethod
from_json_file
(file_name)[source]¶ Construct OVC client using a json file.
- Args:
file_name: json full path.
- Returns:
OVC object
-
property
hosts
¶ Gets the Hosts resource client.
- Returns:
Hosts object
-
property
omnistack_clusters
¶ Gets the Omnistack clusters client.
- Returns:
OmnistackClusters object
-
property
policies
¶ Gets the Policies client.
- Returns:
Policies object
-
property
virtual_machines
¶ Gets the Virtual Machines client.
- Returns:
VirtualMachines object
-
property