1 // Copyright 2018 The prometheus-operator Authors
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 // Code generated by client-gen. DO NOT EDIT.
20 v1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1"
21 "github.com/coreos/prometheus-operator/pkg/client/versioned/scheme"
22 serializer "k8s.io/apimachinery/pkg/runtime/serializer"
23 rest "k8s.io/client-go/rest"
26 type MonitoringV1Interface interface {
27 RESTClient() rest.Interface
34 // MonitoringV1Client is used to interact with features provided by the monitoring.coreos.com group.
35 type MonitoringV1Client struct {
36 restClient rest.Interface
39 func (c *MonitoringV1Client) Alertmanagers(namespace string) AlertmanagerInterface {
40 return newAlertmanagers(c, namespace)
43 func (c *MonitoringV1Client) Prometheuses(namespace string) PrometheusInterface {
44 return newPrometheuses(c, namespace)
47 func (c *MonitoringV1Client) PrometheusRules(namespace string) PrometheusRuleInterface {
48 return newPrometheusRules(c, namespace)
51 func (c *MonitoringV1Client) ServiceMonitors(namespace string) ServiceMonitorInterface {
52 return newServiceMonitors(c, namespace)
55 // NewForConfig creates a new MonitoringV1Client for the given config.
56 func NewForConfig(c *rest.Config) (*MonitoringV1Client, error) {
58 if err := setConfigDefaults(&config); err != nil {
61 client, err := rest.RESTClientFor(&config)
65 return &MonitoringV1Client{client}, nil
68 // NewForConfigOrDie creates a new MonitoringV1Client for the given config and
69 // panics if there is an error in the config.
70 func NewForConfigOrDie(c *rest.Config) *MonitoringV1Client {
71 client, err := NewForConfig(c)
78 // New creates a new MonitoringV1Client for the given RESTClient.
79 func New(c rest.Interface) *MonitoringV1Client {
80 return &MonitoringV1Client{c}
83 func setConfigDefaults(config *rest.Config) error {
84 gv := v1.SchemeGroupVersion
85 config.GroupVersion = &gv
86 config.APIPath = "/apis"
87 config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
89 if config.UserAgent == "" {
90 config.UserAgent = rest.DefaultKubernetesUserAgent()
96 // RESTClient returns a RESTClient that is used to communicate
97 // with API server by this client implementation.
98 func (c *MonitoringV1Client) RESTClient() rest.Interface {