internet

package
v2.30.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddSubnetRequest

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

	NetworkMaskLen int    `validate:"required,min=24,max=28"`
	NextHop        string `validate:"required,ipv4"`
}

func (*AddSubnetRequest) ToRequestParameter

func (req *AddSubnetRequest) ToRequestParameter(current *sacloud.Internet) (*sacloud.InternetAddSubnetRequest, error)

func (*AddSubnetRequest) Validate

func (req *AddSubnetRequest) 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
	NetworkMaskLen int
	BandWidthMbps  int
	EnableIPv6     bool
	NoWait         bool
	NotFoundRetry  int // スイッチ+ルータは作成直後だと404を返すことがあることへの対応でリトライする際のリトライ上限回数、省略時はDefaultNotFoundRetry
}

func (*CreateRequest) Builder added in v2.9.0

func (req *CreateRequest) Builder(caller sacloud.APICaller) *internetBuilder.Builder

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:"-"`
	Force          bool `request:"-"` // trueの場合IPv6やサブネットも一緒に削除する(falseの場合これらがあるとDeleteでエラーとなる)
}

func (*DeleteRequest) Validate

func (req *DeleteRequest) Validate() error

type DeleteSubnetRequest

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

	FailIfNotFound bool     `request:"-"`
	SubnetID       types.ID `validate:"required"`
}

func (*DeleteSubnetRequest) Validate

func (req *DeleteSubnetRequest) Validate() error

type DisableIPv6Request

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

func (*DisableIPv6Request) Validate

func (req *DisableIPv6Request) Validate() error

type EnableIPv6Request

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

func (*EnableIPv6Request) Validate

func (req *EnableIPv6Request) Validate() error

type FindRequest

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

	Names       []string `request:"-"`
	Tags        []string `request:"-"`
	SwitchIDs   []string `request:"-"`
	SwitchNames []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 ListSubnetRequest

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

func (*ListSubnetRequest) Validate

func (req *ListSubnetRequest) Validate() error

type MonitorRouterRequest

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

	Start time.Time
	End   time.Time
}

func (*MonitorRouterRequest) Validate

func (req *MonitorRouterRequest) Validate() error

type ReadIPv6Request

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

func (*ReadIPv6Request) Validate

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

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

Service provides a high-level API of for Internet

func New

func New(caller sacloud.APICaller) *Service

New returns new service instance of Internet

func (*Service) AddSubnet

func (s *Service) AddSubnet(req *AddSubnetRequest) (*sacloud.Subnet, error)

func (*Service) AddSubnetWithContext

func (s *Service) AddSubnetWithContext(ctx context.Context, req *AddSubnetRequest) (*sacloud.Subnet, error)

func (*Service) Create

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

func (*Service) CreateWithContext

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

func (*Service) Delete

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

func (*Service) DeleteSubnet

func (s *Service) DeleteSubnet(req *DeleteSubnetRequest) error

func (*Service) DeleteSubnetWithContext

func (s *Service) DeleteSubnetWithContext(ctx context.Context, req *DeleteSubnetRequest) error

func (*Service) DeleteWithContext

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

func (*Service) DisableIPv6

func (s *Service) DisableIPv6(req *DisableIPv6Request) error

func (*Service) DisableIPv6WithContext

func (s *Service) DisableIPv6WithContext(ctx context.Context, req *DisableIPv6Request) error

func (*Service) EnableIPv6

func (s *Service) EnableIPv6(req *EnableIPv6Request) (*sacloud.IPv6Net, error)

func (*Service) EnableIPv6WithContext

func (s *Service) EnableIPv6WithContext(ctx context.Context, req *EnableIPv6Request) (*sacloud.IPv6Net, error)

func (*Service) Find

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

func (*Service) FindWithContext

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

func (*Service) ListSubnet

func (s *Service) ListSubnet(req *ListSubnetRequest) ([]*sacloud.Subnet, error)

func (*Service) ListSubnetWithContext

func (s *Service) ListSubnetWithContext(ctx context.Context, req *ListSubnetRequest) ([]*sacloud.Subnet, error)

func (*Service) MonitorRouter

func (s *Service) MonitorRouter(req *MonitorRouterRequest) ([]*sacloud.MonitorRouterValue, error)

func (*Service) MonitorRouterWithContext

func (s *Service) MonitorRouterWithContext(ctx context.Context, req *MonitorRouterRequest) ([]*sacloud.MonitorRouterValue, error)

func (*Service) Read

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

func (*Service) ReadIPv6

func (s *Service) ReadIPv6(req *ReadIPv6Request) (*sacloud.IPv6Net, error)

func (*Service) ReadIPv6WithContext

func (s *Service) ReadIPv6WithContext(ctx context.Context, req *ReadIPv6Request) (*sacloud.IPv6Net, error)

func (*Service) ReadWithContext

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

func (*Service) Update

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

func (*Service) UpdateSubnet

func (s *Service) UpdateSubnet(req *UpdateSubnetRequest) (*sacloud.Subnet, error)

func (*Service) UpdateSubnetWithContext

func (s *Service) UpdateSubnetWithContext(ctx context.Context, req *UpdateSubnetRequest) (*sacloud.Subnet, error)

func (*Service) UpdateWithContext

func (s *Service) UpdateWithContext(ctx context.Context, req *UpdateRequest) (*sacloud.Internet, 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"`
	BandWidthMbps *int        `request:",omitempty"`
	EnableIPv6    *bool       `request:",omitempty"`
}

func (*UpdateRequest) Builder added in v2.9.0

func (*UpdateRequest) Validate

func (req *UpdateRequest) Validate() error

type UpdateSubnetRequest

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

	SubnetID types.ID `validate:"required"`
	NextHop  string   `validate:"required,ipv4"`
}

func (*UpdateSubnetRequest) ToRequestParameter

func (req *UpdateSubnetRequest) ToRequestParameter(current *sacloud.Internet) (*sacloud.InternetUpdateSubnetRequest, error)

func (*UpdateSubnetRequest) Validate

func (req *UpdateSubnetRequest) Validate() error

Jump to

Keyboard shortcuts

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