disk

package
v2.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2021 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyRequest

type ApplyRequest struct {
	Zone string   `request:"-" validate:"required"`
	ID   types.ID `request:"-"` // TODO Builderを更新対応させる(変更できない値の場合はエラーにするとか)

	Name            string `validate:"required"`
	Description     string `validate:"min=0,max=512"`
	Tags            types.Tags
	IconID          types.ID
	DiskPlanID      types.ID
	Connection      types.EDiskConnection
	SourceDiskID    types.ID
	SourceArchiveID types.ID
	ServerID        types.ID
	SizeGB          int
	DistantFrom     []types.ID

	OSType        ostype.ArchiveOSType
	EditParameter *EditParameter

	NoWait bool
}

func (*ApplyRequest) Builder

func (req *ApplyRequest) Builder(caller sacloud.APICaller) (diskBuilder.Builder, error)

func (*ApplyRequest) Validate

func (req *ApplyRequest) Validate() error

type ConnectToServerRequest

type ConnectToServerRequest struct {
	Zone string   `request:"-" validate:"required"`
	ID   types.ID `request:"-" validate:"required"`

	ServerID types.ID `validate:"required"`
}

func (*ConnectToServerRequest) Validate

func (req *ConnectToServerRequest) Validate() error

type CreateRequest

type CreateRequest struct {
	Zone string `request:"-" validate:"required"`

	Name            string `validate:"required"`
	Description     string `validate:"min=0,max=512"`
	Tags            types.Tags
	IconID          types.ID
	DiskPlanID      types.ID              `validate:"oneof=4 2"`
	Connection      types.EDiskConnection `validate:"oneof=virtio ide"`
	SourceDiskID    types.ID
	SourceArchiveID types.ID
	ServerID        types.ID
	SizeGB          int `request:"SizeMB,filters=gb_to_mb"`
	DistantFrom     []types.ID
	OSType          ostype.ArchiveOSType
	EditParameter   *EditParameter

	NoWait bool
}

CreateRequest ディスク作成リクエスト

func (*CreateRequest) ApplyRequest added in v2.9.0

func (req *CreateRequest) ApplyRequest() *ApplyRequest

func (*CreateRequest) Validate

func (req *CreateRequest) Validate() error

type DeleteRequest

type DeleteRequest struct {
	Zone string   `request:"-" validate:"required"`
	ID   types.ID `request:"-" validate:"required"`

	FailIfNotFound bool `request:"-"`

	WaitForRelease        bool `request:"-"` // trueの場合、他リソースから参照されている間は削除を待ち合わせし続ける
	WaitForReleaseTimeout int  // WaitForReleaseがtrueの場合の待ち時間タイムアウト(デフォルト:1時間)
	WaitForReleaseTick    int  // WaitForReleaseがtrueの場合の待ち処理のポーリング間隔(デフォルト:5秒)
}

func (*DeleteRequest) Validate

func (req *DeleteRequest) Validate() error

type DisconnectFromServerRequest

type DisconnectFromServerRequest struct {
	Zone string   `request:"-" validate:"required"`
	ID   types.ID `request:"-" validate:"required"`
}

func (*DisconnectFromServerRequest) Validate

func (req *DisconnectFromServerRequest) Validate() error

type EditParameter

type EditParameter struct {
	HostName string
	Password string

	DisablePWAuth       bool
	EnableDHCP          bool
	ChangePartitionUUID bool

	IPAddress      string
	NetworkMaskLen int
	DefaultRoute   string

	SSHKeys   []string
	SSHKeyIDs []types.ID

	// IsSSHKeysEphemeral trueの場合、SSHキーを生成する場合に生成したSSHキーリソースをサーバ作成後に削除する
	IsSSHKeysEphemeral bool

	IsNotesEphemeral bool
	NoteContents     []string
	Notes            []*sacloud.DiskEditNote
}

EditParameter ディスクの修正用パラメータ

type EditRequest added in v2.9.0

type EditRequest struct {
	Zone string   `request:"-" validate:"required"`
	ID   types.ID `request:"-"`

	NoWait bool `request:"-"` // trueの場合ディスクの修正完了まで待たずに即時復帰する

	HostName string
	Password string

	DisablePWAuth       bool
	EnableDHCP          bool
	ChangePartitionUUID bool

	IPAddress      string
	NetworkMaskLen int
	DefaultRoute   string

	SSHKeys   []string
	SSHKeyIDs []types.ID

	Notes []*sacloud.DiskEditNote // スタートアップスクリプトをIDで指定(変数や埋め込むAPIキーを指定可能)
}

func (*EditRequest) ToRequestParameter added in v2.9.0

func (req *EditRequest) ToRequestParameter() (*sacloud.DiskEditRequest, error)

func (*EditRequest) Validate added in v2.9.0

func (req *EditRequest) Validate() error

type FindRequest

type FindRequest struct {
	Zone string `request:"-" validate:"required"`

	Names []string `request:"-"`
	Tags  []string `request:"-"`

	Sort  search.SortKeys
	Count int
	From  int
}

func (*FindRequest) ToRequestParameter

func (req *FindRequest) ToRequestParameter() (*sacloud.FindCondition, error)

func (*FindRequest) Validate

func (req *FindRequest) Validate() error

