extnet

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

API Actor for configure and use external networks

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessAddRequest

type AccessAddRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`

	// Account ID
	// Required: true
	AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
}

Request struct for grant access

type AccessRemoveRequest

type AccessRemoveRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`

	// Account ID
	// Required: true
	AccountID uint64 `url:"accountId" json:"accountId" validate:"required"`
}

Request struct for remove access

type CreateRequest

type CreateRequest struct {
	// External network name
	// Required: true
	Name string `url:"name" json:"name" validate:"required"`

	// Grid (platform) ID
	// Required: true
	GID uint64 `url:"gid" json:"gid" validate:"required"`

	// IP network CIDR
	// For example 192.168.0.0/24
	// Required: true
	IPCIDR string `url:"ipcidr" json:"ipcidr" validate:"required"`

	// External network gateway IP address
	// Required: true
	Gateway string `url:"gateway" json:"gateway" validate:"required"`

	// VLAN ID
	// Required: true
	VLANID uint64 `url:"vlanId" json:"vlanId" validate:"required"`

	// List of DNS addresses
	// Required: false
	DNS []string `url:"dns,omitempty" json:"dns,omitempty"`

	// List of NTP addresses
	// Required: false
	NTP []string `url:"ntp,omitempty" json:"ntp,omitempty"`

	// IPs to check network availability
	// Required: false
	CheckIPs []string `url:"checkIps,omitempty" json:"checkIps,omitempty"`

	// If true - platform DHCP server will not be created
	// Required: false
	Virtual bool `url:"virtual,omitempty" json:"virtual,omitempty"`

	// Optional description
	// Required: false
	Description string `url:"desc,omitempty" json:"desc,omitempty"`

	// Start of IP range to be explicitly included
	// Required: false
	StartIP string `url:"startIP,omitempty" json:"startIP,omitempty"`

	// End of IP range to be explicitly included
	// Required: false
	EndIP string `url:"endIP,omitempty" json:"endIP,omitempty"`

	// IP to create VNFDev with
	// Required: false
	VNFDevIP string `url:"vnfdevIP,omitempty" json:"vnfdevIP,omitempty"`

	// Number of pre created reservations
	// Required: false
	PreReservationsNum uint64 `url:"preReservationsNum,omitempty" json:"preReservationsNum,omitempty"`

	// OpenvSwith bridge name for ExtNet connection
	// Required: false
	OVSBridge string `url:"ovsBridge,omitempty" json:"ovsBridge,omitempty"`
}

Request struct for create external network

type DNSApplyRequest

type DNSApplyRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`

	// List of DNS to apply
	// Required: false
	DNSList []string `url:"dns_list,omitempty" json:"dns_list,omitempty"`
}

Request struct for set new DNS

type DefaultQOSUpdateRequest

type DefaultQOSUpdateRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`

	// Internal traffic, kbit
	// Required: false
	IngressRate uint64 `url:"ingress_rate,omitempty" json:"ingress_rate,omitempty"`

	// Internal traffic burst, kbit
	// Required: false
	IngressBurst uint64 `url:"ingress_burst,omitempty" json:"ingress_burst,omitempty"`

	// External traffic rate, kbit
	// Required: false
	EgressRate uint64 `url:"egress_rate,omitempty" json:"egress_rate,omitempty"`
}

Request struct for update QOS

type DestroyRequest

type DestroyRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
}

Request struct for destroy

type DeviceDeployRequest

type DeviceDeployRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
}

Request struct for deploy network device

type DeviceMigrateRequest

type DeviceMigrateRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`

	// Target stack ID to migrate to
	StackID uint64 `url:"stackId" json:"stackId" validate:"required"`
}

Request struct for migrate VNF

type DeviceRemoveRequest

type DeviceRemoveRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
}

Request struct for remove network device

type DeviceRestartRequest

type DeviceRestartRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
}

Request struct for restart VNF device

type DisableRequest

type DisableRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
}

Request struct for disable external network

type EnableRequest

type EnableRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
}

Request struct for enable external network

type ExtNet

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

Structure for creating request to extnet

func New

func New(client interfaces.Caller) *ExtNet

Builder for extnet endpoints

func (ExtNet) AccessAdd

func (e ExtNet) AccessAdd(ctx context.Context, req AccessAddRequest) ([]uint64, error)

AccessAdd grant access to external network for account ID

func (ExtNet) AccessRemove

func (e ExtNet) AccessRemove(ctx context.Context, req AccessRemoveRequest) ([]uint64, error)

AccessRemove remove access from external network for account ID

func (ExtNet) Create

func (e ExtNet) Create(ctx context.Context, req CreateRequest) (uint64, error)

Create creates new external network into platform

func (ExtNet) DNSApply

func (e ExtNet) DNSApply(ctx context.Context, req DNSApplyRequest) (bool, error)

DNSApply sets new DNS

func (ExtNet) DefaultQOSUpdate

func (e ExtNet) DefaultQOSUpdate(ctx context.Context, req DefaultQOSUpdateRequest) (bool, error)

DefaultQOSUpdate updates default qos values

func (ExtNet) Destroy

func (e ExtNet) Destroy(ctx context.Context, req DestroyRequest) (bool, error)

Destroy destroys external network

func (ExtNet) DeviceDeploy

func (e ExtNet) DeviceDeploy(ctx context.Context, req DeviceDeployRequest) (bool, error)

DeviceDeploy deploys network device for external network (make not virtual, "physical")

func (ExtNet) DeviceMigrate

func (e ExtNet) DeviceMigrate(ctx context.Context, req DeviceMigrateRequest) (bool, error)

DeviceMigrate migrate external network VNF device

func (ExtNet) DeviceRemove

func (e ExtNet) DeviceRemove(ctx context.Context, req DeviceRemoveRequest) (bool, error)

DeviceRemove removes network device of external network (make it virtual, not "physical")

func (ExtNet) DeviceRestart

func (e ExtNet) DeviceRestart(ctx context.Context, req DeviceRestartRequest) (bool, error)

DeviceRestart restarts external network VNF device

func (ExtNet) Disable

func (e ExtNet) Disable(ctx context.Context, req DisableRequest) (bool, error)

Disable disables external network

func (ExtNet) Enable

func (e ExtNet) Enable(ctx context.Context, req EnableRequest) (bool, error)

Enable enables external networks

func (ExtNet) Get

func (e ExtNet) Get(ctx context.Context, req GetRequest) (*RecordExtNet, error)

Get gets external network details

func (ExtNet) GetDefault

func (e ExtNet) GetDefault(ctx context.Context) (uint64, error)

GetDefault get default external network ID

func (ExtNet) IPsExclude

func (e ExtNet) IPsExclude(ctx context.Context, req IPsExcludeRequest) (bool, error)

IPsExclude exclude list IPs from external network pool

func (ExtNet) IPsExcludeRange

func (e ExtNet) IPsExcludeRange(ctx context.Context, req IPsExcludeRangeRequest) (bool, error)

IPsExcludeRange exclude range of IPs from external network pool

func (ExtNet) IPsInclude

func (e ExtNet) IPsInclude(ctx context.Context, req IPsIncludeRequest) (bool, error)

IPsInclude include list IPs to external network pool

func (ExtNet) IPsIncludeRange

func (e ExtNet) IPsIncludeRange(ctx context.Context, req IPsIncludeRangeRequest) (bool, error)

IPsIncludeRange include range of IPs to external network pool

func (ExtNet) List

func (e ExtNet) List(ctx context.Context, req ListRequest) (ListExtNet, error)

List gets list all available external networks

func (ExtNet) NTPApply

func (e ExtNet) NTPApply(ctx context.Context, req NTPApplyRequest) (bool, error)

NTPApply sets new NTP

func (ExtNet) RaiseDown

func (e ExtNet) RaiseDown(ctx context.Context) (bool, error)

RaiseDown starting all extnets vnfdevs in "DOWN" tech status

func (ExtNet) SetDefault

func (e ExtNet) SetDefault(ctx context.Context, req SetDefaultRequest) (bool, error)

SetDefault sets external network as default for platform

func (ExtNet) Update

func (e ExtNet) Update(ctx context.Context, req UpdateRequest) (bool, error)

Update updates external network parameters

type GetRequest

type GetRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
}

Request struct for get information about external network

type IPsExcludeRangeRequest

type IPsExcludeRangeRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`

	// Starting IP
	// Required: true
	IPStart string `url:"ip_start" json:"ip_start" validate:"required"`

	// Ending IP
	// Required: true
	IPEnd string `url:"ip_end" json:"ip_end" validate:"required"`
}

Request struct for exclude range of IPs

type IPsExcludeRequest

type IPsExcludeRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`

	// List of IPs for exclude from external network
	// Required: true
	IPs []string `url:"ips" json:"ips" validate:"min=1"`
}

Request struct for exclude list IPs

type IPsIncludeRangeRequest

type IPsIncludeRangeRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`

	// Starting IP
	// Required: true
	IPStart string `url:"ip_start" json:"ip_start" validate:"required"`

	// Ending IP
	// Required: true
	IPEnd string `url:"ip_end" json:"ip_end" validate:"required"`
}

Request struct for include range of IPs

type IPsIncludeRequest

type IPsIncludeRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`

	// List of IPs for include to external network
	// Required: true
	IPs []string `url:"ips" json:"ips" validate:"min=1"`
}

Request struct for include list IPs

type ItemExtNet

type ItemExtNet struct {
	// CKey
	CKey string `json:"_ckey"`

	// Meta
	Meta []interface{} `json:"_meta"`

	// CheckIPs
	CheckIPs []string `json:"checkIps"`

	// Default
	Default bool `json:"default"`

	// Default QOS
	DefaultQOS QOS `json:"defaultQos"`

	// Description
	Description string `json:"desc"`

	// Free IPs number
	FreeIPs uint64 `json:"freeIps"`

	// Grid ID
	GID uint64 `json:"gid"`

	// GUID
	GUID uint64 `json:"guid"`

	// ID
	ID uint64 `json:"id"`

	// IPCIDR
	IPCIDR string `json:"ipcidr"`

	// Milestones
	Milestones uint64 `json:"milestones"`

	// Name
	Name string `json:"name"`

	// Network ID
	NetworkID uint64 `json:"networkId"`

	// OVSBridge
	OVSBridge string `json:"ovsBridge"`

	// PreReservationsNum
	PreReservationsNum uint64 `json:"preReservationsNum"`

	// PriVNFDevID
	PriVNFDevID uint64 `json:"priVnfDevId"`

	// List of shared with
	SharedWith []interface{} `json:"sharedWith"`

	// Status
	Status string `json:"status"`

	// VLAN ID
	VLANID uint64 `json:"vlanId"`

	// VNFs
	VNFs VNFs `json:"vnfs"`
}

Main information about external network

func (ItemExtNet) Serialize

func (ienet ItemExtNet) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ItemReservation

type ItemReservation struct {
	// Client type
	ClientType string `json:"clientType"`

	// Description
	Description string `json:"desc"`

	// IP
	IP string `json:"ip"`

	// MAC
	MAC string `json:"mac"`

	// Type
	Type string `json:"type"`

	// Virtual machine ID
	VMID uint64 `json:"vmId"`

	// Domain name
	DomainName string `json:"domainname"`

	// Hostname
	Hostname string `json:"hostname"`
}

Main information about reservations

type ListExtNet

type ListExtNet []ItemExtNet

List external networks

func (ListExtNet) FilterByID

func (lenet ListExtNet) FilterByID(id uint64) ListExtNet

FilterByID returns ListExtNet with specified ID.

func (ListExtNet) FilterByName

func (lenet ListExtNet) FilterByName(name string) ListExtNet

FilterByName returns ListExtNet with specified Name.

func (ListExtNet) FilterByStatus

func (lenet ListExtNet) FilterByStatus(status string) ListExtNet

FilterByStatus returns ListExtNet with specified Status.

func (ListExtNet) FilterFunc

func (lenet ListExtNet) FilterFunc(predicate func(ItemExtNet) bool) ListExtNet

FilterFunc allows filtering ListExtNet based on a user-specified predicate.

func (ListExtNet) FindOne

func (lenet ListExtNet) FindOne() ItemExtNet

FindOne returns first found ItemExtNet If none was found, returns an empty struct.

func (ListExtNet) Serialize

func (lenet ListExtNet) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ListRequest

type ListRequest struct {
	// Filter by account ID
	// Required: false
	AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"`

	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

Request struct for get list external network

type ListReservations

type ListReservations []ItemReservation

List reservations

type NTPApplyRequest

type NTPApplyRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`

	// List of NTP to apply
	// Required: false
	NTPList []string `url:"ntp_list,omitempty" json:"ntp_list,omitempty"`
}

Request struct for set new NTP

type QOS

type QOS struct {
	// ERate
	ERate uint64 `json:"eRate"`

	// GUID
	GUID string `json:"guid"`

	// InBurst
	InBurst uint64 `json:"inBurst"`

	// InRate
	InRate uint64 `json:"inRate"`
}

QOS

type RecordExtNet

type RecordExtNet struct {
	// Main information about external network
	ItemExtNet

	// CheckIPs
	CheckIPs []string `json:"checkIPs"`

	// CheckIps
	CheckIps []string `json:"checkIps"`

	// List DNS
	DNS []string `json:"dns"`

	// List excludes
	Excluded []string `json:"excluded"`

	// Gateway
	Gateway string `json:"gateway"`

	// Network
	Network string `json:"network"`

	// Prefix
	Prefix uint64 `json:"prefix"`

	// List reservations
	Reservations ListReservations `json:"reservations"`
}

Detailed information about external network

type SetDefaultRequest

type SetDefaultRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`
}

Request struct for set external network as default

type UpdateRequest

type UpdateRequest struct {
	// ID of external network
	// Required: true
	NetID uint64 `url:"net_id" json:"net_id" validate:"required"`

	// New external network name
	// Required: false
	Name string `url:"name,omitempty" json:"name,omitempty"`

	// New external network description
	// Required: false
	Description string `url:"desc,omitempty" json:"desc,omitempty"`
}

Request struct for update external network

type VNFs

type VNFs struct {
	DHCP int `json:"dhcp"`
}

VNFs

Jump to

Keyboard shortcuts

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