{"action":"created","comment":{"url":"https://api.github.com/repos/ElektraInitiative/libelektra/pulls/comments/93860893","pull_request_review_id":14394473,"id":93860893,"diff_hunk":"@@ -0,0 +1,134 @@\n+FORMAT: 1A\n+\n+# elektrad API\n+\n+to access single instances, each elektra daemon (`elektrad`) provides a REST\n+HTTP API\n+\n+\n+## get versions [GET /version]\n+\n+returns the current version of the API and elektra\n+\n+The API version is increased whenever breaking changes\n+(i.e. changes that prevent backward compatibility) are made.\n+The Elektra version is directly taken from the Elektra library,\n+for further information and explanation see [doc/VERSION.md](https://github.com/ElektraInitiative/libelektra/blob/master/doc/VERSION.md).\n+\n++ Response 200 (application/json)\n+    + Attributes (object)\n+        + elektra (object) - Detailed version information about the used Elektra library\n+            + version (string) - The currently used version in its complete format\n+            + major (number) - The currently used major version\n+            + minor (number) - The currently used minor version\n+            + micro (number) - The currently used micro version\n+        + api (number) - The version of the API itself\n+\n+\n+## elektra key database [/kdb/{+path}{?apikey}]\n+\n+access the elektra key database by specifying a `path`\n+\n++ Parameters\n+    + path: `user/hello` (string) - path to the elektra config\n+    + apikey: `7b7947e6-adc5-4d23-b53c-783623f894f8` (string, required) - API key used to authenticate with `elektrad`\n+\n+### get configuration [GET]\n+\n++ Response 200 (application/json)\n+    + Attributes (object)\n+        + ls: user/hello, user/hello/world (array[string], required) - subkeys of the requested path, similar to `kdb ls`\n+        + value: hello world (string, required)\n+        + meta (object, required) - metadata of the requested path\n+\n++ Response 400 (application/json)\n+    + Attributes (Error)\n+        + i18n\n+            A comprehensive list of possible errors:\n+            - `APIKEY_MISSING` api key not specified\n+\n++ Response 401 (application/json)\n+    + Attributes (Error)\n+        + i18n\n+            A comprehensive list of possible errors:\n+            - `NEED_AUTHENTICATION` if no valid apikey has been supplied\n+\n++ Response 404 (application/json)\n+    + Attributes (Error)\n+        + i18n\n+            A comprehensive list of possible errors:\n+            - `PATH_NOT_FOUND` if the requested path does not exist in the key database\n+\n+### set configuration [PUT]\n+\n++ Request (text/plain)\n+\n+        hello world\n+\n++ Response 204\n+\n++ Request (application/json)\n+\n+        \"hello world\"","path":"doc/apiblueprints/elektrad.apib","position":72,"original_position":72,"commit_id":"91b01aa16499a860c9f2e00d8aa9367a71ab0b76","original_commit_id":"b12eebb62b901c28f4bd83d3e4770524bf976c62","user":{"login":"Namoshek","id":8877609,"avatar_url":"https://avatars.githubusercontent.com/u/8877609?v=3","gravatar_id":"","url":"https://api.github.com/users/Namoshek","html_url":"https://github.com/Namoshek","followers_url":"https://api.github.com/users/Namoshek/followers","following_url":"https://api.github.com/users/Namoshek/following{/other_user}","gists_url":"https://api.github.com/users/Namoshek/gists{/gist_id}","starred_url":"https://api.github.com/users/Namoshek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Namoshek/subscriptions","organizations_url":"https://api.github.com/users/Namoshek/orgs","repos_url":"https://api.github.com/users/Namoshek/repos","events_url":"https://api.github.com/users/Namoshek/events{/privacy}","received_events_url":"https://api.github.com/users/Namoshek/received_events","type":"User","site_admin":false},"body":"I think he means something like\r\n```\r\nPOST [...]/set/path/to/var?format=augeas%20lens=Hosts.lns\r\nContent-Type: text/plain\r\n\r\nBody:\r\n127.0.0.1 localhost loopback-adapter\r\n192.168.0.1 gateway\r\n```\r\nOr in other words: Give format as GET parameter + whole payload is the snippet in plain text.\r\nBut normally one would avoid GET parameters in a POST request I think...","created_at":"2016-12-26T11:19:40Z","updated_at":"2016-12-26T11:19:40Z","html_url":"https://github.com/ElektraInitiative/libelektra/pull/912#discussion_r93860893","pull_request_url":"https://api.github.com/repos/ElektraInitiative/libelektra/pulls/912","_links":{"self":{"href":"https://api.github.com/repos/ElektraInitiative/libelektra/pulls/comments/93860893"},"html":{"href":"https://github.com/ElektraInitiative/libelektra/pull/912#discussion_r93860893"},"pull_request":{"href":"https://api.github.com/repos/ElektraInitiative/libelektra/pulls/912"}}},"pull_request":{"url":"https://api.github.com/repos/ElektraInitiative/libelektra/pulls/912","id":83673329,"html_url":"https://github.com/ElektraInitiative/libelektra/pull/912","diff_url":"https://github.com/ElektraInitiative/libelektra/pull/912.diff","patch_url":"https://github.com/ElektraInitiative/libelektra/pull/912.patch","issue_url":"https://api.github.com/repos/ElektraInitiative/libelektra/issues/912","number":912,"state":"open","locked":false,"title":"elektra-web HTTP API","user":{"login":"omnidan","id":668674,"avatar_url":"https://avatars.githubusercontent.com/u/668674?v=3","gravatar_id":"","url":"https://api.github.com/users/omnidan","html_url":"https://github.com/omnidan","followers_url":"https://api.github.com/users/omnidan/followers","following_url":"https://api.github.com/users/omnidan/following{/other_user}","gists_url":"https://api.github.com/users/omnidan/gists{/gist_id}","starred_url":"https://api.github.com/users/omnidan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omnidan/subscriptions","organizations_url":"https://api.github.com/users/omnidan/orgs","repos_url":"https://api.github.com/users/omnidan/repos","events_url":"https://api.github.com/users/omnidan/events{/privacy}","received_events_url":"https://api.github.com/users/omnidan/received_events","type":"User","site_admin":false},"body":"# Purpose\n\nThis is a proposal to allow remote configuration of (multiple) elektra instances.\n- elektrad: http://docs.elektrad.apiary.io/\n- clusterd: http://docs.clusterd.apiary.io/\n# Checklist\n- [x] split into 2 blueprints\n- [x] move to doc/apiblueprints/\n- [x] use `{+path}` instead of `{path}` - https://apiblueprint.org/documentation/specification.html#variable-with-reserved-characters-values\n- [x] return `ls`/`value`/`meta` when accessing kdb paths via `GET`\n- [x] http error/response codes\n- [x] ~~output kdb errors via api~~ does this really make sense since we're not dealing with plugins?\n- [x] ~~change links to point to the official repo~~\n\n@markus2330 please review my pull request\n","created_at":"2016-09-01T17:24:06Z","updated_at":"2016-12-26T11:19:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"56a740d4870a40c619d5cb5c0243e89c488d5b72","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ElektraInitiative/libelektra/pulls/912/commits","review_comments_url":"https://api.github.com/repos/ElektraInitiative/libelektra/pulls/912/comments","review_comment_url":"https://api.github.com/repos/ElektraInitiative/libelektra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ElektraInitiative/libelektra/issues/912/comments","statuses_url":"https://api.github.com/repos/ElektraInitiative/libelektra/statuses/91b01aa16499a860c9f2e00d8aa9367a71ab0b76","head":{"label":"omnidan:http-api-proposal","ref":"http-api-proposal","sha":"91b01aa16499a860c9f2e00d8aa9367a71ab0b76","user":{"login":"omnidan","id":668674,"avatar_url":"https://avatars.githubusercontent.com/u/668674?v=3","gravatar_id":"","url":"https://api.github.com/users/omnidan","html_url":"https://github.com/omnidan","followers_url":"https://api.github.com/users/omnidan/followers","following_url":"https://api.github.com/users/omnidan/following{/other_user}","gists_url":"https://api.github.com/users/omnidan/gists{/gist_id}","starred_url":"https://api.github.com/users/omnidan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omnidan/subscriptions","organizations_url":"https://api.github.com/users/omnidan/orgs","repos_url":"https://api.github.com/users/omnidan/repos","events_url":"https://api.github.com/users/omnidan/events{/privacy}","received_events_url":"https://api.github.com/users/omnidan/received_events","type":"User","site_admin":false},"repo":{"id":41959424,"name":"libelektra","full_name":"omnidan/libelektra","owner":{"login":"omnidan","id":668674,"avatar_url":"https://avatars.githubusercontent.com/u/668674?v=3","gravatar_id":"","url":"https://api.github.com/users/omnidan","html_url":"https://github.com/omnidan","followers_url":"https://api.github.com/users/omnidan/followers","following_url":"https://api.github.com/users/omnidan/following{/other_user}","gists_url":"https://api.github.com/users/omnidan/gists{/gist_id}","starred_url":"https://api.github.com/users/omnidan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omnidan/subscriptions","organizations_url":"https://api.github.com/users/omnidan/orgs","repos_url":"https://api.github.com/users/omnidan/repos","events_url":"https://api.github.com/users/omnidan/events{/privacy}","received_events_url":"https://api.github.com/users/omnidan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/omnidan/libelektra","description":"Elektra provides a universal and secure framework to store configuration parameters in a global, hierarchical key database.","fork":true,"url":"https://api.github.com/repos/omnidan/libelektra","forks_url":"https://api.github.com/repos/omnidan/libelektra/forks","keys_url":"https://api.github.com/repos/omnidan/libelektra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/omnidan/libelektra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/omnidan/libelektra/teams","hooks_url":"https://api.github.com/repos/omnidan/libelektra/hooks","issue_events_url":"https://api.github.com/repos/omnidan/libelektra/issues/events{/number}","events_url":"https://api.github.com/repos/omnidan/libelektra/events","assignees_url":"https://api.github.com/repos/omnidan/libelektra/assignees{/user}","branches_url":"https://api.github.com/repos/omnidan/libelektra/branches{/branch}","tags_url":"https://api.github.com/repos/omnidan/libelektra/tags","blobs_url":"https://api.github.com/repos/omnidan/libelektra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/omnidan/libelektra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/omnidan/libelektra/git/refs{/sha}","trees_url":"https://api.github.com/repos/omnidan/libelektra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/omnidan/libelektra/statuses/{sha}","languages_url":"https://api.github.com/repos/omnidan/libelektra/languages","stargazers_url":"https://api.github.com/repos/omnidan/libelektra/stargazers","contributors_url":"https://api.github.com/repos/omnidan/libelektra/contributors","subscribers_url":"https://api.github.com/repos/omnidan/libelektra/subscribers","subscription_url":"https://api.github.com/repos/omnidan/libelektra/subscription","commits_url":"https://api.github.com/repos/omnidan/libelektra/commits{/sha}","git_commits_url":"https://api.github.com/repos/omnidan/libelektra/git/commits{/sha}","comments_url":"https://api.github.com/repos/omnidan/libelektra/comments{/number}","issue_comment_url":"https://api.github.com/repos/omnidan/libelektra/issues/comments{/number}","contents_url":"https://api.github.com/repos/omnidan/libelektra/contents/{+path}","compare_url":"https://api.github.com/repos/omnidan/libelektra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/omnidan/libelektra/merges","archive_url":"https://api.github.com/repos/omnidan/libelektra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/omnidan/libelektra/downloads","issues_url":"https://api.github.com/repos/omnidan/libelektra/issues{/number}","pulls_url":"https://api.github.com/repos/omnidan/libelektra/pulls{/number}","milestones_url":"https://api.github.com/repos/omnidan/libelektra/milestones{/number}","notifications_url":"https://api.github.com/repos/omnidan/libelektra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/omnidan/libelektra/labels{/name}","releases_url":"https://api.github.com/repos/omnidan/libelektra/releases{/id}","deployments_url":"https://api.github.com/repos/omnidan/libelektra/deployments","created_at":"2015-09-05T12:06:39Z","updated_at":"2016-08-31T12:39:07Z","pushed_at":"2016-12-26T11:15:49Z","git_url":"git://github.com/omnidan/libelektra.git","ssh_url":"git@github.com:omnidan/libelektra.git","clone_url":"https://github.com/omnidan/libelektra.git","svn_url":"https://github.com/omnidan/libelektra","homepage":"","size":33881,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ElektraInitiative:master","ref":"master","sha":"a37581fc9d7c43ddda3314280a3ba7198dd35770","user":{"login":"ElektraInitiative","id":7949092,"avatar_url":"https://avatars.githubusercontent.com/u/7949092?v=3","gravatar_id":"","url":"https://api.github.com/users/ElektraInitiative","html_url":"https://github.com/ElektraInitiative","followers_url":"https://api.github.com/users/ElektraInitiative/followers","following_url":"https://api.github.com/users/ElektraInitiative/following{/other_user}","gists_url":"https://api.github.com/users/ElektraInitiative/gists{/gist_id}","starred_url":"https://api.github.com/users/ElektraInitiative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElektraInitiative/subscriptions","organizations_url":"https://api.github.com/users/ElektraInitiative/orgs","repos_url":"https://api.github.com/users/ElektraInitiative/repos","events_url":"https://api.github.com/users/ElektraInitiative/events{/privacy}","received_events_url":"https://api.github.com/users/ElektraInitiative/received_events","type":"Organization","site_admin":false},"repo":{"id":21063580,"name":"libelektra","full_name":"ElektraInitiative/libelektra","owner":{"login":"ElektraInitiative","id":7949092,"avatar_url":"https://avatars.githubusercontent.com/u/7949092?v=3","gravatar_id":"","url":"https://api.github.com/users/ElektraInitiative","html_url":"https://github.com/ElektraInitiative","followers_url":"https://api.github.com/users/ElektraInitiative/followers","following_url":"https://api.github.com/users/ElektraInitiative/following{/other_user}","gists_url":"https://api.github.com/users/ElektraInitiative/gists{/gist_id}","starred_url":"https://api.github.com/users/ElektraInitiative/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElektraInitiative/subscriptions","organizations_url":"https://api.github.com/users/ElektraInitiative/orgs","repos_url":"https://api.github.com/users/ElektraInitiative/repos","events_url":"https://api.github.com/users/ElektraInitiative/events{/privacy}","received_events_url":"https://api.github.com/users/ElektraInitiative/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ElektraInitiative/libelektra","description":"Elektra serves as a universal and secure framework to access configuration parameters in a global, hierarchical key database.","fork":false,"url":"https://api.github.com/repos/ElektraInitiative/libelektra","forks_url":"https://api.github.com/repos/ElektraInitiative/libelektra/forks","keys_url":"https://api.github.com/repos/ElektraInitiative/libelektra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ElektraInitiative/libelektra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ElektraInitiative/libelektra/teams","hooks_url":"https://api.github.com/repos/ElektraInitiative/libelektra/hooks","issue_events_url":"https://api.github.com/repos/ElektraInitiative/libelektra/issues/events{/number}","events_url":"https://api.github.com/repos/ElektraInitiative/libelektra/events","assignees_url":"https://api.github.com/repos/ElektraInitiative/libelektra/assignees{/user}","branches_url":"https://api.github.com/repos/ElektraInitiative/libelektra/branches{/branch}","tags_url":"https://api.github.com/repos/ElektraInitiative/libelektra/tags","blobs_url":"https://api.github.com/repos/ElektraInitiative/libelektra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ElektraInitiative/libelektra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ElektraInitiative/libelektra/git/refs{/sha}","trees_url":"https://api.github.com/repos/ElektraInitiative/libelektra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ElektraInitiative/libelektra/statuses/{sha}","languages_url":"https://api.github.com/repos/ElektraInitiative/libelektra/languages","stargazers_url":"https://api.github.com/repos/ElektraInitiative/libelektra/stargazers","contributors_url":"https://api.github.com/repos/ElektraInitiative/libelektra/contributors","subscribers_url":"https://api.github.com/repos/ElektraInitiative/libelektra/subscribers","subscription_url":"https://api.github.com/repos/ElektraInitiative/libelektra/subscription","commits_url":"https://api.github.com/repos/ElektraInitiative/libelektra/commits{/sha}","git_commits_url":"https://api.github.com/repos/ElektraInitiative/libelektra/git/commits{/sha}","comments_url":"https://api.github.com/repos/ElektraInitiative/libelektra/comments{/number}","issue_comment_url":"https://api.github.com/repos/ElektraInitiative/libelektra/issues/comments{/number}","contents_url":"https://api.github.com/repos/ElektraInitiative/libelektra/contents/{+path}","compare_url":"https://api.github.com/repos/ElektraInitiative/libelektra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ElektraInitiative/libelektra/merges","archive_url":"https://api.github.com/repos/ElektraInitiative/libelektra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ElektraInitiative/libelektra/downloads","issues_url":"https://api.github.com/repos/ElektraInitiative/libelektra/issues{/number}","pulls_url":"https://api.github.com/repos/ElektraInitiative/libelektra/pulls{/number}","milestones_url":"https://api.github.com/repos/ElektraInitiative/libelektra/milestones{/number}","notifications_url":"https://api.github.com/repos/ElektraInitiative/libelektra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ElektraInitiative/libelektra/labels{/name}","releases_url":"https://api.github.com/repos/ElektraInitiative/libelektra/releases{/id}","deployments_url":"https://api.github.com/repos/ElektraInitiative/libelektra/deployments","created_at":"2014-06-21T08:01:04Z","updated_at":"2016-12-22T12:16:55Z","pushed_at":"2016-12-26T11:15:50Z","git_url":"git://github.com/ElektraInitiative/libelektra.git","ssh_url":"git@github.com:ElektraInitiative/libelektra.git","clone_url":"https://github.com/ElektraInitiative/libelektra.git","svn_url":"https://github.com/ElektraInitiative/libelektra","homepage":"https://www.libelektra.org","size":37811,"stargazers_count":43,"watchers_count":43,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":177,"forks":35,"open_issues":177,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ElektraInitiative/libelektra/pulls/912"},"html":{"href":"https://github.com/ElektraInitiative/libelektra/pull/912"},"issue":{"href":"https://api.github.com/repos/ElektraInitiative/libelektra/issues/912"},"comments":{"href":"https://api.github.com/repos/ElektraInitiative/libelektra/issues/912/comments"},"review_comments":{"href":"https://api.github.com/repos/ElektraInitiative/libelektra/pulls/912/comments"},"review_comment":{"href":"https://api.github.com/repos/ElektraInitiative/libelektra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ElektraInitiative/libelektra/pulls/912/commits"},"statuses":{"href":"https://api.github.com/repos/ElektraInitiative/libelektra/statuses/91b01aa16499a860c9f2e00d8aa9367a71ab0b76"}}}}
{"actor":{"display_login":"Namoshek"}}