-
Notifications
You must be signed in to change notification settings - Fork 175
/
interface.go
40 lines (33 loc) · 1.92 KB
/
interface.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
package vmoperator
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/dynamic"
vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1"
)
// Interface has methods to work with Vmoperator resources.
type Interface interface {
V1alpha1() V1alpha1Interface
}
// V1alpha1Interface has methods to work with Vmoperator V1alpha1 resources.
type V1alpha1Interface interface {
Client() dynamic.Interface
VirtualMachines(namespace string) VirtualMachineInterface
VirtualMachineServices(namespace string) VirtualMachineServiceInterface
}
// VirtualMachineInterface has methods to work with VirtualMachineService resources.
type VirtualMachineInterface interface {
Create(ctx context.Context, virtualMachine *vmopv1alpha1.VirtualMachine, opts v1.CreateOptions) (*vmopv1alpha1.VirtualMachine, error)
Update(ctx context.Context, virtualMachine *vmopv1alpha1.VirtualMachine, opts v1.UpdateOptions) (*vmopv1alpha1.VirtualMachine, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*vmopv1alpha1.VirtualMachine, error)
List(ctx context.Context, opts v1.ListOptions) (*vmopv1alpha1.VirtualMachineList, error)
}
// VirtualMachineServiceInterface has methods to work with VirtualMachineService resources.
type VirtualMachineServiceInterface interface {
Create(ctx context.Context, virtualMachineService *vmopv1alpha1.VirtualMachineService, opts v1.CreateOptions) (*vmopv1alpha1.VirtualMachineService, error)
Update(ctx context.Context, virtualMachineService *vmopv1alpha1.VirtualMachineService, opts v1.UpdateOptions) (*vmopv1alpha1.VirtualMachineService, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*vmopv1alpha1.VirtualMachineService, error)
List(ctx context.Context, opts v1.ListOptions) (*vmopv1alpha1.VirtualMachineServiceList, error)
}