QlikElixir.REST.DataConnections (qlik_elixir v0.3.5)

View Source

REST API client for Qlik Cloud Data Connections.

Provides functions to manage data connections which define how Qlik apps connect to external data sources.

Examples

# List all data connections
{:ok, %{"data" => connections}} = DataConnections.list(config: config)

# Get connection details
{:ok, connection} = DataConnections.get("conn-123", config: config)

# Create a connection
params = %{
  qName: "MyPostgres",
  qType: "PostgreSQL",
  qConnectStatement: "CONNECT TO 'Provider=PostgreSQL;Host=...';"
}
{:ok, connection} = DataConnections.create(params, config: config)

# Duplicate a connection
{:ok, copy} = DataConnections.duplicate("conn-123", config: config, name: "Copy")

Summary

Functions

Deletes multiple data connections.

Updates multiple data connections.

Changes the owner of a data connection.

Moves a data connection to another space.

Creates a new data connection.

Deletes a data connection.

Duplicates a data connection.

Gets a data connection by ID.

Lists all data connections.

Updates a data connection.

Functions

batch_delete(connection_ids, opts \\ [])

@spec batch_delete(
  [String.t()],
  keyword()
) :: {:ok, map()} | {:error, QlikElixir.Error.t()}

Deletes multiple data connections.

Parameters

  • connection_ids - List of connection IDs to delete.

batch_update(updates, opts \\ [])

@spec batch_update(
  [map()],
  keyword()
) :: {:ok, map()} | {:error, QlikElixir.Error.t()}

Updates multiple data connections.

Parameters

  • updates - List of update objects with :id and fields to update.

change_owner(connection_id, owner_id, opts \\ [])

@spec change_owner(String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, QlikElixir.Error.t()}

Changes the owner of a data connection.

Parameters

  • connection_id - The connection ID.
  • owner_id - The new owner's user ID.

change_space(connection_id, space_id, opts \\ [])

@spec change_space(String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, QlikElixir.Error.t()}

Moves a data connection to another space.

Parameters

  • connection_id - The connection ID.
  • space_id - The target space ID.

create(params, opts \\ [])

@spec create(
  map(),
  keyword()
) :: {:ok, map()} | {:error, QlikElixir.Error.t()}

Creates a new data connection.

Parameters

  • params - Map with connection details:
    • :qName - Required. Connection name.
    • :qType - Required. Connection type (e.g., "PostgreSQL", "folder").
    • :qConnectStatement - Required. Connection string.
    • :spaceId - Optional. Target space ID.

delete(connection_id, opts \\ [])

@spec delete(
  String.t(),
  keyword()
) :: :ok | {:error, QlikElixir.Error.t()}

Deletes a data connection.

duplicate(connection_id, opts \\ [])

@spec duplicate(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, QlikElixir.Error.t()}

Duplicates a data connection.

Options

  • :name - Custom name for the copy.
  • :space_id - Target space for the copy.

get(connection_id, opts \\ [])

@spec get(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, QlikElixir.Error.t()}

Gets a data connection by ID.

list(opts \\ [])

@spec list(keyword()) :: {:ok, map()} | {:error, QlikElixir.Error.t()}

Lists all data connections.

Options

  • :config - Required. The configuration struct.
  • :limit - Maximum number of results per page.
  • :next - Cursor for pagination.
  • :space_id - Filter by space ID.
  • :name - Filter by connection name.
  • :qType - Filter by connection type.

update(connection_id, params, opts \\ [])

@spec update(String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, QlikElixir.Error.t()}

Updates a data connection.

Parameters

  • connection_id - The connection ID.
  • params - Map with fields to update.