Ejemplo n.º 1
0
 def RemovePoolFromSlave(self, slave, pool):
     """ Adds a Pool from a Slave.
         Input:  slave: The name of the Slave or Slaves (may be a list).
                 pool: The name of the Pool or Pools (may be a list).
         Returns: Success message.
     """
     return self.connectionProperties.__delete__(
         "/api/pools?Slaves=" + ArrayToCommaSeparatedString(slave) +
         "&Pool=" + ArrayToCommaSeparatedString(pool))
Ejemplo n.º 2
0
 def RemoveGroupFromSlave(self, slave, group):
     """ Adds a Group from a Slave.
         Input:  slave: The name of the Slave or Slaves (may be a list).
                 group: The name of the Group or Group (may be a list).
         Returns: Success message.
     """
     return self.connectionProperties.__delete__(
         "/api/groups?Slaves=" + ArrayToCommaSeparatedString(slave) +
         "&Group=" + ArrayToCommaSeparatedString(group))
Ejemplo n.º 3
0
 def DeletePools(self, names):
     """ Removes some Pools from the repository.
         Params: names: List of Pool names to remove.
         Returns: Success message.
     """
     return self.connectionProperties.__delete__(
         "/api/pools?Pool=" +
         ArrayToCommaSeparatedString(names).replace(' ', '+'))
Ejemplo n.º 4
0
 def GetSlaveNamesInPool(self, pool):
     """ Gets the names of all Slaves in a specific Pool.
         Input:  pool: The name of the Pool to search in (may be a list).
         Returns: A list of all Slaves that are in the Pool.
     """
     return self.connectionProperties.__get__(
         "/api/pools?Pool=" +
         ArrayToCommaSeparatedString(pool).replace(' ', '+'))
Ejemplo n.º 5
0
 def GetSlaveNamesInGroup(self, group):
     """ Gets the names of all Slaves in a specific Group.
         Input:  group: The name of the Group to search in (may be a list).
         Returns: A list of all Slaves that are in the Groups.
     """
     return self.connectionProperties.__get__(
         "/api/groups?Group=" +
         ArrayToCommaSeparatedString(group).replace(' ', '+'))
Ejemplo n.º 6
0
 def DeleteLimitGroup(self, name):
     """ Deletes a limit group.
         Input: name: The limit group name (may be a list).
         Returns: Success message.
     """
     return self.connectionProperties.__delete__(
         "/api/limitgroups?Names=" +
         ArrayToCommaSeparatedString(name).replace(' ', '+'))
Ejemplo n.º 7
0
 def GetJobs(self, ids=None):
     """    Gets all specified Jobs, or all Jobs if none specified.
         Input: List of Job Ids.
         Returns: The list of Jobs.
     """
     script = "/api/jobs"
     if ids != None:
         script = script + "?JobID=" + ArrayToCommaSeparatedString(ids)
     return self.connectionProperties.__get__(script)
Ejemplo n.º 8
0
 def GetBalancerInfos(self, names = None):
     """ Gets a list of Balancer infos.
         Input: name: The Balancer names to be retrieved. If None then gets all Balancer infos.
         Returns: The Balancer infos.
     """
     script = "/api/balancer?Info=true"
     if names != None:
         script = script+"&Names="+ArrayToCommaSeparatedString(names).replace(' ','+')
     return self.connectionProperties.__get__(script)
Ejemplo n.º 9
0
    def PurgeDeletedJobs(self, ids):
        """ Purges the deleted Jobs that correspond to the provided IDs from the deleted Job collection.
            Input: The deleted Job IDs (may be a list).
            Returns: Success message.
        """
        script = "/api/jobs?Purge=true"

        script = script + "&JobID=" + ArrayToCommaSeparatedString(ids)
        return self.connectionProperties.__delete__(script)
Ejemplo n.º 10
0
    def GetDeletedJobs(self, ids=None):
        """ Gets the undeleted Jobs that correspond to the provided Job IDs. If no IDs are provided, gets all the deleted Jobs.
            Input: The Job IDs (optional, may be a list).
            Returns: The Job/s (list).
        """
        script = "/api/jobs?Deleted=true"

        if ids != None:
            script = script + "&JobID=" + ArrayToCommaSeparatedString(ids)
        return self.connectionProperties.__get__(script)
