2 Copyright The Kubernetes Authors.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
17 // Code generated by client-gen. DO NOT EDIT.
24 autoscalingv1 "k8s.io/api/autoscaling/v1"
25 v1 "k8s.io/api/core/v1"
26 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
27 types "k8s.io/apimachinery/pkg/types"
28 watch "k8s.io/apimachinery/pkg/watch"
29 scheme "k8s.io/client-go/kubernetes/scheme"
30 rest "k8s.io/client-go/rest"
33 // ReplicationControllersGetter has a method to return a ReplicationControllerInterface.
34 // A group's client should implement this interface.
35 type ReplicationControllersGetter interface {
36 ReplicationControllers(namespace string) ReplicationControllerInterface
39 // ReplicationControllerInterface has methods to work with ReplicationController resources.
40 type ReplicationControllerInterface interface {
41 Create(*v1.ReplicationController) (*v1.ReplicationController, error)
42 Update(*v1.ReplicationController) (*v1.ReplicationController, error)
43 UpdateStatus(*v1.ReplicationController) (*v1.ReplicationController, error)
44 Delete(name string, options *metav1.DeleteOptions) error
45 DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
46 Get(name string, options metav1.GetOptions) (*v1.ReplicationController, error)
47 List(opts metav1.ListOptions) (*v1.ReplicationControllerList, error)
48 Watch(opts metav1.ListOptions) (watch.Interface, error)
49 Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error)
50 GetScale(replicationControllerName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)
51 UpdateScale(replicationControllerName string, scale *autoscalingv1.Scale) (*autoscalingv1.Scale, error)
53 ReplicationControllerExpansion
56 // replicationControllers implements ReplicationControllerInterface
57 type replicationControllers struct {
62 // newReplicationControllers returns a ReplicationControllers
63 func newReplicationControllers(c *CoreV1Client, namespace string) *replicationControllers {
64 return &replicationControllers{
65 client: c.RESTClient(),
70 // Get takes name of the replicationController, and returns the corresponding replicationController object, and an error if there is any.
71 func (c *replicationControllers) Get(name string, options metav1.GetOptions) (result *v1.ReplicationController, err error) {
72 result = &v1.ReplicationController{}
75 Resource("replicationcontrollers").
77 VersionedParams(&options, scheme.ParameterCodec).
83 // List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors.
84 func (c *replicationControllers) List(opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) {
85 var timeout time.Duration
86 if opts.TimeoutSeconds != nil {
87 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
89 result = &v1.ReplicationControllerList{}
92 Resource("replicationcontrollers").
93 VersionedParams(&opts, scheme.ParameterCodec).
100 // Watch returns a watch.Interface that watches the requested replicationControllers.
101 func (c *replicationControllers) Watch(opts metav1.ListOptions) (watch.Interface, error) {
102 var timeout time.Duration
103 if opts.TimeoutSeconds != nil {
104 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
107 return c.client.Get().
109 Resource("replicationcontrollers").
110 VersionedParams(&opts, scheme.ParameterCodec).
115 // Create takes the representation of a replicationController and creates it. Returns the server's representation of the replicationController, and an error, if there is any.
116 func (c *replicationControllers) Create(replicationController *v1.ReplicationController) (result *v1.ReplicationController, err error) {
117 result = &v1.ReplicationController{}
118 err = c.client.Post().
120 Resource("replicationcontrollers").
121 Body(replicationController).
127 // Update takes the representation of a replicationController and updates it. Returns the server's representation of the replicationController, and an error, if there is any.
128 func (c *replicationControllers) Update(replicationController *v1.ReplicationController) (result *v1.ReplicationController, err error) {
129 result = &v1.ReplicationController{}
130 err = c.client.Put().
132 Resource("replicationcontrollers").
133 Name(replicationController.Name).
134 Body(replicationController).
140 // UpdateStatus was generated because the type contains a Status member.
141 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
143 func (c *replicationControllers) UpdateStatus(replicationController *v1.ReplicationController) (result *v1.ReplicationController, err error) {
144 result = &v1.ReplicationController{}
145 err = c.client.Put().
147 Resource("replicationcontrollers").
148 Name(replicationController.Name).
149 SubResource("status").
150 Body(replicationController).
156 // Delete takes name of the replicationController and deletes it. Returns an error if one occurs.
157 func (c *replicationControllers) Delete(name string, options *metav1.DeleteOptions) error {
158 return c.client.Delete().
160 Resource("replicationcontrollers").
167 // DeleteCollection deletes a collection of objects.
168 func (c *replicationControllers) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
169 var timeout time.Duration
170 if listOptions.TimeoutSeconds != nil {
171 timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
173 return c.client.Delete().
175 Resource("replicationcontrollers").
176 VersionedParams(&listOptions, scheme.ParameterCodec).
183 // Patch applies the patch and returns the patched replicationController.
184 func (c *replicationControllers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error) {
185 result = &v1.ReplicationController{}
186 err = c.client.Patch(pt).
188 Resource("replicationcontrollers").
189 SubResource(subresources...).
197 // GetScale takes name of the replicationController, and returns the corresponding autoscalingv1.Scale object, and an error if there is any.
198 func (c *replicationControllers) GetScale(replicationControllerName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
199 result = &autoscalingv1.Scale{}
200 err = c.client.Get().
202 Resource("replicationcontrollers").
203 Name(replicationControllerName).
204 SubResource("scale").
205 VersionedParams(&options, scheme.ParameterCodec).
211 // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
212 func (c *replicationControllers) UpdateScale(replicationControllerName string, scale *autoscalingv1.Scale) (result *autoscalingv1.Scale, err error) {
213 result = &autoscalingv1.Scale{}
214 err = c.client.Put().
216 Resource("replicationcontrollers").
217 Name(replicationControllerName).
218 SubResource("scale").