2024-01-14 12:30:33 +02:00

225 lines
6.5 KiB
Markdown

# peertube.JobApi
All URIs are relative to *https://peertube2.cpy.re*
Method | HTTP request | Description
------------- | ------------- | -------------
[**api_v1_jobs_pause_post**](JobApi.md#api_v1_jobs_pause_post) | **POST** /api/v1/jobs/pause | Pause job queue
[**api_v1_jobs_resume_post**](JobApi.md#api_v1_jobs_resume_post) | **POST** /api/v1/jobs/resume | Resume job queue
[**get_jobs**](JobApi.md#get_jobs) | **GET** /api/v1/jobs/{state} | List instance jobs
# **api_v1_jobs_pause_post**
> api_v1_jobs_pause_post()
Pause job queue
### Example
* OAuth Authentication (OAuth2):
```python
import peertube
from peertube.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://peertube2.cpy.re
# See configuration.py for a list of all supported configuration parameters.
configuration = peertube.Configuration(
host = "https://peertube2.cpy.re"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Enter a context with an instance of the API client
with peertube.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = peertube.JobApi(api_client)
try:
# Pause job queue
api_instance.api_v1_jobs_pause_post()
except Exception as e:
print("Exception when calling JobApi->api_v1_jobs_pause_post: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
void (empty response body)
### Authorization
[OAuth2](../README.md#OAuth2)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | successful operation | - |
[[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)
# **api_v1_jobs_resume_post**
> api_v1_jobs_resume_post()
Resume job queue
### Example
* OAuth Authentication (OAuth2):
```python
import peertube
from peertube.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://peertube2.cpy.re
# See configuration.py for a list of all supported configuration parameters.
configuration = peertube.Configuration(
host = "https://peertube2.cpy.re"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Enter a context with an instance of the API client
with peertube.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = peertube.JobApi(api_client)
try:
# Resume job queue
api_instance.api_v1_jobs_resume_post()
except Exception as e:
print("Exception when calling JobApi->api_v1_jobs_resume_post: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
void (empty response body)
### Authorization
[OAuth2](../README.md#OAuth2)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | successful operation | - |
[[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)
# **get_jobs**
> GetJobs200Response get_jobs(state, job_type=job_type, start=start, count=count, sort=sort)
List instance jobs
### Example
* OAuth Authentication (OAuth2):
```python
import peertube
from peertube.models.get_jobs200_response import GetJobs200Response
from peertube.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://peertube2.cpy.re
# See configuration.py for a list of all supported configuration parameters.
configuration = peertube.Configuration(
host = "https://peertube2.cpy.re"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Enter a context with an instance of the API client
with peertube.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = peertube.JobApi(api_client)
state = 'state_example' # str | The state of the job ('' for for no filter)
job_type = 'job_type_example' # str | job type (optional)
start = 56 # int | Offset used to paginate results (optional)
count = 15 # int | Number of items to return (optional) (default to 15)
sort = '-createdAt' # str | Sort column (optional)
try:
# List instance jobs
api_response = api_instance.get_jobs(state, job_type=job_type, start=start, count=count, sort=sort)
print("The response of JobApi->get_jobs:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling JobApi->get_jobs: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**state** | **str**| The state of the job ('' for for no filter) |
**job_type** | **str**| job type | [optional]
**start** | **int**| Offset used to paginate results | [optional]
**count** | **int**| Number of items to return | [optional] [default to 15]
**sort** | **str**| Sort column | [optional]
### Return type
[**GetJobs200Response**](GetJobs200Response.md)
### Authorization
[OAuth2](../README.md#OAuth2)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | successful operation | - |
[[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)