ports

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteURL

func DeleteURL(c *golangsdk.ServiceClient, portId string) string

func GetURL

func GetURL(c *golangsdk.ServiceClient, portId string) string

func UpdateURL

func UpdateURL(c *golangsdk.ServiceClient, portId string) string

Types

type CreateOpts

type CreateOpts struct {
	// Specifies the ID of the network to which the port belongs. The
	// network ID must be a real one in the network environment.
	NetworkId string `json:"network_id" required:"true"`

	DeviceOwner string `json:"device_owner,omitempty"`

	FixedIPs []FixIPEntity `json:"fixed_ips,omitempty"`
}

func (CreateOpts) ToPortsCreateMap

func (opts CreateOpts) ToPortsCreateMap() (map[string]interface{}, error)

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToPortsCreateMap() (map[string]interface{}, error)
}

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

func (CreateResult) Extract

func (r CreateResult) Extract() (*common.Port, error)

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

func Delete(client *golangsdk.ServiceClient, portId string) (r DeleteResult)

type FixIPEntity

type FixIPEntity struct {
	SubnetID  string `json:"subnet_id,omitempty"`
	IPAddress string `json:"ip_address,omitempty"`
}

FixIPEntity 私有IP的结构体

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

func Get

func Get(client *golangsdk.ServiceClient, portId string) (r GetResult)

func (GetResult) Extract

func (r GetResult) Extract() (*common.Port, error)

type ListOpts

type ListOpts struct {
	Limit          int      `q:"limit"`
	Offset         int      `q:"offset"`
	ID             string   `q:"id"`
	Name           string   `q:"name"`
	AdminStateUp   bool     `q:"admin_state_up"`
	DeviceID       string   `q:"device_id"`
	DeviceOwner    string   `q:"device_owner"`
	FixedIPs       []string `q:"fixed_ips"`
	MacAddress     string   `q:"mac_address"`
	NetworkID      string   `q:"network_id"`
	SecurityGroups string   `q:"security_groups"`
	Status         string   `q:"status"`
}

func (ListOpts) ToListPortsQuery

func (opts ListOpts) ToListPortsQuery() (string, error)

type ListPortsOptsBuilder

type ListPortsOptsBuilder interface {
	ToListPortsQuery() (string, error)
}

type ListResult

type ListResult struct {
	// contains filtered or unexported fields
}

func List

func (ListResult) Extract

func (r ListResult) Extract() (*Ports, error)

type Ports

type Ports struct {
	Ports []common.Port `json:"ports"`
	Count int           `json:"count"`
}

Ports 端口列表对象

type UpdateOpts

type UpdateOpts struct {
	// Specifies the port name. The value can contain no more than 255
	// characters. This parameter is left blank by default.
	Name string `json:"name,omitempty"`

	// Specifies the UUID of the security group.
	// This attribute is extended.
	SecurityGroups *[]string `json:"security_groups,omitempty"`

	// 1. Specifies a set of zero or more allowed address pairs. An
	// address pair consists of an IP address and MAC address. This attribute is extended.
	// For details, see parameter?allow_address_pair. 2. The IP address cannot be?0.0.0.0.
	// 3. Configure an independent security group for the port if a large CIDR block (subnet
	// mask less than 24) is configured for parameter?allowed_address_pairs.
	AllowedAddressPairs *[]common.AllowedAddressPair `json:"allowed_address_pairs,omitempty"`

	// Specifies a set of zero or more extra DHCP option pairs. An
	// option pair consists of an option value and name. This attribute is extended.
	ExtraDhcpOpts []common.ExtraDHCPOpt `json:"extra_dhcp_opts,omitempty"`
}

func (UpdateOpts) ToPortsUpdateMap

func (opts UpdateOpts) ToPortsUpdateMap() (map[string]interface{}, error)

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToPortsUpdateMap() (map[string]interface{}, error)
}

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

func Update

func Update(client *golangsdk.ServiceClient, portId string, opts UpdateOptsBuilder) (r UpdateResult)

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*common.Port, error)

Jump to

Keyboard shortcuts

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