aoscxgo

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Connection properties.
	Hostname string `json:"hostname"`
	Username string `json:"username"`
	Password string `json:"password"`
	Version  string `json:"version"`
	// Generated after Connect
	Cookie *http.Cookie `json:"cookie"`
	// HTTP transport options.  Note that the VerifyCertificate setting is
	// only used if you do not specify a HTTP transport yourself.
	VerifyCertificate bool            `json:"verify_certificate"`
	Transport         *http.Transport `json:"-"`
}

func Connect

func Connect(c *Client) (*Client, error)

Connect creates connection to given Client object.

type Firmware

type Firmware struct {
	BootedImage      string                 `json:"booted_image"`
	CurrentVersion   string                 `json:"current_version"`
	DefaultImage     string                 `json:"default_image"`
	PrimaryVersion   string                 `json:"primary_version"`
	SecondaryVersion string                 `json:"secondary_version"`
	FirmwareDetails  map[string]interface{} `json:"details"`
	// contains filtered or unexported fields
}

func (*Firmware) Get

func (f *Firmware) Get(c *Client) error

func (*Firmware) Update

func (f *Firmware) Update(c *Client, firmware_location string, image string) error

type Interface

type Interface struct {

	// Connection properties.
	Name             string                 `json:"name"`
	Description      string                 `json:"description"`
	AdminState       string                 `json:"admin"`
	InterfaceDetails map[string]interface{} `json:"details"`
	// contains filtered or unexported fields
}

func (*Interface) Create

func (i *Interface) Create(c *Client) error

Create performs POST to create Interface configuration on the given Client object.

func (*Interface) Delete

func (i *Interface) Delete(c *Client) error

Delete performs PUT to remove/default Interface configuration from the given Client object.

func (*Interface) Get

func (i *Interface) Get(c *Client) error

Get performs GET to retrieve Interface configuration from the given Client object.

func (*Interface) GetStatus

func (i *Interface) GetStatus() bool

GetStatus returns True if Interface exists on Client object or False if not.

func (*Interface) Update

func (i *Interface) Update(c *Client) error

Update performs PATCH to update Interface configuration on the given Client object.

type L2Interface

type L2Interface struct {

	// Connection properties.
	Interface        Interface              `json:"interface"`
	Description      string                 `json:"description"`
	VlanMode         string                 `json:"vlan_mode"`
	VlanIds          []interface{}          `json:"vlan_ids"`
	VlanTag          int                    `json:"vlan_tag"`
	TrunkAllowedAll  bool                   `json:"trunk_allowed_all"`
	NativeVlanTag    bool                   `json:"native_vlan_tag"`
	InterfaceDetails map[string]interface{} `json:"details"`
	// contains filtered or unexported fields
}

func (*L2Interface) Create

func (i *L2Interface) Create(c *Client) error

Create performs PATCH to update L2Interface configuration on the given Client object.

func (*L2Interface) Delete

func (i *L2Interface) Delete(c *Client) error

Delete performs PUT to remove/default L2Interface configuration from the given Client object.

func (*L2Interface) Get

func (i *L2Interface) Get(c *Client) error

Get performs GET to retrieve L2Interface configuration from the given Client object.

func (*L2Interface) GetStatus

func (i *L2Interface) GetStatus() bool

GetStatus returns True if L2Interface exists on Client object or False if not.

func (*L2Interface) Update

func (i *L2Interface) Update(c *Client, use_put bool) error

Update performs PATCH or PUT to update L2Interface configuration on the given Client object.

type RequestError

type RequestError struct {
	StatusCode string

	Err error
}

A custom error struct

func (*RequestError) Error

func (r *RequestError) Error() string

A custom error string

type Vlan

type Vlan struct {

	// Connection properties.
	VlanId      int                    `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	AdminState  string                 `json:"admin_state"`
	VlanDetails map[string]interface{} `json:"details"`
	// contains filtered or unexported fields
}

func (*Vlan) Create

func (v *Vlan) Create(c *Client) error

Create performs POST to create VLAN configuration on the given Client object.

func (*Vlan) Delete

func (v *Vlan) Delete(c *Client) error

Delete performs DELETE to remove VLAN configuration from the given Client object.

func (*Vlan) Get

func (v *Vlan) Get(c *Client) error

Get performs GET to retrieve VLAN configuration for the given Client object.

func (*Vlan) GetStatus

func (v *Vlan) GetStatus() bool

GetStatus returns True if VLAN exists on Client object or False if not.

func (*Vlan) GetURI

func (v *Vlan) GetURI() string

GetURI returns URI of VLAN.

func (*Vlan) Update

func (v *Vlan) Update(c *Client) error

Update performs PATCH to update VLAN configuration on the given Client object.

Jump to

Keyboard shortcuts

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