[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: PAS - Pick up new r-code

  • Thread starter Thread starter dbeavon
  • Start date Start date
Status
Not open for further replies.
D

dbeavon

Guest
Thanks for the tip Irfan. Sounds like the MS-agent process is able to replace its code after all. That is good to know. Can you point me to a REST equivalent? (link: OpenEdge 11.7 Documentation ) I typically use the "-q" option on my ABL sessions which may be inflexible about detecting changes in r-code. So I went ahead and wrote a powershell script for that case: $agent= $null $response = $null $response2 = $null # Store credentials $pass="tomcat" | ConvertTo-SecureString -AsPlainText -Force $cred = New-Object System.Management.Automation.PsCredential('tomcat',$pass) # Retrieve available agents $response = Invoke-RestMethod -Uri hhhp:/xyz.com:8815/oemanager/applications/abl_application/agents -Credential $cred # Parse out the results into JSON $jsonstring = ConvertTo-Json -InputObject $response -Depth 3 $json = ConvertFrom-Json -InputObject $jsonstring # Retrieve an available agent $agent = $json.result.agents | Where-Object -Property 'state' -EQ 'AVAILABLE' # delete the agent $response2 = Invoke-RestMethod -Method Delete -Uri ('hhhp:/xyz.com:8815/oemanager/applications/abl_application/agents/' + $agent.agentId) -Credential $cred -ContentType "application/vnd.progress+json" # Display summary Write-Output "Delete operation was sent to oemanager REST URI" Write-Output ("Deleted ID : " + $agent.agentId + " - " + $response2.outcome + " " + $response2.result ) Hope this saves someone else a bit of time.

Continue reading...
 
Status
Not open for further replies.
Back
Top