{ "id": "166335", "key": "DAEMON-57", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "12519", "key": "DAEMON", "name": "Appcelerator Daemon" }, "fixVersions": [ { "id": "18407", "description": "", "name": "Appc Daemon 1.0.0", "archived": false, "released": true, "releaseDate": "2017-12-05" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-05-09T19:52:04.000+0000", "created": "2017-02-27T17:05:22.000+0000", "epic": { "id": 154699, "key": "DAEMON-48", "name": "Appcelerator Daemon v1", "summary": "Appcelerator Daemon v1", "color": { "key": "color_9" }, "done": false }, "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [ { "id": "54700", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "outwardIssue": { "id": "167048", "key": "DAEMON-71", "fields": { "summary": "appcd config command implementation", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2017-10-26T03:07:25.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "15601", "name": "appcd-config" }, { "id": "15300", "name": "appcd-config-service" } ], "description": "The config handler currently only returns the config. The handler should also support a \"data\" payload to change the daemon's config at runtime.\r\n\r\nNote that only a single config setting can be changed per call. Use the path to determine what is being changed. HTTP methods can be used to determine how the key should be changed. The handler returns the new value. Use the status code to determine if successful.\r\n\r\nThe appcd CLI is responsible for persisting the settings to the user's config file {{~/.appcelerator/appcd/config.json}}. The daemon does not modify the config file. The appcd CLI will validate the config change, then persist it to disk. After that, it will check if the daemon is running and attempt to change it at runtime. If the daemon is not running or it is running and the setting is changeable during runtime, then everything succeeds. If the daemon is running and the change is rejected, then the CLI will alert the user that the daemon must be restarted for the setting to take effect. If the CLI as a TTY, it can prompt to restart the daemon. Note that the CLI should also support a {{\\-\\-no\\-prompt}} flag and a {{\\-\\-auto\\-restart}} flag.\r\n\r\nh4. Examples:\r\n\r\nh5. Getting a value:\r\n\r\n{code}\r\nappcd exec /appcd/config/analytics/enabled\r\n\r\nappcd exec /appcd/config/analytics/enabled '{ \"action\": \"get\" }'\r\n\r\nappcd exec /appcd/config '{ \"action\": \"get\", \"key\": \"/analytics/enabled\" }'\r\n\r\nappcd exec /appcd/config '{ \"action\": \"get\", \"key\": \"analytics.enabled\" }'\r\n{code}\r\n\r\nh5. Setting a value:\r\n\r\n{code}\r\nappcd exec /appcd/config '{ \"action\": \"set\", \"key\": \"analytics.enabled\", \"value\": true }'\r\n\r\nappcd exec /appcd/config/analytics/enabled '{ \"action\": \"set\", \"value\": true }'\r\n{code}\r\n\r\nh5. Deleting a value:\r\n\r\n{code}\r\nappcd exec /appcd/config '{ \"action\": \"delete\", \"key\": \"analytics.enabled\" }'\r\n\r\nappcd exec /appcd/config/analytics/enabled '{ \"action\": \"delete\" }'\r\n{code}\r\n\r\nh5. Array examples:\r\n\r\n{code}\r\nappcd exec /appcd/config '{ \"action\": \"set\", \"key\": \"foo\", \"value\": [\"bar\", \"baz\"] }'\r\n{code}\r\n\r\nDelete will remove the entire value.\r\n\r\n{code}\r\nappcd exec /appcd/config '{ \"action\": \"delete\", \"key\": \"foo\" }'\r\n{code}", "attachment": [], "flagged": false, "summary": "appcd: Add support to config handler to change settings at runtime", "creator": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "environment": null, "closedSprints": [ { "id": 890, "state": "closed", "name": "2017 Sprint 10 Tooling", "startDate": "2017-05-08T00:27:34.394Z", "endDate": "2017-05-22T00:27:00.000Z", "completeDate": "2017-05-22T02:42:47.719Z", "originBoardId": 199 } ], "comment": { "comments": [ { "id": "419399", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "https://github.com/appcelerator/appc-daemon/pull/11", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2017-05-09T19:51:59.000+0000", "updated": "2017-05-09T19:51:59.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }