bie

package
v0.9.37 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package bie defines the bie services of BCE. The supported APIs are all defined in sub-package

Index

Constants

View Source
const (
	DEFAULT_SERVICE_DOMAIN = "iotedge." + bce.DEFAULT_REGION + "." + bce.DEFAULT_DOMAIN
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*bce.BceClient
}

Client of BIE(iot edge) service is a kind of BceClient, so derived from BceClient

func NewClient

func NewClient(ak, sk, endpoint string) (*Client, error)

NewClient make the BIE service client with default configuration. Use `cli.Config.xxx` to access the config or change it to non-default value.

func (*Client) ClearVolFile

func (c *Client) ClearVolFile(name string) error

ClearVolFile - clear all volume files

PARAMS:

  • name: the requested volume name

RETURNS:

  • error: nil if ok otherwise the specific error

func (*Client) CreateGroup

func (c *Client) CreateGroup(cgr *api.CreateGroupReq) (*api.CreateGroupResult, error)

CreateGroup - create a group

PARAMS:

  • cgr: parameters to create group

RETURNS:

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

func (*Client) CreateImageUser

func (c *Client) CreateImageUser(cir *api.CreateImageReq) (*api.Image, error)

CreateImageUser - create a user docker image

PARAMS:

  • CreateImageReq: request parameters, name, image url, description

RETURNS:

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

func (*Client) CreateService

func (c *Client) CreateService(cv *api.CoreidVersion,
	sr *api.CreateServiceReq) (*api.ServiceResult, error)

CreateService - create a service

PARAMS:

  • *CoreidVersion: coreid, version
  • *CreateServiceReq: request parameters

RETURNS:

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

func (*Client) CreateVolFile

func (c *Client) CreateVolFile(name string,
	cvf *api.CreateVolFileReq) (*api.CreateVolFileReq, error)

CreateVolFile - create a volume file

PARAMS:

  • name: the request volume name
  • *CreateVolFileReq: request parameters

RETURNS:

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

func (*Client) CreateVolume

func (c *Client) CreateVolume(cvr *api.CreateVolReq) (*api.VolumeResult, error)

CreateVolume - create a volume

PARAMS:

  • CreateVolReq: the request parameters

RETURNS:

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

func (*Client) DeleteGroup

func (c *Client) DeleteGroup(groupUuid string) error

DeleteGroup - delete a group of the account

PARAMS:

  • groupUuid: id of the group

RETURNS:

  • error: nil if ok otherwise the specific error

func (*Client) DeleteImageUser

func (c *Client) DeleteImageUser(uuid string) error

DeleteImageUser - delete a user docker image

PARAMS:

  • uuid: the image uuid

RETURNS:

  • error: nil if ok otherwise the specific error

func (*Client) DeleteService

func (c *Client) DeleteService(ivn *api.IdVerName) error

DeleteService - delete a service

PARAMS:

  • *IdVerName: coreid, version, and name

RETURNS:

  • error: nil if ok otherwise the specific error

func (*Client) DeleteVolFile

func (c *Client) DeleteVolFile(name string, filename string) error

DeleteVolFile - delete a volume file

PARAMS:

  • name: the requested volume name
  • filename: the requested volume filename

RETURNS:

  • error: nil if ok otherwise the specific error

func (*Client) DeleteVolume

func (c *Client) DeleteVolume(name string) error

DeleteVolume - delete a volume

PARAMS:

  • name: the requested volume name

RETURNS:

  • error: nil if ok otherwise the specific error

func (*Client) DeployConfig

func (c *Client) DeployConfig(coreid string, ver string) error

DeployConfig - deploy a config

PARAMS:

  • coreid: id of the core
  • ver: version, e.g:$LATEST

RETURNS:

  • error: nil if ok otherwise the specific error

func (*Client) DownloadConfig

func (c *Client) DownloadConfig(cdr *api.CfgDownloadReq) (*api.CfgDownloadResult, error)

DownloadConfig - download a config

PARAMS:

  • *CfgDownloadReq: id, version, with bin or not

RETURNS:

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

func (*Client) DownloadVolVer

func (c *Client) DownloadVolVer(name string,
	version string) (*api.VolDownloadResult, error)

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

