mobilegateway

package
v2.31.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddSIMRequest

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

	SIMID     types.ID `validate:"required"`
	IPAddress string   `validate:"required,ipv4"`
}

func (*AddSIMRequest) Validate

func (req *AddSIMRequest) Validate() error

type AddSIMRouteRequest

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

	SIMID  types.ID `validate:"required"`
	Prefix string   `validate:"required"`
}

func (*AddSIMRouteRequest) Validate

func (req *AddSIMRouteRequest) Validate() error

type ApplyRequest

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

	ID                              types.ID `request:"-"`
	Name                            string   `validate:"required"`
	Description                     string   `validate:"min=0,max=512"`
	Tags                            types.Tags
	IconID                          types.ID
	PrivateInterface                *PrivateInterfaceSetting `validate:"omitempty"`
	StaticRoutes                    []*sacloud.MobileGatewayStaticRoute
	SIMRoutes                       []*SIMRouteSetting
	InternetConnectionEnabled       bool
	InterDeviceCommunicationEnabled bool
	DNS                             *DNSSetting
	SIMs                            []*SIMSetting
	TrafficConfig                   *TrafficConfig

	SettingsHash    string
	BootAfterCreate bool
	NoWait          bool
}

func (*ApplyRequest) Builder added in v2.9.0

func (*ApplyRequest) Validate

func (req *ApplyRequest) Validate() error

type BootRequest

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

	NoWait bool `request:"-"`
}

func (*BootRequest) Validate

func (req *BootRequest) Validate() error

type ConnectToSwitchRequest

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

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

func (*ConnectToSwitchRequest) Validate

func (req *ConnectToSwitchRequest) Validate() error

type CreateRequest

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

	Name                            string `validate:"required"`
	Description                     string `validate:"min=0,max=512"`
	Tags                            types.Tags
	IconID                          types.ID
	PrivateInterface                *PrivateInterfaceSetting `validate:"omitempty"`
	StaticRoutes                    []*sacloud.MobileGatewayStaticRoute
	SIMRoutes                       []*SIMRouteSetting
	InternetConnectionEnabled       bool
	InterDeviceCommunicationEnabled bool
	DNS                             *DNSSetting
	SIMs                            []*SIMSetting
	TrafficConfig                   *TrafficConfig

	NoWait          bool
	BootAfterCreate bool
}

func (*CreateRequest) ApplyRequest added in v2.9.0

func (req *CreateRequest) ApplyRequest() *ApplyRequest

func (*CreateRequest) Validate

func (req *CreateRequest) Validate() error

type DNSSetting added in v2.9.0

type DNSSetting struct {
	DNS1 string `request:",omitempty" validate:"required_with=DNS2,omitempty,ipv4"`
	DNS2 string `request:",omitempty" validate:"required_with=DNS1,omitempty,ipv4"`
}

type DNSSettingUpdate added in v2.9.0

type DNSSettingUpdate struct {
	DNS1 *string `request:",omitempty" validate:"required_with=DNS2,omitempty,ipv4"`
	DNS2 *string `request:",omitempty" validate:"required_with=DNS1,omitempty,ipv4"`
}

type DeleteRequest

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

	FailIfNotFound bool `request:"-"`
	Force          bool `request:"-"` // trueの場合は電源OFF(強制終了)し、SIMルートやSIMの登録を削除してからDeleteする
}

func (*DeleteRequest) Validate

func (req *DeleteRequest) Validate() error

type DeleteSIMRequest

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

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

func (*DeleteSIMRequest) Validate

func (req *DeleteSIMRequest) Validate() error

type DeleteSIMRouteRequest

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

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

func (*DeleteSIMRouteRequest) Validate

func (req *DeleteSIMRouteRequest) Validate() error

type DeleteTrafficConfigRequest

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

func (*DeleteTrafficConfigRequest) Validate

func (req *DeleteTrafficConfigRequest) Validate() error

type DisconnectFromSwitchRequest

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

func (*DisconnectFromSwitchRequest) Validate

func (req *DisconnectFromSwitchRequest) 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 GetDNSRequest

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

func (*GetDNSRequest) Validate

