Skip to content

Latest commit

 

History

History
3498 lines (2918 loc) · 208 KB

RepositoriesApi.md

File metadata and controls

3498 lines (2918 loc) · 208 KB

bitbucketopenapi.RepositoriesApi

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

Method HTTP request Description
create_repositories_by_username_by_repo_slug POST /repositories/{username}/{repo_slug}
create_repositories_by_username_by_repo_slug_commit_by_node_statuses_build POST /repositories/{username}/{repo_slug}/commit/{node}/statuses/build
create_repositories_by_username_by_repo_slug_forks POST /repositories/{username}/{repo_slug}/forks
create_repositories_by_username_by_repo_slug_hooks POST /repositories/{username}/{repo_slug}/hooks
create_repositories_by_username_by_repo_slug_src POST /repositories/{username}/{repo_slug}/src
delete_repositories_by_username_by_repo_slug DELETE /repositories/{username}/{repo_slug}
delete_repositories_by_username_by_repo_slug_hooks_by_uid DELETE /repositories/{username}/{repo_slug}/hooks/{uid}
get_repositories GET /repositories
get_repositories_by_username GET /repositories/{username}
get_repositories_by_username_by_repo_slug GET /repositories/{username}/{repo_slug}
get_repositories_by_username_by_repo_slug_commit_by_node_statuses GET /repositories/{username}/{repo_slug}/commit/{node}/statuses
get_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key GET /repositories/{username}/{repo_slug}/commit/{node}/statuses/build/{key}
get_repositories_by_username_by_repo_slug_filehistory_by_node_by_path GET /repositories/{username}/{repo_slug}/filehistory/{node}/{path}
get_repositories_by_username_by_repo_slug_forks GET /repositories/{username}/{repo_slug}/forks
get_repositories_by_username_by_repo_slug_hooks GET /repositories/{username}/{repo_slug}/hooks
get_repositories_by_username_by_repo_slug_hooks_by_uid GET /repositories/{username}/{repo_slug}/hooks/{uid}
get_repositories_by_username_by_repo_slug_pullrequests_by_pull_request_id_statuses GET /repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/statuses
get_repositories_by_username_by_repo_slug_src GET /repositories/{username}/{repo_slug}/src
get_repositories_by_username_by_repo_slug_src_by_node_by_path GET /repositories/{username}/{repo_slug}/src/{node}/{path}
get_repositories_by_username_by_repo_slug_watchers GET /repositories/{username}/{repo_slug}/watchers
get_user_permissions_repositories GET /user/permissions/repositories
update_repositories_by_username_by_repo_slug PUT /repositories/{username}/{repo_slug}
update_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key PUT /repositories/{username}/{repo_slug}/commit/{node}/statuses/build/{key}
update_repositories_by_username_by_repo_slug_hooks_by_uid PUT /repositories/{username}/{repo_slug}/hooks/{uid}

create_repositories_by_username_by_repo_slug

Repository create_repositories_by_username_by_repo_slug(username, repo_slug, body=body)

Creates a new repository. Note: In order to set the project for the newly created repository, pass in either the project key or the project UUID as part of the request body as shown in the examples below: $ curl -X POST -H \"Content-Type: application/json\" -d '{ \"scm\": \"git\", \"project\": { \"key\": \"MARS\" } }' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding or $ curl -X POST -H \"Content-Type: application/json\" -d '{ \"scm\": \"git\", \"project\": { \"key\": \"{ba516952-992a-4c2d-acbd-17d502922f96}\" } }' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding The project must only be assigned for repositories belonging to a team. If the repository owner is a team and the project is not provided, the repository is automatically assigned to the oldest project in the team. Note: In the examples above, the username teamsinspace, and/or the repository name hablanding can be replaced by UUIDs.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Repository() # Repository | The repository that is to be created. Note that most object elements are optional. Elements \"owner\" and \"full_name\" are ignored as the URL implies them. (optional)

