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 v1beta1 "k8s.io/api/extensions/v1beta1"
25 v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
26 types "k8s.io/apimachinery/pkg/types"
27 watch "k8s.io/apimachinery/pkg/watch"
28 scheme "k8s.io/client-go/kubernetes/scheme"
29 rest "k8s.io/client-go/rest"
32 // ReplicaSetsGetter has a method to return a ReplicaSetInterface.
33 // A group's client should implement this interface.
34 type ReplicaSetsGetter interface {
35 ReplicaSets(namespace string) ReplicaSetInterface
38 // ReplicaSetInterface has methods to work with ReplicaSet resources.
39 type ReplicaSetInterface interface {
40 Create(*v1beta1.ReplicaSet) (*v1beta1.ReplicaSet, error)
41 Update(*v1beta1.ReplicaSet) (*v1beta1.ReplicaSet, error)
42 UpdateStatus(*v1beta1.ReplicaSet) (*v1beta1.ReplicaSet, error)
43 Delete(name string, options *v1.DeleteOptions) error
44 DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
45 Get(name string, options v1.GetOptions) (*v1beta1.ReplicaSet, error)
46 List(opts v1.ListOptions) (*v1beta1.ReplicaSetList, error)
47 Watch(opts v1.ListOptions) (watch.Interface, error)
48 Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error)
49 GetScale(replicaSetName string, options v1.GetOptions) (*v1beta1.Scale, error)
50 UpdateScale(replicaSetName string, scale *v1beta1.Scale) (*v1beta1.Scale, error)
55 // replicaSets implements ReplicaSetInterface
56 type replicaSets struct {
61 // newReplicaSets returns a ReplicaSets
62 func newReplicaSets(c *ExtensionsV1beta1Client, namespace string) *replicaSets {
64 client: c.RESTClient(),
69 // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any.
70 func (c *replicaSets) Get(name string, options v1.GetOptions) (result *v1beta1.ReplicaSet, err error) {
71 result = &v1beta1.ReplicaSet{}
74 Resource("replicasets").
76 VersionedParams(&options, scheme.ParameterCodec).
82 // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
83 func (c *replicaSets) List(opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) {
84 var timeout time.Duration
85 if opts.TimeoutSeconds != nil {
86 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
88 result = &v1beta1.ReplicaSetList{}
91 Resource("replicasets").
92 VersionedParams(&opts, scheme.ParameterCodec).
99 // Watch returns a watch.Interface that watches the requested replicaSets.
100 func (c *replicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
101 var timeout time.Duration
102 if opts.TimeoutSeconds != nil {
103 timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
106 return c.client.Get().
108 Resource("replicasets").
109 VersionedParams(&opts, scheme.ParameterCodec).
114 // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any.
115 func (c *replicaSets) Create(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) {
116 result = &v1beta1.ReplicaSet{}
117 err = c.client.Post().
119 Resource("replicasets").
126 // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any.
127 func (c *replicaSets) Update(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) {
128 result = &v1beta1.ReplicaSet{}
129 err = c.client.Put().
131 Resource("replicasets").
132 Name(replicaSet.Name).
139 // UpdateStatus was generated because the type contains a Status member.
140 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
142 func (c *replicaSets) UpdateStatus(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) {
143 result = &v1beta1.ReplicaSet{}
144 err = c.client.Put().
146 Resource("replicasets").
147 Name(replicaSet.Name).
148 SubResource("status").
155 // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs.
156 func (c *replicaSets) Delete(name string, options *v1.DeleteOptions) error {
157 return c.client.Delete().
159 Resource("replicasets").
166 // DeleteCollection deletes a collection of objects.
167 func (c *replicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
168 var timeout time.Duration
169 if listOptions.TimeoutSeconds != nil {
170 timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
172 return c.client.Delete().
174 Resource("replicasets").
175 VersionedParams(&listOptions, scheme.ParameterCodec).
182 // Patch applies the patch and returns the patched replicaSet.
183 func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) {
184 result = &v1beta1.ReplicaSet{}
185 err = c.client.Patch(pt).
187 Resource("replicasets").
188 SubResource(subresources...).
196 // GetScale takes name of the replicaSet, and returns the corresponding v1beta1.Scale object, and an error if there is any.
197 func (c *replicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) {
198 result = &v1beta1.Scale{}
199 err = c.client.Get().
201 Resource("replicasets").
202 Name(replicaSetName).
203 SubResource("scale").
204 VersionedParams(&options, scheme.ParameterCodec).
210 // 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.
211 func (c *replicaSets) UpdateScale(replicaSetName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) {
212 result = &v1beta1.Scale{}
213 err = c.client.Put().
215 Resource("replicasets").
216 Name(replicaSetName).
217 SubResource("scale").