ciscoasa

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInternalServer = errors.New("ciscoasa: Internal Server error")
	ErrUnknown        = errors.New("ciscoasa: Unknown error")
)

Predefine standard errors

Functions

This section is empty.

Types

type Address added in v0.2.3

type Address struct {
	Kind  string `json:"kind"`
	Value string `json:"value"`
}

Address represents a static IPv4/IPv6 address settings.

type AddressObject

type AddressObject struct {
	Value    string `json:"value,omitempty"`
	Kind     string `json:"kind"`
	ObjectID string `json:"objectId,omitempty"`
	Reflink  string `json:"refLink,omitempty"`
}

AddressObject represents an address object.

func (*AddressObject) String

func (o *AddressObject) String() string

String returns the objects address

type Client

type Client struct {
	Access     *accessService
	Interfaces *interfaceService
	Objects    *objectsService
	Routing    *routingService
	// contains filtered or unexported fields
}

Client represents a Cisco ASA client

func NewClient

func NewClient(apiURL, username, password string, sslNoVerify bool) (*Client, error)

NewClient creates a new client for communicating with a Cisco ASA

type CreateExtendedACLACEOptions added in v0.2.0

type CreateExtendedACLACEOptions struct {
	Active      bool
	Dst         string
	DstService  string
	Permit      bool
	Remarks     []string
	Position    int
	RuleLogging *RuleLogging
	Src         string
	SrcService  string
}

type DhcpClient added in v0.2.3

type DhcpClient struct {
	SetDefaultRoute     bool         `json:"setDefaultRoute"`
	Metric              int          `json:"metric"`
	PrimaryTrackId      int          `json:"primaryTrackId"`
	TrackingEnabled     bool         `json:"trackingEnabled"`
	SlaTrackingSettings *SlaTracking `json:"slaTrackingSettings"`
}

DhcpClient represents an DHCP Settings.

type ErrorMessage

type ErrorMessage struct {
	Level   string `json:"level"`
	Code    string `json:"code"`
	Context string `json:"context,omitempty"`
	Details string `json:"details"`
}

ErrorMessage represents a single API error

type ErrorResponse

type ErrorResponse struct {
	Messages []*ErrorMessage `json:"messages"`
}

ErrorResponse represents an error response

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type ExtendedACEObject

type ExtendedACEObject struct {
	SrcAddress   *AddressObject `json:"sourceAddress,omitempty"`
	SrcService   *ServiceObject `json:"sourceService,omitempty"`
	DstAddress   *AddressObject `json:"destinationAddress,omitempty"`
	DstService   *ServiceObject `json:"destinationService,omitempty"`
	RuleLogging  *RuleLogging   `json:"ruleLogging,omitempty"`
	Position     int            `json:"position,omitempty"`
	Permit       bool           `json:"permit,omitempty"`
	Active       bool           `json:"active"`
	IsAccessRule bool           `json:"isAccessRule"`
	Remarks      []string       `json:"remarks,omitempty"`
	Kind         string         `json:"kind,omitempty"`
	ObjectID     string         `json:"objectId,omitempty"`
	SelfLink     string         `json:"selfLink,omitempty"`
}

ExtendedACEObject represents an access control element object

type ExtendedACEObjectCollection

type ExtendedACEObjectCollection struct {
	RangeInfo RangeInfo            `json:"rangeInfo"`
	Items     []*ExtendedACEObject `json:"items"`
	Kind      string               `json:"kind"`
	SelfLink  string               `json:"selfLink"`
}

ExtendedACEObjectCollection represents a collection of access control element objects.

type ExtendedACLObject

type ExtendedACLObject struct {
	Name     string `json:"name,omitempty"`
	Kind     string `json:"kind,omitempty"`
	ObjectID string `json:"objectId,omitempty"`
	SelfLink string `json:"selfLink,omitempty"`
}

ExtendedACLObject represents an access control list object.

type ExtendedACLObjectCollection

type ExtendedACLObjectCollection struct {
	RangeInfo RangeInfo            `json:"rangeInfo"`
	Items     []*ExtendedACLObject `json:"items"`
	Kind      string               `json:"kind"`
	SelfLink  string               `json:"selfLink"`
}

