It depends on where the data is located. I want to pull all the geospatial data 
off a hard drive, but that is after Melody and I figure out a solution for this 
problem.

Right now I'm putting in file:data/CADRG/JNC, because I moved the data into the 
data directory of the GEOServer.

From: [email protected] [mailto:[email protected]] On 
Behalf Of Mauro Bartolomeoli
Sent: Wednesday, October 23, 2013 1:46 PM
To: Laratta, David (IS)
Cc: Ballance, Melody (IS); Mauro Bartolomeoli; 
[email protected]
Subject: Re: EXT :Re: [Geoserver-users] GeoServer 2.3.4 imagepyramid plugin and 
SSL and J2EE login


Hi David,
see my answers below:
2013/10/23 Laratta, David (IS) 
<[email protected]<mailto:[email protected]>>
Originally I wrote the code in Perl, but I had to change it to Python.

def http_post(url, username, password, content):
                user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) 
Gecko/20100101 Firefox/25.0'
                base64string = base64.standard_b64encode('%s:%s' % (username, 
password))
                headers = { 'User-Agent' : user_agent , 'Content-Type' : 
'text/xml', 'Authorization' : 'Basic %s' % base64string }
                request = urllib2.Request(url, content, headers)
                try:
                                result = urllib2.urlopen(request)
                                print result.read()
                except urllib2.URLError as e:
                                if hasattr(e, 'reason'):
                                                print 'We failed to reach a 
server.'
                                                print 'Reason: ', e.reason
                                elif hasattr(e, 'code'):
                                                print 'The server couldn\'t 
fulfill the request.'
                                                print 'Error code: ', e.code

username = sys.argv[1];
password = sys.argv[2];
data = sys.argv[3];

What are you using as the 3rd argument to the script, or better, what is the 
content of the data variable after this line of code?

fqhn = sys.argv[4];

url = 'https://' + fqhn + ':7502/GeoServer/rest/workspaces/'
content = '<workspace><name>CADRG</name>'
http_post(url, username, password, content)

url = 'https://' + fqhn + 
':7502/GeoServer/rest/workspaces/CADRG/coveragestores?configure=all'
content = 
'<coverageStore><workspace>CADRG</workspace><name>JNC</name><enabled>true</enabled><type>ImagePyramid</type><url>'
 + data + '/CADRG/JNC</url></coverageStore>'
http_post(url, username, password, content)

So, what is the value of the content variable at this point?
What I'm thinking of is that in the url section maybe you are missing the url 
protocol (file:). Is this the case?

Regards,
Mauro

--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more 
information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:     +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to