func (req *GetDNSRequest) Validate() error

type GetTrafficConfigRequest

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

func (*GetTrafficConfigRequest) Validate

func (req *GetTrafficConfigRequest) Validate() error

type ListSIMRequest

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

func (*ListSIMRequest) Validate

func (req *ListSIMRequest) Validate() error

type ListSIMRouteRequest

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

func (*ListSIMRouteRequest) Validate

func (req *ListSIMRouteRequest) Validate() error

type LogsRequest

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

func (*LogsRequest) Validate

func (req *LogsRequest) Validate() error

type MonitorInterfaceRequest

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

	Start time.Time
	End   time.Time
	Index int
}

func (*MonitorInterfaceRequest) Validate

func (req *MonitorInterfaceRequest) Validate() error

type PrivateInterfaceSetting

type PrivateInterfaceSetting struct {
	SwitchID       types.ID `request:",omitempty"`
	IPAddress      string   `request:",omitempty" validate:"required,ipv4"`
	NetworkMaskLen int      `request:",omitempty"`
}

PrivateInterfaceSetting represents API parameter/response structure

type PrivateInterfaceSettingUpdate added in v2.9.0

type PrivateInterfaceSettingUpdate struct {
	SwitchID       *types.ID `request:",omitempty"`
	IPAddress      *string   `request:",omitempty" validate:"omitempty,ipv4"`
	NetworkMaskLen *int      `request:",omitempty"`
}

PrivateInterfaceSetting represents API parameter/response structure

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 ResetRequest

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

func (*ResetRequest) Validate

func (req *ResetRequest) Validate() error

type SIMRouteSetting

type SIMRouteSetting struct {
	SIMID  types.ID
	Prefix string `validate:"required"`
}

SIMRouteSetting represents API parameter/response structure

type SIMSetting

type SIMSetting struct {
	SIMID     types.ID
	IPAddress string `validate:"required,ipv4"`
}

SIMSetting represents API parameter/response structure

type Service

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

Service provides a high-level API of for MobileGateway

func New

func New(caller sacloud.APICaller) *Service

New returns new service instance of MobileGateway

func (*Service) AddSIM

func (s *Service) AddSIM(req *AddSIMRequest) error

func (*Service) AddSIMRoute

func (s *Service) AddSIMRoute(req *AddSIMRouteRequest) error

func (*Service) AddSIMRouteWithContext

func (s *Service) AddSIMRouteWithContext(ctx context.Context, req *AddSIMRouteRequest) error

func (*Service) AddSIMWithContext

func (s *Service) AddSIMWithContext(ctx context.Context, req *AddSIMRequest) error

func (*Service) Apply

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

func (*Service) ApplyWithContext

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

func (*Service) Boot

func (s *Service) Boot(req *BootRequest) error

func (*Service) BootWithContext

func (s *Service) BootWithContext(ctx context.Context, req *BootRequest) error

func (*Service) ConnectToSwitch

func (s *Service) ConnectToSwitch(req *ConnectToSwitchRequest) error

func (*Service) ConnectToSwitchWithContext

func (s *Service) ConnectToSwitchWithContext(ctx context.Context, req *ConnectToSwitchRequest) error

func (*Service) Create

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

func (*Service) CreateWithContext

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

func (*Service) Delete

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

func (*Service) DeleteSIM

func (s *Service) DeleteSIM(req *DeleteSIMRequest) error

func (*Service) DeleteSIMRoute

func (s *Service) DeleteSIMRoute(req *DeleteSIMRouteRequest) error

func (*Service) DeleteSIMRouteWithContext

func (s *Service) DeleteSIMRouteWithContext(ctx context.Context, req *DeleteSIMRouteRequest) error

func (*Service) DeleteSIMWithContext

func (s *Service) DeleteSIMWithContext(ctx context.Context, req *DeleteSIMRequest) error

func (*Service) DeleteTrafficConfig

func (s *Service) DeleteTrafficConfig(req *DeleteTrafficConfigRequest) error

func (*Service) DeleteTrafficConfigWithContext

func (s *Service) DeleteTrafficConfigWithContext(ctx context.Context, req *DeleteTrafficConfigRequest) error

