SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
Geoserver Shell
Administer Geoserver using a CLI

Jared Erickson
CUGOS July 2013
Outline
• What is Geoserver Shell?
• Why does Geoserver need a CLI?
• What are we administering with CLI?
• How does it work?
• What does it look like in action?
What is it?
• Administer Geoserver from a command
line interface (CLI)

• Uses Geoserver Rest interface
• Based on Spring Shell
• Uses GeoServer Manager and GeoTools
• Written in Java
• Open Source MIT License
• Hosted on Github
Why a CLI?
• Web UI is a major feature
• Non developers can load data and styles
• CLI is quick, efficient and scriptable
• Once a script is written it can be replayed

on other Geoservers (set up dev, then test,
then production)
Geoserver UI
Geoserver Catalog
• Workspace
• Namespace
• DataStore
• FeatureType
• CoverageStore
• Coverage

• Layer
• LayerGroups
• Style
• WMSStore
Geoserver Rest
•
•
•
•
•

Administer GeoServer without GUI

•

Integrate with 3rd party applications

Multiple representations: HTML, JSON, XML
HTTP Verbs: GET, POST, PUT, DELETE
HATEOS - linking
http://docs.geoserver.org/stable/en/user/rest/
index.html
Verbs
Commands

Verbs

list

GET

get

GET

create

POST

modify

PUT

delete

DELETE
Geoserver Rest UI
/geoserver/rest/layers
Client #1 = curl
•

Upload a Shapefile

curl -v -u admin:geoserver -XPUT -H "Content-type: application/zip" --data-binary
@roads.zip http://localhost:8080/geoserver/rest/workspaces/acme/datastores/roads/
file.shp

•

Create a Workspace

