Alter

Alter an existing group.

GroupAdmin.alter()

def alter(self, group: str, traits: dict) -> Union[dict, bytes]:

📄 Description

 

Only a subset of available Segments and Traits are considered Stable. See Segments and Traits for more details.

 

Alter operations in pyracf require READ access to IRR.IRRSMO00.PRECHECK in the XFACILIT class This function will not produce output unless the user running the command has this access.

 

Alter an existing group.

📥 Parameters

  • group
    The group being altered.

  • traits
    A dictionary of traits/attributes that should be altered. See Traits to see what all of the valid Group Traits are.

📤 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.
  • AlterOperationError
    Raises AlterOperationError when the group cannot be altered because it does NOT exist.
  • SegmentTraitError
    Raises SegmentTraitError when the dictionary of traits/attributes provided contains one or more unknown traits.

💻 Example

The following example alters a group called testgrp0 with traits/attributes to alter specified in the traits dictionary.

Python Script
from pyracf import GroupAdmin
group_admin = GroupAdmin()

traits = {
    "omvs:gid": 2048,
    "ovm:gid": 256,
}

group_admin.alter("testgrp0", traits=traits)
Security Result Dictionary as JSON
{
  "securityResult": {
    "group": {
      "name": "TESTGRP0",
      "operation": "set",
      "requestId": "GroupRequest",
      "info": [
        "Definition exists. Add command skipped due  to precheck option"
      ],
      "commands": [
        {
          "safReturnCode": 0,
          "returnCode": 0,
          "reasonCode": 0,
          "image": "ALTGROUP TESTGRP0  OMVS     (GID         (2048)) OVM      (GID         (256))"
        }
      ]
    },
    "returnCode": 0,
    "reasonCode": 0,
    "runningUserid": "testuser"
  }
}