nautobot

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CidrToIPAndNetMask

func CidrToIPAndNetMask(ipv4 string) (string, string, int, error)

Types

type ACL

type ACL struct {
	Definitions *Definitions `json:"definitions,omitempty"`
}

type AssignedObject

type AssignedObject struct {
	ID     string  `json:"id"`
	URL    string  `json:"url"`
	Device *Device `json:"device"`
	Name   string  `json:"name"`
	Cable  string  `json:"cable"`
}

type Cable

type Cable struct {
	ID    string `json:"id"`
	URL   string `json:"url"`
	Label string `json:"label"`
}

type CablePeer

type CablePeer struct {
	ID     string  `json:"id"`
	URL    string  `json:"url"`
	Device *Device `json:"device"`
	Name   string  `json:"name"`
	Cable  string  `json:"cable"`
}

type Client

type Client interface {
	RequestActiveDevice() (*DeviceInfo, error)
	GetDeviceByAssetTag(string) (*DeviceInfo, error)
	GetDeviceByID(string) (*DeviceInfo, error)
	PatchDeviceStatus(string, *PatchedDeviceParams) error
	GetActiveInterface(string) (*InterfaceInfo, error)
	GetIP(*GetIPParams) (*IPInfo, error)
	GetPrefix(string, string, int) (*PrefixInfo, error)
}

func NewDefaultClient

func NewDefaultClient(token, dcTag, nautobotServer string) (Client, error)

type Community

type Community []struct {
	Name string `json:"name,omitempty"`
	Role string `json:"role,omitempty"`
}

type ConfigContext

type ConfigContext struct {
	Cdp         bool      `json:"cdp,omitempty"`
	Ntp         Ntp       `json:"ntp,omitempty"`
	Lldp        bool      `json:"lldp,omitempty"`
	Snmp        *Snmp     `json:"snmp,omitempty"`
	AaaNewModel bool      `json:"aaa-new-model,omitempty"`
	ACL         *ACL      `json:"acl,omitempty"`
	RouteMaps   RouteMaps `json:"route-maps,omitempty"`
}

type ConnectedEndpoint

type ConnectedEndpoint struct {
	ID     string  `json:"id"`
	URL    string  `json:"url"`
	Device *Device `json:"device"`
	Name   string  `json:"name"`
	Cable  string  `json:"cable"`
}

type Definitions

type Definitions struct {
	Named *Named `json:"named,omitempty"`
}

type Device

type Device struct {
	ID          string `json:"id"`
	URL         string `json:"url"`
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
}

type DeviceInfo

type DeviceInfo struct {
	ID               string         `json:"id,omitempty"`
	URL              string         `json:"url,omitempty"`
	Name             string         `json:"name,omitempty"`
	DisplayName      string         `json:"display_name,omitempty"`
	DeviceType       *DeviceType    `json:"device_type,omitempty"`
	DeviceRole       *DeviceRole    `json:"device_role,omitempty"`
	Tenant           *Tenant        `json:"tenant,omitempty"`
	Platform         *Platform      `json:"platform,omitempty"`
	Serial           string         `json:"serial,omitempty"`
	AssetTag         interface{}    `json:"asset_tag,omitempty"`
	Site             *Site          `json:"site,omitempty"`
	Rack             *Rack          `json:"rack,omitempty"`
	Position         int            `json:"position,omitempty"`
	Face             *Face          `json:"face,omitempty"`
	ParentDevice     interface{}    `json:"parent_device,omitempty"`
	Status           *Status        `json:"status,omitempty"`
	PrimaryIP        *PrimaryIP     `json:"primary_ip,omitempty"`
	PrimaryIP4       *PrimaryIP4    `json:"primary_ip4,omitempty"`
	PrimaryIP6       interface{}    `json:"primary_ip6,omitempty"`
	Cluster          interface{}    `json:"cluster,omitempty"`
	VirtualChassis   interface{}    `json:"virtual_chassis,omitempty"`
	VcPosition       interface{}    `json:"vc_position,omitempty"`
	VcPriority       interface{}    `json:"vc_priority,omitempty"`
	Comments         string         `json:"comments,omitempty"`
	LocalContextData interface{}    `json:"local_context_data,omitempty"`
	Tags             []Tags         `json:"tags,omitempty"`
	ConfigContext    *ConfigContext `json:"config_context,omitempty"`
	Created          string         `json:"created,omitempty"`
	LastUpdated      time.Time      `json:"last_updated,omitempty"`
}

