def show_resource_spec(resource_name): for subclass in Resource.__subclasses__(): if resource_name == subclass.resource_name: print(json.dumps(subclass.spec, default=dumper, indent=4)) return subclass.spec print("Resource {} not found. This is the list of available resources:". format(resource_name)) list_spec_resources()
def list_spec_resources(): for subclass in Resource.__subclasses__(): print(subclass.resource_name)
def get_resource_subclass(subclass_name): for subclass in Resource.__subclasses__(): if subclass.resource_name == subclass_name: return subclass return None