forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appliedclusterresourcequota.go
46 lines (38 loc) · 1.85 KB
/
appliedclusterresourcequota.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
package client
import (
kapi "k8s.io/kubernetes/pkg/api"
quotaapi "github.com/openshift/origin/pkg/quota/api"
)
// AppliedClusterResourceQuotasNamespacer has methods to work with AppliedClusterResourceQuota resources in a namespace
type AppliedClusterResourceQuotasNamespacer interface {
AppliedClusterResourceQuotas(namespace string) AppliedClusterResourceQuotaInterface
}
// AppliedClusterResourceQuotaInterface exposes methods on AppliedClusterResourceQuota resources.
type AppliedClusterResourceQuotaInterface interface {
List(opts kapi.ListOptions) (*quotaapi.AppliedClusterResourceQuotaList, error)
Get(name string) (*quotaapi.AppliedClusterResourceQuota, error)
}
// appliedClusterResourceQuotas implements AppliedClusterResourceQuotasNamespacer interface
type appliedClusterResourceQuotas struct {
r *Client
ns string
}
// newAppliedClusterResourceQuotas returns a appliedClusterResourceQuotas
func newAppliedClusterResourceQuotas(c *Client, namespace string) *appliedClusterResourceQuotas {
return &appliedClusterResourceQuotas{
r: c,
ns: namespace,
}
}
// List returns a list of appliedClusterResourceQuotas that match the label and field selectors.
func (c *appliedClusterResourceQuotas) List(opts kapi.ListOptions) (result *quotaapi.AppliedClusterResourceQuotaList, err error) {
result = "aapi.AppliedClusterResourceQuotaList{}
err = c.r.Get().Namespace(c.ns).Resource("appliedclusterresourcequotas").VersionedParams(&opts, kapi.ParameterCodec).Do().Into(result)
return
}
// Get returns information about a particular appliedClusterResourceQuota and error if one occurs.
func (c *appliedClusterResourceQuotas) Get(name string) (result *quotaapi.AppliedClusterResourceQuota, err error) {
result = "aapi.AppliedClusterResourceQuota{}
err = c.r.Get().Namespace(c.ns).Resource("appliedclusterresourcequotas").Name(name).Do().Into(result)
return
}