2173 lines
87 KiB
Markdown
2173 lines
87 KiB
Markdown
# gitea.AdminApi
|
|
|
|
All URIs are relative to *https://localhost/api/v1*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**admin_add_user_badges**](AdminApi.md#admin_add_user_badges) | **POST** /admin/users/{username}/badges | Add a badge to a user
|
|
[**admin_adopt_repository**](AdminApi.md#admin_adopt_repository) | **POST** /admin/unadopted/{owner}/{repo} | Adopt unadopted files as a repository
|
|
[**admin_create_hook**](AdminApi.md#admin_create_hook) | **POST** /admin/hooks | Create a hook
|
|
[**admin_create_org**](AdminApi.md#admin_create_org) | **POST** /admin/users/{username}/orgs | Create an organization
|
|
[**admin_create_public_key**](AdminApi.md#admin_create_public_key) | **POST** /admin/users/{username}/keys | Add a public key on behalf of a user
|
|
[**admin_create_repo**](AdminApi.md#admin_create_repo) | **POST** /admin/users/{username}/repos | Create a repository on behalf of a user
|
|
[**admin_create_user**](AdminApi.md#admin_create_user) | **POST** /admin/users | Create a user
|
|
[**admin_cron_list**](AdminApi.md#admin_cron_list) | **GET** /admin/cron | List cron tasks
|
|
[**admin_cron_run**](AdminApi.md#admin_cron_run) | **POST** /admin/cron/{task} | Run cron task
|
|
[**admin_delete_hook**](AdminApi.md#admin_delete_hook) | **DELETE** /admin/hooks/{id} | Delete a hook
|
|
[**admin_delete_unadopted_repository**](AdminApi.md#admin_delete_unadopted_repository) | **DELETE** /admin/unadopted/{owner}/{repo} | Delete unadopted files
|
|
[**admin_delete_user**](AdminApi.md#admin_delete_user) | **DELETE** /admin/users/{username} | Delete a user
|
|
[**admin_delete_user_badges**](AdminApi.md#admin_delete_user_badges) | **DELETE** /admin/users/{username}/badges | Remove a badge from a user
|
|
[**admin_delete_user_public_key**](AdminApi.md#admin_delete_user_public_key) | **DELETE** /admin/users/{username}/keys/{id} | Delete a user's public key
|
|
[**admin_edit_hook**](AdminApi.md#admin_edit_hook) | **PATCH** /admin/hooks/{id} | Update a hook
|
|
[**admin_edit_user**](AdminApi.md#admin_edit_user) | **PATCH** /admin/users/{username} | Edit an existing user
|
|
[**admin_get_all_emails**](AdminApi.md#admin_get_all_emails) | **GET** /admin/emails | List all emails
|
|
[**admin_get_all_orgs**](AdminApi.md#admin_get_all_orgs) | **GET** /admin/orgs | List all organizations
|
|
[**admin_get_hook**](AdminApi.md#admin_get_hook) | **GET** /admin/hooks/{id} | Get a hook
|
|
[**admin_get_runner_registration_token**](AdminApi.md#admin_get_runner_registration_token) | **GET** /admin/runners/registration-token | Get an global actions runner registration token
|
|
[**admin_list_hooks**](AdminApi.md#admin_list_hooks) | **GET** /admin/hooks | List system's webhooks
|
|
[**admin_list_user_badges**](AdminApi.md#admin_list_user_badges) | **GET** /admin/users/{username}/badges | List a user's badges
|
|
[**admin_rename_user**](AdminApi.md#admin_rename_user) | **POST** /admin/users/{username}/rename | Rename a user
|
|
[**admin_search_emails**](AdminApi.md#admin_search_emails) | **GET** /admin/emails/search | Search all emails
|
|
[**admin_search_users**](AdminApi.md#admin_search_users) | **GET** /admin/users | Search users according filter conditions
|
|
[**admin_unadopted_list**](AdminApi.md#admin_unadopted_list) | **GET** /admin/unadopted | List unadopted repositories
|
|
|
|
|
|
# **admin_add_user_badges**
|
|
> admin_add_user_badges(username, body=body)
|
|
|
|
Add a badge to a user
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
username = 'username_example' # str | username of user
|
|
body = gitea.UserBadgeOption() # UserBadgeOption | (optional)
|
|
|
|
try:
|
|
# Add a badge to a user
|
|
api_instance.admin_add_user_badges(username, body=body)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_add_user_badges: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**username** | **str**| username of user |
|
|
**body** | [**UserBadgeOption**](UserBadgeOption.md)| | [optional]
|
|
|
|
### Return type
|
|
|
|
void (empty response body)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_adopt_repository**
|
|
> admin_adopt_repository(owner, repo)
|
|
|
|
Adopt unadopted files as a repository
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
owner = 'owner_example' # str | owner of the repo
|
|
repo = 'repo_example' # str | name of the repo
|
|
|
|
try:
|
|
# Adopt unadopted files as a repository
|
|
api_instance.admin_adopt_repository(owner, repo)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_adopt_repository: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**owner** | **str**| owner of the repo |
|
|
**repo** | **str**| name of the repo |
|
|
|
|
### Return type
|
|
|
|
void (empty response body)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_create_hook**
|
|
> Hook admin_create_hook(body)
|
|
|
|
Create a hook
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
body = gitea.CreateHookOption() # CreateHookOption |
|
|
|
|
try:
|
|
# Create a hook
|
|
api_response = api_instance.admin_create_hook(body)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_create_hook: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**body** | [**CreateHookOption**](CreateHookOption.md)| |
|
|
|
|
### Return type
|
|
|
|
[**Hook**](Hook.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_create_org**
|
|
> Organization admin_create_org(username, organization)
|
|
|
|
Create an organization
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
username = 'username_example' # str | username of the user that will own the created organization
|
|
organization = gitea.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**](CreateOrgOption.md)| |
|
|
|
|
### Return type
|
|
|
|
[**Organization**](Organization.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_create_public_key**
|
|
> PublicKey admin_create_public_key(username, key=key)
|
|
|
|
Add a public key on behalf of a user
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
username = 'username_example' # str | username of the user
|
|
key = gitea.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**](CreateKeyOption.md)| | [optional]
|
|
|
|
### Return type
|
|
|
|
[**PublicKey**](PublicKey.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_create_repo**
|
|
> Repository admin_create_repo(username, repository)
|
|
|
|
Create a repository on behalf of a user
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
username = 'username_example' # str | username of the user. This user will own the created repository
|
|
repository = gitea.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**](CreateRepoOption.md)| |
|
|
|
|
### Return type
|
|
|
|
[**Repository**](Repository.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_create_user**
|
|
> User admin_create_user(body=body)
|
|
|
|
Create a user
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
body = gitea.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**](CreateUserOption.md)| | [optional]
|
|
|
|
### Return type
|
|
|
|
[**User**](User.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_cron_list**
|
|
> list[Cron] admin_cron_list(page=page, limit=limit)
|
|
|
|
List cron tasks
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
page = 56 # int | page number of results to return (1-based) (optional)
|
|
limit = 56 # int | page size of results (optional)
|
|
|
|
try:
|
|
# List cron tasks
|
|
api_response = api_instance.admin_cron_list(page=page, limit=limit)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_cron_list: %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 | [optional]
|
|
|
|
### Return type
|
|
|
|
[**list[Cron]**](Cron.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_cron_run**
|
|
> admin_cron_run(task)
|
|
|
|
Run cron task
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
task = 'task_example' # str | task to run
|
|
|
|
try:
|
|
# Run cron task
|
|
api_instance.admin_cron_run(task)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_cron_run: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**task** | **str**| task to run |
|
|
|
|
### Return type
|
|
|
|
void (empty response body)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_delete_hook**
|
|
> admin_delete_hook(id)
|
|
|
|
Delete a hook
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
id = 789 # int | id of the hook to delete
|
|
|
|
try:
|
|
# Delete a hook
|
|
api_instance.admin_delete_hook(id)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_delete_hook: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**id** | **int**| id of the hook to delete |
|
|
|
|
### Return type
|
|
|
|
void (empty response body)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_delete_unadopted_repository**
|
|
> admin_delete_unadopted_repository(owner, repo)
|
|
|
|
Delete unadopted files
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
owner = 'owner_example' # str | owner of the repo
|
|
repo = 'repo_example' # str | name of the repo
|
|
|
|
try:
|
|
# Delete unadopted files
|
|
api_instance.admin_delete_unadopted_repository(owner, repo)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_delete_unadopted_repository: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**owner** | **str**| owner of the repo |
|
|
**repo** | **str**| name of the repo |
|
|
|
|
### Return type
|
|
|
|
void (empty response body)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_delete_user**
|
|
> admin_delete_user(username, purge=purge)
|
|
|
|
Delete a user
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
username = 'username_example' # str | username of user to delete
|
|
purge = true # bool | purge the user from the system completely (optional)
|
|
|
|
try:
|
|
# Delete a user
|
|
api_instance.admin_delete_user(username, purge=purge)
|
|
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 |
|
|
**purge** | **bool**| purge the user from the system completely | [optional]
|
|
|
|
### Return type
|
|
|
|
void (empty response body)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_delete_user_badges**
|
|
> admin_delete_user_badges(username, body=body)
|
|
|
|
Remove a badge from a user
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
username = 'username_example' # str | username of user
|
|
body = gitea.UserBadgeOption() # UserBadgeOption | (optional)
|
|
|
|
try:
|
|
# Remove a badge from a user
|
|
api_instance.admin_delete_user_badges(username, body=body)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_delete_user_badges: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**username** | **str**| username of user |
|
|
**body** | [**UserBadgeOption**](UserBadgeOption.md)| | [optional]
|
|
|
|
### Return type
|
|
|
|
void (empty response body)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_delete_user_public_key**
|
|
> admin_delete_user_public_key(username, id)
|
|
|
|
Delete a user's public key
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.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](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_edit_hook**
|
|
> Hook admin_edit_hook(id, body=body)
|
|
|
|
Update a hook
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
id = 789 # int | id of the hook to update
|
|
body = gitea.EditHookOption() # EditHookOption | (optional)
|
|
|
|
try:
|
|
# Update a hook
|
|
api_response = api_instance.admin_edit_hook(id, body=body)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_edit_hook: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**id** | **int**| id of the hook to update |
|
|
**body** | [**EditHookOption**](EditHookOption.md)| | [optional]
|
|
|
|
### Return type
|
|
|
|
[**Hook**](Hook.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_edit_user**
|
|
> User admin_edit_user(username, body=body)
|
|
|
|
Edit an existing user
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
username = 'username_example' # str | username of user to edit
|
|
body = gitea.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**](EditUserOption.md)| | [optional]
|
|
|
|
### Return type
|
|
|
|
[**User**](User.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_get_all_emails**
|
|
> list[Email] admin_get_all_emails(page=page, limit=limit)
|
|
|
|
List all emails
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
page = 56 # int | page number of results to return (1-based) (optional)
|
|
limit = 56 # int | page size of results (optional)
|
|
|
|
try:
|
|
# List all emails
|
|
api_response = api_instance.admin_get_all_emails(page=page, limit=limit)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_get_all_emails: %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 | [optional]
|
|
|
|
### Return type
|
|
|
|
[**list[Email]**](Email.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_get_all_orgs**
|
|
> list[Organization] admin_get_all_orgs(page=page, limit=limit)
|
|
|
|
List all organizations
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
page = 56 # int | page number of results to return (1-based) (optional)
|
|
limit = 56 # int | page size of results (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 | [optional]
|
|
|
|
### Return type
|
|
|
|
[**list[Organization]**](Organization.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_get_hook**
|
|
> Hook admin_get_hook(id)
|
|
|
|
Get a hook
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
id = 789 # int | id of the hook to get
|
|
|
|
try:
|
|
# Get a hook
|
|
api_response = api_instance.admin_get_hook(id)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_get_hook: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**id** | **int**| id of the hook to get |
|
|
|
|
### Return type
|
|
|
|
[**Hook**](Hook.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_get_runner_registration_token**
|
|
> admin_get_runner_registration_token()
|
|
|
|
Get an global actions runner registration token
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
|
|
try:
|
|
# Get an global actions runner registration token
|
|
api_instance.admin_get_runner_registration_token()
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_get_runner_registration_token: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
This endpoint does not need any parameter.
|
|
|
|
### Return type
|
|
|
|
void (empty response body)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_list_hooks**
|
|
> list[Hook] admin_list_hooks(page=page, limit=limit)
|
|
|
|
List system's webhooks
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
page = 56 # int | page number of results to return (1-based) (optional)
|
|
limit = 56 # int | page size of results (optional)
|
|
|
|
try:
|
|
# List system's webhooks
|
|
api_response = api_instance.admin_list_hooks(page=page, limit=limit)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_list_hooks: %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 | [optional]
|
|
|
|
### Return type
|
|
|
|
[**list[Hook]**](Hook.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_list_user_badges**
|
|
> list[Badge] admin_list_user_badges(username)
|
|
|
|
List a user's badges
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
username = 'username_example' # str | username of user
|
|
|
|
try:
|
|
# List a user's badges
|
|
api_response = api_instance.admin_list_user_badges(username)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_list_user_badges: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**username** | **str**| username of user |
|
|
|
|
### Return type
|
|
|
|
[**list[Badge]**](Badge.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_rename_user**
|
|
> admin_rename_user(username, body)
|
|
|
|
Rename a user
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
username = 'username_example' # str | existing username of user
|
|
body = gitea.RenameUserOption() # RenameUserOption |
|
|
|
|
try:
|
|
# Rename a user
|
|
api_instance.admin_rename_user(username, body)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_rename_user: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**username** | **str**| existing username of user |
|
|
**body** | [**RenameUserOption**](RenameUserOption.md)| |
|
|
|
|
### Return type
|
|
|
|
void (empty response body)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_search_emails**
|
|
> list[Email] admin_search_emails(q=q, page=page, limit=limit)
|
|
|
|
Search all emails
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
q = 'q_example' # str | keyword (optional)
|
|
page = 56 # int | page number of results to return (1-based) (optional)
|
|
limit = 56 # int | page size of results (optional)
|
|
|
|
try:
|
|
# Search all emails
|
|
api_response = api_instance.admin_search_emails(q=q, page=page, limit=limit)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_search_emails: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**q** | **str**| keyword | [optional]
|
|
**page** | **int**| page number of results to return (1-based) | [optional]
|
|
**limit** | **int**| page size of results | [optional]
|
|
|
|
### Return type
|
|
|
|
[**list[Email]**](Email.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_search_users**
|
|
> list[User] admin_search_users(source_id=source_id, login_name=login_name, page=page, limit=limit)
|
|
|
|
Search users according filter conditions
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
source_id = 789 # int | ID of the user's login source to search for (optional)
|
|
login_name = 'login_name_example' # str | user's login name to search for (optional)
|
|
page = 56 # int | page number of results to return (1-based) (optional)
|
|
limit = 56 # int | page size of results (optional)
|
|
|
|
try:
|
|
# Search users according filter conditions
|
|
api_response = api_instance.admin_search_users(source_id=source_id, login_name=login_name, page=page, limit=limit)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_search_users: %s\n" % e)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**source_id** | **int**| ID of the user's login source to search for | [optional]
|
|
**login_name** | **str**| user's login name to search for | [optional]
|
|
**page** | **int**| page number of results to return (1-based) | [optional]
|
|
**limit** | **int**| page size of results | [optional]
|
|
|
|
### Return type
|
|
|
|
[**list[User]**](User.md)
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **admin_unadopted_list**
|
|
> list[str] admin_unadopted_list(page=page, limit=limit, pattern=pattern)
|
|
|
|
List unadopted repositories
|
|
|
|
### Example
|
|
```python
|
|
from __future__ import print_function
|
|
import time
|
|
import gitea
|
|
from gitea.rest import ApiException
|
|
from pprint import pprint
|
|
|
|
# Configure API key authorization: AccessToken
|
|
configuration = gitea.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 = gitea.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 = gitea.Configuration()
|
|
configuration.username = 'YOUR_USERNAME'
|
|
configuration.password = 'YOUR_PASSWORD'
|
|
# Configure API key authorization: SudoHeader
|
|
configuration = gitea.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 = gitea.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: TOTPHeader
|
|
configuration = gitea.Configuration()
|
|
configuration.api_key['X-GITEA-OTP'] = 'YOUR_API_KEY'
|
|
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
|
|
# configuration.api_key_prefix['X-GITEA-OTP'] = 'Bearer'
|
|
# Configure API key authorization: Token
|
|
configuration = gitea.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 = gitea.AdminApi(gitea.ApiClient(configuration))
|
|
page = 56 # int | page number of results to return (1-based) (optional)
|
|
limit = 56 # int | page size of results (optional)
|
|
pattern = 'pattern_example' # str | pattern of repositories to search for (optional)
|
|
|
|
try:
|
|
# List unadopted repositories
|
|
api_response = api_instance.admin_unadopted_list(page=page, limit=limit, pattern=pattern)
|
|
pprint(api_response)
|
|
except ApiException as e:
|
|
print("Exception when calling AdminApi->admin_unadopted_list: %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 | [optional]
|
|
**pattern** | **str**| pattern of repositories to search for | [optional]
|
|
|
|
### Return type
|
|
|
|
**list[str]**
|
|
|
|
### Authorization
|
|
|
|
[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, text/plain
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|