api

package
v0.9.22 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package api defines all APIs supported by the BIE service of BCE.

Package api defines all APIs supported by the BIE service of BCE.

const.go - define common constants

Package api defines all APIs supported by the BIE service of BCE.

Package api defines all APIs supported by the BIE service of BCE.

Package api defines all APIs supported by the BIE service of BCE.

Package api defines all APIs supported by the BIE service of BCE.

Index

Constants

View Source
const (
	PREFIX_V3MODSYS = "/v3/module/system"
	PREFIX_V3MODUSR = "/v3/module/user"
)
View Source
const (
	PREFIX_V3VOLTPL = "/v3/volumeTemplate"
	PREFIX_V3VOL    = "/v3/volume"
)
View Source
const (
	PREFIX = "/v3/group"
)
View Source
const (
	PREFIX_V3CORE = "/v3/core"
)

Variables

This section is empty.

Functions

func ClearVolFile

func ClearVolFile(cli bce.Client, name string) error

ClearVolFile - clear all volume files

PARAMS:

  • cli: the client agent which can perform sending request
  • name: the requested volume name

RETURNS:

  • error: nil if ok otherwise the specific error

func DeleteGroup

func DeleteGroup(cli bce.Client, groupUuid string) error

DeleteGroup - delete a group of the account

PARAMS:

  • cli: the client agent which can perform sending request
  • groupUuid: id of the group

RETURNS:

  • error: nil if ok otherwise the specific error

func DeleteImageUser

func DeleteImageUser(cli bce.Client, uuid string) error

DeleteImageUser - delete a user docker image

PARAMS:

  • cli: the client agent which can perform sending request
  • uuid: the image uuid

RETURNS:

  • error: nil if ok otherwise the specific error

func DeleteService

func DeleteService(cli bce.Client, ivn *IdVerName) error

DeleteService - delete a service

PARAMS:

  • cli: the client agent which can perform sending request
  • *IdVerName: coreid, version, and name

RETURNS:

  • error: nil if ok otherwise the specific error

func DeleteVolFile

func DeleteVolFile(cli bce.Client, name string, filename string) error

DeleteVolFile - delete a volume file

PARAMS:

  • cli: the client agent which can perform sending request
  • name: the requested volume name
  • filename: the requested volume filename

RETURNS:

  • error: nil if ok otherwise the specific error

func DeleteVolume

func DeleteVolume(cli bce.Client, name string) error

DeleteVolume - delete a volume

PARAMS:

  • cli: the client agent which can perform sending request
  • name: the requested volume name

RETURNS:

  • error: nil if ok otherwise the specific error

func DeployConfig

func DeployConfig(cli bce.Client, coreid string, ver string) error

DeployConfig - deploy a config

PARAMS:

  • cli: the client agent which can perform sending request
  • coreid: id of the core
  • ver: version, e.g:$LATEST

RETURNS:

  • error: nil if ok otherwise the specific error

func EditCoreVolVer

func EditCoreVolVer(cli bce.Client, name string,
	ecvr *EditCoreVolVerReq) error

EditCoreVolVer - edit core version

PARAMS:

  • cli: the client agent which can perform sending request
  • name: the volume name
  • *EditCoreVolVerReq: the request parameters

RETURNS:

  • error: nil if ok otherwise the specific error

func Get

func Get(cli bce.Client, ghr *GetHttpReq) error

func ImportBos

func ImportBos(cli bce.Client, name string,
	ibr *ImportBosReq) error

ImportBos - import a BOS file into volume

PARAMS:

  • cli: the client agent which can perform sending request
  • name: the volume name
  • *ImportBosReq: the request parameters

RETURNS:

  • error: nil if ok otherwise the specific error

func ImportCfc

func ImportCfc(cli bce.Client, name string,
	icr *ImportCfcReq) error

ImportCfc - import a CFC function into volume

PARAMS:

  • cli: the client agent which can perform sending request
  • name: the volume name
  • *ImportCfcReq: the request parameters

RETURNS:

  • error: nil if ok otherwise the specific error

func Post

func Post(cli bce.Client, phr *PostHttpReq) error

func PostOrPut

func PostOrPut(cli bce.Client, phr *PostHttpReq, req *bce.BceRequest) error

func Put

func Put(cli bce.Client, phr *PostHttpReq) error

