def construct(self): root = xmlutil.TemplateElement('storage_groups') elem = xmlutil.SubTemplateElement(root, 'storage_group', selector='storage_groupss') make_storage_group(elem, detailed=True) return xmlutil.MasterTemplate(root, 1, nsmap=storage_group_nsmap)
def construct(self): root = xmlutil.TemplateElement('rbd_pools') elem = xmlutil.SubTemplateElement(root, 'rbd_pool', selector='rbd_poolss') make_rbd_pool(elem, detailed=True) return xmlutil.MasterTemplate(root, 1, nsmap=rbd_pool_nsmap)
def construct(self): root = xmlutil.TemplateElement('host') root.set('host') root.set('service') root.set('disabled') return xmlutil.MasterTemplate(root, 1)
def construct(self): root = xmlutil.TemplateElement('storage_pools') elem = xmlutil.SubTemplateElement(root, 'storage_pool', selector='storage_pools') make_storage_pool(elem) return xmlutil.MasterTemplate(root, 1, nsmap=storage_pool_nsmap)
def construct(self): root = xmlutil.TemplateElement('poolusages') elem = xmlutil.SubTemplateElement(root, 'poolusage', selector='poolusages') make_poolusage(elem, detailed=True) return xmlutil.MasterTemplate(root, 1, nsmap=poolusage_nsmap)
def construct(self): root = xmlutil.TemplateElement('licenses') elem = xmlutil.SubTemplateElement(root, 'licenses', selector='licenses') make_license(elem, detailed=True) return xmlutil.MasterTemplate(root, 1, nsmap=license_nsmap)
def construct(self): root = xmlutil.TemplateElement('ec_profiles') elem = xmlutil.SubTemplateElement(root, 'ec_profiles', selector='ec_profile') make_ec_profile(elem, detailed=True) return xmlutil.MasterTemplate(root, 1, nsmap=ec_profile_nsmap)
def construct(self): root = xmlutil.TemplateElement('storage_types') elem = xmlutil.SubTemplateElement(root, 'storage_type', selector='storage_types') make_voltype(elem) return xmlutil.MasterTemplate(root, 1)
def construct(self): root = xmlutil.TemplateElement('backups') elem = xmlutil.SubTemplateElement(root, 'backup', selector='backups') make_backup(elem) alias = Backups.alias namespace = Backups.namespace return xmlutil.MasterTemplate(root, 1, nsmap={alias: namespace})
def construct(self): root = xmlutil.TemplateElement('host') elem = xmlutil.make_flat_dict('resource', selector='host', subselector='resource') root.append(elem) return xmlutil.MasterTemplate(root, 1)
def construct(self): root = xmlutil.TemplateElement('extensions') elem = xmlutil.SubTemplateElement(root, 'extension', selector='extensions') make_ext(elem) return xmlutil.MasterTemplate(root, 1, nsmap=ext_nsmap)
def construct(self): root = xmlutil.TemplateElement('conductors') elem = xmlutil.SubTemplateElement(root, 'conductor', selector='conductors') make_conductor(elem) return xmlutil.MasterTemplate(root, 1, nsmap=conductor_nsmap)
def construct(self): root = MetadataTemplateElement('metadata', selector='metadata') elem = xmlutil.SubTemplateElement(root, 'meta', selector=xmlutil.get_items) elem.set('key', 0) elem.text = 1 return xmlutil.MasterTemplate(root, 1, nsmap=metadata_nsmap)
def construct(self): root = xmlutil.TemplateElement('quota_set', selector='quota_set') root.set('id') for resource in QUOTAS.resources: elem = xmlutil.SubTemplateElement(root, resource) elem.text = resource return xmlutil.MasterTemplate(root, 1)
def construct(self): root = xmlutil.TemplateElement('storage_image_metadata', selector='storage_image_metadata') elem = xmlutil.SubTemplateElement(root, 'meta', selector=xmlutil.get_items) elem.set('key', 0) elem.text = 1 return xmlutil.MasterTemplate(root, 1)
def construct(self): tagname = xmlutil.Selector('key') def extraspec_sel(obj, do_raise=False): # Have to extract the key and value for later use... key, value = obj.items()[0] return dict(key=key, value=value) root = xmlutil.TemplateElement(tagname, selector=extraspec_sel) root.text = 'value' return xmlutil.MasterTemplate(root, 1)
def construct(self): root = xmlutil.TemplateElement('hosts') elem = xmlutil.SubTemplateElement(root, 'host', selector='hosts') elem.set('service-status') elem.set('service') elem.set('zone') elem.set('service-state') elem.set('host_name') elem.set('last-update') return xmlutil.MasterTemplate(root, 1)
def construct(self): root = xmlutil.TemplateElement('services') elem = xmlutil.SubTemplateElement(root, 'service', selector='services') elem.set('binary') elem.set('host') elem.set('zone') elem.set('status') elem.set('state') elem.set('update_at') return xmlutil.MasterTemplate(root, 1)
def construct(self): root = xmlutil.TemplateElement('os-storage_upload_image', selector='os-storage_upload_image') root.set('id') root.set('updated_at') root.set('status') root.set('display_description') root.set('size') root.set('storage_type') root.set('image_id') root.set('container_format') root.set('disk_format') root.set('image_name') return xmlutil.MasterTemplate(root, 1)
def construct(self): root = xmlutil.TemplateElement('limits', selector='limits') rates = xmlutil.SubTemplateElement(root, 'rates') rate = xmlutil.SubTemplateElement(rates, 'rate', selector='rate') rate.set('uri', 'uri') rate.set('regex', 'regex') limit = xmlutil.SubTemplateElement(rate, 'limit', selector='limit') limit.set('value', 'value') limit.set('verb', 'verb') limit.set('remaining', 'remaining') limit.set('unit', 'unit') limit.set('next-available', 'next-available') absolute = xmlutil.SubTemplateElement(root, 'absolute', selector='absolute') limit = xmlutil.SubTemplateElement(absolute, 'limit', selector=xmlutil.get_items) limit.set('name', 0) limit.set('value', 1) return xmlutil.MasterTemplate(root, 1, nsmap=limits_nsmap)
def construct(self): root = xmlutil.TemplateElement('settings') elem = xmlutil.SubTemplateElement(root, 'setting', selector='settings') make_setting(elem, detailed=True) return xmlutil.MasterTemplate(root, 1, nsmap=setting_nsmap)
def construct(self): root = xmlutil.TemplateElement('clusters') elem = xmlutil.SubTemplateElement(root, 'cluster', selector='clusters') make_cluster(elem, detailed=True) return xmlutil.MasterTemplate(root, 1, nsmap=cluster_nsmap)
def construct(self): root = xmlutil.TemplateElement('placement_group', selector='placement_group') make_placement_group(root, detailed=True) return xmlutil.MasterTemplate(root, 1, nsmap=placement_group_nsmap)
def construct(self): root = xmlutil.TemplateElement('mons') elem = xmlutil.SubTemplateElement(root, 'mon', selector='mons') make_mon(elem, detailed=True) return xmlutil.MasterTemplate(root, 1, nsmap=mon_nsmap)
def construct(self): root = xmlutil.TemplateElement('osds') elem = xmlutil.SubTemplateElement(root, 'osd', selector='osds') make_osd(elem, detailed=True) return xmlutil.MasterTemplate(root, 1, nsmap=osd_nsmap)
def construct(self): root = xmlutil.TemplateElement('choices') elem = xmlutil.SubTemplateElement(root, 'version', selector='choices') make_version(elem) return xmlutil.MasterTemplate(root, 1, nsmap=version_nsmap)
def construct(self): root = xmlutil.TemplateElement('version', selector='version') make_version(root) return xmlutil.MasterTemplate(root, 1, nsmap=version_nsmap)
def construct(self): root = xmlutil.TemplateElement('server', selector='server') make_server(root, detailed=True) return xmlutil.MasterTemplate(root, 1, nsmap=server_nsmap)
def construct(self): root = xmlutil.TemplateElement('appnodes') elem = xmlutil.SubTemplateElement(root, 'appnode', selector='appnodes') make_appnode(elem, detailed=True) return xmlutil.MasterTemplate(root, 1, nsmap=vsmapp_nsmap)
def construct(self): sel = xmlutil.Selector('meta', xmlutil.get_items, 0) root = xmlutil.TemplateElement('meta', selector=sel) root.set('key', 0) root.text = 1 return xmlutil.MasterTemplate(root, 1, nsmap=metadata_nsmap)