Ejemplo n.º 1
0
 public List<RichDestination> call(ApiCaller ac, Deserializer parms) throws PerunException {
   if (parms.contains("facility")) {
     return ac.getServicesManager()
         .getAllRichDestinations(ac.getSession(), ac.getFacilityById(parms.readInt("facility")));
   } else {
     return ac.getServicesManager()
         .getAllRichDestinations(ac.getSession(), ac.getServiceById(parms.readInt("service")));
   }
 }
Ejemplo n.º 2
0
    @Override
    public Void call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      ac.getServicesManager().updateService(ac.getSession(), parms.read("service", Service.class));
      return null;
    }
Ejemplo n.º 3
0
    @Override
    public Owner call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      return ac.getServicesManager()
          .getOwner(ac.getSession(), ac.getServiceById(parms.readInt("service")));
    }
Ejemplo n.º 4
0
 @Override
 public List<Destination> call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getServicesManager()
       .getDestinations(
           ac.getSession(),
           ac.getServiceById(parms.readInt("service")),
           ac.getFacilityById(parms.readInt("facility")));
 }
Ejemplo n.º 5
0
    @Override
    public Void call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      ac.getServicesManager()
          .deleteService(ac.getSession(), ac.getServiceById(parms.readInt("service")));
      return null;
    }
Ejemplo n.º 6
0
    @Override
    public ServicesPackage call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      return ac.getServicesManager()
          .createServicesPackage(
              ac.getSession(), parms.read("servicesPackage", ServicesPackage.class));
    }
Ejemplo n.º 7
0
 @Override
 public ServiceAttributes call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getServicesManager()
       .getDataWithGroups(
           ac.getSession(),
           ac.getServiceById(parms.readInt("service")),
           ac.getFacilityById(parms.readInt("facility")));
 }
Ejemplo n.º 8
0
    @Override
    public List<Destination> call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      return ac.getServicesManager()
          .addDestinationsDefinedByHostsOnCluster(
              ac.getSession(),
              ac.getServiceById(parms.readInt("service")),
              ac.getFacilityById(parms.readInt("facility")));
    }
Ejemplo n.º 9
0
    @Override
    public List<Destination> call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      return ac.getServicesManager()
          .addDestinationsForAllServicesOnFacility(
              ac.getSession(),
              ac.getFacilityById(parms.readInt("facility")),
              ac.getDestination(parms.readString("destination"), parms.readString("type")));
    }
Ejemplo n.º 10
0
    @Override
    public Service call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      return ac.getServicesManager()
          .createService(
              ac.getSession(),
              parms.read("service", Service.class),
              ac.getOwnerById(parms.readInt("owner")));
    }
Ejemplo n.º 11
0
    @Override
    public Void call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      ac.getServicesManager()
          .removeRequiredAttribute(
              ac.getSession(),
              ac.getServiceById(parms.readInt("service")),
              ac.getAttributeDefinitionById(parms.readInt("attribute")));
      return null;
    }
Ejemplo n.º 12
0
    @Override
    public Void call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      ac.getServicesManager()
          .removeAllDestinations(
              ac.getSession(),
              ac.getServiceById(parms.readInt("service")),
              ac.getFacilityById(parms.readInt("facility")));

      return null;
    }
Ejemplo n.º 13
0
    @Override
    public Void call(ApiCaller ac, Deserializer parms) throws PerunException {
      ac.stateChangingCheck();

      int[] ids = parms.readArrayOfInts("attributes");
      List<AttributeDefinition> attributes = new ArrayList<AttributeDefinition>(ids.length);

      for (int i : ids) {
        attributes.add(ac.getAttributeDefinitionById(i));
      }

      ac.getServicesManager()
          .removeRequiredAttributes(
              ac.getSession(), ac.getServiceById(parms.readInt("service")), attributes);
      return null;
    }
Ejemplo n.º 14
0
 @Override
 public List<Service> call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getServicesManager()
       .getServicesFromServicesPackage(
           ac.getSession(), ac.getServicesPackageById(parms.readInt("servicesPackage")));
 }
Ejemplo n.º 15
0
 @Override
 public List<ServicesPackage> call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getServicesManager().getServicesPackages(ac.getSession());
 }
Ejemplo n.º 16
0
 @Override
 public Destination call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getServicesManager().getDestinationById(ac.getSession(), parms.readInt("id"));
 }
Ejemplo n.º 17
0
 @Override
 public Service call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getServicesManager().getServiceByName(ac.getSession(), parms.readString("name"));
 }
Ejemplo n.º 18
0
 @Override
 public List<Service> call(ApiCaller ac, Deserializer parms) throws PerunException {
   return ac.getServicesManager()
       .getServicesByAttributeDefinition(
           ac.getSession(), ac.getAttributeDefinitionById(parms.readInt("attributeDefinition")));
 }