Skip to content

Commit

Permalink
add jsonpath to kubectl
Browse files Browse the repository at this point in the history
  • Loading branch information
daizuozhuo committed Aug 20, 2015
1 parent 8a43bd6 commit b61a905
Show file tree
Hide file tree
Showing 23 changed files with 249 additions and 143 deletions.
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-annotate.1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ resourcequotas (quota) or secrets.

.PP
\fB\-o\fP, \fB\-\-output\fP=""
Output format. One of: json|yaml|template|templatefile|wide.
Output format. One of: json|yaml|template|templatefile|wide|jsonpath.

.PP
\fB\-\-output\-version\fP=""
Expand All @@ -67,8 +67,8 @@ resourcequotas (quota) or secrets.

.PP
\fB\-t\fP, \fB\-\-template\fP=""
Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]
Template string or path to template file to use when \-o=template, \-o=templatefile or \-o=jsonpath. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. The jsonpath template is composed of jsonpath expressions enclosed by {}


.SH OPTIONS INHERITED FROM PARENT COMMANDS
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-config-view.1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ You can use \-\-output=template \-\-template=TEMPLATE to extract specific values

.PP
\fB\-o\fP, \fB\-\-output\fP=""
Output format. One of: json|yaml|template|templatefile|wide.
Output format. One of: json|yaml|template|templatefile|wide|jsonpath.

.PP
\fB\-\-output\-version\fP=""
Expand All @@ -62,8 +62,8 @@ You can use \-\-output=template \-\-template=TEMPLATE to extract specific values

.PP
\fB\-t\fP, \fB\-\-template\fP=""
Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]
Template string or path to template file to use when \-o=template, \-o=templatefile or \-o=jsonpath. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. The jsonpath template is composed of jsonpath expressions enclosed by {}


.SH OPTIONS INHERITED FROM PARENT COMMANDS
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-expose.1
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ re\-use the labels from the resource it exposes.

.PP
\fB\-o\fP, \fB\-\-output\fP=""
Output format. One of: json|yaml|template|templatefile|wide.
Output format. One of: json|yaml|template|templatefile|wide|jsonpath.

.PP
\fB\-\-output\-version\fP=""
Expand Down Expand Up @@ -104,8 +104,8 @@ re\-use the labels from the resource it exposes.

.PP
\fB\-t\fP, \fB\-\-template\fP=""
Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]
Template string or path to template file to use when \-o=template, \-o=templatefile or \-o=jsonpath. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. The jsonpath template is composed of jsonpath expressions enclosed by {}

.PP
\fB\-\-type\fP=""
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-get.1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ of the \-\-template flag, you can filter the attributes of the fetched resource(

.PP
\fB\-o\fP, \fB\-\-output\fP=""
Output format. One of: json|yaml|template|templatefile|wide.
Output format. One of: json|yaml|template|templatefile|wide|jsonpath.

.PP
\fB\-\-output\-version\fP=""
Expand All @@ -69,8 +69,8 @@ of the \-\-template flag, you can filter the attributes of the fetched resource(

.PP
\fB\-t\fP, \fB\-\-template\fP=""
Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]
Template string or path to template file to use when \-o=template, \-o=templatefile or \-o=jsonpath. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. The jsonpath template is composed of jsonpath expressions enclosed by {}

.PP
\fB\-w\fP, \fB\-\-watch\fP=false
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-label.1
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ If \-\-resource\-version is specified, then updates will use this resource versi

.PP
\fB\-o\fP, \fB\-\-output\fP=""
Output format. One of: json|yaml|template|templatefile|wide.
Output format. One of: json|yaml|template|templatefile|wide|jsonpath.

.PP
\fB\-\-output\-version\fP=""
Expand Down Expand Up @@ -68,8 +68,8 @@ If \-\-resource\-version is specified, then updates will use this resource versi

.PP
\fB\-t\fP, \fB\-\-template\fP=""
Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]
Template string or path to template file to use when \-o=template, \-o=templatefile or \-o=jsonpath. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. The jsonpath template is composed of jsonpath expressions enclosed by {}


.SH OPTIONS INHERITED FROM PARENT COMMANDS
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-rolling-update.1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ existing replication controller and overwrite at least one (common) label in its

.PP
\fB\-o\fP, \fB\-\-output\fP=""
Output format. One of: json|yaml|template|templatefile|wide.
Output format. One of: json|yaml|template|templatefile|wide|jsonpath.

.PP
\fB\-\-output\-version\fP=""
Expand All @@ -72,8 +72,8 @@ existing replication controller and overwrite at least one (common) label in its

.PP
\fB\-t\fP, \fB\-\-template\fP=""
Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]
Template string or path to template file to use when \-o=template, \-o=templatefile or \-o=jsonpath. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. The jsonpath template is composed of jsonpath expressions enclosed by {}

