Lines Matching full:content

74 …{self.timeout}&format={self.format}' + uri_options, data=data, headers={'content-type': 'applicati…
81 headers={'content-type': 'application/json'}
220 def _decode_resource(cls, content: dict):
224 if content['kind'] == 'singleResource' or content['kind'] == 'resourceInstance':
225 return {content['id']: cls._decode_value(content['type'], content['value'])}
226 elif content['kind'] == 'multiResource':
228 for riid, value in content['values'].items():
229 values.update({int(riid): cls._decode_value(content['type'], value)})
230 return {content['id']: values}
231 raise RuntimeError(f'Unhandled type {content["kind"]}')
234 def _decode_obj_inst(cls, content): argument
239 for resource in content['resources']:
241 return {content['id']: resources}
244 def _decode_obj(cls, content): argument
249 for instance in content['instances']:
251 return {content['id']: instances}
258 content = resp['content']
259 if content['kind'] == 'obj':
260 return self._decode_obj(content)
261 elif content['kind'] == 'instance':
262 return self._decode_obj_inst(content)
263 elif content['kind'] == 'singleResource' or content['kind'] == 'resourceInstance':
264 return self._decode_value(content['type'], content['value'])
265 elif content['kind'] == 'multiResource':
266 return self._decode_resource(content)
267 raise RuntimeError(f'Unhandled type {content["kind"]}')
274 if payload['status'] != 'CONTENT(205)' or 'content' not in payload:
275 raise RuntimeError(f'No content received')
276 payload = payload['content']
277 for path, content in payload.items():
279 for obj in content['objects']:
284 data.update(cls._decode_obj(content))
288 data[keys[0]].update(cls._decode_obj_inst(content))
294 data[keys[0]][keys[1]].update(cls._decode_resource(content))
302 data[keys[0]][keys[1]][keys[2]].update(cls._decode_resource(content))
385content = '{"servers":{"0":{"binding":"U","defaultMinPeriod":1,"lifetime":86400,"notifIfDisabled":…
386 self.post(f'/bootstrap/{endpoint}', content)