func ReorderService

func ReorderService(cli bce.Client, ivn *IdVerName, after string) error

ReorderService - reorder service after an other service

PARAMS:

  • cli: the client agent which can perform sending request
  • *IdVerName: coreid, version, and name

RETURNS:

  • error: nil if ok otherwise the specific error

func VolumeOp

func VolumeOp(cli bce.Client, cv *CoreidVersion, vor *VolumeOpReq) error

VolumeOp - attache of detach volumes

PARAMS:

  • cli: the client agent which can perform sending request
  • *CoreidVersion: coreid, version
  • *VolumeOpReq: request parameters

RETURNS:

  • error: nil if ok otherwise the specific error

Types

type CfgDownloadReq

type CfgDownloadReq struct {
	Coreid  string `json:"coreid"`
	Version string `json:"version"`
	WithBin bool   `json:"withBin"`
}

type CfgDownloadResult

type CfgDownloadResult struct {
	Url string `json:"url"`
	Md5 string `json:"md5"`
}

func DownloadConfig

func DownloadConfig(cli bce.Client, cdr *CfgDownloadReq) (*CfgDownloadResult, error)

DownloadConfig - download a config

PARAMS:

  • cli: the client agent which can perform sending request
  • *CfgDownloadReq: id, version, with bin or not

RETURNS:

  • *CfgDownloadResult: the result
  • error: nil if ok otherwise the specific error

type CfgPubBody

type CfgPubBody struct {
	Description string `json:"description"`
}

type CfgRestart

type CfgRestart struct {
	Retry map[string]interface{} `json:"restart"`
}

type CfgResult

type CfgResult struct {
	Uuid           string       `json:"uuid"`
	Status         string       `json:"status"`
	Version        string       `json:"version"`
	Description    string       `json:"description"`
	LastDeployTime string       `json:"lastDeployTime"`
	CreateTime     string       `json:"createTime"`
	ConfigServices []CfgService `json:"configServices"`
	ConfigVolumes  []CfgVolume  `json:"configVolumes"`
}

func GetConfig

func GetConfig(cli bce.Client, coreid string, ver string) (*CfgResult, error)

GetConfig - get a config

PARAMS:

  • cli: the client agent which can perform sending request
  • coreid: id of the core
  • ver: version, e.g:$LATEST

RETURNS:

  • *CfgResult: the result config
  • error: nil if ok otherwise the specific error

func PubConfig

func PubConfig(cli bce.Client, cpr *CoreidVersion, cpb *CfgPubBody) (*CfgResult, error)

PubConfig - pub a config

PARAMS:

  • cli: the client agent which can perform sending request
  • cpr: id of the core and version

RETURNS:

  • *CfgResult: the pub result
  • error: nil if ok otherwise the specific error

type CfgService

type CfgService struct {
	Uuid           string   `json:"uuid"`
	Name           string   `json:"name"`
	ModuleUuid     string   `json:"moduleUuid"`
	ModuleImage    string   `json:"moduleImage"`
	ModuleName     string   `json:"moduleName"`
	ModuleTags     string   `json:"moduleTags"`
	ModuleCategory string   `json:"moduleCategory"`
	Mounts         []string `json:"mounts"`
	Description    string   `json:"description"`
	CreateTime     string   `json:"createTime"`
}

type CfgVolume

type CfgVolume struct {
	Name       string `json:"name"`
	Version    string `json:"version"`
	HostPath   string `json:"hostPath"`
	Deletable  bool   `json:"deletable"`
	CreateTime string `json:"createTime"`
}

type Config

type Config struct {
	Uuid           string `json:"uuid"`
	Status         string `json:"status"`
	Version        string `json:"version"`
	Description    string `json:"description"`
	LastDeployTime string `json:"lastDeployTime"`
	CreateTime     string `json:"createTime"`
}

type CoreAuth

type CoreAuth struct {
	AuthType    string `json:"authType"`
	Password    string `json:"password"`
	PrivateKey  string `json:"privateKey"`
	Certificate string `json:"certificate"`
	UserName    string `json:"username"`
	Tcp         string `json:"tcp"`
	Hostname    string `json:"hostname"`
	Ssl         string `json:"ssl"`
	Wss         string `json:"wss"`
}

type CoreInfo