type DeviceRole

type DeviceRole struct {
	ID   string `json:"id,omitempty"`
	URL  string `json:"url,omitempty"`
	Name string `json:"name,omitempty"`
	Slug string `json:"slug,omitempty"`
}

type DeviceStatus

type DeviceStatus string
const (
	Active DeviceStatus = "active"
	Staged DeviceStatus = "staged"
)

type DeviceType

type DeviceType struct {
	ID           string        `json:"id,omitempty"`
	URL          string        `json:"url,omitempty"`
	Manufacturer *Manufacturer `json:"manufacturer,omitempty"`
	Model        string        `json:"model,omitempty"`
	Slug         string        `json:"slug,omitempty"`
	DisplayName  string        `json:"display_name,omitempty"`
}

type Face

type Face struct {
	Value string `json:"value,omitempty"`
	Label string `json:"label,omitempty"`
}

type Family

type Family struct {
	Value int    `json:"value"`
	Label string `json:"label"`
}

type GetIPParams

type GetIPParams struct {
	InterfaceID string
	Parent      string
	Tag         string
}

func (*GetIPParams) ToRawQuery

func (p *GetIPParams) ToRawQuery() string

type Host

type Host []struct {
	IP        string `json:"ip,omitempty"`
	Version   string `json:"version,omitempty"`
	Community string `json:"community,omitempty"`
}

type IP

type IP struct {
	Count   int      `json:"count"`
	Results []IPInfo `json:"results"`
}

type IPInfo

type IPInfo struct {
	ID                 string          `json:"id"`
	URL                string          `json:"url"`
	Family             *Family         `json:"family"`
	Address            string          `json:"address"`
	Vrf                *Vrf            `json:"vrf"`
	Tenant             *Tenant         `json:"tenant"`
	Status             *Status         `json:"status"`
	AssignedObjectType string          `json:"assigned_object_type"`
	AssignedObjectID   string          `json:"assigned_object_id"`
	AssignedObject     *AssignedObject `json:"assigned_object"`
	DNSName            string          `json:"dns_name"`
	Description        string          `json:"description"`
	Created            string          `json:"created"`
	LastUpdated        time.Time       `json:"last_updated"`
}

type Interface

type Interface struct {
	Count   int             `json:"count"`
	Results []InterfaceInfo `json:"results"`
}

type InterfaceInfo

type InterfaceInfo struct {
	ID                         string             `json:"id"`
	URL                        string             `json:"url"`
	Device                     *Device            `json:"device"`
	Name                       string             `json:"name"`
	Label                      string             `json:"label"`
	Type                       *Type              `json:"type"`
	Enabled                    bool               `json:"enabled"`
	MacAddress                 string             `json:"mac_address"`
	MgmtOnly                   bool               `json:"mgmt_only"`
	Description                string             `json:"description"`
	Cable                      *Cable             `json:"cable"`
	CablePeer                  *CablePeer         `json:"cable_peer"`
	CablePeerType              string             `json:"cable_peer_type"`
	ConnectedEndpoint          *ConnectedEndpoint `json:"connected_endpoint"`
	ConnectedEndpointType      string             `json:"connected_endpoint_type"`
	ConnectedEndpointReachable bool               `json:"connected_endpoint_reachable"`
	CountIpaddresses           int                `json:"count_ipaddresses"`
}

type Manufacturer

