@@ -41,14 +41,14 @@ def _send(self, method, path, data=None):
41
41
if method == 'GET' :
42
42
params = data
43
43
data = None
44
+
44
45
resp = requests .request (method , url , data = data , params = params ,
45
46
auth = (self .user , self .pwd ),
46
47
verify = self .verify_cert , headers = self .headers )
47
48
if not resp .ok :
48
49
raise Device42HTTPError ("HTTP %s (%s) Error %s: %s request was %s" %
49
50
(method , path , resp .status_code , resp .text , data ))
50
51
retval = resp .json ()
51
- # print(retval)
52
52
return retval
53
53
54
54
def _get (self , path , data = None ):
@@ -74,10 +74,11 @@ def _log(self, message, level="DEBUG"):
74
74
def update_device (self , ** kwargs ):
75
75
""" See http://api.device42.com/#create/update-device-by-name """
76
76
path = 'devices'
77
- atleast_fields = "name serial_no uuid" . split ()
77
+ atleast_fields = [ "name" ] # this is the only required field to create/update a device, serial and uuid opt
78
78
known_fields = "new_name asset_no manufacturer hardware new_hardware is_it_switch"
79
79
known_fields += " is_it_virtual_host is_it_blade_host in_service type service_level virtual_host"
80
- known_fields += " blade_host slot_no storage_room_id storage_room os osver memory cpucount cpupower cpucore"
80
+ known_fields += " serial_no uuid"
81
+ known_fields += " blade_host slot_no storage_room_id storage_room os osver osverno memory cpucount cpupower cpucore"
81
82
known_fields += " hddcount hddsize hddraid hddraid_type macaddress devices_in_cluster appcomps"
82
83
known_fields += " customer contract_id contract"
83
84
known_fields += " aliases subtype virtual_subtype notes tags"
0 commit comments