示例#1
0
    def listWiped(self):
        postUri = "/_listWiped"
        __data__ = None
        queryParams = {}

        response = requests.get(self.base + postUri,
                                params=queryParams,
                                verify=False,
                                headers={
                                    'X-BM-ApiKey': self.apiKey,
                                    'Accept': 'application/json',
                                    'X-BM-ClientVersion': IDevices_VERSION
                                },
                                data=json.dumps(__data__))
        from netbluemind.device.api.Device import Device
        from netbluemind.device.api.Device import __DeviceSerDer__
        return self.handleResult__(serder.ListSerDer(__DeviceSerDer__()),
                                   response)
示例#2
0
    def update(self, uid, device):
        postUri = "/{uid}"
        __data__ = None
        postUri = postUri.replace("{uid}", uid)
        from netbluemind.device.api.Device import Device
        from netbluemind.device.api.Device import __DeviceSerDer__
        __data__ = __DeviceSerDer__().encode(device)

        queryParams = {}

        response = requests.post(self.base + postUri,
                                 params=queryParams,
                                 verify=False,
                                 headers={
                                     'X-BM-ApiKey': self.apiKey,
                                     'Accept': 'application/json',
                                     'X-BM-ClientVersion': IDevice_VERSION
                                 },
                                 data=json.dumps(__data__))
        return self.handleResult__(None, response)
示例#3
0
    def byIdentifier(self, identifier):
        postUri = "/{identifier}/byIdentifier"
        __data__ = None
        postUri = postUri.replace("{identifier}", identifier)
        queryParams = {}

        response = requests.get(self.base + postUri,
                                params=queryParams,
                                verify=False,
                                headers={
                                    'X-BM-ApiKey': self.apiKey,
                                    'Accept': 'application/json',
                                    'X-BM-ClientVersion': IDevice_VERSION
                                },
                                data=json.dumps(__data__))
        from netbluemind.device.api.Device import Device
        from netbluemind.device.api.Device import __DeviceSerDer__
        from netbluemind.core.container.model.ItemValue import ItemValue
        from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__
        return self.handleResult__(__ItemValueSerDer__(__DeviceSerDer__()),
                                   response)
示例#4
0
    def list(self):
        postUri = "/_list"
        __data__ = None
        queryParams = {}

        response = requests.get(self.base + postUri,
                                params=queryParams,
                                verify=False,
                                headers={
                                    'X-BM-ApiKey': self.apiKey,
                                    'Accept': 'application/json',
                                    'X-BM-ClientVersion': IDevice_VERSION
                                },
                                data=json.dumps(__data__))
        from netbluemind.device.api.Device import Device
        from netbluemind.device.api.Device import __DeviceSerDer__
        from netbluemind.core.container.model.ItemValue import ItemValue
        from netbluemind.core.container.model.ItemValue import __ItemValueSerDer__
        from netbluemind.core.api.ListResult import ListResult
        from netbluemind.core.api.ListResult import __ListResultSerDer__
        return self.handleResult__(
            __ListResultSerDer__(__ItemValueSerDer__(__DeviceSerDer__())),
            response)