(LOGO.JPG) Python for OpenVMS

(go to: table of contents, index, list of vms_sys, prev: ADD_HOLDER, next: ADD_PROXY)


ADD_IDENT - Add Identifier to Rights Database


Adds the specified identifier to the rights database.


Format:

    resid = vms_sys.add_ident (name [,id] [,attrib])
Returns:
resid
Identifier value assigned by the system.
Arguments:
name
Identifier name to be added to the rights database.
id
Identifier to be created. If the id argument is omitted or 'None', ADD_IDENT selects a unique available value from the general identifier space and returns it in 'resid' (resid is always returned by the Python function).
attrib
Attributes to be placed in the identifier's record. Bitmask values are defined in module 'vms_kgbdef'.
Examples:
>>> import vms_sys

>>> vms_sys.add_ident ('NEW_ID_1')
-2147418093
>>> hex (-2147418093)
'0x80010013'
>>>

UAF> show /identifier /full NEW_ID_1
  Name                             Value           Attributes
  NEW_ID_1                         %X80010013
UAF>


>>> import vms_kgbdef
>>> attrib = vms_kgbdef.KGB_M_DYNAMIC
>>> resid  = vms_sys.add_ident ('NEW_ID_2', 0x80010014, attrib)
>>> hex (resid)
'0x80010014'
>>>

UAF> show /identifier /full NEW_ID_2
  Name                             Value           Attributes
  NEW_ID_2                         %X80010014      DYNAMIC
UAF>


>>> vms_sys.add_ident ('x23456789012345678901234567890123')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (8740, '%SYSTEM-F-IVIDENT, invalid identifier format')
>>> # name is too long

>>> vms_sys.add_ident ('X%X')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (8740, '%SYSTEM-F-IVIDENT, invalid identifier format')
>>> # bad character in name

>>> vms_sys.add_ident ('NEW_ID_2', None, None)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (148, '%SYSTEM-F-DUPLNAM, duplicate name')
>>> # name already exists

>>> vms_sys.add_ident ('NEW_ID_2X', 0x80010014)
Traceback (innermost last):
  File "<stdin>", line 1, in ?
vms_sys.error: (8748, '%SYSTEM-F-DUPIDENT, duplicate identifier')
>>> # identifier value (0x80010014) already in use

>>> vms_sys.add_ident ('NEW_ID_2X', 'BAD-PARAM')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 2: id - must be integer or None
>>>

>>> vms_sys.add_ident ('NEW_ID_2X', None, 'BAD-PARAM')
Traceback (innermost last):
  File "<stdin>", line 1, in ?
TypeError: argument 3: attrib - must be integer or None
>>>

(go to: table of contents, index, list of vms_sys, prev: ADD_HOLDER, next: ADD_PROXY)

27-SEP-1998 ZE.