Documentation ¶
Overview ¶
Package portsecurity provides information and interaction with the port security extension for the OpenStack Networking service.
Example to List Networks with Port Security Information
type NetworkWithPortSecurityExt struct { networks.Network portsecurity.PortSecurityExt } var allNetworks []NetworkWithPortSecurityExt listOpts := networks.ListOpts{ Name: "network_1", } allPages, err := networks.List(networkClient, listOpts).AllPages() if err != nil { panic(err) } err = networks.ExtractNetworksInto(allPages, &allNetworks) if err != nil { panic(err) } for _, network := range allNetworks { fmt.Println("%+v\n", network) }
Example to Get a Port with Port Security Information
var portWithExtensions struct { ports.Port portsecurity.PortSecurityExt } portID := "46d4bfb9-b26e-41f3-bd2e-e6dcc1ccedb2" err := ports.Get(networkingClient, portID).ExtractInto(&portWithExtensions) if err != nil { panic(err) } fmt.Println("%+v\n", portWithExtensions)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NetworkCreateOptsExt ¶
type NetworkCreateOptsExt struct { networks.CreateOptsBuilder // PortSecurityEnabled toggles port security on a port. PortSecurityEnabled *bool `json:"port_security_enabled,omitempty"` }
NetworkCreateOptsExt adds port security options to the base networks.CreateOpts.
func (NetworkCreateOptsExt) ToNetworkCreateMap ¶
func (opts NetworkCreateOptsExt) ToNetworkCreateMap() (map[string]interface{}, error)
ToNetworkCreateMap casts a CreateOpts struct to a map.
type PortCreateOptsExt ¶
type PortCreateOptsExt struct { ports.CreateOptsBuilder // PortSecurityEnabled toggles port security on a port. PortSecurityEnabled *bool `json:"port_security_enabled,omitempty"` }
PortCreateOptsExt adds port security options to the base ports.CreateOpts.
func (PortCreateOptsExt) ToPortCreateMap ¶
func (opts PortCreateOptsExt) ToPortCreateMap() (map[string]interface{}, error)
ToPortCreateMap casts a CreateOpts struct to a map.
type PortSecurityExt ¶
type PortSecurityExt struct { // PortSecurityEnabled specifies whether port security is enabled or // disabled. PortSecurityEnabled bool `json:"port_security_enabled"` }
Click to show internal directories.
Click to hide internal directories.