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))
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))
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(' ', '+'))
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(' ', '+'))
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(' ', '+'))
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(' ', '+'))
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)
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)
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)
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)
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)
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)
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)
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))
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)
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)
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
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)
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(' ','+'))