huaweicloud

package
v19.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 42 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FloatingIP

type FloatingIP struct {
	ID              string `json:"id"`
	Status          string `json:"status"`
	Type            string `json:"type"`
	PublicIPAddress string `json:"public_ip_address"`
	TenantID        string `json:"tenant_id"`
	CreateTime      string `json:"create_time"`
	BandwidthSize   int    `json:"bandwidth_size"`
}

FloatingIP represents a FlexibleEngine Floating IP

type ListOpts

type ListOpts struct {
	Marker string `json:"marker,omitempty"`
	Limit  int    `json:"limit,omitempty"`
}

ListOpts to define parameter of list

type Stack

type Stack struct {
	// use openstack stack when fully openstack compliant
	*openstack.Stack
	// contains filtered or unexported fields
}

Stack is the implementation for huaweicloud cloud stack

func New

New authenticates and return interface Stack

func (*Stack) AssociateFloatingIP

func (s *Stack) AssociateFloatingIP(host *resources.Host, id string) error

AssociateFloatingIP to host

func (*Stack) CreateFloatingIP

func (s *Stack) CreateFloatingIP() (*FloatingIP, error)

CreateFloatingIP creates a floating IP

func (*Stack) CreateGateway

func (s *Stack) CreateGateway(req resources.GatewayRequest) (*resources.Host, *userdata.Content, error)

CreateGateway creates a gateway for a network. By current implementation, only one gateway can exist by Network because the object is intended to contain only one hostID

func (*Stack) CreateHost

func (s *Stack) CreateHost(request resources.HostRequest) (host *resources.Host, userData *userdata.Content, err error)

CreateHost creates a new host On success returns an instance of resources.Host, and a string containing the script to execute to finalize host installation

func (*Stack) CreateNetwork

func (s *Stack) CreateNetwork(req resources.NetworkRequest) (network *resources.Network, err error)

