All URIs are relative to https://api.bitbucket.org/2.0
Method | HTTP request | Description |
---|---|---|
create_users_by_username_sshkeys | POST /users/{username}/ssh-keys | |
delete_users_by_username_sshkeys | DELETE /users/{username}/ssh-keys/ | |
get_users_by_username_sshkeys | GET /users/{username}/ssh-keys | |
get_users_by_username_sshkeys_0 | GET /users/{username}/ssh-keys/ | |
update_users_by_username_sshkeys | PUT /users/{username}/ssh-keys/ |
SshAccountKey create_users_by_username_sshkeys(username, body=body)
Adds a new SSH public key to the specified user account and returns the resulting key. Example: $ curl -X POST -H \"Content-Type: application/json\" -d '{\"key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY user@myhost\"}' https://api.bitbucket.org/2.0/users/markadams-atl/ssh-keys { \"comment\": \"user@myhost\", \"created_on\": \"2018-03-14T13:17:05.196003+00:00\", \"key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY\", \"label\": \"\", \"last_used\": \"2018-03-20T13:18:05.196003+00:00\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/markadams-atl/ssh-keys/b15b6026-9c02-4626-b4ad-b905f99f763a\" } }, \"owner\": { \"display_name\": \"Mark Adams\", \"links\": { \"avatar\": { \"href\": \"https://bitbucket.org/account/markadams-atl/avatar/32/\" }, \"html\": { \"href\": \"https://bitbucket.org/markadams-atl/\" }, \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/markadams-atl\" } }, \"type\": \"user\", \"username\": \"markadams-atl\", \"nickname\": \"markadams-atl\", \"uuid\": \"{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}\" }, \"type\": \"ssh_key\", \"uuid\": \"{b15b6026-9c02-4626-b4ad-b905f99f763a}\" }
- Api Key Authentication (api_key):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's UUID, account_id, or username. Note that username has been deprecated due to [privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis).
body = bitbucketopenapi.SshAccountKey() # SshAccountKey | The new SSH key object. Note that the username property has been deprecated due to [privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis). (optional)
try:
api_response = api_instance.create_users_by_username_sshkeys(username, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling SshApi->create_users_by_username_sshkeys: %s\n" % e)
- Basic Authentication (basic):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's UUID, account_id, or username. Note that username has been deprecated due to [privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis).
body = bitbucketopenapi.SshAccountKey() # SshAccountKey | The new SSH key object. Note that the username property has been deprecated due to [privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis). (optional)
try:
api_response = api_instance.create_users_by_username_sshkeys(username, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling SshApi->create_users_by_username_sshkeys: %s\n" % e)
- OAuth Authentication (oauth2):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's UUID, account_id, or username. Note that username has been deprecated due to [privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis).
body = bitbucketopenapi.SshAccountKey() # SshAccountKey | The new SSH key object. Note that the username property has been deprecated due to [privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis). (optional)
try:
api_response = api_instance.create_users_by_username_sshkeys(username, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling SshApi->create_users_by_username_sshkeys: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
username | str | The account's UUID, account_id, or username. Note that username has been deprecated due to privacy changes. | |
body | SshAccountKey | The new SSH key object. Note that the username property has been deprecated due to privacy changes. | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | The newly created SSH key. | - |
400 | If the submitted key or related value is invalid | - |
403 | If the current user does not have permission to add a key for the specified user | - |
404 | If the specified user does not exist | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_users_by_username_sshkeys(username, key_id)
Deletes a specific SSH public key from a user's account Example: $ curl -X DELETE https://api.bitbucket.org/2.0/users/markadams-atl/ssh-keys/{b15b6026-9c02-4626-b4ad-b905f99f763a}
- Api Key Authentication (api_key):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's username or UUID.
key_id = 'key_id_example' # str | The SSH key's UUID value.
try:
api_instance.delete_users_by_username_sshkeys(username, key_id)
except ApiException as e:
print("Exception when calling SshApi->delete_users_by_username_sshkeys: %s\n" % e)
- Basic Authentication (basic):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's username or UUID.
key_id = 'key_id_example' # str | The SSH key's UUID value.
try:
api_instance.delete_users_by_username_sshkeys(username, key_id)
except ApiException as e:
print("Exception when calling SshApi->delete_users_by_username_sshkeys: %s\n" % e)
- OAuth Authentication (oauth2):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's username or UUID.
key_id = 'key_id_example' # str | The SSH key's UUID value.
try:
api_instance.delete_users_by_username_sshkeys(username, key_id)
except ApiException as e:
print("Exception when calling SshApi->delete_users_by_username_sshkeys: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
username | str | The account's username or UUID. | |
key_id | str | The SSH key's UUID value. |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | The key has been deleted | - |
400 | If the submitted key or related value is invalid | - |
403 | If the current user does not have permission to add a key for the specified user | - |
404 | If the specified user does not exist | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PaginatedSshUserKeys get_users_by_username_sshkeys(username)
Returns a paginated list of the user's SSH public keys. Example: $ curl https://api.bitbucket.org/2.0/users/markadams-atl/ssh-keys { \"page\": 1, \"pagelen\": 10, \"size\": 1, \"values\": [ { \"comment\": \"user@myhost\", \"created_on\": \"2018-03-14T13:17:05.196003+00:00\", \"key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY\", \"label\": \"\", \"last_used\": \"2018-03-20T13:18:05.196003+00:00\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/markadams-atl/ssh-keys/b15b6026-9c02-4626-b4ad-b905f99f763a\" } }, \"owner\": { \"display_name\": \"Mark Adams\", \"links\": { \"avatar\": { \"href\": \"https://bitbucket.org/account/markadams-atl/avatar/32/\" }, \"html\": { \"href\": \"https://bitbucket.org/markadams-atl/\" }, \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/markadams-atl\" } }, \"type\": \"user\", \"username\": \"markadams-atl\", \"nickname\": \"markadams-atl\", \"uuid\": \"{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}\" }, \"type\": \"ssh_key\", \"uuid\": \"{b15b6026-9c02-4626-b4ad-b905f99f763a}\" } ] }
- Api Key Authentication (api_key):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's UUID, account_id, or username. Note that username has been deprecated due to [privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis).
try:
api_response = api_instance.get_users_by_username_sshkeys(username)
pprint(api_response)
except ApiException as e:
print("Exception when calling SshApi->get_users_by_username_sshkeys: %s\n" % e)
- Basic Authentication (basic):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's UUID, account_id, or username. Note that username has been deprecated due to [privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis).
try:
api_response = api_instance.get_users_by_username_sshkeys(username)
pprint(api_response)
except ApiException as e:
print("Exception when calling SshApi->get_users_by_username_sshkeys: %s\n" % e)
- OAuth Authentication (oauth2):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's UUID, account_id, or username. Note that username has been deprecated due to [privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis).
try:
api_response = api_instance.get_users_by_username_sshkeys(username)
pprint(api_response)
except ApiException as e:
print("Exception when calling SshApi->get_users_by_username_sshkeys: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
username | str | The account's UUID, account_id, or username. Note that username has been deprecated due to privacy changes. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | A list of the SSH keys associated with the account. | - |
403 | If the specified user's keys are not accessible to the current user | - |
404 | If the specified user does not exist | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SshAccountKey get_users_by_username_sshkeys_0(username, key_id)
Returns a specific SSH public key belonging to a user. Example: $ curl https://api.bitbucket.org/2.0/users/markadams-atl/ssh-keys/{fbe4bbab-f6f7-4dde-956b-5c58323c54b3} { \"comment\": \"user@myhost\", \"created_on\": \"2018-03-14T13:17:05.196003+00:00\", \"key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY\", \"label\": \"\", \"last_used\": \"2018-03-20T13:18:05.196003+00:00\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/markadams-atl/ssh-keys/b15b6026-9c02-4626-b4ad-b905f99f763a\" } }, \"owner\": { \"display_name\": \"Mark Adams\", \"links\": { \"avatar\": { \"href\": \"https://bitbucket.org/account/markadams-atl/avatar/32/\" }, \"html\": { \"href\": \"https://bitbucket.org/markadams-atl/\" }, \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/markadams-atl\" } }, \"type\": \"user\", \"username\": \"markadams-atl\", \"nickname\": \"markadams-atl\", \"uuid\": \"{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}\" }, \"type\": \"ssh_key\", \"uuid\": \"{b15b6026-9c02-4626-b4ad-b905f99f763a}\" }
- Api Key Authentication (api_key):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's username or UUID.
key_id = 'key_id_example' # str | The SSH key's UUID value.
try:
api_response = api_instance.get_users_by_username_sshkeys_0(username, key_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling SshApi->get_users_by_username_sshkeys_0: %s\n" % e)
- Basic Authentication (basic):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's username or UUID.
key_id = 'key_id_example' # str | The SSH key's UUID value.
try:
api_response = api_instance.get_users_by_username_sshkeys_0(username, key_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling SshApi->get_users_by_username_sshkeys_0: %s\n" % e)
- OAuth Authentication (oauth2):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's username or UUID.
key_id = 'key_id_example' # str | The SSH key's UUID value.
try:
api_response = api_instance.get_users_by_username_sshkeys_0(username, key_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling SshApi->get_users_by_username_sshkeys_0: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
username | str | The account's username or UUID. | |
key_id | str | The SSH key's UUID value. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | The specific SSH key matching the user and UUID | - |
403 | If the specified user or key is not accessible to the current user | - |
404 | If the specified user or key does not exist | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SshAccountKey update_users_by_username_sshkeys(username, key_id, body=body)
Updates a specific SSH public key on a user's account Note: Only the 'comment' field can be updated using this API. To modify the key or comment values, you must delete and add the key again. Example: $ curl -X PUT -H \"Content-Type: application/json\" -d '{\"label\": \"Work key\"}' https://api.bitbucket.org/2.0/users/markadams-atl/ssh-keys/{b15b6026-9c02-4626-b4ad-b905f99f763a} { \"comment\": \"\", \"created_on\": \"2018-03-14T13:17:05.196003+00:00\", \"key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY\", \"label\": \"Work key\", \"last_used\": \"2018-03-20T13:18:05.196003+00:00\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/markadams-atl/ssh-keys/b15b6026-9c02-4626-b4ad-b905f99f763a\" } }, \"owner\": { \"display_name\": \"Mark Adams\", \"links\": { \"avatar\": { \"href\": \"https://bitbucket.org/account/markadams-atl/avatar/32/\" }, \"html\": { \"href\": \"https://bitbucket.org/markadams-atl/\" }, \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/markadams-atl\" } }, \"type\": \"user\", \"username\": \"markadams-atl\", \"nickname\": \"markadams-atl\", \"uuid\": \"{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}\" }, \"type\": \"ssh_key\", \"uuid\": \"{b15b6026-9c02-4626-b4ad-b905f99f763a}\" }
- Api Key Authentication (api_key):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's username or UUID.
key_id = 'key_id_example' # str | The SSH key's UUID value.
body = bitbucketopenapi.SshAccountKey() # SshAccountKey | The updated SSH key object (optional)
try:
api_response = api_instance.update_users_by_username_sshkeys(username, key_id, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling SshApi->update_users_by_username_sshkeys: %s\n" % e)
- Basic Authentication (basic):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's username or UUID.
key_id = 'key_id_example' # str | The SSH key's UUID value.
body = bitbucketopenapi.SshAccountKey() # SshAccountKey | The updated SSH key object (optional)
try:
api_response = api_instance.update_users_by_username_sshkeys(username, key_id, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling SshApi->update_users_by_username_sshkeys: %s\n" % e)
- OAuth Authentication (oauth2):
from __future__ import print_function
import time
import bitbucketopenapi
from bitbucketopenapi.rest import ApiException
from pprint import pprint
configuration = bitbucketopenapi.Configuration()
# Configure API key authorization: api_key
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
configuration = bitbucketopenapi.Configuration()
# Configure HTTP basic authorization: basic
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
configuration = bitbucketopenapi.Configuration()
# Configure OAuth2 access token for authorization: oauth2
configuration.access_token = 'YOUR_ACCESS_TOKEN'
# Defining host is optional and default to https://api.bitbucket.org/2.0
configuration.host = "https://api.bitbucket.org/2.0"
# Create an instance of the API class
api_instance = bitbucketopenapi.SshApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | The account's username or UUID.
key_id = 'key_id_example' # str | The SSH key's UUID value.
body = bitbucketopenapi.SshAccountKey() # SshAccountKey | The updated SSH key object (optional)
try:
api_response = api_instance.update_users_by_username_sshkeys(username, key_id, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling SshApi->update_users_by_username_sshkeys: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
username | str | The account's username or UUID. | |
key_id | str | The SSH key's UUID value. | |
body | SshAccountKey | The updated SSH key object | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | The newly updated SSH key. | - |
400 | If the submitted key or related value is invalid | - |
403 | If the current user does not have permission to add a key for the specified user | - |
404 | If the specified user does not exist | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]