如何获取Jenkins的API令牌 [英] How to get the API Token for Jenkins
本文介绍了如何获取Jenkins的API令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用jenkins rest api.在说明中说我需要api密钥.我在所有的配置页面中查找了它.如何获取詹金斯的API密钥?
I am trying to use the jenkins rest api. In the instructions it says I need to have the api key. I have looked all over the configuration pages to find it. How do i get the API key for jenkins?
推荐答案
Since Jenkins 2.129 the API token configuration has changed:
您现在可以拥有多个令牌并为其命名.它们可以单独吊销.
You can now have multiple tokens and name them. They can be revoked individually.
- 登录到詹金斯.
- 单击您的姓名(右上角).
- 点击配置(左侧菜单).
- 使用添加新令牌"按钮生成一个新令牌,然后为其命名.
- 生成令牌时必须复制令牌,因为以后无法查看令牌.
- 在不再需要时撤销旧令牌.
- Log in to Jenkins.
- Click you name (upper-right corner).
- Click Configure (left-side menu).
- Use "Add new Token" button to generate a new one then name it.
- You must copy the token when you generate it as you cannot view the token afterwards.
- Revoke old tokens when no longer needed.
在Jenkins 2.129之前:如下显示API令牌:
Before Jenkins 2.129: Show the API token as follows:
- 登录到詹金斯.
- 单击您的姓名(右上角).
- 点击配置(左侧菜单).
- 点击显示API令牌.
- Log in to Jenkins.
- Click your name (upper-right corner).
- Click Configure (left-side menu).
- Click Show API Token.
API令牌已显示.
您可以通过点击更改API令牌按钮来更改令牌.
You can change the token by clicking the Change API Token button.
这篇关于如何获取Jenkins的API令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文