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 message IKJ56702I INVALID GROUP, <group> in the messages 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 the GroupAdmin.generate_requests_only class attribute is set to True.

❌ Raises

  • SecurityRequestError
    Raises SecurityRequestError when the SAF Return Code of a Security Result is equal to 4.
  • DownstreamFatalError
    Raises DownstreamFatalError when the SAF Return Code of a Security Result is greater than 4.

💻 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"
  }
}