servers

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

This section is empty.

Types

type CommonFiled

type CommonFiled struct {
	ServerID      string             `json:"origin_server_id,omitempty"`
	EdgeCloudID   string             `json:"edgecloud_id,omitempty"`
	EdgeCloudName string             `json:"edgecloud_name,omitempty"`
	Location      common.GeoLocation `json:"geolocation"`
	Operator      common.Operator    `json:"operator"`
	DomainID      string             `json:"domain_id"`
}

CommonFiled is common filed

type CreateCloudServerResponse

type CreateCloudServerResponse struct {
	Job       Job
	ServerIDs ServerIDs
}

CreateCloudServerResponse is a structure for creating server return values

func CreateServer

func CreateServer(client *golangsdk.ServiceClient, opts CreateOptsBuilder) (createResult CreateCloudServerResponse, err error)

CreateServer requests a server to be provisioned to the user in the current tenant with response entity.

type CreateOpts

type CreateOpts struct {
	common.ResourceOpts
	Coverage common.Coverage `json:"coverage" required:"true"`
}

func (CreateOpts) ToServerCreateMap

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

ToServerCreateMap assembles a request body based on the contents of a CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToServerCreateMap() (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 (CreateResult) ExtractJob

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

func (CreateResult) ExtractServer

func (r CreateResult) ExtractServer() (ServerIDs, error)

ExtractServer is used to extract server struct in response

type DeleteOpts

type DeleteOpts struct {
	Servers []cloudservers.Server `json:"servers"`
}

DeleteOpts to delete all Servers in server array

func (DeleteOpts) ToDeleteBodyMap

func (opts DeleteOpts) ToDeleteBodyMap() (map[string]interface{}, error)

ToDeleteBodyMap converts DeleteOpts structures to map[string]interface{}

type DeleteOptsBuilder

type DeleteOptsBuilder interface {
	ToDeleteBodyMap() (map[string]interface{}, error)
}

DeleteOptsBuilder to handle Delete request's body

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult is the response from a Delete operation. Call its ExtractErr method to determine if the call succeeded or failed.

func DeleteServers

func DeleteServers(client *golangsdk.ServiceClient, opts DeleteOptsBuilder) (r DeleteResult)

DeleteServers deletes all server in DeleteOptsBuilder

type GetResult

type GetResult struct {
	golangsdk.Result
}

GetResult contains the server result

func GetServer

func GetServer(client *golangsdk.ServiceClient, serverID string) (r GetResult)

GetServer get server detail

func (GetResult) ExtractServerDetail

func (r GetResult) ExtractServerDetail() (ServerDetail, error)

ExtractServerDetail 输出边缘实例详情

type Job

type Job struct {
	// job id of create image
	Id string `json:"job_id"`
}

Job 执行创建/删除接口时返回的jobid结构

type JobExecResult

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

func (JobExecResult) ExtractJob

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

func (JobExecResult) ExtractServer

func (r JobExecResult) ExtractServer() (ServerIDs, error)

ExtractServer is used to extract server struct in response

type ListOpts

type ListOpts struct {
	Limit       int    `q:"limit"`
	Offset      int    `q:"offset"`
	Name        string `q:"name"`
	Area        string `q:"area"`
	City        string `q:"city"`
	Province    string `q:"province"`
	EdgeCloudID string `q:"edgecloud_id"`
	Status      string `q:"status"`
}

func (ListOpts) ToListServersQuery

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

type ListResult

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

func List

func (ListResult) Extract

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

func (ListResult) ExtractJob

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

func (ListResult) ExtractServer

func (r ListResult) ExtractServer() (ServerIDs, error)

ExtractServer is used to extract server struct in response

type ListServersOptsBuilder

type ListServersOptsBuilder interface {
	ToListServersQuery() (string, error)
}

type Server

type Server struct {
	cloudservers.CloudServer
	CommonFiled
}

Server IEC服务实例的对外呈现结构

type ServerDetail

type ServerDetail struct {
	Server *Server `json:"server"`
}

type ServerIDs

type ServerIDs struct {
	IDs []string `json:"server_ids"`
}

ServerIDs is a serverIds structure returned when you create a server

type Servers

type Servers struct {
	Servers []Server `json:"servers"`
	Count   int      `json:"count"`
}

type UpdateInstance

type UpdateInstance struct {
	UpdateServer UpdateOpts `json:"server"`
}

UpdateInstance to update one server

func (UpdateInstance) ToUpdateBodyMap

func (opts UpdateInstance) ToUpdateBodyMap() (map[string]interface{}, error)

ToUpdateBodyMap converts UpdateInstance structures to map[string]interface{}

type UpdateOpts

type UpdateOpts struct {
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
}

UpdateOpts to update one server options

type UpdateOptsBuilder

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

UpdateOptsBuilder to handle Delete request's body

type UpdateResult

type UpdateResult struct {
	golangsdk.Result
}

UpdateResult contains the update result

func UpdateServer

func UpdateServer(client *golangsdk.ServiceClient, opts UpdateOptsBuilder, serverID string) (r UpdateResult)

UpdateServer updates one server in UpdateOptsBuilder

func (UpdateResult) ExtractUpdateToServer

func (r UpdateResult) ExtractUpdateToServer() (interface{}, error)

ExtractUpdateToServer extract CloudServer struct from UpdateResult

Jump to

Keyboard shortcuts

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