# Pastebin Mz8QxHCW import resource from openstack import format fake_data = {'id': 123, 'enabled': True, 'name': 'foobar', 'attr1': 'value1', 'attr2': 'value2', 'status': None} class FakeResource(resource.Resource): resource_key = 'foobar' resources_key = 'foobars' base_path = '/foobar' allow_create = allow_retrieve = allow_update = True allow_delete = allow_list = allow_head = True enabled = resource.prop('enabled', type=format.BoolStr) name = resource.prop('name') first = resource.prop('attr1') second = resource.prop('attr2') third = resource.prop('attr3', alias='attr_three') status = resource.prop('status') foobar1 = FakeResource(fake_data) foobar2 = FakeResource(fake_data) print(foobar1.first) print(foobar2.first) foobar1.first = 'new_value1' print(foobar1.first) print(foobar2.first)