curl -v -u admin:geoserver -XPOST -H "Content-type: text/xml" -d
"<workspace><name>acme</name></workspace>" http://localhost:8080/geoserver/rest/
workspaces
Client #2 = Python
• gsconfig.py
• https://github.com/dwins/gsconfig.py/wiki
• Used by GeoNode
>>> from geoserver.catalog import Catalog
>>> cat = Catalog("http://localhost:8080/geoserver/rest", "admin",
"geoserver")
>>> cat.get_layers()
[Layer[Arc_Sample], Layer[Pk50095], Layer[Img_Sample], ...
>>> that_layer = cat.get_layer("roads")
>>> that_layer.enabled = False
>>> cat.save(that_layer)
Client #3 = Java
• Geoserver Manager Library
• https://github.com/geosolutions-it/
geoserver-manager

GeoServerRESTReader reader = new GeoServerRESTReader(url, user, password);
RESTStyleList styleList = reader.getStyles();
List<String> names = styleList.getNames();
GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(url, user, password);
publisher.createWorkspace(name);
Github

https://github.com/jericks/geoserver-shell
Install
• Download 0.1 release
• https://github.com/jericks/geoserver-shell/
releases

• Put bin directory on path
• run gs-shell
• Requires Java
Spring Shell
• Open source project from Spring Source
• Shell extracted from Spring Roo
• Spring Roo is a Java RAD tool for creating
web apps
Spring Shell
• Interactive shell environment
• Tab completion for commands, arguments,
and files

• History support (up and down arrows)
• Knows your commands and when you can
use them
Geoserver Shell
• Commands for each major Geoserver
Catalog item

• Methods in command construct a URL,

create a request body (xml, file) and make
an Http Request to Geoserver. The
Geoserver response is parsed and displayed
to the user
Commands
geoserver

datastore

ows

workspace

shapefile

settings

version

postgis

gwc

manifest

featuretype

wmsstore

namespace

coverage stores

style

coverage

template

worldimage

font

layers
Workspace Commands
• workspace list
• workspace create --name test
• workspace get --name test
• workspace delete --name test
• workspace default get
• workspace default set --name test
Workspace
gs-shell> geoserver set --url http://localhost:8080/geoserver
gs-shell> workspace create --name naturalearth
true
gs-shell> workspace list
topp
nurc
gs-shell> workspace get --name naturalearth
naturalearth
Shapefile
gs-shell> geoserver set --url http://localhost:8080/geoserver
gs-shell> workspace create --name naturalearth
true
gs-shell> shapefile zip --shapefile 110m_admin_0_countries.shp
true
gs-shell> shapefile publish --file 110m_admin_0_countries.zip -workspace naturalearth
true
PostGIS
gs-shell> geoserver set --url http://localhost:8080/geoserver
gs-shell> workspace create --name post
gs-shell> postgis datastore create --workspace post --datastore postgis -host localhost --port 5432 --database postgres --schema public --user
postgres --password postgres
true
gs-shell> featuretype list --workspace post --datastore postgis --list available
states
countries
cities
gs-shell> postgis featuretype publish --workspace post --datastore postgis -table 110m-admin-0-countries
true
GeoTiff
gs-shell> geoserver set --url http://localhost:8080/geoserver
gs-shell> coverage store upload --workspace naturalearth --file
GRAY_50M_SR_OB.zip --coveragestore world --type worldimage -configure first
true
gs-shell> coverage list --workspace naturalearth --coveragestore world
GRAY_50M_SR_OB
BLUE_MARBLE
gs-shell> coverage modify --workspace naturalearth --coveragestore world
--coverage GRAY_50M_SR_OB --srs EPSG:4326 --enabled true
true
Styles
gs-shell> style create --file 110m_admin_0_countries.sld --name
110m_admin_0_countries
true
gs-shell> layer style add --name 110m_admin_0_countries --style
110m_admin_0_countries
true
gs-shell> layer get --name 110m_admin_0_countries
110m_admin_0_countries
Title: null
Type:VECTOR
Abstract: null
Default Style: 110m_admin_0_countries
Namespace: Type String:VECTOR

gs-shell> layer modify --name 110m_admin_0_countries --defaultStyle
110m_admin_0_countries
true
Scripts
• Scripts contain the same commands entered
interactively

• History support saves session to geoservershell.log

$ gs-shell --cmdfile mycommands.gs
gs-shell> script --file naturalearth_countries.gs
Thank you!
Jared Erickson
jared.erickson@gmail.com
https://github.com/jericks

Contenu connexe

Tendances

Electrical survey 2018
Electrical survey 2018Electrical survey 2018
Electrical survey 2018Amit K. Mishra
 
Global positioning system (GPS)
Global positioning system (GPS)Global positioning system (GPS)
Global positioning system (GPS)Gautham Reddy
 
Groundwater Level Measurment Overview
Groundwater Level Measurment OverviewGroundwater Level Measurment Overview
Groundwater Level Measurment OverviewAbigail Brown
 
IMPROVED RESERVOIR EVALUATION 
IMPROVED RESERVOIR EVALUATION IMPROVED RESERVOIR EVALUATION 
IMPROVED RESERVOIR EVALUATION Modou.L. Jarju
 
Magnetic prospecting
Magnetic prospectingMagnetic prospecting
Magnetic prospectingPramoda Raj
 
Modelling of a Coastal Aquifer using FEFLOW
Modelling of a Coastal Aquifer using FEFLOWModelling of a Coastal Aquifer using FEFLOW
Modelling of a Coastal Aquifer using FEFLOWC. P. Kumar
 
Watershed analysis using GIS
Watershed analysis using GISWatershed analysis using GIS
Watershed analysis using GISAya Osman
 
Conjunctive use of water and water budgeting
Conjunctive use of water and water budgetingConjunctive use of water and water budgeting
Conjunctive use of water and water budgetingDelince Samuel
 
Sequence Stratigraphy.pptx
Sequence Stratigraphy.pptxSequence Stratigraphy.pptx
Sequence Stratigraphy.pptxSaadTaman
 
Electrical resistivity method ( electrical survey)
Electrical resistivity method ( electrical survey)Electrical resistivity method ( electrical survey)
Electrical resistivity method ( electrical survey)SudhanKumarSubedi
 
Subsurface geophysical methods
Subsurface geophysical methodsSubsurface geophysical methods
Subsurface geophysical methodsMohit Kumar
 

Tendances (20)

Electrical survey 2018
Electrical survey 2018Electrical survey 2018
Electrical survey 2018
 
Global positioning system (GPS)
Global positioning system (GPS)Global positioning system (GPS)
Global positioning system (GPS)
 
Borehole mantenance
Borehole mantenanceBorehole mantenance
Borehole mantenance
 
Basic of Geodesy
Basic of GeodesyBasic of Geodesy
Basic of Geodesy
 
Surface Water
Surface WaterSurface Water
Surface Water
 
Groundwater Level Measurment Overview
Groundwater Level Measurment OverviewGroundwater Level Measurment Overview
Groundwater Level Measurment Overview
 
Chapter 5 Fetter Ground water flow to wells
Chapter 5 Fetter Ground water flow to wellsChapter 5 Fetter Ground water flow to wells
Chapter 5 Fetter Ground water flow to wells
 
Geophysical well logging
Geophysical well loggingGeophysical well logging
Geophysical well logging
 
IMPROVED RESERVOIR EVALUATION 
IMPROVED RESERVOIR EVALUATION IMPROVED RESERVOIR EVALUATION 
IMPROVED RESERVOIR EVALUATION 
 
Magnetic prospecting
Magnetic prospectingMagnetic prospecting
Magnetic prospecting
 
Pulsed Neutron Logs.pdf
Pulsed Neutron Logs.pdfPulsed Neutron Logs.pdf
Pulsed Neutron Logs.pdf
 
Well logs
Well logsWell logs
Well logs
 
Modelling of a Coastal Aquifer using FEFLOW
Modelling of a Coastal Aquifer using FEFLOWModelling of a Coastal Aquifer using FEFLOW
Modelling of a Coastal Aquifer using FEFLOW
 
3.gravimetry
3.gravimetry3.gravimetry
3.gravimetry
 
Watershed analysis using GIS
Watershed analysis using GISWatershed analysis using GIS
Watershed analysis using GIS
 
Conjunctive use of water and water budgeting
Conjunctive use of water and water budgetingConjunctive use of water and water budgeting
Conjunctive use of water and water budgeting
 
Sequence Stratigraphy.pptx
Sequence Stratigraphy.pptxSequence Stratigraphy.pptx
Sequence Stratigraphy.pptx
 
Introduction to irrigation and hydrology
Introduction to irrigation and hydrologyIntroduction to irrigation and hydrology
Introduction to irrigation and hydrology
 
Electrical resistivity method ( electrical survey)
Electrical resistivity method ( electrical survey)Electrical resistivity method ( electrical survey)
Electrical resistivity method ( electrical survey)
 
Subsurface geophysical methods
Subsurface geophysical methodsSubsurface geophysical methods
Subsurface geophysical methods
 

Similaire à Geo servershell

WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.
WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.
WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.Dimitris Andreadis
 
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...seleniumconf
 
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache UsergridDavid M. Johnson
 
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...J V
 
MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB MeetupMariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB MeetupColin Charles
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS偉格 高
 
Introduction to Node (15th May 2017)
Introduction to Node (15th May 2017)Introduction to Node (15th May 2017)
Introduction to Node (15th May 2017)Lucas Jellema
 
Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoopclairvoyantllc
 
JS - The Unknown Basics.pptx
JS - The Unknown Basics.pptxJS - The Unknown Basics.pptx
JS - The Unknown Basics.pptxParveenSoni21
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersRob Windsor
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationStuart (Pid) Williams
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPOscar Merida
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and ActivatorKevin Webber
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure DataTaro L. Saito
 

Similaire à Geo servershell (20)

WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.
WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.
WildFly v9 - State of the Union Session at Voxxed, Istanbul, May/9th 2015.
 
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
Testing Rapidly Changing Applications With Self-Testing Object-Oriented Selen...
 
JSF2
JSF2JSF2
JSF2
 
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
44CON 2014 - Pentesting NoSQL DB's Using NoSQL Exploitation Framework, Franci...
 
GoDocker presentation
GoDocker presentationGoDocker presentation
GoDocker presentation
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 
Javascript & Jquery
Javascript & JqueryJavascript & Jquery
Javascript & Jquery
 
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
 
Liberty Deep Dive
Liberty Deep DiveLiberty Deep Dive
Liberty Deep Dive
 
MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB MeetupMariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS
 
Introduction to Node (15th May 2017)
Introduction to Node (15th May 2017)Introduction to Node (15th May 2017)
Introduction to Node (15th May 2017)
 
Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoop
 
JS - The Unknown Basics.pptx
JS - The Unknown Basics.pptxJS - The Unknown Basics.pptx
JS - The Unknown Basics.pptx
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint Developers
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
Nodejs web,db,hosting
Nodejs web,db,hostingNodejs web,db,hosting
Nodejs web,db,hosting
 
Play Framework and Activator
Play Framework and ActivatorPlay Framework and Activator
Play Framework and Activator
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure Data
 

Dernier

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 

Dernier (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Geo servershell

  • 1. Geoserver Shell Administer Geoserver using a CLI Jared Erickson CUGOS July 2013
  • 2. Outline • What is Geoserver Shell? • Why does Geoserver need a CLI? • What are we administering with CLI? • How does it work? • What does it look like in action?
  • 3. What is it? • Administer Geoserver from a command line interface (CLI) • Uses Geoserver Rest interface • Based on Spring Shell • Uses GeoServer Manager and GeoTools • Written in Java • Open Source MIT License • Hosted on Github
  • 4. Why a CLI? • Web UI is a major feature • Non developers can load data and styles • CLI is quick, efficient and scriptable • Once a script is written it can be replayed on other Geoservers (set up dev, then test, then production)
  • 6. Geoserver Catalog • Workspace • Namespace • DataStore • FeatureType • CoverageStore • Coverage • Layer • LayerGroups • Style • WMSStore
  • 7. Geoserver Rest • • • • • Administer GeoServer without GUI • Integrate with 3rd party applications Multiple representations: HTML, JSON, XML HTTP Verbs: GET, POST, PUT, DELETE HATEOS - linking http://docs.geoserver.org/stable/en/user/rest/ index.html
  • 11. Client #1 = curl • Upload a Shapefile curl -v -u admin:geoserver -XPUT -H "Content-type: application/zip" --data-binary @roads.zip http://localhost:8080/geoserver/rest/workspaces/acme/datastores/roads/ file.shp • Create a Workspace curl -v -u admin:geoserver -XPOST -H "Content-type: text/xml" -d "<workspace><name>acme</name></workspace>" http://localhost:8080/geoserver/rest/ workspaces
  • 12. Client #2 = Python • gsconfig.py • https://github.com/dwins/gsconfig.py/wiki • Used by GeoNode >>> from geoserver.catalog import Catalog >>> cat = Catalog("http://localhost:8080/geoserver/rest", "admin", "geoserver") >>> cat.get_layers() [Layer[Arc_Sample], Layer[Pk50095], Layer[Img_Sample], ... >>> that_layer = cat.get_layer("roads") >>> that_layer.enabled = False >>> cat.save(that_layer)
  • 13. Client #3 = Java • Geoserver Manager Library • https://github.com/geosolutions-it/ geoserver-manager GeoServerRESTReader reader = new GeoServerRESTReader(url, user, password); RESTStyleList styleList = reader.getStyles(); List<String> names = styleList.getNames(); GeoServerRESTPublisher publisher = new GeoServerRESTPublisher(url, user, password); publisher.createWorkspace(name);
  • 15. Install • Download 0.1 release • https://github.com/jericks/geoserver-shell/ releases • Put bin directory on path • run gs-shell • Requires Java
  • 16. Spring Shell • Open source project from Spring Source • Shell extracted from Spring Roo • Spring Roo is a Java RAD tool for creating web apps
  • 17. Spring Shell • Interactive shell environment • Tab completion for commands, arguments, and files • History support (up and down arrows) • Knows your commands and when you can use them
  • 18. Geoserver Shell • Commands for each major Geoserver Catalog item • Methods in command construct a URL, create a request body (xml, file) and make an Http Request to Geoserver. The Geoserver response is parsed and displayed to the user
  • 20. Workspace Commands • workspace list • workspace create --name test • workspace get --name test • workspace delete --name test • workspace default get • workspace default set --name test
  • 21. Workspace gs-shell> geoserver set --url http://localhost:8080/geoserver gs-shell> workspace create --name naturalearth true gs-shell> workspace list topp nurc gs-shell> workspace get --name naturalearth naturalearth
  • 22. Shapefile gs-shell> geoserver set --url http://localhost:8080/geoserver gs-shell> workspace create --name naturalearth true gs-shell> shapefile zip --shapefile 110m_admin_0_countries.shp true gs-shell> shapefile publish --file 110m_admin_0_countries.zip -workspace naturalearth true
  • 23. PostGIS gs-shell> geoserver set --url http://localhost:8080/geoserver gs-shell> workspace create --name post gs-shell> postgis datastore create --workspace post --datastore postgis -host localhost --port 5432 --database postgres --schema public --user postgres --password postgres true gs-shell> featuretype list --workspace post --datastore postgis --list available states countries cities gs-shell> postgis featuretype publish --workspace post --datastore postgis -table 110m-admin-0-countries true
  • 24. GeoTiff gs-shell> geoserver set --url http://localhost:8080/geoserver gs-shell> coverage store upload --workspace naturalearth --file GRAY_50M_SR_OB.zip --coveragestore world --type worldimage -configure first true gs-shell> coverage list --workspace naturalearth --coveragestore world GRAY_50M_SR_OB BLUE_MARBLE gs-shell> coverage modify --workspace naturalearth --coveragestore world --coverage GRAY_50M_SR_OB --srs EPSG:4326 --enabled true true
  • 25. Styles gs-shell> style create --file 110m_admin_0_countries.sld --name 110m_admin_0_countries true gs-shell> layer style add --name 110m_admin_0_countries --style 110m_admin_0_countries true gs-shell> layer get --name 110m_admin_0_countries 110m_admin_0_countries Title: null Type:VECTOR Abstract: null Default Style: 110m_admin_0_countries Namespace: Type String:VECTOR gs-shell> layer modify --name 110m_admin_0_countries --defaultStyle 110m_admin_0_countries true
  • 26. Scripts • Scripts contain the same commands entered interactively • History support saves session to geoservershell.log $ gs-shell --cmdfile mycommands.gs gs-shell> script --file naturalearth_countries.gs