type CoreInfo struct {
	DeviceUuid  string   `json:"deviceUuid"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	AuthType    string   `json:"authType"`
	Platform    string   `json:"platform"`
	BinVersion  string   `json:"binVersion"`
	CoreAuth    CoreAuth `json:"coreAuth"`
	DownloadUrl string   `json:"downloadUrl"`
	CreateTime  string   `json:"createTime"`
	UpdateTime  string   `json:"updateTime"`
}

func RenewCoreAuth

func RenewCoreAuth(cli bce.Client, coreid string) (*CoreInfo, error)

RenewCoreAuth - renew the auth of a core

PARAMS:

  • cli: the client agent which can perform sending request
  • coreid: id of the core

RETURNS:

  • *CoreInfo: the result core info
  • error: nil if ok otherwise the specific error

type CoreResult

type CoreResult struct {
	DeviceUuid  string `json:"deviceUuid"`
	Name        string `json:"name"`
	ConfVersion string `json:"confVersion"`
	Report      string `json:"report"`
	AuthType    string `json:"authType"`
	Description string `json:"description"`
	Platform    string `json:"platform"`
	CreateTime  string `json:"createTime"`
	UpdateTime  string `json:"updateTime"`
}

func GetCore

func GetCore(cli bce.Client, groupUuid string, coreid string) (*CoreResult, error)

GetCore - get a core of a group

PARAMS:

  • cli: the client agent which can perform sending request
  • groupUuid: id of the group
  • coreid: id of the core

RETURNS:

  • *CoreResult: the result core
  • error: nil if ok otherwise the specific error

type CoreStatus

type CoreStatus struct {
	IsCoreOnline bool `json:"isCoreOnline"`
}

func GetCoreStatus

func GetCoreStatus(cli bce.Client, coreid string) (*CoreStatus, error)

GetCoreStatus - get the status of a core

PARAMS:

  • cli: the client agent which can perform sending request
  • coreid: id of the core

RETURNS:

  • *CoreStatus: the status of the core
  • error: nil if ok otherwise the specific error

type CoreidVersion

type CoreidVersion struct {
	Coreid  string `json:"coreid"`
	Version string `json:"version"`
}

type CreateGroupReq

type CreateGroupReq struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	AuthType    string `json:"authType"`
	Platform    string `json:"platform"`
}

type CreateGroupResult

type CreateGroupResult struct {
	GroupInfo Group    `json:"groupInfo"`
	CoreInfo  CoreInfo `json:"coreInfo"`
}

func CreateGroup

func CreateGroup(cli bce.Client, cgr *CreateGroupReq) (*CreateGroupResult, error)

CreateGroup - create a group

PARAMS:

  • cli: the client agent which can perform sending request
  • cgr: parameters to create group

RETURNS:

  • *CreateGroupResult: the result group
  • error: nil if ok otherwise the specific error

type CreateImageReq

type CreateImageReq struct {
	Description string `json:"description"`
	Image       string `json:"image"`
	Name        string `json:"name"`
}

type CreateServiceReq

type CreateServiceReq struct {
	Name           string                   `json:"name"`
	ModuleUuid     string                   `json:"moduleUuid"`
	ModuleCategory string                   `json:"moduleCategory"`
	Description    string                   `json:"description"`
	Replica        int                      `json:"replica"`
	Mounts         []map[string]interface{} `json:"mounts"`
	Ports          []string                 `json:"ports"`
	Args           []string                 `json:"args"`
	Env            map[string]string        `json:"env"`
	Devs           []string                 `json:"devs"`
	Restart        map[string]interface{}   `json:"restart"`
	Resources      map[string]interface{}   `json:"resources"`
}

type CreateVolFileReq

type CreateVolFileReq struct {
	Content  string `json:"content"`
	FileName string `json:"fileName"`
}

func CreateVolFile

func CreateVolFile(cli bce.Client, name string,
	cvf *CreateVolFileReq) (*CreateVolFileReq, error)

CreateVolFile - create a volume file

PARAMS:

  • cli: the client agent which can perform sending request
  • name: the request volume name
  • *CreateVolFileReq: request parameters

RETURNS:

  • *CreateVolFileReq: the result
  • error: nil if ok otherwise the specific error

func EditVolumeFile

func EditVolumeFile(cli bce.Client, names *Name2,
	body *EditVolFileReq) (*CreateVolFileReq, error)

EditVolumeFile - edit a volume file

PARAMS:

  • cli: the client agent which can perform sending request
  • *Name2: the requested volume name and file name
  • *EditVolFileReq: the content, the request body

RETURNS:

  • *CreateVolFileReq: the result
  • error: nil if ok otherwise the specific error

func GetVolumeFile

func GetVolumeFile(cli bce.Client, cvfr *GetVolFileReq) (*CreateVolFileReq, error)

GetVolumeFile - get a volume file

PARAMS:

  • cli: the client agent which can perform sending request
  • GetVolFileReq: volume name, version anf filename

RETURNS:

  • *ListVolumeVerResult: the result list
  • error: nil if ok otherwise the specific error

type CreateVolReq

type CreateVolReq struct {
	Name         string   `json:"name"`
	TemplateCode string   `json:"templateCode"`
	Description  string   `json:"description"`
	Tags         []string `json:"tags"`
	HostPath     string   `json:"hostPath"`
}

type EditCoreVolVerEntry

type EditCoreVolVerEntry struct {
	DeviceUUID string `json:"deviceUuid"`
	NewVersion string `json:"newVersion"`
	OldVersion string `json:"oldVersion"`
}

type EditCoreVolVerReq

type EditCoreVolVerReq struct {
	Jobs []EditCoreVolVerEntry `json:"jobs"`
}

type EditGroupReq

type EditGroupReq struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type EditImageReq

type EditImageReq struct {
	Description string `json:"description"`
}

type EditServiceReq

type EditServiceReq struct {
	Description string                   `json:"description"`
	Replica     int                      `json:"replica"`
	Mounts      []map[string]interface{} `json:"mounts"`
	Ports       []string                 `json:"ports"`
	Args        []string                 `json:"args"`
	Env         map[string]string        `json:"env"`
	Devs        []string                 `json:"devs"`
	Restart     map[string]interface{}   `json:"restart"`
	Resources   map[string]interface{}   `json:"resources"`
}

type EditVolFileReq

type EditVolFileReq struct {
	Content string `json:"content"`
}

type EditVolumeReq

type EditVolumeReq struct {
	Description string   `json:"description"`
	Tags        []string `json:"tags"`
	HostPath    string   `json:"hostPath"`
}

type GetHttpReq

type GetHttpReq struct {
	Url    string
	Result interface{}
	Params map[string]string
}

type GetVolFileReq

type GetVolFileReq struct {
	Name     string `json:"name"`
	Version  string `json:"version"`
	FileName string `json:"fileName"`
}

type Group

type Group struct {
	GroupUuid   string `json:"groupUuid"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Platform    string `json:"platform"`
	CreateTime  string `json:"createTime"`
	UpdateTime  string `json:"updateTime"`
}