PARAMS:

  • name: the request volume name
  • version: the request volume version

RETURNS:

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

func (*Client) EditCoreVolVer

func (c *Client) EditCoreVolVer(name string,
	ecvr *api.EditCoreVolVerReq) error

EditCoreVolVer - edit the core version

PARAMS:

  • name: the volume name
  • *EditCoreVolVerReq: the request parameters

RETURNS:

  • error: nil if ok otherwise the specific error

func (*Client) EditGroup

func (c *Client) EditGroup(groupid string, egr *api.EditGroupReq) (*api.Group, error)

EditGroup - edit a group

PARAMS:

  • groupId: the group to edit
  • egr: parameters to update group

RETURNS:

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

func (*Client) EditImageUser

func (c *Client) EditImageUser(uuid string, eir *api.EditImageReq) (*api.Image, error)

EditImageUser - edit a user docker image information

PARAMS:

  • uuid: the image uuid
  • EditImageReq: request parameter: description

RETURNS:

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

func (*Client) EditService

func (c *Client) EditService(ivn *api.IdVerName,
	esr *api.EditServiceReq) (*api.ServiceResult, error)

EditService - edit a service

PARAMS:

  • *IdVerName: coreid, version, and name

RETURNS:

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

func (*Client) EditVolume

func (c *Client) EditVolume(name string, evr *api.EditVolumeReq) (*api.VolumeResult, error)

EditVolume - edit a volume

PARAMS:

  • name: the requested volume name
  • *EditVolumeReq: request parameters

RETURNS:

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

func (*Client) EditVolumeFile

func (c *Client) EditVolumeFile(names *api.Name2,
	body *api.EditVolFileReq) (*api.CreateVolFileReq, error)

EditVolumeFile - edit a volume file

PARAMS:

  • *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 (*Client) GetConfig

func (c *Client) GetConfig(coreid string, ver string) (*api.CfgResult, error)

GetConfig - get a config

PARAMS:

  • coreid: id of the core
  • ver: version, e.g:$LATEST

RETURNS:

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

func (*Client) GetCore

func (c *Client) GetCore(groupUuid string, coreid string) (*api.CoreResult, error)

GetCore - get a core of a group

PARAMS:

  • groupUuid: id of the group
  • coreid: id of the core

RETURNS:

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

func (*Client) GetCoreStatus

func (c *Client) GetCoreStatus(coreid string) (*api.CoreStatus, error)

GetCoreStatus - get the status of a core

PARAMS:

  • coreid: id of the core

RETURNS:

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

func (*Client) GetGroup

func (c *Client) GetGroup(groupUuid string) (*api.Group, error)

GetGroup - get a group

RETURNS:

  • *api.Group: the group
  • error: the return error if any occurs

func (*Client) GetImageSys

func (c *Client) GetImageSys(uuid string) (*api.Image, error)

GetImageSys - get a system docker images

PARAMS:

  • uuid: the image uuid

RETURNS:

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

func (*Client) GetImageUser

func (c *Client) GetImageUser(uuid string) (*api.Image, error)

GetImageUser - get a user docker image

PARAMS:

  • uuid: the image uuid

RETURNS:

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

func (*Client) GetService

func (c *Client) GetService(ivn *api.IdVerName) (*api.ServiceResult, error)

GetService - get a service

PARAMS:

  • *IdVerName: coreid, version and name

RETURNS:

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

func (*Client) GetVolume

func (c *Client) GetVolume(name string) (*api.VolumeResult, error)

GetVolume - get a volume

PARAMS:

  • name: the requested volume name

RETURNS:

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

func (*Client) GetVolumeFile

func (c *Client) GetVolumeFile(cvfr *api.GetVolFileReq) (*api.CreateVolFileReq, error)

GetVolumeFile - get a volume file

PARAMS:

  • GetVolFileReq: volume name, version anf filename

RETURNS:

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

func (*Client) ImportBos

func (c *Client) ImportBos(name string,
	ibr *api.ImportBosReq) error

ImportBos - import a BOS file into volume

PARAMS:

  • name: the volume name
  • *ImportBosReq: the request parameters

RETURNS:

  • error: nil if ok otherwise the specific error

