network

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: MPL-2.0 Imports: 9 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateFabricInput

type CreateFabricInput struct {
	FabricVLANID     int               `json:"-"`
	Name             string            `json:"name"`
	Description      string            `json:"description,omitempty"`
	Subnet           string            `json:"subnet"`
	ProvisionStartIP string            `json:"provision_start_ip"`
	ProvisionEndIP   string            `json:"provision_end_ip"`
	Gateway          string            `json:"gateway,omitempty"`
	Resolvers        []string          `json:"resolvers,omitempty"`
	Routes           map[string]string `json:"routes,omitempty"`
	InternetNAT      bool              `json:"internet_nat"`
}

type CreateRuleInput

type CreateRuleInput struct {
	Enabled     bool   `json:"enabled"`
	Rule        string `json:"rule"`
	Description string `json:"description,omitempty"`
}

type CreateVLANInput

type CreateVLANInput struct {
	Name        string `json:"name"`
	ID          int    `json:"vlan_id"`
	Description string `json:"description,omitempty"`
}

type DeleteFabricInput

type DeleteFabricInput struct {
	FabricVLANID int    `json:"-"`
	NetworkID    string `json:"-"`
}

type DeleteRuleInput

type DeleteRuleInput struct {
	ID string
}

type DeleteVLANInput

type DeleteVLANInput struct {
	ID int `json:"-"`
}

type DisableRuleInput

type DisableRuleInput struct {
	ID string `json:"-"`
}

type EnableRuleInput

type EnableRuleInput struct {
	ID string `json:"-"`
}

type FabricVLAN

type FabricVLAN struct {
	Name        string `json:"name"`
	ID          int    `json:"vlan_id"`
	Description string `json:"description"`
}

type FabricsClient

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

func (*FabricsClient) Create

func (c *FabricsClient) Create(ctx context.Context, input *CreateFabricInput) (*Network, error)

func (*FabricsClient) CreateVLAN

func (c *FabricsClient) CreateVLAN(ctx context.Context, input *CreateVLANInput) (*FabricVLAN, error)

func (*FabricsClient) Delete

func (c *FabricsClient) Delete(ctx context.Context, input *DeleteFabricInput) error

func (*FabricsClient) DeleteVLAN

func (c *FabricsClient) DeleteVLAN(ctx context.Context, input *DeleteVLANInput) error

func (*FabricsClient) Get

func (c *FabricsClient) Get(ctx context.Context, input *GetFabricInput) (*Network, error)

func (*FabricsClient) GetVLAN

func (c *FabricsClient) GetVLAN(ctx context.Context, input *GetVLANInput) (*FabricVLAN, error)

func (*FabricsClient) List

func (c *FabricsClient) List(ctx context.Context, input *ListFabricsInput) ([]*Network, error)

func (*FabricsClient) ListVLANs

func (c *FabricsClient) ListVLANs(ctx context.Context, _ *ListVLANsInput) ([]*FabricVLAN, error)

func (*FabricsClient) UpdateVLAN

func (c *FabricsClient) UpdateVLAN(ctx context.Context, input *UpdateVLANInput) (*FabricVLAN, error)

type FirewallClient

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

func (*FirewallClient) CreateRule

func (c *FirewallClient) CreateRule(ctx context.Context, input *CreateRuleInput) (*FirewallRule, error)

func (*FirewallClient) DeleteRule

func (c *FirewallClient) DeleteRule(ctx context.Context, input *DeleteRuleInput) error

func (*FirewallClient) DisableRule

func (c *FirewallClient) DisableRule(ctx context.Context, input *DisableRuleInput) (*FirewallRule, error)

func (*FirewallClient) EnableRule

func (c *FirewallClient) EnableRule(ctx context.Context, input *EnableRuleInput) (*FirewallRule, error)

func (*FirewallClient) GetRule

func (c *FirewallClient) GetRule(ctx context.Context, input *GetRuleInput) (*FirewallRule, error)

func (*FirewallClient) ListMachineRules

func (c *FirewallClient) ListMachineRules(ctx context.Context, input *ListMachineRulesInput) ([]*FirewallRule, error)

func (*FirewallClient) ListRuleMachines

func (c *FirewallClient) ListRuleMachines(ctx context.Context, input *ListRuleMachinesInput) ([]*Machine, error)

func (*FirewallClient) ListRules

func (c *FirewallClient) ListRules(ctx context.Context, _ *ListRulesInput) ([]*FirewallRule, error)