Ejemplo n.º 11
0
    def GetJobDetails(self, ids):
        """ Gets the Job details for the provided Job IDs.
            Input: The Job IDs (may be a list).
            Returns: The Job Details for the valid Job IDs provided.
        """
        script = "/api/jobs"

        script = script + "?JobID=" + ArrayToCommaSeparatedString(
            ids) + "&Details=true"
        return self.connectionProperties.__get__(script)
Ejemplo n.º 12
0
 def GetSlaveInfos(self, names=None):
     """ Gets multiple Slave info objects.
         Input: name: The Slave names. If None return all info for all Slaves.
         Returns: List of the Slave infos.
         """
     script = "/api/slaves?Data=info"
     if names != None:
         script = script + "&Name=" + ArrayToCommaSeparatedString(
             names).replace(' ', '+')
     return self.connectionProperties.__get__(script)
Ejemplo n.º 13
0
 def GetSlavesInfoSettings(self, names=None):
     """ Gets multiple Slave info settings.
         Inputs: names: The names of the Slaves to get. If None get all Slaves.
         Returns: The list of Slaves' infos and settings.
     """
     script = "/api/slaves?Data=infosettings"
     if names != None:
         script = script + "&Name=" + ArrayToCommaSeparatedString(
             names).replace(' ', '+')
     return self.connectionProperties.__get__(script)
Ejemplo n.º 14
0
 def GetUsers(self, names = None):
     """ Gets all the User infos.
         Input: names: The names of the Users you want info for. If None get all Users infos.
         Returns: The list of User infos.
     """
     script = "/api/users"
     if names != None:
         script =script +"?Name=" + ArrayToCommaSeparatedString(names).replace(' ','+')
         
     return (self.connectionProperties.__get__(script))
Ejemplo n.º 15
0
    def GetPulseInfoSettingsList(self, names=None):
        """ Gets a list of Pulse info settings.
            Input: name: The Pulse names to be retrieved. If None then gets all Pulse info settings.
            Returns: The Pulse info settings.
        """
        script = "/api/pulse"
        if names != None:
            script = script + "?Names=" + ArrayToCommaSeparatedString(
                names).replace(' ', '+')

        return self.connectionProperties.__get__(script)
Ejemplo n.º 16
0
 def GetProxyServerInfoSettingsList(self, names=None):
     """ Gets ProxyServerInfoSettings objects for specified Proxy Servers.
         Inputs:
             Names: Proxy Server names to retrieve InfoSettings for. Gets all InfoSettings if `None`.
         Returns: List of ProxyServerInfoSettings objects for all specified Proxy Servers.
     """
     url = self.URL
     if (names != None):
         url += '?Names=' + ArrayToCommaSeparatedString(names).replace(
             ' ', '+')
     return self.connectionProperties.__get__(url)
Ejemplo n.º 17
0
    def GetJob(self, id):
        """Gets a Job.
            Input: id: The Job ID (may be a list).
            Returns: The Job/s (list).
        """
        jobId = ArrayToCommaSeparatedString(id)

        result = self.connectionProperties.__get__("/api/jobs?JobID=" + jobId)

        if type(result) == list and len(result) > 0:
            result = result[0]

        return result
Ejemplo n.º 18
0
    def GetLimitGroups(self, names=None):
        """ Gets a list of limit groups.
            Input: Names: A list of limit group names, gets all limit groups if left as None.
            Returns: The list of limit groups.
        """
        if names is not None:

            script = "/api/limitgroups?Names=" + ArrayToCommaSeparatedString(
                names).replace(' ', '+')

        else:
            script = "/api/limitgroups"

        return self.connectionProperties.__get__(script)
Ejemplo n.º 19
0
 def DeleteUser(self, name):
     """ Deletes a User.
         Input: name: The Users name (may be a list).
         Returns: Success message.
     """ 
     return self.connectionProperties.__delete__("/api/users?Name=" + ArrayToCommaSeparatedString(name).replace(' ','+'))