CSAPI
CSAPI exposes update functionalities to the Configuration.
Most of these functions can only be done by administrators
- class DIRAC.ConfigurationSystem.Client.CSAPI.CSAPI
Bases:
object
CSAPI objects need an initialization phase
- __init__()
Initialization function
- addCEtoSite(siteName, ceName, optionsDict=None)
Adds a new CE to a site definition in the CS. A CE normally has queues, so addQueueToCE should be called after this one.
- addGroup(groupname, properties)
Add a group to the cs
- addHost(hostname, properties)
Add a host to the cs
- addQueueToCE(ceName, queueName, optionsDict=None)
Adds a new queue to a CE definition in the CS.
- addShifter(shifters=None)
Adds or modify one or more shifters. Also, adds the shifter section in case this is not present. Shifter identities are used in several places, mostly for running agents
- Parameters:
shifters (dict) – has to be in the form {‘ShifterRole’:{‘User’:’aUserName’, ‘Group’:’aDIRACGroup’}}
- Returns:
S_OK/S_ERROR
- addSite(siteName, optionsDict=None)
Adds a new site to the CS. A site is a container for services, so after calling this function, at least addCEtoSite() should be called.
- addUser(username, properties)
Add a user to the cs
- checkForUnexistantUsersInGroups()
- commit()
Commit the accumulated changes to the CS server
- commitChanges(sortUsers=True)
- copySection(originalPath, targetPath)
Copy a whole section to a new location
- createSection(sectionPath, comment='')
Create a new section
- delOption(optionPath)
Delete an option
- delSection(sectionPath)
Delete a section
- deleteUsers(users)
Delete a user/s can receive as a param either a string or a list
- Parameters:
users (list) – users
- Returns:
S_OK(bool)/S_ERROR()
- describeGroups(mask=None)
List all groups that are in the mask (or all if no mask) with their properties
- describeHosts(hosts=None)
describe hosts
- Parameters:
users (list) – list of users’ nicknames
- Returns:
a S_OK(description) of the users in input
- describeUsers(users=None)
describe users by nickname
- Parameters:
users (list) – list of users’ nicknames
- Returns:
a S_OK(description) of the users in input
- downloadCSData()
Download CS data
- Returns:
S_OK()/S_ERROR()
- forceGlobalConfigurationUpdate()
Force global update of configuration on all the registered services
- Returns:
S_OK/S_ERROR
- getCurrentCFG()
Get the current CFG as it is
- initialize()
API initialization
- Returns:
S_OK()/S_ERROR()
- listGroups()
List all groups
- listHosts()
List hosts
- Returns:
S_OK(list)/S_ERROR()
- listUsers(group=False)
List users
- Parameters:
group (str) – group name
- Returns:
S_OK(list)/S_ERROR()
- mergeCFGUnderSection(sectionPath, cfg)
Merge the given cfg under a certain section
- mergeFromCFG(cfg)
Merge the internal CFG data with the input
- mergeWithCFG(cfg)
Merge the given cfg with the current config
- modifyGroup(groupname, properties, createIfNonExistant=False)
Modify a group
- modifyHost(hostname, properties, createIfNonExistant=False)
Modify a host
- modifyUser(username, properties, createIfNonExistant=False)
Modify a user
- modifyValue(optionPath, newValue)
Modify an existing value at the specified options path.
- moveSection(originalPath, targetPath)
Move a whole section to a new location
- setOption(optionPath, optionValue)
Create an option at the specified path.
- setOptionComment(optionPath, comment)
Create an option at the specified path.
- showDiff()
Just shows the differences accumulated within the Modificator object
- sortUsersAndGroups()
- syncUsersWithCFG(usersCFG)
Sync users with the cfg contents. Usernames have to be sections containing DN, Groups, and extra properties as parameters