func (*FirewallClient) UpdateRule

func (c *FirewallClient) UpdateRule(ctx context.Context, input *UpdateRuleInput) (*FirewallRule, error)

type FirewallRule

type FirewallRule struct {
	// ID is a unique identifier for this rule
	ID string `json:"id"`

	// Enabled indicates if the rule is enabled
	Enabled bool `json:"enabled"`

	// Rule is the firewall rule text
	Rule string `json:"rule"`

	// Global indicates if the rule is global. Optional.
	Global bool `json:"global"`

	// Description is a human-readable description for the rule. Optional
	Description string `json:"description"`
}

FirewallRule represents a firewall rule

type GetFabricInput

type GetFabricInput struct {
	FabricVLANID int    `json:"-"`
	NetworkID    string `json:"-"`
}

type GetInput

type GetInput struct {
	ID string
}

type GetRuleInput

type GetRuleInput struct {
	ID string
}

type GetVLANInput

type GetVLANInput struct {
	ID int `json:"-"`
}

type ListFabricsInput

type ListFabricsInput struct {
	FabricVLANID int `json:"-"`
}

type ListInput

type ListInput struct{}

type ListMachineRulesInput

type ListMachineRulesInput struct {
	MachineID string
}

type ListRuleMachinesInput

type ListRuleMachinesInput struct {
	ID string
}

type ListRulesInput

type ListRulesInput struct{}

type ListVLANsInput

type ListVLANsInput struct{}

type Machine

type Machine struct {
	ID              string                 `json:"id"`
	Name            string                 `json:"name"`
	Type            string                 `json:"type"`
	Brand           string                 `json:"brand"`
	State           string                 `json:"state"`
	Image           string                 `json:"image"`
	Memory          int                    `json:"memory"`
	Disk            int                    `json:"disk"`
	Metadata        map[string]string      `json:"metadata"`
	Tags            map[string]interface{} `json:"tags"`
	Created         time.Time              `json:"created"`
	Updated         time.Time              `json:"updated"`
	Docker          bool                   `json:"docker"`
	IPs             []string               `json:"ips"`
	Networks        []string               `json:"networks"`
	PrimaryIP       string                 `json:"primaryIp"`
	FirewallEnabled bool                   `json:"firewall_enabled"`
	ComputeNode     string                 `json:"compute_node"`
	Package         string                 `json:"package"`
}

type Network

type Network struct {
	Id                  string            `json:"id"`
	Name                string            `json:"name"`
	Public              bool              `json:"public"`
	Fabric              bool              `json:"fabric"`
	Description         string            `json:"description"`
	Subnet              string            `json:"subnet"`
	ProvisioningStartIP string            `json:"provision_start_ip"`
	ProvisioningEndIP   string            `json:"provision_end_ip"`
	Gateway             string            `json:"gateway"`
	Resolvers           []string          `json:"resolvers"`
	Routes              map[string]string `json:"routes"`
	InternetNAT         bool              `json:"internet_nat"`
}

type NetworkClient

type NetworkClient struct {
	Client *client.Client
}

func NewClient

func NewClient(config *triton.ClientConfig) (*NetworkClient, error)

NewClient returns a new client for working with Network endpoints and resources within CloudAPI

func (*NetworkClient) Fabrics

func (c *NetworkClient) Fabrics() *FabricsClient

Fabrics returns a FabricsClient used for accessing functions pertaining to Fabric functionality in the Triton API.

func (*NetworkClient) Firewall

func (c *NetworkClient) Firewall() *FirewallClient

Firewall returns a FirewallClient client used for accessing functions pertaining to firewall functionality in the Triton API.

func (*NetworkClient) Get

func (c *NetworkClient) Get(ctx context.Context, input *GetInput) (*Network, error)

func (*NetworkClient) List

func (c *NetworkClient) List(ctx context.Context, _ *ListInput) ([]*Network, error)

func (*NetworkClient) SetHeader

func (c *NetworkClient) SetHeader(header *http.Header)

SetHeaders allows a consumer of the current client to set custom headers for the next backend HTTP request sent to CloudAPI

type UpdateRuleInput

type UpdateRuleInput struct {
	ID          string `json:"-"`
	Enabled     bool   `json:"enabled"`
	Rule        string `json:"rule"`
	Description string `json:"description,omitempty"`
}

type UpdateVLANInput

type UpdateVLANInput struct {
	ID          int    `json:"-"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

Jump to

Keyboard shortcuts

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