Documentation ¶
Index ¶
- Variables
- type Service
- func (ss *Service) Create(ctx context.Context, datacenterID string) (*ionoscloud.Server, *ionoscloud.APIResponse, error)
- func (ss *Service) Delete(ctx context.Context, datacenterID, serverID, ID string) (*ionoscloud.APIResponse, error)
- func (ss *Service) FindById(ctx context.Context, datacenterID, serverID string, depth int32) (*ionoscloud.Server, error)
- func (ss *Service) GetAttachedVolumes(ctx context.Context, datacenterID, serverID string) ([]*ionoscloud.Volume, *ionoscloud.APIResponse, error)
- func (ss *Service) GetCurrentBootDeviceID(ctx context.Context, datacenterId, serverId string) (string, string, error)
- func (ss *Service) GetDefaultBootVolume(ctx context.Context, datacenterId, serverId string) (*ionoscloud.Volume, error)
- func (ss *Service) GetServerType(ctx context.Context, datacenterID, serverID string) (string, error)
- func (ss *Service) GetVmState(ctx context.Context, datacenterID, serverID string) (string, error)
- func (ss *Service) PxeBoot(ctx context.Context, datacenterID, serverID string) error
- func (ss *Service) Reboot(ctx context.Context, datacenterID, serverID string) error
- func (ss *Service) Start(ctx context.Context, datacenterID, serverID, serverType string) error
- func (ss *Service) Stop(ctx context.Context, datacenterID, serverID, serverType string) error
- func (ss *Service) Update(ctx context.Context, datacenterID, serverID string, ...) (*ionoscloud.Server, *ionoscloud.APIResponse, error)
- func (ss *Service) UpdateBootDevice(ctx context.Context, datacenterID, serverID, newBootDeviceID string) error
- func (ss *Service) UpdateVmState(ctx context.Context, datacenterID, serverID, newVmState string) error
- type UnboundService
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSuspendCubeLast signals to the Server Resource UpdateContext that the cube server will be suspended so that the operation is deferred ErrSuspendCubeLast error // ErrServerNotFound returned when the server with the requested ID does not exist ErrServerNotFound error // ErrNoBootDevice is returned if the Server does not have a boot cdrom or boot volume set ErrNoBootDevice = errors.New("server has no boot device") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct { Client *ionoscloud.APIClient Meta any D *schema.ResourceData }
func (*Service) Create ¶
func (ss *Service) Create(ctx context.Context, datacenterID string) (*ionoscloud.Server, *ionoscloud.APIResponse, error)
func (*Service) Delete ¶
func (ss *Service) Delete(ctx context.Context, datacenterID, serverID, ID string) (*ionoscloud.APIResponse, error)
func (*Service) GetAttachedVolumes ¶ added in v6.4.12
func (ss *Service) GetAttachedVolumes(ctx context.Context, datacenterID, serverID string) ([]*ionoscloud.Volume, *ionoscloud.APIResponse, error)
func (*Service) GetCurrentBootDeviceID ¶ added in v6.4.12
func (*Service) GetDefaultBootVolume ¶ added in v6.4.12
func (*Service) GetServerType ¶
func (*Service) GetVmState ¶
func (*Service) PxeBoot ¶ added in v6.4.13
PxeBoot restarts the Server into the PXE shell by unsetting the primary boot device of the VM and performing a reset
func (*Service) Update ¶
func (ss *Service) Update(ctx context.Context, datacenterID, serverID string, serverProperties ionoscloud.ServerProperties) (*ionoscloud.Server, *ionoscloud.APIResponse, error)
func (*Service) UpdateBootDevice ¶ added in v6.4.12
func (ss *Service) UpdateBootDevice(ctx context.Context, datacenterID, serverID, newBootDeviceID string) error
UpdateBootDevice will set a new boot device for the server, which can be a volume or bootable image CDROM. When the new boot device is a volume, it must be already attached to the server. When the new boot device is a CDROM image, it will be attached by default. If the current boot device is a CDROM image, it will be detached after it is changed by this operation.
type UnboundService ¶ added in v6.4.13
type UnboundService interface { Update(context.Context, string, string, ionoscloud.ServerProperties) (*ionoscloud.Server, *ionoscloud.APIResponse, error) GetDefaultBootVolume(ctx context.Context, datacenterID, serverID string) (*ionoscloud.Volume, error) UpdateBootDevice(ctx context.Context, datacenterID, serverID, newBootDeviceID string) error PxeBoot(ctx context.Context, datacenterID, serverID string) error Reboot(ctx context.Context, datacenterID, serverID string) error }
UnboundService allows usage of a subset of the method set of the Service This is useful when using the Service in Provider Context functions that belong to a different resource which needs to interact with an already existing server In this case, the Service will not be 'bound' to the state of the Server resource The methods of this interface must not write to the state, since the Service will use a placeholder ResourceData reference
func NewUnboundService ¶ added in v6.4.13
func NewUnboundService(serverID string, meta any) UnboundService
NewUnboundService creates an UnboundService with a subset of the underlying Service methods The concrete Service is created with a dummy ResourceData reference which has the ID of the Server this service will interact with This ensure state tracking functions such as WaitForResourceToBeReady use the correct ID