如何获取 Jenkins 的 API Token [英] How to get the API Token for Jenkins
本文介绍了如何获取 Jenkins 的 API Token的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用 jenkins rest api.在说明中,它说我需要拥有 api 密钥.我已经查看了所有配置页面以找到它.我如何获取 jenkins 的 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?
推荐答案
自 Jenkins 2.129 以来 API 令牌配置 已更改:
Since Jenkins 2.129 the API token configuration has changed:
您现在可以拥有多个令牌并为其命名.它们可以单独撤销.
You can now have multiple tokens and name them. They can be revoked individually.
- 登录 Jenkins.
- 点击您的名字(右上角).
- 点击配置(左侧菜单).
- 使用添加新令牌"按钮生成一个新令牌,然后为其命名.
- 您必须在生成令牌时复制令牌,因为之后无法查看令牌.
- 在不再需要时撤销旧令牌.
Jenkins 2.129 之前:显示 API 令牌如下:
Before Jenkins 2.129: Show the API token as follows:
- 登录 Jenkins.
- 点击您的姓名(右上角).
- 点击配置(左侧菜单).
- 点击显示 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 Token的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文