Skip to content

Instantly share code, notes, and snippets.

View raj-arun's full-sized avatar
🎶
Focusing

Arun Raj raj-arun

🎶
Focusing
View GitHub Profile
@raj-arun
raj-arun / migrationversion.py
Created March 12, 2019 22:19
Oracle EPM Migration Version
def get_migration_api_version():
'''
Get the latest migration api version
Input: None
Output: migration api version
'''
try:
response = requests.get(migration_url,auth=HTTPBasicAuth(uname,password),headers = headers)
if response.status_code == 200:
version_data = json.loads(response.text)
@raj-arun
raj-arun / planversion.py
Last active March 12, 2019 22:26
Oracle EPM Planning API Version
def get_planning_api_version():
'''
Get the latest planning api version
Input: None
Output: planning api version
'''
try:
response = requests.get(planning_url,auth=HTTPBasicAuth(uname,password),headers = headers)
if response.status_code == 200:
version_data = json.loads(response.text)
@raj-arun
raj-arun / applicationname.py
Created March 12, 2019 22:49
Get Planning Application Name
def get_application_details():
'''
Get the Application Name from the instance
Input: None
Output: application name
'''
try:
response = requests.get(rest_end_point,auth=HTTPBasicAuth(uname,password),headers = headers)
if response.status_code == 200:
json_data = json.loads(response.text)
@raj-arun
raj-arun / request.xml
Created April 30, 2019 02:05
SOAP Payload
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://xmlns.oracle.com/oxp/service/v2">
<soapenv:Body>
<v2:runReport>
<v2:reportRequest>
<v2:attributeLocale>en-US</v2:attributeLocale>
<v2:flattenXML>false</v2:flattenXML>
<v2:reportAbsolutePath>/Custom/Integrations/EPM/HCM/Report/Position Details Report.xdo</v2:reportAbsolutePath>
<v2:sizeOfDataChunkDownload>-1</v2:sizeOfDataChunkDownload>
</v2:reportRequest>
<v2:userID>araj</v2:userID>
@raj-arun
raj-arun / decode_base64.ps1
Created April 30, 2019 02:19
Decode the base64 file
[xml]$hcmdata = Get-Content output.xml
$sEncodedString = $hcmdata.Envelope.Body.runReportResponse.runReportReturn.reportBytes
$sDecodedString=[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($sEncodedString))
$sDecodedString | Out-File Positions.csv
@raj-arun
raj-arun / Invoke_bi_report.ps1
Last active May 9, 2019 23:26
Invoke BI Web Service
[Net.ServicePointManager]::SecurityProtocol = "tls12"
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add('SOAPAction','')
Invoke-WebRequest https://<url to oracle cloud>.oraclecloud.com/xmlpserver/services/v2/ReportService?wsdl `
-Method Post -ContentType "text/xml;charset=utf-8" -Headers $headers `
-InFile request.xml -OutFile output.xml
@raj-arun
raj-arun / encrypt_credentals.ps1
Last active July 18, 2019 15:33
Encrypt Username and Password
#Read user name , password and wsdl endpoint
$loginData = Get-Content -Raw -Path 'loginDetails.json' | ConvertFrom-Json
#Encrypt the username and password
$pair="$($loginData.biuser):$($loginData.bipwd)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"
#Create the header for Web Service Request
[Net.ServicePointManager]::SecurityProtocol = "tls12"
@raj-arun
raj-arun / invoke_report.ps1
Created July 18, 2019 15:36
Invoke the BI Report
#Invoke BI Report
Invoke-WebRequest $loginData.wsdl `
-Method Post -ContentType "application/soap+xml;charset=utf-8" `
-Headers $headers -InFile EPM_Account_Hierarchy.xml -OutFile output.xml
@raj-arun
raj-arun / decode_generate_csv.ps1
Last active July 18, 2019 15:42
Decodes base64 response and generate csv file
#Decode and Generate CSV File
[xml]$report = Get-Content output.xml
$EncodedString = $report.Envelope.Body.runReportResponse.runReportReturn.reportBytes
$DecodedString = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($EncodedString))
$DecodedString | Out-File "temp.txt"
Import-CSV "temp.txt" -delimiter "," | Export-CSV EPM_Account_Metadata.csv -NoType
@raj-arun
raj-arun / EPM_Account_Hierarchy.xml
Last active July 18, 2019 15:54
SOAP Payload for BI Report
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:pub="http://xmlns.oracle.com/oxp/service/PublicReportService">
<soap:Header/>
<soap:Body>
<pub:runReport>
<pub:reportRequest>
<pub:parameterNameValues>
<pub:item>
<pub:name>P_VERSION_NAME</pub:name>
<pub:values>
<pub:item>ACCOUNT_V1</pub:item>