Spatio.Api.Platforms (spatio_sdk v0.0.2)

API calls for all endpoints tagged Platforms.

Summary

Functions

Run an INSERT/UPDATE/DELETE statement against a platform's store.

Export all secrets for a platform (values included). Caller must be the platform owner.

Generate a short-lived backend JWT a platform's worker can use to call back into platform-service.

List the global platform catalog — every platform that exists, not just the ones the caller has installed.

Fetch a platform's manifest (capabilities, schema, UI metadata).

List accounts the caller has connected for a platform.

Discover supported providers + capabilities for a platform.

List tables in a platform's data store.

List installed platforms for the sidebar.

Run a SELECT query against a platform's data store.

Run pending migrations for a platform.

Functions

add_platform_provider_account(connection, platform_id, provider, request_body, opts \\ [])

@spec add_platform_provider_account(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Add a connected account for a platform/provider pair.

Parameters

  • connection (Spatio.Connection): Connection to server
  • platform_id (String.t):
  • provider (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

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

create_or_update_platform_secret(connection, platform_id, request_body, opts \\ [])

@spec create_or_update_platform_secret(
  Tesla.Env.client(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Create or update a secret value.

Parameters

  • connection (Spatio.Connection): Connection to server
  • platform_id (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

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

delete_platform_secret(connection, platform_id, name, opts \\ [])

@spec delete_platform_secret(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, nil} | {:ok, Spatio.Model.ApiError.t()} | {:error, Tesla.Env.t()}

Delete a secret.

Parameters

  • connection (Spatio.Connection): Connection to server
  • platform_id (String.t):
  • name (String.t):
  • opts (keyword): Optional parameters

Returns

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

exec_platform_data(connection, platform_id, request_body, opts \\ [])

@spec exec_platform_data(
  Tesla.Env.client(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Run an INSERT/UPDATE/DELETE statement against a platform's store.

Parameters

  • connection (Spatio.Connection): Connection to server
  • platform_id (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

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

export_platform_secrets(connection, platform_id, opts \\ [])

@spec export_platform_secrets(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Export all secrets for a platform (values included). Caller must be the platform owner.

Parameters

  • connection (Spatio.Connection): Connection to server
  • platform_id (String.t):
  • opts (keyword): Optional parameters

Returns

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

generate_platform_backend_token(connection, platform_id, opts \\ [])

@spec generate_platform_backend_token(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Generate a short-lived backend JWT a platform's worker can use to call back into platform-service.

Parameters

  • connection (Spatio.Connection): Connection to server
  • platform_id (String.t):
  • opts (keyword): Optional parameters

Returns

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

get_platform_catalog(connection, opts \\ [])

@spec get_platform_catalog(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List the global platform catalog — every platform that exists, not just the ones the caller has installed.

Parameters

  • connection (Spatio.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

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

get_platform_manifest(connection, platform_id, opts \\ [])

@spec get_platform_manifest(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Fetch a platform's manifest (capabilities, schema, UI metadata).

Parameters

  • connection (Spatio.Connection): Connection to server
  • platform_id (String.t):
  • opts (keyword): Optional parameters

Returns

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

list_platform_accounts(connection, platform_id, opts \\ [])

@spec list_platform_accounts(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List accounts the caller has connected for a platform.

Parameters

  • connection (Spatio.Connection): Connection to server
  • platform_id (String.t):
  • opts (keyword): Optional parameters

Returns

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

list_platform_providers(connection, platform_id, opts \\ [])

@spec list_platform_providers(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Discover supported providers + capabilities for a platform.

Parameters

  • connection (Spatio.Connection): Connection to server
  • platform_id (String.t):
  • opts (keyword): Optional parameters

Returns

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

list_platform_secrets(connection, platform_id, opts \\ [])

@spec list_platform_secrets(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List secret keys (values redacted).

Parameters

  • connection (Spatio.Connection): Connection to server
  • platform_id (String.t):
  • opts (keyword): Optional parameters

Returns

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

list_platform_tables(connection, platform_id, opts \\ [])

@spec list_platform_tables(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List tables in a platform's data store.

Parameters

  • connection (Spatio.Connection): Connection to server
  • platform_id (String.t):
  • opts (keyword): Optional parameters

Returns

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

list_platforms(connection, opts \\ [])

@spec list_platforms(
  Tesla.Env.client(),
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

List installed platforms for the sidebar.

Parameters

  • connection (Spatio.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

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

query_platform_data(connection, platform_id, request_body, opts \\ [])

@spec query_platform_data(
  Tesla.Env.client(),
  String.t(),
  %{optional(String.t()) => any()},
  keyword()
) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Run a SELECT query against a platform's data store.

Parameters

  • connection (Spatio.Connection): Connection to server
  • platform_id (String.t):
  • request_body (%{optional(String.t) => any()}):
  • opts (keyword): Optional parameters

Returns

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

run_platform_migrations(connection, platform_id, opts \\ [])

@spec run_platform_migrations(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, %{optional(String.t()) => any()}}
  | {:ok, Spatio.Model.ApiError.t()}
  | {:error, Tesla.Env.t()}

Run pending migrations for a platform.

Parameters

  • connection (Spatio.Connection): Connection to server
  • platform_id (String.t):
  • opts (keyword): Optional parameters

Returns

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