netbox

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIManyResponse

type APIManyResponse[T APIResultModel] struct {
	Count    int    `json:"count"`
	Next     string `json:"next"`
	Previous string `json:"previous"`
	Results  []T    `json:"results"`
}

type APIRequestClient

type APIRequestClient struct {
	Client    *http.Client
	NetboxURL *url.URL
	Token     string
	UserAgent string
}

type APIResultModel

type APIResultModel interface {
	Record | Zone
}

type Record

type Record struct {
	Type  string  `json:"type"`
	Value string  `json:"value"`
	TTL   *uint32 `json:"ttl"`
	Zone  Zone    `json:"zone"`
	FQDN  string  `json:"fqdn"`
}

func GetRecordsQuery

func GetRecordsQuery(
	requestClient *APIRequestClient,
	query *RecordQuery,
) ([]Record, error)

type RecordQuery

type RecordQuery struct {
	FQDN string
	Name string
	Type []string
	Zone *Zone
}

func (*RecordQuery) Encode

func (recordQuery *RecordQuery) Encode() string

type SOAMName

type SOAMName struct {
	Name string `json:"name"`
}

type Zone

type Zone struct {
	DefaultTTL  uint32     `json:"default_ttl"`
	ID          int        `json:"id"`
	Name        string     `json:"name"`
	NameServers []SOAMName `json:"nameservers"`
}

func GetZones

func GetZones(requestClient *APIRequestClient) ([]Zone, error)

Jump to

Keyboard shortcuts

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