{"action":"created","issue":{"url":"https://api.github.com/repos/koding/koding/issues/10297","repository_url":"https://api.github.com/repos/koding/koding","labels_url":"https://api.github.com/repos/koding/koding/issues/10297/labels{/name}","comments_url":"https://api.github.com/repos/koding/koding/issues/10297/comments","events_url":"https://api.github.com/repos/koding/koding/issues/10297/events","html_url":"https://github.com/koding/koding/pull/10297","id":200491997,"number":10297,"title":"kd/template: add list / show / delete subcommands","user":{"login":"rjeczalik","id":1162017,"avatar_url":"https://avatars.githubusercontent.com/u/1162017?v=3","gravatar_id":"","url":"https://api.github.com/users/rjeczalik","html_url":"https://github.com/rjeczalik","followers_url":"https://api.github.com/users/rjeczalik/followers","following_url":"https://api.github.com/users/rjeczalik/following{/other_user}","gists_url":"https://api.github.com/users/rjeczalik/gists{/gist_id}","starred_url":"https://api.github.com/users/rjeczalik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjeczalik/subscriptions","organizations_url":"https://api.github.com/users/rjeczalik/orgs","repos_url":"https://api.github.com/users/rjeczalik/repos","events_url":"https://api.github.com/users/rjeczalik/events{/privacy}","received_events_url":"https://api.github.com/users/rjeczalik/received_events","type":"User","site_admin":false},"labels":[{"id":301510826,"url":"https://api.github.com/repos/koding/koding/labels/Waiting%20for%20Review","name":"Waiting for Review","color":"c5def5","default":false}],"state":"open","locked":false,"assignee":{"login":"cihangir","id":879660,"avatar_url":"https://avatars.githubusercontent.com/u/879660?v=3","gravatar_id":"","url":"https://api.github.com/users/cihangir","html_url":"https://github.com/cihangir","followers_url":"https://api.github.com/users/cihangir/followers","following_url":"https://api.github.com/users/cihangir/following{/other_user}","gists_url":"https://api.github.com/users/cihangir/gists{/gist_id}","starred_url":"https://api.github.com/users/cihangir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cihangir/subscriptions","organizations_url":"https://api.github.com/users/cihangir/orgs","repos_url":"https://api.github.com/users/cihangir/repos","events_url":"https://api.github.com/users/cihangir/events{/privacy}","received_events_url":"https://api.github.com/users/cihangir/received_events","type":"User","site_admin":false},"assignees":[{"login":"cihangir","id":879660,"avatar_url":"https://avatars.githubusercontent.com/u/879660?v=3","gravatar_id":"","url":"https://api.github.com/users/cihangir","html_url":"https://github.com/cihangir","followers_url":"https://api.github.com/users/cihangir/followers","following_url":"https://api.github.com/users/cihangir/following{/other_user}","gists_url":"https://api.github.com/users/cihangir/gists{/gist_id}","starred_url":"https://api.github.com/users/cihangir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cihangir/subscriptions","organizations_url":"https://api.github.com/users/cihangir/orgs","repos_url":"https://api.github.com/users/cihangir/repos","events_url":"https://api.github.com/users/cihangir/events{/privacy}","received_events_url":"https://api.github.com/users/cihangir/received_events","type":"User","site_admin":false},{"login":"ppknap","id":5021246,"avatar_url":"https://avatars.githubusercontent.com/u/5021246?v=3","gravatar_id":"","url":"https://api.github.com/users/ppknap","html_url":"https://github.com/ppknap","followers_url":"https://api.github.com/users/ppknap/followers","following_url":"https://api.github.com/users/ppknap/following{/other_user}","gists_url":"https://api.github.com/users/ppknap/gists{/gist_id}","starred_url":"https://api.github.com/users/ppknap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppknap/subscriptions","organizations_url":"https://api.github.com/users/ppknap/orgs","repos_url":"https://api.github.com/users/ppknap/repos","events_url":"https://api.github.com/users/ppknap/events{/privacy}","received_events_url":"https://api.github.com/users/ppknap/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2017-01-12T21:59:50Z","updated_at":"2017-01-13T19:59:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/koding/koding/pulls/10297","html_url":"https://github.com/koding/koding/pull/10297","diff_url":"https://github.com/koding/koding/pull/10297.diff","patch_url":"https://github.com/koding/koding/pull/10297.patch"},"body":"Depends on: https://github.com/koding/koding/pull/10296\r\n\r\nThis PR adds the following commands:\r\n\r\n- kd template list\r\n\r\n```\r\n$ kd template list\r\nID                        TITLE              SLUG               OWNER      TEAM    ACCESS   MACHINES\r\n587777ba112c2d2217cab6aa  Diglett Aws Stack  diglett-aws-stack  rjeczalik  foobar  private  0\r\n```\r\n\r\n- kd template show\r\n\r\n```\r\n$ kd template show -t rjeczalik/diglett-aws-stack\r\nprovider:\r\n  aws:\r\n    access_key: ${var.aws_access_key}\r\n    secret_key: ${var.aws_secret_key}\r\nresource:\r\n  aws_instance:\r\n    aws-instance:\r\n      ami: \"\"\r\n      instance_type: t2.nano\r\n      tags:\r\n        Name: ${var.koding_user_username}-${var.koding_group_slug}\r\n      user_data: |2\r\n\r\n        echo \"hello world!\" >> /helloworld.txt\r\n```\r\n```\r\n$ kd template show -t rjeczalik/diglett-aws-stack -json\r\n{\r\n\t\"provider\": {\r\n\t\t\"aws\": {\r\n\t\t\t\"access_key\": \"${var.aws_access_key}\",\r\n\t\t\t\"secret_key\": \"${var.aws_secret_key}\"\r\n\t\t}\r\n\t},\r\n\t\"resource\": {\r\n\t\t\"aws_instance\": {\r\n\t\t\t\"aws-instance\": {\r\n\t\t\t\t\"ami\": \"\",\r\n\t\t\t\t\"instance_type\": \"t2.nano\",\r\n\t\t\t\t\"tags\": {\r\n\t\t\t\t\t\"Name\": \"${var.koding_user_username}-${var.koding_group_slug}\"\r\n\t\t\t\t},\r\n\t\t\t\t\"user_data\": \"\\necho \\\"hello world!\\\" >> /helloworld.txt\\n\"\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n```\r\n$ kd template show -t rjeczalik/diglett-aws-stack -hcl\r\n\"provider\" \"aws\" {\r\n  \"access_key\" = \"${var.aws_access_key}\"\r\n\r\n  \"secret_key\" = \"${var.aws_secret_key}\"\r\n}\r\n\r\n\"resource\" \"aws_instance\" \"aws-instance\" {\r\n  \"tags\" = {\r\n    \"Name\" = \"${var.koding_user_username}-${var.koding_group_slug}\"\r\n  }\r\n\r\n  \"instance_type\" = \"t2.nano\"\r\n\r\n  \"ami\" = \"\"\r\n\r\n  \"user_data\" = \"\\necho \\\"hello world!\\\" >> /helloworld.txt\\n\"\r\n}\r\n```\r\n\r\n- kd template delete\r\n\r\n```\r\n$ kd template delete -t rjeczalik/diglett-aws-stack\r\nPlease type \"yes\" to confirm you want to delete the resource []: yes\r\nStack template with \"587777ba112c2d2217cab6aa\" ID deleted successfully.\r\n```\r\n```\r\n$ kd template show -t rjeczalik/diglett-aws-stack -json\r\nerror executing \"show\" command: resource was not found\r\n```"},"comment":{"url":"https://api.github.com/repos/koding/koding/issues/comments/272533087","html_url":"https://github.com/koding/koding/pull/10297#issuecomment-272533087","issue_url":"https://api.github.com/repos/koding/koding/issues/10297","id":272533087,"user":{"login":"gokmen","id":42368,"avatar_url":"https://avatars.githubusercontent.com/u/42368?v=3","gravatar_id":"","url":"https://api.github.com/users/gokmen","html_url":"https://github.com/gokmen","followers_url":"https://api.github.com/users/gokmen/followers","following_url":"https://api.github.com/users/gokmen/following{/other_user}","gists_url":"https://api.github.com/users/gokmen/gists{/gist_id}","starred_url":"https://api.github.com/users/gokmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gokmen/subscriptions","organizations_url":"https://api.github.com/users/gokmen/orgs","repos_url":"https://api.github.com/users/gokmen/repos","events_url":"https://api.github.com/users/gokmen/events{/privacy}","received_events_url":"https://api.github.com/users/gokmen/received_events","type":"User","site_admin":false},"created_at":"2017-01-13T19:59:06Z","updated_at":"2017-01-13T19:59:06Z","body":"@rjeczalik I can update current implementation for slugs to use `username` field (which doesn't exists) instead of `originId` for new documents. and in migration script I can add missing `username` fields while setting `slug`s. and then we can remove all `originId` fields once we make the switch. cc/ @cihangir "}}
{"actor":{"display_login":"gokmen"}}