How does a command output can be accessed through UDEPLOY REST API - udeploy

I am using https://host/cli/componentProcessRequest/info/ to get the information about a component process request execution details. But this gives basic information not detailed like logs.
In this process we execute a shell script. I want to get the shell output log through REST API. Is there any way that i can achieve this ?

Related

Download Ansible Tower log output directly to a output file on managed remote server

Could someone please help on "How to download Ansible Tower execution result to a log file on a particular remote server?".
I couldn't find much results on "How to automatically download the result of execution?".
I understand your question similar to Ansible Tower REST API: Is there any way to get the logs/output of a job?
According the Tower API Reference Guide: Jobs, the following call might work from or on your remote server.
curl --silent -u ${TOWER_USER}:${TOWER_PASSWORD} -JL https://${TOWER_URL}/api/v2/jobs/${JobID}/stdout?format=txt_download -o job_${JobID}.log
resulting into the output of a file called job_${JobID}.log.
You may transfer this in to an Ansible task, ideally by not using the shell module.

Access to an API on Powershell does not work

I started to use the API on the PowerShell by instruction https://automation.deepsecurity.trendmicro.com/article/12_0/set-up-cookbook?platform=on-premise under API Cookbook - > Set up to use Bash or Powershell - to extract the managed agents status from the Deep Security.
I followed the instruction to test the access to the API on the Windows PowerShell using a pre-created API key, secret, headers and Invoke-WebRequest.
The documentation says if you receive the error message “The underlying connection was closed: An unexpected error occurred on a send” need to restart the PowerShell and repeat the test. But it does not work.
Can you please help with the automation on Powershell to successfully complete the test?

Can I re-run a Power Automate flow instance from history?

Is there any way to find and re-run an earlier instance of a Power Automate workflow programmatically?
I can do this manually: download the .csv file containing the instances, search in the Trigger output column the one I want, get the id, copy-paste the run URL, and click resubmit.
I tried with Power Automate itself:
The built-in Flow Management connector supports only to find a specific flow by name, and does not even go to the history.
PowerShell:
Installed the PowerApps module, I can list the instances with
Get-FlowRun -FlowName {flow name}
But I don't see the same properties as in the exported .csv file, and there's also no Run-Flow command that would let me run it.
So, I am a little stuck here; could someone please help me out?
We cannot programmatically resubmit the Flow run from the history with PowerShell or by any other api method yet.
But can avoid some manual work by using workflow function in a Flow compose step, we can automate the composition of Flow history run url. Read more
https://xxx.flow.microsoft.com/manage/environments/07aa1562-fea6-4583-8d76-9a8e67cbf298/flows/141e89fb-af2d-47ac-be25-f9176e64e9a0/runs/08586722084717816659969428791CU12?backUrl=%2Fflows%2F141e89fb-af2d-47ac-be25-f9176e64e9a0%2Fdetails&runStatus=Failed
There are 3 guids that I need to find aso that I can build up the flow history url.
The first guid is my environmentName (07aa1562-fea6-4583-8d76-9a8e67cbf298), then I’ve got the flow name ( 141e89fb-af2d-47ac-be25-f9176e64e9a0) and finally the run (08586722084717816659969428791CU12).
There is a cmdlet from Microsoft 365 CLI to resubmit a flow run
m365 flow run resubmit --environment flowEnvironmentID --flow flowGUID --name flowRunID –confirm
You can also resubmit a flow run using Power Automate REST API
https://api.flow.microsoft.com/providers/Microsoft.ProcessSimple/environments/{FlowEnvironment}/flows/{FlowGUID}/triggers/manual/histories/{FlowRunID}/resubmit?api-version=2016-11-01
For the Power Automate REST API, you will have to pass an authorization token.
For more information, go through the following post
https://ashiqf.com/2021/05/09/resubmit-your-failed-power-automate-flow-runs-automatically-using-m365-cli-and-rest-api/

How to check in Nifi whether all the flowfile or messages in a process group has cleared or not?

Is there a way to check whether all the messages/flow-files in a processor group has cleared or not using rest api in shell script?
Basically, my use case is that I am stopping a nifi processor in my shell script via curl command. Then I need to wait till all the queues are empty and flow files have passed through before proceeding further.
Yes, you can query the status of individual connections or the process group status via the API. The easiest way to do this is perform the action in your browser and use the Developer Tools to monitor the request and copy/paste this to your invoking tool.

How do I configure and access logs in Java and Docker based OpenWhisk actions?

Looking at OpenWhisk samples, it seems like JavaScript-based actions can use console.log() to report log information that would be collected and accessible through the activation API.
However, it is not clear how to report logs from Java-based or Docker-based actions.
Logs for OpenWhisk actions are taken from stdout and stderr of the action. That mechanism applies to all runtimes.
The Docker-based approach assumes that stdout of the program you run is the result of the action. Thus it takes stdout and tries to JSON-parse it. The result will be the result of the action itself rather than logs. Currently there is no way to write logs in a docker-based action.