type Manufacturer struct {
	ID   string `json:"id,omitempty"`
	URL  string `json:"url,omitempty"`
	Name string `json:"name,omitempty"`
	Slug string `json:"slug,omitempty"`
}

type Named

type Named struct {
	PermitRoutes []string `json:"PERMIT_ROUTES,omitempty"`
}

type NetworkDevice

type NetworkDevice struct {
	Count   int           `json:"count,omitempty"`
	Results []*DeviceInfo `json:"results,omitempty"`
}

type Ntp

type Ntp []struct {
	IP     string `json:"ip,omitempty"`
	Prefer bool   `json:"prefer,omitempty"`
}

type PatchedDeviceParams

type PatchedDeviceParams struct {
	Status   DeviceStatus `json:"status"`
	AssetTag string       `json:"asset_tag"`
}

type PermitConnRoutes

type PermitConnRoutes struct {
	Seq        int      `json:"seq,omitempty"`
	Type       string   `json:"type,omitempty"`
	Statements []string `json:"statements,omitempty"`
}

type Platform

type Platform struct {
	ID   string `json:"id,omitempty"`
	URL  string `json:"url,omitempty"`
	Name string `json:"name,omitempty"`
	Slug string `json:"slug,omitempty"`
}

type Prefix

type Prefix struct {
	Count   int          `json:"count"`
	Results []PrefixInfo `json:"results"`
}

type PrefixInfo

type PrefixInfo struct {
	ID          string    `json:"id"`
	URL         string    `json:"url"`
	Family      *Family   `json:"family"`
	Prefix      string    `json:"prefix"`
	Site        *Site     `json:"site"`
	Vrf         *Vrf      `json:"vrf"`
	Tenant      *Tenant   `json:"tenant"`
	Status      *Status   `json:"status"`
	IsPool      bool      `json:"is_pool"`
	Description string    `json:"description"`
	Tags        []Tags    `json:"tags"`
	Created     string    `json:"created"`
	LastUpdated time.Time `json:"last_updated"`
}

type PrimaryIP

type PrimaryIP struct {
	ID      string `json:"id,omitempty"`
	URL     string `json:"url,omitempty"`
	Family  int    `json:"family,omitempty"`
	Address string `json:"address,omitempty"`
}

type PrimaryIP4

type PrimaryIP4 struct {
	ID      string `json:"id,omitempty"`
	URL     string `json:"url,omitempty"`
	Family  int    `json:"family,omitempty"`
	Address string `json:"address,omitempty"`
}

type Rack

type Rack struct {
	ID          string `json:"id,omitempty"`
	URL         string `json:"url,omitempty"`
	Name        string `json:"name,omitempty"`
	DisplayName string `json:"display_name,omitempty"`
}

type RouteMaps

type RouteMaps struct {
	PermitConnRoutes *PermitConnRoutes `json:"PERMIT_CONN_ROUTES,omitempty"`
}

type Site

type Site struct {
	ID   string `json:"id"`
	URL  string `json:"url"`
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type Snmp

type Snmp struct {
	Host      Host      `json:"host,omitempty"`
	Contact   string    `json:"contact,omitempty"`
	Location  string    `json:"location,omitempty"`
	Community Community `json:"community,omitempty"`
}

type Status

type Status struct {
	Value string `json:"value"`
	Label string `json:"label"`
}

type Tags

type Tags struct {
	ID    string `json:"id"`
	URL   string `json:"url"`
	Name  string `json:"name"`
	Slug  string `json:"slug"`
	Color string `json:"color"`
}

type Tenant

type Tenant struct {
	ID   string `json:"id"`
	URL  string `json:"url"`
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type Type

type Type struct {
	Value string `json:"value"`
	Label string `json:"label"`
}

type Vrf

type Vrf struct {
	ID          string `json:"id"`
	URL         string `json:"url"`
	Name        string `json:"name"`
	Rd          string `json:"rd"`
	DisplayName string `json:"display_name"`
}

Jump to

Keyboard shortcuts

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