api.accounts.base — API login & logout

/accounts/login

Note

Instead of logging into the API, you can use the ES-API-KEY HTTP header or -api-key es parameter to perform an authenticated API request.

api.accounts.base.views.api_login(*args, **kwargs)

Function used for API login validation and authentication (POST). There are two required parameters.

POST /accounts/login
DC-bound?:
Permissions:
Asynchronous?:
Parameters:
  • data.username (string) – required - Username used for authentication
  • data.password (string) – required - Password used for authentication
Status Codes:

es example:

es login -username user@example.com -password Y0urPassw0rd
{
    "url": "https://my.erigones.com/api/accounts/login/",
    "status": 200,
    "method": "POST",
    "text": {
        "token": "00000a000aa0a00000a0aa0a0a00000a00000000",
        "detail": "Welcome to Danube Cloud API."
    }
}

Warning

es stores the session token in a plain text file (by default: /tmp/esdc.session)

Note

The API session token expires after 1 hour after successful login.

/accounts/logout

api.accounts.base.views.api_logout(*args, **kwargs)

Function used for API logout (GET).

GET /accounts/logout
DC-bound?:
Permissions:
Asynchronous?:
Status Codes:

es example:

es logout
{
    "url": "https://my.erigones.com/api/accounts/logout/",
    "status": 200,
    "method": "GET",
    "text": {
        "detail": "Bye."
    }
}