Connect
Create or change a group connection.
ConnectionAdmin.connect()
def connect(self, userid: str, group: str, traits: dict = {}) -> Union[dict, bytes]:
📄 Description
Only a subset of available Traits are considered Stable. See 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.
Create or change a group connection.
📥 Parameters
userid
The z/OS userid of the user whose connection to the specified group is being created or changed.-
group
The group to which the user’s connection is being created or changed. traits
A dictionary of traits/attributes that will be connected for the specified user’s connection to the specifed group. See Traits to see what all of the valid Group Connection Traits are.
📤 Returns
Union[dict, bytes]
Returns a Security Result dictionary or Security Request XML bytes if theConnectionAdmin.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.SegmentTraitError
RaisesSegmentTraitErrorwhen the dictionary of traits/attributes provided contains one or more unknown traits.
💻 Example
The following example connects an existing group connection where the connection of z/OS userid squidwrd to group testgrp0 will be connected with the traits/attributes defined in the traits dictionary.
Python Script
from pyracf import ConnectionAdmin
connection_admin = ConnectionAdmin()
traits = {
"base:auditor": False,
"base:operations": False,
"base:special": True
}
connection_admin.connect("squidwrd", "testgrp0", traits=traits)
Security Result Dictionary as JSON
{
"securityResult": {
"groupConnection": {
"name": "SQUIDWRD",
"group": "TESTGRP0",
"operation": "set",
"requestId": "ConnectionRequest",
"commands": [
{
"safReturnCode": 0,
"returnCode": 0,
"reasonCode": 0,
"image": "CONNECT SQUIDWRD GROUP (TESTGRP0) NOAUDITOR NOOPERATIONS SPECIAL "
}
]
},
"returnCode": 0,
"reasonCode": 0,
"runningUserid": "testuser"
}
}