Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions scaleio/scaleio.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import json
import requests
from requests.auth import HTTPBasicAuth
from requests_toolbelt import SSLAdapter
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
import ssl
Expand All @@ -20,7 +18,7 @@ def get_class_name(cls):

def __str__(self):
"""
A convinience method to pretty print the contents of the class instance
A convenience method to pretty print the contents of the class instance
"""
# to show include all variables in sorted order
return "<{}> @ {}:\n".format(self.get_class_name(), id(self)) + "\n".join(
Expand Down Expand Up @@ -62,7 +60,7 @@ def __init__(self,
@staticmethod
def from_dict(dict):
"""
A convinience method that directly creates a new instance from a passed dictionary (that probably came from a
A convenience method that directly creates a new instance from a passed dictionary (that probably came from a
JSON response from the server.
"""
return ScaleIO_Protection_Domain(**dict)
Expand Down Expand Up @@ -107,7 +105,7 @@ def __init__(self,
@staticmethod
def from_dict(dict):
"""
A convinience method that directly creates a new instance from a passed dictionary (that probably came from a
A convenience method that directly creates a new instance from a passed dictionary (that probably came from a
JSON response from the server.
"""
return ScaleIO_Volume(**dict)
Expand Down Expand Up @@ -138,7 +136,7 @@ def __init__(self,
@staticmethod
def from_dict(dict):
"""
A convinience method that directly creates a new instance from a passed dictionary (that probably came from a
A convenience method that directly creates a new instance from a passed dictionary (that probably came from a
JSON response from the server.
"""
return ScaleIO_SDC(**dict)
Expand Down Expand Up @@ -188,7 +186,7 @@ def __init__(self,
@staticmethod
def from_dict(dict):
"""
A convinience method that directly creates a new instance from a passed dictionary (that probably came from a
A convenience method that directly creates a new instance from a passed dictionary (that probably came from a
JSON response from the server.
"""
return ScaleIO_SDS(**dict)
Expand All @@ -200,7 +198,7 @@ def __init__(self, ip, role):

def __str__(self):
"""
A convinience method to pretty print the contents of the class instance
A convenience method to pretty print the contents of the class instance
"""
# to show include all variables in sorted order
return "{} : IP: {} Role: {}".format("IP",self.ip,self.role)
Expand All @@ -215,7 +213,7 @@ def __init__(self, href, rel):

def __str__(self):
"""
A convinience method to pretty print the contents of the class instance
A convenience method to pretty print the contents of the class instance
"""
# to show include all variables in sorted order
return "{} : Target: '{}' Relative: '{}'".format("Link", self.href, self.rel)
Expand Down Expand Up @@ -282,7 +280,7 @@ def _check_login(self):

def _do_post(self, url, **kwargs):
"""
Convinient method for POST requests
Convenient method for POST requests
Returns http request status value from a POST request
"""
scaleioapi_post_headers = {'Content-type':'application/json','Version':'1.0'}
Expand Down Expand Up @@ -486,4 +484,4 @@ def delete_volume(self, volObj, removeMode='ONLY_ME', **kwargs):
#sio.create_volume_by_pd_name('testvol001', 8192, sio.get_pd_by_name('default'))
#sio.map_volume_to_sdc(sio.get_volume_by_name('testvol009'), sio.get_sdc_by_id('ce4d7e2a00000001'), False)
#sio.unmap_volume_from_sdc(sio.get_volume_by_name('testvol009'), sio.get_sdc_by_id('ce4d7e2a00000001'))
#sio.delete_volume(sio.get_volume_by_name('testvol009'), 'ONLY_ME')
#sio.delete_volume(sio.get_volume_by_name('testvol009'), 'ONLY_ME')