func EditGroup

func EditGroup(cli bce.Client, groupId string, egr *EditGroupReq) (*Group, error)

EditGroup - edit a group

PARAMS:

  • cli: the client agent which can perform sending request
  • groupId: the group to edit
  • egr: parameters to update group

RETURNS:

  • *Group: the result group
  • error: nil if ok otherwise the specific error

func GetGroup

func GetGroup(cli bce.Client, groupUuid string) (*Group, error)

GetGroup - get a group of the account

PARAMS:

  • cli: the client agent which can perform sending request
  • groupUuid: id of the group

RETURNS:

  • *ListGroupResult: the result group list structure
  • error: nil if ok otherwise the specific error

type IdVerName

type IdVerName struct {
	Coreid  string `json:"coreid"`
	Version string `json:"version"`
	Name    string `json:"name"`
}

type Image

type Image struct {
	Category    string `json:"category"`
	CreateTime  string `json:"createTime"`
	Description string `json:"description"`
	Image       string `json:"image"`
	Name        string `json:"name"`
	Tags        string `json:"tags"`
	UUID        string `json:"uuid"`
	Warehouse   string `json:"warehouse"`
	Replica     struct {
		Min string `json:"min"`
	} `json:"replica"`
}

func CreateImageUser

func CreateImageUser(cli bce.Client, cir *CreateImageReq) (*Image, error)

CreateImageUser - create a user docker image

PARAMS:

  • cli: the client agent which can perform sending request
  • CreateImageReq: request parameters, name, image url, description

