ExDaytona.Api.ApiKeys (ex_daytona v0.2.0)

Copy Markdown View Source

API calls for all endpoints tagged ApiKeys.

Summary

Functions

create_api_key(connection, create_api_key, opts \\ [])

Create API key

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • create_api_key (CreateApiKey):
  • opts (keyword): Optional parameters
    • :"X-Daytona-Organization-ID" (String.t): Use with JWT to specify the organization ID

Returns

  • {:ok, ExDaytona.Model.ApiKeyResponse.t} on success
  • {:error, Tesla.Env.t} on failure

delete_api_key(connection, name, opts \\ [])

@spec delete_api_key(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Delete API key

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • name (String.t):
  • opts (keyword): Optional parameters
    • :"X-Daytona-Organization-ID" (String.t): Use with JWT to specify the organization ID

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

delete_api_key_for_user(connection, user_id, name, opts \\ [])

@spec delete_api_key_for_user(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

Delete API key for user

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • user_id (String.t):
  • name (String.t):
  • opts (keyword): Optional parameters
    • :"X-Daytona-Organization-ID" (String.t): Use with JWT to specify the organization ID

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

get_api_key(connection, name, opts \\ [])

@spec get_api_key(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, ExDaytona.Model.ApiKeyList.t()} | {:error, Tesla.Env.t()}

Get API key

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • name (String.t):
  • opts (keyword): Optional parameters
    • :"X-Daytona-Organization-ID" (String.t): Use with JWT to specify the organization ID

Returns

  • {:ok, ExDaytona.Model.ApiKeyList.t} on success
  • {:error, Tesla.Env.t} on failure

get_current_api_key(connection, opts \\ [])

@spec get_current_api_key(
  Tesla.Env.client(),
  keyword()
) :: {:ok, ExDaytona.Model.ApiKeyList.t()} | {:error, Tesla.Env.t()}

Get current API key's details

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :"X-Daytona-Organization-ID" (String.t): Use with JWT to specify the organization ID

Returns

  • {:ok, ExDaytona.Model.ApiKeyList.t} on success
  • {:error, Tesla.Env.t} on failure

list_api_keys(connection, opts \\ [])

@spec list_api_keys(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, nil} | {:ok, [ExDaytona.Model.ApiKeyList.t()]} | {:error, Tesla.Env.t()}

List API keys

Parameters

  • connection (ExDaytona.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :"X-Daytona-Organization-ID" (String.t): Use with JWT to specify the organization ID

Returns

  • {:ok, [%ApiKeyList{}, ...]} on success
  • {:error, Tesla.Env.t} on failure