9.6 KiB
generated.immich.openapi_client.JobsApi
All URIs are relative to https://github.com/api
| Method | HTTP request | Description |
|---|---|---|
| create_job | POST /jobs | Create a manual job |
| get_queues_legacy | GET /jobs | Retrieve queue counts and status |
| run_queue_command_legacy | PUT /jobs/{name} | Run jobs |
create_job
create_job(job_create_dto)
Create a manual job
Run a specific job. Most jobs are queued automatically, but this endpoint allows for manual creation of a handful of jobs, including various cleanup tasks, as well as creating a new database backup.
Example
- Api Key Authentication (cookie):
- Api Key Authentication (api_key):
- Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.job_create_dto import JobCreateDto
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
host = "https://github.com/api"
)
# 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.
# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'
# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'
# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = generated.immich.openapi_client.JobsApi(api_client)
job_create_dto = generated.immich.openapi_client.JobCreateDto() # JobCreateDto |
try:
# Create a manual job
api_instance.create_job(job_create_dto)
except Exception as e:
print("Exception when calling JobsApi->create_job: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| job_create_dto | JobCreateDto |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: Not defined
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_queues_legacy
QueuesResponseLegacyDto get_queues_legacy()
Retrieve queue counts and status
Retrieve the counts of the current queue, as well as the current status.
Example
- Api Key Authentication (cookie):
- Api Key Authentication (api_key):
- Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.queues_response_legacy_dto import QueuesResponseLegacyDto
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
host = "https://github.com/api"
)
# 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.
# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'
# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'
# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = generated.immich.openapi_client.JobsApi(api_client)
try:
# Retrieve queue counts and status
api_response = api_instance.get_queues_legacy()
print("The response of JobsApi->get_queues_legacy:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling JobsApi->get_queues_legacy: %s\n" % e)
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
run_queue_command_legacy
QueueResponseLegacyDto run_queue_command_legacy(name, queue_command_dto)
Run jobs
Queue all assets for a specific job type. Defaults to only queueing assets that have not yet been processed, but the force command can be used to re-process all assets.
Example
- Api Key Authentication (cookie):
- Api Key Authentication (api_key):
- Bearer (JWT) Authentication (bearer):
import generated.immich.openapi_client
from generated.immich.openapi_client.models.queue_command_dto import QueueCommandDto
from generated.immich.openapi_client.models.queue_name import QueueName
from generated.immich.openapi_client.models.queue_response_legacy_dto import QueueResponseLegacyDto
from generated.immich.openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://github.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = generated.immich.openapi_client.Configuration(
host = "https://github.com/api"
)
# 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.
# Configure API key authorization: cookie
configuration.api_key['cookie'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookie'] = 'Bearer'
# Configure API key authorization: api_key
configuration.api_key['api_key'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'
# Configure Bearer authorization (JWT): bearer
configuration = generated.immich.openapi_client.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with generated.immich.openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = generated.immich.openapi_client.JobsApi(api_client)
name = generated.immich.openapi_client.QueueName() # QueueName |
queue_command_dto = generated.immich.openapi_client.QueueCommandDto() # QueueCommandDto |
try:
# Run jobs
api_response = api_instance.run_queue_command_legacy(name, queue_command_dto)
print("The response of JobsApi->run_queue_command_legacy:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling JobsApi->run_queue_command_legacy: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| name | QueueName | ||
| queue_command_dto | QueueCommandDto |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]