ExtendedACLObjectCollection represents a collection of access control list objects.

type IPAddress

type IPAddress struct {
	IP                 *Address    `json:"ip,omitempty"`
	NetMask            *Address    `json:"netMask,omitempty"`
	Kind               string      `json:"kind"`
	DhcpOptionUsingMac bool        `json:"dhcpOptionUsingMac,omitempty"`
	DhcpBroadcast      bool        `json:"dhcpBroadcast,omitempty"`
	DhcpClient         *DhcpClient `json:"dhcpClient,omitempty"`
}

IPAddress represents an IP address settings.

func (*IPAddress) String

func (ip *IPAddress) String() string

func (*IPAddress) UnmarshalJSON

func (ip *IPAddress) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type IPv6Info

type IPv6Info struct {
	Enabled                  bool                `json:"enabled"`
	AutoConfig               bool                `json:"autoConfig"`
	EnforceEUI64             bool                `json:"enforceEUI64"`
	ManagedAddressConfig     bool                `json:"managedAddressConfig"`
	NsInterval               int                 `json:"nsInterval"`
	DadAttempts              int                 `json:"dadAttempts"`
	NDiscoveryPrefixList     []*NDiscoveryPrefix `json:"nDiscoveryPrefixList,omitempty"`
	OtherStatefulConfig      bool                `json:"otherStatefulConfig"`
	RouterAdvertInterval     int                 `json:"routerAdvertInterval"`
	RouterAdvertIntervalUnit string              `json:"routerAdvertIntervalUnit"`
	RouterAdvertLifetime     int                 `json:"routerAdvertLifetime"`
	SuppressRouterAdvert     bool                `json:"suppressRouterAdvert"`
	ReachableTime            int                 `json:"reachableTime"`
	LinkLocalAddress         *Ipv6Address        `json:"linkLocalAddress,omitempty"`
	Ipv6Addresses            []*Ipv6Address      `json:"ipv6Addresses,omitempty"`
	Kind                     string              `json:"kind"`
}

IPv6Info represents an IPv6 address.

func (*IPv6Info) UnmarshalJSON

func (ip *IPv6Info) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler interface.

type Ipv6Address added in v0.2.3

type Ipv6Address struct {
	PrefixLength int      `json:"prefixLength,omitempty"`
	Standby      *Address `json:"standby,omitempty"`
	Address      *Address `json:"address,omitempty"`
	// IsEUI64      bool     `json:"isEUI64"`
	Kind string `json:"kind"`
}

Ipv6Address represents an Ipv6Address.

type NDiscoveryPrefix added in v0.2.3

type NDiscoveryPrefix struct {
	OffLink           bool   `json:"offLink"`
	NoAdvertise       bool   `json:"noAdvertise"`
	PreferredLifetime int    `json:"preferredLifetime"`
	ValidLifetime     int    `json:"validLifetime"`
	HasDuration       bool   `json:"hasDuration"`
	DefaultPrefix     bool   `json:"defaultPrefix"`
	Kind              string `json:"kind"`
}

nDiscoveryPrefix represents an nDiscoveryPrefix list.

type NetworkObject

type NetworkObject struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Host        struct {
		Kind  string `json:"kind"`
		Value string `json:"value"`
	} `json:"host"`
	Kind     string `json:"kind"`
	ObjectID string `json:"objectId,omitempty"`
	SelfLink string `json:"selfLink,omitempty"`
}

NetworkObject represents a network object.

type NetworkObjectCollection

type NetworkObjectCollection struct {
	RangeInfo RangeInfo        `json:"rangeInfo"`
	Items     []*NetworkObject `json:"items"`
	Kind      string           `json:"kind"`
	SelfLink  string           `json:"selfLink"`
}

NetworkObjectCollection represents a collection of network objects.

type NetworkObjectGroup

type NetworkObjectGroup struct {
	Name        string           `json:"name"`
	Description string           `json:"description,omitempty"`
	Members     []*AddressObject `json:"members"`
	Kind        string           `json:"kind"`
	ObjectID    string           `json:"objectId,omitempty"`
	SelfLink    string           `json:"selfLink,omitempty"`
}

