ace-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daan Veldhof <daanveld...@gmail.com>
Subject Uploading artifact through REST
Date Thu, 15 Oct 2015 11:43:57 GMT
Hi everyone,

I'm trying to setup ACE so I don't have to interact with the Web UI, but I
can't find a clear REST call for uploading an artifact. I know there is the
way with the URL to the local file, but I want to be able to upload the
artifacts from another PC, so that's not really an option. I also know
there is this call below, but I don't know exactly how to add the file to
the request

- - POST /*obr*/${ID}, submits a resource to the *OBR*. The ${ID} is used
as the resource name and the content as its value. Returns a 409 if there
is a conflict with another resource;

I tried adding the file to the request with python using httplib
--------------------------------------------------------------------------
conn.request("POST", "/obr/bla.jar", open("bla.jar", "r"))
response = conn.getresponse()
print response.status, response.reason
data = response.read()
print data
--------------------------------------------------------------------------

And I tried it with python using urllib2 and poster
--------------------------------------------------------------------------
register_openers()
datagen, headers = multipart_encode({"blah": open("bla.jar", "rb")})
request = urllib2.Request("http://localhost:8080/obr/bla.jar", datagen,
headers)
print urllib2.urlopen(request).read()
--------------------------------------------------------------------------

The GET and DELETE on /obr/${ID} do work for me.


Regards

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message