@@ -32,10 +32,10 @@ var _ PowerVS = &Service{}
3232// Service holds the PowerVS Service specific information
3333type Service struct {
3434 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
3939}
4040
4141type ServiceOptions struct {
@@ -46,42 +46,42 @@ type ServiceOptions struct {
4646
4747// CreateInstance creates the virtual machine in the Power VS service instance.
4848func (s * Service ) CreateInstance (body * models.PVMInstanceCreate ) (* models.PVMInstanceList , error ) {
49- return s .InstanceClient .Create (body )
49+ return s .instanceClient .Create (body )
5050}
5151
5252// DeleteInstance deletes the virtual machine in the Power VS service instance.
5353func (s * Service ) DeleteInstance (id string ) error {
54- return s .InstanceClient .Delete (id )
54+ return s .instanceClient .Delete (id )
5555}
5656
5757// GetAllInstance returns all the virtual machine in the Power VS service instance.
5858func (s * Service ) GetAllInstance () (* models.PVMInstances , error ) {
59- return s .InstanceClient .GetAll ()
59+ return s .instanceClient .GetAll ()
6060}
6161
6262// GetInstance returns the virtual machine in the Power VS service instance.
6363func (s * Service ) GetInstance (id string ) (* models.PVMInstance , error ) {
64- return s .InstanceClient .Get (id )
64+ return s .instanceClient .Get (id )
6565}
6666
6767// GetImage returns the image in the Power VS service instance.
6868func (s * Service ) GetImage (id string ) (* models.Image , error ) {
69- return s .ImageClient .Get (id )
69+ return s .imageClient .Get (id )
7070}
7171
7272// GetAllImage returns all the images in the Power VS service instance.
7373func (s * Service ) GetAllImage () (* models.Images , error ) {
74- return s .ImageClient .GetAll ()
74+ return s .imageClient .GetAll ()
7575}
7676
7777// DeleteImage deletes the image in the Power VS service instance.
7878func (s * Service ) DeleteImage (id string ) error {
79- return s .ImageClient .Delete (id )
79+ return s .imageClient .Delete (id )
8080}
8181
8282// CreateCosImage creates a import job to import the image in the Power VS service instance.
8383func (s * Service ) CreateCosImage (body * models.CreateCosImageImportJob ) (* models.JobReference , error ) {
84- return s .ImageClient .CreateCosImage (body )
84+ return s .imageClient .CreateCosImage (body )
8585}
8686
8787// 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) {
9696
9797// GetJob returns the import job to in the Power VS service instance.
9898func (s * Service ) GetJob (id string ) (* models.Job , error ) {
99- return s .JobClient .Get (id )
99+ return s .jobClient .Get (id )
100100}
101101
102102// DeleteJob deletes the image import job in the Power VS service instance.
103103func (s * Service ) DeleteJob (id string ) error {
104- return s .JobClient .Delete (id )
104+ return s .jobClient .Delete (id )
105105}
106106
107107// GetAllNetwork returns all the networks in the Power VS service instance.
108108func (s * Service ) GetAllNetwork () (* models.Networks , error ) {
109- return s .NetworkClient .GetAll ()
109+ return s .networkClient .GetAll ()
110110}
111111
112112// NewService returns a new service for the Power VS api client.
@@ -125,9 +125,9 @@ func NewService(options ServiceOptions) (*Service, error) {
125125
126126 return & Service {
127127 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 ),
132132 }, nil
133133}
0 commit comments