如何获取Jenkins的API令牌 [英] How to get the API Token for Jenkins

查看:590
本文介绍了如何获取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?

推荐答案

自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.

  1. 登录到詹金斯.
  2. 单击您的姓名(右上角).
  3. 点击配置(左侧菜单).
  4. 使用添加新令牌"按钮生成一个新令牌,然后为其命名.
  5. 生成令牌时必须复制令牌,因为以后无法查看令牌.
  6. 在不再需要时撤销旧令牌.
  1. Log in to Jenkins.
  2. Click you name (upper-right corner).
  3. Click Configure (left-side menu).
  4. Use "Add new Token" button to generate a new one then name it.
  5. You must copy the token when you generate it as you cannot view the token afterwards.
  6. Revoke old tokens when no longer needed.

在Jenkins 2.129之前:如下显示API令牌:

Before Jenkins 2.129: Show the API token as follows:

  1. 登录到詹金斯.
  2. 单击您的姓名(右上角).
  3. 点击配置(左侧菜单).
  4. 点击显示API令牌.
  1. Log in to Jenkins.
  2. Click your name (upper-right corner).
  3. Click Configure (left-side menu).
  4. Click Show API Token.

API令牌已显示.

您可以通过点击更改API令牌按钮来更改令牌.

You can change the token by clicking the Change API Token button.

这篇关于如何获取Jenkins的API令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