{"action":"created","issue":{"url":"https://api.github.com/repos/allegro/ralph/issues/1971","repository_url":"https://api.github.com/repos/allegro/ralph","labels_url":"https://api.github.com/repos/allegro/ralph/issues/1971/labels{/name}","comments_url":"https://api.github.com/repos/allegro/ralph/issues/1971/comments","events_url":"https://api.github.com/repos/allegro/ralph/issues/1971/events","html_url":"https://github.com/allegro/ralph/issues/1971","id":118203484,"number":1971,"title":"REP9: new CLI","user":{"login":"vi4m","id":552398,"avatar_url":"https://avatars.githubusercontent.com/u/552398?v=3","gravatar_id":"","url":"https://api.github.com/users/vi4m","html_url":"https://github.com/vi4m","followers_url":"https://api.github.com/users/vi4m/followers","following_url":"https://api.github.com/users/vi4m/following{/other_user}","gists_url":"https://api.github.com/users/vi4m/gists{/gist_id}","starred_url":"https://api.github.com/users/vi4m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vi4m/subscriptions","organizations_url":"https://api.github.com/users/vi4m/orgs","repos_url":"https://api.github.com/users/vi4m/repos","events_url":"https://api.github.com/users/vi4m/events{/privacy}","received_events_url":"https://api.github.com/users/vi4m/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/allegro/ralph/labels/ng","name":"ng","color":"d4c5f9"},{"url":"https://api.github.com/repos/allegro/ralph/labels/REP","name":"REP","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2015-11-21T15:37:50Z","updated_at":"2016-09-02T14:32:45Z","closed_at":"2016-09-02T14:32:45Z","body":"# Background\r\n\r\nCLI is essential interface for sysadmins. Historically, we created some commands extending the django management interface. But we lose authorization, and security. We don't want this. That's the reason I created ralph beast project which got some more attention from our users. But we should move forward with it.\r\n\r\n# Beast status\r\n\r\nBeast is pretty much complete simple API wrapper with 2 modes CSV and \"rich\" console output for browsing. It has listing and editing ability. But with old API it doesn't spread wings. We should improve it for our users to be compatible with the new Ralph (Django Rest Framework) and change its grammar a bit.\r\n\r\n# What are others doing?\r\n\r\nDocker - https://github.com/docker/docker/blob/master/api/client/cli.go CLI module is integrated into the sources itself. It has explicit grammar defined in sources.\r\n\r\nNova client - bloated as _fuck_ client - because separate source code tries to handle different openstack versions. TODO: investigate more\r\n...\r\n\r\n# What's missing?\r\n\r\n1. It's currently second-class citizen of Ralph. The only maintainer is @vi4m with couple of pull requests from community. IMHO CLI should be the first class citizen of Ralph, taking much more focus. Adding new functionality (for example scanning, deployment, transitions) should be implemented at the level of CL first. And it should be PR requirement. \r\n2. Changing the name\r\nIt's called the same, it IS the same. Therefore i propose to change name from beast to ralph-cli\r\n3. New gramar (see below)\r\nGrammar should be explicit, so when you type `ralph-cli --help` you should get ALL exact options(adding racks, dc-s, updating records and so on). Currently we suffer from fact, that objects are gathered at runtime, so --help doesn't cover all the details.\r\n4. Autocompletion for bash / fish - nice to have :-)\r\n\r\n# Proposed grammar (Todo)\r\n\r\nUsage:\r\nralph-cli [subcommand] [subcommand_options] [--csv] \r\n\r\nWhere subcommands are: \r\n[dcasset,boasset, rack, virtual_asset, cloud_project, switch,  dc, scan, deployment...]\r\n\r\nand subcommands_options depending on the command could be:\r\n[create,update,list]\r\n\r\n# Examples for old and new grammar\r\n\r\nOLD:\r\n\r\nShow all physical servers from Cloud Service\r\n`beast show dev --filter=venture__symbol=cloud --fields=barcode,id,name --csv`\r\n\r\nNEW:\r\n\r\n`ralph-cli physical_asset list --filter=service=cloud --fields=barcode,id,name --csv`\r\n\r\nOLD:\r\nShow all blades\r\n`beast show dev --fields=name,model --filter=model__type=202`\r\nNEW: \r\nralph-cli blade list \r\n\r\nShow all management networks \r\nOLD: \r\nbeast show networks --fields=last_scan,min_ip,max_ip,name,remarks | grep mgmt\r\nNEW:\r\ntodo\r\n\r\nShow all switches\r\nOLD:\r\n`beast show dev --fields=name,model --filter=model__type=203`\r\nNEW:\r\nralph-cli switch list\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/allegro/ralph/issues/comments/244391698","html_url":"https://github.com/allegro/ralph/issues/1971#issuecomment-244391698","issue_url":"https://api.github.com/repos/allegro/ralph/issues/1971","id":244391698,"user":{"login":"vi4m","id":552398,"avatar_url":"https://avatars.githubusercontent.com/u/552398?v=3","gravatar_id":"","url":"https://api.github.com/users/vi4m","html_url":"https://github.com/vi4m","followers_url":"https://api.github.com/users/vi4m/followers","following_url":"https://api.github.com/users/vi4m/following{/other_user}","gists_url":"https://api.github.com/users/vi4m/gists{/gist_id}","starred_url":"https://api.github.com/users/vi4m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vi4m/subscriptions","organizations_url":"https://api.github.com/users/vi4m/orgs","repos_url":"https://api.github.com/users/vi4m/repos","events_url":"https://api.github.com/users/vi4m/events{/privacy}","received_events_url":"https://api.github.com/users/vi4m/received_events","type":"User","site_admin":false},"created_at":"2016-09-02T14:32:45Z","updated_at":"2016-09-02T14:32:45Z","body":"Accepted and implemented: https://github.com/allegro/ralph-cli"}}
{"actor":{"display_login":"vi4m"}}