@@ -118,7 +118,7 @@ def create(self):
118118 if self .management_port :
119119 data ["managementPort" ] = self .management_port
120120
121- self .call_post (data )
121+ self ._call_post (data )
122122 self .fail = not self .response .ok
123123 if self .response .ok :
124124 self .device_id = json .loads (self .content )['id' ]
@@ -161,7 +161,7 @@ def update(self, field: str, value: str) -> dict:
161161
162162 data [field ] = value
163163
164- self .call_put (json .dumps (data ))
164+ self ._call_put (json .dumps (data ))
165165
166166 return json .loads (self .content )
167167
@@ -181,7 +181,7 @@ def delete(self, by_ref=False):
181181 """
182182 self .action = 'Delete device'
183183 self ._format_path_ref_id (by_ref , self .api_path )
184- self .call_delete ()
184+ self ._call_delete ()
185185
186186 def activate (self ):
187187 """
@@ -193,7 +193,7 @@ def activate(self):
193193
194194 """
195195 self .path = "{}/activate/{}" .format (self .api_path , self .device_id )
196- self .call_post ()
196+ self ._call_post ()
197197
198198 def provision (self ):
199199 """
@@ -206,7 +206,7 @@ def provision(self):
206206 """
207207 self .action = 'Post Provisioning'
208208 self .path = "{}/provisioning/{}" .format (self .api_path , self .device_id )
209- self .call_post ()
209+ self ._call_post ()
210210
211211 def provision_status (self ):
212212 """
@@ -220,7 +220,7 @@ def provision_status(self):
220220 self .action = 'Get provision status'
221221 self .path = "{}/provisioning/status/{}" .format (
222222 self .api_path , self .device_id )
223- self .call_get ()
223+ self ._call_get ()
224224
225225 return json .loads (self .content )
226226
@@ -235,7 +235,7 @@ def is_device(self):
235235 """
236236 self .action = 'Is device'
237237 self .path = "{}/isDevice/{}" .format (self .api_path , self .device_id )
238- self .call_get ()
238+ self ._call_get ()
239239 return json .loads (self .content )
240240
241241 def read (self , by_ref = False ):
@@ -260,7 +260,7 @@ def read(self, by_ref=False):
260260 else :
261261 self .path = '{}/v2/{}' .format (self .api_path , self .device_id )
262262
263- self .call_get ()
263+ self ._call_get ()
264264 if not self .response .ok :
265265 return False
266266
@@ -295,7 +295,7 @@ def status(self):
295295 self .action = "Get device status"
296296 self .path = "{}/status/{}" .format (self .api_path , self .device_id )
297297
298- self .call_get ()
298+ self ._call_get ()
299299 return self .content
300300
301301 def get_configuration_status (self ):
@@ -310,7 +310,7 @@ def get_configuration_status(self):
310310 self .action = 'Get configuration status'
311311 self .path = "{}/configuration/status/id/{}" .format (
312312 self .api_path , self .device_id )
313- self .call_get ()
313+ self ._call_get ()
314314 self .configuration = json .loads (self .content )
315315
316316 def update_config (self ):
@@ -325,7 +325,7 @@ def update_config(self):
325325 self .action = 'Update config'
326326 self .path = "{}/configuration/update/{}" .format (
327327 self .api_path , self .device_id )
328- self .call_post ()
328+ self ._call_post ()
329329 return json .dumps (self .content )
330330
331331 def ping (self , address ):
@@ -344,7 +344,7 @@ def ping(self, address):
344344 """
345345 self .action = 'Get ping'
346346 self .path = "{}/ping/{}" .format (self .api_path , address )
347- self .call_get ()
347+ self ._call_get ()
348348
349349 return self .content
350350
@@ -359,7 +359,7 @@ def initial_provisioning(self):
359359 """
360360 self .action = 'Intial provisioning'
361361 self .path = "{}/provisioning/{}" .format (self .api_path , self .device_id )
362- self .call_post ()
362+ self ._call_post ()
363363
364364 def push_configuration_status (self ):
365365 """
@@ -374,7 +374,7 @@ def push_configuration_status(self):
374374 self .path = "{}/push_configuration/status/{}" .format (
375375 self .api_path , self .device_id )
376376
377- self .call_get ()
377+ self ._call_get ()
378378 return json .dumps (self .content )
379379
380380 def push_configuration (self , configuration = None ):
@@ -395,7 +395,7 @@ def push_configuration(self, configuration=None):
395395 self .path = "{}/push_configuration/{}" .format (
396396 self .api_path , self .device_id )
397397
398- self .call_put (configuration )
398+ self ._call_put (configuration )
399399
400400 def update_ip_address (self , ip_addr , netmask = "255.255.255.255" ):
401401 """
@@ -417,7 +417,7 @@ def update_ip_address(self, ip_addr, netmask="255.255.255.255"):
417417 path = "{}/management_ip/update/{}?ip={}&mask={}"
418418 self .path = path .format (self .api_path , self .device_id , ip_addr ,
419419 netmask )
420- self .call_put ()
420+ self ._call_put ()
421421
422422 def profile_switch (self , old_profile , new_profile_ref ):
423423 """
@@ -443,7 +443,7 @@ def profile_switch(self, old_profile, new_profile_ref):
443443 old_profile ,
444444 new_profile_ref )
445445 self .path = path
446- self .call_put ()
446+ self ._call_put ()
447447
448448 def profile_attach (self , profile_reference : str ) -> None :
449449 """
@@ -463,7 +463,7 @@ def profile_attach(self, profile_reference: str) -> None:
463463 '?device={device_reference}' ).format (
464464 profile_reference = profile_reference ,
465465 device_reference = self .device_external )
466- self .call_put ()
466+ self ._call_put ()
467467
468468 def update_credentials (self , login , password ):
469469 """
@@ -484,7 +484,7 @@ def update_credentials(self, login, password):
484484 self .action = 'Update credentials'
485485 path = "{}/credentials/update/{}?login={}&password={}"
486486 self .path = path .format (self .api_path , self .device_id , login , password )
487- self .call_put ()
487+ self ._call_put ()
488488
489489 def attach_files (self , uris , position = "AUTO" ):
490490 """
@@ -504,7 +504,7 @@ def attach_files(self, uris, position="AUTO"):
504504 self .action = 'Attach files'
505505 self .path = ("{}/attach/{}/files/{}" ).format (self .api_path ,
506506 self .device_id , position )
507- self .call_put (json .dumps (uris ))
507+ self ._call_put (json .dumps (uris ))
508508
509509 def detach_files (self , uris ):
510510 """
@@ -522,7 +522,7 @@ def detach_files(self, uris):
522522 self .action = 'Detach files'
523523 self .path = ("{}/detach/{}/files" ).format (self .api_path ,
524524 self .device_id )
525- self .call_put (json .dumps (uris ))
525+ self ._call_put (json .dumps (uris ))
526526
527527 def get_configuration_variable (self , name : str ) -> dict :
528528 """
@@ -540,7 +540,7 @@ def get_configuration_variable(self, name: str) -> dict:
540540 """
541541 self .path = '/variables/{device_id}/{name}' .format (
542542 device_id = self .device_id , name = name )
543- self .call_get ()
543+ self ._call_get ()
544544
545545 return json .loads (self .content )
546546
@@ -581,7 +581,7 @@ def create_configuration_variable(
581581 type = conf_type ,
582582 comment = comment )
583583
584- self .call_put ()
584+ self ._call_put ()
585585
586586 if self .get_configuration_variable (name )['value' ] == value :
587587 return True
0 commit comments