diff --git a/geoservercloud/geoservercloud.py b/geoservercloud/geoservercloud.py index be50190..2b81c1c 100644 --- a/geoservercloud/geoservercloud.py +++ b/geoservercloud/geoservercloud.py @@ -207,19 +207,17 @@ def create_pg_datastore( datastore = PostGisDataStore( workspace_name, datastore_name, - connection_parameters=KeyDollarListDict( - input_dict={ - "dbtype": "postgis", - "host": pg_host, - "port": pg_port, - "database": pg_db, - "user": pg_user, - "passwd": pg_password, - "schema": pg_schema, - "namespace": f"http://{workspace_name}", - "Expose primary keys": "true", - } - ), + connection_parameters={ + "dbtype": "postgis", + "host": pg_host, + "port": pg_port, + "database": pg_db, + "user": pg_user, + "passwd": pg_password, + "schema": pg_schema, + "namespace": f"http://{workspace_name}", + "Expose primary keys": "true", + }, data_store_type="PostGIS", description=description, ) @@ -258,15 +256,13 @@ def create_jndi_datastore( datastore = PostGisDataStore( workspace_name, datastore_name, - connection_parameters=KeyDollarListDict( - input_dict={ - "dbtype": "postgis", - "jndiReferenceName": jndi_reference, - "schema": pg_schema, - "namespace": f"http://{workspace_name}", - "Expose primary keys": "true", - } - ), + connection_parameters={ + "dbtype": "postgis", + "jndiReferenceName": jndi_reference, + "schema": pg_schema, + "namespace": f"http://{workspace_name}", + "Expose primary keys": "true", + }, data_store_type="PostGIS (JNDI)", description=description, ) diff --git a/geoservercloud/models/datastore.py b/geoservercloud/models/datastore.py index ef31086..107721a 100644 --- a/geoservercloud/models/datastore.py +++ b/geoservercloud/models/datastore.py @@ -14,14 +14,14 @@ def __init__( self, workspace_name: str, data_store_name: str, - connection_parameters: KeyDollarListDict, + connection_parameters: dict, data_store_type: str = "PostGIS", enabled: bool = True, description: str | None = None, ) -> None: self.workspace_name = workspace_name self.data_store_name = data_store_name - self.connection_parameters = connection_parameters + self.connection_parameters = KeyDollarListDict(input_dict=connection_parameters) self.data_store_type = data_store_type self.description = description self.enabled = enabled