eimDeleteDomain()--Delete an EIM Domain Object


  Syntax
 #include <eim.h>

 int eimDeleteDomain(char           * ldapURL,
                     EimConnectInfo   connectInfo,
         EimRC          * eimrc)
 
  Service Program Name: QSYS/QSYEIM

  Default Public Authority: *USE

  Threadsafe: Yes

The eimDeleteDomain() function deletes the EIM domain information. If there are any registries or identifiers in the domain then it cannot be deleted.


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:
  • EIM Administrator

Parameters

ldapURL  (Input)
A uniform resource locator (URL) that contains the EIM host information. This URL has the following format:
    ldap://host:port/dn
          or
    ldaps://host:port/dn

where:

  • host:port is the name of the host on which the EIM domain controller is running with an optional port number.
  • dn is the distinguished name of the domain to delete.
  • ldaps indicates that this host/port combination uses SSL and TLS.

Examples:

  • ldap://systemx:389/ibm-eimDomainName=myEimDomain,o=myCompany,c=us
  • ldaps://systemy:636/ibm-eimDomainName=thisEimDomain

connectInfo  (Input)
Connect information. EIM uses ldap. This parameter provides the information required to bind to ldap. This parameter is passed by value.

If the system is configured to connect to a secure port, EimSSLInfo is required.

For EIM_SIMPLE connect type, the creds field should contain the EimSimpleConnectInfo structure with a binddn and password. EimPasswordProtect is used to determine the level of password protection on the ldap bind.

For EIM_KERBEROS, the default logon credentials are used. The kerberos creds field must be NULL.

For EIM_CLIENT_AUTHENTICATION, the creds field is ignored. EimSSLInfo must be provided.

The structure layouts follow:

   enum EimPasswordProtect {
       EIM_PROTECT_NO,              
       EIM_PROTECT_CRAM_MD5,
       EIM_PROTECT_CRAM_MD5_OPTIONAL
   };
   enum EimConnectType {
       EIM_SIMPLE,
       EIM_KERBEROS,
       EIM_CLIENT_AUTHENTICATION
   };

   typedef struct EimSimpleConnectInfo 
   {
        enum EimPasswordProtect protect;
        char * bindDn;
        char * bindPw;
   } EimSimpleConnectInfo;

   typedef struct EimSSLInfo 
   {
        char * keyring;
        char * keyring_pw;
        char * certificateLabel;
   } EimSSLInfo; 

   typedef struct EimConnectInfo
   {
        enum EimConnectType type;
        union {
            gss_cred_id_t * kerberos;
            EimSimpleConnectInfo simpleCreds;
        } creds;
      EimSSLInfo * ssl;
   } EimConnectInfo;      
eimrc  (Input/Output)
The structure in which to return error code information. If the return value is not 0, eimrc will be 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.


EBADDATA
eimrc is not valid.

EBADNAME
EIM domain not found or insufficient access to EIM data.



ECONVERT
Data conversion error.


EINVAL
Input parameter was not valid.


ENOMEM
Unable to allocate required space.


ENOTSAFE
Not safe to delete domain.


ENOTSUP
Connection type is not supported.


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


EUNKNOWN
Unexpected exception.


Related Information


Example

The following example deletes the specified EIM domain information.

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

#include <eim.h>

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

    
    char * ldapURL = "ldap://eimsystem:389/ibm-eimDomainName=myEimDomain,o=mycompany,c=us";
    
    EimConnectInfo con;
    
    /* Set up connection information           */
    con.type = EIM_SIMPLE;
    con.creds.simpleCreds.protect = EIM_PROTECT_NO;
    con.creds.simpleCreds.bindDn = "cn=admin";
    con.creds.simpleCreds.bindPw = "secret";
    con.ssl = NULL;

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

    
    /* Delete this domain                      */
    if (0 != (rc = eimDeleteDomain(ldapURL,
                                   con,
                                   err)))
        printf("Delete domain error = %d", rc);

    return 0;
}


API introduced: V5R2

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