deploy-keys リソース

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

Bitbucket Cloud v1 APIs are deprecated

Bitbucket Cloud REST API version 1 is deprecated effective 30 June 2018. All 1.0 APIs will be removed from the REST API permanently on 31 December 2018. Read the deprecation notice. Or you can jump right to the version 2.0 REST API documentation.

概要

Manage ssh keys used for deploying product builds. All the calls for this resource require authentication as the account owner. The deploy-keys fields are the following:

フィールド 説明
pk キーの識別子 (ID)。
鍵 (キー) 公開キーの値。
ラベル ユーザーに表示される、キーのラベル。

You cannot update an existing deploy key.  Instead, you must DELETE the key and recreate a new one with a POST call.

GET a list of keys

Gets a list of the keys associated with an repository. You can specify the following parameters with this call:

パラメーター
必須かどうか
説明
accountname はい The team or individual account.
repo_slug はい The repo identifier (not to be confused with the repo's name).
GET https://api.bitbucket.org/1.0/repositories/{accountname}/{repo_slug}/deploy-keys 
ここをクリックしてレスポンスを展開...
[
    {
        "pk": 171092,
        "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMl/FZf9AtrJBth+8swfDfJrRWetHHnew/LTwX86OGdcG4sJWE9QpWzO9K+szpxaFmMF729
bKAUBMBWNoPrYApayyalirpe7fjzHqIWoq9CsP/wKDVSyMxVOiBwBnXSukS7i9iOiC2J9PyEQwAq7GJXI3E2UWyymW7rVyaDdYKLH9PdUMNmLfBpsDUyjdGO40pLj
r6KCiyOTLI07Qy9iVz44VTRm6IBlxhee0DV3gw4GADHllSRVVOOngO+3493943sgfsfgsgsffgs3349349DFG346qi4WTeECB6JH87Fhd
CGS6mFyavpvOnrZdR9jGD auserbb",
        "label": "bamboo-agent"
    }
]

GET the key's content

Gets the content of the specified key_id. This call requires authentication. You can specify the following parameters with this call:

パラメーター
必須かどうか
説明
accountname はい The team or individual account.
repo_slug はい The repo identifier (not to be confused with the repo's name).
pk はい The key identifier assigned by Bitbucket. Use the GET call to obtain this value.
 GET https://api.bitbucket.org/1.0/repositories/{accountname}/{repo_slug}/deploy-keys/{pk}
ここをクリックして展開...
[
    {
        "pk": 171092,
        "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMl/FZf9AtrJBth+8swfDfJrRWetHHnew/LTwX86OGdcG4sJWE9QpWzO9K+szpxaFmMF729
bKAUBMBWNoPrYApayyalirpe7fjzHqIWoq9CsP/wKDVSyMxVOiBwBnXSukS7i9iOiC2J9PyEQwAq7GJXI3E2UWyymW7rVyaDdYKLH9PdUMNmLfBpsDUyjdGO40pLj
r6KCiyOTLI07Qy9iVz44VTRm6IBlxhee0DV3gw4GADHllSRVVOOngO+3493943sgfsfgsgsffgs3349349DFG346qi4WTeECB6JH87Fhd
CGS6mFyavpvOnrZdR9jGD auserbb",
        "label": "bamboo-agent"
    }
]

POST a new key

Creates a key on the specified account. You must supply a valid key that is unique across the Bitbucket service. A public key contains characters need to be escaped before sending it as a POST data. So, use the proper escaping ( urlencode ), if you are testing to add a key via your terminal. This call requires authentication. You can specify the following parameters with this call:

パラメーター
必須かどうか
説明
accountname はい The team or individual account.
repo_slug はい The repo identifier (not to be confused with the repo's name).
ラベル いいえ A display name for the key.
鍵 (キー) はい The content of the key.
POST https://api.bitbucket.org/1.0/repositories/{accountname}/{repo_slug}/deploy-keys --data "key=value"
ここをクリックしてレスポンスを展開...
[
    {
        "pk": 171092,
        "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMl/FZf9AtrJBth+8swfDfJrRWetHHnew/LTwX86OGdcG4sJWE9QpWzO9K+szpxaFmMF729
bKAUBMBWNoPrYApayyalirpe7fjzHqIWoq9CsP/wKDVSyMxVOiBwBnXSukS7i9iOiC2J9PyEQwAq7GJXI3E2UWyymW7rVyaDdYKLH9PdUMNmLfBpsDUyjdGO40pLj
r6KCiyOTLI07Qy9iVz44VTRm6IBlxhee0DV3gw4GADHllSRVVOOngO+3493943sgfsfgsgsffgs3349349DFG346qi4WTeECB6JH87Fhd
CGS6mFyavpvOnrZdR9jGD auserbb",
        "label": "bamboo-agent"
    }
]

DELETE a key

Deletes the key specified by the key_id value. This call requires authentication. You can specify the following parameters with this call:

パラメーター
必須かどうか
説明
accountname はい The team or individual account.
repo_slug はい The repo identifier (not to be confused with the repo's name).
pk はい The key identifier assigned by Bitbucket. Use the GET call to obtain this value.
DELETE https://api.bitbucket.org/1.0/repositories/{accountname}/{repo_slug}/deploy-keys/{pk}

Returns HTTP 204 on success.

最終更新日 2018 年 1 月 14 日

この翻訳に満足しましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.