type MonitorDiskRequest

type MonitorDiskRequest struct {
	Zone string   `request:"-" validate:"required"`
	ID   types.ID `request:"-" validate:"required"`

	Start time.Time
	End   time.Time
}

func (*MonitorDiskRequest) Validate

func (req *MonitorDiskRequest) Validate() error

type ReadRequest

type ReadRequest struct {
	Zone string   `request:"-" validate:"required"`
	ID   types.ID `request:"-" validate:"required"`
}

func (*ReadRequest) Validate

func (req *ReadRequest) Validate() error

type ResizePartitionRequest

type ResizePartitionRequest struct {
	Zone string   `request:"-" validate:"required"`
	ID   types.ID `request:"-" validate:"required"`
}

func (*ResizePartitionRequest) Validate

func (req *ResizePartitionRequest) Validate() error

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides a high-level API of for Disk

func New

func New(caller sacloud.APICaller) *Service

New returns new service instance of Disk

func (*Service) Apply

func (s *Service) Apply(req *ApplyRequest) (*sacloud.Disk, error)

func (*Service) ApplyWithContext

func (s *Service) ApplyWithContext(ctx context.Context, req *ApplyRequest) (*sacloud.Disk, error)

func (*Service) ConnectToServer

func (s *Service) ConnectToServer(req *ConnectToServerRequest) error

func (*Service) ConnectToServerWithContext

func (s *Service) ConnectToServerWithContext(ctx context.Context, req *ConnectToServerRequest) error

func (*Service) Create

func (s *Service) Create(req *CreateRequest) (*sacloud.Disk, error)

func (*Service) CreateWithContext

func (s *Service) CreateWithContext(ctx context.Context, req *CreateRequest) (*sacloud.Disk, error)

func (*Service) Delete

func (s *Service) Delete(req *DeleteRequest) error

func (*Service) DeleteWithContext

func (s *Service) DeleteWithContext(ctx context.Context, req *DeleteRequest) error

func (*Service) DisconnectFromServer

func (s *Service) DisconnectFromServer(req *DisconnectFromServerRequest) error

func (*Service) DisconnectFromServerWithContext

func (s *Service) DisconnectFromServerWithContext(ctx context.Context, req *DisconnectFromServerRequest) error

func (*Service) Edit added in v2.9.0

func (s *Service) Edit(req *EditRequest) error

func (*Service) EditWithContext added in v2.9.0

func (s *Service) EditWithContext(ctx context.Context, req *EditRequest) error

func (*Service) Find

func (s *Service) Find(req *FindRequest) ([]*sacloud.Disk, error)

func (*Service) FindWithContext

func (s *Service) FindWithContext(ctx context.Context, req *FindRequest) ([]*sacloud.Disk, error)

func (*Service) MonitorDisk

func (s *Service) MonitorDisk(req *MonitorDiskRequest) ([]*sacloud.MonitorDiskValue, error)

func (*Service) MonitorDiskWithContext

func (s *Service) MonitorDiskWithContext(ctx context.Context, req *MonitorDiskRequest) ([]*sacloud.MonitorDiskValue, error)

func (*Service) Read

func (s *Service) Read(req *ReadRequest) (*sacloud.Disk, error)

func (*Service) ReadWithContext

func (s *Service) ReadWithContext(ctx context.Context, req *ReadRequest) (*sacloud.Disk, error)

func (*Service) ResizePartition

func (s *Service) ResizePartition(req *ResizePartitionRequest) error

func (*Service) ResizePartitionWithContext

func (s *Service) ResizePartitionWithContext(ctx context.Context, req *ResizePartitionRequest) error

func (*Service) Update

func (s *Service) Update(req *UpdateRequest) (*sacloud.Disk, error)

func (*Service) UpdateWithContext

func (s *Service) UpdateWithContext(ctx context.Context, req *UpdateRequest) (*sacloud.Disk, error)

func (*Service) WaitReady

func (s *Service) WaitReady(req *WaitReadyRequest) error

func (*Service) WaitReadyWithContext

func (s *Service) WaitReadyWithContext(ctx context.Context, req *WaitReadyRequest) error

type UpdateRequest

type UpdateRequest struct {
	Zone string   `request:"-" validate:"required"`
	ID   types.ID `request:"-" validate:"required"`

	Name          *string                `request:",omitempty" validate:"omitempty,min=1"`
	Description   *string                `request:",omitempty" validate:"omitempty,min=1,max=512"`
	Tags          *types.Tags            `request:",omitempty"`
	IconID        *types.ID              `request:",omitempty"`
	Connection    *types.EDiskConnection `request:",omitempty"`
	EditParameter *EditParameter         `request:",omitempty"`

	NoWait bool
}

func (*UpdateRequest) ApplyRequest added in v2.9.0

func (req *UpdateRequest) ApplyRequest(ctx context.Context, caller sacloud.APICaller) (*ApplyRequest, error)

func (*UpdateRequest) Validate

func (req *UpdateRequest) Validate() error

type WaitReadyRequest

type WaitReadyRequest struct {
	Zone string   `request:"-" validate:"required"`
	ID   types.ID `request:"-" validate:"required"`
}

func (*WaitReadyRequest) Validate

func (req *WaitReadyRequest) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL