eimChangeRegistry()--Change EIM Registry


  Syntax
 #include <eim.h>

 int eimChangeRegistry(EimHandle            * eim,
                       char                 * registryName,
                       enum EimRegistryAttr   attrName,
                       char                 * attrValue,
                       enum EimChangeType     changeType,
                       EimRC                * eimrc)
 
  Service Program Name: QSYS/QSYEIM  

  Default Public Authority: *USE

  Threadsafe: Yes

The eimChangeRegistry() function changes the attribute of a registry participating in the EIM domain.


Authorities and Locks

EIM Data
Access to EIM data is controlled by EIM access groups. LDAP administrators also have access to EIM data. The access groups whose members have authority to the EIM data for this API follow:

Parameters

eim  (Input)
The EIM handle returned by a previous call to eimCreateHandle(). A valid connection is required for this function.

registryName  (Input)
The name of the registry to change.

attrName  (Input)
The attribute to be updated. Valid values are:

EIM_REGISTRY_DESCRIPTION (0) Change the registry description. Valid changeType is EIM_CHG (0).
EIM_REGISTRY_LABELEDURI (1) Change the URI for the system registry. Valid changeType is EIM_CHG (0).
EIM_REGISTRY_MAPPING_LOOKUP (2) Change the indicator for whether or not the registry supports any mapping lookup operations. By default, the mapping lookup operations are supported. Valid changeType is EIM_ENABLE (3) or EIM_DISABLE (4). This attribute is controlled by the version of the API interface, not the domain. If this attribute is disabled for the registry, it will only be checked in a mapping lookup operation if the version of the mapping lookup API that is used to access the domain supports this attribute. EIM version 2 must be supported by the local EIM APIs to specify this attribute (see eimGetVersion()--Get EIM Version).
EIM_REGISTRY_POLICY_ASSOCIATIONS (3) Change the indicator for whether or not the registry supports policy associations in a mapping lookup. By default, the policy associations are not supported. Valid changeType is EIM_ENABLE (3) or EIM_DISABLE (4). This attribute is controlled by the version of the API interface, not the domain. If this attribute is enabled for the registry, it will only be checked in a mapping lookup operation if the version of the mapping lookup API that is used to access the domain supports this attribute. EIM version 2 must be supported by the local EIM APIs to specify this attribute (see eimGetVersion()--Get EIM Version).
EIM_REGISTRY_MEMBER (4) Change the list of registries that are members of this group registry. The registryName parameter must be the name of a registry that has a type of group registry to change this attribute. The registry name specified in the attrValue parameter must exist and cannot have a type of group registry. The normalization method for the group registry must be the same as the normalization method for the member. Valid changeType is EIM_ADD (1) or EIM_RMV (2). EIM version 3 must be supported by the local EIM APIs to specify this attribute (see eimGetVersion()--Get EIM Version).

attrValue  (Input)
The new value for the attribute.

If the attribute being changed is EIM_REGISTRY_MAPPING_LOOKUP or EIM_REGISTRY_POLICY_ASSOCIATIONS, this value must be NULL.

changeType  (Input)
The type of change to make. This could be add, remove, change, enable, or disable.   attrName parameter indicates which type is allowed for each attribute.

eimrc  (Input/Output)
The structure in which to return error code information. If the return value is not 0, eimrc is set with additional information. This parameter may be NULL. For the format of the structure, see EimRC--EIM Return Code Parameter.

Return Value

The return value from the API. Following each return value is the list of possible values for the messageCatalogMessageID field in the eimrc parameter for that value.

0
Request was successful.

EACCES
Access denied. Not enough permissions to access data.

EIMERR_ACCESS (1) Insufficient access to EIM data.

EBADDATA
eimrc is not valid.

EBADNAME
Registry not found or insufficient access to EIM data.

EIMERR_NOREG (28) EIM Registry not found or insufficient access to EIM data.

EBUSY
Unable to allocate internal system object.

EIMERR_NOLOCK (26) Unable to allocate internal system object.

ECONVERT
Data conversion error.

EIMERR_DATA_CONVERSION (13) Error occurred when converting data between code pages.

EINVAL
Input parameter was not valid.

EIMERR_ATTR_INVAL (5) Attribute name is not valid.
EIMERR_CHGTYPE_INVAL (9) This change type is not valid with the requested attribute. Please check the API documentation.
EIMERR_HANDLE_INVAL (17) EimHandle is not valid.
EIMERR_PARM_REQ (34) Missing required parameter. Please check API documentation.
EIMERR_PTR_INVAL (35) Pointer parameter is not valid.
EIMERR_REGTYPE_INVAL (62) Registry type is not valid.
EIMERR_FUNCTION_NOT_SUPPORTED (70) The specified function is not supported by the EIM version.

ENOMEM
Unable to allocate required space.

EIMERR_NOMEM (27) No memory available. Unable to allocate required space.

ENOTCONN
LDAP connection has not been made.

EIMERR_NOT_CONN (31) Not connected to LDAP. Use eimConnect() API and try the request again.

EROFS
LDAP connection is for read only. Need to connect to master.

EIMERR_READ_ONLY (36) LDAP connection is for read only. Use eimConnectToMaster() to get a write connection.

EUNKNOWN
Unexpected exception.

EIMERR_LDAP_ERR (23) Unexpected LDAP error. %s
EIMERR_UNKNOWN (44) Unknown error or unknown system state.

Related Information


Example

The following example changes the description for the registry and enables the use of policy associations for the registry.

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

#include <eim.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
    int           rc;
    char          eimerr[100];
    EimRC       * err;
    EimHandle   * handle;

    /* Get eim handle from input arg.           */
    /* This handle is already connected to EIM. */
    handle = (EimHandle *)argv[1];

    /* Set up error structure.                 */
    memset(eimerr,0x00,100);
    err = (EimRC *)eimerr;
    err->memoryProvidedByCaller = 100;

    /* Change the description for this registry */
    if (0 != (rc = eimChangeRegistry(handle,
                                     "MyAppRegistry",
                                     EIM_REGISTRY_DESCRIPTION,
                                     "New description",
                                     EIM_CHG,
                                     err)))
        printf("Change registry error = %d", rc);

    /* Enable the use of default registry policies. */
    if (0 != (rc = eimChangeRegistry(handle,
                                     "MyAppRegistry",
                                     EIM_REGISTRY_POLICY_ASSOCIATIONS,
                                     NULL,
                                     EIM_ENABLE,
                                     err)))
        printf("Change registry error = %d", rc);

    return 0;
}


API introduced: V5R2

[ Back to top | Security APIs | APIs by category ]