Skip to content

Latest commit

 

History

History
161 lines (97 loc) · 12.8 KB

DeployApi.md

File metadata and controls

161 lines (97 loc) · 12.8 KB

\DeployApi

All URIs are relative to https://api.bitbucket.org/2.0

Method HTTP request Description
RepositoriesUsernameRepoSlugDeployKeysGet Get /repositories/{username}/{repo_slug}/deploy-keys
RepositoriesUsernameRepoSlugDeployKeysKeyIdDelete Delete /repositories/{username}/{repo_slug}/deploy-keys/{key_id}
RepositoriesUsernameRepoSlugDeployKeysKeyIdGet Get /repositories/{username}/{repo_slug}/deploy-keys/{key_id}
RepositoriesUsernameRepoSlugDeployKeysKeyIdPut Put /repositories/{username}/{repo_slug}/deploy-keys/{key_id}
RepositoriesUsernameRepoSlugDeployKeysPost Post /repositories/{username}/{repo_slug}/deploy-keys

RepositoriesUsernameRepoSlugDeployKeysGet

PaginatedDeployKeys RepositoriesUsernameRepoSlugDeployKeysGet(ctx, username, repoSlug)

Returns all deploy-keys belonging to a repository. Example: $ curl -H \"Authorization <auth header>\" \\ https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys Output: { \"pagelen\": 10, \"values\": [ { \"id\": 123, \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5\", \"label\": \"mykey\", \"type\": \"deploy_key\", \"created_on\": \"2018-08-15T23:50:59.993890+00:00\", \"repository\": { \"full_name\": \"mleu/test\", \"name\": \"test\", \"type\": \"repository\", \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\" }, \"links\":{ \"self\":{ \"href\": \"https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/123\" } } \"last_used\": null, \"comment\": \"mleu@C02W454JHTD8\" } ], \"page\": 1, \"size\": 1 }

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string This can either be the username or the UUID of the account, surrounded by curly-braces, for example: `{account UUID}`. An account is either a team or user.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.

Return type

PaginatedDeployKeys

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesUsernameRepoSlugDeployKeysKeyIdDelete

RepositoriesUsernameRepoSlugDeployKeysKeyIdDelete(ctx, username, repoSlug, keyId)

This deletes a deploy key from a repository. Example: $ curl -XDELETE \\ -H \"Authorization <auth header>\" \\ https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/1234

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string This can either be the username or the UUID of the account, surrounded by curly-braces, for example: `{account UUID}`. An account is either a team or user.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
keyId string The key ID matching the deploy key.

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesUsernameRepoSlugDeployKeysKeyIdGet

DeployKey RepositoriesUsernameRepoSlugDeployKeysKeyIdGet(ctx, username, repoSlug, keyId)

Returns the deploy key belonging to a specific key. Example: $ curl -H \"Authorization <auth header>\" \\ https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-key/1234 Output: { \"comment\": \"mleu@C02W454JHTD8\", \"last_used\": null, \"links\": { \"self\": { \"href\": https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-key/1234\" } }, \"repository\": { \"full_name\": \"mleu/test\", \"name\": \"test\", \"type\": \"repository\", \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\" }, \"label\": \"mykey\", \"created_on\": \"2018-08-15T23:50:59.993890+00:00\", \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5\", \"id\": 1234, \"type\": \"deploy_key\" }

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string This can either be the username or the UUID of the account, surrounded by curly-braces, for example: `{account UUID}`. An account is either a team or user.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
keyId string The key ID matching the deploy key.

Return type

DeployKey

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesUsernameRepoSlugDeployKeysKeyIdPut

DeployKey RepositoriesUsernameRepoSlugDeployKeysKeyIdPut(ctx, username, repoSlug, keyId)

Create a new deploy key in a repository. The same key needs to be passed in but the comment and label can change. Example: $ curl -XPUT \\ -H \"Authorization <auth header>\" \\ -H \"Content-type: application/json\" \\ https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/1234 -d \\ '{ \"label\": \"newlabel\", \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 newcomment\", }' Output: { \"comment\": \"newcomment\", \"last_used\": null, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/1234\" } }, \"repository\": { \"full_name\": \"mleu/test\", \"name\": \"test\", \"type\": \"repository\", \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\" }, \"label\": \"newlabel\", \"created_on\": \"2018-08-15T23:50:59.993890+00:00\", \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5\", \"id\": 1234, \"type\": \"deploy_key\" }

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string This can either be the username or the UUID of the account, surrounded by curly-braces, for example: `{account UUID}`. An account is either a team or user.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
keyId string The key ID matching the deploy key.

Return type

DeployKey

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesUsernameRepoSlugDeployKeysPost

DeployKey RepositoriesUsernameRepoSlugDeployKeysPost(ctx, username, repoSlug)

Create a new deploy key in a repository. Example: $ curl -XPOST \\ -H \"Authorization <auth header>\" \\ -H \"Content-type: application/json\" \\ https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys -d \\ '{ \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 mleu@C02W454JHTD8\", \"label\": \"mydeploykey\" }' Output: { \"id\": 123, \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5\", \"label\": \"mydeploykey\", \"type\": \"deploy_key\", \"created_on\": \"2018-08-15T23:50:59.993890+00:00\", \"repository\": { \"full_name\": \"mleu/test\", \"name\": \"test\", \"type\": \"repository\", \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\" }, \"links\":{ \"self\":{ \"href\": \"https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/123\" } } \"last_used\": null, \"comment\": \"mleu@C02W454JHTD8\" }

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string This can either be the username or the UUID of the account, surrounded by curly-braces, for example: `{account UUID}`. An account is either a team or user.
repoSlug string This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.

Return type

DeployKey

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]