Skip to content

Latest commit

 

History

History
250 lines (191 loc) · 8.26 KB

BranchesApi.md

File metadata and controls

250 lines (191 loc) · 8.26 KB

jiaozifs_client.BranchesApi

All URIs are relative to http://localhost:34913/api/v1

Method HTTP request Description
create_branch POST /repos/{owner}/{repository}/branch create branch
delete_branch DELETE /repos/{owner}/{repository}/branch delete branch
get_branch GET /repos/{owner}/{repository}/branch get branch
list_branches GET /repos/{owner}/{repository}/branches list branches

create_branch

Branch create_branch(body, owner, repository)

create branch

Example

from __future__ import print_function
import time
import jiaozifs_client
from jiaozifs_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic_auth
configuration = jiaozifs_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: cookie_auth
configuration = jiaozifs_client.Configuration()
configuration.api_key['internal_auth_session'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['internal_auth_session'] = 'Bearer'

# create an instance of the API class
api_instance = jiaozifs_client.BranchesApi(jiaozifs_client.ApiClient(configuration))
body = jiaozifs_client.BranchCreation() # BranchCreation | 
owner = 'owner_example' # str | 
repository = 'repository_example' # str | 

try:
    # create branch
    api_response = api_instance.create_branch(body, owner, repository)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BranchesApi->create_branch: %s\n" % e)

Parameters

Name Type Description Notes
body BranchCreation
owner str
repository str

Return type

Branch

Authorization

basic_auth, cookie_auth, jwt_token

HTTP request headers

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

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

delete_branch

delete_branch(owner, repository, ref_name)

delete branch

Example

from __future__ import print_function
import time
import jiaozifs_client
from jiaozifs_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic_auth
configuration = jiaozifs_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: cookie_auth
configuration = jiaozifs_client.Configuration()
configuration.api_key['internal_auth_session'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['internal_auth_session'] = 'Bearer'

# create an instance of the API class
api_instance = jiaozifs_client.BranchesApi(jiaozifs_client.ApiClient(configuration))
owner = 'owner_example' # str | 
repository = 'repository_example' # str | 
ref_name = 'ref_name_example' # str | 

try:
    # delete branch
    api_instance.delete_branch(owner, repository, ref_name)
except ApiException as e:
    print("Exception when calling BranchesApi->delete_branch: %s\n" % e)

Parameters

Name Type Description Notes
owner str
repository str
ref_name str

Return type

void (empty response body)

Authorization

basic_auth, cookie_auth, jwt_token

HTTP request headers

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

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

get_branch

Branch get_branch(owner, repository, ref_name)

get branch

Example

from __future__ import print_function
import time
import jiaozifs_client
from jiaozifs_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic_auth
configuration = jiaozifs_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: cookie_auth
configuration = jiaozifs_client.Configuration()
configuration.api_key['internal_auth_session'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['internal_auth_session'] = 'Bearer'

# create an instance of the API class
api_instance = jiaozifs_client.BranchesApi(jiaozifs_client.ApiClient(configuration))
owner = 'owner_example' # str | 
repository = 'repository_example' # str | 
ref_name = 'ref_name_example' # str | 

try:
    # get branch
    api_response = api_instance.get_branch(owner, repository, ref_name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BranchesApi->get_branch: %s\n" % e)

Parameters

Name Type Description Notes
owner str
repository str
ref_name str

Return type

Branch

Authorization

basic_auth, cookie_auth, jwt_token

HTTP request headers

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

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

list_branches

BranchList list_branches(owner, repository, prefix=prefix, after=after, amount=amount)

list branches

Example

from __future__ import print_function
import time
import jiaozifs_client
from jiaozifs_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic_auth
configuration = jiaozifs_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: cookie_auth
configuration = jiaozifs_client.Configuration()
configuration.api_key['internal_auth_session'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['internal_auth_session'] = 'Bearer'

# create an instance of the API class
api_instance = jiaozifs_client.BranchesApi(jiaozifs_client.ApiClient(configuration))
owner = 'owner_example' # str | 
repository = 'repository_example' # str | 
prefix = 'prefix_example' # str | return items prefixed with this value (optional)
after = 'after_example' # str | return items after this value (optional)
amount = 100 # int | how many items to return (optional) (default to 100)

try:
    # list branches
    api_response = api_instance.list_branches(owner, repository, prefix=prefix, after=after, amount=amount)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling BranchesApi->list_branches: %s\n" % e)

Parameters

Name Type Description Notes
owner str
repository str
prefix str return items prefixed with this value [optional]
after str return items after this value [optional]
amount int how many items to return [optional] [default to 100]

Return type

BranchList

Authorization

basic_auth, cookie_auth, jwt_token

HTTP request headers

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

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