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
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]
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]
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]
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]
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]