NetworkObjectGroup represents a network object group.

type NetworkObjectGroupCollection

type NetworkObjectGroupCollection struct {
	RangeInfo RangeInfo             `json:"rangeInfo"`
	Items     []*NetworkObjectGroup `json:"items"`
	Kind      string                `json:"kind"`
	SelfLink  string                `json:"selfLink"`
}

NetworkObjectGroupCollection represents a collection of network object groups.

type NetworkService

type NetworkService struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Value       string `json:"value"`
	Kind        string `json:"kind"`
	ObjectID    string `json:"objectId,omitempty"`
	SelfLink    string `json:"selfLink,omitempty"`
}

NetworkService represents a network service.

type NetworkServiceCollection

type NetworkServiceCollection struct {
	RangeInfo RangeInfo         `json:"rangeInfo"`
	Items     []*NetworkService `json:"items"`
	Kind      string            `json:"kind"`
	SelfLink  string            `json:"selfLink"`
}

NetworkServiceCollection represents a collection of network services.

type NetworkServiceGroup

type NetworkServiceGroup struct {
	Name        string           `json:"name"`
	Description string           `json:"description,omitempty"`
	Members     []*ServiceObject `json:"members"`
	Kind        string           `json:"kind"`
	ObjectID    string           `json:"objectId,omitempty"`
	SelfLink    string           `json:"selfLink,omitempty"`
}

NetworkServiceGroup represents a network service group.

type NetworkServiceGroupCollection

type NetworkServiceGroupCollection struct {
	RangeInfo RangeInfo              `json:"rangeInfo"`
	Items     []*NetworkServiceGroup `json:"items"`
	Kind      string                 `json:"kind"`
	SelfLink  string                 `json:"selfLink"`
}

NetworkServiceGroupCollection represents a collection of network service groups.

type PhysicalInterface

type PhysicalInterface struct {
	HardwareID        string     `json:"hardwareID"`
	InterfaceDesc     string     `json:"interfaceDesc"`
	ChannelGroupID    string     `json:"channelGroupID"`
	ChannelGroupMode  string     `json:"channelGroupMode"`
	Duplex            string     `json:"duplex,omitempty"`
	FlowcontrolOn     bool       `json:"flowcontrolOn"`
	FlowcontrolHigh   int        `json:"flowcontrolHigh"`
	FlowcontrolLow    int        `json:"flowcontrolLow"`
	FlowcontrolPeriod int        `json:"flowcontrolPeriod"`
	ForwardTrafficCX  bool       `json:"forwardTrafficCX"`
	ForwardTrafficSFR bool       `json:"forwardTrafficSFR"`
	LacpPriority      int        `json:"lacpPriority"`
	ActiveMacAddress  string     `json:"activeMacAddress"`
	StandByMacAddress string     `json:"standByMacAddress"`
	ManagementOnly    bool       `json:"managementOnly"`
	Mtu               int        `json:"mtu"`
	Name              string     `json:"name"`
	SecurityLevel     int        `json:"securityLevel"`
	Shutdown          bool       `json:"shutdown"`
	Speed             string     `json:"speed,omitempty"`
	IPAddress         *IPAddress `json:"ipAddress,omitempty"`
	Ipv6Info          *IPv6Info  `json:"ipv6Info,omitempty"`
	Kind              string     `json:"kind"`
	ObjectID          string     `json:"objectId,omitempty"`
	SelfLink          string     `json:"selfLink,omitempty"`
}

PhysicalInterface represents an interface.

type PhysicalInterfaceCollection

type PhysicalInterfaceCollection struct {
	RangeInfo RangeInfo            `json:"rangeInfo"`
	Items     []*PhysicalInterface `json:"items"`
	Kind      string               `json:"kind"`
	SelfLink  string               `json:"selfLink"`
}

PhysicalInterfaceCollection represents a collection of physical interfaces.

type RangeInfo

type RangeInfo struct {
	Offset int `json:"offset"`
	Limit  int `json:"limit"`
	Total  int `json:"total"`
}

RangeInfo common data type amongst object types