CreateNetwork creates a network (ie a subnet in the network associated to VPC in FlexibleEngine

func (*Stack) CreateVIP

func (s *Stack) CreateVIP(networkID string, name string) (*resources.VIP, error)

CreateVIP creates a private virtual IP If public is set to true,

func (*Stack) CreateVPC

func (s *Stack) CreateVPC(req VPCRequest) (*VPC, error)

CreateVPC creates a network, which is managed by VPC in FlexibleEngine

func (*Stack) CreateVolume

func (s *Stack) CreateVolume(request resources.VolumeRequest) (*resources.Volume, error)

CreateVolume creates a block volume

func (*Stack) CreateVolumeAttachment

func (s *Stack) CreateVolumeAttachment(request resources.VolumeAttachmentRequest) (string, error)

CreateVolumeAttachment attaches a volume to an host

func (*Stack) DeleteFloatingIP

func (s *Stack) DeleteFloatingIP(id string) error

DeleteFloatingIP deletes a floating IP

func (*Stack) DeleteGateway

func (s *Stack) DeleteGateway(id string) error

DeleteGateway deletes the gateway associated with network identified by ID

func (*Stack) DeleteHost

func (s *Stack) DeleteHost(id string) error

DeleteHost deletes the host identified by id

func (*Stack) DeleteNetwork

func (s *Stack) DeleteNetwork(id string) error

DeleteNetwork consists to delete subnet in FlexibleEngine VPC

func (*Stack) DeleteVPC

func (s *Stack) DeleteVPC(id string) error

DeleteVPC deletes a Network (ie a VPC in Huawei Cloud) identified by 'id'

func (*Stack) DeleteVolumeAttachment

func (s *Stack) DeleteVolumeAttachment(serverID, vaID string) error

DeleteVolumeAttachment deletes the volume attachment identifed by id

func (*Stack) DissociateFloatingIP

func (s *Stack) DissociateFloatingIP(host *resources.Host, id string) error

DissociateFloatingIP from host

func (*Stack) FindFloatingIPByIP

func (s *Stack) FindFloatingIPByIP(ipAddress string) (*FloatingIP, error)

FindFloatingIPByIP returns FloatingIP instance associated with 'ipAddress'

func (*Stack) GetAuthOpts

func (s *Stack) GetAuthOpts() (providers.Config, error)

GetAuthOpts returns the auth options

func (*Stack) GetAuthenticationOptions

func (s *Stack) GetAuthenticationOptions() stacks.AuthenticationOptions

GetAuthenticationOptions ...

func (*Stack) GetConfigurationOptions

func (s *Stack) GetConfigurationOptions() stacks.ConfigurationOptions

GetConfigurationOptions ...

func (*Stack) GetFloatingIP

func (s *Stack) GetFloatingIP(id string) (*FloatingIP, error)

GetFloatingIP returns FloatingIP instance corresponding to ID 'id'

func (*Stack) GetNetwork

func (s *Stack) GetNetwork(id string) (*resources.Network, error)

GetNetwork returns the network identified by id

func (*Stack) GetNetworkByName

func (s *Stack) GetNetworkByName(name string) (*resources.Network, error)

GetNetworkByName ...

func (*Stack) GetVPC

func (s *Stack) GetVPC(id string) (*VPC, error)

GetVPC returns the information about a VPC identified by 'id'

func (*Stack) GetVolume

func (s *Stack) GetVolume(id string) (*resources.Volume, error)

GetVolume returns the volume identified by id If volume not found, returns (nil, nil) - TODO: returns utils.ErrNotFound

func (*Stack) GetVolumeAttachment

func (s *Stack) GetVolumeAttachment(serverID, id string) (*resources.VolumeAttachment, error)

GetVolumeAttachment returns the volume attachment identified by id

func (*Stack) InitDefaultSecurityGroup

func (s *Stack) InitDefaultSecurityGroup() error

InitDefaultSecurityGroup create an open Security Group The default security group opens all TCP, UDP, ICMP ports Security is managed individually on each host using a linux firewall

func (*Stack) InspectHost

func (s *Stack) InspectHost(hostParam interface{}) (host *resources.Host, err error)

InspectHost updates the data inside host with the data from provider

func (*Stack) ListFloatingIPs

func (s *Stack) ListFloatingIPs() pagination.Pager

ListFloatingIPs lists all the floating IP currently requested for the VPC

func (*Stack) ListHosts

func (s *Stack) ListHosts() ([]*resources.Host, error)

ListHosts lists available hosts

func (*Stack) ListNetworks

func (s *Stack) ListNetworks() ([]*resources.Network, error)

ListNetworks lists networks

func (*Stack) ListVPCs

func (s *Stack) ListVPCs() ([]VPC, error)

ListVPCs lists all the VPC created

func (*Stack) ListVolumeAttachments

func (s *Stack) ListVolumeAttachments(serverID string) ([]resources.VolumeAttachment, error)

ListVolumeAttachments lists available volume attachment

func (*Stack) ListVolumes

func (s *Stack) ListVolumes() ([]resources.Volume, error)

ListVolumes lists volumes

func (*Stack) WaitHostReady

func (s *Stack) WaitHostReady(hostParam interface{}, timeout time.Duration) (*resources.Host, error)

WaitHostReady waits an host achieve ready state hostParam can be an ID of host, or an instance of *resources.Host; any other type will return an utils.ErrInvalidParameter.

type VPC

type VPC struct {
	ID      string `json:"id"`
	Name    string `json:"name,omitempty"`
	CIDR    string `json:"cidr,omitempty"`
	Status  string `json:"status,omitempty"`
	Network *networks.Network
	Router  *routers.Router
}

VPC contains information about a VPC

type VPCRequest

type VPCRequest struct {
	Name string `json:"name"`
	CIDR string `json:"cidr"`
}

VPCRequest defines a request to create a VPC

Jump to

Keyboard shortcuts

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