diff --git a/pkg/cloudprovider/resources.go b/pkg/cloudprovider/resources.go index 876a93d34..24fe85ac4 100644 --- a/pkg/cloudprovider/resources.go +++ b/pkg/cloudprovider/resources.go @@ -367,11 +367,6 @@ type ICloudVM interface { GetVga() string GetVdi() string - // GetOSArch() string - // GetOsType() TOsType - // GetOSName() string - // GetBios() string - GetMachine() string GetInstanceType() string @@ -418,6 +413,39 @@ type ICloudVM interface { GetPowerStates() string GetHealthStatus() string GetIsolateDeviceIds() ([]string, error) + + GetContainers() ([]ICloudContainer, error) +} + +type SContainerEnv struct { + Key string + Value string +} + +type ICloudContainer interface { + ICloudResource + + GetImage() string + GetCommand() []string + GetEnvs() []SContainerEnv + + GetStartedAt() time.Time + GetLastFinishedAt() time.Time + GetRestartCount() int + + GetVolumentMounts() ([]ICloudVolumeMount, error) + GetDevices() ([]IContainerDevice, error) +} + +type ICloudVolumeMount interface { + GetName() string + IsReadOnly() bool + GetType() string +} + +type IContainerDevice interface { + GetId() string + GetType() string } type ICloudNic interface { diff --git a/pkg/multicloud/instance_base.go b/pkg/multicloud/instance_base.go index 0f43b261d..a106b5b0f 100644 --- a/pkg/multicloud/instance_base.go +++ b/pkg/multicloud/instance_base.go @@ -102,3 +102,7 @@ func (instance *SInstanceBase) GetError() error { func (instance *SInstanceBase) GetIsolateDeviceIds() ([]string, error) { return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetIsolateDeviceIds") } + +func (instance *SInstanceBase) GetContainers() ([]cloudprovider.ICloudContainer, error) { + return nil, errors.Wrapf(cloudprovider.ErrNotImplemented, "GetContainers") +} diff --git a/pkg/multicloud/remotefile/instance.go b/pkg/multicloud/remotefile/instance.go index 36275bbfd..64fa6a907 100644 --- a/pkg/multicloud/remotefile/instance.go +++ b/pkg/multicloud/remotefile/instance.go @@ -292,3 +292,7 @@ func (self *SInstance) GetHealthStatus() string { func (self *SInstance) GetIsolateDeviceIds() ([]string, error) { return nil, cloudprovider.ErrNotSupported } + +func (self *SInstance) GetContainers() ([]cloudprovider.ICloudContainer, error) { + return nil, cloudprovider.ErrNotSupported +}