GeoserverConfig.Coveragestores (GeoserverConfig v0.3.0)

Copy Markdown View Source

Provides functions for managing GeoServer coverage stores via the REST API.

Coverage stores reference raster data such as GeoTIFF or COGs (Cloud Optimized GeoTIFFs). All functions require a GeoserverConfig.Connection as their first argument.

Example

conn = GeoserverConfig.Connection.from_env()
{:ok, stores} = GeoserverConfig.Coveragestores.list_coveragestores(conn, "demo_workspace")

Summary

Functions

Creates a new coverage store for a GeoTIFF or COG raster file.

Deletes a coverage store from the specified workspace.

Lists all coverage stores in the specified workspace.

Functions

create_coveragestore(conn, workspace, store_name, geotiff_path, description \\ "", opts \\ %{})

Creates a new coverage store for a GeoTIFF or COG raster file.

Parameters

  • conn — a GeoserverConfig.Connection
  • workspace — the GeoServer workspace name
  • store_name — desired name for the coverage store
  • geotiff_path — file path or URL to the GeoTIFF/COG
  • description — optional description (default: "")
  • opts — optional map with extra store fields:
    • :connectionParameters, :metadata, :disableOnConnFailure

Returns

  • {:ok, store_name} on success
  • {:error, reason} on failure

delete_coveragestore(conn, workspace, name)

Deletes a coverage store from the specified workspace.

Uses purge=true to also remove related resources.

Returns

  • {:ok, name} on success
  • {:error, {:http_error, status, body}} on failure
  • {:error, {:request_failed, reason}} on transport error

list_coveragestores(conn, workspace)

Lists all coverage stores in the specified workspace.

Returns

  • {:ok, [store]} on success
  • {:error, {:http_error, status, body}} on non-200 response
  • {:error, :unexpected_format, body} when the response body is unrecognised
  • {:error, {:request_failed, reason}} on transport error

update_coveragestore(conn, workspace, store_name, updated_params)

Updates an existing coverage store.

Parameters

  • conn — a GeoserverConfig.Connection
  • workspace — workspace containing the store
  • store_name — name of the coverage store to update
  • updated_params — map of fields to update: :type, :enabled, :url, :description

Returns

  • {:ok, store_name} on success
  • {:error, {:http_error, status, body}} on failure
  • {:error, {:request_failed, reason}} on transport error