func (*Service) DeleteWithContext

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

func (*Service) DisconnectFromSwitch

func (s *Service) DisconnectFromSwitch(req *DisconnectFromSwitchRequest) error

func (*Service) DisconnectFromSwitchWithContext

func (s *Service) DisconnectFromSwitchWithContext(ctx context.Context, req *DisconnectFromSwitchRequest) error

func (*Service) Find

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

func (*Service) FindWithContext

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

func (*Service) GetDNS

func (*Service) GetDNSWithContext

func (s *Service) GetDNSWithContext(ctx context.Context, req *GetDNSRequest) (*sacloud.MobileGatewayDNSSetting, error)

func (*Service) GetTrafficConfig

func (*Service) GetTrafficConfigWithContext

func (s *Service) GetTrafficConfigWithContext(ctx context.Context, req *GetTrafficConfigRequest) (*sacloud.MobileGatewayTrafficControl, error)

func (*Service) ListSIM

func (*Service) ListSIMRoute

func (*Service) ListSIMRouteWithContext

func (s *Service) ListSIMRouteWithContext(ctx context.Context, req *ListSIMRouteRequest) (sacloud.MobileGatewaySIMRoutes, error)

func (*Service) ListSIMWithContext

func (s *Service) ListSIMWithContext(ctx context.Context, req *ListSIMRequest) (sacloud.MobileGatewaySIMs, error)

func (*Service) Logs

func (*Service) LogsWithContext

func (s *Service) LogsWithContext(ctx context.Context, req *LogsRequest) ([]*sacloud.MobileGatewaySIMLogs, error)

func (*Service) MonitorInterface

func (s *Service) MonitorInterface(req *MonitorInterfaceRequest) ([]*sacloud.MonitorInterfaceValue, error)

func (*Service) MonitorInterfaceWithContext

func (s *Service) MonitorInterfaceWithContext(ctx context.Context, req *MonitorInterfaceRequest) ([]*sacloud.MonitorInterfaceValue, error)

func (*Service) Read

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

func (*Service) ReadWithContext

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

func (*Service) Reset

func (s *Service) Reset(req *ResetRequest) error

func (*Service) ResetWithContext

func (s *Service) ResetWithContext(ctx context.Context, req *ResetRequest) error

func (*Service) SetDNS

func (s *Service) SetDNS(req *SetDNSRequest) error

func (*Service) SetDNSWithContext

func (s *Service) SetDNSWithContext(ctx context.Context, req *SetDNSRequest) error

func (*Service) SetTrafficConfig

func (s *Service) SetTrafficConfig(req *SetTrafficConfigRequest) error

func (*Service) SetTrafficConfigWithContext

func (s *Service) SetTrafficConfigWithContext(ctx context.Context, req *SetTrafficConfigRequest) error

func (*Service) Shutdown

func (s *Service) Shutdown(req *ShutdownRequest) error

func (*Service) ShutdownWithContext

func (s *Service) ShutdownWithContext(ctx context.Context, req *ShutdownRequest) error

func (*Service) TrafficStatus

func (*Service) TrafficStatusWithContext

func (s *Service) TrafficStatusWithContext(ctx context.Context, req *TrafficStatusRequest) (*sacloud.MobileGatewayTrafficStatus, error)

func (*Service) Update

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

func (*Service) UpdateSIM

func (s *Service) UpdateSIM(req *UpdateSIMRequest) error

func (*Service) UpdateSIMRoute

func (s *Service) UpdateSIMRoute(req *UpdateSIMRouteRequest) error

func (*Service) UpdateSIMRouteWithContext

func (s *Service) UpdateSIMRouteWithContext(ctx context.Context, req *UpdateSIMRouteRequest) error

func (*Service) UpdateSIMWithContext

func (s *Service) UpdateSIMWithContext(ctx context.Context, req *UpdateSIMRequest) error

func (*Service) UpdateWithContext

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

func (*Service) WaitBoot

func (s *Service) WaitBoot(req *WaitBootRequest) error

func (*Service) WaitBootWithContext

