Statistics Classes
Setropts Administration functions for modifying if a class has the Statistics attribute.
SetroptsAdmin.add_statistics_classes()
def add_statistics_classes(self, class_names: Union[str, List[str]]) -> Union[dict, bytes]:
📄 Description
Add a class to the list of classes that RACF will collect Statistics for.
📥 Parameters
class_name
The name of the class to add the statistics attribute to.
📤 Returns
Union[dict, bytes]
Returns a Security Result Steps dictionary or Concatenated Security Request XML bytes if theSetroptsAdmin.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
.
💻 Example
Python REPL
>>> from pyracf import SetroptsAdmin
>>> setropts_admin = SetroptsAdmin()
>>> setropts_admin.add_statistics_classes("ELIJTEST")
{'step1': {'securityResult': {'systemSettings': {'operation': 'set', 'requestId': 'SetroptsRequest', 'commands': [{'safReturnCode': 0, 'returnCode': 0, 'reasonCode': 0, 'image': 'SETROPTS STATISTICS (ELIJTEST)'}]}, 'returnCode': 0, 'reasonCode': 0, 'runningUserid': 'testuser'}}}
Security Result Steps Dictionary as JSON
{
"step1":{
"securityResult":{
"systemSettings":{
"operation":"set",
"requestId":"SetroptsRequest",
"commands":[
{
"safReturnCode":0,
"returnCode":0,
"reasonCode":0,
"image":"SETROPTS STATISTICS (ELIJTEST)"
}
]
},
"returnCode":0,
"reasonCode":0
}
}
}
SetroptsAdmin.remove_statistics_classes()
def remove_statistics_classes(self, class_names: Union[str, List[str]]) -> Union[dict, bytes]:
📄 Description
Remove a class from the list of classes that RACF will collect Statistics for.
📥 Parameters
class_name
The name of the class to remove the statistics attribute from.
📤 Returns
Union[dict, bytes]
Returns a Security Result Steps dictionary or Concatenated Security Request XML bytes if theSetroptsAdmin.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
.
💻 Example
Python REPL
>>> from pyracf import SetroptsAdmin
>>> setropts_admin = SetroptsAdmin()
>>> setropts_admin.remove_statistics_classes("ELIJTEST")
{'step1': {'securityResult': {'systemSettings': {'operation': 'set', 'requestId': 'SetroptsRequest', 'commands': [{'safReturnCode': 0, 'returnCode': 0, 'reasonCode': 0, 'image': 'SETROPTS NOSTATISTICS (ELIJTEST)'}]}, 'returnCode': 0, 'reasonCode': 0, 'runningUserid': 'testuser'}}}
Security Result Steps Dictionary as JSON
{
"step1":{
"securityResult":{
"systemSettings":{
"operation":"set",
"requestId":"SetroptsRequest",
"commands":[
{
"safReturnCode":0,
"returnCode":0,
"reasonCode":0,
"image":"SETROPTS NOSTATISTICS (ELIJTEST)"
}
]
},
"returnCode":0,
"reasonCode":0
}
}
}