def rest_api_entity(self): try: return self.appliance.rest_api.collections.hosts.get( name=self.name) except ValueError: raise RestLookupError( f'No host rest entity found matching name {self.name}')
def rest_api_entity(self): try: return self.appliance.rest_api.collections.reports.get( name=self.menu_name) except ValueError: raise RestLookupError( f"No report rest entity found matching name {self.menu_name}")
def rest_api_entity(self): try: return self.appliance.rest_api.collections.services.get( name=self.name, display=True) except ValueError: raise RestLookupError( f'No service rest entity found matching name {self.name}')
def rest_api_entity(self): try: return self.appliance.rest_api.collections.service_dialogs.get( label=self.label) except ValueError: raise RestLookupError( f"No service dialog rest entity found matching label {self.label}" )
def rest_api_entity(self): try: return self.appliance.rest_api.collections.automation_requests.get( description=self.description) except ValueError: raise RestLookupError( f"No automation request rest entity found matching description '{self.description}'" )
def rest_api_entity(self): try: return self.appliance.rest_api.collections.regions.get( region_number=self.number) except ValueError: raise RestLookupError( f"No region rest entity found matching region_number {self.number}" )
def rest_api_entity(self): try: return self.appliance.rest_api.collections.widgets.get( description=self.description) except ValueError: raise RestLookupError( f"No widget rest entity found matching description {self.description}" )
def rest_api_entity(self): try: return ( self.appliance.rest_api.collections.automate_domains.find_by( name=self.name)).resources[0] except IndexError: raise RestLookupError( f"No automate domain rest entity found matching name {self.name}" )
def rest_api_entity(self): collection = "instances" if self.VM_TYPE == "Instance" else "vms" try: return (getattr( self.appliance.rest_api.collections, collection).filter( Q("name", "=", self.name) & Q("ems_id", "=", self.provider.rest_api_entity.id)). resources[0]) except IndexError: raise RestLookupError( f"No {self.VM_TYPE} rest entity found matching name {self.name}" )
def rest_api_entity(self): try: return self.appliance.rest_api.collections.servers.get(id=self.sid) except ValueError: raise RestLookupError(f'No server rest entity found matching ID {self.sid}')
def rest_api_entity(self): try: return self.appliance.rest_api.collections.zones.get(id=self.id) except ValueError: raise RestLookupError( f"No zone rest entity found matching id '{self.id}'")