.PP
\fB\-\-timeout\fP=5m0s
Expand Down
6 changes: 3 additions & 3 deletions docs/man/man1/kubectl-run.1
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Creates a replication controller to manage the created container(s).

.PP
\fB\-o\fP, \fB\-\-output\fP=""
Output format. One of: json|yaml|template|templatefile|wide.
Output format. One of: json|yaml|template|templatefile|wide|jsonpath.

.PP
\fB\-\-output\-version\fP=""
Expand Down Expand Up @@ -92,8 +92,8 @@ Creates a replication controller to manage the created container(s).

.PP
\fB\-t\fP, \fB\-\-template\fP=""
Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]
Template string or path to template file to use when \-o=template, \-o=templatefile or \-o=jsonpath. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. The jsonpath template is composed of jsonpath expressions enclosed by {}

.PP
\fB\-\-tty\fP=false
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/kubectl/kubectl_annotate.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ $ kubectl annotate pods foo description-
--all[=false]: select all resources in the namespace of the specified resource types
-h, --help[=false]: help for annotate
--no-headers[=false]: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|template|templatefile|wide.
-o, --output="": Output format. One of: json|yaml|template|templatefile|wide|jsonpath.
--output-version="": Output the formatted object with the given version (default api-version).
--overwrite[=false]: If true, allow annotations to be overwritten, otherwise reject annotation updates that overwrite existing annotations.
--resource-version="": If non-empty, the annotation update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.
-a, --show-all[=false]: When printing, show all resources (default hide terminated pods.)
--sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
-t, --template="": Template string or path to template file to use when -o=template or -o=templatefile. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]
-t, --template="": Template string or path to template file to use when -o=template, -o=templatefile or -o=jsonpath. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. The jsonpath template is composed of jsonpath expressions enclosed by {}
```

### Options inherited from parent commands
Expand Down
10 changes: 7 additions & 3 deletions docs/user-guide/kubectl/kubectl_config_view.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ $ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2
--merge=true: merge together the full hierarchy of kubeconfig files
--minify[=false]: remove all information not used by current-context from the output
--no-headers[=false]: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|template|templatefile|wide.
-o, --output="": Output format. One of: json|yaml|template|templatefile|wide|jsonpath.
--output-version="": Output the formatted object with the given version (default api-version).
--raw[=false]: display raw byte data
-a, --show-all[=false]: When printing, show all resources (default hide terminated pods.)
--sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
-t, --template="": Template string or path to template file to use when -o=template or -o=templatefile. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]
-t, --template="": Template string or path to template file to use when -o=template, -o=templatefile or -o=jsonpath. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. The jsonpath template is composed of jsonpath expressions enclosed by {}
```

### Options inherited from parent commands
Expand Down Expand Up @@ -105,7 +105,11 @@ $ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2

* [kubectl config](kubectl_config.md) - config modifies kubeconfig files

