Delete
Delete a group.
GroupAdmin.delete()
def delete(self, group: str) -> Union[dict, bytes]:
📄 Description
Note that in order to delete a group, you must remove all subgroups, user connections, and group data sets from it. Failure to do so will result in a
SecurityRequestError
that contains a Security Result dictionary that will contain the messageIKJ56702I INVALID GROUP, <group>
in themessages
list.
Delete a group.
📥 Parameters
group
The group to delete.
📤 Returns
Union[dict, bytes]
Returns a Security Result dictionary or Security Request XML bytes if theGroupAdmin.generate_requests_only
class attribute is set toTrue
.
❌ Raises
SecurityRequestError
RaisesSecurityRequestError
when the SAF Return Code of a Security Result is equal to4
.DownstreamFatalError
RaisesDownstreamFatalError
when the SAF Return Code of a Security Result is greater than4
.
💻 Example
Python REPL
>>> from pyracf import GroupAdmin
>>> group_admin = GroupAdmin()
>>> group_admin.delete("testgrp0")
{'securityResult': {'group': {'name': 'TESTGRP0', 'operation': 'del', 'requestId': 'GroupRequest', 'commands': [{'safReturnCode': 0, 'returnCode': 0, 'reasonCode': 0, 'image': 'DELGROUP TESTGRP0'}]}, 'returnCode': 0, 'reasonCode': 0, 'runningUserid': 'testuser'}}
Security Result Dictionary as JSON
{
"securityResult": {
"group": {
"name": "TESTGRP0",
"operation": "del",
"requestId": "GroupRequest",
"commands": [
{
"safReturnCode": 0,
"returnCode": 0,
"reasonCode": 0,
"image": "DELGROUP TESTGRP0"
}
]
},
"returnCode": 0,
"reasonCode": 0,
"runningUserid": "testuser"
}
}