Skip to content

Latest commit

 

History

History
168 lines (113 loc) · 5 KB

AuthenticationApi.md

File metadata and controls

168 lines (113 loc) · 5 KB

sonarr.AuthenticationApi

All URIs are relative to http://localhost:8989

Method HTTP request Description
create_login POST /login
get_logout GET /logout

create_login

create_login(return_url=return_url, username=username, password=password, remember_me=remember_me)

Example

  • Api Key Authentication (apikey):
  • Api Key Authentication (X-Api-Key):
import sonarr
from sonarr.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8989
# See configuration.py for a list of all supported configuration parameters.
configuration = sonarr.Configuration(
    host = "http://localhost:8989"
)

# 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: apikey
configuration.api_key['apikey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apikey'] = 'Bearer'

# Configure API key authorization: X-Api-Key
configuration.api_key['X-Api-Key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Api-Key'] = 'Bearer'

# Enter a context with an instance of the API client
with sonarr.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sonarr.AuthenticationApi(api_client)
    return_url = 'return_url_example' # str |  (optional)
    username = 'username_example' # str |  (optional)
    password = 'password_example' # str |  (optional)
    remember_me = 'remember_me_example' # str |  (optional)

    try:
        api_instance.create_login(return_url=return_url, username=username, password=password, remember_me=remember_me)
    except Exception as e:
        print("Exception when calling AuthenticationApi->create_login: %s\n" % e)

Parameters

Name Type Description Notes
return_url str [optional]
username str [optional]
password str [optional]
remember_me str [optional]

Return type

void (empty response body)

Authorization

apikey, X-Api-Key

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: Not defined

HTTP response details

Status code Description Response headers
2XX OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_logout

get_logout()

Example

  • Api Key Authentication (apikey):
  • Api Key Authentication (X-Api-Key):
import sonarr
from sonarr.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8989
# See configuration.py for a list of all supported configuration parameters.
configuration = sonarr.Configuration(
    host = "http://localhost:8989"
)

# 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: apikey
configuration.api_key['apikey'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['apikey'] = 'Bearer'

# Configure API key authorization: X-Api-Key
configuration.api_key['X-Api-Key'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-Api-Key'] = 'Bearer'

# Enter a context with an instance of the API client
with sonarr.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = sonarr.AuthenticationApi(api_client)

    try:
        api_instance.get_logout()
    except Exception as e:
        print("Exception when calling AuthenticationApi->get_logout: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

apikey, X-Api-Key

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
2XX OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]