aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV.Krishn <vkrishn4@gmail.com>2016-06-20 07:34:36 +0530
committerV.Krishn <vkrishn4@gmail.com>2016-06-20 07:34:36 +0530
commit10d11050f6ee052e50b7dc6bd22ec5204d624fc0 (patch)
treec5988ca133831ac5b98d9cddaf4219a5c465ca15
parent3be0c714c500118956f0aeb032d5db0f55a66d04 (diff)
downloadaport-api-10d11050f6ee052e50b7dc6bd22ec5204d624fc0.tar.bz2
update docs
-rw-r--r--docs/api-json.md30
1 files changed, 21 insertions, 9 deletions
diff --git a/docs/api-json.md b/docs/api-json.md
index 320539c..cf1f4ea 100644
--- a/docs/api-json.md
+++ b/docs/api-json.md
@@ -5,6 +5,7 @@ JSONAPI implementations for aports packages.
Api is build around packages data and its relationships with other tables in database,
using, simple one-to-one relationships (based on foreign-key/pid/id).
+
Currently, any JOINS in database is being avoided and maybe used if needed.
@@ -28,19 +29,26 @@ packages
api uri: `<BaseURL>/packages/...`
Get packages list (paginated 50 items)
-`curl https://api.alpinelinux.org/packages | jq . | less`
+
+* eg. `curl https://api.alpinelinux.org/packages | jq . | less`
searching
-----------
-* Searching packages by categories
+api uri: `<BaseURL>/search/<where>/key1/value1/key2/value2`
+
+1. where = packages|contents
+2. keys = category|name|maintainer|flagged
+
api uri: `<BaseURL>/search/packages/category/<branch>:<repo>:<arch>/name/<pkgName>`
+* Searches packages by categories and pkgName
* Reserved keyword in categories - ''all''
* Wildcard for package name recogonized '_'
-Eg. Basic search
+
+* eg. Basic search
`curl https://api.alpinelinux.org/search/packages/category/v3.4:all:x86/name/_bas_ | jq . | less`
-Eg. Advanced search
+* eg. Advanced search
`curl -X POST https://api.alpinelinux.org/search/packages -d '{"name":"_bas_","category":"edge:main:x86"}' | jq . | less`
@@ -49,18 +57,22 @@ categories
api uri: `<BaseURL>/categories`
Get categories available.
-Categories are for Branch:Repo:Arch
+Categories are for branch:repo:arch (eg. edge:main:x86 )
-Eg. Get available categories
+* eg. Get available categories
`<BaseURL>/categories`
flagged packages
-----------------
-* Get flagged data (paginated) `<BaseURL>/flagged` (follow relationships link to get package data)
+1. api uri: `<BaseURL>/flagged`
+* Get flagged data (paginated) (follow relationships link to get package data)
* `<BaseURL>/flagged/page/<num>` - more items (older)
-* Get current flagged item `<BaseURL>/flagged/new`
-* See the current package that got flagged
+
+2. api uri: `<BaseURL>/flagged/new`
+* Get current flagged item
+
+* How to get the current package that got flagged
`new=$(curl api.alpinelinux.org/flagged/new | jq .data[].relationships.packages.links.self | sed -e 's/"//g'); curl $new | jq .data[].attributes.origin | uniq`