For Rundeck community edition 3.3.10 is there a way of getting a scheduled job's schedule frequency via the API? e.g. if the schedule is 0 20/15 * ? * * * then an API call that will either return this string, or the frequency part of every 15 minutes. I have looked at the job/<ID>/info and job/<ID>/executions endpoints, but I am unable to get the actual schedule frequency.
You can use the Job Forecast API Endpoint. That info is available in the "futureScheduledExecutions" response section.
Related
In Azure DevOps, I have a pipeline, where I need the logs of a specific task. How do I find out which log ID i need to fetch it?
eg. on UI this is the endpoint: https://dev.azure.com/myorg/myspace/_build/results?buildId=1234&view=logs&j=899c4bff-9ac3-12de-4775-50e701812cb4&t=bc949ec8-c945-5220-1d40-d8ea7dab4bda
which contains the job and task ids, but these are useless when querying logs.
Same example, url to the logs I need: https://dev.azure.com/myorg/cd642969-da00-4584-ab6a-4b6021c47eff/_apis/build/builds/1234/logs/24
The number of tasks depends on what parameters I set, so the number 24 changes. How do I calculate the log id, if I know the name / id of the job and task?
Should I go through all the ~100 task logs and grep for match in the first lines for the task name? (troll)
How do I calculate the log id, if I know the name / id of the job and task?
To get the logid with task name, you could try to use the following Rest API: Timeline - Get
GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/timeline?api-version=6.0
You could search with task name. Then you could get the target logid:
I am using a grafana dashboard for Azure Monitor for containers- Metrics but while creating the alarm for CPU utilization in the Kubernetes cluster, I get the error mentioned above.
Here is the graph for the CPU utilization :
And also I am attaching the condition I am using to create alert:
I am not sure what am I doing wrong here. Please advice!
Thank you
Graph of CPU utilization and configuration to create alert looks correct. As per the error message (request failed status: 400 Bad Request), this looks like the alert notification settings might have some issue (most likely the server is expecting different format of data and throwing 400 to the request).
Grafana documentation for alerts - link
What is the mode of notification you are using? Predefined one or custom webhook based notification?
I have defined swagger for REST APIs. Swagger explorer is working fine. 1 of the APIs is doing bulk update of dynamo DB records. It takes around 3-4 minutes to complete dynamoDB operation. For this API, swagger call runs for sometime and then it says
Response Code
0
Response Headers
{
"error": "no response from server"
}
When I checked logs, there is no any exception from swagger. This API update operation runs in background and completes processing in 3-4 minutes. I have verified it using logs and metric datapoint. I want swagger also to pause/ continuous active load instead of getting timed out.
After checking Inspect part of page, it says
net::ERR_EMPTY_RESPONSE
Is there any way to update swagger timeout/ anything?
Is there any way to trigger REST API from mongodb ?
below is my mongo document
{
_id : "123",
"expiryTime" : "2020-01-30T00:00:00Z",
"status" : "NEW"
}
I have an REST API which will mark status of all documents for which expiryTime reached as "OLD".
How to achieve this , can mongo call an API ?
MongoDB doesn't have any solution to this.
Alternative solutions:
Schedule Tasks with Spring Boot: You need to implement in your code such logic look here
UNIX: You may schedule with crontab to execute commands / API rest periodically.
Windows: You may schedule with Task Scheduler to execute commands / API rest periodically.
You may write a program (Python, Java) to do:
Connect MongoDB
Check if any data expired for current date (query)
- If yes, execute API rest for each expired data
-- Remove expired data
- If no, finish the execution
I am using https://wiki.jenkins.io/display/JENKINS/EnvInject+Plugin 1.93.1 in my Jenkins installation.
I need to fetch the EnvInject properties configuration for every job I have, but I can't seem to find a way to do this in the job rest api.
The way I figured to do this is by fetching the last build for every job and then hit the injectedEnvVars/api/.
This strategy is not optimal because I have to do a request for every job, and that is taking too long (4000+ jobs).
Am I missing something? Is there a way to fetch the envInject properties together with the job information?
If you think send 4000 HTTP requests is not effective, You can iterate the JENKINS_HOME folder on Jenkins Master.
Following picture illustrate the structure for injectedEnvVars.txt which stores the value of EnvInject.
.jenkins is JENKINS_HOME folder
fetch-envinject-value is jenkins job
builds/1 is the 1st job build
builds/1/injectedEnvVars.txt is all environment variables for this job build.