/
client.go
168 lines (147 loc) · 9.92 KB
/
client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
package client
//go:generate mockgen -source $GOFILE -package=$GOPACKAGE -destination=generated_mock_$GOFILE
/*
ATTENTION: Rerun code generators when interface signatures are modified.
*/
import (
"context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
generatedclient "kubevirt.io/application-aware-quota/pkg/generated/aaq/clientset/versioned"
aaqv1alpha1 "kubevirt.io/application-aware-quota/pkg/generated/aaq/clientset/versioned/typed/core/v1alpha1"
crqclient "kubevirt.io/application-aware-quota/pkg/generated/cluster-resource-quota/clientset/versioned"
kubevirtclient "kubevirt.io/application-aware-quota/pkg/generated/kubevirt/clientset/versioned"
"kubevirt.io/application-aware-quota/staging/src/kubevirt.io/application-aware-quota-api/pkg/apis/core/v1alpha1"
)
type AAQClient interface {
RestClient() *rest.RESTClient
kubernetes.Interface
ApplicationAwareResourceQuotas(namespace string) ApplicationAwareResourceQuotaInterface
ApplicationAwareClusterResourceQuotas() ApplicationAwareClusterResourceQuotaInterface
ApplicationAwareAppliedClusterResourceQuotas(namespace string) ApplicationAwareAppliedClusterResourceQuotaInterface
AAQJobQueueConfigs(namespace string) AAQJobQueueConfigInterface
AAQ() AAQInterface
GeneratedAAQClient() generatedclient.Interface
CRQClient() crqclient.Interface
KubevirtClient() kubevirtclient.Interface
DiscoveryClient() discovery.DiscoveryInterface
Config() *rest.Config
}
type aaq struct {
master string
kubeconfig string
restClient *rest.RESTClient
config *rest.Config
generatedAAQClient *generatedclient.Clientset
kubevirtClient *kubevirtclient.Clientset
crqClient *crqclient.Clientset
discoveryClient *discovery.DiscoveryClient
dynamicClient dynamic.Interface
*kubernetes.Clientset
}
func (k aaq) CRQClient() crqclient.Interface {
return k.crqClient
}
func (k aaq) KubevirtClient() kubevirtclient.Interface {
return k.kubevirtClient
}
func (k aaq) Config() *rest.Config {
return k.config
}
func (k aaq) RestClient() *rest.RESTClient {
return k.restClient
}
func (k aaq) GeneratedAAQClient() generatedclient.Interface {
return k.generatedAAQClient
}
func (k aaq) ApplicationAwareResourceQuotas(namespace string) ApplicationAwareResourceQuotaInterface {
return k.generatedAAQClient.AaqV1alpha1().ApplicationAwareResourceQuotas(namespace)
}
func (k aaq) ApplicationAwareClusterResourceQuotas() ApplicationAwareClusterResourceQuotaInterface {
return k.generatedAAQClient.AaqV1alpha1().ApplicationAwareClusterResourceQuotas()
}
func (k aaq) ApplicationAwareAppliedClusterResourceQuotas(namespace string) ApplicationAwareAppliedClusterResourceQuotaInterface {
return k.generatedAAQClient.AaqV1alpha1().ApplicationAwareAppliedClusterResourceQuotas(namespace)
}
func (k aaq) AAQJobQueueConfigs(namespace string) AAQJobQueueConfigInterface {
return k.generatedAAQClient.AaqV1alpha1().AAQJobQueueConfigs(namespace)
}
func (k aaq) AAQ() AAQInterface {
return k.generatedAAQClient.AaqV1alpha1().AAQs()
}
func (k aaq) DynamicClient() dynamic.Interface {
return k.dynamicClient
}
func (k aaq) DiscoveryClient() discovery.DiscoveryInterface {
return k.discoveryClient
}
// ApplicationAwareResourceQuotaInterface has methods to work with ApplicationAwareResourceQuotas resources.
type ApplicationAwareResourceQuotaInterface interface {
Create(ctx context.Context, applicationAwareResourceQuota *v1alpha1.ApplicationAwareResourceQuota, opts metav1.CreateOptions) (*v1alpha1.ApplicationAwareResourceQuota, error)
Update(ctx context.Context, applicationAwareResourceQuota *v1alpha1.ApplicationAwareResourceQuota, opts metav1.UpdateOptions) (*v1alpha1.ApplicationAwareResourceQuota, error)
UpdateStatus(ctx context.Context, applicationAwareResourceQuota *v1alpha1.ApplicationAwareResourceQuota, opts metav1.UpdateOptions) (*v1alpha1.ApplicationAwareResourceQuota, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1alpha1.ApplicationAwareResourceQuota, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1alpha1.ApplicationAwareResourceQuotaList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1alpha1.ApplicationAwareResourceQuota, err error)
aaqv1alpha1.ApplicationAwareResourceQuotaExpansion
}
// ApplicationAwareClusterResourceQuotaInterface has methods to work with ApplicationAwareClusterResourceQuota resources.
type ApplicationAwareClusterResourceQuotaInterface interface {
Create(ctx context.Context, applicationAwareResourceQuota *v1alpha1.ApplicationAwareClusterResourceQuota, opts metav1.CreateOptions) (*v1alpha1.ApplicationAwareClusterResourceQuota, error)
Update(ctx context.Context, applicationAwareResourceQuota *v1alpha1.ApplicationAwareClusterResourceQuota, opts metav1.UpdateOptions) (*v1alpha1.ApplicationAwareClusterResourceQuota, error)
UpdateStatus(ctx context.Context, applicationAwareResourceQuota *v1alpha1.ApplicationAwareClusterResourceQuota, opts metav1.UpdateOptions) (*v1alpha1.ApplicationAwareClusterResourceQuota, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1alpha1.ApplicationAwareClusterResourceQuota, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1alpha1.ApplicationAwareClusterResourceQuotaList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1alpha1.ApplicationAwareClusterResourceQuota, err error)
aaqv1alpha1.ApplicationAwareClusterResourceQuotaExpansion
}
// ApplicationAwareAppliedClusterResourceQuotaInterface has methods to work with ApplicationAwareAppliedClusterResourceQuotaInterface resources.
type ApplicationAwareAppliedClusterResourceQuotaInterface interface {
Create(ctx context.Context, ApplicationAwareAppliedClusterResourceQuota *v1alpha1.ApplicationAwareAppliedClusterResourceQuota, opts metav1.CreateOptions) (*v1alpha1.ApplicationAwareAppliedClusterResourceQuota, error)
Update(ctx context.Context, ApplicationAwareAppliedClusterResourceQuota *v1alpha1.ApplicationAwareAppliedClusterResourceQuota, opts metav1.UpdateOptions) (*v1alpha1.ApplicationAwareAppliedClusterResourceQuota, error)
UpdateStatus(ctx context.Context, ApplicationAwareAppliedClusterResourceQuota *v1alpha1.ApplicationAwareAppliedClusterResourceQuota, opts metav1.UpdateOptions) (*v1alpha1.ApplicationAwareAppliedClusterResourceQuota, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1alpha1.ApplicationAwareAppliedClusterResourceQuota, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1alpha1.ApplicationAwareAppliedClusterResourceQuotaList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1alpha1.ApplicationAwareAppliedClusterResourceQuota, err error)
aaqv1alpha1.ApplicationAwareAppliedClusterResourceQuotaExpansion
}
// AAQJobQueueConfigInterface has methods to work with AAQJobQueueConfigs resources.
type AAQJobQueueConfigInterface interface {
Create(ctx context.Context, aAQJobQueueConfig *v1alpha1.AAQJobQueueConfig, opts metav1.CreateOptions) (*v1alpha1.AAQJobQueueConfig, error)
Update(ctx context.Context, aAQJobQueueConfig *v1alpha1.AAQJobQueueConfig, opts metav1.UpdateOptions) (*v1alpha1.AAQJobQueueConfig, error)
UpdateStatus(ctx context.Context, aAQJobQueueConfig *v1alpha1.AAQJobQueueConfig, opts metav1.UpdateOptions) (*v1alpha1.AAQJobQueueConfig, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1alpha1.AAQJobQueueConfig, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1alpha1.AAQJobQueueConfigList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1alpha1.AAQJobQueueConfig, err error)
aaqv1alpha1.AAQJobQueueConfigExpansion
}
// AAQInterface has methods to work with AAQ resources.
type AAQInterface interface {
Create(ctx context.Context, aAQ *v1alpha1.AAQ, opts metav1.CreateOptions) (*v1alpha1.AAQ, error)
Update(ctx context.Context, aAQ *v1alpha1.AAQ, opts metav1.UpdateOptions) (*v1alpha1.AAQ, error)
UpdateStatus(ctx context.Context, aAQ *v1alpha1.AAQ, opts metav1.UpdateOptions) (*v1alpha1.AAQ, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1alpha1.AAQ, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1alpha1.AAQList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1alpha1.AAQ, err error)
aaqv1alpha1.AAQExpansion
}