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.PRECHECKin theXFACILITclass 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 theGroupAdmin.generate_requests_onlyclass attribute is set toTrue.
❌ Raises
SecurityRequestError
RaisesSecurityRequestErrorwhen the SAF Return Code of a Security Result is equal to4.DownstreamFatalError
RaisesDownstreamFatalErrorwhen the SAF Return Code of a Security Result is greater than4.AlterOperationError
RaisesAlterOperationErrorwhen the group cannot be altered because it does NOT exist.SegmentTraitError
RaisesSegmentTraitErrorwhen 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"
}
}