@@ -32,10 +32,10 @@ var _ PowerVS = &Service{}
32
32
// Service holds the PowerVS Service specific information
33
33
type Service struct {
34
34
session * ibmpisession.IBMPISession
35
- InstanceClient * instance.IBMPIInstanceClient
36
- NetworkClient * instance.IBMPINetworkClient
37
- ImageClient * instance.IBMPIImageClient
38
- JobClient * instance.IBMPIJobClient
35
+ instanceClient * instance.IBMPIInstanceClient
36
+ networkClient * instance.IBMPINetworkClient
37
+ imageClient * instance.IBMPIImageClient
38
+ jobClient * instance.IBMPIJobClient
39
39
}
40
40
41
41
type ServiceOptions struct {
@@ -46,42 +46,42 @@ type ServiceOptions struct {
46
46
47
47
// CreateInstance creates the virtual machine in the Power VS service instance.
48
48
func (s * Service ) CreateInstance (body * models.PVMInstanceCreate ) (* models.PVMInstanceList , error ) {
49
- return s .InstanceClient .Create (body )
49
+ return s .instanceClient .Create (body )
50
50
}
51
51
52
52
// DeleteInstance deletes the virtual machine in the Power VS service instance.
53
53
func (s * Service ) DeleteInstance (id string ) error {
54
- return s .InstanceClient .Delete (id )
54
+ return s .instanceClient .Delete (id )
55
55
}
56
56
57
57
// GetAllInstance returns all the virtual machine in the Power VS service instance.
58
58
func (s * Service ) GetAllInstance () (* models.PVMInstances , error ) {
59
- return s .InstanceClient .GetAll ()
59
+ return s .instanceClient .GetAll ()
60
60
}
61
61
62
62
// GetInstance returns the virtual machine in the Power VS service instance.
63
63
func (s * Service ) GetInstance (id string ) (* models.PVMInstance , error ) {
64
- return s .InstanceClient .Get (id )
64
+ return s .instanceClient .Get (id )
65
65
}
66
66
67
67
// GetImage returns the image in the Power VS service instance.
68
68
func (s * Service ) GetImage (id string ) (* models.Image , error ) {
69
- return s .ImageClient .Get (id )
69
+ return s .imageClient .Get (id )
70
70
}
71
71
72
72
// GetAllImage returns all the images in the Power VS service instance.
73
73
func (s * Service ) GetAllImage () (* models.Images , error ) {
74
- return s .ImageClient .GetAll ()
74
+ return s .imageClient .GetAll ()
75
75
}
76
76
77
77
// DeleteImage deletes the image in the Power VS service instance.
78
78
func (s * Service ) DeleteImage (id string ) error {
79
- return s .ImageClient .Delete (id )
79
+ return s .imageClient .Delete (id )
80
80
}
81
81
82
82
// CreateCosImage creates a import job to import the image in the Power VS service instance.
83
83
func (s * Service ) CreateCosImage (body * models.CreateCosImageImportJob ) (* models.JobReference , error ) {
84
- return s .ImageClient .CreateCosImage (body )
84
+ return s .imageClient .CreateCosImage (body )
85
85
}
86
86
87
87
// GetCosImages returns the last import job in the Power VS service instance.
@@ -96,17 +96,17 @@ func (s *Service) GetCosImages(id string) (*models.Job, error) {
96
96
97
97
// GetJob returns the import job to in the Power VS service instance.
98
98
func (s * Service ) GetJob (id string ) (* models.Job , error ) {
99
- return s .JobClient .Get (id )
99
+ return s .jobClient .Get (id )
100
100
}
101
101
102
102
// DeleteJob deletes the image import job in the Power VS service instance.
103
103
func (s * Service ) DeleteJob (id string ) error {
104
- return s .JobClient .Delete (id )
104
+ return s .jobClient .Delete (id )
105
105
}
106
106
107
107
// GetAllNetwork returns all the networks in the Power VS service instance.
108
108
func (s * Service ) GetAllNetwork () (* models.Networks , error ) {
109
- return s .NetworkClient .GetAll ()
109
+ return s .networkClient .GetAll ()
110
110
}
111
111
112
112
// NewService returns a new service for the Power VS api client.
@@ -125,9 +125,9 @@ func NewService(options ServiceOptions) (*Service, error) {
125
125
126
126
return & Service {
127
127
session : session ,
128
- InstanceClient : instance .NewIBMPIInstanceClient (ctx , session , options .CloudInstanceID ),
129
- NetworkClient : instance .NewIBMPINetworkClient (ctx , session , options .CloudInstanceID ),
130
- ImageClient : instance .NewIBMPIImageClient (ctx , session , options .CloudInstanceID ),
131
- JobClient : instance .NewIBMPIJobClient (ctx , session , options .CloudInstanceID ),
128
+ instanceClient : instance .NewIBMPIInstanceClient (ctx , session , options .CloudInstanceID ),
129
+ networkClient : instance .NewIBMPINetworkClient (ctx , session , options .CloudInstanceID ),
130
+ imageClient : instance .NewIBMPIImageClient (ctx , session , options .CloudInstanceID ),
131
+ jobClient : instance .NewIBMPIJobClient (ctx , session , options .CloudInstanceID ),
132
132
}, nil
133
133
}
0 commit comments