try:
    api_response = api_instance.create_repositories_by_username_by_repo_slug(username, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Repository() # Repository | The repository that is to be created. Note that most object elements are optional. Elements \"owner\" and \"full_name\" are ignored as the URL implies them. (optional)

try:
    api_response = api_instance.create_repositories_by_username_by_repo_slug(username, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Repository() # Repository | The repository that is to be created. Note that most object elements are optional. Elements \"owner\" and \"full_name\" are ignored as the URL implies them. (optional)

try:
    api_response = api_instance.create_repositories_by_username_by_repo_slug(username, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug: %s\n" % e)

Parameters

Name Type Description Notes
username str 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.
repo_slug str This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
body Repository The repository that is to be created. Note that most object elements are optional. Elements "owner" and "full_name" are ignored as the URL implies them. [optional]

Return type

Repository

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The newly created repository. -
400 If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account. -
401 If the request was not authenticated. -

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

create_repositories_by_username_by_repo_slug_commit_by_node_statuses_build

Commitstatus create_repositories_by_username_by_repo_slug_commit_by_node_statuses_build(username, node, repo_slug, body=body)

Creates a new build status against the specified commit. If the specified key already exists, the existing status object will be overwritten. When creating a new commit status, you can use a URI template for the URL. Templates are URLs that contain variable names that Bitbucket will evaluate at runtime whenever the URL is displayed anywhere similar to parameter substitution in Bitbucket Connect. For example, one could use https://foo.com/builds/{repository.full_name} which Bitbucket will turn into https://foo.com/builds/foo/bar at render time. The context variables available are repository and commit.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
node = 'node_example' # str | The commit's SHA1.
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Commitstatus() # Commitstatus | The new commit status object. (optional)

try:
    api_response = api_instance.create_repositories_by_username_by_repo_slug_commit_by_node_statuses_build(username, node, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug_commit_by_node_statuses_build: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
node = 'node_example' # str | The commit's SHA1.
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Commitstatus() # Commitstatus | The new commit status object. (optional)

try:
    api_response = api_instance.create_repositories_by_username_by_repo_slug_commit_by_node_statuses_build(username, node, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug_commit_by_node_statuses_build: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
node = 'node_example' # str | The commit's SHA1.
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Commitstatus() # Commitstatus | The new commit status object. (optional)

try:
    api_response = api_instance.create_repositories_by_username_by_repo_slug_commit_by_node_statuses_build(username, node, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug_commit_by_node_statuses_build: %s\n" % e)

Parameters

Name Type Description Notes
username str 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.
node str The commit's SHA1.
repo_slug str This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
body Commitstatus The new commit status object. [optional]

Return type

Commitstatus

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 The newly created build status object. -
401 If the repository is private and the request was not authenticated. -
404 If the repository, commit, or build status key does not exist -

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

create_repositories_by_username_by_repo_slug_forks

Repository create_repositories_by_username_by_repo_slug_forks(username, repo_slug, body=body)

Creates a new fork of the specified repository. By default, forks are created under the authenticated user's account with the same name and slug of the original repository. $ curl -X POST -u jdoe https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/forks { \"scm\": \"git\", \"full_name\": \"jdoe/dogslow\", \"parent\": { \"full_name\": \"evzijst/dogslow\", ... }, ... } If you already have a repo with that name, then a 400 is returned and you'll need to specify a custom name for the new fork: $ curl -X POST -u jdoe https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/forks \\ -H 'Content-Type: application/json' -d '{ \"name\": \"dogslow_fork\" }' When you specify a value for name, it will also affect the slug. The slug is reflected in the repository URL of the new fork. It is derived from name by substituting non-ASCII characters, removes whitespace, and changes characters to lower case. For example, My repo would turn into my_repo. ## Forking a repository into a team account To create a fork into a team account, specify the new owner's account explicitly as part of the request body. This prevents forked repositories from being owned by the authenticated user submitting the request: $ curl -X POST -u jdoe https://api.bitbucket.org/2.0/repositories/atlassian/bbql/forks \\ -H 'Content-Type: application/json' -d '{ \"name\": \"bbql_fork\", \"owner\": { \"username\": \"atlassian\" } }' To fork a repository into the same team, also specify a new name. You need contributor access to create new forks within a team account. ## Change the properties of a new fork By default the fork inherits most of its properties from the parent. However, since the optional POST body document follows the normal repository JSON schema and you can override the new fork's properties. Properties that can be overridden include: * description * fork_policy * language * mainbranch * is_private (note that a private repo's fork_policy might prohibit the creation of public forks, in which is_private=False would fail) * has_issues (to initialize or disable the new repo's issue tracker -- note that the actual contents of the parent repository's issue tracker are not copied during forking) * has_wiki (to initialize or disable the new repo's wiki -- note that the actual contents of the parent repository's wiki are not copied during forking) * project (only teams have projects and when forking into a private project, the fork's is_private must be true) Properties that cannot be modified include: * scm * parent * full_name

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Repository() # Repository | A repository object. This can be left blank. (optional)

try:
    api_response = api_instance.create_repositories_by_username_by_repo_slug_forks(username, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug_forks: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Repository() # Repository | A repository object. This can be left blank. (optional)

try:
    api_response = api_instance.create_repositories_by_username_by_repo_slug_forks(username, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug_forks: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Repository() # Repository | A repository object. This can be left blank. (optional)

try:
    api_response = api_instance.create_repositories_by_username_by_repo_slug_forks(username, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug_forks: %s\n" % e)

Parameters

Name Type Description Notes
username str 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.
repo_slug str This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
body Repository A repository object. This can be left blank. [optional]

Return type

Repository

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 The newly created fork. * Location - The URL of the newly created fork

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

create_repositories_by_username_by_repo_slug_hooks

WebhookSubscription create_repositories_by_username_by_repo_slug_hooks(username, repo_slug)

Creates a new webhook on the specified repository. Example: $ curl -X POST -u credentials -H 'Content-Type: application/json' https://api.bitbucket.org/2.0/repositories/username/slug/hooks -d ' { \"description\": \"Webhook Description\", \"url\": \"https://example.com/\", \"active\": true, \"events\": [ \"repo:push\", \"issue:created\", \"issue:updated\" ] }' Note that this call requires the webhook scope, as well as any scope that applies to the events that the webhook subscribes to. In the example above that means: webhook, repository and issue. Also note that the url must properly resolve and cannot be an internal, non-routed address.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 

try:
    api_response = api_instance.create_repositories_by_username_by_repo_slug_hooks(username, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug_hooks: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 

try:
    api_response = api_instance.create_repositories_by_username_by_repo_slug_hooks(username, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug_hooks: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 

try:
    api_response = api_instance.create_repositories_by_username_by_repo_slug_hooks(username, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug_hooks: %s\n" % e)

Parameters

Name Type Description Notes
username str
repo_slug str

Return type

WebhookSubscription

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 If the webhook was registered successfully. * Location - The URL of new newly created webhook.
403 If the authenticated user does not have permission to install webhooks on the specified repository. -
404 If the repository does not exist. -

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

create_repositories_by_username_by_repo_slug_src

create_repositories_by_username_by_repo_slug_src(username, repo_slug, message=message, author=author, parents=parents, files=files, files2=files2, branch=branch)

This endpoint is used to create new commits in the repository by uploading files. To add a new file to a repository: $ curl https://api.bitbucket.org/2.0/repositories/username/slug/src \\ -F /repo/path/to/image.png=@image.png This will create a new commit on top of the main branch, inheriting the contents of the main branch, but adding (or overwriting) the image.png file to the repository in the /repo/path/to directory. To create a commit that deletes files, use the files parameter: $ curl https://api.bitbucket.org/2.0/repositories/username/slug/src \\ -F files=/file/to/delete/1.txt \\ -F files=/file/to/delete/2.txt You can add/modify/delete multiple files in a request. Rename/move a file by deleting the old path and adding the content at the new path. This endpoint accepts multipart/form-data (as in the examples above), as well as application/x-www-form-urlencoded. ## multipart/form-data A multipart/form-data post contains a series of "form fields" that identify both the individual files that are being uploaded, as well as additional, optional meta data. Files are uploaded in file form fields (those that have a Content-Disposition parameter) whose field names point to the remote path in the repository where the file should be stored. Path field names are always interpreted to be absolute from the root of the repository, regardless whether the client uses a leading slash (as the above curl example did). File contents are treated as bytes and are not decoded as text. The commit message, as well as other non-file meta data for the request, is sent along as normal form field elements. Meta data fields share the same namespace as the file objects. For multipart/form-data bodies that should not lead to any ambiguity, as the Content-Disposition header will contain the filename parameter to distinguish between a file named "message" and the commit message field. ## application/x-www-form-urlencoded It is also possible to upload new files using a simple application/x-www-form-urlencoded POST. This can be convenient when uploading pure text files: $ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src \\ --data-urlencode \"/path/to/me.txt=Lorem ipsum.\" \\ --data-urlencode \"message=Initial commit\" \\ --data-urlencode \"author=Erik van Zijst <erik.van.zijst@gmail.com>\" There could be a field name clash if a client were to upload a file named "message", as this filename clashes with the meta data property for the commit message. To avoid this and to upload files whose names clash with the meta data properties, use a leading slash for the files, e.g. curl --data-urlencode \"/message=file contents\". When an explicit slash is omitted for a file whose path matches that of a meta data parameter, then it is interpreted as meta data, not as a file. ## Executables and links While this API aims to facilitate the most common use cases, it is possible to perform some more advanced operations like creating a new symlink in the repository, or creating an executable file. Files can be supplied with a x-attributes value in the Content-Disposition header. For example, to upload an executable file, as well as create a symlink from README.txt to README: --===============1438169132528273974== Content-Type: text/plain; charset=\"us-ascii\" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-ID: \"bin/shutdown.sh\" Content-Disposition: attachment; filename=\"shutdown.sh\"; x-attributes:\"executable\" #!/bin/sh halt --===============1438169132528273974== Content-Type: text/plain; charset=\"us-ascii\" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-ID: \"/README.txt\" Content-Disposition: attachment; filename=\"README.txt\"; x-attributes:\"link\" README --===============1438169132528273974==-- Links are files that contain the target path and have x-attributes:\"link\" set. When overwriting links with files, or vice versa, the newly uploaded file determines both the new contents, as well as the attributes. That means uploading a file without specifying x-attributes=\"link\" will create a regular file, even if the parent commit hosted a symlink at the same path. The same applies to executables. When modifying an existing executable file, the form-data file element must include x-attributes=\"executable\" in order to preserve the executable status of the file. Note that this API does not support the creation or manipulation of subrepos / submodules.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
message = 'message_example' # str | The commit message. When omitted, Bitbucket uses a canned string. (optional)
author = 'author_example' # str |  The raw string to be used as the new commit's author. This string follows the format `Erik van Zijst <evzijst@atlassian.com>`.  When omitted, Bitbucket uses the authenticated user's full/display name and primary email address. Commits cannot be created anonymously. (optional)
parents = 'parents_example' # str |  A comma-separated list of SHA1s of the commits that should be the parents of the newly created commit.  When omitted, the new commit will inherit from and become a child of the main branch's tip/HEAD commit.  When more than one SHA1 is provided, the first SHA1 identifies the commit from which the content will be inherited.  When more than 2 parents are provided on a Mercurial repo, a 400 is returned as Mercurial does not support \"octopus merges\". (optional)
files = 'files_example' # str |  Optional field that declares the files that the request is manipulating. When adding a new file to a repo, or when overwriting an existing file, the client can just upload the full contents of the file in a normal form field and the use of this `files` meta data field is redundant. However, when the `files` field contains a file path that does not have a corresponding, identically-named form field, then Bitbucket interprets that as the client wanting to replace the named file with the null set and the file is deleted instead.  Paths in the repo that are referenced in neither files nor an individual file field, remain unchanged and carry over from the parent to the new commit.  This API does not support renaming as an explicit feature. To rename a file, simply delete it and recreate it under the new name in the same commit.  (optional)
files2 = 'files_example' # str |  The name of the branch that the new commit should be created on. When omitted, the commit will be created on top of the main branch and will become the main branch's new HEAD/tip.  When a branch name is provided that already exists in the repo, then the commit will be created on top of that branch. In this case, if a parent SHA1 was also provided, then it is asserted that the parent is the branch's tip/HEAD at the time the request is made. When this is not the case, a 409 is returned.  This API cannot be used to create new anonymous heads in Mercurial repos.  When a new branch name is specified (that does not already exist in the repo), and no parent SHA1s are provided, then the new commit will inherit from the current main branch's tip/HEAD commit, but not advance the main branch. The new commit will be the new branch. When the request also specifies a parent SHA1, then the new commit and branch are created directly on top of the parent commit, regardless of the state of the main branch.  When a branch name is not specified, but a parent SHA1 is provided, then Bitbucket asserts that it represents the main branch's current HEAD/tip, or a 409 is returned.  When a branch name is not specified and the repo is empty, the new commit will become the repo's root commit and will be on the main branch.  When a branch name is specified and the repo is empty, the new commit will become the repo's root commit and also define the repo's main branch going forward.  This API cannot be used to create additional root commits in non-empty repos.  The branch field cannot be repeated.  As a side effect, this API can be used to create a new branch without modifying any files, by specifying a new branch name in this field, together with parents, but omitting the files fields, while not sending any files. This will create a new commit and branch with the same contents as the first parent. The diff of this commit against its first parent will be empty.  (optional)
branch = 'branch_example' # str |  The name of the branch that the new commit should be created on. When omitted, the commit will be created on top of the main branch and will become the main branch's new head.  When a branch name is provided that already exists in the repo, then the commit will be created on top of that branch. In this case, *if* a parent SHA1 was also provided, then it is asserted that the parent is the branch's tip/HEAD at the time the request is made. When this is not the case, a 409 is returned.  This API cannot be used to create new anonymous heads in Mercurial repositories.  When a new branch name is specified (that does not already exist in the repo), and no parent SHA1s are provided, then the new commit will inherit from the current main branch's tip/HEAD commit, but not advance the main branch. The new commit will be the new branch. When the request *also* specifies a parent SHA1, then the new commit and branch are created directly on top of the parent commit, regardless of the state of the main branch.  When a branch name is not specified, but a parent SHA1 is provided, then Bitbucket asserts that it represents the main branch's current HEAD/tip, or a 409 is returned.  When a branch name is not specified and the repo is empty, the new commit will become the repo's root commit and will be on the main branch.  When a branch name is specified and the repo is empty, the new commit will become the repo's root commit and also define the repo's main branch going forward.  This API cannot be used to create additional root commits in non-empty repos.  The branch field cannot be repeated.  As a side effect, this API can be used to create a new branch without modifying any files, by specifying a new branch name in this field, together with `parents`, but omitting the `files` fields, while not sending any files. This will create a new commit and branch with the same contents as the first parent. The diff of this commit against its first parent will be empty.  (optional)

try:
    api_instance.create_repositories_by_username_by_repo_slug_src(username, repo_slug, message=message, author=author, parents=parents, files=files, files2=files2, branch=branch)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug_src: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
message = 'message_example' # str | The commit message. When omitted, Bitbucket uses a canned string. (optional)
author = 'author_example' # str |  The raw string to be used as the new commit's author. This string follows the format `Erik van Zijst <evzijst@atlassian.com>`.  When omitted, Bitbucket uses the authenticated user's full/display name and primary email address. Commits cannot be created anonymously. (optional)
parents = 'parents_example' # str |  A comma-separated list of SHA1s of the commits that should be the parents of the newly created commit.  When omitted, the new commit will inherit from and become a child of the main branch's tip/HEAD commit.  When more than one SHA1 is provided, the first SHA1 identifies the commit from which the content will be inherited.  When more than 2 parents are provided on a Mercurial repo, a 400 is returned as Mercurial does not support \"octopus merges\". (optional)
files = 'files_example' # str |  Optional field that declares the files that the request is manipulating. When adding a new file to a repo, or when overwriting an existing file, the client can just upload the full contents of the file in a normal form field and the use of this `files` meta data field is redundant. However, when the `files` field contains a file path that does not have a corresponding, identically-named form field, then Bitbucket interprets that as the client wanting to replace the named file with the null set and the file is deleted instead.  Paths in the repo that are referenced in neither files nor an individual file field, remain unchanged and carry over from the parent to the new commit.  This API does not support renaming as an explicit feature. To rename a file, simply delete it and recreate it under the new name in the same commit.  (optional)
files2 = 'files_example' # str |  The name of the branch that the new commit should be created on. When omitted, the commit will be created on top of the main branch and will become the main branch's new HEAD/tip.  When a branch name is provided that already exists in the repo, then the commit will be created on top of that branch. In this case, if a parent SHA1 was also provided, then it is asserted that the parent is the branch's tip/HEAD at the time the request is made. When this is not the case, a 409 is returned.  This API cannot be used to create new anonymous heads in Mercurial repos.  When a new branch name is specified (that does not already exist in the repo), and no parent SHA1s are provided, then the new commit will inherit from the current main branch's tip/HEAD commit, but not advance the main branch. The new commit will be the new branch. When the request also specifies a parent SHA1, then the new commit and branch are created directly on top of the parent commit, regardless of the state of the main branch.  When a branch name is not specified, but a parent SHA1 is provided, then Bitbucket asserts that it represents the main branch's current HEAD/tip, or a 409 is returned.  When a branch name is not specified and the repo is empty, the new commit will become the repo's root commit and will be on the main branch.  When a branch name is specified and the repo is empty, the new commit will become the repo's root commit and also define the repo's main branch going forward.  This API cannot be used to create additional root commits in non-empty repos.  The branch field cannot be repeated.  As a side effect, this API can be used to create a new branch without modifying any files, by specifying a new branch name in this field, together with parents, but omitting the files fields, while not sending any files. This will create a new commit and branch with the same contents as the first parent. The diff of this commit against its first parent will be empty.  (optional)
branch = 'branch_example' # str |  The name of the branch that the new commit should be created on. When omitted, the commit will be created on top of the main branch and will become the main branch's new head.  When a branch name is provided that already exists in the repo, then the commit will be created on top of that branch. In this case, *if* a parent SHA1 was also provided, then it is asserted that the parent is the branch's tip/HEAD at the time the request is made. When this is not the case, a 409 is returned.  This API cannot be used to create new anonymous heads in Mercurial repositories.  When a new branch name is specified (that does not already exist in the repo), and no parent SHA1s are provided, then the new commit will inherit from the current main branch's tip/HEAD commit, but not advance the main branch. The new commit will be the new branch. When the request *also* specifies a parent SHA1, then the new commit and branch are created directly on top of the parent commit, regardless of the state of the main branch.  When a branch name is not specified, but a parent SHA1 is provided, then Bitbucket asserts that it represents the main branch's current HEAD/tip, or a 409 is returned.  When a branch name is not specified and the repo is empty, the new commit will become the repo's root commit and will be on the main branch.  When a branch name is specified and the repo is empty, the new commit will become the repo's root commit and also define the repo's main branch going forward.  This API cannot be used to create additional root commits in non-empty repos.  The branch field cannot be repeated.  As a side effect, this API can be used to create a new branch without modifying any files, by specifying a new branch name in this field, together with `parents`, but omitting the `files` fields, while not sending any files. This will create a new commit and branch with the same contents as the first parent. The diff of this commit against its first parent will be empty.  (optional)

try:
    api_instance.create_repositories_by_username_by_repo_slug_src(username, repo_slug, message=message, author=author, parents=parents, files=files, files2=files2, branch=branch)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug_src: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
message = 'message_example' # str | The commit message. When omitted, Bitbucket uses a canned string. (optional)
author = 'author_example' # str |  The raw string to be used as the new commit's author. This string follows the format `Erik van Zijst <evzijst@atlassian.com>`.  When omitted, Bitbucket uses the authenticated user's full/display name and primary email address. Commits cannot be created anonymously. (optional)
parents = 'parents_example' # str |  A comma-separated list of SHA1s of the commits that should be the parents of the newly created commit.  When omitted, the new commit will inherit from and become a child of the main branch's tip/HEAD commit.  When more than one SHA1 is provided, the first SHA1 identifies the commit from which the content will be inherited.  When more than 2 parents are provided on a Mercurial repo, a 400 is returned as Mercurial does not support \"octopus merges\". (optional)
files = 'files_example' # str |  Optional field that declares the files that the request is manipulating. When adding a new file to a repo, or when overwriting an existing file, the client can just upload the full contents of the file in a normal form field and the use of this `files` meta data field is redundant. However, when the `files` field contains a file path that does not have a corresponding, identically-named form field, then Bitbucket interprets that as the client wanting to replace the named file with the null set and the file is deleted instead.  Paths in the repo that are referenced in neither files nor an individual file field, remain unchanged and carry over from the parent to the new commit.  This API does not support renaming as an explicit feature. To rename a file, simply delete it and recreate it under the new name in the same commit.  (optional)
files2 = 'files_example' # str |  The name of the branch that the new commit should be created on. When omitted, the commit will be created on top of the main branch and will become the main branch's new HEAD/tip.  When a branch name is provided that already exists in the repo, then the commit will be created on top of that branch. In this case, if a parent SHA1 was also provided, then it is asserted that the parent is the branch's tip/HEAD at the time the request is made. When this is not the case, a 409 is returned.  This API cannot be used to create new anonymous heads in Mercurial repos.  When a new branch name is specified (that does not already exist in the repo), and no parent SHA1s are provided, then the new commit will inherit from the current main branch's tip/HEAD commit, but not advance the main branch. The new commit will be the new branch. When the request also specifies a parent SHA1, then the new commit and branch are created directly on top of the parent commit, regardless of the state of the main branch.  When a branch name is not specified, but a parent SHA1 is provided, then Bitbucket asserts that it represents the main branch's current HEAD/tip, or a 409 is returned.  When a branch name is not specified and the repo is empty, the new commit will become the repo's root commit and will be on the main branch.  When a branch name is specified and the repo is empty, the new commit will become the repo's root commit and also define the repo's main branch going forward.  This API cannot be used to create additional root commits in non-empty repos.  The branch field cannot be repeated.  As a side effect, this API can be used to create a new branch without modifying any files, by specifying a new branch name in this field, together with parents, but omitting the files fields, while not sending any files. This will create a new commit and branch with the same contents as the first parent. The diff of this commit against its first parent will be empty.  (optional)
branch = 'branch_example' # str |  The name of the branch that the new commit should be created on. When omitted, the commit will be created on top of the main branch and will become the main branch's new head.  When a branch name is provided that already exists in the repo, then the commit will be created on top of that branch. In this case, *if* a parent SHA1 was also provided, then it is asserted that the parent is the branch's tip/HEAD at the time the request is made. When this is not the case, a 409 is returned.  This API cannot be used to create new anonymous heads in Mercurial repositories.  When a new branch name is specified (that does not already exist in the repo), and no parent SHA1s are provided, then the new commit will inherit from the current main branch's tip/HEAD commit, but not advance the main branch. The new commit will be the new branch. When the request *also* specifies a parent SHA1, then the new commit and branch are created directly on top of the parent commit, regardless of the state of the main branch.  When a branch name is not specified, but a parent SHA1 is provided, then Bitbucket asserts that it represents the main branch's current HEAD/tip, or a 409 is returned.  When a branch name is not specified and the repo is empty, the new commit will become the repo's root commit and will be on the main branch.  When a branch name is specified and the repo is empty, the new commit will become the repo's root commit and also define the repo's main branch going forward.  This API cannot be used to create additional root commits in non-empty repos.  The branch field cannot be repeated.  As a side effect, this API can be used to create a new branch without modifying any files, by specifying a new branch name in this field, together with `parents`, but omitting the `files` fields, while not sending any files. This will create a new commit and branch with the same contents as the first parent. The diff of this commit against its first parent will be empty.  (optional)

try:
    api_instance.create_repositories_by_username_by_repo_slug_src(username, repo_slug, message=message, author=author, parents=parents, files=files, files2=files2, branch=branch)
except ApiException as e:
    print("Exception when calling RepositoriesApi->create_repositories_by_username_by_repo_slug_src: %s\n" % e)

Parameters

Name Type Description Notes
username str
repo_slug str
message str The commit message. When omitted, Bitbucket uses a canned string. [optional]
author str The raw string to be used as the new commit's author. This string follows the format `Erik van Zijst <evzijst@atlassian.com>`. When omitted, Bitbucket uses the authenticated user's full/display name and primary email address. Commits cannot be created anonymously. [optional]
parents str A comma-separated list of SHA1s of the commits that should be the parents of the newly created commit. When omitted, the new commit will inherit from and become a child of the main branch's tip/HEAD commit. When more than one SHA1 is provided, the first SHA1 identifies the commit from which the content will be inherited. When more than 2 parents are provided on a Mercurial repo, a 400 is returned as Mercurial does not support &quot;octopus merges&quot;. [optional]
files str Optional field that declares the files that the request is manipulating. When adding a new file to a repo, or when overwriting an existing file, the client can just upload the full contents of the file in a normal form field and the use of this `files` meta data field is redundant. However, when the `files` field contains a file path that does not have a corresponding, identically-named form field, then Bitbucket interprets that as the client wanting to replace the named file with the null set and the file is deleted instead. Paths in the repo that are referenced in neither files nor an individual file field, remain unchanged and carry over from the parent to the new commit. This API does not support renaming as an explicit feature. To rename a file, simply delete it and recreate it under the new name in the same commit. [optional]
files2 str The name of the branch that the new commit should be created on. When omitted, the commit will be created on top of the main branch and will become the main branch's new HEAD/tip. When a branch name is provided that already exists in the repo, then the commit will be created on top of that branch. In this case, if a parent SHA1 was also provided, then it is asserted that the parent is the branch's tip/HEAD at the time the request is made. When this is not the case, a 409 is returned. This API cannot be used to create new anonymous heads in Mercurial repos. When a new branch name is specified (that does not already exist in the repo), and no parent SHA1s are provided, then the new commit will inherit from the current main branch's tip/HEAD commit, but not advance the main branch. The new commit will be the new branch. When the request also specifies a parent SHA1, then the new commit and branch are created directly on top of the parent commit, regardless of the state of the main branch. When a branch name is not specified, but a parent SHA1 is provided, then Bitbucket asserts that it represents the main branch's current HEAD/tip, or a 409 is returned. When a branch name is not specified and the repo is empty, the new commit will become the repo's root commit and will be on the main branch. When a branch name is specified and the repo is empty, the new commit will become the repo's root commit and also define the repo's main branch going forward. This API cannot be used to create additional root commits in non-empty repos. The branch field cannot be repeated. As a side effect, this API can be used to create a new branch without modifying any files, by specifying a new branch name in this field, together with parents, but omitting the files fields, while not sending any files. This will create a new commit and branch with the same contents as the first parent. The diff of this commit against its first parent will be empty. [optional]
branch str The name of the branch that the new commit should be created on. When omitted, the commit will be created on top of the main branch and will become the main branch's new head. When a branch name is provided that already exists in the repo, then the commit will be created on top of that branch. In this case, if a parent SHA1 was also provided, then it is asserted that the parent is the branch's tip/HEAD at the time the request is made. When this is not the case, a 409 is returned. This API cannot be used to create new anonymous heads in Mercurial repositories. When a new branch name is specified (that does not already exist in the repo), and no parent SHA1s are provided, then the new commit will inherit from the current main branch's tip/HEAD commit, but not advance the main branch. The new commit will be the new branch. When the request also specifies a parent SHA1, then the new commit and branch are created directly on top of the parent commit, regardless of the state of the main branch. When a branch name is not specified, but a parent SHA1 is provided, then Bitbucket asserts that it represents the main branch's current HEAD/tip, or a 409 is returned. When a branch name is not specified and the repo is empty, the new commit will become the repo's root commit and will be on the main branch. When a branch name is specified and the repo is empty, the new commit will become the repo's root commit and also define the repo's main branch going forward. This API cannot be used to create additional root commits in non-empty repos. The branch field cannot be repeated. As a side effect, this API can be used to create a new branch without modifying any files, by specifying a new branch name in this field, together with `parents`, but omitting the `files` fields, while not sending any files. This will create a new commit and branch with the same contents as the first parent. The diff of this commit against its first parent will be empty. [optional]

Return type

void (empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -
404 If the repository does not exist. -

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

delete_repositories_by_username_by_repo_slug

delete_repositories_by_username_by_repo_slug(username, repo_slug, redirect_to=redirect_to)

Deletes the repository. This is an irreversible operation. This does not affect its forks.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
redirect_to = 'redirect_to_example' # str | If a repository has been moved to a new location, use this parameter to show users a friendly message in the Bitbucket UI that the repository has moved to a new location. However, a GET to this endpoint will still return a 404.  (optional)

try:
    api_instance.delete_repositories_by_username_by_repo_slug(username, repo_slug, redirect_to=redirect_to)
except ApiException as e:
    print("Exception when calling RepositoriesApi->delete_repositories_by_username_by_repo_slug: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
redirect_to = 'redirect_to_example' # str | If a repository has been moved to a new location, use this parameter to show users a friendly message in the Bitbucket UI that the repository has moved to a new location. However, a GET to this endpoint will still return a 404.  (optional)

try:
    api_instance.delete_repositories_by_username_by_repo_slug(username, repo_slug, redirect_to=redirect_to)
except ApiException as e:
    print("Exception when calling RepositoriesApi->delete_repositories_by_username_by_repo_slug: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
redirect_to = 'redirect_to_example' # str | If a repository has been moved to a new location, use this parameter to show users a friendly message in the Bitbucket UI that the repository has moved to a new location. However, a GET to this endpoint will still return a 404.  (optional)

try:
    api_instance.delete_repositories_by_username_by_repo_slug(username, repo_slug, redirect_to=redirect_to)
except ApiException as e:
    print("Exception when calling RepositoriesApi->delete_repositories_by_username_by_repo_slug: %s\n" % e)

Parameters

Name Type Description Notes
username str 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.
repo_slug str This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
redirect_to str If a repository has been moved to a new location, use this parameter to show users a friendly message in the Bitbucket UI that the repository has moved to a new location. However, a GET to this endpoint will still return a 404. [optional]

Return type

void (empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Indicates successful deletion. -
403 If the caller either does not have admin access to the repository, or the repository is set to read-only. -
404 If the repository does not exist. -

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

delete_repositories_by_username_by_repo_slug_hooks_by_uid

delete_repositories_by_username_by_repo_slug_hooks_by_uid(username, repo_slug, uid)

Deletes the specified webhook subscription from the given repository.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
uid = 'uid_example' # str | The installed webhook's id

try:
    api_instance.delete_repositories_by_username_by_repo_slug_hooks_by_uid(username, repo_slug, uid)
except ApiException as e:
    print("Exception when calling RepositoriesApi->delete_repositories_by_username_by_repo_slug_hooks_by_uid: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
uid = 'uid_example' # str | The installed webhook's id

try:
    api_instance.delete_repositories_by_username_by_repo_slug_hooks_by_uid(username, repo_slug, uid)
except ApiException as e:
    print("Exception when calling RepositoriesApi->delete_repositories_by_username_by_repo_slug_hooks_by_uid: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
uid = 'uid_example' # str | The installed webhook's id

try:
    api_instance.delete_repositories_by_username_by_repo_slug_hooks_by_uid(username, repo_slug, uid)
except ApiException as e:
    print("Exception when calling RepositoriesApi->delete_repositories_by_username_by_repo_slug_hooks_by_uid: %s\n" % e)

Parameters

Name Type Description Notes
username str
repo_slug str
uid str The installed webhook's id

Return type

void (empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 When the webhook was deleted successfully -
403 If the authenticated user does not have permission to delete the webhook. -
404 If the webhook or repository does not exist. -

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

get_repositories

PaginatedRepositories get_repositories(after=after)

Returns a paginated list of all public repositories. This endpoint also supports filtering and sorting of the results. See filtering and sorting for more details.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
after = 'after_example' # str | Filter the results to include only repositories create on or after this [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)  timestamp. Example: `YYYY-MM-DDTHH:mm:ss.sssZ` (optional)

try:
    api_response = api_instance.get_repositories(after=after)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
after = 'after_example' # str | Filter the results to include only repositories create on or after this [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)  timestamp. Example: `YYYY-MM-DDTHH:mm:ss.sssZ` (optional)

try:
    api_response = api_instance.get_repositories(after=after)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
after = 'after_example' # str | Filter the results to include only repositories create on or after this [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)  timestamp. Example: `YYYY-MM-DDTHH:mm:ss.sssZ` (optional)

try:
    api_response = api_instance.get_repositories(after=after)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories: %s\n" % e)

Parameters

Name Type Description Notes
after str Filter the results to include only repositories create on or after this ISO-8601 timestamp. Example: `YYYY-MM-DDTHH:mm:ss.sssZ` [optional]

Return type

PaginatedRepositories

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 All public repositories. -

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

get_repositories_by_username

PaginatedRepositories get_repositories_by_username(username, role=role)

Returns a paginated list of all repositories owned by the specified account or UUID. The result can be narrowed down based on the authenticated user's role. E.g. with ?role=contributor, only those repositories that the authenticated user has write access to are returned (this includes any repo the user is an admin on, as that implies write access). This endpoint also supports filtering and sorting of the results. See filtering and sorting for more details.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
role = 'role_example' # str |  Filters the result based on the authenticated user's role on each repository.  * **member**: returns repositories to which the user has explicit read access * **contributor**: returns repositories to which the user has explicit write access * **admin**: returns repositories to which the user has explicit administrator access * **owner**: returns all repositories owned by the current user  (optional)

try:
    api_response = api_instance.get_repositories_by_username(username, role=role)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
role = 'role_example' # str |  Filters the result based on the authenticated user's role on each repository.  * **member**: returns repositories to which the user has explicit read access * **contributor**: returns repositories to which the user has explicit write access * **admin**: returns repositories to which the user has explicit administrator access * **owner**: returns all repositories owned by the current user  (optional)

try:
    api_response = api_instance.get_repositories_by_username(username, role=role)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
role = 'role_example' # str |  Filters the result based on the authenticated user's role on each repository.  * **member**: returns repositories to which the user has explicit read access * **contributor**: returns repositories to which the user has explicit write access * **admin**: returns repositories to which the user has explicit administrator access * **owner**: returns all repositories owned by the current user  (optional)

try:
    api_response = api_instance.get_repositories_by_username(username, role=role)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username: %s\n" % e)

Parameters

Name Type Description Notes
username str 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.
role str Filters the result based on the authenticated user's role on each repository. * member: returns repositories to which the user has explicit read access * contributor: returns repositories to which the user has explicit write access * admin: returns repositories to which the user has explicit administrator access * owner: returns all repositories owned by the current user [optional]

Return type

PaginatedRepositories

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The repositories owned by the specified account. -
404 If the specified account does not exist. -

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

get_repositories_by_username_by_repo_slug

Repository get_repositories_by_username_by_repo_slug(username, repo_slug)

Returns the object describing this repository.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug(username, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug(username, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug(username, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug: %s\n" % e)

Parameters

Name Type Description Notes
username str 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.
repo_slug str This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.

Return type

Repository

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The repository object. -
403 If the repository is private and the authenticated user does not have access to it. -
404 If no repository exists at this location. -

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

get_repositories_by_username_by_repo_slug_commit_by_node_statuses

PaginatedCommitstatuses get_repositories_by_username_by_repo_slug_commit_by_node_statuses(username, node, repo_slug)

Returns all statuses (e.g. build results) for a specific commit.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
node = 'node_example' # str | The commit's SHA1.
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_commit_by_node_statuses(username, node, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_commit_by_node_statuses: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
node = 'node_example' # str | The commit's SHA1.
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_commit_by_node_statuses(username, node, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_commit_by_node_statuses: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
node = 'node_example' # str | The commit's SHA1.
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_commit_by_node_statuses(username, node, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_commit_by_node_statuses: %s\n" % e)

Parameters

Name Type Description Notes
username str 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.
node str The commit's SHA1.
repo_slug str This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.

Return type

PaginatedCommitstatuses

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A paginated list of all commit statuses for this commit. -
401 If the repository is private and the request was not authenticated. -
404 If the repository or commit does not exist -

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

get_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key

Commitstatus get_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key(username, node, key, repo_slug)

Returns the specified build status for a commit.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
node = 'node_example' # str | The commit's SHA1.
key = 'key_example' # str | The build status' unique key
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key(username, node, key, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
node = 'node_example' # str | The commit's SHA1.
key = 'key_example' # str | The build status' unique key
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key(username, node, key, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
node = 'node_example' # str | The commit's SHA1.
key = 'key_example' # str | The build status' unique key
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key(username, node, key, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key: %s\n" % e)

Parameters

Name Type Description Notes
username str 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.
node str The commit's SHA1.
key str The build status' unique key
repo_slug str This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.

Return type

Commitstatus

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The build status object with the specified key. -
401 If the repository is private and the request was not authenticated. -
404 If the repository, commit, or build status key does not exist -

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

get_repositories_by_username_by_repo_slug_filehistory_by_node_by_path

PaginatedFiles get_repositories_by_username_by_repo_slug_filehistory_by_node_by_path(username, node, path, repo_slug, renames=renames, q=q, sort=sort)

Returns a paginated list of commits that modified the specified file. Commits are returned in reverse chronological order. This is roughly equivalent to the following commands: $ git log --follow --date-order $ hg log --follow By default, Bitbucket will follow renames and the path name in the returned entries reflects that. This can be turned off using the ?renames=false query parameter. Results are returned in descending chronological order by default, and like most endpoints you can filter and sort the response to only provide exactly the data you want. For example, if you wanted to find commits made before 2011-05-18 against a file named README.rst, but you only wanted the path and date, your query would look like this: $ curl 'https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/filehistory/master/README.rst'\\ '?fields=values.next,values.path,values.commit.date&q=commit.date<=2011-05-18' { \"values\": [ { \"commit\": { \"date\": \"2011-05-17T07:32:09+00:00\" }, \"path\": \"README.rst\" }, { \"commit\": { \"date\": \"2011-05-16T06:33:28+00:00\" }, \"path\": \"README.txt\" }, { \"commit\": { \"date\": \"2011-05-16T06:15:39+00:00\" }, \"path\": \"README.txt\" } ] } In the response you can see that the file was renamed to README.rst by the commit made on 2011-05-16, and was previously named README.txt.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
node = 'node_example' # str | 
path = 'path_example' # str | 
repo_slug = 'repo_slug_example' # str | 
renames = 'renames_example' # str |  When `true`, Bitbucket will follow the history of the file across renames (this is the default behavior). This can be turned off by specifying `false`. (optional)
q = 'q_example' # str |  Query string to narrow down the response as per [filtering and sorting](../../../../../../meta/filtering). (optional)
sort = 'sort_example' # str |  Name of a response property sort the result by as per [filtering and sorting](../../../../../../meta/filtering#query-sort).  (optional)

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_filehistory_by_node_by_path(username, node, path, repo_slug, renames=renames, q=q, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_filehistory_by_node_by_path: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
node = 'node_example' # str | 
path = 'path_example' # str | 
repo_slug = 'repo_slug_example' # str | 
renames = 'renames_example' # str |  When `true`, Bitbucket will follow the history of the file across renames (this is the default behavior). This can be turned off by specifying `false`. (optional)
q = 'q_example' # str |  Query string to narrow down the response as per [filtering and sorting](../../../../../../meta/filtering). (optional)
sort = 'sort_example' # str |  Name of a response property sort the result by as per [filtering and sorting](../../../../../../meta/filtering#query-sort).  (optional)

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_filehistory_by_node_by_path(username, node, path, repo_slug, renames=renames, q=q, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_filehistory_by_node_by_path: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
node = 'node_example' # str | 
path = 'path_example' # str | 
repo_slug = 'repo_slug_example' # str | 
renames = 'renames_example' # str |  When `true`, Bitbucket will follow the history of the file across renames (this is the default behavior). This can be turned off by specifying `false`. (optional)
q = 'q_example' # str |  Query string to narrow down the response as per [filtering and sorting](../../../../../../meta/filtering). (optional)
sort = 'sort_example' # str |  Name of a response property sort the result by as per [filtering and sorting](../../../../../../meta/filtering#query-sort).  (optional)

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_filehistory_by_node_by_path(username, node, path, repo_slug, renames=renames, q=q, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_filehistory_by_node_by_path: %s\n" % e)

Parameters

Name Type Description Notes
username str
node str
path str
repo_slug str
renames str When `true`, Bitbucket will follow the history of the file across renames (this is the default behavior). This can be turned off by specifying `false`. [optional]
q str Query string to narrow down the response as per filtering and sorting. [optional]
sort str Name of a response property sort the result by as per filtering and sorting. [optional]

Return type

PaginatedFiles

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A paginated list of commits that modified the specified file -
404 If the repository does not exist. -

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

get_repositories_by_username_by_repo_slug_forks

PaginatedRepositories get_repositories_by_username_by_repo_slug_forks(username, repo_slug)

Returns a paginated list of all the forks of the specified repository.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_forks(username, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_forks: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_forks(username, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_forks: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_forks(username, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_forks: %s\n" % e)

Parameters

Name Type Description Notes
username str 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.
repo_slug str This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.

Return type

PaginatedRepositories

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 All forks. -

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

get_repositories_by_username_by_repo_slug_hooks

PaginatedWebhookSubscriptions get_repositories_by_username_by_repo_slug_hooks(username, repo_slug)

Returns a paginated list of webhooks installed on this repository.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_hooks(username, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_hooks: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_hooks(username, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_hooks: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_hooks(username, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_hooks: %s\n" % e)

Parameters

Name Type Description Notes
username str
repo_slug str

Return type

PaginatedWebhookSubscriptions

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The paginated list of installed webhooks. -
403 If the authenticated user does not have permission to access the webhooks. -
404 If the repository does not exist. -

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

get_repositories_by_username_by_repo_slug_hooks_by_uid

WebhookSubscription get_repositories_by_username_by_repo_slug_hooks_by_uid(username, repo_slug, uid)

Returns the webhook with the specified id installed on the specified repository.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
uid = 'uid_example' # str | The installed webhook's id.

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_hooks_by_uid(username, repo_slug, uid)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_hooks_by_uid: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
uid = 'uid_example' # str | The installed webhook's id.

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_hooks_by_uid(username, repo_slug, uid)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_hooks_by_uid: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
uid = 'uid_example' # str | The installed webhook's id.

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_hooks_by_uid(username, repo_slug, uid)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_hooks_by_uid: %s\n" % e)

Parameters

Name Type Description Notes
username str
repo_slug str
uid str The installed webhook's id.

Return type

WebhookSubscription

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The webhook subscription object. -
404 If the webhook or repository does not exist. -

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

get_repositories_by_username_by_repo_slug_pullrequests_by_pull_request_id_statuses

PaginatedCommitstatuses get_repositories_by_username_by_repo_slug_pullrequests_by_pull_request_id_statuses(username, pull_request_id, repo_slug)

Returns all statuses (e.g. build results) for the given pull request.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
pull_request_id = 56 # int | The id of the pull request.
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_pullrequests_by_pull_request_id_statuses(username, pull_request_id, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_pullrequests_by_pull_request_id_statuses: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
pull_request_id = 56 # int | The id of the pull request.
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_pullrequests_by_pull_request_id_statuses(username, pull_request_id, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_pullrequests_by_pull_request_id_statuses: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
pull_request_id = 56 # int | The id of the pull request.
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_pullrequests_by_pull_request_id_statuses(username, pull_request_id, repo_slug)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_pullrequests_by_pull_request_id_statuses: %s\n" % e)

Parameters

Name Type Description Notes
username str 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.
pull_request_id int The id of the pull request.
repo_slug str This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.

Return type

PaginatedCommitstatuses

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A paginated list of all commit statuses for this pull request. -
401 If the repository is private and the request was not authenticated. -
404 If the specified repository or pull request does not exist. -

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

get_repositories_by_username_by_repo_slug_src

PaginatedTreeentries get_repositories_by_username_by_repo_slug_src(username, repo_slug, format=format)

This endpoint redirects the client to the directory listing of the root directory on the main branch. This is equivalent to directly hitting /2.0/repositories/{username}/{repo_slug}/src/{node}/{path} without having to know the name or SHA1 of the repo's main branch. To create new commits, POST to this endpoint

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
format = 'format_example' # str | Instead of returning the file's contents, return the (json) meta data for it. (optional)

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_src(username, repo_slug, format=format)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_src: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
format = 'format_example' # str | Instead of returning the file's contents, return the (json) meta data for it. (optional)

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_src(username, repo_slug, format=format)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_src: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
format = 'format_example' # str | Instead of returning the file's contents, return the (json) meta data for it. (optional)

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_src(username, repo_slug, format=format)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_src: %s\n" % e)

Parameters

Name Type Description Notes
username str
repo_slug str
format str Instead of returning the file's contents, return the (json) meta data for it. [optional]

Return type

PaginatedTreeentries

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 If the path matches a file, then the raw contents of the file are returned (unless the `format=meta` query parameter was provided, in which case a json document containing the file's meta data is returned). If the path matches a directory, then a paginated list of file and directory entries is returned (if the `format=meta` query parameter was provided, then the json document containing the directory's meta data is returned). -
404 If the path or commit in the URL does not exist. -

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

get_repositories_by_username_by_repo_slug_src_by_node_by_path

PaginatedTreeentries get_repositories_by_username_by_repo_slug_src_by_node_by_path(username, node, path, repo_slug, format=format, q=q, sort=sort, max_depth=max_depth)

This endpoints is used to retrieve the contents of a single file, or the contents of a directory at a specified revision. ## Raw file contents When path points to a file, this endpoint returns the raw contents. The response's Content-Type is derived from the filename extension (not from the contents). The file contents are not processed and no character encoding/recoding is performed and as a result no character encoding is included as part of the Content-Type. The Content-Disposition header will be "attachment" to prevent browsers from running executable files. If the file is managed by LFS, then a 301 redirect pointing to Atlassian's media services platform is returned. The response includes an ETag that is based on the contents of the file and its attributes. This means that an empty __init__.py always returns the same ETag, regardless on the directory it lives in, or the commit it is on. ## File meta data When the request for a file path includes the query parameter ?format=meta, instead of returning the file's raw contents, Bitbucket instead returns the JSON object describing the file's properties: javascript $ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef/tests/__init__.py?format=meta { \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py\" }, \"meta\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py?format=meta\" } }, \"path\": \"tests/__init__.py\", \"commit\": { \"type\": \"commit\", \"hash\": \"eefd5ef5d3df01aed629f650959d6706d54cd335\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335\" } } }, \"attributes\": [], \"type\": \"commit_file\", \"size\": 0 } File objects contain an attributes element that contains a list of possible modifiers. Currently defined values are: * link -- indicates that the entry is a symbolic link. The contents of the file represent the path the link points to. * executable -- indicates that the file has the executable bit set. * subrepository -- indicates that the entry points to a submodule or subrepo. The contents of the file is the SHA1 of the repository pointed to. * binary -- indicates whether Bitbucket thinks the file is binary. This endpoint can provide an alternative to how a HEAD request can be used to check for the existence of a file, or a file's size without incurring the overhead of receiving its full contents. ## Directory listings When path points to a directory instead of a file, the response is a paginated list of directory and file objects in the same order as the underlying SCM system would return them. For example: javascript $ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef/tests { \"pagelen\": 10, \"values\": [ { \"path\": \"tests/test_project\", \"type\": \"commit_directory\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/\" }, \"meta\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/?format=meta\" } }, \"commit\": { \"type\": \"commit\", \"hash\": \"eefd5ef5d3df01aed629f650959d6706d54cd335\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335\" } } } }, { \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py\" }, \"meta\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py?format=meta\" } }, \"path\": \"tests/__init__.py\", \"commit\": { \"type\": \"commit\", \"hash\": \"eefd5ef5d3df01aed629f650959d6706d54cd335\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335\" } } }, \"attributes\": [], \"type\": \"commit_file\", \"size\": 0 } ], \"page\": 1, \"size\": 2 } When listing the contents of the repo's root directory, the use of a trailing slash at the end of the URL is required. The response by default is not recursive, meaning that only the direct contents of a path are returned. The response does not recurse down into subdirectories. In order to "walk" the entire directory tree, the client can either parse each response and follow the self links of each commit_directory object, or can specify a max_depth to recurse to. The max_depth parameter will do a breadth-first search to return the contents of the subdirectories up to the depth specified. Breadth-first search was chosen as it leads to the least amount of file system operations for git. If the max_depth parameter is specified to be too large, the call will time out and return a 555. Each returned object is either a commit_file, or a commit_directory, both of which contain a path element. This path is the absolute path from the root of the repository. Each object also contains a commit object which embeds the commit the file is on. Note that this is merely the commit that was used in the URL. It is not the commit that last modified the file. Directory objects have 2 representations. Their self link returns the paginated contents of the directory. The meta link on the other hand returns the actual directory object itself, e.g.: javascript { \"path\": \"tests/test_project\", \"type\": \"commit_directory\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/\" }, \"meta\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/?format=meta\" } }, \"commit\": { ... } } ## Querying, filtering and sorting Like most API endpoints, this API supports the Bitbucket querying/filtering syntax and so you could filter a directory listing to only include entries that match certain criteria. For instance, to list all binary files over 1kb use the expression: size > 1024 and attributes = \"binary\" which after urlencoding yields the query string: ?q=size%3E1024+and+attributes%3D%22binary%22 To change the ordering of the response, use the ?sort parameter: .../src/eefd5ef/?sort=-size See filtering and sorting for more details.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
node = 'node_example' # str | 
path = 'path_example' # str | 
repo_slug = 'repo_slug_example' # str | 
format = 'format_example' # str | If 'meta' is provided, returns the (json) meta data for the contents of the file.  If 'rendered' is provided, returns the contents of a non-binary file in HTML-formatted rendered markup. Since Git and Mercurial do not generally track what text encoding scheme is used, this endpoint attempts to detect the most appropriate character encoding. While usually correct, determining the character encoding can be ambiguous which in exceptional cases can lead to misinterpretation of the characters. As such, the raw element in the response object should not be treated as equivalent to the file's actual contents. (optional)
q = 'q_example' # str | Optional filter expression as per [filtering and sorting](../../../../../../meta/filtering). (optional)
sort = 'sort_example' # str | Optional sorting parameter as per [filtering and sorting](../../../../../../meta/filtering#query-sort). (optional)
max_depth = 56 # int | If provided, returns the contents of the repository and its subdirectories recursively until the specified max_depth of nested directories. When omitted, this defaults to 1. (optional)

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_src_by_node_by_path(username, node, path, repo_slug, format=format, q=q, sort=sort, max_depth=max_depth)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_src_by_node_by_path: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
node = 'node_example' # str | 
path = 'path_example' # str | 
repo_slug = 'repo_slug_example' # str | 
format = 'format_example' # str | If 'meta' is provided, returns the (json) meta data for the contents of the file.  If 'rendered' is provided, returns the contents of a non-binary file in HTML-formatted rendered markup. Since Git and Mercurial do not generally track what text encoding scheme is used, this endpoint attempts to detect the most appropriate character encoding. While usually correct, determining the character encoding can be ambiguous which in exceptional cases can lead to misinterpretation of the characters. As such, the raw element in the response object should not be treated as equivalent to the file's actual contents. (optional)
q = 'q_example' # str | Optional filter expression as per [filtering and sorting](../../../../../../meta/filtering). (optional)
sort = 'sort_example' # str | Optional sorting parameter as per [filtering and sorting](../../../../../../meta/filtering#query-sort). (optional)
max_depth = 56 # int | If provided, returns the contents of the repository and its subdirectories recursively until the specified max_depth of nested directories. When omitted, this defaults to 1. (optional)

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_src_by_node_by_path(username, node, path, repo_slug, format=format, q=q, sort=sort, max_depth=max_depth)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_src_by_node_by_path: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
node = 'node_example' # str | 
path = 'path_example' # str | 
repo_slug = 'repo_slug_example' # str | 
format = 'format_example' # str | If 'meta' is provided, returns the (json) meta data for the contents of the file.  If 'rendered' is provided, returns the contents of a non-binary file in HTML-formatted rendered markup. Since Git and Mercurial do not generally track what text encoding scheme is used, this endpoint attempts to detect the most appropriate character encoding. While usually correct, determining the character encoding can be ambiguous which in exceptional cases can lead to misinterpretation of the characters. As such, the raw element in the response object should not be treated as equivalent to the file's actual contents. (optional)
q = 'q_example' # str | Optional filter expression as per [filtering and sorting](../../../../../../meta/filtering). (optional)
sort = 'sort_example' # str | Optional sorting parameter as per [filtering and sorting](../../../../../../meta/filtering#query-sort). (optional)
max_depth = 56 # int | If provided, returns the contents of the repository and its subdirectories recursively until the specified max_depth of nested directories. When omitted, this defaults to 1. (optional)

try:
    api_response = api_instance.get_repositories_by_username_by_repo_slug_src_by_node_by_path(username, node, path, repo_slug, format=format, q=q, sort=sort, max_depth=max_depth)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_src_by_node_by_path: %s\n" % e)

Parameters

Name Type Description Notes
username str
node str
path str
repo_slug str
format str If 'meta' is provided, returns the (json) meta data for the contents of the file. If 'rendered' is provided, returns the contents of a non-binary file in HTML-formatted rendered markup. Since Git and Mercurial do not generally track what text encoding scheme is used, this endpoint attempts to detect the most appropriate character encoding. While usually correct, determining the character encoding can be ambiguous which in exceptional cases can lead to misinterpretation of the characters. As such, the raw element in the response object should not be treated as equivalent to the file's actual contents. [optional]
q str Optional filter expression as per filtering and sorting. [optional]
sort str Optional sorting parameter as per filtering and sorting. [optional]
max_depth int If provided, returns the contents of the repository and its subdirectories recursively until the specified max_depth of nested directories. When omitted, this defaults to 1. [optional]

Return type

PaginatedTreeentries

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 If the path matches a file, then the raw contents of the file are returned. If the `format=meta` query parameter is provided, a json document containing the file's meta data is returned. If the `format=rendered` query parameter is provided, the contents of the file in HTML-formated rendered markup is returned. If the path matches a directory, then a paginated list of file and directory entries is returned (if the `format=meta` query parameter was provided, then the json document containing the directory's meta data is returned.) -
404 If the path or commit in the URL does not exist. -
555 If the call times out, possibly because the specifiedrecursion depth is too large. -

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

get_repositories_by_username_by_repo_slug_watchers

get_repositories_by_username_by_repo_slug_watchers(username, repo_slug)

Returns a paginated list of all the watchers on the specified repository.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_instance.get_repositories_by_username_by_repo_slug_watchers(username, repo_slug)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_watchers: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_instance.get_repositories_by_username_by_repo_slug_watchers(username, repo_slug)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_watchers: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 

try:
    api_instance.get_repositories_by_username_by_repo_slug_watchers(username, repo_slug)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_repositories_by_username_by_repo_slug_watchers: %s\n" % e)

Parameters

Name Type Description Notes
username str 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.
repo_slug str This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.

Return type

void (empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 A paginated list of all the watchers on the specified repository. -

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

get_user_permissions_repositories

PaginatedRepositoryPermissions get_user_permissions_repositories(q=q, sort=sort)

Returns an object for each repository the caller has explicit access to and their effective permission — the highest level of permission the caller has. This does not return public repositories that the user was not granted any specific permission in, and does not distinguish between direct and indirect privileges. Permissions can be: * admin * write * read Example: $ curl https://api.bitbucket.org/2.0/user/permissions/repositories { \"pagelen\": 10, \"values\": [ { \"type\": \"repository_permission\", \"user\": { \"type\": \"user\", \"username\": \"evzijst\", \"nickname\": \"evzijst\", \"display_name\": \"Erik van Zijst\", \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\" }, \"repository\": { \"type\": \"repository\", \"name\": \"geordi\", \"full_name\": \"bitbucket/geordi\", \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\" }, \"permission\": \"admin\" } ], \"page\": 1, \"size\": 1 } Results may be further filtered or sorted by repository or permission by adding the following query string parameters: * q=repository.name=\"geordi\" or q=permission>\"read\" * sort=repository.name Note that the query parameter values need to be URL escaped so that = would become %3D.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
q = 'q_example' # str |  Query string to narrow down the response as per [filtering and sorting](../../../meta/filtering). (optional)
sort = 'sort_example' # str |  Name of a response property sort the result by as per [filtering and sorting](../../../meta/filtering#query-sort).  (optional)

try:
    api_response = api_instance.get_user_permissions_repositories(q=q, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_user_permissions_repositories: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
q = 'q_example' # str |  Query string to narrow down the response as per [filtering and sorting](../../../meta/filtering). (optional)
sort = 'sort_example' # str |  Name of a response property sort the result by as per [filtering and sorting](../../../meta/filtering#query-sort).  (optional)

try:
    api_response = api_instance.get_user_permissions_repositories(q=q, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_user_permissions_repositories: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
q = 'q_example' # str |  Query string to narrow down the response as per [filtering and sorting](../../../meta/filtering). (optional)
sort = 'sort_example' # str |  Name of a response property sort the result by as per [filtering and sorting](../../../meta/filtering#query-sort).  (optional)

try:
    api_response = api_instance.get_user_permissions_repositories(q=q, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->get_user_permissions_repositories: %s\n" % e)

Parameters

Name Type Description Notes
q str Query string to narrow down the response as per filtering and sorting. [optional]
sort str Name of a response property sort the result by as per filtering and sorting. [optional]

Return type

PaginatedRepositoryPermissions

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Repository permissions for the repositories a caller has explicit access to. -

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

update_repositories_by_username_by_repo_slug

Repository update_repositories_by_username_by_repo_slug(username, repo_slug, body=body)

Since this endpoint can be used to both update and to create a repository, the request body depends on the intent. ### Creation See the POST documentation for the repository endpoint for an example of the request body. ### Update Note: Changing the name of the repository will cause the location to be changed. This is because the URL of the repo is derived from the name (a process called slugification). In such a scenario, it is possible for the request to fail if the newly created slug conflicts with an existing repository's slug. But if there is no conflict, the new location will be returned in the Location header of the response.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Repository() # Repository | The repository that is to be updated.  Note that the elements \"owner\" and \"full_name\" are ignored since the URL implies them.  (optional)

try:
    api_response = api_instance.update_repositories_by_username_by_repo_slug(username, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->update_repositories_by_username_by_repo_slug: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Repository() # Repository | The repository that is to be updated.  Note that the elements \"owner\" and \"full_name\" are ignored since the URL implies them.  (optional)

try:
    api_response = api_instance.update_repositories_by_username_by_repo_slug(username, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->update_repositories_by_username_by_repo_slug: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Repository() # Repository | The repository that is to be updated.  Note that the elements \"owner\" and \"full_name\" are ignored since the URL implies them.  (optional)

try:
    api_response = api_instance.update_repositories_by_username_by_repo_slug(username, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->update_repositories_by_username_by_repo_slug: %s\n" % e)

Parameters

Name Type Description Notes
username str 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.
repo_slug str This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
body Repository The repository that is to be updated. Note that the elements &quot;owner&quot; and &quot;full_name&quot; are ignored since the URL implies them. [optional]

Return type

Repository

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The existing repository has been updated * Location - The location of the repository. This header is only provided when the repository's name is changed.
201 A new repository has been created * Location - The location of the newly created repository
400 If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account. -
401 If the request was not authenticated. -

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

update_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key

Commitstatus update_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key(username, node, key, repo_slug, body=body)

Used to update the current status of a build status object on the specific commit. This operation can also be used to change other properties of the build status: * state * name * description * url * refname The key cannot be changed.

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
node = 'node_example' # str | The commit's SHA1.
key = 'key_example' # str | The build status' unique key
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Commitstatus() # Commitstatus | The updated build status object (optional)

try:
    api_response = api_instance.update_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key(username, node, key, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->update_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
node = 'node_example' # str | The commit's SHA1.
key = 'key_example' # str | The build status' unique key
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Commitstatus() # Commitstatus | The updated build status object (optional)

try:
    api_response = api_instance.update_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key(username, node, key, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->update_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 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. 
node = 'node_example' # str | The commit's SHA1.
key = 'key_example' # str | The build status' unique key
repo_slug = 'repo_slug_example' # str | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. 
body = bitbucketopenapi.Commitstatus() # Commitstatus | The updated build status object (optional)

try:
    api_response = api_instance.update_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key(username, node, key, repo_slug, body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->update_repositories_by_username_by_repo_slug_commit_by_node_statuses_build_by_key: %s\n" % e)

Parameters

Name Type Description Notes
username str 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.
node str The commit's SHA1.
key str The build status' unique key
repo_slug str This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
body Commitstatus The updated build status object [optional]

Return type

Commitstatus

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The updated build status object. -
401 If the repository is private and the request was not authenticated. -
404 If the repository or build does not exist -

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

update_repositories_by_username_by_repo_slug_hooks_by_uid

WebhookSubscription update_repositories_by_username_by_repo_slug_hooks_by_uid(username, repo_slug, uid)

Updates the specified webhook subscription. The following properties can be mutated: * description * url * active * events

Example

  • 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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
uid = 'uid_example' # str | The installed webhook's id

try:
    api_response = api_instance.update_repositories_by_username_by_repo_slug_hooks_by_uid(username, repo_slug, uid)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->update_repositories_by_username_by_repo_slug_hooks_by_uid: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
uid = 'uid_example' # str | The installed webhook's id

try:
    api_response = api_instance.update_repositories_by_username_by_repo_slug_hooks_by_uid(username, repo_slug, uid)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->update_repositories_by_username_by_repo_slug_hooks_by_uid: %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.RepositoriesApi(bitbucketopenapi.ApiClient(configuration))
username = 'username_example' # str | 
repo_slug = 'repo_slug_example' # str | 
uid = 'uid_example' # str | The installed webhook's id

try:
    api_response = api_instance.update_repositories_by_username_by_repo_slug_hooks_by_uid(username, repo_slug, uid)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RepositoriesApi->update_repositories_by_username_by_repo_slug_hooks_by_uid: %s\n" % e)

Parameters

Name Type Description Notes
username str
repo_slug str
uid str The installed webhook's id

Return type

WebhookSubscription

Authorization

api_key, basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The webhook subscription object. -
403 If the authenticated user does not have permission to update the webhook. -
404 If the webhook or repository does not exist. -

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