bitbucket-api-client-lib

DeployApi

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

Method HTTP request Description
repositoriesWorkspaceRepoSlugDeployKeysGet GET /repositories/{workspace}/{repo_slug}/deploy-keys  
repositoriesWorkspaceRepoSlugDeployKeysKeyIdDelete DELETE /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}  
repositoriesWorkspaceRepoSlugDeployKeysKeyIdGet GET /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}  
repositoriesWorkspaceRepoSlugDeployKeysKeyIdPut PUT /repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}  
repositoriesWorkspaceRepoSlugDeployKeysPost POST /repositories/{workspace}/{repo_slug}/deploy-keys  

repositoriesWorkspaceRepoSlugDeployKeysGet

PaginatedDeployKeys repositoriesWorkspaceRepoSlugDeployKeysGet(repoSlug, workspace)

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 } ```

Example

// Import classes:
//import com.rappi.bitbucket.client.invoker.ApiClient;
//import com.rappi.bitbucket.client.invoker.ApiException;
//import com.rappi.bitbucket.client.invoker.Configuration;
//import com.rappi.bitbucket.client.invoker.auth.*;
//import com.rappi.bitbucket.client.api.DeployApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");

DeployApi apiInstance = new DeployApi();
String repoSlug = "repoSlug_example"; // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
String workspace = "workspace_example"; // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. 
try {
    PaginatedDeployKeys result = apiInstance.repositoriesWorkspaceRepoSlugDeployKeysGet(repoSlug, workspace);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DeployApi#repositoriesWorkspaceRepoSlugDeployKeysGet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
repoSlug String This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.  
workspace String This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.  

Return type

PaginatedDeployKeys

Authorization

api_keybasicoauth2

HTTP request headers

repositoriesWorkspaceRepoSlugDeployKeysKeyIdDelete

repositoriesWorkspaceRepoSlugDeployKeysKeyIdDelete(keyId, repoSlug, workspace)

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 ```

Example

// Import classes:
//import com.rappi.bitbucket.client.invoker.ApiClient;
//import com.rappi.bitbucket.client.invoker.ApiException;
//import com.rappi.bitbucket.client.invoker.Configuration;
//import com.rappi.bitbucket.client.invoker.auth.*;
//import com.rappi.bitbucket.client.api.DeployApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");

DeployApi apiInstance = new DeployApi();
String keyId = "keyId_example"; // String | The key ID matching the deploy key.
String repoSlug = "repoSlug_example"; // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
String workspace = "workspace_example"; // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. 
try {
    apiInstance.repositoriesWorkspaceRepoSlugDeployKeysKeyIdDelete(keyId, repoSlug, workspace);
} catch (ApiException e) {
    System.err.println("Exception when calling DeployApi#repositoriesWorkspaceRepoSlugDeployKeysKeyIdDelete");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
keyId String The key ID matching the deploy key.  
repoSlug String This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.  
workspace String This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.  

Return type

null (empty response body)

Authorization

api_keybasicoauth2

HTTP request headers

repositoriesWorkspaceRepoSlugDeployKeysKeyIdGet

DeployKey repositoriesWorkspaceRepoSlugDeployKeysKeyIdGet(keyId, repoSlug, workspace)

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\" } ```

Example

// Import classes:
//import com.rappi.bitbucket.client.invoker.ApiClient;
//import com.rappi.bitbucket.client.invoker.ApiException;
//import com.rappi.bitbucket.client.invoker.Configuration;
//import com.rappi.bitbucket.client.invoker.auth.*;
//import com.rappi.bitbucket.client.api.DeployApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");

DeployApi apiInstance = new DeployApi();
String keyId = "keyId_example"; // String | The key ID matching the deploy key.
String repoSlug = "repoSlug_example"; // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
String workspace = "workspace_example"; // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. 
try {
    DeployKey result = apiInstance.repositoriesWorkspaceRepoSlugDeployKeysKeyIdGet(keyId, repoSlug, workspace);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DeployApi#repositoriesWorkspaceRepoSlugDeployKeysKeyIdGet");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
keyId String The key ID matching the deploy key.  
repoSlug String This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.  
workspace String This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.  

Return type

DeployKey

Authorization

api_keybasicoauth2

HTTP request headers

repositoriesWorkspaceRepoSlugDeployKeysKeyIdPut

DeployKey repositoriesWorkspaceRepoSlugDeployKeysKeyIdPut(keyId, repoSlug, workspace)

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\" } ```

Example

// Import classes:
//import com.rappi.bitbucket.client.invoker.ApiClient;
//import com.rappi.bitbucket.client.invoker.ApiException;
//import com.rappi.bitbucket.client.invoker.Configuration;
//import com.rappi.bitbucket.client.invoker.auth.*;
//import com.rappi.bitbucket.client.api.DeployApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");

DeployApi apiInstance = new DeployApi();
String keyId = "keyId_example"; // String | The key ID matching the deploy key.
String repoSlug = "repoSlug_example"; // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
String workspace = "workspace_example"; // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. 
try {
    DeployKey result = apiInstance.repositoriesWorkspaceRepoSlugDeployKeysKeyIdPut(keyId, repoSlug, workspace);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DeployApi#repositoriesWorkspaceRepoSlugDeployKeysKeyIdPut");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
keyId String The key ID matching the deploy key.  
repoSlug String This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.  
workspace String This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.  

Return type

DeployKey

Authorization

api_keybasicoauth2

HTTP request headers

repositoriesWorkspaceRepoSlugDeployKeysPost

DeployKey repositoriesWorkspaceRepoSlugDeployKeysPost(repoSlug, workspace)

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\" } ```

Example

// Import classes:
//import com.rappi.bitbucket.client.invoker.ApiClient;
//import com.rappi.bitbucket.client.invoker.ApiException;
//import com.rappi.bitbucket.client.invoker.Configuration;
//import com.rappi.bitbucket.client.invoker.auth.*;
//import com.rappi.bitbucket.client.api.DeployApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
api_key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.setApiKeyPrefix("Token");
// Configure HTTP basic authorization: basic
HttpBasicAuth basic = (HttpBasicAuth) defaultClient.getAuthentication("basic");
basic.setUsername("YOUR USERNAME");
basic.setPassword("YOUR PASSWORD");

// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");

DeployApi apiInstance = new DeployApi();
String repoSlug = "repoSlug_example"; // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
String workspace = "workspace_example"; // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. 
try {
    DeployKey result = apiInstance.repositoriesWorkspaceRepoSlugDeployKeysPost(repoSlug, workspace);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DeployApi#repositoriesWorkspaceRepoSlugDeployKeysPost");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
repoSlug String This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.  
workspace String This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.  

Return type

DeployKey

Authorization

api_keybasicoauth2

HTTP request headers