Autogenerated Code Documentaion

Platforms: Unix

class essential.randomdomain.RandomDomain

Generates random internet domain names

getDomainList(count)

Generate list of domains names

Parameters:count (int) – number of wanted domains
Returns:[str] domains list

Class InternetRule

All the operations related to internet rules

class essential.internetrule.InternetRule(umcConnection=None, ucr=None, name=None, typ=None, domains=None, wlan=None, priority=None)

Contains the needed functuality for internet rules. By default they are randomly formed

Parameters:
  • umcConnection (UMC connection object) –
  • ucr (UCR object) –
  • name (str) – name of the internet rule to be created later
  • typ (str=’whitelist’ or ‘blacklist’) – type of the internet rule to be created later
  • domains ([str]) – list of the internet rule to be created later
  • wlan (bool) – if the internet rule supports wlan
  • priority ([int]) – priority of the internet rule [1,10]
allRules()

Get all defined rules via UMCP

Returns:[str] list of rules names
assign(school, groupName, groupType, default=False)

Assign internet rule via UMCP

Parameters:
  • school (str) – name of the ou
  • groupName (str) – name of the group or class
  • groupType (str) – ‘workgroup’ or ‘class’
  • defalt (bool) – if the groups is assigned to default values
checkUcr(expectedResult)

check ucr for internet rule

Fetch the values from ucr and check if it matches the correct values for the rule

Parameters:expectedResult (bool) –
define()

Define internet rule via UMCP

defineList(count)

Define list of random internet rules

Parameters:count (int) – number of wanted rules
Returns:list of rule objects
get(expectedResult)

gets internet rule via UMCP

Parameters:expectedResult (bool) – True if the rule is expected to be found
put(new_name=None, new_type=None, new_domains=None, new_wlan=None, new_priority=None)

Modify internet rule via UMCP

with no args passed this only reset the rule properties

Parameters:
  • new_name (str) –
  • new_type (str) –
  • new_domains ([str]) –
  • new_wlan (bool) –
  • new_priority (int [1,10]) –
remove()

removes internet rule via UMCP

Platforms: Unix

class essential.check.Check(school, groupRuleCouples, umcConnection=None, ucr=None)

Contains the needed functuality for checks related to internet rules within groups/classes.

param school:name of the ou
type school:str
param groupRuleCouples:
 couples of groups and rules assigned to them
type groupRuleCouples:
 tuple(str,str)
param umcConnection:
 
type umcConnection:
 UMC connection object
param ucr:
type ucr:UCR object
checkRules()

Check if the assigned internet rules are correct UMCP

checkUcr()

Check ucr variables for groups/ classes internet rules

Platforms: Unix

class essential.workgroup.Workgroup(school, umcConnection=None, ucr=None, name=None, description=None, members=None)

Contains the needed functuality for workgroups in an already created OU, By default they are randomly formed except the OU, should be provided

Parameters:
  • school (str) – name of the ou
  • umcConnection (UMC connection object) –
  • ucr (UCR object) –
  • name (str) – name of the class to be created later
  • description (str) – description of the class to be created later
  • members ([str=memberdn]) – list of dns of members
create()

Creates object workgroup

createList(count)

create list of random workgroups returns list of groups objects

Parameters:count (int) – number of wanted workgroups
Returns:[workgroup_object]

Platforms: Unix

class essential.klasse.Klasse(school, umcConnection=None, ucr=None, name=None, description=None)

Contains the needed functuality for classes in an already created OU, By default they are randomly formed except the OU, should be provided

Parameters:
  • school (str) – name of the ou
  • umcConnection (UMC connection object) –
  • ucr (UCR object) –
  • name (str) – name of the class to be created later
  • description (str) – description of the class to be created later
create()

Creates object class

createList(count)

Create a list of classes inside the specific ou with random names and description

Parameters:count (int) – number of wanted classes
Returns:[klasse_object]
class essential.simplecurl.SimpleCurl(proxy, username='Administrator', password='univention', bFollowLocation=1, maxReDirs=5, connectTimout=10, timeOut=10, port=3128, auth=1)

pycurl simple class implementation

Parameters:
  • proxy (str) – proxy for the http requests
  • username (str) – to use for http requests
  • password (str) – password for the user provided
  • bFollowLocation (bool) –
  • maxReDirs (int) –
  • connectTimeout (int) –
  • port (int) –
  • auth (int) – authentication type
close()

Close the curl connection

getPage(url, bVerbose=False, postData=None)

Gets a http page this method keep trying to fetch the page for 60secs then stops raising and exception if not succeeded.

Parameters:
  • url (str) – url
  • bVerbose (bool) – if verbose
  • postData –
Returns:

html page

httpCode()

HTTP status code

Returns:int - http_status_code
response(url)

HTTP status code

Parameters:url (str) – url
Returns:int - HTTP status code

Previous topic

Welcome to 90_ucsschool’s documentation!

This Page