RETURNS:

  • *Image: the result iamge
  • error: nil if ok otherwise the specific error

func EditImageUser

func EditImageUser(cli bce.Client, uuid string, eir *EditImageReq) (*Image, error)

EditImageUser - edit a user docker image information

PARAMS:

  • cli: the client agent which can perform sending request
  • uuid: the image uuid
  • EditImageReq: request parameter: description

RETURNS:

  • *Image: the result iamge
  • error: nil if ok otherwise the specific error

func GetImageSys

func GetImageSys(cli bce.Client, uuid string) (*Image, error)

GetImageSys - get a system docker images

PARAMS:

  • cli: the client agent which can perform sending request
  • uuid: the image uuid

RETURNS:

  • *Image: the result iamge
  • error: nil if ok otherwise the specific error

func GetImageUser

func GetImageUser(cli bce.Client, uuid string) (*Image, error)

GetImageUser - get a user docker image

PARAMS:

  • cli: the client agent which can perform sending request
  • uuid: the image uuid

RETURNS:

  • *Image: the result iamge
  • error: nil if ok otherwise the specific error

type ImportBosReq

type ImportBosReq struct {
	BosBucket string `json:"bosBucket"`
	BosKey    string `json:"bosKey"`
}

type ImportCfcReq

type ImportCfcReq struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type ListConfigReq

type ListConfigReq struct {
	Status   string `json:"status"`
	PageNo   int    `json:"pageNo"`
	PageSize int    `json:"pageSize"`
}

type ListConfigResult

type ListConfigResult struct {
	TotalCount int      `json:"totalCount"`
	Result     []Config `json:"result"`
	Language   string   `json:"language"`
	PageNo     int      `json:"pageNo"`
	PageSize   int      `json:"pageSize"`
	Region     bool     `json:"region"`
}

func ListConfig

func ListConfig(cli bce.Client, coreid string, lcr *ListConfigReq) (*ListConfigResult, error)

ListConfig - list all configs

PARAMS:

  • cli: the client agent which can perform sending request
  • coreid: id of the core

RETURNS:

  • *ListConfigResult: the result config list
  • error: nil if ok otherwise the specific error

type ListCoreResult

type ListCoreResult struct {
	Result []CoreResult `json:"result"`
}

func ListCore

func ListCore(cli bce.Client, groupUuid string) (*ListCoreResult, error)

ListCore - list all core of a group

PARAMS:

  • cli: the client agent which can perform sending request
  • groupUuid: id of the group

RETURNS:

  • *ListCoreResult: the result core list
  • error: nil if ok otherwise the specific error

type ListGroupReq

type ListGroupReq struct {
	PageNo   int    `json:"pageNo"`
	PageSize int    `json:"pageSize"`
	Name     string `json:"name"`
}

type ListGroupResult

type ListGroupResult struct {
	TotalCountByUser int     `json:"totalCountByUser"`
	TotalCount       int     `json:"totalCount"`
	PageNo           int     `json:"pageNo"`
	PageSize         int     `json:"pageSize"`
	Result           []Group `json:"result"`
}

func ListGroup

func ListGroup(cli bce.Client, lgr *ListGroupReq) (*ListGroupResult, error)

ListGroup - list all groups of the account

PARAMS:

  • cli: the client agent which can perform sending request
  • *ListGroupReq: page no, page size, and name

RETURNS:

  • *ListGroupResult: the result group list structure
  • error: nil if ok otherwise the specific error

type ListImageReq

type ListImageReq struct {
	PageNo   int    `json:"pageNo"`
	PageSize int    `json:"pageSize"`
	Tag      string `json:"tag"`
}

image

type ListImageResult

type ListImageResult struct {
	Result     []Image `json:"result"`
	PageNo     int     `json:"pageNo"`
	PageSize   int     `json:"pageSize"`
	TotalCount int     `json:"totalCount"`
}

func ListImageSys

func ListImageSys(cli bce.Client, lir *ListImageReq) (*ListImageResult, error)

ListImageSys - list all system docker images

PARAMS:

  • cli: the client agent which can perform sending request
  • ListImageReq: list request parameters

RETURNS:

  • *ListImageResult: the result iamge list
  • error: nil if ok otherwise the specific error

