예제 #1
0
 def remove(self, force=False):
     self._ensure_exists()
     auth_api_request = AuthApiRequest(self._api)
     auth_api_request.method('DELETE')
     auth_api_request.url('devicetype/{deviceTypeId}',
                          deviceTypeId=self._id)
     auth_api_request.action('devicetype/delete')
     auth_api_request.param('force', force)
     auth_api_request.execute('DeviceType remove failure.')
     self._id = None
     self.name = None
     self.description = None
예제 #2
0
 def list_notifications(self,
                        device_id,
                        start=None,
                        end=None,
                        notification=None,
                        sort_field=None,
                        sort_order=None,
                        take=None,
                        skip=None):
     auth_api_request = AuthApiRequest(self)
     auth_api_request.url('device/{deviceId}/notification',
                          deviceId=device_id)
     auth_api_request.action('notification/list')
     auth_api_request.param('start', start)
     auth_api_request.param('end', end)
     auth_api_request.param('notification', notification)
     auth_api_request.param('sortField', sort_field)
     auth_api_request.param('sortOrder', sort_order)
     auth_api_request.param('take', take)
     auth_api_request.param('skip', skip)
     auth_api_request.response_key('notifications')
     notifications = auth_api_request.execute('List notifications failure.')
     return [Notification(notification) for notification in notifications]
예제 #3
0
 def list_device_types(self,
                       name=None,
                       name_pattern=None,
                       sort_field=None,
                       sort_order=None,
                       take=None,
                       skip=None):
     auth_api_request = AuthApiRequest(self)
     auth_api_request.url('devicetype')
     auth_api_request.action('devicetype/list')
     auth_api_request.param('name', name)
     auth_api_request.param('namePattern', name_pattern)
     auth_api_request.param('sortField', sort_field)
     auth_api_request.param('sortOrder', sort_order)
     auth_api_request.param('take', take)
     auth_api_request.param('skip', skip)
     auth_api_request.response_key('deviceTypes')
     device_types = auth_api_request.execute('List device types failure.')
     return [DeviceType(self, device_type) for device_type in device_types]
예제 #4
0
 def list_networks(self,
                   name=None,
                   name_pattern=None,
                   sort_field=None,
                   sort_order=None,
                   take=None,
                   skip=None):
     auth_api_request = AuthApiRequest(self)
     auth_api_request.url('network')
     auth_api_request.action('network/list')
     auth_api_request.param('name', name)
     auth_api_request.param('namePattern', name_pattern)
     auth_api_request.param('sortField', sort_field)
     auth_api_request.param('sortOrder', sort_order)
     auth_api_request.param('take', take)
     auth_api_request.param('skip', skip)
     auth_api_request.response_key('networks')
     networks = auth_api_request.execute('List networks failure.')
     return [Network(self, network) for network in networks]
예제 #5
0
 def list_users(self,
                login=None,
                login_pattern=None,
                role=None,
                status=None,
                sort_field=None,
                sort_order=None,
                take=None,
                skip=None):
     auth_api_request = AuthApiRequest(self)
     auth_api_request.url('user')
     auth_api_request.action('user/list')
     auth_api_request.param('login', login)
     auth_api_request.param('loginPattern', login_pattern)
     auth_api_request.param('role', role)
     auth_api_request.param('status', status)
     auth_api_request.param('sortField', sort_field)
     auth_api_request.param('sortOrder', sort_order)
     auth_api_request.param('take', take)
     auth_api_request.param('skip', skip)
     auth_api_request.response_key('users')
     users = auth_api_request.execute('List users failure.')
     return [User(self, user) for user in users]
예제 #6
0
 def list_commands(self,
                   device_id,
                   start=None,
                   end=None,
                   command=None,
                   status=None,
                   sort_field=None,
                   sort_order=None,
                   take=None,
                   skip=None):
     auth_api_request = AuthApiRequest(self)
     auth_api_request.url('device/{deviceId}/command', deviceId=device_id)
     auth_api_request.action('command/list')
     auth_api_request.param('start', start)
     auth_api_request.param('end', end)
     auth_api_request.param('command', command)
     auth_api_request.param('status', status)
     auth_api_request.param('sortField', sort_field)
     auth_api_request.param('sortOrder', sort_order)
     auth_api_request.param('take', take)
     auth_api_request.param('skip', skip)
     auth_api_request.response_key('commands')
     commands = auth_api_request.execute('List commands failure.')
     return [Command(self, command) for command in commands]