(LOGO.JPG) Python for OpenVMS

(go to: table of contents, index, list of vms_sys, prev: SETUAI, next: SET_SECURITY)


SET_RESOUCE_DOMAIN - Set Resource Domain


Controls the association between a calling process and resource domains.

Format:

    status, rsdm_id = vms_sys.set_resource_domain (func, rsdm_id,
                      domain_number, [nullarg], [access], [acmode])
Returns:
status
condition value that is returned by SYS$SET_RESOURCE_DOMAIN().
rsdm_id
Resource domain identification. It is always returned, but valid only when using RSDM__JOIN_DOMAIN.
Arguments:
func
Function code specifying which action SYS$SET_RESOURCE_DOMAIN should perform. Codes like RSDM__JOIN_DOMAIN are available in module 'vms_rsdmdef'.
rsdm_id
Resource domain identification. It must always be specified, but is only required when using RSDM__LEAVE.
domain_number
Domain number that identifies the resource domain - Python integer.
nullarg
Placeholder argument - specify None.
access
Access type - bitmasks like RSDM_M_READ are available in module 'vms_rsdmdef'.
acmode
Not usable - specify None.
Examples:
>>> import vms_sys
>>> import vms_rsdmdef

>>> status, rsdm_id = vms_sys.set_resource_domain ( \
...                   vms_rsdmdef.RSDM__JOIN_DOMAIN, \
...                   0, 5, None, vms_rsdmdef.RSDM_M_LOCK)
>>> print (status, rsdm_id)
(1, 131074)
>>> print vms_sys.getmsg (status) [0]
%SYSTEM-S-NORMAL, normal successful completion
>>>


>>> import vms_lckdef
>>> l_lkmode = vms_lckdef.LCK_K_NLMODE
>>> # Note: LKSB will be created automatically -v
>>> dict     = vms_sys.enqw (None, l_lkmode, None, None,
...                          'PY_RESNAM', None, None,
...                          None, None, None, rsdm_id)
>>> for key in dict.keys():
...   print key, '=', dict.get(key)
... #-for
...
lksb = <vmsobj_lksb, LKSB at 0x00285718>
status = 1        <-- from SYS$ENQW()
>>>
>>> # check status inside LKSB
>>> r_lksb   = dict.get ('lksb')
>>> w_status = r_lksb.W_STATUS
>>> print vms_sys.getmsg (w_status) [0]
%SYSTEM-S-NORMAL, normal successful completion
>>>


>>> status, rsdm_xx = vms_sys.set_resource_domain ( \
...                   vms_rsdmdef.RSDM__LEAVE,      \
...                   rsdm_id, 5, None, None)
>>> print (status, rsdm_xx)
(3834, 131074)
>>> print vms_sys.getmsg (status) [0]
%SYSTEM-E-RSDM_ACTIVE, resource domain active
>>>

(go to: table of contents, index, list of vms_sys, prev: SETUAI, next: SET_SECURITY)

18-JUL-1999 ZE.