I am using below gitlab API to fetch jobs of a particular project:
https://git.nmlv.nml.com/api/v4/projects/:project_id/jobs?updated_after=2023-02-01T00:00:00.000Z&page_no=1&per_page=100
I want to fetch only those jobs that completed after 1st February 2023, but above request still returns all jobs, that completed before 1st Feb.
Is it possible to do what I am trying to do, because I have seen the deployment API takes as parameter the updated_after field. Is it possible in any other REST API version of gitlab, like v2 or v3?
Thanks!
Related
I'm using the Azure DevOps REST API to retrieve pipeline runs (aka "builds"). The build response has a bunch of good data, but it seems that the pool it reports only applies if the overall pipeline has a top-level pool defined.
For example, I have a pipeline that runs several parallel jobs, each one in a different self-hosted agent pool. But when I retrieve a build of this pipeline using the REST API, the only data available is for the pipeline's pool, which is the normal Hosted Ubuntu 1604 response you get for Microsoft-hosted builds - there's no mention of any of the self-hosted agent pools that did all the work.
I've tried drilling down into different sections (including the stage and task queries). The task level will eventually show the name of the agent used, but it's just a string, so it's not easy to infer the agent pool used unless you happen to name your agents in a specific way.
Is there any way to drill down into the individual "jobs" that ran as part of a pipeline and see what agent pools they were run on, using the REST API?
The Build response contains a link timeline (under Links field).
You can form it like this: https://dev.azure.com/<org>/<project>/_apis/build/builds/<buildId>/Timeline
The Json response has useful info for each job/task including queueId
at present, our Rest API cannot help us drill down into the individual "jobs" that ran as part of a pipeline and see what agent pools they were run on. This Rest Api is used to find the default settings about your pipeline.
As the work around, we can use the api: Builds - Get Build Log, and find the agent's name, like this:
I am running a build pipe line in azure that is having multiple tasks. But I have a requirement to get logs using rest API calls after triggering pipeline. I used Builds-Get Build Logs, but it listing only completed task logs and not listing ongoing task log. Is there any mechanism available to get ongoing task logs/live logs?
Is there a way to get the live logs of a running pipeline using Azure REST API?
I am afraid there is no such mechanism available to get ongoing task logs/live logs.
As we know, the Representational State Transfer (REST) APIs are service endpoints that support sets of HTTP operations (methods), which provide create, retrieve, update, or delete access to the service's resources.
The task is executed inside the agent, and the result of the execution be passed back to azure devops only after a task is completed. So, HTTP operations (methods) are triggered only when the task is completed and the results are returned, and then we could use the REST API to get the results.
So, we could not use the Azure REST API to get ongoing task logs/live logs. This is limited by the azure devops design pattern.
Hope this helps.
I want to be notified via slack whether my scheduled pipeline runs are failing or passing. I also do not want a trigger every time the pipeline fails or passes, I want it to be specifically limited to the scheduled pipelines
We have a requirement where we want to create a scheduled web job to call an API and process some data at the 12:00 AM every night. However, each of the job needs to be triggered at 12:00 AM of specific time-zone, to which the record in the table belongs.
Is it possible to automate the creation of web job with scheduled time, after an entry is done in the table? The time zone information along with other inputs, required by the API, will be in the table record. As far as I have googled, I am not able to find if it is possible to automate the creation of web job after an event.
If you have the executable ready as a zip you can upload that zip to your App Service Web App as a Webjob using the Webjobs API.
I created with my user, one trigger in the Pipeline triggers of my project. I successfully executed the trigger and it appears on the job page. But since I want this trigger to be used by all developers on my team, I need to see who triggered the job. But always appears on the job page, that I, who created the trigger, triggered all jobs and not the other user who actually triggered it.
There is any way that can I show who triggered the job?
I tried to use, as another option the creating pipeline via API and setting a private token to each user. But when I pass a variable in the request, apparently the Gitlab API is not working with the variables option. Because, when we create a pipeline trigger and request it, we don't pass a user token, we pass the trigger token.
https://gitlab.com/gitlab-org/gitlab-ce/issues/52926
If you navigate to the repository that contains the CI Pipeline, under CI/CD>Pipelines there should be a table showing all past instances of the pipeline. There is a "Triggerer" column which should show you who triggered it.
If you are still unable to see who triggered it, perhaps you need to adjust your own permissions