Пример #1
0
 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}')
Пример #2
0
 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}")
Пример #3
0
 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}')
Пример #4
0
 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}"
         )
Пример #5
0
 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}'"
         )
Пример #6
0
 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}"
         )
Пример #7
0
 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}"
         )
Пример #8
0
 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}"
         )
Пример #9
0
 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}"
         )
Пример #10
0
 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}')
Пример #11
0
 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}'")