Resume Date
User Administration functions for accessing and modifying a user’s Resume Date.
UserAdmin.get_resume_date()
def get_resume_date(self, userid: str) -> Union[str, None, bytes]:
📄 Description
Get a user’s Resume Date.
📥 Parameters
userid
The z/OS userid of the user whose Resume Date is being requested.
📤 Returns
Union[str, None, bytes]
Returns the user’s Resume Date orNone
if it is not set. If theUserAdmin.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 UserAdmin
>>> user_admin = UserAdmin()
>>> user_admin.get_resume_date("squidwrd")
'11/2/2023'
UserAdmin.set_resume_date()
def set_resume_date(self, userid: str, resume_date: Union[str, bool]) -> Union[dict, bytes]:
📄 Description
Set a user’s Resume Date.
📥 Parameters
-
userid
The z/OS userid of the user whose Resume Date is being set. -
revoke_date
The Resume Date to set for the specified user orFalse
to delete the current value.
📤 Returns
Union[dict, bytes]
Returns a Security Result Steps dictionary or Concatenated Security Request XML bytes if theUserAdmin.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 z/OS userid supplied cannot be altered because it does NOT exist.
💻 Example
Python REPL
>>> from pyracf import UserAdmin
>>> user_admin = UserAdmin()
>>> user_admin.set_resume_date("squidwrd", "11/13/23")
{'step1': {'securityResult': {'user': {'name': 'SQUIDWRD', 'operation': 'set', 'requestId': 'UserRequest', 'info': ['Definition exists. Add command skipped due to precheck option'], 'commands': [{'safReturnCode': 0, 'returnCode': 0, 'reasonCode': 0, 'image': 'ALTUSER SQUIDWRD REVOKE (10/23/23)'}]}, 'returnCode': 0, 'reasonCode': 0, 'runningUserid': 'testuser'}}}
Security Result Steps Dictionary as JSON
{
"step1": {
"securityResult": {
"user": {
"name": "SQUIDWRD",
"operation": "set",
"requestId": "UserRequest",
"info": [
"Definition exists. Add command skipped due to precheck option"
],
"commands": [
{
"safReturnCode": 0,
"returnCode": 0,
"reasonCode": 0,
"image": "ALTUSER SQUIDWRD RESUME (11/13/23)"
}
]
},
"returnCode": 0,
"reasonCode": 0
}
}
}