From 74b9ef111301ef6189d0bee6835a60d9ed268674 Mon Sep 17 00:00:00 2001 From: krishnaglodha Date: Wed, 6 Nov 2024 12:54:48 +0530 Subject: [PATCH] updated documentation for workspace --- docs/pages/async/workspace.md | 31 ++++++++++++++- docs/pages/cli/workspace.md | 75 ++++++++++++++++++++++++++++++++++- docs/pages/sync/workspace.md | 31 ++++++++++++++- 3 files changed, 134 insertions(+), 3 deletions(-) diff --git a/docs/pages/async/workspace.md b/docs/pages/async/workspace.md index 54f45c4..a63c511 100644 --- a/docs/pages/async/workspace.md +++ b/docs/pages/async/workspace.md @@ -1,6 +1,10 @@ # Workspaces -`geoserverx` allows users to access all/one workspace from GeoServer, along with ability to add new workspaces. +`geoserverx` allows users to access all/one workspace from GeoServer, along with ability to do CRUD operations on workspaces. + +!!! get "Get started" + To start using `geoserverx` in Sync mode, create a new instance of `AsyncGeoServerX` Class, ream more about it [here](https://geobeyond.github.io/geoserverx/pages/async/) + ## Get all workspaces This command fetches all workspaces available in GeoServer. No parameters are required to be passed. @@ -29,3 +33,28 @@ Creating new workspace requires following parameters #Create new workspace with name `my_wrkspc` , make it Default and Isolated await client.create_workspace(name='my_wrkspc',default=True,Isolated=True) ``` + +## Delete workspace +This command allows user to delete workspace. +Deleting workspace requires following parameters + +* workspace `str` : Name of the workspace + +```Python +#Delete workspace with name `my_wrkspc`. +await client.delete_workspace(workspace='my_wrkspc') +``` + +## Update workspace +This command allows user to update existing workspace. +Updating workspace requires following parameters + +* name `str` : To define Name of the workspace +* update `UpdateWorkspaceInfo` : To define body of the update request + +```Python +#Updating workspace with name `my_wrkspc` , make is Isolated and rename it to `my_new_wrkspc` +from geoserverx.models.workspace import UpdateWorkspaceInfo + +await client.update_workspace(name='my_wrkspc',update=UpdateWorkspaceInfo(name='my_new_wrkspc',isolated=True)) +``` diff --git a/docs/pages/cli/workspace.md b/docs/pages/cli/workspace.md index e0e8c75..9591cf7 100644 --- a/docs/pages/cli/workspace.md +++ b/docs/pages/cli/workspace.md @@ -99,7 +99,7 @@ $ gsx workspace --workspace cesium -## Paramters for create workspace command +## Parameters for create workspace command
@@ -136,4 +136,77 @@ As listed above, `create-workspace` command accepts parameters as follows $ gsx create-workspace --workspace mydefaultws --default code=201 response='Data added successfully' ``` +
+ +## Parameters for delete workspace command + +
+ +```console +$ gsx delete-workspace --help +Usage: gsx delete-workspace [OPTIONS] + + Delete workspace in the Geoserver + +Options: + --request [sync|async] [default: requestEnum._sync] + --workspace TEXT Workspace name [required] + --url TEXT Geoserver REST URL [default: + http://127.0.0.1:8080/geoserver/rest/] + --password TEXT Geoserver Password [default: geoserver] + --username TEXT Geoserver username [default: admin] + --help Show this message and exit. +``` +
+ +As listed above, `delete-workspace` command accepts parameters as follows + +* --workspace - name of workspace + +## Delete single workspaces + +
+```console +gsx delete-workspace --workspace my_wrkspace +{"code":200,"response":"Executed successfully"} +``` +
+ + +## Parameters for update workspace command + +
+ +```console +$ gsx update-workspace --help +Usage: gsx update-workspace [OPTIONS] + + Add workspace in the Geoserver + +Options: + --request [sync|async] [default: requestEnum._sync] + --current-name TEXT Current Workspace name [required] + --new-name TEXT New Workspace name + --isolated / --no-isolated Make workspace isolated? [default: no-isolated] + --url TEXT Geoserver REST URL [default: + http://127.0.0.1:8080/geoserver/rest/] + --password TEXT Geoserver Password [default: geoserver] + --username TEXT Geoserver username [default: admin] + --help Show this message and exit. +``` +
+ +As listed above, `update-workspace` command accepts parameters as follows + +* --current-name - name of current workspace +* --new-name - name of new workspace +* --isolated/--no-isolated - To keep workspace either isolated or not + +## Delete single workspaces + +
+```console +gsx update-workspace --current-name sde --new-name duster +{"code":200,"response":"Executed successfully"} +```
\ No newline at end of file diff --git a/docs/pages/sync/workspace.md b/docs/pages/sync/workspace.md index 667f821..ba96ba1 100644 --- a/docs/pages/sync/workspace.md +++ b/docs/pages/sync/workspace.md @@ -1,6 +1,10 @@ # Workspaces -`geoserverx` allows users to access all/one workspace from GeoServer, along with ability to add new workspaces. +`geoserverx` allows users to access all/one workspace from GeoServer, along with ability to do CRUD operations on workspaces. + +!!! get "Get started" + To start using `geoserverx` in Sync mode, create a new instance of `SyncGeoServerX` Class, ream more about it [here](https://geobeyond.github.io/geoserverx/pages/sync/) + ## Get all workspaces This command fetches all workspaces available in GeoServer. No paramters are required to be passed. @@ -29,3 +33,28 @@ Creating new workspace requires following parameters #Create new workspace with name `my_wrkspc` , make it Default and Isolated client.create_workspace(name='my_wrkspc',default=True,Isolated=True) ``` + +## Delete workspace +This command allows user to delete workspace. +Deleting workspace requires following parameters + +* workspace `str` : Name of the workspace + +```Python +#Delete workspace with name `my_wrkspc`. +client.delete_workspace(workspace='my_wrkspc') +``` + +## Update workspace +This command allows user to update existing workspace. +Updating workspace requires following parameters + +* name `str` : To define Name of the workspace +* update `UpdateWorkspaceInfo` : To define body of the update request + +```Python +#Updating workspace with name `my_wrkspc` , make is Isolated and rename it to `my_new_wrkspc` +from geoserverx.models.workspace import UpdateWorkspaceInfo + +client.update_workspace(name='my_wrkspc',update=UpdateWorkspaceInfo(name='my_new_wrkspc',isolated=True)) +``` \ No newline at end of file