Skip to content

Commit

Permalink
updated documentation for workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnaglodha committed Nov 6, 2024
1 parent 040e412 commit 74b9ef1
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 3 deletions.
31 changes: 30 additions & 1 deletion docs/pages/async/workspace.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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))
```
75 changes: 74 additions & 1 deletion docs/pages/cli/workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ $ gsx workspace --workspace cesium
</div>


## Paramters for create workspace command
## Parameters for create workspace command

<div class="termy">

Expand Down Expand Up @@ -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'
```
</div>

## Parameters for delete workspace command

<div class="termy">

```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.
```
</div>

As listed above, `delete-workspace` command accepts parameters as follows

* --workspace - name of workspace

## Delete single workspaces

<div class="termy">
```console
gsx delete-workspace --workspace my_wrkspace
{"code":200,"response":"Executed successfully"}
```
</div>


## Parameters for update workspace command

<div class="termy">

```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.
```
</div>

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

<div class="termy">
```console
gsx update-workspace --current-name sde --new-name duster
{"code":200,"response":"Executed successfully"}
```
</div>
31 changes: 30 additions & 1 deletion docs/pages/sync/workspace.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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))
```

0 comments on commit 74b9ef1

Please sign in to comment.