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.
22 v1 "k8s.io/api/core/v1"
23 serializer "k8s.io/apimachinery/pkg/runtime/serializer"
24 "k8s.io/client-go/kubernetes/scheme"
25 rest "k8s.io/client-go/rest"
28 type CoreV1Interface interface {
29 RESTClient() rest.Interface
30 ComponentStatusesGetter
37 PersistentVolumesGetter
38 PersistentVolumeClaimsGetter
41 ReplicationControllersGetter
48 // CoreV1Client is used to interact with features provided by the group.
49 type CoreV1Client struct {
50 restClient rest.Interface
53 func (c *CoreV1Client) ComponentStatuses() ComponentStatusInterface {
54 return newComponentStatuses(c)
57 func (c *CoreV1Client) ConfigMaps(namespace string) ConfigMapInterface {
58 return newConfigMaps(c, namespace)
61 func (c *CoreV1Client) Endpoints(namespace string) EndpointsInterface {
62 return newEndpoints(c, namespace)
65 func (c *CoreV1Client) Events(namespace string) EventInterface {
66 return newEvents(c, namespace)
69 func (c *CoreV1Client) LimitRanges(namespace string) LimitRangeInterface {
70 return newLimitRanges(c, namespace)
73 func (c *CoreV1Client) Namespaces() NamespaceInterface {
74 return newNamespaces(c)
77 func (c *CoreV1Client) Nodes() NodeInterface {
81 func (c *CoreV1Client) PersistentVolumes() PersistentVolumeInterface {
82 return newPersistentVolumes(c)
85 func (c *CoreV1Client) PersistentVolumeClaims(namespace string) PersistentVolumeClaimInterface {
86 return newPersistentVolumeClaims(c, namespace)
89 func (c *CoreV1Client) Pods(namespace string) PodInterface {
90 return newPods(c, namespace)
93 func (c *CoreV1Client) PodTemplates(namespace string) PodTemplateInterface {
94 return newPodTemplates(c, namespace)
97 func (c *CoreV1Client) ReplicationControllers(namespace string) ReplicationControllerInterface {
98 return newReplicationControllers(c, namespace)
101 func (c *CoreV1Client) ResourceQuotas(namespace string) ResourceQuotaInterface {
102 return newResourceQuotas(c, namespace)
105 func (c *CoreV1Client) Secrets(namespace string) SecretInterface {
106 return newSecrets(c, namespace)
109 func (c *CoreV1Client) Services(namespace string) ServiceInterface {
110 return newServices(c, namespace)
113 func (c *CoreV1Client) ServiceAccounts(namespace string) ServiceAccountInterface {
114 return newServiceAccounts(c, namespace)
117 // NewForConfig creates a new CoreV1Client for the given config.
118 func NewForConfig(c *rest.Config) (*CoreV1Client, error) {
120 if err := setConfigDefaults(&config); err != nil {
123 client, err := rest.RESTClientFor(&config)
127 return &CoreV1Client{client}, nil
130 // NewForConfigOrDie creates a new CoreV1Client for the given config and
131 // panics if there is an error in the config.
132 func NewForConfigOrDie(c *rest.Config) *CoreV1Client {
133 client, err := NewForConfig(c)
140 // New creates a new CoreV1Client for the given RESTClient.
141 func New(c rest.Interface) *CoreV1Client {
142 return &CoreV1Client{c}
145 func setConfigDefaults(config *rest.Config) error {
146 gv := v1.SchemeGroupVersion
147 config.GroupVersion = &gv
148 config.APIPath = "/api"
149 config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
151 if config.UserAgent == "" {
152 config.UserAgent = rest.DefaultKubernetesUserAgent()
158 // RESTClient returns a RESTClient that is used to communicate
159 // with API server by this client implementation.
160 func (c *CoreV1Client) RESTClient() rest.Interface {