User story #5795
closedMake Categories API accessible
Description
It's not possible to add a node group without knowing the ID of the category it should be assigned to.
But so far, you cannot query them.
The following hack shows how you currently would need a hardcoded uuid, found from metadata.xml
@
def get_group_cat(group):
cat_name = "CM Testumgebung"
cat_id = "9ab2f05c-8191-4da5-853f-8dcc19d2b5da"
return (cat_name, cat_id)
def create_group_obj(objname,arg_nodes):
if arg_nodes:
print "adding group with nodes"
nodeids = arg_nodes
else:
nodeids = []
print "adding group"
- erstmal fix, spaeter ueber name!
cat_name, cat_id = get_group_cat(objname)
params = {
"nodeGroupCategory": cat_id,
"displayName" : objname,
"description" : "Group %s" % objname,
"dynamic" : 'false',
"nodeIds" : nodeids,
"reason" : "Automatically created in testing",
}
return params
@
When creating new objects, you should be able to
- add categories
- find the category ids to put the objects in the right place.
Jonathan uttered words like
- "LDAP"
- "considered"
- "internal"
Updated by François ARMAND over 9 years ago
- Status changed from New to 8
- Assignee set to François ARMAND
- Target version set to 3.0.0~beta1
Thanks for both reporting and the proposed workaround.
We are going to add missing api call for all categories.
Updated by Florian Heigl over 9 years ago
Hi,
I have looked at this in some more detail.
To make this work:
- the ID needs to be included in the group details when querying a group
- An API call is needed to get categories incl. ID and create them.
I'm dumping them to ldif files using these queries:
ldapsearch -x -D cn=manager,cn=rudder-configuration -w $PW -b "techniqueCategoryId=Active Techniques,ou=Rudder,cn=rudder-configuration" objectClass=techniqueCategory
ldapsearch -x -D cn=manager,cn=rudder-configuration -w $PW -b "groupCategoryId=GroupRoot,ou=Rudder,cn=rudder-configuration" '(&(objectClass=groupCategory)
ldapsearch -x -D cn=manager,cn=rudder-configuration -w $PW -b "ruleCategoryId=rootRuleCategory,ou=Rudder,cn=rudder-configuration" objectClass=ruleCategory(isSystem=FALSE))'
Updated by Florian Heigl over 9 years ago
I'm not sure how much risk is inherited with excluding system groups (or with including them)
So far it appears to work as I described.
Updated by Jonathan CLARKE over 9 years ago
- Target version changed from 3.0.0~beta1 to 3.1.0~beta1
Updated by Vincent MEMBRÉ almost 9 years ago
- Target version changed from 3.1.0~beta1 to 3.1.0~rc1
Updated by Vincent MEMBRÉ almost 9 years ago
- Status changed from New to Rejected
Updated by Vincent MEMBRÉ almost 9 years ago
- Is duplicate of User story #6511: Add an API to manage Rule categories added
Updated by Vincent MEMBRÉ almost 9 years ago
- Is duplicate of User story #6512: Add an API to manage Group categories added