type RoutingObject

type RoutingObject struct {
	DistanceMetric int            `json:"distanceMetric"`
	Gateway        *AddressObject `json:"gateway"`
	Interface      struct {
		Name     string `json:"name"`
		Kind     string `json:"kind"`
		ObjectID string `json:"objectId,omitempty"`
	} `json:"interface"`
	Network  *AddressObject `json:"network"`
	Tracked  bool           `json:"tracked,omitempty"`
	Tunneled bool           `json:"tunneled,omitempty"`
	Kind     string         `json:"kind"`
	ObjectID string         `json:"objectId,omitempty"`
	SelfLink string         `json:"selfLink,omitempty"`
}

RoutingObject represents a routing object.

type RoutingObjectCollection

type RoutingObjectCollection struct {
	RangeInfo RangeInfo        `json:"rangeInfo"`
	Items     []*RoutingObject `json:"items"`
	Kind      string           `json:"kind"`
	SelfLink  string           `json:"selfLink"`
}

RoutingObjectCollection represents a collection of routing objects.

type RuleLogging

type RuleLogging struct {
	LogStatus   string `json:"logStatus,omitempty"`
	LogInterval int    `json:"logInterval,omitempty"`
}

RuleLogging represents the rule logging settings

type ServiceObject

type ServiceObject struct {
	Value    string `json:"value,omitempty"`
	Kind     string `json:"kind"`
	ObjectID string `json:"objectId,omitempty"`
	Reflink  string `json:"refLink,omitempty"`
}

ServiceObject represents an service object.

func (*ServiceObject) String

func (o *ServiceObject) String() string

String returns the numerical description of the service.

type SlaTracking added in v0.2.3

type SlaTracking struct {
	SlaId                   int    `json:"slaId"`
	TrackedIP               string `json:"trackedIP"`
	FrequencyInSeconds      int    `json:"frequencyInSeconds"`
	DataSizeInBytes         int    `json:"dataSizeInBytes"`
	ThresholdInMilliseconds int    `json:"thresholdInMilliseconds"`
	ToS                     int    `json:"ToS"`
	TimeoutInMilliseconds   int    `json:"timeoutInMilliseconds"`
	NumPackets              int    `json:"numPackets"`
}

SlaTracking represents an SlaTracking Settings.

type UpdateExtendedACLACEOptions added in v0.2.0

type UpdateExtendedACLACEOptions struct {
	Active      bool
	Dst         string
	DstService  string
	Permit      bool
	Remarks     []string
	Position    int
	RuleLogging *RuleLogging
	Src         string
	SrcService  string
}

type VlanInterface

type VlanInterface struct {
	HardwareID        string     `json:"hardwareID"`
	InterfaceDesc     string     `json:"interfaceDesc"`
	ForwardTrafficCX  bool       `json:"forwardTrafficCX"`
	ForwardTrafficSFR bool       `json:"forwardTrafficSFR"`
	ActiveMacAddress  string     `json:"activeMacAddress"`
	StandByMacAddress string     `json:"standByMacAddress"`
	ManagementOnly    bool       `json:"managementOnly"`
	Mtu               int        `json:"mtu"`
	Name              string     `json:"name"`
	SecurityLevel     int        `json:"securityLevel"`
	Shutdown          bool       `json:"shutdown"`
	VlanID            int        `json:"vlanID"`
	IPAddress         *IPAddress `json:"ipAddress,omitempty"`
	Ipv6Info          *IPv6Info  `json:"ipv6Info,omitempty"`
	Kind              string     `json:"kind"`
	ObjectID          string     `json:"objectId,omitempty"`
	SelfLink          string     `json:"selfLink,omitempty"`
}

VlanInterface represents an vlan interface.

type VlanInterfaceCollection

type VlanInterfaceCollection struct {
	RangeInfo RangeInfo        `json:"rangeInfo"`
	Items     []*VlanInterface `json:"items"`
	Kind      string           `json:"kind"`
	SelfLink  string           `json:"selfLink"`
}

VlanInterfaceCollection represents a collection of vlan interfaces.

Jump to

Keyboard shortcuts

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