Documentation ¶
Index ¶
- func FormatSSHKeyToTag(publicKey string) string
- func GetCommands() *core.Commands
- func GetGeneratedCommands() *core.Commands
- func SizeValue(s *scw.Size) scw.Size
- type PostServerCreationSetupFunc
- type SSHKeyFormat
- type ServerBuilder
- func (sb *ServerBuilder) AddAdminPasswordEncryptionSSHKeyID(adminPasswordEncryptionSSHKeyID *string) *ServerBuilder
- func (sb *ServerBuilder) AddBootType(bootType string) *ServerBuilder
- func (sb *ServerBuilder) AddDynamicIPRequired(dynamicIPRequired *bool) *ServerBuilder
- func (sb *ServerBuilder) AddEnableIPv6(enableIPv6 *bool) *ServerBuilder
- func (sb *ServerBuilder) AddIP(ip string) (*ServerBuilder, error)
- func (sb *ServerBuilder) AddImage(image string) (*ServerBuilder, error)
- func (sb *ServerBuilder) AddOrganizationID(orgID *string) *ServerBuilder
- func (sb *ServerBuilder) AddPlacementGroup(placementGroupID string) *ServerBuilder
- func (sb *ServerBuilder) AddProjectID(projectID *string) *ServerBuilder
- func (sb *ServerBuilder) AddRoutedIPEnabled(routedIPEnabled *bool) *ServerBuilder
- func (sb *ServerBuilder) AddSecurityGroup(securityGroupID string) *ServerBuilder
- func (sb *ServerBuilder) AddTags(tags []string) *ServerBuilder
- func (sb *ServerBuilder) AddVolumes(rootVolume string, additionalVolumes []string) (*ServerBuilder, error)
- func (sb *ServerBuilder) Build() (*instance.CreateServerRequest, []*instance.CreateIPRequest)
- func (sb *ServerBuilder) BuildPostCreationSetup() PostServerCreationSetupFunc
- func (sb *ServerBuilder) Validate() error
- func (sb *ServerBuilder) ValidateVolumes() error
- type ServerGetRdpPasswordResponse
- type VolumeBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatSSHKeyToTag ¶ added in v2.28.0
func GetCommands ¶
GetCommands returns instance commands.
This function: - Gets the generated commands - Register handwritten marshalers - Apply handwritten overrides (of Command.Run and Command.View) - Merge handwritten commands
func GetGeneratedCommands ¶
Types ¶
type PostServerCreationSetupFunc ¶ added in v2.35.0
type SSHKeyFormat ¶ added in v2.16.0
type ServerBuilder ¶ added in v2.33.0
type ServerBuilder struct {
// contains filtered or unexported fields
}
func NewServerBuilder ¶ added in v2.33.0
func NewServerBuilder(client *scw.Client, name string, zone scw.Zone, commercialType string) *ServerBuilder
NewServerBuilder creates a new builder for a server with requested commercialType in given zone. commercialType will be used to validate that added components are supported.
func (*ServerBuilder) AddAdminPasswordEncryptionSSHKeyID ¶ added in v2.33.0
func (sb *ServerBuilder) AddAdminPasswordEncryptionSSHKeyID(adminPasswordEncryptionSSHKeyID *string) *ServerBuilder
func (*ServerBuilder) AddBootType ¶ added in v2.33.0
func (sb *ServerBuilder) AddBootType(bootType string) *ServerBuilder
func (*ServerBuilder) AddDynamicIPRequired ¶ added in v2.35.0
func (sb *ServerBuilder) AddDynamicIPRequired(dynamicIPRequired *bool) *ServerBuilder
func (*ServerBuilder) AddEnableIPv6 ¶ added in v2.33.0
func (sb *ServerBuilder) AddEnableIPv6(enableIPv6 *bool) *ServerBuilder
func (*ServerBuilder) AddIP ¶ added in v2.33.0
func (sb *ServerBuilder) AddIP(ip string) (*ServerBuilder, error)
AddIP takes an ip argument and change requests accordingly. ip could be:
- "new"
- A flexible IP UUID
- A flexible IP address
- "dynamic"
- "none"
func (*ServerBuilder) AddImage ¶ added in v2.33.0
func (sb *ServerBuilder) AddImage(image string) (*ServerBuilder, error)
AddImage handle a custom image argument. image could be:
- A local image UUID.
- An image label.
func (*ServerBuilder) AddOrganizationID ¶ added in v2.33.0
func (sb *ServerBuilder) AddOrganizationID(orgID *string) *ServerBuilder
func (*ServerBuilder) AddPlacementGroup ¶ added in v2.33.0
func (sb *ServerBuilder) AddPlacementGroup(placementGroupID string) *ServerBuilder
func (*ServerBuilder) AddProjectID ¶ added in v2.33.0
func (sb *ServerBuilder) AddProjectID(projectID *string) *ServerBuilder
func (*ServerBuilder) AddRoutedIPEnabled ¶ added in v2.33.0
func (sb *ServerBuilder) AddRoutedIPEnabled(routedIPEnabled *bool) *ServerBuilder
func (*ServerBuilder) AddSecurityGroup ¶ added in v2.33.0
func (sb *ServerBuilder) AddSecurityGroup(securityGroupID string) *ServerBuilder
func (*ServerBuilder) AddTags ¶ added in v2.33.0
func (sb *ServerBuilder) AddTags(tags []string) *ServerBuilder
func (*ServerBuilder) AddVolumes ¶ added in v2.33.0
func (sb *ServerBuilder) AddVolumes(rootVolume string, additionalVolumes []string) (*ServerBuilder, error)
AddVolumes build volume templates from arguments.
More format details in buildVolumeTemplate function.
Also add default volumes to server, ex: scratch storage for GPU servers
func (*ServerBuilder) Build ¶ added in v2.33.0
func (sb *ServerBuilder) Build() (*instance.CreateServerRequest, []*instance.CreateIPRequest)
func (*ServerBuilder) BuildPostCreationSetup ¶ added in v2.35.0
func (sb *ServerBuilder) BuildPostCreationSetup() PostServerCreationSetupFunc
func (*ServerBuilder) Validate ¶ added in v2.33.0
func (sb *ServerBuilder) Validate() error
func (*ServerBuilder) ValidateVolumes ¶ added in v2.33.0
func (sb *ServerBuilder) ValidateVolumes() error
ValidateVolumes validates that the volumes are valid and sanitize the prepared template. Server creation should fail if ValidateVolumes is not ran before.
type ServerGetRdpPasswordResponse ¶ added in v2.31.0
type VolumeBuilder ¶ added in v2.35.0
type VolumeBuilder struct { Zone scw.Zone VolumeType instance.VolumeVolumeType // SnapshotID is the ID of the snapshot the volume should be created from. SnapshotID *string // VolumeID is the ID of the volume if one should be imported. VolumeID *string // Size is the size of the created Volume. If used, the volume should be created from scratch. Size *scw.Size // IOPS is the io per second to be configured for a created volume. IOPS *uint32 }
func NewVolumeBuilder ¶ added in v2.35.0
func NewVolumeBuilder(zone scw.Zone, flagV string) (*VolumeBuilder, error)
NewVolumeBuilder creates a volume builder from a 'volumes' argument item.
Volumes definition must be through multiple arguments (eg: volumes.0="l:20GB" volumes.1="b:100GB" volumes.2="sbs:50GB:15000)
A valid volume format is either - a "creation" format: ^((local|l|block|b|scratch|s|sbs):)?\d+GB?(:\d+)?$ (size is handled by go-humanize, so other sizes are supported) - a "creation" format with a snapshot id: l:<uuid> b:<uuid> - a UUID format
func (*VolumeBuilder) BuildVolumeServerTemplate ¶ added in v2.35.0
func (vb *VolumeBuilder) BuildVolumeServerTemplate(apiInstance *instance.API, apiBlock *block.API) (*instance.VolumeServerTemplate, error)
BuildVolumeServerTemplate builds the requested volume template to be used in a CreateServerRequest
func (*VolumeBuilder) ExecutePostCreationSetup ¶ added in v2.35.0
func (vb *VolumeBuilder) ExecutePostCreationSetup(ctx context.Context, apiBlock *block.API, volumeID string)
ExecutePostCreationSetup executes requests that are required after volume creation.
Source Files ¶
- args.go
- custom.go
- custom_image.go
- custom_ip.go
- custom_placement_group.go
- custom_privatenics.go
- custom_security_group.go
- custom_server.go
- custom_server_action.go
- custom_server_console.go
- custom_server_create.go
- custom_server_create_builder.go
- custom_server_rdp.go
- custom_server_ssh.go
- custom_server_type.go
- custom_snapshot.go
- custom_ssh_config.go
- custom_ssh_key.go
- custom_user_data.go
- custom_volume.go
- custom_volume_type.go
- custom_web.go
- helpers_types.go
- instance_cli.go