28 KiB
giteapython.AdminApi
All URIs are relative to http://localhost/api/v1
Method | HTTP request | Description |
---|---|---|
admin_create_org | POST /admin/users/{username}/orgs | Create an organization |
admin_create_public_key | POST /admin/users/{username}/keys | Add a public key on behalf of a user |
admin_create_repo | POST /admin/users/{username}/repos | Create a repository on behalf of a user |
admin_create_user | POST /admin/users | Create a user |
admin_delete_user | DELETE /admin/users/{username} | Delete a user |
admin_delete_user_public_key | DELETE /admin/users/{username}/keys/{id} | Delete a user's public key |
admin_edit_user | PATCH /admin/users/{username} | Edit an existing user |
admin_get_all_orgs | GET /admin/orgs | List all organizations |
admin_get_all_users | GET /admin/users | List all users |
admin_create_org
Organization admin_create_org(username, organization)
Create an organization
Example
from __future__ import print_function
import time
import giteapython
from giteapython.rest import ApiException
from pprint import pprint
# Configure API key authorization: AccessToken
configuration = giteapython.Configuration()
configuration.api_key['access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['access_token'] = 'Bearer'
# Configure API key authorization: AuthorizationHeaderToken
configuration = giteapython.Configuration()
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'
# Configure HTTP basic authorization: BasicAuth
configuration = giteapython.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: SudoHeader
configuration = giteapython.Configuration()
configuration.api_key['Sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Sudo'] = 'Bearer'
# Configure API key authorization: SudoParam
configuration = giteapython.Configuration()
configuration.api_key['sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['sudo'] = 'Bearer'
# Configure API key authorization: Token
configuration = giteapython.Configuration()
configuration.api_key['token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'
# create an instance of the API class
api_instance = giteapython.AdminApi(giteapython.ApiClient(configuration))
username = 'username_example' # str | username of the user that will own the created organization
organization = giteapython.CreateOrgOption() # CreateOrgOption |
try:
# Create an organization
api_response = api_instance.admin_create_org(username, organization)
pprint(api_response)
except ApiException as e:
print("Exception when calling AdminApi->admin_create_org: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | str | username of the user that will own the created organization | |
organization | CreateOrgOption |
Return type
Authorization
AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, 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]
admin_create_public_key
PublicKey admin_create_public_key(username, key=key)
Add a public key on behalf of a user
Example
from __future__ import print_function
import time
import giteapython
from giteapython.rest import ApiException
from pprint import pprint
# Configure API key authorization: AccessToken
configuration = giteapython.Configuration()
configuration.api_key['access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['access_token'] = 'Bearer'
# Configure API key authorization: AuthorizationHeaderToken
configuration = giteapython.Configuration()
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'
# Configure HTTP basic authorization: BasicAuth
configuration = giteapython.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: SudoHeader
configuration = giteapython.Configuration()
configuration.api_key['Sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Sudo'] = 'Bearer'
# Configure API key authorization: SudoParam
configuration = giteapython.Configuration()
configuration.api_key['sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['sudo'] = 'Bearer'
# Configure API key authorization: Token
configuration = giteapython.Configuration()
configuration.api_key['token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'
# create an instance of the API class
api_instance = giteapython.AdminApi(giteapython.ApiClient(configuration))
username = 'username_example' # str | username of the user
key = giteapython.CreateKeyOption() # CreateKeyOption | (optional)
try:
# Add a public key on behalf of a user
api_response = api_instance.admin_create_public_key(username, key=key)
pprint(api_response)
except ApiException as e:
print("Exception when calling AdminApi->admin_create_public_key: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | str | username of the user | |
key | CreateKeyOption | [optional] |
Return type
Authorization
AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, 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]
admin_create_repo
Repository admin_create_repo(username, repository)
Create a repository on behalf of a user
Example
from __future__ import print_function
import time
import giteapython
from giteapython.rest import ApiException
from pprint import pprint
# Configure API key authorization: AccessToken
configuration = giteapython.Configuration()
configuration.api_key['access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['access_token'] = 'Bearer'
# Configure API key authorization: AuthorizationHeaderToken
configuration = giteapython.Configuration()
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'
# Configure HTTP basic authorization: BasicAuth
configuration = giteapython.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: SudoHeader
configuration = giteapython.Configuration()
configuration.api_key['Sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Sudo'] = 'Bearer'
# Configure API key authorization: SudoParam
configuration = giteapython.Configuration()
configuration.api_key['sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['sudo'] = 'Bearer'
# Configure API key authorization: Token
configuration = giteapython.Configuration()
configuration.api_key['token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'
# create an instance of the API class
api_instance = giteapython.AdminApi(giteapython.ApiClient(configuration))
username = 'username_example' # str | username of the user. This user will own the created repository
repository = giteapython.CreateRepoOption() # CreateRepoOption |
try:
# Create a repository on behalf of a user
api_response = api_instance.admin_create_repo(username, repository)
pprint(api_response)
except ApiException as e:
print("Exception when calling AdminApi->admin_create_repo: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | str | username of the user. This user will own the created repository | |
repository | CreateRepoOption |
Return type
Authorization
AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, 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]
admin_create_user
User admin_create_user(body=body)
Create a user
Example
from __future__ import print_function
import time
import giteapython
from giteapython.rest import ApiException
from pprint import pprint
# Configure API key authorization: AccessToken
configuration = giteapython.Configuration()
configuration.api_key['access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['access_token'] = 'Bearer'
# Configure API key authorization: AuthorizationHeaderToken
configuration = giteapython.Configuration()
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'
# Configure HTTP basic authorization: BasicAuth
configuration = giteapython.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: SudoHeader
configuration = giteapython.Configuration()
configuration.api_key['Sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Sudo'] = 'Bearer'
# Configure API key authorization: SudoParam
configuration = giteapython.Configuration()
configuration.api_key['sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['sudo'] = 'Bearer'
# Configure API key authorization: Token
configuration = giteapython.Configuration()
configuration.api_key['token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'
# create an instance of the API class
api_instance = giteapython.AdminApi(giteapython.ApiClient(configuration))
body = giteapython.CreateUserOption() # CreateUserOption | (optional)
try:
# Create a user
api_response = api_instance.admin_create_user(body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AdminApi->admin_create_user: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
body | CreateUserOption | [optional] |
Return type
Authorization
AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, 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]
admin_delete_user
admin_delete_user(username)
Delete a user
Example
from __future__ import print_function
import time
import giteapython
from giteapython.rest import ApiException
from pprint import pprint
# Configure API key authorization: AccessToken
configuration = giteapython.Configuration()
configuration.api_key['access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['access_token'] = 'Bearer'
# Configure API key authorization: AuthorizationHeaderToken
configuration = giteapython.Configuration()
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'
# Configure HTTP basic authorization: BasicAuth
configuration = giteapython.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: SudoHeader
configuration = giteapython.Configuration()
configuration.api_key['Sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Sudo'] = 'Bearer'
# Configure API key authorization: SudoParam
configuration = giteapython.Configuration()
configuration.api_key['sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['sudo'] = 'Bearer'
# Configure API key authorization: Token
configuration = giteapython.Configuration()
configuration.api_key['token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'
# create an instance of the API class
api_instance = giteapython.AdminApi(giteapython.ApiClient(configuration))
username = 'username_example' # str | username of user to delete
try:
# Delete a user
api_instance.admin_delete_user(username)
except ApiException as e:
print("Exception when calling AdminApi->admin_delete_user: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | str | username of user to delete |
Return type
void (empty response body)
Authorization
AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, Token
HTTP request headers
- Content-Type: application/json, text/plain
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
admin_delete_user_public_key
admin_delete_user_public_key(username, id)
Delete a user's public key
Example
from __future__ import print_function
import time
import giteapython
from giteapython.rest import ApiException
from pprint import pprint
# Configure API key authorization: AccessToken
configuration = giteapython.Configuration()
configuration.api_key['access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['access_token'] = 'Bearer'
# Configure API key authorization: AuthorizationHeaderToken
configuration = giteapython.Configuration()
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'
# Configure HTTP basic authorization: BasicAuth
configuration = giteapython.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: SudoHeader
configuration = giteapython.Configuration()
configuration.api_key['Sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Sudo'] = 'Bearer'
# Configure API key authorization: SudoParam
configuration = giteapython.Configuration()
configuration.api_key['sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['sudo'] = 'Bearer'
# Configure API key authorization: Token
configuration = giteapython.Configuration()
configuration.api_key['token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'
# create an instance of the API class
api_instance = giteapython.AdminApi(giteapython.ApiClient(configuration))
username = 'username_example' # str | username of user
id = 789 # int | id of the key to delete
try:
# Delete a user's public key
api_instance.admin_delete_user_public_key(username, id)
except ApiException as e:
print("Exception when calling AdminApi->admin_delete_user_public_key: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | str | username of user | |
id | int | id of the key to delete |
Return type
void (empty response body)
Authorization
AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, Token
HTTP request headers
- Content-Type: application/json, text/plain
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
admin_edit_user
User admin_edit_user(username, body=body)
Edit an existing user
Example
from __future__ import print_function
import time
import giteapython
from giteapython.rest import ApiException
from pprint import pprint
# Configure API key authorization: AccessToken
configuration = giteapython.Configuration()
configuration.api_key['access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['access_token'] = 'Bearer'
# Configure API key authorization: AuthorizationHeaderToken
configuration = giteapython.Configuration()
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'
# Configure HTTP basic authorization: BasicAuth
configuration = giteapython.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: SudoHeader
configuration = giteapython.Configuration()
configuration.api_key['Sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Sudo'] = 'Bearer'
# Configure API key authorization: SudoParam
configuration = giteapython.Configuration()
configuration.api_key['sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['sudo'] = 'Bearer'
# Configure API key authorization: Token
configuration = giteapython.Configuration()
configuration.api_key['token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'
# create an instance of the API class
api_instance = giteapython.AdminApi(giteapython.ApiClient(configuration))
username = 'username_example' # str | username of user to edit
body = giteapython.EditUserOption() # EditUserOption | (optional)
try:
# Edit an existing user
api_response = api_instance.admin_edit_user(username, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AdminApi->admin_edit_user: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
username | str | username of user to edit | |
body | EditUserOption | [optional] |
Return type
Authorization
AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, 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]
admin_get_all_orgs
list[Organization] admin_get_all_orgs(page=page, limit=limit)
List all organizations
Example
from __future__ import print_function
import time
import giteapython
from giteapython.rest import ApiException
from pprint import pprint
# Configure API key authorization: AccessToken
configuration = giteapython.Configuration()
configuration.api_key['access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['access_token'] = 'Bearer'
# Configure API key authorization: AuthorizationHeaderToken
configuration = giteapython.Configuration()
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'
# Configure HTTP basic authorization: BasicAuth
configuration = giteapython.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: SudoHeader
configuration = giteapython.Configuration()
configuration.api_key['Sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Sudo'] = 'Bearer'
# Configure API key authorization: SudoParam
configuration = giteapython.Configuration()
configuration.api_key['sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['sudo'] = 'Bearer'
# Configure API key authorization: Token
configuration = giteapython.Configuration()
configuration.api_key['token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'
# create an instance of the API class
api_instance = giteapython.AdminApi(giteapython.ApiClient(configuration))
page = 56 # int | page number of results to return (1-based) (optional)
limit = 56 # int | page size of results, maximum page size is 50 (optional)
try:
# List all organizations
api_response = api_instance.admin_get_all_orgs(page=page, limit=limit)
pprint(api_response)
except ApiException as e:
print("Exception when calling AdminApi->admin_get_all_orgs: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
page | int | page number of results to return (1-based) | [optional] |
limit | int | page size of results, maximum page size is 50 | [optional] |
Return type
Authorization
AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, Token
HTTP request headers
- Content-Type: application/json, text/plain
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
admin_get_all_users
list[User] admin_get_all_users(page=page, limit=limit)
List all users
Example
from __future__ import print_function
import time
import giteapython
from giteapython.rest import ApiException
from pprint import pprint
# Configure API key authorization: AccessToken
configuration = giteapython.Configuration()
configuration.api_key['access_token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['access_token'] = 'Bearer'
# Configure API key authorization: AuthorizationHeaderToken
configuration = giteapython.Configuration()
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'
# Configure HTTP basic authorization: BasicAuth
configuration = giteapython.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# Configure API key authorization: SudoHeader
configuration = giteapython.Configuration()
configuration.api_key['Sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Sudo'] = 'Bearer'
# Configure API key authorization: SudoParam
configuration = giteapython.Configuration()
configuration.api_key['sudo'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['sudo'] = 'Bearer'
# Configure API key authorization: Token
configuration = giteapython.Configuration()
configuration.api_key['token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'
# create an instance of the API class
api_instance = giteapython.AdminApi(giteapython.ApiClient(configuration))
page = 56 # int | page number of results to return (1-based) (optional)
limit = 56 # int | page size of results, maximum page size is 50 (optional)
try:
# List all users
api_response = api_instance.admin_get_all_users(page=page, limit=limit)
pprint(api_response)
except ApiException as e:
print("Exception when calling AdminApi->admin_get_all_users: %s\n" % e)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
page | int | page number of results to return (1-based) | [optional] |
limit | int | page size of results, maximum page size is 50 | [optional] |
Return type
Authorization
AccessToken, AuthorizationHeaderToken, BasicAuth, SudoHeader, SudoParam, Token
HTTP request headers
- Content-Type: application/json, text/plain
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]