###### Auto generated by spf13/cobra at 2015-08-18 17:36:23.977277472 +0000 UTC
<<<<<<< HEAD
###### Auto generated by spf13/cobra at 2015-08-12 23:41:01.310054033 +0000 UTC
=======
###### Auto generated by spf13/cobra at 2015-08-11 10:20:05.920471764 +0000 UTC
>>>>>>> add jsonpath to kubectl
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_view.md?pixel)]()
Expand Down
10 changes: 7 additions & 3 deletions docs/user-guide/kubectl/kubectl_expose.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
-l, --labels="": Labels to apply to the service created by this call.
--name="": The name for the newly created object.
--no-headers[=false]: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|template|templatefile|wide.
-o, --output="": Output format. One of: json|yaml|template|templatefile|wide|jsonpath.
--output-version="": Output the formatted object with the given version (default api-version).
--overrides="": An inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field.
--port=-1: The port that the service should serve on. Copied from the resource being exposed, if unspecified
Expand All @@ -87,7 +87,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
-a, --show-all[=false]: When printing, show all resources (default hide terminated pods.)
--sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
--target-port="": Name or number for the port on the container that the service should direct traffic to. Optional.
-t, --template="": Template string or path to template file to use when -o=template or -o=templatefile. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]
-t, --template="": Template string or path to template file to use when -o=template, -o=templatefile or -o=jsonpath. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. The jsonpath template is composed of jsonpath expressions enclosed by {}
--type="": Type for this service: ClusterIP, NodePort, or LoadBalancer. Default is 'ClusterIP' unless --create-external-load-balancer is specified.
```

Expand Down Expand Up @@ -124,7 +124,11 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream

* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager

###### Auto generated by spf13/cobra at 2015-08-18 17:36:23.976918949 +0000 UTC
<<<<<<< HEAD
###### Auto generated by spf13/cobra at 2015-08-12 23:41:01.308576759 +0000 UTC
=======
###### Auto generated by spf13/cobra at 2015-08-11 10:20:05.919806434 +0000 UTC
>>>>>>> add jsonpath to kubectl
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_expose.md?pixel)]()
Expand Down
25 changes: 24 additions & 1 deletion docs/user-guide/kubectl/kubectl_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ By specifying the output as 'template' and providing a Go template as the value
of the --template flag, you can filter the attributes of the fetched resource(s).

```
<<<<<<< HEAD
kubectl get [(-o|--output=)json|yaml|template|wide|...] (TYPE [(NAME | -l label] | TYPE/NAME ...) [flags]
=======
kubectl get [(-o|--output=)json|yaml|template|templatefile|wide|jsonpath|...] (TYPE [NAME | -l label] | TYPE/NAME ...)
>>>>>>> add jsonpath to kubectl
```

### Examples
Expand Down Expand Up @@ -88,12 +92,19 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7
-h, --help[=false]: help for get
-L, --label-columns=[]: Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag statements like -L label1 -L label2...
--no-headers[=false]: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|template|templatefile|wide.
-o, --output="": Output format. One of: json|yaml|template|templatefile|wide|jsonpath.
--output-version="": Output the formatted object with the given version (default api-version).
-l, --selector="": Selector (label query) to filter on
<<<<<<< HEAD
-a, --show-all[=false]: When printing, show all resources (default hide terminated pods.)
=======
<<<<<<< HEAD
>>>>>>> add jsonpath to kubectl
--sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
-t, --template="": Template string or path to template file to use when -o=template or -o=templatefile. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]
=======
-t, --template="": Template string or path to template file to use when -o=template, -o=templatefile or -o=jsonpath. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. The jsonpath template is composed of jsonpath expressions enclosed by {}
>>>>>>> add jsonpath to kubectl
-w, --watch[=false]: After listing/getting the requested object, watch for changes.
--watch-only[=false]: Watch for changes to the requested object(s), without listing/getting first.
```
Expand Down Expand Up @@ -131,7 +142,19 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7

* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager

<<<<<<< HEAD
###### Auto generated by spf13/cobra at 2015-08-18 17:36:23.974605429 +0000 UTC
=======
<<<<<<< HEAD
###### Auto generated by spf13/cobra at 2015-08-13 06:12:05.386038784 +0000 UTC
=======
<<<<<<< HEAD
###### Auto generated by spf13/cobra at 2015-08-12 23:41:01.301023165 +0000 UTC
=======
###### Auto generated by spf13/cobra at 2015-08-11 10:20:05.915175811 +0000 UTC
>>>>>>> add jsonpath to kubectl
>>>>>>> add jsonpath to kubectl
>>>>>>> add jsonpath to kubectl
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_get.md?pixel)]()
Expand Down
14 changes: 11 additions & 3 deletions docs/user-guide/kubectl/kubectl_label.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ $ kubectl label pods foo bar-
-f, --filename=[]: Filename, directory, or URL to a file identifying the resource to update the labels
-h, --help[=false]: help for label
--no-headers[=false]: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|template|templatefile|wide.
-o, --output="": Output format. One of: json|yaml|template|templatefile|wide|jsonpath.
--output-version="": Output the formatted object with the given version (default api-version).
--overwrite[=false]: If true, allow labels to be overwritten, otherwise reject label updates that overwrite existing labels.
--resource-version="": If non-empty, the labels update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource.
-l, --selector="": Selector (label query) to filter on
-a, --show-all[=false]: When printing, show all resources (default hide terminated pods.)
--sort-by="": If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
-t, --template="": Template string or path to template file to use when -o=template or -o=templatefile. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]
-t, --template="": Template string or path to template file to use when -o=template, -o=templatefile or -o=jsonpath. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. The jsonpath template is composed of jsonpath expressions enclosed by {}
```

### Options inherited from parent commands
Expand Down Expand Up @@ -121,7 +121,15 @@ $ kubectl label pods foo bar-

* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager

###### Auto generated by spf13/cobra at 2015-08-18 17:36:23.977042997 +0000 UTC
<<<<<<< HEAD
###### Auto generated by spf13/cobra at 2015-08-13 02:21:16.349210188 +0000 UTC
=======
<<<<<<< HEAD
###### Auto generated by spf13/cobra at 2015-08-12 23:41:01.309176995 +0000 UTC
=======
###### Auto generated by spf13/cobra at 2015-08-11 10:20:05.920043611 +0000 UTC
>>>>>>> add jsonpath to kubectl
>>>>>>> add jsonpath to kubectl
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_label.md?pixel)]()
Expand Down
Loading

0 comments on commit b61a905

Please sign in to comment.