disk

package
v2.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 13 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
}

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
	DistantFrom     []types.ID
	OSType          ostype.ArchiveOSType
}

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

func (*CreateRequest) ToRequestParameter

func (req *CreateRequest) ToRequestParameter(ctx context.Context, caller sacloud.APICaller) (*sacloud.DiskCreateRequest, error)

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:"-"`
}

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
	// GenerateSSHKeyName 設定されていた場合、クラウドAPIを用いてキーペアを生成する。
	GenerateSSHKeyName        string
	GenerateSSHKeyPassPhrase  string
	GenerateSSHKeyDescription string

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

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

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 ReinstallFromArchiveRequest

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

	OSType          ostype.ArchiveOSType
	SourceArchiveID types.ID
	EditParameter   *sacloud.DiskEditRequest
	DistantFrom     []types.ID
}

func (*ReinstallFromArchiveRequest) Validate

func (req *ReinstallFromArchiveRequest) Validate() error

type ReinstallFromBlankRequest

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

	DistantFrom []types.ID
}

func (*ReinstallFromBlankRequest) Validate

func (req *ReinstallFromBlankRequest) Validate() error

type ReinstallFromDiskRequest

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

	OSType        ostype.ArchiveOSType
	SourceDiskID  types.ID
	EditParameter *sacloud.DiskEditRequest
	DistantFrom   []types.ID
}

func (*ReinstallFromDiskRequest) Validate

func (req *ReinstallFromDiskRequest) 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 (*Service) ApplyWithContext

func (s *Service) ApplyWithContext(ctx context.Context, req *ApplyRequest) (*sacloud.Disk, *sacloud.SSHKeyGenerated, 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) 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) ReinstallFromArchive

func (s *Service) ReinstallFromArchive(req *ReinstallFromArchiveRequest) (*sacloud.Disk, error)

func (*Service) ReinstallFromArchiveWithContext

func (s *Service) ReinstallFromArchiveWithContext(ctx context.Context, req *ReinstallFromArchiveRequest) (*sacloud.Disk, error)

func (*Service) ReinstallFromBlank

func (s *Service) ReinstallFromBlank(req *ReinstallFromBlankRequest) (*sacloud.Disk, error)

func (*Service) ReinstallFromBlankWithContext

func (s *Service) ReinstallFromBlankWithContext(ctx context.Context, req *ReinstallFromBlankRequest) (*sacloud.Disk, error)

func (*Service) ReinstallFromDisk

func (s *Service) ReinstallFromDisk(req *ReinstallFromDiskRequest) (*sacloud.Disk, error)

func (*Service) ReinstallFromDiskWithContext

func (s *Service) ReinstallFromDiskWithContext(ctx context.Context, req *ReinstallFromDiskRequest) (*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"`
}

func (*UpdateRequest) ToRequestParameter

func (req *UpdateRequest) ToRequestParameter(current *sacloud.Disk) (*sacloud.DiskUpdateRequest, 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