blob: 095601e15a581d768a503924a53c1d75e37928a3 [file] [log] [blame]
Matthias Andreas Benkard832a54e2019-01-29 09:27:38 +01001/*
2Copyright The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17// Code generated by client-gen. DO NOT EDIT.
18
19package v1beta2
20
21import (
22 v1beta2 "k8s.io/api/apps/v1beta2"
23 v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24 types "k8s.io/apimachinery/pkg/types"
25 watch "k8s.io/apimachinery/pkg/watch"
26 scheme "k8s.io/client-go/kubernetes/scheme"
27 rest "k8s.io/client-go/rest"
28)
29
30// StatefulSetsGetter has a method to return a StatefulSetInterface.
31// A group's client should implement this interface.
32type StatefulSetsGetter interface {
33 StatefulSets(namespace string) StatefulSetInterface
34}
35
36// StatefulSetInterface has methods to work with StatefulSet resources.
37type StatefulSetInterface interface {
38 Create(*v1beta2.StatefulSet) (*v1beta2.StatefulSet, error)
39 Update(*v1beta2.StatefulSet) (*v1beta2.StatefulSet, error)
40 UpdateStatus(*v1beta2.StatefulSet) (*v1beta2.StatefulSet, error)
41 Delete(name string, options *v1.DeleteOptions) error
42 DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
43 Get(name string, options v1.GetOptions) (*v1beta2.StatefulSet, error)
44 List(opts v1.ListOptions) (*v1beta2.StatefulSetList, error)
45 Watch(opts v1.ListOptions) (watch.Interface, error)
46 Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.StatefulSet, err error)
47 GetScale(statefulSetName string, options v1.GetOptions) (*v1beta2.Scale, error)
48 UpdateScale(statefulSetName string, scale *v1beta2.Scale) (*v1beta2.Scale, error)
49
50 StatefulSetExpansion
51}
52
53// statefulSets implements StatefulSetInterface
54type statefulSets struct {
55 client rest.Interface
56 ns string
57}
58
59// newStatefulSets returns a StatefulSets
60func newStatefulSets(c *AppsV1beta2Client, namespace string) *statefulSets {
61 return &statefulSets{
62 client: c.RESTClient(),
63 ns: namespace,
64 }
65}
66
67// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any.
68func (c *statefulSets) Get(name string, options v1.GetOptions) (result *v1beta2.StatefulSet, err error) {
69 result = &v1beta2.StatefulSet{}
70 err = c.client.Get().
71 Namespace(c.ns).
72 Resource("statefulsets").
73 Name(name).
74 VersionedParams(&options, scheme.ParameterCodec).
75 Do().
76 Into(result)
77 return
78}
79
80// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
81func (c *statefulSets) List(opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) {
82 result = &v1beta2.StatefulSetList{}
83 err = c.client.Get().
84 Namespace(c.ns).
85 Resource("statefulsets").
86 VersionedParams(&opts, scheme.ParameterCodec).
87 Do().
88 Into(result)
89 return
90}
91
92// Watch returns a watch.Interface that watches the requested statefulSets.
93func (c *statefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
94 opts.Watch = true
95 return c.client.Get().
96 Namespace(c.ns).
97 Resource("statefulsets").
98 VersionedParams(&opts, scheme.ParameterCodec).
99 Watch()
100}
101
102// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any.
103func (c *statefulSets) Create(statefulSet *v1beta2.StatefulSet) (result *v1beta2.StatefulSet, err error) {
104 result = &v1beta2.StatefulSet{}
105 err = c.client.Post().
106 Namespace(c.ns).
107 Resource("statefulsets").
108 Body(statefulSet).
109 Do().
110 Into(result)
111 return
112}
113
114// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any.
115func (c *statefulSets) Update(statefulSet *v1beta2.StatefulSet) (result *v1beta2.StatefulSet, err error) {
116 result = &v1beta2.StatefulSet{}
117 err = c.client.Put().
118 Namespace(c.ns).
119 Resource("statefulsets").
120 Name(statefulSet.Name).
121 Body(statefulSet).
122 Do().
123 Into(result)
124 return
125}
126
127// UpdateStatus was generated because the type contains a Status member.
128// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
129
130func (c *statefulSets) UpdateStatus(statefulSet *v1beta2.StatefulSet) (result *v1beta2.StatefulSet, err error) {
131 result = &v1beta2.StatefulSet{}
132 err = c.client.Put().
133 Namespace(c.ns).
134 Resource("statefulsets").
135 Name(statefulSet.Name).
136 SubResource("status").
137 Body(statefulSet).
138 Do().
139 Into(result)
140 return
141}
142
143// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs.
144func (c *statefulSets) Delete(name string, options *v1.DeleteOptions) error {
145 return c.client.Delete().
146 Namespace(c.ns).
147 Resource("statefulsets").
148 Name(name).
149 Body(options).
150 Do().
151 Error()
152}
153
154// DeleteCollection deletes a collection of objects.
155func (c *statefulSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
156 return c.client.Delete().
157 Namespace(c.ns).
158 Resource("statefulsets").
159 VersionedParams(&listOptions, scheme.ParameterCodec).
160 Body(options).
161 Do().
162 Error()
163}
164
165// Patch applies the patch and returns the patched statefulSet.
166func (c *statefulSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.StatefulSet, err error) {
167 result = &v1beta2.StatefulSet{}
168 err = c.client.Patch(pt).
169 Namespace(c.ns).
170 Resource("statefulsets").
171 SubResource(subresources...).
172 Name(name).
173 Body(data).
174 Do().
175 Into(result)
176 return
177}
178
179// GetScale takes name of the statefulSet, and returns the corresponding v1beta2.Scale object, and an error if there is any.
180func (c *statefulSets) GetScale(statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) {
181 result = &v1beta2.Scale{}
182 err = c.client.Get().
183 Namespace(c.ns).
184 Resource("statefulsets").
185 Name(statefulSetName).
186 SubResource("scale").
187 VersionedParams(&options, scheme.ParameterCodec).
188 Do().
189 Into(result)
190 return
191}
192
193// 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.
194func (c *statefulSets) UpdateScale(statefulSetName string, scale *v1beta2.Scale) (result *v1beta2.Scale, err error) {
195 result = &v1beta2.Scale{}
196 err = c.client.Put().
197 Namespace(c.ns).
198 Resource("statefulsets").
199 Name(statefulSetName).
200 SubResource("scale").
201 Body(scale).
202 Do().
203 Into(result)
204 return
205}