API support for manual approval of promoted builds in Jenkins? - api

Is there any way to programmatically approve the Jenkins promoted build?
In job configuration it has been set to "Only when manually approved".

Yes! Although I haven't found any documentation for it and so it might not be a stable solution. I found this using the browser developer tools. Make sure "Only when manually approved" is checked.
Here's an example:
curl 'https://jenkins/job/z-promotion-test/3/promotion/promotionProcess/promotion_test/promotionCondition/hudson.plugins.promoted_builds.conditions.ManualCondition/approve' --data 'json=%7B%7D&Submit=Approve'
Authenticated version
curl 'http://<user>:<token>#jenkins/job/z-promotion-test/3/promotion/promotionProcess/promotion_test/promotionCondition/hudson.plugins.promoted_builds.conditions.ManualCondition/approve' --data 'json=%7B%7D&Submit=Approve'
See
http://jenkins/me/configure
https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API

I too got into the same situation. There is no documentation/help found nowhere. But after some serious plug n play below command made it work. Hope it helps. Please refer below URL
API (curl)Command to Approve a promoted build Job in Jenkins
I know it is almost 2 years since the post published, but thought it could help some others with the same issue. Thanks

Related

Heroku: http-error 410. Invalid response from API (I am not behind a proxy)

I am currently having some issues with heroku. I just installed it and tried to heroku create. It takes my credentials but so far i just get this
! HTTP Error: https://api.heroku.com/login 410 Gone
! Invalid response from API.
! HTTP 410
! {myMail myPw}
!
! Are you behind a proxy?
! https://devcenter.heroku.com/articles/using-the-cli#using-an-http-proxy
I have been looking around for others with that issue but they all were behind a proxy. I am not. I also checked my firewall settings and also tried to run the command line client with admin rights. But nothing has proven to be successful so far. I'll keep trying and post an answer as soon as i figure it out. Maybe someone of you has an idea. Would be appreciated. Thanks in advance and
Greetings Chris
EDIT
Maybe some info. I'm running
Windows 10 Pro (V10.0.15063)
and a basic network setup with a router and DHCP
I had the same problem today.
When I type
heroku
in my Command Prompt, it promotes me to enter my email and after that my password. Then I got the same error message as you.
After that instead "heroku" I typed
heroku login
I entered the same email and password and everything was fine.
Ok. I made it work. Unfortunately I'm not really understanding why this worked which is pretty unsatisfying but I'll tell you what I did. I stumbled on some posts that were saying heroku-cli is outdated if that happens. First I tried to update it with npm using
npm update -g heroku-cli
which basically made heroku stop working alltogether because now the cli reported it needed node >7.X (and I was still running on 6.X). The node update I then made also didn't help because now heroku-cli was unable find the command bash.
In the end I just reinstalled heroku. After that (with at first getting the same error as in the beginning) I first did
heroku update
and after that heroku login worked. Now why I don't really grasp and maybe someone of you guys knows. But the version I had before heroku update was exaclty the same as afterwards
heroku-cli/5.11.12-8ae9780 (windows-amd64) go1.7.5
I found out the heroku.cl was blocked by my antivirus and unblocked it. Now its working flawless.
Updating Heroku worked for me.
heroku update

Connecting IntelliJ Idea Servers to GitLab.com: what info is actually needed?

I'm trying to configure IntelliJ IDEA 2017.1.2 in order to get the tasks from a private repository on GitLab.com.
To do that I have to create the corresponding entry in the Servers window.
Now, I don't have the faintest idea about how I should fill the Servers form in IDEA.
What URL I have to use for Server URL ?
What token ?
Any advice? Thx in advance.
UPDATE: Based on the information mentioned in the issue IDEA-193736, the connectivity problem with the new GitLab Issues API (V4) should be fixed when the update 2018.2 is released.
The https://gitlab.com URL didn't work for me as the API URL was updated to V4 on GitLab. So, after some trial and error I was able to make it work by completing the following steps:
Create a Personal Access Token on GitLab (https://gitlab.com/profile/personal_access_tokens) with API and read_user access permissions
In IntelliJ (or Pycharm in my case), the Server URL should be https://gitlab.com/api/v4/issues? (with the question mark at the end)
The token is the Personal Access Token that was generated previously
Also, don't forget to increase the connection timeout to 15000 milliseconds under the Tasks section in the Settings (Settings => Tools => Tasks).
Task Server Screenshot
Hope it helps someone else.
[EDIT] This answer was valid in '17, when it was created. For an up to date anwer, pls see other answers in the thread.
So, here's how to do it.
First of all, go to gitlab.
Access with your data and get a personal access token.
Then, you can configure IntelliJ Idea with the following values:
You can now check all your GitLab's issues directly in Idea, as shown here below.

Spring Config Client - ConfigClientWatch

I am looking at the class ConfigClientWatch in the package package org.springframework.cloud.config.client;
I was expecting that I could use this to poll the server periodically to see if the config had changed and then execute an refresh.
I am not able to get this to work? How does the value
String newState = this.environment.getProperty("config.client.state");
Get updated.
I have not been able to find any documentation on this.
Thanks in Advance
Raghu
Unfortunately, this property is only used by Vault backend. Anyway, there is a thread in the Spring Config's GitHub proposing changes to support other backends such as Git.
If you are using Git-backed configurations, this solution may work for you:
https://github.com/spring-cloud/spring-cloud-config/issues/1378#issuecomment-492073851
Please, upvote the GitHub thread so this feature gets accepted.

How to define the leak period date in SonarQube using the API?

I am using SonarQube 6.0
Has anyone defined the leak period date in SonarQube using the API?
I have looked at the Web API (localhost:9000/web_api/) but have not seen a section that details this operation.
Any advise is appreciated.
Thanks
As indicated in the documentation go to Administration > General Settings > General > Differential Views. If you want to do it with a script, have a look at api/properties web services.
So I've tried this url,
curl -u d****#****.com:****** -X POST https://*****.com/api/properties?id=sonar.timemachine.period1&value=2018-06-01&resource=AdManager
and my response code is;
{"err_code":200,"err_msg":"property created"}
But, the property is not updated. Is there a way I can see why this failed? The logs don't seem to mention anything.

Unable to add apache Nifi in ambari?

I am trying to add Apache Nifi in ambari but continuously failing with error Error occured during stack advisor command invocation:
Unable to delete directory /var/run/ambari-server/stack-recommendations/1.
There is a similar thread with the same error in hortonworks community, I have tried everything mentioned in that thread but unable to fix it. My sandbox is installed in vmware workstation 12 player. I also tried to create and remove directory manually but it is failing with the error invalid argument. Created a thread for this error also on stackexchange. Please help!!!
Here is a link to Hortonworks forum thread. And it seems like sandbox is just broken:
This is due to a docker issue in this 2.5 sandbox build. It will be
fixed in next revision of the sandbox.
There are also some workarounds described (like use older HDP 2.4 or establishing own cluser based on the HDP 2.5 docker image)
Updated sandbox arrived: http://hortonworks.com/downloads
Trust me, active member of community see your posts in multiple locations. In a good, no Big Brother ways :) but cross-posting is an old as world ... Well, you got it.
Did you see a notice for this service in Ambari? Telling it's been deprecated? Same note in the github. There's a good reason for that, it's now been implemented properly by the dev team and with many more features. I.e. all the action is there now.
I think I replied a similar question, though not sure it was yours, take a look in HCC.