func (s *Service) WaitBootWithContext(ctx context.Context, req *WaitBootRequest) error

func (*Service) WaitShutdown

func (s *Service) WaitShutdown(req *WaitShutdownRequest) error

func (*Service) WaitShutdownWithContext

func (s *Service) WaitShutdownWithContext(ctx context.Context, req *WaitShutdownRequest) error

type SetDNSRequest

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

	DNS1 string `validate:"required,ipv4"`
	DNS2 string `validate:"required,ipv4"`
}

func (*SetDNSRequest) Validate

func (req *SetDNSRequest) Validate() error

type SetTrafficConfigRequest

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

	TrafficQuotaInMB       int
	BandWidthLimitInKbps   int
	EmailNotifyEnabled     bool
	SlackNotifyEnabled     bool
	SlackNotifyWebhooksURL string
	AutoTrafficShaping     bool
}

func (*SetTrafficConfigRequest) Validate

func (req *SetTrafficConfigRequest) Validate() error

type ShutdownRequest

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

	NoWait        bool `request:"-"`
	ForceShutdown bool `request:"-"`
}

func (*ShutdownRequest) Validate

func (req *ShutdownRequest) Validate() error

type TrafficConfig added in v2.9.0

type TrafficConfig struct {
	TrafficQuotaInMB       int    `request:",omitempty"`
	BandWidthLimitInKbps   int    `request:",omitempty"`
	EmailNotifyEnabled     bool   `request:",omitempty"`
	SlackNotifyEnabled     bool   `request:",omitempty"`
	SlackNotifyWebhooksURL string `request:",omitempty"`
	AutoTrafficShaping     bool   `request:",omitempty"`
}

type TrafficConfigUpdate added in v2.9.0

type TrafficConfigUpdate struct {
	TrafficQuotaInMB       *int    `request:",omitempty"`
	BandWidthLimitInKbps   *int    `request:",omitempty"`
	EmailNotifyEnabled     *bool   `request:",omitempty"`
	SlackNotifyEnabled     *bool   `request:",omitempty"`
	SlackNotifyWebhooksURL *string `request:",omitempty"`
	AutoTrafficShaping     *bool   `request:",omitempty"`
}

type TrafficStatusRequest

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

func (*TrafficStatusRequest) Validate

func (req *TrafficStatusRequest) Validate() error

type UpdateRequest

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

	Name                            *string                              `request:",omitempty"`
	Description                     *string                              `request:",omitempty" validate:"omitempty,min=0,max=512"`
	Tags                            *types.Tags                          `request:",omitempty"`
	IconID                          *types.ID                            `request:",omitempty"`
	PrivateInterface                *PrivateInterfaceSettingUpdate       `request:",omitempty,recursive"`
	StaticRoutes                    *[]*sacloud.MobileGatewayStaticRoute `request:",omitempty"`
	SIMRoutes                       *[]*SIMRouteSetting                  `request:",omitempty"`
	InternetConnectionEnabled       *bool                                `request:",omitempty"`
	InterDeviceCommunicationEnabled *bool                                `request:",omitempty"`
	DNS                             *DNSSettingUpdate                    `request:",omitempty,recursive"`
	SIMs                            *[]*SIMSetting                       `request:",omitempty"`
	TrafficConfig                   *TrafficConfigUpdate                 `request:",omitempty,recursive"`

	SettingsHash string
	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 UpdateSIMRequest

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

	SIMID     types.ID `validate:"required"`
	IPAddress string   `validate:"required,ipv4"`
}

func (*UpdateSIMRequest) Validate

func (req *UpdateSIMRequest) Validate() error

type UpdateSIMRouteRequest

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

	SIMID  types.ID `validate:"required"`
	Prefix string   `validate:"required"`
}

func (*UpdateSIMRouteRequest) Validate

func (req *UpdateSIMRouteRequest) Validate() error

type WaitBootRequest

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

func (*WaitBootRequest) Validate

func (req *WaitBootRequest) Validate() error

type WaitShutdownRequest

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

func (*WaitShutdownRequest) Validate

func (req *WaitShutdownRequest) Validate() error

Jump to

Keyboard shortcuts

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