func (*Client) ImportCfc

func (c *Client) ImportCfc(name string,
	icr *api.ImportCfcReq) error

ImportCfc - import a CFC function into volume

PARAMS:

  • name: the volume name
  • *ImportCfcReq: the request parameters

RETURNS:

  • error: nil if ok otherwise the specific error

func (*Client) ListConfig

func (c *Client) ListConfig(coreid string,
	lcr *api.ListConfigReq) (*api.ListConfigResult, error)

ListConfig - list all configs

PARAMS:

  • coreid: id of the core

RETURNS:

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

func (*Client) ListCore

func (c *Client) ListCore(groupUuid string) (*api.ListCoreResult, error)

ListCore - list all core of a group

PARAMS:

  • groupUuid: id of the group

RETURNS:

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

func (*Client) ListGroup

func (c *Client) ListGroup(lgr *api.ListGroupReq) (*api.ListGroupResult, error)

ListGroup - list all groups

  • *ListGroupReq: page no, page size, and name

RETURNS:

  • *api.ListGroupResult: the all groups
  • error: the return error if any occurs

func (*Client) ListImageSys

func (c *Client) ListImageSys(lir *api.ListImageReq) (*api.ListImageResult, error)

//////////////////////////////////////////// Volume API //////////////////////////////////////////// ListImageSys - list all system docker images

PARAMS:

  • ListImageReq: list request parameters

RETURNS:

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

func (*Client) ListImageUser

func (c *Client) ListImageUser(lir *api.ListImageReq) (*api.ListImageResult, error)

ListImageUser - list all user docker images

PARAMS:

  • ListImageReq: list request parameters

RETURNS:

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

func (*Client) ListVolCore

func (c *Client) ListVolCore(lvcr *api.ListVolCoreReq) (*api.ListVolCoreResult, error)

ListVolCore - list the cores associated with the volume

PARAMS:

  • *ListVolCoreReq: the request parameters

RETURNS:

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

func (*Client) ListVolume

func (c *Client) ListVolume(lvr *api.ListVolumeReq) (*api.ListVolumeResult, error)

ListVolume - list a bunch of volumes

PARAMS:

  • ListVolReq: the request parameters

RETURNS:

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

func (*Client) ListVolumeTpl

func (c *Client) ListVolumeTpl() (*api.ListVolTemplate, error)

//////////////////////////////////////////// Volume API //////////////////////////////////////////// ListVolumeTpl - list all volume template

PARAMS: RETURNS:

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

func (*Client) ListVolumeVer

func (c *Client) ListVolumeVer(nv *api.NameVersion) (*api.ListVolumeVerResult, error)

ListVolumeVer - list version list of a volume

PARAMS:

  • NameVersion: the request parameters, version can be empty

RETURNS:

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

func (*Client) PubConfig

func (c *Client) PubConfig(cpr *api.CoreidVersion, cpb *api.CfgPubBody) (*api.CfgResult, error)

PubConfig - pub a config

PARAMS:

  • cpr: id of the core and version

RETURNS:

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

func (*Client) PubVolumeVer

func (c *Client) PubVolumeVer(name string) (*api.VolumeResult, error)

PubVolumeVer - pub version list of a volume

PARAMS:

  • name: the request volume name

RETURNS:

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

func (*Client) RenewCoreAuth

func (c *Client) RenewCoreAuth(coreid string) (*api.CoreInfo, error)

RenewCoreAuth - renew the auth of a core

PARAMS:

  • coreid: id of the core

RETURNS:

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

func (*Client) ReorderService

func (c *Client) ReorderService(ivn *api.IdVerName, after string) error

ReorderService - reorder service after an other service

PARAMS:

  • *IdVerName: coreid, version, and name

RETURNS:

  • error: nil if ok otherwise the specific error

func (*Client) VolumeOp

func (c *Client) VolumeOp(cv *api.CoreidVersion, vor *api.VolumeOpReq) error

VolumeOp - attache of detach volumes

PARAMS:

  • *CoreidVersion: coreid, version
  • *VolumeOpReq: request parameters

RETURNS:

  • error: nil if ok otherwise the specific error

Directories

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

Jump to

Keyboard shortcuts

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