Documentation
¶
Overview ¶
Package metadata implements a client for the cloudscale.ch's OpenStack metadata API. This API allows a server to inspect information about itself, like its server ID.
Documentation for the API is available at:
https://www.cloudscale.ch/en/api/v1
Index ¶
- Constants
- func CheckResponse(r *http.Response) error
- type Address
- type AddressRequest
- type BucketMetrics
- type BucketMetricsData
- type BucketMetricsDataSubject
- type BucketMetricsInterval
- type BucketMetricsIntervalUsage
- type BucketMetricsRequest
- type Client
- type CustomImage
- type CustomImageImport
- type CustomImageImportRequest
- type CustomImageImportsService
- type CustomImageImportsServiceOperations
- func (s CustomImageImportsServiceOperations) Create(ctx context.Context, createRequest *CustomImageImportRequest) (*CustomImageImport, error)
- func (s CustomImageImportsServiceOperations) Get(ctx context.Context, CustomImageImportID string) (*CustomImageImport, error)
- func (s CustomImageImportsServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]CustomImageImport, error)
- type CustomImageRequest
- type CustomImageService
- type CustomImageServiceOperations
- func (s CustomImageServiceOperations) Delete(ctx context.Context, customImageID string) error
- func (s CustomImageServiceOperations) Get(ctx context.Context, customImageID string) (*CustomImage, error)
- func (s CustomImageServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]CustomImage, error)
- func (s CustomImageServiceOperations) Update(ctx context.Context, customImageID string, updateRequest *CustomImageRequest) error
- type CustomImageStub
- type ErrorResponse
- type Flavor
- type FloatingIP
- type FloatingIPCreateRequest
- type FloatingIPUpdateRequest
- type FloatingIPsService
- type FloatingIPsServiceOperations
- func (f FloatingIPsServiceOperations) Create(ctx context.Context, floatingIPRequest *FloatingIPCreateRequest) (*FloatingIP, error)
- func (f FloatingIPsServiceOperations) Delete(ctx context.Context, ip string) error
- func (f FloatingIPsServiceOperations) Get(ctx context.Context, ip string) (*FloatingIP, error)
- func (f FloatingIPsServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]FloatingIP, error)
- func (f FloatingIPsServiceOperations) Update(ctx context.Context, ip string, ...) error
- type Image
- type Interface
- type InterfaceRequest
- type ListRequestModifier
- type Metadata
- type MetadataClient
- type MetricsService
- type MetricsServiceOperations
- type Network
- type NetworkCreateRequest
- type NetworkService
- type NetworkServiceOperations
- func (s NetworkServiceOperations) Create(ctx context.Context, createRequest *NetworkCreateRequest) (*Network, error)
- func (s NetworkServiceOperations) Delete(ctx context.Context, networkID string) error
- func (s NetworkServiceOperations) Get(ctx context.Context, networkID string) (*Network, error)
- func (s NetworkServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]Network, error)
- func (f NetworkServiceOperations) Update(ctx context.Context, networkID string, updateRequest *NetworkUpdateRequest) error
- type NetworkStub
- type NetworkUpdateRequest
- type ObjectsUser
- type ObjectsUserRequest
- type ObjectsUsersService
- type ObjectsUsersServiceOperations
- func (s ObjectsUsersServiceOperations) Create(ctx context.Context, createRequest *ObjectsUserRequest) (*ObjectsUser, error)
- func (s ObjectsUsersServiceOperations) Delete(ctx context.Context, objectsUserID string) error
- func (s ObjectsUsersServiceOperations) Get(ctx context.Context, objectsUserID string) (*ObjectsUser, error)
- func (s ObjectsUsersServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]ObjectsUser, error)
- func (s ObjectsUsersServiceOperations) Update(ctx context.Context, objectsUserID string, updateRequest *ObjectsUserRequest) error
- type Region
- type RegionService
- type RegionServiceOperations
- type RegionalResource
- type RegionalResourceRequest
- type Server
- type ServerGroup
- type ServerGroupRequest
- type ServerGroupService
- type ServerGroupServiceOperations
- func (s ServerGroupServiceOperations) Create(ctx context.Context, createRequest *ServerGroupRequest) (*ServerGroup, error)
- func (s ServerGroupServiceOperations) Delete(ctx context.Context, serverGroupID string) error
- func (s ServerGroupServiceOperations) Get(ctx context.Context, serverGroupID string) (*ServerGroup, error)
- func (s ServerGroupServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]ServerGroup, error)
- func (f ServerGroupServiceOperations) Update(ctx context.Context, serverGroupID string, updateRequest *ServerGroupRequest) error
- type ServerGroupStub
- type ServerRequest
- type ServerService
- type ServerServiceOperations
- func (s ServerServiceOperations) Create(ctx context.Context, createRequest *ServerRequest) (*Server, error)
- func (s ServerServiceOperations) Delete(ctx context.Context, serverID string) error
- func (s ServerServiceOperations) Get(ctx context.Context, serverID string) (*Server, error)
- func (s ServerServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]Server, error)
- func (s ServerServiceOperations) Reboot(ctx context.Context, serverID string) error
- func (s ServerServiceOperations) Start(ctx context.Context, serverID string) error
- func (s ServerServiceOperations) Stop(ctx context.Context, serverID string) error
- func (s ServerServiceOperations) Update(ctx context.Context, serverID string, updateRequest *ServerUpdateRequest) error
- type ServerStub
- type ServerUpdateRequest
- type Subnet
- type SubnetCreateRequest
- type SubnetService
- type SubnetServiceOperations
- func (s SubnetServiceOperations) Create(ctx context.Context, createRequest *SubnetCreateRequest) (*Subnet, error)
- func (s SubnetServiceOperations) Delete(ctx context.Context, subnetID string) error
- func (s SubnetServiceOperations) Get(ctx context.Context, subnetID string) (*Subnet, error)
- func (s SubnetServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]Subnet, error)
- func (f SubnetServiceOperations) Update(ctx context.Context, subnetID string, updateRequest *SubnetUpdateRequest) error
- type SubnetStub
- type SubnetUpdateRequest
- type TagMap
- type TaggedResource
- type TaggedResourceRequest
- type Volume
- type VolumeRequest
- type VolumeService
- type VolumeServiceOperations
- func (s VolumeServiceOperations) Create(ctx context.Context, createRequest *VolumeRequest) (*Volume, error)
- func (s VolumeServiceOperations) Delete(ctx context.Context, volumeID string) error
- func (s VolumeServiceOperations) Get(ctx context.Context, volumeID string) (*Volume, error)
- func (s VolumeServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]Volume, error)
- func (f VolumeServiceOperations) Update(ctx context.Context, volumeID string, updateRequest *VolumeRequest) error
- type VolumeStub
- type ZonalResource
- type ZonalResourceRequest
- type Zone
Constants ¶
const ServerRebooted = "rebooted"
const ServerRunning = "running"
const ServerStopped = "stopped"
const UserDataHandlingExtendCloudConfig = "extend-cloud-config"
const UserDataHandlingPassThrough = "pass-through"
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
Types ¶
type AddressRequest ¶
type BucketMetrics ¶
type BucketMetrics struct {
Start time.Time `json:"start"`
End time.Time `json:"end"`
Data []BucketMetricsData
}
type BucketMetricsData ¶
type BucketMetricsData struct {
Subject BucketMetricsDataSubject `json:"subject"`
TimeSeries []BucketMetricsInterval `json:"time_series"`
}
type BucketMetricsInterval ¶
type BucketMetricsInterval struct {
Start time.Time `json:"start"`
End time.Time `json:"end"`
Usage BucketMetricsIntervalUsage `json:"usage"`
}
type BucketMetricsRequest ¶
type BucketMetricsRequest struct {
// Interpreted as midnight in the Europe/Zurich time zone at the start of
// the day represented by the day of the passed value in the UTC time zone.
Start time.Time
// Interpreted as midnight in the Europe/Zurich time zone at the end of
// the day represented by the day of the passed value in the UTC time zone.
End time.Time
BucketNames []string
ObjectsUserIDs []string
}
type Client ¶
type Client struct {
// Base URL for API requests.
BaseURL *url.URL
// Authentication token
AuthToken string
// User agent for client
UserAgent string
Regions RegionService
Servers ServerService
Volumes VolumeService
Networks NetworkService
Subnets SubnetService
FloatingIPs FloatingIPsService
ServerGroups ServerGroupService
ObjectsUsers ObjectsUsersService
CustomImages CustomImageService
CustomImageImports CustomImageImportsService
Metrics MetricsService
// contains filtered or unexported fields
}
Client manages communication with CloudScale API.
type CustomImage ¶
type CustomImage struct {
ZonalResource
TaggedResource
// Just use omitempty everywhere. This makes it easy to use restful. Errors
// will be coming from the API if something is disabled.
HREF string `json:"href,omitempty"`
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
Slug string `json:"slug,omitempty"`
SizeGB int `json:"size_gb,omitempty"`
Checksums map[string]string `json:"checksums,omitempty"`
UserDataHandling string `json:"user_data_handling,omitempty"`
FirmwareType string `json:"firmware_type,omitempty"`
Zones []Zone `json:"zones"`
CreatedAt time.Time `json:"created_at"`
}
type CustomImageImport ¶
type CustomImageImport struct {
TaggedResource
// Just use omitempty everywhere. This makes it easy to use restful. Errors
// will be coming from the API if something is disabled.
HREF string `json:"href,omitempty"`
UUID string `json:"uuid,omitempty"`
CustomImage CustomImageStub `json:"custom_image,omitempty"`
URL string `json:"url,omitempty"`
Status string `json:"status,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
}
type CustomImageImportRequest ¶
type CustomImageImportRequest struct {
TaggedResourceRequest
URL string `json:"url,omitempty"`
Name string `json:"name,omitempty"`
Slug string `json:"slug,omitempty"`
UserDataHandling string `json:"user_data_handling,omitempty"`
FirmwareType string `json:"firmware_type,omitempty"`
SourceFormat string `json:"source_format,omitempty"`
Zones []string `json:"zones,omitempty"`
}
type CustomImageImportsService ¶
type CustomImageImportsService interface {
Create(ctx context.Context, createRequest *CustomImageImportRequest) (*CustomImageImport, error)
Get(ctx context.Context, CustomImageImportID string) (*CustomImageImport, error)
List(ctx context.Context, modifiers ...ListRequestModifier) ([]CustomImageImport, error)
}
type CustomImageImportsServiceOperations ¶
type CustomImageImportsServiceOperations struct {
// contains filtered or unexported fields
}
func (CustomImageImportsServiceOperations) Create ¶
func (s CustomImageImportsServiceOperations) Create(ctx context.Context, createRequest *CustomImageImportRequest) (*CustomImageImport, error)
func (CustomImageImportsServiceOperations) Get ¶
func (s CustomImageImportsServiceOperations) Get(ctx context.Context, CustomImageImportID string) (*CustomImageImport, error)
func (CustomImageImportsServiceOperations) List ¶
func (s CustomImageImportsServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]CustomImageImport, error)
type CustomImageRequest ¶
type CustomImageRequest struct {
TaggedResourceRequest
Name string `json:"name,omitempty"`
Slug string `json:"slug,omitempty"`
UserDataHandling string `json:"user_data_handling,omitempty"`
}
type CustomImageService ¶
type CustomImageService interface {
Get(ctx context.Context, CustomImageID string) (*CustomImage, error)
List(ctx context.Context, modifiers ...ListRequestModifier) ([]CustomImage, error)
Update(ctx context.Context, customImageID string, updateRequest *CustomImageRequest) error
Delete(ctx context.Context, customImageID string) error
}
type CustomImageServiceOperations ¶
type CustomImageServiceOperations struct {
// contains filtered or unexported fields
}
func (CustomImageServiceOperations) Delete ¶
func (s CustomImageServiceOperations) Delete(ctx context.Context, customImageID string) error
func (CustomImageServiceOperations) Get ¶
func (s CustomImageServiceOperations) Get(ctx context.Context, customImageID string) (*CustomImage, error)
func (CustomImageServiceOperations) List ¶
func (s CustomImageServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]CustomImage, error)
func (CustomImageServiceOperations) Update ¶
func (s CustomImageServiceOperations) Update(ctx context.Context, customImageID string, updateRequest *CustomImageRequest) error
type CustomImageStub ¶
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type FloatingIP ¶
type FloatingIP struct {
Region *Region `json:"region"` // not using RegionalResource here, as FloatingIP can be regional or global
TaggedResource
HREF string `json:"href"`
Network string `json:"network"`
IPVersion int `json:"ip_version"`
NextHop string `json:"next_hop"`
Server *ServerStub `json:"server"`
Type string `json:"type"`
ReversePointer string `json:"reverse_ptr,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
func (FloatingIP) IP ¶
func (f FloatingIP) IP() string
func (FloatingIP) PrefixLength ¶
func (f FloatingIP) PrefixLength() int
type FloatingIPCreateRequest ¶
type FloatingIPCreateRequest struct {
RegionalResourceRequest
TaggedResourceRequest
IPVersion int `json:"ip_version"`
Server string `json:"server,omitempty"`
Type string `json:"type,omitempty"`
PrefixLength int `json:"prefix_length,omitempty"`
ReversePointer string `json:"reverse_ptr,omitempty"`
}
type FloatingIPUpdateRequest ¶
type FloatingIPUpdateRequest struct {
TaggedResourceRequest
Server string `json:"server,omitempty"`
ReversePointer string `json:"reverse_ptr,omitempty"`
}
type FloatingIPsService ¶
type FloatingIPsService interface {
Create(ctx context.Context, floatingIPRequest *FloatingIPCreateRequest) (*FloatingIP, error)
Get(ctx context.Context, ip string) (*FloatingIP, error)
Update(ctx context.Context, ip string, FloatingIPRequest *FloatingIPUpdateRequest) error
Delete(ctx context.Context, ip string) error
List(ctx context.Context, modifiers ...ListRequestModifier) ([]FloatingIP, error)
}
type FloatingIPsServiceOperations ¶
type FloatingIPsServiceOperations struct {
// contains filtered or unexported fields
}
func (FloatingIPsServiceOperations) Create ¶
func (f FloatingIPsServiceOperations) Create(ctx context.Context, floatingIPRequest *FloatingIPCreateRequest) (*FloatingIP, error)
func (FloatingIPsServiceOperations) Delete ¶
func (f FloatingIPsServiceOperations) Delete(ctx context.Context, ip string) error
func (FloatingIPsServiceOperations) Get ¶
func (f FloatingIPsServiceOperations) Get(ctx context.Context, ip string) (*FloatingIP, error)
func (FloatingIPsServiceOperations) List ¶
func (f FloatingIPsServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]FloatingIP, error)
func (FloatingIPsServiceOperations) Update ¶
func (f FloatingIPsServiceOperations) Update(ctx context.Context, ip string, floatingIPUpdateRequest *FloatingIPUpdateRequest) error
type Interface ¶
type Interface struct {
Type string `json:"type,omitempty"`
Network NetworkStub `json:"network,omitempty"`
Addresses []Address `json:"addresses,omitempty"`
}
type InterfaceRequest ¶
type InterfaceRequest struct {
Network string `json:"network,omitempty"`
Addresses *[]AddressRequest `json:"addresses,omitempty"`
}
type ListRequestModifier ¶
func WithNameFilter ¶
func WithNameFilter(name string) ListRequestModifier
WithNameFilter uses an undocumented feature of the cloudscale.ch API
func WithTagFilter ¶
func WithTagFilter(tags TagMap) ListRequestModifier
type MetadataClient ¶
Client to interact with cloudscale.ch's OpenStack metadata API, from inside a server.
func NewMetadataClient ¶
func NewMetadataClient(httpClient *http.Client) *MetadataClient
NewClient creates a client for the metadata API.
func (*MetadataClient) GetMetadata ¶
func (c *MetadataClient) GetMetadata() (*Metadata, error)
Metadata contains the entire contents of a OpenStack's metadata. This method is unique because it returns all of the metadata at once, instead of individual metadata items.
func (*MetadataClient) GetRawUserData ¶
func (c *MetadataClient) GetRawUserData() (string, error)
RawUserData returns the user data that was provided by the user during Server creation. User data for cloudscale.ch is a YAML Script that is used for cloud-init.
func (*MetadataClient) GetServerID ¶
func (c *MetadataClient) GetServerID() (string, error)
ServerID returns the Server's unique identifier. This is automatically generated upon Server creation.
type MetricsService ¶
type MetricsService interface {
GetBucketMetrics(ctx context.Context, request *BucketMetricsRequest) (*BucketMetrics, error)
}
type MetricsServiceOperations ¶
type MetricsServiceOperations struct {
// contains filtered or unexported fields
}
func (MetricsServiceOperations) GetBucketMetrics ¶
func (s MetricsServiceOperations) GetBucketMetrics(ctx context.Context, request *BucketMetricsRequest) (*BucketMetrics, error)
type Network ¶
type Network struct {
ZonalResource
TaggedResource
// Just use omitempty everywhere. This makes it easy to use restful. Errors
// will be coming from the API if something is disabled.
HREF string `json:"href,omitempty"`
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
MTU int `json:"mtu,omitempty"`
Subnets []SubnetStub `json:"subnets"`
CreatedAt time.Time `json:"created_at"`
}
type NetworkCreateRequest ¶
type NetworkCreateRequest struct {
ZonalResourceRequest
TaggedResourceRequest
Name string `json:"name,omitempty"`
MTU int `json:"mtu,omitempty"`
AutoCreateIPV4Subnet *bool `json:"auto_create_ipv4_subnet,omitempty"`
}
type NetworkService ¶
type NetworkService interface {
Create(ctx context.Context, createRequest *NetworkCreateRequest) (*Network, error)
Get(ctx context.Context, networkID string) (*Network, error)
List(ctx context.Context, modifiers ...ListRequestModifier) ([]Network, error)
Update(ctx context.Context, networkID string, updateRequest *NetworkUpdateRequest) error
Delete(ctx context.Context, networkID string) error
}
type NetworkServiceOperations ¶
type NetworkServiceOperations struct {
// contains filtered or unexported fields
}
func (NetworkServiceOperations) Create ¶
func (s NetworkServiceOperations) Create(ctx context.Context, createRequest *NetworkCreateRequest) (*Network, error)
func (NetworkServiceOperations) Delete ¶
func (s NetworkServiceOperations) Delete(ctx context.Context, networkID string) error
func (NetworkServiceOperations) List ¶
func (s NetworkServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]Network, error)
func (NetworkServiceOperations) Update ¶
func (f NetworkServiceOperations) Update(ctx context.Context, networkID string, updateRequest *NetworkUpdateRequest) error
type NetworkStub ¶
type NetworkUpdateRequest ¶
type NetworkUpdateRequest struct {
ZonalResourceRequest
TaggedResourceRequest
Name string `json:"name,omitempty"`
MTU int `json:"mtu,omitempty"`
}
type ObjectsUser ¶
type ObjectsUser struct {
TaggedResource
HREF string `json:"href,omitempty"`
ID string `json:"id,omitempty"`
DisplayName string `json:"display_name,omitempty"`
Keys []map[string]string `json:"keys,omitempty"`
}
ObjectsUser contains information
type ObjectsUserRequest ¶
type ObjectsUserRequest struct {
TaggedResourceRequest
DisplayName string `json:"display_name,omitempty"`
}
ObjectsUserRequest is used to create and update Objects Users
type ObjectsUsersService ¶
type ObjectsUsersService interface {
Create(ctx context.Context, createRequest *ObjectsUserRequest) (*ObjectsUser, error)
Get(ctx context.Context, objectsUserID string) (*ObjectsUser, error)
Update(ctx context.Context, objectsUserID string, updateRequest *ObjectsUserRequest) error
Delete(ctx context.Context, objectsUserID string) error
List(ctx context.Context, modifiers ...ListRequestModifier) ([]ObjectsUser, error)
}
ObjectsUsersService manages users of the S3-compatible objects storage
type ObjectsUsersServiceOperations ¶
type ObjectsUsersServiceOperations struct {
// contains filtered or unexported fields
}
ObjectsUsersServiceOperations contains config for this service
func (ObjectsUsersServiceOperations) Create ¶
func (s ObjectsUsersServiceOperations) Create(ctx context.Context, createRequest *ObjectsUserRequest) (*ObjectsUser, error)
Create an objects user with the specified attributes.
func (ObjectsUsersServiceOperations) Delete ¶
func (s ObjectsUsersServiceOperations) Delete(ctx context.Context, objectsUserID string) error
Delete an objects user
func (ObjectsUsersServiceOperations) Get ¶
func (s ObjectsUsersServiceOperations) Get(ctx context.Context, objectsUserID string) (*ObjectsUser, error)
Get an objects user by its ID
func (ObjectsUsersServiceOperations) List ¶
func (s ObjectsUsersServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]ObjectsUser, error)
List all objects users
func (ObjectsUsersServiceOperations) Update ¶
func (s ObjectsUsersServiceOperations) Update(ctx context.Context, objectsUserID string, updateRequest *ObjectsUserRequest) error
Update the properties of an objects user
type RegionServiceOperations ¶
type RegionServiceOperations struct {
// contains filtered or unexported fields
}
type RegionalResource ¶
type RegionalResource struct {
Region Region `json:"Region"`
}
type RegionalResourceRequest ¶
type RegionalResourceRequest struct {
Region string `json:"region,omitempty"`
}
type Server ¶
type Server struct {
ZonalResource
TaggedResource
HREF string `json:"href"`
UUID string `json:"uuid"`
Name string `json:"name"`
Status string `json:"status"`
Flavor Flavor `json:"flavor"`
Image Image `json:"image"`
Volumes []VolumeStub `json:"volumes"`
Interfaces []Interface `json:"interfaces"`
SSHFingerprints []string `json:"ssh_fingerprints"`
SSHHostKeys []string `json:"ssh_host_keys"`
AntiAfinityWith []ServerStub `json:"anti_affinity_with"`
ServerGroups []ServerGroupStub `json:"server_groups"`
CreatedAt time.Time `json:"created_at"`
}
type ServerGroup ¶
type ServerGroup struct {
ZonalResource
TaggedResource
HREF string `json:"href"`
UUID string `json:"uuid"`
Name string `json:"name"`
Type string `json:"type"`
Servers []ServerStub `json:"servers"`
}
type ServerGroupRequest ¶
type ServerGroupRequest struct {
ZonalResourceRequest
TaggedResourceRequest
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
}
type ServerGroupService ¶
type ServerGroupService interface {
Create(ctx context.Context, createRequest *ServerGroupRequest) (*ServerGroup, error)
Get(ctx context.Context, serverGroupID string) (*ServerGroup, error)
Update(ctx context.Context, networkID string, updateRequest *ServerGroupRequest) error
Delete(ctx context.Context, serverGroupID string) error
List(ctx context.Context, modifiers ...ListRequestModifier) ([]ServerGroup, error)
}
type ServerGroupServiceOperations ¶
type ServerGroupServiceOperations struct {
// contains filtered or unexported fields
}
func (ServerGroupServiceOperations) Create ¶
func (s ServerGroupServiceOperations) Create(ctx context.Context, createRequest *ServerGroupRequest) (*ServerGroup, error)
func (ServerGroupServiceOperations) Delete ¶
func (s ServerGroupServiceOperations) Delete(ctx context.Context, serverGroupID string) error
func (ServerGroupServiceOperations) Get ¶
func (s ServerGroupServiceOperations) Get(ctx context.Context, serverGroupID string) (*ServerGroup, error)
func (ServerGroupServiceOperations) List ¶
func (s ServerGroupServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]ServerGroup, error)
func (ServerGroupServiceOperations) Update ¶
func (f ServerGroupServiceOperations) Update(ctx context.Context, serverGroupID string, updateRequest *ServerGroupRequest) error
type ServerGroupStub ¶
type ServerRequest ¶
type ServerRequest struct {
ZonalResourceRequest
TaggedResourceRequest
Name string `json:"name"`
Flavor string `json:"flavor"`
Image string `json:"image"`
Zone string `json:"zone,omitempty"`
VolumeSizeGB int `json:"volume_size_gb,omitempty"`
Volumes *[]Volume `json:"volumes,omitempty"`
Interfaces *[]InterfaceRequest `json:"interfaces,omitempty"`
BulkVolumeSizeGB int `json:"bulk_volume_size_gb,omitempty"`
SSHKeys []string `json:"ssh_keys"`
Password string `json:"password,omitempty"`
UsePublicNetwork *bool `json:"use_public_network,omitempty"`
UsePrivateNetwork *bool `json:"use_private_network,omitempty"`
UseIPV6 *bool `json:"use_ipv6,omitempty"`
AntiAffinityWith string `json:"anti_affinity_with,omitempty"`
ServerGroups []string `json:"server_groups,omitempty"`
UserData string `json:"user_data,omitempty"`
}
type ServerService ¶
type ServerService interface {
Create(ctx context.Context, createRequest *ServerRequest) (*Server, error)
Get(ctx context.Context, serverID string) (*Server, error)
Update(ctx context.Context, serverID string, updateRequest *ServerUpdateRequest) error
Delete(ctx context.Context, serverID string) error
List(ctx context.Context, modifiers ...ListRequestModifier) ([]Server, error)
Reboot(ctx context.Context, serverID string) error
Start(ctx context.Context, serverID string) error
Stop(ctx context.Context, serverID string) error
}
type ServerServiceOperations ¶
type ServerServiceOperations struct {
// contains filtered or unexported fields
}
func (ServerServiceOperations) Create ¶
func (s ServerServiceOperations) Create(ctx context.Context, createRequest *ServerRequest) (*Server, error)
func (ServerServiceOperations) Delete ¶
func (s ServerServiceOperations) Delete(ctx context.Context, serverID string) error
func (ServerServiceOperations) List ¶
func (s ServerServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]Server, error)
func (ServerServiceOperations) Reboot ¶
func (s ServerServiceOperations) Reboot(ctx context.Context, serverID string) error
func (ServerServiceOperations) Start ¶
func (s ServerServiceOperations) Start(ctx context.Context, serverID string) error
func (ServerServiceOperations) Stop ¶
func (s ServerServiceOperations) Stop(ctx context.Context, serverID string) error
func (ServerServiceOperations) Update ¶
func (s ServerServiceOperations) Update(ctx context.Context, serverID string, updateRequest *ServerUpdateRequest) error
type ServerStub ¶
type ServerUpdateRequest ¶
type ServerUpdateRequest struct {
TaggedResourceRequest
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
Flavor string `json:"flavor,omitempty"`
Interfaces *[]InterfaceRequest `json:"interfaces,omitempty"`
}
type Subnet ¶
type Subnet struct {
TaggedResource
// Just use omitempty everywhere. This makes it easy to use restful. Errors
// will be coming from the API if something is disabled.
HREF string `json:"href,omitempty"`
UUID string `json:"uuid,omitempty"`
CIDR string `json:"cidr,omitempty"`
Network NetworkStub `json:"network,omitempty"`
GatewayAddress string `json:"gateway_address,omitempty"`
DNSServers []string `json:"dns_servers,omitempty"`
}
type SubnetCreateRequest ¶
type SubnetCreateRequest struct {
TaggedResourceRequest
CIDR string `json:"cidr,omitempty"`
Network string `json:"network,omitempty"`
GatewayAddress string `json:"gateway_address,omitempty"`
DNSServers []string `json:"dns_servers,omitempty"`
}
type SubnetService ¶
type SubnetService interface {
Create(ctx context.Context, createRequest *SubnetCreateRequest) (*Subnet, error)
Get(ctx context.Context, subnetID string) (*Subnet, error)
List(ctx context.Context, modifiers ...ListRequestModifier) ([]Subnet, error)
Update(ctx context.Context, subnetID string, updateRequest *SubnetUpdateRequest) error
Delete(ctx context.Context, subnetID string) error
}
type SubnetServiceOperations ¶
type SubnetServiceOperations struct {
// contains filtered or unexported fields
}
func (SubnetServiceOperations) Create ¶
func (s SubnetServiceOperations) Create(ctx context.Context, createRequest *SubnetCreateRequest) (*Subnet, error)
func (SubnetServiceOperations) Delete ¶
func (s SubnetServiceOperations) Delete(ctx context.Context, subnetID string) error
func (SubnetServiceOperations) List ¶
func (s SubnetServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]Subnet, error)
func (SubnetServiceOperations) Update ¶
func (f SubnetServiceOperations) Update(ctx context.Context, subnetID string, updateRequest *SubnetUpdateRequest) error
type SubnetStub ¶
type SubnetUpdateRequest ¶
type SubnetUpdateRequest struct {
TaggedResourceRequest
GatewayAddress string `json:"gateway_address,omitempty"`
DNSServers []string `json:"dns_servers,omitempty"`
}
type TaggedResource ¶
type TaggedResource struct {
Tags TagMap `json:"tags"`
}
type TaggedResourceRequest ¶
type TaggedResourceRequest struct {
Tags *TagMap `json:"tags,omitempty"`
}
type Volume ¶
type Volume struct {
ZonalResource
TaggedResource
// Just use omitempty everywhere. This makes it easy to use restful. Errors
// will be coming from the API if something is disabled.
HREF string `json:"href,omitempty"`
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
SizeGB int `json:"size_gb,omitempty"`
Type string `json:"type,omitempty"`
ServerUUIDs *[]string `json:"server_uuids,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type VolumeRequest ¶
type VolumeRequest struct {
ZonalResourceRequest
TaggedResourceRequest
Name string `json:"name,omitempty"`
SizeGB int `json:"size_gb,omitempty"`
Type string `json:"type,omitempty"`
ServerUUIDs *[]string `json:"server_uuids,omitempty"`
}
type VolumeService ¶
type VolumeService interface {
Create(ctx context.Context, createRequest *VolumeRequest) (*Volume, error)
Get(ctx context.Context, volumeID string) (*Volume, error)
List(ctx context.Context, modifiers ...ListRequestModifier) ([]Volume, error)
Update(ctx context.Context, volumeID string, updateRequest *VolumeRequest) error
Delete(ctx context.Context, volumeID string) error
}
type VolumeServiceOperations ¶
type VolumeServiceOperations struct {
// contains filtered or unexported fields
}
func (VolumeServiceOperations) Create ¶
func (s VolumeServiceOperations) Create(ctx context.Context, createRequest *VolumeRequest) (*Volume, error)
func (VolumeServiceOperations) Delete ¶
func (s VolumeServiceOperations) Delete(ctx context.Context, volumeID string) error
func (VolumeServiceOperations) List ¶
func (s VolumeServiceOperations) List(ctx context.Context, modifiers ...ListRequestModifier) ([]Volume, error)
func (VolumeServiceOperations) Update ¶
func (f VolumeServiceOperations) Update(ctx context.Context, volumeID string, updateRequest *VolumeRequest) error
type VolumeStub ¶
type ZonalResource ¶
type ZonalResource struct {
Zone Zone `json:"zone"`
}
type ZonalResourceRequest ¶
type ZonalResourceRequest struct {
Zone string `json:"zone,omitempty"`
}