Audit Log on Softlayer -
in softlayer portal, java api can retrieve data on audit log view. developing portal page using java client api. if choose 1 of actions in device list, can page below.. if share python sample code, helpful well.
looking feedback.. thank you
mike
please try java example audit log items using softlayer_event_log::getallobjects
import java.util.iterator; import java.util.list; import com.softlayer.api.apiclient; import com.softlayer.api.restapiclient; import com.softlayer.api.resultlimit; import com.softlayer.api.service.event.log; public class getallobjects { public static void main(string[] args) { string username = "set me"; string apikey = "set me"; apiclient client = new restapiclient().withcredentials(username, apikey).withloggingenabled(); com.softlayer.api.service.event.log.service eventlogservice = com.softlayer.api.service.event.log.service(client); eventlogservice.setresultlimit(new resultlimit(0,50)); list<log> = eventlogservice.getallobjects(); iterator<log> iterator = a.iterator(); int idx = 0; while (iterator.hasnext()) { log data = iterator.next(); system.out.println(" data: " + idx); system.out.println(" username: " + data.getusername()); system.out.println(" usertype: " + data.getusertype()); system.out.println(" action: " + data.geteventname()); idx++; } } }
in script added “result limits” in order more items default (amount default displayed= 25 last items).
some references:
http://sldn.softlayer.com/reference/services/softlayer_event_log/getallobjects https://github.com/softlayer/softlayer-java/blob/master/examples/src/main/java/com/softlayer/api/example/pagination.java http://sldn.softlayer.com/article/rest section: using result limits
Comments
Post a Comment