instances

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestOpts golangsdk.RequestOpts = golangsdk.RequestOpts{
	MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"},
}

Functions

This section is empty.

Types

type CreateOpts

type CreateOpts struct {
	Name string `json:"name" required:"true"`

	Version string `json:"version" required:"true"`

	Network NetworkOpts `json:"network" required:"true"`

	Agency string `json:"agency,omitempty"`

	FlavorRef string `json:"flavorRef" required:"true"`

	MrsCluster MrsClusterOpts `json:"mrsCluster" required:"true"`
}

CreateOpts is a struct that contains all the parameters.

func (CreateOpts) ToInstanceCreateMap

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

type CreateOptsBuilder

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

CreateOptsBuilder is used for creating instance parameters. any struct providing the parameters should implement this interface

type CreateResult

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

func Create

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

Create an instance with given parameters.

func (CreateResult) Extract

func (r CreateResult) Extract() (*Instance, error)

Extract will get the Instance object out of the commonResult object.

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

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

delete an instance via id

type GetResult

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

func Get

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

get an instance with detailed information by id

func (GetResult) Extract

func (r GetResult) Extract() (*Instance, error)

Extract will get the Instance object out of the commonResult object.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type Instance

type Instance struct {
	ID             string     `json:"id"`
	Name           string     `json:"name"`
	Version        string     `json:"version"`
	FlavorRef      string     `json:"flavorRef"`
	Status         string     `json:"status"`
	CurrentTask    string     `json:"currentTask"`
	Network        Network    `json:"network"`
	MrsCluster     MrsCluster `json:"mrsCluster"`
	Created        string     `json:"created"`
	Updated        string     `json:"updated"`
	InnerEndPoint  string     `json:"innerEndPoint"`
	PublicEndPoint string     `json:"publicEndPoint"`
}

type MrsCluster

type MrsCluster struct {
	Id string `json:"id"`
}

type MrsClusterOpts

type MrsClusterOpts struct {
	Id           string `json:"id" required:"true"`
	UserName     string `json:"userName,omitempty"`
	UserPassword string `json:"userPassword,omitempty"`
}

type Network

type Network struct {
	VpcId           string   `json:"vpcId"`
	SubnetId        string   `json:"subnetId"`
	SecurityGroupId string   `json:"securityGroupId"`
	AvailableZone   string   `json:"availableZone"`
	PublicIP        PublicIP `json:"publicIP"`
}

type NetworkOpts

type NetworkOpts struct {
	VpcId           string       `json:"vpcId" required:"true"`
	SubnetId        string       `json:"subnetId" required:"true"`
	SecurityGroupId string       `json:"securityGroupId,omitempty"`
	AvailableZone   string       `json:"availableZone" required:"true"`
	PublicIP        PublicIPOpts `json:"publicIP" required:"true"`
}

type PublicIP

type PublicIP struct {
	BindType string `json:"bindType"`
	EipId    string `json:"eipId"`
}

type PublicIPOpts

type PublicIPOpts struct {
	BindType string `json:"bindType" required:"true"`
}

Jump to

Keyboard shortcuts

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