Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
Mapserver REST API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Miscellaneous
Mapserver REST API
Commits
7e6dfe7f
Commit
7e6dfe7f
authored
11 years ago
by
Maël Méliani
Browse files
Options
Downloads
Patches
Plain Diff
Changed case datastore->dataStore and coveragestore->coverageStore.
parent
0df7a9d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/server.py
+23
-23
23 additions, 23 deletions
src/server.py
with
23 additions
and
23 deletions
src/server.py
+
23
−
23
View file @
7e6dfe7f
...
...
@@ -128,7 +128,7 @@ class datastores(object):
@HTTPCompatible
()
def
GET
(
self
,
map_name
,
ws_name
,
format
,
*
args
,
**
kwargs
):
mf
,
ws
=
get_mapfile_workspace
(
map_name
,
ws_name
)
return
{
"
data
s
tores
"
:
[{
return
{
"
data
S
tores
"
:
[{
"
name
"
:
ds_name
,
"
href
"
:
"
%s/maps/%s/workspaces/%s/datastores/%s.%s
"
%
(
web
.
ctx
.
home
,
map_name
,
ws
.
name
,
ds_name
,
format
)
...
...
@@ -138,10 +138,10 @@ class datastores(object):
def
POST
(
self
,
map_name
,
ws_name
,
format
):
mf
,
ws
=
get_mapfile_workspace
(
map_name
,
ws_name
)
data
=
get_data
(
name
=
"
data
s
tore
"
,
mandatory
=
[
"
name
"
,
"
connectionParameters
"
])
data
=
get_data
(
name
=
"
data
S
tore
"
,
mandatory
=
[
"
name
"
,
"
connectionParameters
"
])
ds_name
=
data
.
pop
(
"
name
"
)
with
webapp
.
mightConflict
(
"
data
s
tore
"
,
workspace
=
ws_name
):
with
webapp
.
mightConflict
(
"
data
S
tore
"
,
workspace
=
ws_name
):
ws
.
create_datastore
(
ds_name
,
data
)
ws
.
save
()
...
...
@@ -154,27 +154,27 @@ class datastore(object):
def
GET
(
self
,
map_name
,
ws_name
,
ds_name
,
format
):
mf
,
ws
=
get_mapfile_workspace
(
map_name
,
ws_name
)
with
webapp
.
mightNotFound
(
"
data
s
tore
"
,
workspace
=
ws_name
):
with
webapp
.
mightNotFound
(
"
data
S
tore
"
,
workspace
=
ws_name
):
info
=
ws
.
get_datastore_info
(
ds_name
)
info
[
"
href
"
]
=
"
%s/maps/%s/workspaces/%s/datastores/%s/featuretypes.%s
"
%
(
web
.
ctx
.
home
,
map_name
,
ws
.
name
,
ds_name
,
format
)
return
{
"
data
s
tore
"
:
info
}
return
{
"
data
S
tore
"
:
info
}
def
PUT
(
self
,
map_name
,
ws_name
,
ds_name
,
format
):
mf
,
ws
=
get_mapfile_workspace
(
map_name
,
ws_name
)
data
=
get_data
(
name
=
"
data
s
tore
"
,
mandatory
=
[
"
name
"
,
"
connectionParameters
"
],
forbidden
=
[
"
href
"
])
data
=
get_data
(
name
=
"
data
S
tore
"
,
mandatory
=
[
"
name
"
,
"
connectionParameters
"
],
forbidden
=
[
"
href
"
])
if
ds_name
!=
data
.
pop
(
"
name
"
):
raise
webapp
.
Forbidden
(
"
Can
'
t change the name of a data
s
tore.
"
)
raise
webapp
.
Forbidden
(
"
Can
'
t change the name of a data
S
tore.
"
)
with
webapp
.
mightNotFound
(
"
data
s
tore
"
,
workspace
=
ws_name
):
with
webapp
.
mightNotFound
(
"
data
S
tore
"
,
workspace
=
ws_name
):
ws
.
update_datastore
(
ds_name
,
data
)
ws
.
save
()
def
DELETE
(
self
,
map_name
,
ws_name
,
ds_name
,
format
):
mf
,
ws
=
get_mapfile_workspace
(
map_name
,
ws_name
)
with
webapp
.
mightNotFound
(
"
data
s
tore
"
,
workspace
=
ws_name
):
with
webapp
.
mightNotFound
(
"
data
S
tore
"
,
workspace
=
ws_name
):
ws
.
delete_datastore
(
ds_name
)
ws
.
save
()
...
...
@@ -183,7 +183,7 @@ class featuretypes(object):
@HTTPCompatible
()
def
GET
(
self
,
map_name
,
ws_name
,
ds_name
,
format
):
mf
,
ws
=
get_mapfile_workspace
(
map_name
,
ws_name
)
return
{
"
feature
t
ypes
"
:
[{
return
{
"
feature
T
ypes
"
:
[{
"
name
"
:
ft
.
name
,
"
href
"
:
"
%s/maps/%s/workspaces/%s/datastores/%s/featuretypes/%s.%s
"
%
(
web
.
ctx
.
home
,
map_name
,
ws
.
name
,
ds_name
,
ft
.
name
,
format
)
...
...
@@ -193,8 +193,8 @@ class featuretypes(object):
def
POST
(
self
,
map_name
,
ws_name
,
ds_name
,
format
):
mf
,
ws
=
get_mapfile_workspace
(
map_name
,
ws_name
)
data
=
get_data
(
name
=
"
feature
t
ype
"
,
mandatory
=
[
"
name
"
])
with
webapp
.
mightConflict
(
"
feature
t
ype
"
,
datastore
=
ds_name
):
data
=
get_data
(
name
=
"
feature
T
ype
"
,
mandatory
=
[
"
name
"
])
with
webapp
.
mightConflict
(
"
feature
T
ype
"
,
datastore
=
ds_name
):
ws
.
create_featuretype
(
data
[
"
name
"
],
ds_name
,
data
)
ws
.
save
()
...
...
@@ -206,17 +206,17 @@ class featuretype(object):
@HTTPCompatible
()
def
GET
(
self
,
map_name
,
ws_name
,
ds_name
,
ft_name
,
format
):
mf
,
ws
=
get_mapfile_workspace
(
map_name
,
ws_name
)
with
webapp
.
mightNotFound
(
"
feature
t
ype
"
,
datastore
=
ds_name
):
with
webapp
.
mightNotFound
(
"
feature
T
ype
"
,
datastore
=
ds_name
):
ft
=
ws
.
get_featuretype
(
ft_name
,
ds_name
)
ds
=
ws
.
get_datastore
(
ds_name
)
with
webapp
.
mightNotFound
(
"
data
s
tore entry
"
,
datastore
=
ds_name
):
with
webapp
.
mightNotFound
(
"
data
S
tore entry
"
,
datastore
=
ds_name
):
dsft
=
ds
[
ft_name
]
extent
=
dsft
.
get_extent
()
latlon_extent
=
dsft
.
get_latlon_extent
()
return
{
"
feature
t
ype
"
:
({
return
{
"
feature
T
ype
"
:
({
"
name
"
:
ft
.
name
,
"
nativeName
"
:
ft
.
name
,
"
namespace
"
:
{
...
...
@@ -285,7 +285,7 @@ class coveragestores(object):
def
GET
(
self
,
map_name
,
ws_name
,
format
):
mf
,
ws
=
get_mapfile_workspace
(
map_name
,
ws_name
)
return
{
"
coverage
s
tores
"
:
[{
return
{
"
coverage
S
tores
"
:
[{
"
name
"
:
cs_name
,
"
href
"
:
"
%s/maps/%s/workspaces/%s/coveragestores/%s.%s
"
%
(
web
.
ctx
.
home
,
map_name
,
ws
.
name
,
cs_name
,
format
)
...
...
@@ -295,10 +295,10 @@ class coveragestores(object):
def
POST
(
self
,
map_name
,
ws_name
,
format
):
mf
,
ws
=
get_mapfile_workspace
(
map_name
,
ws_name
)
data
=
get_data
(
name
=
"
coverage
s
tore
"
,
mandatory
=
[
"
name
"
,
"
connectionParameters
"
])
data
=
get_data
(
name
=
"
coverage
S
tore
"
,
mandatory
=
[
"
name
"
,
"
connectionParameters
"
])
cs_name
=
data
.
pop
(
"
name
"
)
with
webapp
.
mightConflict
(
"
coverage
s
tore
"
,
workspace
=
ws_name
):
with
webapp
.
mightConflict
(
"
coverage
S
tore
"
,
workspace
=
ws_name
):
ws
.
create_coveragestore
(
cs_name
,
data
)
ws
.
save
()
...
...
@@ -314,23 +314,23 @@ class coveragestore(object):
info
=
ws
.
get_coveragestore_info
(
cs_name
)
info
[
"
href
"
]
=
"
%s/maps/%s/workspaces/%s/coveragestores/%s/coverages.%s
"
%
(
web
.
ctx
.
home
,
map_name
,
ws
.
name
,
cs_name
,
format
)
return
{
"
coverage
s
tore
"
:
info
}
return
{
"
coverage
S
tore
"
:
info
}
def
PUT
(
self
,
map_name
,
ws_name
,
cs_name
,
format
):
mf
,
ws
=
get_mapfile_workspace
(
map_name
,
ws_name
)
data
=
get_data
(
name
=
"
coverage
s
tore
"
,
mandatory
=
[
"
name
"
,
"
type
"
,
"
connectionParameters
"
],
forbidden
=
[
"
href
"
])
data
=
get_data
(
name
=
"
coverage
S
tore
"
,
mandatory
=
[
"
name
"
,
"
type
"
,
"
connectionParameters
"
],
forbidden
=
[
"
href
"
])
if
cs_name
!=
data
.
pop
(
"
name
"
):
raise
webapp
.
Forbidden
(
"
Can
'
t change the name of a coverage
s
tore.
"
)
raise
webapp
.
Forbidden
(
"
Can
'
t change the name of a coverage
S
tore.
"
)
with
webapp
.
mightNotFound
(
"
coverage
s
tore
"
,
workspace
=
ws_name
):
with
webapp
.
mightNotFound
(
"
coverage
S
tore
"
,
workspace
=
ws_name
):
ws
.
update_coveragestore
(
cs_name
,
data
)
ws
.
save
()
def
DELETE
(
self
,
map_name
,
ws_name
,
cs_name
,
format
):
mf
,
ws
=
get_mapfile_workspace
(
map_name
,
ws_name
)
with
webapp
.
mightNotFound
(
"
coverage
s
tore
"
,
workspace
=
ws_name
):
with
webapp
.
mightNotFound
(
"
coverage
S
tore
"
,
workspace
=
ws_name
):
ws
.
delete_coveragestore
(
cs_name
)
ws
.
save
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment