From 6dba6aa178c404f611fbf9ae7c9b598c24cdbd5f Mon Sep 17 00:00:00 2001 From: Cesar Wong Date: Mon, 6 Apr 2015 12:38:55 -0400 Subject: [PATCH] Add PodLogOptions versioned resource PodLogOptions will capture options passed in to retrieve a pod's log. --- pkg/api/register.go | 2 ++ pkg/api/types.go | 11 +++++++++++ pkg/api/v1beta1/register.go | 2 ++ pkg/api/v1beta1/types.go | 11 +++++++++++ pkg/api/v1beta2/register.go | 2 ++ pkg/api/v1beta2/types.go | 11 +++++++++++ pkg/api/v1beta3/register.go | 2 ++ pkg/api/v1beta3/types.go | 11 +++++++++++ 8 files changed, 52 insertions(+) diff --git a/pkg/api/register.go b/pkg/api/register.go index 64d9ee529e0..067ee837f20 100644 --- a/pkg/api/register.go +++ b/pkg/api/register.go @@ -58,6 +58,7 @@ func init() { &PersistentVolumeClaimList{}, &DeleteOptions{}, &ListOptions{}, + &PodLogOptions{}, ) // Legacy names are supported Scheme.AddKnownTypeWithName("", "Minion", &Node{}) @@ -97,3 +98,4 @@ func (*PersistentVolumeClaim) IsAnAPIObject() {} func (*PersistentVolumeClaimList) IsAnAPIObject() {} func (*DeleteOptions) IsAnAPIObject() {} func (*ListOptions) IsAnAPIObject() {} +func (*PodLogOptions) IsAnAPIObject() {} diff --git a/pkg/api/types.go b/pkg/api/types.go index c2b603ec247..6202b83a6e9 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -1249,6 +1249,17 @@ type ListOptions struct { ResourceVersion string } +// PodLogOptions is the query options for a Pod's logs REST call +type PodLogOptions struct { + TypeMeta + + // Container for which to return logs + Container string + + // If true, follow the logs for the pod + Follow bool +} + // Status is a return value for calls that don't return other objects. // TODO: this could go in apiserver, but I'm including it here so clients needn't // import both. diff --git a/pkg/api/v1beta1/register.go b/pkg/api/v1beta1/register.go index a0b9fb38876..42d8be4dca3 100644 --- a/pkg/api/v1beta1/register.go +++ b/pkg/api/v1beta1/register.go @@ -65,6 +65,7 @@ func init() { &PersistentVolumeClaimList{}, &DeleteOptions{}, &ListOptions{}, + &PodLogOptions{}, ) // Future names are supported api.Scheme.AddKnownTypeWithName("v1beta1", "Node", &Minion{}) @@ -104,3 +105,4 @@ func (*PersistentVolumeClaim) IsAnAPIObject() {} func (*PersistentVolumeClaimList) IsAnAPIObject() {} func (*DeleteOptions) IsAnAPIObject() {} func (*ListOptions) IsAnAPIObject() {} +func (*PodLogOptions) IsAnAPIObject() {} diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index e6d4fd33174..ed7d8559d18 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -1104,6 +1104,17 @@ type ListOptions struct { ResourceVersion string `json:"resourceVersion" description:"when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history"` } +// PodLogOptions is the query options for a Pod's logs REST call +type PodLogOptions struct { + TypeMeta `json:",inline"` + + // Container for which to return logs + Container string `json:"container,omitempty" description:"the container for which to stream logs; defaults to only container if there is one container in the pod"` + + // If true, follow the logs for the pod + Follow bool `json:"follow,omitempty" description:"follow the log stream of the pod; defaults to false"` +} + // Status is a return value for calls that don't return other objects. // TODO: this could go in apiserver, but I'm including it here so clients needn't // import both. diff --git a/pkg/api/v1beta2/register.go b/pkg/api/v1beta2/register.go index ad69988caff..ccd8f064772 100644 --- a/pkg/api/v1beta2/register.go +++ b/pkg/api/v1beta2/register.go @@ -65,6 +65,7 @@ func init() { &PersistentVolumeClaimList{}, &DeleteOptions{}, &ListOptions{}, + &PodLogOptions{}, ) // Future names are supported api.Scheme.AddKnownTypeWithName("v1beta2", "Node", &Minion{}) @@ -104,3 +105,4 @@ func (*PersistentVolumeClaim) IsAnAPIObject() {} func (*PersistentVolumeClaimList) IsAnAPIObject() {} func (*DeleteOptions) IsAnAPIObject() {} func (*ListOptions) IsAnAPIObject() {} +func (*PodLogOptions) IsAnAPIObject() {} diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index 1cb0522e750..8a9be79b454 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -1118,6 +1118,17 @@ type ListOptions struct { ResourceVersion string `json:"resourceVersion" description:"when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history"` } +// PodLogOptions is the query options for a Pod's logs REST call +type PodLogOptions struct { + TypeMeta `json:",inline"` + + // Container for which to return logs + Container string `json:"container,omitempty" description:"the container for which to stream logs; defaults to only container if there is one container in the pod"` + + // If true, follow the logs for the pod + Follow bool `json:"follow,omitempty" description:"follow the log stream of the pod; defaults to false"` +} + // Status is a return value for calls that don't return other objects. // TODO: this could go in apiserver, but I'm including it here so clients needn't // import both. diff --git a/pkg/api/v1beta3/register.go b/pkg/api/v1beta3/register.go index 0d9c7a7a994..9622b4d983a 100644 --- a/pkg/api/v1beta3/register.go +++ b/pkg/api/v1beta3/register.go @@ -59,6 +59,7 @@ func init() { &PersistentVolumeClaimList{}, &DeleteOptions{}, &ListOptions{}, + &PodLogOptions{}, ) // Legacy names are supported api.Scheme.AddKnownTypeWithName("v1beta3", "Minion", &Node{}) @@ -98,3 +99,4 @@ func (*PersistentVolumeClaim) IsAnAPIObject() {} func (*PersistentVolumeClaimList) IsAnAPIObject() {} func (*DeleteOptions) IsAnAPIObject() {} func (*ListOptions) IsAnAPIObject() {} +func (*PodLogOptions) IsAnAPIObject() {} diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index 23070a36477..904f54b9335 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -1236,6 +1236,17 @@ type ListOptions struct { ResourceVersion string `json:"resourceVersion" description:"when specified with a watch call, shows changes that occur after that particular version of a resource; defaults to changes from the beginning of history"` } +// PodLogOptions is the query options for a Pod's logs REST call +type PodLogOptions struct { + TypeMeta `json:",inline"` + + // Container for which to return logs + Container string `json:"container,omitempty" description:"the container for which to stream logs; defaults to only container if there is one container in the pod"` + + // If true, follow the logs for the pod + Follow bool `json:"follow,omitempty" description:"follow the log stream of the pod; defaults to false"` +} + // Status is a return value for calls that don't return other objects. type Status struct { TypeMeta `json:",inline"`