{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/12677","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/12677/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/12677/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/12677/events","html_url":"https://github.com/kubernetes/kubernetes/pull/12677","id":100840333,"number":12677,"title":"WIP: A new command to read types' description from Swagger","user":{"login":"andronat","id":793408,"avatar_url":"https://avatars.githubusercontent.com/u/793408?v=3","gravatar_id":"","url":"https://api.github.com/users/andronat","html_url":"https://github.com/andronat","followers_url":"https://api.github.com/users/andronat/followers","following_url":"https://api.github.com/users/andronat/following{/other_user}","gists_url":"https://api.github.com/users/andronat/gists{/gist_id}","starred_url":"https://api.github.com/users/andronat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andronat/subscriptions","organizations_url":"https://api.github.com/users/andronat/orgs","repos_url":"https://api.github.com/users/andronat/repos","events_url":"https://api.github.com/users/andronat/events{/privacy}","received_events_url":"https://api.github.com/users/andronat/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cla:%20yes","name":"cla: yes","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-13T18:44:26Z","updated_at":"2015-08-18T16:43:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/12677","html_url":"https://github.com/kubernetes/kubernetes/pull/12677","diff_url":"https://github.com/kubernetes/kubernetes/pull/12677.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/12677.patch"},"body":"This is a simple kubectl tool that parses the swagger schema and returns useful information for the various models/types we have.\r\n\r\nHere you can see an example output:\r\n```\r\n# kubectl doc Pod\r\nMODEL: Pod\r\n\r\n\r\n\r\nFIELD DESCRIPTIONS\r\n-> status\t[PodStatus]\r\n\tmost recently observed status of the pod; populated by the system, read-only; http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status\r\n-> apiVersion\t[string]\r\n\tversion of the schema the object should have; see http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources\r\n-> kind\t[string]\r\n\tkind of object, in CamelCase; cannot be updated; see http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds\r\n-> metadata\t[ObjectMeta]\r\n\tstandard object metadata; see http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata\r\n-> spec\t[PodSpec]\r\n\tspecification of the desired behavior of the pod; http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#spec-and-status\r\n\r\n```\r\n\r\nand has this interface:\r\n```\r\n# kubectl help doc\r\nPrint model's documentation through swagger's API.\r\n\r\nUsage:\r\n  kubectl doc MODEL-NAME... [flags]\r\n\r\nFlags:\r\n      --api-version=\"\": The Kubernetes' API version we want to query\r\n  -h, --help=false: help for doc\r\n  -S, --search=false: Search for similar models to given MODEL-NAMEs\r\n```\r\n\r\nWe also support searching through the `-S` flag like this:\r\n```\r\n#kubectl doc -S Pod Spec\r\nPodSpec\r\nPodList\r\nPod\r\nPodCondition\r\nPodStatus\r\nPodTemplateList\r\nPodTemplateSpec\r\nPodTemplate\r\n\r\nPersistentVolumeClaimSpec\r\nLimitRangeSpec\r\nPodTemplateSpec\r\nNodeSpec\r\nReplicationControllerSpec\r\nServiceSpec\r\nPersistentVolumeSpec\r\nPodSpec\r\nResourceQuotaSpec\r\nNamespaceSpec\r\n```\r\n\r\nAn other feature we have is a \"dot\" notation on `Model.attribute.attribute` for further exploration of the API:\r\n```\r\n#kubectl doc Pod.status.conditions\r\nMODEL: PodCondition\r\n\r\n\r\n\r\nFIELD DESCRIPTIONS\r\n-> status\t<string>\r\n\tstatus of the condition, one of True, False, Unknown; see http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#pod-conditions\r\n-> type\t<string>\r\n\tkind of the condition, currently only Ready; see http://releases.k8s.io/HEAD/docs/user-guide/pod-states.md#pod-conditions\r\n```\r\n\r\n### IMPORTANT NOTE\r\nUntil #10933 is finished, the big gap under the MODEL title exists due to the absence of struct description.\r\n\r\n/cc @ghodss "},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/132271282","html_url":"https://github.com/kubernetes/kubernetes/pull/12677#issuecomment-132271282","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/12677","id":132271282,"user":{"login":"andronat","id":793408,"avatar_url":"https://avatars.githubusercontent.com/u/793408?v=3","gravatar_id":"","url":"https://api.github.com/users/andronat","html_url":"https://github.com/andronat","followers_url":"https://api.github.com/users/andronat/followers","following_url":"https://api.github.com/users/andronat/following{/other_user}","gists_url":"https://api.github.com/users/andronat/gists{/gist_id}","starred_url":"https://api.github.com/users/andronat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andronat/subscriptions","organizations_url":"https://api.github.com/users/andronat/orgs","repos_url":"https://api.github.com/users/andronat/repos","events_url":"https://api.github.com/users/andronat/events{/privacy}","received_events_url":"https://api.github.com/users/andronat/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T16:43:45Z","updated_at":"2015-08-18T16:43:45Z","body":"Lots of changes. Added a dot notation feature for better exploration. Thanks @ghodss for the nice ideas and suggestions :)"}}