All URIs are relative to https://ecotaxa.obs-vlfr.fr/api
Method | HTTP request | Description |
---|---|---|
db_direct_query | GET /admin/db/query | Direct Db Query |
object db_direct_query(q)
Direct Db Query
For making selects on the DB. 🔒 Admin only.
- OAuth Authentication (BearerOrCookieAuth):
import ecotaxa_py_client
from ecotaxa_py_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://ecotaxa.obs-vlfr.fr/api
# See configuration.py for a list of all supported configuration parameters.
configuration = ecotaxa_py_client.Configuration(
host = "https://ecotaxa.obs-vlfr.fr/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.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Enter a context with an instance of the API client
with ecotaxa_py_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = ecotaxa_py_client.AdminApi(api_client)
q = 'select count(1) from objects' # str | The SQL to execute.
try:
# Direct Db Query
api_response = api_instance.db_direct_query(q)
print("The response of AdminApi->db_direct_query:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AdminApi->db_direct_query: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
q | str | The SQL to execute. |
object
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]