| 64 | | |
| 65 | | ---- |
| 66 | | |
| 67 | | == Current Development Issues == |
| 68 | | |
| 69 | | * How does a machine client acquire and select from the package license options? |
| 70 | | * Can the above POST parameter data types be specified more formally? |
| 71 | | |
| 72 | | ---- |
| 73 | | |
| 74 | | = Proposed API = |
| 75 | | |
| 76 | | == Resources == |
| 77 | | |
| 78 | | || '''Resource''' || '''Location''' || |
| 79 | | || All Licenses|| !http://ckan.net/api/rest/licenses || |
| 80 | | || Licence || !http://ckan.net/api/rest/license/:id || |
| 81 | | || All Packages || !http://ckan.net/api/rest/packages || |
| 82 | | || Package || !http://ckan.net/api/rest/package/:id || |
| 83 | | || All Tags || !http://ckan.net/api/rest/tags || |
| 84 | | || Tag || !http://ckan.net/api/rest/tag/:id || |
| 85 | | |
| 86 | | == Data Formats == |
| 87 | | |
| 88 | | ''Todo: Decide how to identify objects (name, database ID, UUID), then fixup these data formats. Currently assumed to use the value of the object name attribute as the object's resource identifier.'' |
| 89 | | |
| 90 | | ==== Database ID Format ==== |
| 91 | | |
| 92 | | {{{ |
| 93 | | An integer. |
| 94 | | }}} |
| 95 | | |
| 96 | | ==== UUID Format ==== |
| 97 | | |
| 98 | | {{{ |
| 99 | | ? |
| 100 | | }}} |
| 101 | | |
| 102 | | |
| 103 | | ==== Name ID Format ==== |
| 104 | | |
| 105 | | {{{ |
| 106 | | The value of the object's name attribute. |
| 107 | | }}} |
| 108 | | |
| 109 | | |
| 110 | | ==== License List Format ==== |
| 111 | | |
| 112 | | {{{ |
| 113 | | { |
| 114 | | "licence-list": [ |
| 115 | | { |
| 116 | | "id": "BSD" |
| 117 | | |
| 118 | | },{ |
| 119 | | "id": "MIT" |
| 120 | | } |
| 121 | | ] |
| 122 | | } |
| 123 | | }}} |
| 124 | | |
| 125 | | ==== License Format ==== |
| 126 | | |
| 127 | | {{{ |
| 128 | | { |
| 129 | | "licence": { |
| 130 | | "name": "BSD" |
| 131 | | } |
| 132 | | } |
| 133 | | }}} |
| 134 | | |
| 135 | | ==== Package List Format ==== |
| 136 | | |
| 137 | | {{{ |
| 138 | | { |
| 139 | | "package-list": [ |
| 140 | | { |
| 141 | | "id": "dataset-1" |
| 142 | | |
| 143 | | },{ |
| 144 | | "id": "dataset-2" |
| 145 | | } |
| 146 | | ] |
| 147 | | } |
| 148 | | }}} |
| 149 | | |
| 150 | | ==== Package Format ==== |
| 151 | | |
| 152 | | {{{ |
| 153 | | { |
| 154 | | "package": { |
| 155 | | "name": "dataset-1", |
| 156 | | "title": "My Title", |
| 157 | | "url": "http://mylocation", |
| 158 | | "download_url": "http://mydownloadlocation", |
| 159 | | "licences": [5,7], |
| 160 | | "tags": "this that other", |
| 161 | | "notes": "Some notes." |
| 162 | | } |
| 163 | | } |
| 164 | | }}} |
| 165 | | |
| 166 | | ==== Tag List Format ==== |
| 167 | | |
| 168 | | {{{ |
| 169 | | { |
| 170 | | "tag-list": [ |
| 171 | | { |
| 172 | | "id": "this" |
| 173 | | |
| 174 | | },{ |
| 175 | | "id": "that" |
| 176 | | } |
| 177 | | ] |
| 178 | | } |
| 179 | | }}} |
| 180 | | |
| 181 | | ==== Tag Format ==== |
| 182 | | |
| 183 | | {{{ |
| 184 | | { |
| 185 | | "tag": { |
| 186 | | "name": "this" |
| 187 | | } |
| 188 | | } |
| 189 | | }}} |
| 190 | | |
| 191 | | == Methods, Formats, and Status Codes == |
| 192 | | |
| 193 | | || '''Resource''' || '''Method''' || '''Format''' || '''Status Codes''' || |
| 194 | | || All Licenses || GET || License List Format || 200, 301 || |
| 195 | | || All Licenses || POST || License Format || 201, 400 || |
| 196 | | || License || GET || License Format || 200, 301, 410 || |
| 197 | | || License || PUT || License Format || 200, 301, 400, 410 || |
| 198 | | || License || DELETE || N/A || 200, 204 || |
| 199 | | || All Packages || GET || Package List Format || 200, 301 || |
| 200 | | || All Packages || POST || Package Format || 201, 400 || |
| 201 | | || Package || GET || Package Format || 200, 301, 410 || |
| 202 | | || Package || PUT || Package Format || 200, 301, 400, 410 || |
| 203 | | || Package || DELETE || N/A || 200, 204 || |
| 204 | | || All Tags || GET || Tag List Format || 200, 301 || |
| 205 | | || All Tags || POST || Tag Format || 201, 400 || |
| 206 | | || Tags || GET || Tag Format || 200, 301, 410 || |
| 207 | | || Tags || PUT || Tag Format || 200, 301, 400, 410 || |
| 208 | | || Tags || DELETE || N/A || 200, 204 || |
| 209 | | |