nics

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNics

func AddNics(client *gophercloud.ServiceClient, seviceId string, opts AddOptsBuilder) (jobId string, err error)

Adding nics to an ecs in batches based on the configuration defined in the AddOpts struct.

func DeleteNics

func DeleteNics(client *gophercloud.ServiceClient, seviceId string, opts DelOptsBuilder) (jobId string, err error)

Deleting nics from an ecs in batches based on the configuration defined in the DelOpts struct.

Types

type AddOpts

type AddOpts struct {
	Nics []Nic `json:"nics"`
}

AddOpts represents options for add nics.

func (AddOpts) ToAddNicsOptsMap

func (opts AddOpts) ToAddNicsOptsMap() (map[string]interface{}, error)

ToAddNicsOptsMap builds a request body from AddOpts.

type AddOptsBuilder

type AddOptsBuilder interface {
	ToAddNicsOptsMap() (map[string]interface{}, error)
}

AddOptsBuilder allows extensions to add additional parameters to the AddNics request.

type AddResult

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

AddResult represents the result of a add operation. Call its ExtractJob method to get the JobId.

func (AddResult) ExtractJob

func (r AddResult) ExtractJob() (Job, error)

ExtractJob is a function that accepts a result get the JobId

type BindOpts

type BindOpts struct {
	// Specifies the subnet ID of the NIC.
	SubnetId string `json:"subnet_id" required:"true"`

	// Specifies the virtual IP address to be bound to a NIC.
	IpAddress string `json:"ip_address" required:"true"`

	// Indicates the allowed_address_pairs attribute of a virtual IP address,
	// specifying whether the NIC IP/MAC address pair is added.
	ReverseBinding *bool `json:"reverse_binding" required:"true"`

	// Specifies the DHCP, router, LB, or Nova to which a device belongs.
	DeviceOwner string `json:"device_owner,omitempty"`
}

BindOpts represents options for binding a virtual ip address to an ecs nic.

func (BindOpts) ToBindOptsMap

func (opts BindOpts) ToBindOptsMap() (map[string]interface{}, error)

ToBindOptsMap builds a request body from BindOpts.

type BindOptsBuilder

type BindOptsBuilder interface {
	ToBindOptsMap() (map[string]interface{}, error)
}

BindOptsBuilder allows extensions to add additional parameters to the BindOpts request.

type BindResult

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

BindResult represents the result of bind operation and unbind operation. Call its ExtractPortId method to get the portId.

func BindNic

func BindNic(c *gophercloud.ServiceClient, nicId string, opts BindOptsBuilder) (r BindResult)

Binding a virtual ip address to an ecs nic based on the configuration defined in the BindOpts struct.

func UnBindNic

func UnBindNic(c *gophercloud.ServiceClient, nicId string, opts UnBindOptsBuilder) (r BindResult)

Unbinding a virtual ip address to an ecs nic based on the configuration defined in the UnBindOpts struct.

func (BindResult) ExtractJob

func (r BindResult) ExtractJob() (Job, error)

ExtractJob is a function that accepts a result get the JobId

func (BindResult) ExtractPortId

func (r BindResult) ExtractPortId() (string, error)

ExtractPortId is a function that accepts a result get the PortId

type DelOpts

type DelOpts struct {
	Nics []Nics `json:"nics"`
}

AddOpts represents options for delete nics.

func (DelOpts) ToDelNicsOptsMap

func (opts DelOpts) ToDelNicsOptsMap() (map[string]interface{}, error)

ToDelNicsOptsMap builds a request body from DelOpts.

type DelOptsBuilder

type DelOptsBuilder interface {
	ToDelNicsOptsMap() (map[string]interface{}, error)
}

DelOptsBuilder allows extensions to add additional parameters to the DeleteNics request.

type DelResult

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

DelResult represents the result of a delete operation. Call its ExtractJob method to get the JobId.

func (DelResult) ExtractJob

func (r DelResult) ExtractJob() (Job, error)

ExtractJob is a function that accepts a result get the JobId

type Job

type Job struct {
	//jobId
	Id string `json:"job_id"`
}

type Nic

type Nic struct {
	// Specifies the subnet ID of the NIC to be added.
	SubnetId string `json:"subnet_id" required:"true"`

	// Specifies the IP address.
	// If this parameter is unavailable, the IP address is automatically assigned.
	IpAddress string `json:"ip_address,omitempty"`

	// Specifies the security groups for NICs.
	SecurityGroups []SecurityGroup `json:"security_groups"`
}

type Nics

type Nics struct {
	//Specifies the port ID of the NIC.
	ID string `json:"id"`
}

type Port

type Port struct {
	// Specifies the ECS NIC ID.
	PortId string `json:"port_id"`
}

type SecurityGroup

type SecurityGroup struct {
	//Specifies the ID of the security group.
	ID string `json:"id" required:"true"`
}

type UnBindOpts

type UnBindOpts struct {
	// Specifies the subnet ID of the NIC.
	// This parameter must be left blank when you unbind the virtual IP address from an ECS NIC.
	SubnetId string `json:"subnet_id"`

	// Specifies the virtual IP address to be unbound from a NIC.
	// This parameter must be left blank when you unbind the virtual IP address from an ECS NIC.
	IpAddress string `json:"ip_address"`

	// Indicates the allowed_address_pairs attribute of a virtual IP address,
	// specifying whether the NIC IP/MAC address pair is added.
	ReverseBinding *bool `json:"reverse_binding,omitempty"`
}

UnBindOpts represents options for unbinding a virtual ip address to an ecs nic.

func (UnBindOpts) ToUnBindOptsMap

func (opts UnBindOpts) ToUnBindOptsMap() (map[string]interface{}, error)

ToUnBindOptsMap builds a request body from UnBindOpts.

type UnBindOptsBuilder

type UnBindOptsBuilder interface {
	ToUnBindOptsMap() (map[string]interface{}, error)
}

UnBindOptsBuilder allows extensions to add additional parameters to the UnBindOpts request.

Directories

Path Synopsis
nics unit tests
nics unit tests

Jump to

Keyboard shortcuts

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