func ListImageUser

func ListImageUser(cli bce.Client, lir *ListImageReq) (*ListImageResult, error)

ListImageUser - list all user docker images

PARAMS:

  • cli: the client agent which can perform sending request
  • ListImageReq: list request parameters

RETURNS:

  • *ListImageResult: the result iamge list
  • error: nil if ok otherwise the specific error

type ListVolCoreReq

type ListVolCoreReq struct {
	Name     string `json:"name"`
	PageNo   int    `json:"pageNo"`
	PageSize int    `json:"pageSize"`
}

type ListVolCoreResult

type ListVolCoreResult struct {
	PageNo   int `json:"pageNo"`
	PageSize int `json:"pageSize"`
	Result   []struct {
		ConfigVersion string `json:"configVersion"`
		DeviceName    string `json:"deviceName"`
		DeviceUUID    string `json:"deviceUuid"`
		GroupUUID     string `json:"groupUuid"`
		VolumeName    string `json:"volumeName"`
		VolumeVersion string `json:"volumeVersion"`
	} `json:"result"`
	TotalCount int `json:"totalCount"`
}

func ListVolCore

func ListVolCore(cli bce.Client, lvcr *ListVolCoreReq) (*ListVolCoreResult, error)

ListVolCore - list the cores associated with the volume

PARAMS:

  • cli: the client agent which can perform sending request
  • *ListVolCoreReq: the request parameters

RETURNS:

  • *ListVolumeVerResult: the result list
  • error: nil if ok otherwise the specific error

type ListVolTemplate

type ListVolTemplate struct {
	Result []VolTemplate `json:"result"`
}

func ListVolumeTpl

func ListVolumeTpl(cli bce.Client) (*ListVolTemplate, error)

ListVolumeTpl - list all volume template

PARAMS:

  • cli: the client agent which can perform sending request

RETURNS:

  • *ListVolTemplate: the result volume template list
  • error: nil if ok otherwise the specific error

type ListVolumeReq

type ListVolumeReq struct {
	PageNo   int    `json:"pageNo"`
	PageSize int    `json:"pageSize"`
	Tag      string `json:"tag"`
	Name     string `json:"name"`
}

type ListVolumeResult

type ListVolumeResult struct {
	TotalCount int            `json:"totalCount"`
	PageNo     int            `json:"pageNo"`
	PageSize   int            `json:"pageSize"`
	Result     []VolumeResult `json:"result"`
}

func ListVolume

func ListVolume(cli bce.Client, lvr *ListVolumeReq) (*ListVolumeResult, error)

ListVolume - list a bunch of volumes

PARAMS:

  • cli: the client agent which can perform sending request
  • ListVolReq: the request parameters

RETURNS:

  • *ListVolumeResult: the result list
  • error: nil if ok otherwise the specific error

type ListVolumeVerResult

type ListVolumeVerResult struct {
	Result []VolumeResult `json:"result"`
}

func ListVolumeVer

func ListVolumeVer(cli bce.Client, nv *NameVersion) (*ListVolumeVerResult, error)

ListVolumeVer - list version list of a volume

PARAMS:

  • cli: the client agent which can perform sending request
  • NameVersion: the request parameters, version can be empty

RETURNS:

  • *ListVolumeVerResult: the result list
  • error: nil if ok otherwise the specific error

type Name2

type Name2 struct {
	Name     string `json:"name"`
	FileName string `json:"fileName"`
}

type NameVersion

type NameVersion struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type PostHttpReq

type PostHttpReq struct {
	Url    string
	Body   interface{}
	Result interface{}
	Params map[string]string
}

type ServiceResult

type ServiceResult struct {
	Uuid           string                   `json:"uuid"`
	Name           string                   `json:"name"`
	ModuleImage    string                   `json:"moduleImage"`
	ModuleName     string                   `json:"moduleName"`
	ModuleTags     string                   `json:"moduleTags"`
	ModuleCategory string                   `json:"moduleCategory"`
	Description    string                   `json:"description"`
	Mounts         []map[string]interface{} `json:"mounts"`
	Ports          []string                 `json:"ports"`
	Args           []string                 `json:"args"`
	Env            map[string]string        `json:"env"`
	Devs           []string                 `json:"devs"`
	Restart        map[string]interface{}   `json:"restart"`
	Resources      map[string]interface{}   `json:"resources"`
	CreateTime     string                   `json:"createTime"`
}

