Building AIMWebService API Call "Framework"
Class created as "framework" to perform CyberArk AIMWebService API Calls. This framework allows creating multiple objects, which in turn allows retrieving multiple accounts.
Developed by Jorge Berrios - Contact information: [email protected], [email protected]
Usage:
- Create instance: CyberarkAIM() - It can received values for AppID, Safe, Object and CyberArk DNS Name as arguments.
- Set AppID values: assign the string value to the public attribute appID from the newly created CyberAIM Object.
- Set Safe values: assign the string value to the public attribute safe from the newly created CyberAIM Object.
- Set Object values: assign the string value to the public attribute actName from the newly created CyberAIM Object.
- Set CyberArk DNS name: assign the string value to the public method setHost from the newly created CyberAIM Object.
Retrieving values through get methods:
- getHost: Returns the host or DNS name of CyberArk IF set.
- getaimURL: Returns the composed CyberArk AIMWebService URL
- getaimData: calls the private method responsible for the API call, and returns the value from the local attribute
- getUsername: returns the json key value of UserName
- getPassword: returns the json key value of Content
- getAddress: returns the json key value of Address
- getCPMStatus: returns the json key value of CPMStatus
- getCPMDisabled: returns a boolean to say if the account management is disabled.
- getCPMDisabledReason: returns the json key value of CPMDisabled IF it exists
- getLastSuccessChange: returns the datetime format of json key value of LastSuccessChange
- getNextChange: returns the next possible password change based on the typical 30 day policy.
- getLastSuccessChangeTS: returns the timestamp ISO format of json key value of LastSuccessChange
- getLastSuccessReconciliation: returns the datetime format of json key value of LastSuccessReconciliation
- getLastSuccessReconciliationTS: returns the timestamp ISO format of json key value of LastSuccessReconciliation
- getLastSuccessVerification: returns the datetime format of json key value of LastSuccessVerification
- getNextVerification: returns the next possible password verification based on the typical 7 day policy.
- getLastSuccessVerificationTS: returns the timestamp ISO format of json key value of LastSuccessVerificationTS
- getLastTask: returns the json key value of LastTask
- getPasswordChangeInProcess: returns the json key value of PasswordChangeInProcess
- isAIMError: returns a boolean if the json key ErrorCode exists from an AIMWebService error.
- getAIMError: IF the json key ErrorCode exists, it will print a custom error from the json key value ErrorMsg and exit the program. Similar to raising a custom exception.