Documentation
¶
Overview ¶
Package client contains an implementation of the Client interface defined in internal/ionoscloud.
Index ¶
- func WithDepth(client ionoscloud.Client, depth int32) ionoscloud.Client
- type IonosCloudClient
- func (c *IonosCloudClient) CheckRequestStatus(ctx context.Context, requestURL string) (*sdk.RequestStatus, error)
- func (c *IonosCloudClient) CreateLAN(ctx context.Context, datacenterID string, properties sdk.LanProperties) (string, error)
- func (c *IonosCloudClient) CreateServer(ctx context.Context, datacenterID string, properties sdk.ServerProperties, ...) (*sdk.Server, string, error)
- func (c *IonosCloudClient) DeleteIPBlock(ctx context.Context, ipBlockID string) (requestPath string, err error)
- func (c *IonosCloudClient) DeleteLAN(ctx context.Context, datacenterID, lanID string) (string, error)
- func (c *IonosCloudClient) DeleteServer(ctx context.Context, datacenterID, serverID string, deleteVolumes bool) (string, error)
- func (c *IonosCloudClient) DeleteVolume(ctx context.Context, datacenterID, volumeID string) (string, error)
- func (c *IonosCloudClient) GetDatacenterLocationByID(ctx context.Context, datacenterID string) (string, error)
- func (c *IonosCloudClient) GetIPBlock(ctx context.Context, ipBlockID string) (*sdk.IpBlock, error)
- func (c *IonosCloudClient) GetImage(ctx context.Context, imageID string) (*sdk.Image, error)
- func (c *IonosCloudClient) GetRequests(ctx context.Context, method, path string) ([]sdk.Request, error)
- func (c *IonosCloudClient) GetServer(ctx context.Context, datacenterID, serverID string) (*sdk.Server, error)
- func (c *IonosCloudClient) ListIPBlocks(ctx context.Context) (*sdk.IpBlocks, error)
- func (c *IonosCloudClient) ListLANs(ctx context.Context, datacenterID string) (*sdk.Lans, error)
- func (c *IonosCloudClient) ListLabels(ctx context.Context) ([]sdk.Label, error)
- func (c *IonosCloudClient) ListServers(ctx context.Context, datacenterID string) (*sdk.Servers, error)
- func (c *IonosCloudClient) PatchLAN(ctx context.Context, datacenterID, lanID string, properties sdk.LanProperties) (string, error)
- func (c *IonosCloudClient) PatchNIC(ctx context.Context, datacenterID, serverID, nicID string, ...) (string, error)
- func (c *IonosCloudClient) ReserveIPBlock(ctx context.Context, name, location string, size int32) (requestPath string, err error)
- func (c *IonosCloudClient) StartServer(ctx context.Context, datacenterID, serverID string) (string, error)
- func (c *IonosCloudClient) WaitForRequest(ctx context.Context, requestURL string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDepth ¶
func WithDepth(client ionoscloud.Client, depth int32) ionoscloud.Client
WithDepth creates a temporary copy of the client, where a custom depth can be set.
Types ¶
type IonosCloudClient ¶
IonosCloudClient is a concrete implementation of the Client interface defined in the internal client package that communicates with Cloud API using its SDK.
func NewClient ¶
func NewClient(token, apiURL string, caBundle []byte) (*IonosCloudClient, error)
NewClient instantiates a usable IonosCloudClient. The client needs a token to work. Basic auth is not supported. Passing a CA bundle is optional.
func (*IonosCloudClient) CheckRequestStatus ¶
func (c *IonosCloudClient) CheckRequestStatus(ctx context.Context, requestURL string) (*sdk.RequestStatus, error)
CheckRequestStatus returns the status of a request and an error if checking for it fails.
func (*IonosCloudClient) CreateLAN ¶
func (c *IonosCloudClient) CreateLAN(ctx context.Context, datacenterID string, properties sdk.LanProperties, ) (string, error)
CreateLAN creates a new LAN with the provided properties in the specified data center, returning the request location.
func (*IonosCloudClient) CreateServer ¶
func (c *IonosCloudClient) CreateServer( ctx context.Context, datacenterID string, properties sdk.ServerProperties, entities sdk.ServerEntities, ) (*sdk.Server, string, error)
CreateServer creates a new server with provided properties in the specified data center.
func (*IonosCloudClient) DeleteIPBlock ¶
func (c *IonosCloudClient) DeleteIPBlock(ctx context.Context, ipBlockID string) (requestPath string, err error)
DeleteIPBlock deletes the IP block that matches the provided ipBlockID.
func (*IonosCloudClient) DeleteLAN ¶
func (c *IonosCloudClient) DeleteLAN(ctx context.Context, datacenterID, lanID string) (string, error)
DeleteLAN deletes the LAN that matches the provided lanID in the specified data center, returning the request location.
func (*IonosCloudClient) DeleteServer ¶
func (c *IonosCloudClient) DeleteServer(ctx context.Context, datacenterID, serverID string, deleteVolumes bool) (string, error)
DeleteServer deletes the server that matches the provided serverID in the specified data center.
func (*IonosCloudClient) DeleteVolume ¶
func (c *IonosCloudClient) DeleteVolume(ctx context.Context, datacenterID, volumeID string) (string, error)
DeleteVolume deletes the volume that matches the provided volumeID in the specified data center.
func (*IonosCloudClient) GetDatacenterLocationByID ¶ added in v0.3.0
func (c *IonosCloudClient) GetDatacenterLocationByID(ctx context.Context, datacenterID string) (string, error)
GetDatacenterLocationByID returns the location of the data center identified by datacenterID.
func (*IonosCloudClient) GetIPBlock ¶
GetIPBlock returns the IP block that matches the provided ipBlockID.
func (*IonosCloudClient) GetImage ¶ added in v0.3.0
GetImage returns the image identified by imageID.
func (*IonosCloudClient) GetRequests ¶
func (c *IonosCloudClient) GetRequests(ctx context.Context, method, path string) ([]sdk.Request, error)
GetRequests returns the requests made in the last 24 hours that match the provided method and path.
func (*IonosCloudClient) GetServer ¶
func (c *IonosCloudClient) GetServer(ctx context.Context, datacenterID, serverID string) (*sdk.Server, error)
GetServer returns the server that matches the provided serverID in the specified data center.
func (*IonosCloudClient) ListIPBlocks ¶
ListIPBlocks returns a list of IP blocks.
func (*IonosCloudClient) ListLabels ¶ added in v0.3.0
ListLabels returns a list of all available resource labels.
func (*IonosCloudClient) ListServers ¶
func (c *IonosCloudClient) ListServers(ctx context.Context, datacenterID string) (*sdk.Servers, error)
ListServers returns a list with servers in the specified data center.
func (*IonosCloudClient) PatchLAN ¶
func (c *IonosCloudClient) PatchLAN( ctx context.Context, datacenterID, lanID string, properties sdk.LanProperties, ) (string, error)
PatchLAN patches the LAN that matches lanID in the specified data center with the provided properties, returning the request location.
func (*IonosCloudClient) PatchNIC ¶
func (c *IonosCloudClient) PatchNIC( ctx context.Context, datacenterID, serverID, nicID string, properties sdk.NicProperties, ) (string, error)
PatchNIC updates the NIC identified by nicID with the provided properties.
func (*IonosCloudClient) ReserveIPBlock ¶
func (c *IonosCloudClient) ReserveIPBlock( ctx context.Context, name, location string, size int32, ) (requestPath string, err error)
ReserveIPBlock reserves an IP block with the provided properties in the specified location, returning the request path.
func (*IonosCloudClient) StartServer ¶
func (c *IonosCloudClient) StartServer(ctx context.Context, datacenterID, serverID string) (string, error)
StartServer starts the server that matches the provided serverID in the specified data center. Returning the location and an error if starting the server fails.
func (*IonosCloudClient) WaitForRequest ¶
func (c *IonosCloudClient) WaitForRequest(ctx context.Context, requestURL string) error
WaitForRequest waits for the completion of the provided request.