func CreateService

func CreateService(cli bce.Client, cv *CoreidVersion,
	sr *CreateServiceReq) (*ServiceResult, error)

CreateService - create a service

PARAMS:

  • cli: the client agent which can perform sending request
  • *CoreidVersion: coreid, version
  • *CreateServiceReq: request parameters

RETURNS:

  • *ServiceResult: the result
  • error: nil if ok otherwise the specific error

func EditService

func EditService(cli bce.Client, ivn *IdVerName,
	esr *EditServiceReq) (*ServiceResult, error)

EditService - edit a service

PARAMS:

  • cli: the client agent which can perform sending request
  • *IdVerName: coreid, version, and name

RETURNS:

  • *ServiceResult: the result
  • error: nil if ok otherwise the specific error

func GetService

func GetService(cli bce.Client, ivn *IdVerName) (*ServiceResult, error)

GetService - get a service

PARAMS:

  • cli: the client agent which can perform sending request
  • *IdVerName: coreid, version and name

RETURNS:

  • *ServiceResult: the result
  • error: nil if ok otherwise the specific error

type VolDownloadResult

type VolDownloadResult struct {
	Url string `json:"url"`
}

func DownloadVolVer

func DownloadVolVer(cli bce.Client, name string,
	version string) (*VolDownloadResult, error)

DownloadVolVer - get the download address of a specific version of volume

PARAMS:

  • cli: the client agent which can perform sending request
  • name: the request volume name
  • version: the request volume version

RETURNS:

  • *VolDownloadResult: the result
  • error: nil if ok otherwise the specific error

type VolFile

type VolFile struct {
	FileName  string `json:"fileName"`
	Type      string `json:"type"`
	Viewable  bool   `json:"viewable"`
	Editable  bool   `json:"editable"`
	Deletable bool   `json:"deletable"`
}

type VolTemplate

type VolTemplate struct {
	Name     string   `json:"name"`
	Code     string   `json:"code"`
	Category string   `json:"category"`
	Tags     []string `json:"tags"`
}

Volume

type VolumeOpReq

type VolumeOpReq struct {
	Attach []NameVersion `json:"attach"`
	Detach []NameVersion `json:"detach"`
}

type VolumeResult

type VolumeResult struct {
	Uuid        string      `json:"uuid"`
	Name        string      `json:"name"`
	Tags        []string    `json:"tags"`
	HostPath    string      `json:"hostPath"`
	Files       []VolFile   `json:"files"`
	Description string      `json:"description"`
	Version     string      `json:"version"`
	Template    VolTemplate `json:"template"`
	NewFile     bool        `json:"newFile"`
	CleanFile   bool        `json:"cleanFile"`
	CreateTime  string      `json:"createTime"`
}

func CreateVolume

func CreateVolume(cli bce.Client, cvr *CreateVolReq) (*VolumeResult, error)

CreateVolume - create a volume

PARAMS:

  • cli: the client agent which can perform sending request
  • CreateVolReq: the request parameters

RETURNS:

  • *VolumeResult: the result volume
  • error: nil if ok otherwise the specific error

func EditVolume

func EditVolume(cli bce.Client, name string, evr *EditVolumeReq) (*VolumeResult, error)

EditVolume - edit a volume

PARAMS:

  • cli: the client agent which can perform sending request
  • name: the requested volume name
  • *EditVolumeReq: request parameters

RETURNS:

  • *VolumeResult: the result vaolume
  • error: nil if ok otherwise the specific error

func GetVolume

func GetVolume(cli bce.Client, name string) (*VolumeResult, error)

GetVolume - get a volume

PARAMS:

  • cli: the client agent which can perform sending request
  • name: the requested volume name

RETURNS:

  • *VolumeResult: the result vaolume
  • error: nil if ok otherwise the specific error

func PubVolumeVer

func PubVolumeVer(cli bce.Client, name string) (*VolumeResult, error)

PubVolumeVer - pub version list of a volume

PARAMS:

  • cli: the client agent which can perform sending request
  • name: the request volume name

RETURNS:

  • *VolumeResult: the result volume
  • error: nil if ok otherwise the specific error

Jump to

Keyboard shortcuts

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