z/OS Unix System Services GID
Group Administration functions for accessing and modifying a group’s z/OS Unix System Services GID.
GroupAdmin.get_omvs_gid()
def get_omvs_gid(self, group: str) -> Union[int, None, bytes]:
📄 Description
Get a group’s z/OS Unix System Services GID.
📥 Parameters
group
The group whose z/OS Unix System Services GID is being requested.
📤 Returns
Union[int, None, bytes]
Returns the group’s z/OS Unix System Services GID orNone
if the group does not have an OMVS segment. If theGroupAdmin.generate_requests_only
class attribute is set toTrue
, concatenated Security Request XML bytes will be returned.
❌ 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.get_omvs_gid("testgrp0")
3434
GroupAdmin.set_omvs_gid()
def set_omvs_uid(self, group: str, gid: int) -> Union[dict, bytes]:
📄 Description
Change a group’s z/OS Unix System Services GID.
📥 Parameters
-
group
The group whose z/OS Unix System Services GID is being changed. -
gid
The z/OS Unix System Services GID to set for the specified group.
📤 Returns
Union[dict, bytes]
Returns a Security Result Steps dictionary or Concatenated 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
.AlterOperationError
RaisesAlterOperationError
when the group cannot be altered because it does NOT exist.
💻 Example
Python REPL
>>> from pyracf import GroupAdmin
>>> group_admin = GroupAdmin()
>>> group_admin.set_omvs_gid("testgrp0", 4545)
{'step1': {'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 (4545))'}]}, 'returnCode': 0, 'reasonCode': 0, 'runningUserid': 'testuser'}}}
Security Result Steps Dictionary as JSON
{
"step1": {
"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 (4545))"
}
]
},
"returnCode": 0,
"reasonCode": 0
}
}
}