network

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2018 License: BSD-2-Clause Imports: 13 Imported by: 0

README

Network

Example

grpc_cli call localhost:20182 n0stack.pool.NetworkService/ListNetworks ''
grpc_cli call localhost:20182 n0stack.pool.NetworkService/GetNetwork '
name: "test-network"
'
grpc_cli call localhost:20182 n0stack.pool.NetworkService/ApplyNetwork '
name: "test-network"
ipv4_cidr: "10.100.100.0/24"
domain: "test.local"
'
grpc_cli call localhost:20182 n0stack.pool.NetworkService/ReserveNetworkInterface '
name: "test-network"
network_interface_name: "test-reserve"
'
grpc_cli call localhost:20182 n0stack.pool.NetworkService/ReleaseNetworkInterface '
name: "test-network"
network_interface_name: "test-reserve"
'

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckConflictIPv4

func CheckConflictIPv4(request net.IP, reserved map[string]*pbudget.NetworkInterface) error

func CheckIPv4OnCIDR

func CheckIPv4OnCIDR(request net.IP, cidr *net.IPNet) error

func GenerateHardwareAddress

func GenerateHardwareAddress(id string) net.HardwareAddr

func NextIP

func NextIP(ip net.IP) net.IP

func ScheduleNewIPv4

func ScheduleNewIPv4(cidr *net.IPNet, reserved map[string]*pbudget.NetworkInterface) net.IP

O(len(reserved) ^ 2) なので要修正

Types

type NetworkAPI

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

func CreateNetworkAPI

func CreateNetworkAPI(ds datastore.Datastore) (*NetworkAPI, error)

func (NetworkAPI) ApplyNetwork

func (a NetworkAPI) ApplyNetwork(ctx context.Context, req *ppool.ApplyNetworkRequest) (*ppool.Network, error)

func (NetworkAPI) DeleteNetwork

func (a NetworkAPI) DeleteNetwork(ctx context.Context, req *ppool.DeleteNetworkRequest) (*empty.Empty, error)

func (NetworkAPI) GetNetwork

func (a NetworkAPI) GetNetwork(ctx context.Context, req *ppool.GetNetworkRequest) (*ppool.Network, error)

func (NetworkAPI) ListNetworks

func (a NetworkAPI) ListNetworks(ctx context.Context, req *ppool.ListNetworksRequest) (*ppool.ListNetworksResponse, error)

func (NetworkAPI) ReleaseNetworkInterface

func (a NetworkAPI) ReleaseNetworkInterface(ctx context.Context, req *ppool.ReleaseNetworkInterfaceRequest) (*empty.Empty, error)

func (NetworkAPI) ReserveNetworkInterface

func (a NetworkAPI) ReserveNetworkInterface(ctx context.Context, req *ppool.ReserveNetworkInterfaceRequest) (*ppool.Network, error)

とりあえず IPv4 のスケジューリングのみに対応

Jump to

Keyboard shortcuts

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