vlan

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

Package vlan implements API functions residing under /vlan. This path contains methods for querying, creating and deleting of VLANs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	List(ctx context.Context, page, limit int, search string) ([]Summary, error)
	Get(ctx context.Context, identifier string) (Info, error)
	Create(ctx context.Context, createDefinition CreateDefinition) (Summary, error)
	Delete(ctx context.Context, identifier string) error
	Update(ctx context.Context, identifier string, updateDefinition UpdateDefinition) error
}

API contains methods for VLAN control.

func NewAPI

func NewAPI(c client.Client) API

NewAPI creates a new VLAN API instance with the given client.

type CreateDefinition

type CreateDefinition struct {
	Location            string `json:"location"`
	VMProvisioning      bool   `json:"vm_provisioning,omitempty"`
	CustomerDescription string `json:"description_customer,omitempty"`
}

CreateDefinition contains information required to create a VLAN.

type Info

type Info struct {
	Identifier          string `json:"identifier"`
	Name                string `json:"name"`
	CustomerDescription string `json:"description_customer"`
	InternalDescription string `json:"description_internal"`
	Role                string `json:"role_text"`
	Status              string `json:"status"`
	VMProvisioning      bool   `json:"vm_provisioning,omitempty"`
	Locations           []Location
}

Info describes all attributes of a VLAN.

type Location

type Location struct {
	Identifier  string `json:"identifier"`
	Name        string `json:"name"`
	Code        string `json:"code"`
	CountryCode string `json:"country"`
	Latitude    string `json:"lat"`
	Longitude   string `json:"lon"`
	CityCode    string `json:"city_code"`
}

Location is the metadata of a single location.

type Summary

type Summary struct {
	Identifier          string `json:"identifier"`
	Name                string `json:"name"`
	CustomerDescription string `json:"description_customer"`
}

Summary describes some attributes of a VLAN.

type UpdateDefinition

type UpdateDefinition struct {
	CustomerDescription string `json:"description_customer,omitempty"`
	VMProvisioning      bool   `json:"vm_provisioning,omitempty"`
}

UpdateDefinition contains information required to update a VLAN.

Jump to

Keyboard shortcuts

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