Thursday, August 6, 2020

API Basics

API Basics    :

# Java Docs (C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\idenityiq\doc\javadoc\index.html)    
(OR)

# Sailpoint Context
# Finding Objects
# Identity Objects
# Account Object (Link)
# Roles (Bundles)

SailPoint Context    :

# Available to all rules and workflow steps
# Can be used to find current logged in user - getUserName()
# Retrieve, Count and Search for Sailpoint Objects
  •  getObjectById(), getObjectByName(), getObject(), getObjects()
  • countObjects()
  • search()
# Remove (Delete) SailPoint Objects
  • removeObject(), removeObjects()
Finding Objects    :
  • getObjectByName(java.lang.Class<T> cls, java.lang.String name)
  • getObject(java.lang.Class<T> cls, java.lang.String idOrName)
  • getObjectById(java.lang.Class<T> cls, java.lang.String id)
  • getObjects(java.lang.Class<T> cls, QueryOptions ops)
Examples    :

Identity user = context.getObjectByName(Identity.class, strIdentityName);
Application app = context.getObjectById(Application.class, strAppId);
nPopsize = ctx.getObjectByName(Groupindex.class, "My Test Population").getMemberCount();

Interacting with Identities    :

Identity identity = context.getObjectByName(Identity.class,"David.Nicholas");
System.out.println("Email : " + identity.getEmail());
System.out.println("Status : " + identity.getAttribute("status"));
System.out.println("Location : " + identity.getattribute("location"));
System.out.println("Region : " + identity.getAttribute("region"));

Listing Accounts    :

List links =(List) identity.getLinks();

if (null != links){
Iterator linkIterator = links.iterator();

while(linkIterator.hasNext()){
Link account = (Link) linkIterator.next();
System.ou.println("Application Name : "+account.getApplicationName()+": Account Name : " + account.getDisplayableName());
}
}

Listing Assigned Roles    :

List bundles = (List) identity.getAssignedRoles();

if (null != bundles){
Iterator bundleIterator = bundles.Iterator();

while(bundleIterator.hasNext()){
Bundle role = (Bundle) bundleItearator.next();
System.out.println("Role Name : " +role.getFullName())+"; role type :"+role.getType());
}
}





No comments:

Post a Comment

Fetch Members from Workgroup

  import java.util.ArrayList;   import java.util.Iterator;   import java.util.List;   import sailpoint.api.ObjectUtil;   import sailpoint.ob...