vpcs

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: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteURL

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

func ExtractVpcs

func ExtractVpcs(r pagination.Page) ([]common.VPC, error)

func GetURL

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

func UpdateURL

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

Types

type CreateOpts

type CreateOpts struct {
	//vpc name
	Name string `json:"name" required:"true"`
	//cidr,172.16.0.0/12~172.248.255.0/24
	Cidr string `json:"cidr" required:"true"`

	//mode,SYSTEM or CUSTOMER,SYSTEM: system will design and create subnet when you need;
	// CUSTOMER: you should design and create by yourself
	Mode string `json:"mode" required:"true"`
}

func (CreateOpts) ToVPCCreateMap

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

ToSecurityGroupsCreateMap converts CreateOpts structures to map[string]interface{}

type CreateOptsBuilder

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

CreateOptsBuilder allows extensions to add additional parameters to the create request.

type CreateResult

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

func Create

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

Create create vpc

func (CreateResult) Extract

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

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

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

Delete delete the vpc

type GetResult

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

func Get

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

Get get vpc detail

func (GetResult) Extract

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

type ListOpts

type ListOpts struct {
	Limit  int `q:"limit"`
	Offset int `q:"offset"`

	// ID is the unique identifier for the vpc.
	ID string `q:"id"`

	// Name is the human readable name for the vpc. It does not have to be unique.
	Name string `q:"name"`
}

ListOpts allows the filtering collections through the API.

func (ListOpts) ToListVPCQuery

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

ToListVPCQuery converts ListVPCOpts structures to query string

type ListResult

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

func List

func List(client *golangsdk.ServiceClient, opts ListVPCOptsBuilder) (r ListResult)

List returns collection of vpcs. It accepts a ListOpts struct, which allows you to filter the returned collection for greater efficiency.

func (ListResult) Extract

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

type ListVPCOptsBuilder

type ListVPCOptsBuilder interface {
	ToListVPCQuery() (string, error)
}

type UpdateOpts

type UpdateOpts struct {
	// Specifies the name of the VPC. The name must be unique for a
	// tenant. The value is a string of no more than 64 characters and can contain digits,
	// letters, underscores (_), and hyphens (-).
	Name string `json:"name,omitempty"`

	// Specifies the range of available subnets in the VPC. The value
	// must be in CIDR format, for example, 192.168.0.0/16. The value ranges from 10.0.0.0/8
	// to 10.255.255.0/24, 172.16.0.0/12 to 172.31.255.0/24, or 192.168.0.0/16 to
	// 192.168.255.0/24.
	Cidr string `json:"cidr,omitempty"`
}

func (UpdateOpts) ToVPCUpdateMap

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

type UpdateOptsBuilder

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

type UpdateResult

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

func Update

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

Update update vpc info,name especially

func (UpdateResult) Extract

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

type UpdateStatusResult

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

type VpcPage

type VpcPage struct {
	pagination.LinkedPageBase
}

func (VpcPage) IsEmpty

func (r VpcPage) IsEmpty() (bool, error)

IsEmpty checks whether a NetworkPage struct is empty.

type Vpcs

type Vpcs struct {
	Vpcs  []common.VPC `json:"vpcs"`
	Count int          `json:"count"`
}

Vpcs vpc列表对象

Jump to

Keyboard shortcuts

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