Getting 404s working with Publish API

143 views
Skip to first unread message

Zane Williamson

unread,
Apr 24, 2015, 12:22:22 PM4/24/15
to aptly-...@googlegroups.com
Hi All,

Not sure what I am doing wrong here but perhaps a second set of eyes will help me...

here is the testing layout:

repo
{"Name":"stable-repo","Comment":"","DefaultDistribution":"","DefaultComponent":"main"}

snapshot
{"Name":"rocksoftware301","CreatedAt":"2015-04-11T16:11:54.795861762Z","Description":"Snapshot from local repo [stable-repo]"}

My publish attempt:
curl -XPOST -H "Content-type: application/json" -d '{"SourceKind":"snapshot","Sources":[{"Name":"rocksoftware301"}],"Distribution":"precise",Component:"main"}' 'http://localhost:8082/api/publish'
404 page not found

I try with just requirements of SourceKind and Name:
curl -XPOST -H "Content-type: application/json" -d '{"SourceKind":"snapshot","Sources":[{"Name":"rocksoftware301"}]}' 'http://localhost:8082/api/publish'
404 page not found

Any advice on what I might be missing here would be appreciated!

-Zane

Zane Williamson

unread,
Apr 26, 2015, 8:27:09 PM4/26/15
to aptly-...@googlegroups.com
Hmm, looks like I am having trouble with the DELETE function of the package API as well...

Testing publish point:
  * testing/precise-testing [amd64, i386] publishes {main: [testing-repo]}

{}

400 code response?
[GIN] 2015/04/27 - 00:25:36 | 400 |     58.948µs | 10.0.2.2:50331 |   DELETE  /api/publish/testing/precise-testing

same thing with a force added:

{}

[GIN] 2015/04/27 - 00:26:48 | 400 |     48.609µs | 10.0.2.2:50335 |   DELETE  /api/publish/testing/precise-testing

Zane Williamson

unread,
May 3, 2015, 9:28:13 AM5/3/15
to aptly-...@googlegroups.com
I figured it out.  The documentation appears to be wrong on the Publish API page.  Ill submit a pull request to update it.

basically, 


but this works:

Zane Williamson

unread,
May 3, 2015, 10:13:03 AM5/3/15
to aptly-...@googlegroups.com

Andrey Smirnov

unread,
May 4, 2015, 3:22:47 PM5/4/15
to aptly-...@googlegroups.com
Hi Zane,

Could that be that you're running some old development version of aptly?

It looks like DELETE is not implemented, and old format of publish API is being used. Docs should be up to date with current version (0.9+).

Zane Williamson

unread,
May 5, 2015, 2:46:12 PM5/5/15
to aptly-...@googlegroups.com
Great, upgrading did the trick.  Appreciate the feedback!
Reply all
Reply to author
Forward
0 new messages