api

package
v0.9.209 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	API      = "/api"
	AIHC_POM = "/aihcpom"

	URI_PREFIXV1 = bce.URI_PREFIX + "v1"

	TYPE_RESPOOL = "/respool"
	TYPE_APP     = "/app"
	TYPE_POD     = "/pod"

	REQUEST_CREATE       = "/create"
	REQUEST_LIST         = "/list"
	REQUEST_STATS        = "/stats"
	REQUEST_DETAILS      = "/details"
	REQUEST_DETAIL       = "/detail"
	REQUEST_UPDATE       = "/update"
	REQUEST_SCALE        = "/scale"
	REQUEST_PUBACCESS    = "/pubaccess"
	REQUEST_LISTCHANGE   = "/listchange"
	REQUEST_CHANGEDETAIL = "/changedetail"
	REQUEST_DELETE       = "/delete"
	REQUEST_BLOCK        = "/block"
	REQUEST_LISTBRIEF    = "/listbrief"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessConf

type AccessConf struct {
	PublicAccess bool   `json:"publicAccess,omitempty"`
	Eip          string `json:"eip,omitempty"`
}

type AccessIPConf

type AccessIPConf struct {
	Internal string `json:"internal,omitempty"`
	External string `json:"external,omitempty"`
}

type AccessPortConf

type AccessPortConf struct {
	Name          string `json:"name,omitempty"`
	ContainerPort int32  `json:"containerPort,omitempty"`
	ServicePort   int32  `json:"servicePort,omitempty"`
}

type AppBriefInfo

type AppBriefInfo struct {
	AppId        string `json:"appId,omitempty"`
	AppName      string `json:"appName,omitempty"`
	ResPoolId    string `json:"resPoolId,omitempty"`
	ResPoolName  string `json:"resPoolName,omitempty"`
	ResQueue     string `json:"resQueue,omitempty"`
	Region       string `json:"region,omitempty"`
	PublicAccess bool   `json:"publicAccess,omitempty"`
	Creator      string `json:"creator,omitempty"`
	Ctime        uint32 `json:"ctime,omitempty"`
	Mtime        uint32 `json:"mtime,omitempty"`
}

type AppBriefStat

type AppBriefStat struct {
	Status       int32 `json:"status,omitempty"`
	AvailableIns int32 `json:"availableIns,omitempty"`
	TotalIns     int32 `json:"totalIns,omitempty"`
}

type AppChangeRecord

type AppChangeRecord struct {
	ChangeId   string `json:"changeId,omitempty"`
	Prev       string `json:"prev,omitempty"`
	ChangeType int32  `json:"changeType,omitempty"`
	ShortDesc  string `json:"shortDesc,omitempty"`
	Creator    string `json:"creator,omitempty"`
	Ctime      uint32 `json:"ctime,omitempty"`
}

type AppDetailsArgs

type AppDetailsArgs struct {
	AppId string `json:"appId,omitempty"`
}

type AppDetailsData

type AppDetailsData struct {
	App     *CreateAppArgs `json:"app,omitempty"`
	Status  *AppStatus     `json:"status,omitempty"`
	Creator string         `json:"creator,omitempty"`
	Ctime   uint32         `json:"ctime,omitempty"`
	Mtime   uint32         `json:"mtime,omitempty"`
}

type AppDetailsResult

type AppDetailsResult struct {
	Data AppDetailsData `json:"data,omitempty"`
	BaseRes
}

func AppDetails

func AppDetails(cli bce.Client, region string, args *AppDetailsArgs) (*AppDetailsResult, error)

type AppStatus

type AppStatus struct {
	AccessIPs   *AccessIPConf     `json:"accessIPs,omitempty"`
	AccessPorts []*AccessPortConf `json:"accessPorts,omitempty"`
	BlbShortId  string            `json:"blbShortId,omitempty"`
}

type BaseRes

type BaseRes struct {
	Code      string `json:"code,omitempty"`
	Message   string `json:"message,omitempty"`
	RequestId string `json:"requestId,omitempty"`
}

type BlockPodArgs

type BlockPodArgs struct {
	AppId string `json:"appId,omitempty"`
	InsID string `json:"insID,omitempty"`
	Block bool   `json:"block,omitempty"`
}

type BlockPodResult

type BlockPodResult struct {
	BaseRes
}

func BlockPod

func BlockPod(cli bce.Client, region string, args *BlockPodArgs) (*BlockPodResult, error)

type CanaryStrategyConf

type CanaryStrategyConf struct {
	MaxSurge       int32 `json:"maxSurge,omitempty"`
	MaxUnavailable int32 `json:"maxUnavailable,omitempty"`
}

type ChangeDetailArgs

type ChangeDetailArgs struct {
	ChangeId string `json:"changeId,omitempty"`
}

type ChangeDetailData

type ChangeDetailData struct {
	ChangeId   string `json:"changeId,omitempty"`
	Prev       string `json:"prev,omitempty"`
	ChangeType int32  `json:"changeType,omitempty"`
	ShortDesc  string `json:"shortDesc,omitempty"`
	Creator    string `json:"creator,omitempty"`
	Ctime      uint32 `json:"ctime,omitempty"`
}

type ChangeDetailResult

type ChangeDetailResult struct {
	Data ChangeDetailData `json:"data,omitempty"`
	BaseRes
}

func ChangeDetail

func ChangeDetail(cli bce.Client, region string, args *ChangeDetailArgs) (*ChangeDetailResult, error)

type ContainerConf

type ContainerConf struct {
	Name           string             `json:"name,omitempty"`
	Cpus           int32              `json:"cpus,omitempty"`
	Memory         int32              `json:"memory,omitempty"`
	Cards          int32              `json:"cards,omitempty"`
	RunCmd         []string           `json:"runCmd,omitempty"`
	RunArgs        []string           `json:"runArgs,omitempty"`
	Ports          []*PortConf        `json:"ports,omitempty"`
	Env            map[string]string  `json:"env,omitempty"`
	Image          *ImageConf         `json:"image,omitempty"`
	VolumeMounts   []*VolumnMountConf `json:"volumeMounts,omitempty"`
	StartupsProbe  *ProbeConf         `json:"startupsProbe,omitempty"`
	ReadinessProbe *ProbeConf         `json:"readinessProbe,omitempty"`
	LivenessProbe  *ProbeConf         `json:"livenessProbe,omitempty"`
}

type ContainerInfo

type ContainerInfo struct {
	ContainerId string           `json:"containerId,omitempty"`
	Container   *ContainerConf   `json:"container,omitempty"`
	Status      *ContainerStatus `json:"status,omitempty"`
}

type ContainerStatus

type ContainerStatus struct {
	ContainerStatus string `json:"containerStatus,omitempty"`
	Ctime           uint32 `json:"ctime,omitempty"`
	Reason          string `json:"reason,omitempty"`
}

type CreateAppArgs

type CreateAppArgs struct {
	AppName    string           `json:"appName,omitempty"`
	ChipType   string           `json:"chipType,omitempty"`
	InsCount   int32            `json:"insCount,omitempty"`
	ResPool    *ResPoolConf     `json:"resPool,omitempty"`
	Storage    *StorageConf     `json:"storage,omitempty"`
	Containers []*ContainerConf `json:"containers,omitempty"`
	Access     *AccessConf      `json:"access,omitempty"`
	Log        *LogConf         `json:"log,omitempty"`
	Deploy     *DeployConf      `json:"deploy,omitempty"`
	Misc       *Misc            `json:"misc,omitempty"`
}

type CreateAppData

type CreateAppData struct {
	AppId string `json:"appId,omitempty"`
}

type CreateAppResult

type CreateAppResult struct {
	Data CreateAppData `json:"data,omitempty"`
	BaseRes
}

func CreateApp

func CreateApp(cli bce.Client, region string, reqBody *bce.Body, extraInfo map[string]string) (*CreateAppResult, error)

type DeleteAppArgs

type DeleteAppArgs struct {
	AppId string `json:"appId,omitempty"`
}

type DeleteAppResult

type DeleteAppResult struct {
	BaseRes
}

func DeleteApp

func DeleteApp(cli bce.Client, region string, args *DeleteAppArgs) (*DeleteAppResult, error)

type DeletePodArgs

type DeletePodArgs struct {
	AppId string `json:"appId,omitempty"`
	InsID string `json:"insID,omitempty"`
}

type DeletePodResult

type DeletePodResult struct {
	BaseRes
}

func DeletePod

func DeletePod(cli bce.Client, region string, args *DeletePodArgs) (*DeletePodResult, error)

type DeployConf

type DeployConf struct {
	CanaryStrategy *CanaryStrategyConf `protobuf:"bytes,1,opt,name=canaryStrategy,proto3" json:"canaryStrategy,omitempty"`
}

type ExecAction

type ExecAction struct {
	Command []string `json:"command,omitempty"`
}

type HTTPGetAction

type HTTPGetAction struct {
	Path string `json:"path,omitempty"`
	Port int32  `json:"port,omitempty"`
}

type HostPathConfig

type HostPathConfig struct {
	SrcPath string `json:"srcPath,omitempty"`
}

type ImageConf

type ImageConf struct {
	ImageType     int32  `json:"imageType,omitempty"`
	ImageAddr     string `json:"imageAddr,omitempty"`
	ImagePullUser string `json:"imagePullUser,omitempty"`
	ImagePullPass string `json:"imagePullPass,omitempty"`
}

type InsInfo

type InsInfo struct {
	InsID      string           `json:"insID,omitempty"`
	Containers []*ContainerInfo `json:"containers,omitempty"`
	Status     *InsStauts       `json:"status,omitempty"`
}

type InsStauts

type InsStauts struct {
	Blocked             bool   `json:"blocked,omitempty"`
	InsStatus           string `json:"insStatus,omitempty"`
	Ctime               uint32 `json:"ctime,omitempty"`
	AvailableContainers int32  `json:"availableContainers,omitempty"`
	TotalContainers     int32  `json:"totalContainers,omitempty"`
	PodIP               string `json:"podIP,omitempty"`
	NodeIP              string `json:"nodeIP,omitempty"`
}

type ListAppArgs

type ListAppArgs struct {
	PageNo   int32  `json:"pageNo,omitempty"`
	PageSize int32  `json:"pageSize,omitempty"`
	OrderBy  string `json:"orderBy,omitempty"`
	Order    string `json:"order,omitempty"`
	Keyword  string `json:"keyword,omitempty"`
}

type ListAppData

type ListAppData struct {
	AppList []*AppBriefInfo `json:"list,omitempty"`
	Count   int32           `json:"count,omitempty"`
}

type ListAppResult

type ListAppResult struct {
	Data ListAppData `json:"data,omitempty"`
	BaseRes
}

func ListApp

func ListApp(cli bce.Client, region string, args *ListAppArgs, extraInfo map[string]string) (*ListAppResult, error)

type ListAppStatsArgs

type ListAppStatsArgs struct {
	AppIds []string `json:"appIds,omitempty"`
}

type ListAppStatsData

type ListAppStatsData struct {
	Apps map[string]*AppBriefStat `json:"apps,omitempty"`
}

type ListAppStatsResult

type ListAppStatsResult struct {
	Data ListAppStatsData `json:"data,omitempty"`
	BaseRes
}

func ListAppStats

func ListAppStats(cli bce.Client, region string, args *ListAppStatsArgs) (*ListAppStatsResult, error)

type ListBriefResPoolArgs

type ListBriefResPoolArgs struct {
	PageNo   int32 `json:"pageNo,omitempty"`
	PageSize int32 `json:"pageSize,omitempty"`
}

type ListBriefResPoolData

type ListBriefResPoolData struct {
	ResPools []*ResPoolBriefInfo `json:"resPools,omitempty"`
}

type ListBriefResPoolResult

type ListBriefResPoolResult struct {
	Data ListBriefResPoolData `json:"data,omitempty"`
	BaseRes
}

func ListBriefResPool

func ListBriefResPool(cli bce.Client, region string, args *ListBriefResPoolArgs) (*ListBriefResPoolResult, error)

type ListChangeArgs

type ListChangeArgs struct {
	AppId      string `json:"appId,omitempty"`
	ChangeType int32  `json:"changeType,omitempty"`
	PageNo     int32  `json:"pageNo,omitempty"`
	PageSize   int32  `json:"pageSize,omitempty"`
	OrderBy    string `json:"orderBy,omitempty"`
	Order      string `json:"order,omitempty"`
}

type ListChangeData

type ListChangeData struct {
	Count int32              `json:"count,omitempty"`
	List  []*AppChangeRecord `json:"list,omitempty"`
}

type ListChangeResult

type ListChangeResult struct {
	Data ListChangeData `json:"data,omitempty"`
	BaseRes
}

func ListChange

func ListChange(cli bce.Client, region string, args *ListChangeArgs) (*ListChangeResult, error)

type ListPodArgs

type ListPodArgs struct {
	AppId string `json:"appId,omitempty"`
}

type ListPodData

type ListPodData struct {
	List []*InsInfo `json:"list,omitempty"`
}

type ListPodResult

type ListPodResult struct {
	Data ListPodData `json:"data,omitempty"`
	BaseRes
}

func ListPod

func ListPod(cli bce.Client, region string, args *ListPodArgs) (*ListPodResult, error)

type LogConf

type LogConf struct {
	Persistent bool `json:"persistent,omitempty"`
}

type Misc

type Misc struct {
	PodLabels      map[string]string `json:"podLabels,omitempty"`
	PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
}

type PFSConfig

type PFSConfig struct {
	SrcPath string `json:"srcPath,omitempty"`
}

type PortConf

type PortConf struct {
	Port int32 `json:"port,omitempty"`
}

type ProbeConf

type ProbeConf struct {
	InitialDelaySeconds int32             `json:"initialDelaySeconds,omitempty"`
	TimeoutSeconds      int32             `json:"timeoutSeconds,omitempty"`
	PeriodSeconds       int32             `json:"periodSeconds,omitempty"`
	SuccessThreshold    int32             `json:"successThreshold,omitempty"`
	FailureThreshold    int32             `json:"failureThreshold,omitempty"`
	Handler             *ProbeHandlerConf `json:"handler,omitempty"`
}

type ProbeHandlerConf

type ProbeHandlerConf struct {
	Exec            *ExecAction      `json:"exec,omitempty"`
	HttpGet         *HTTPGetAction   `json:"httpGet,omitempty"`
	TcpSocketAction *TCPSocketAction `json:"tcpSocketAction,omitempty"`
}

type PubAccessArgs

type PubAccessArgs struct {
	AppId        string `json:"appId,omitempty"`
	PublicAccess bool   `json:"publicAccess,omitempty"`
	Eip          string `json:"eip,omitempty"`
}

type PubAccessResult

type PubAccessResult struct {
	BaseRes
}

func PubAccess

func PubAccess(cli bce.Client, region string, args *PubAccessArgs) (*PubAccessResult, error)

type ResPoolBriefInfo

type ResPoolBriefInfo struct {
	ResPoolId       string `json:"resPoolId,omitempty"`
	ResPoolName     string `json:"resPoolName,omitempty"`
	AssociatedPfsID string `json:"associatedPfsID,omitempty"`
	ClusterType     string `json:"clusterType,omitempty"`
	Description     string `json:"description,omitempty"`
	ForbidDelete    bool   `json:"forbidDelete,omitempty"`
	K8SVersion      string `json:"k8sVersion,omitempty"`
	CreatedAt       string `json:"createdAt,omitempty"`
	UpdatedAt       string `json:"updatedAt,omitempty"`
	Phase           string `json:"phase,omitempty"`
}

type ResPoolConf

type ResPoolConf struct {
	ResPoolId string `json:"resPoolId,omitempty"`
	Queue     string `json:"queue,omitempty"`
}

type ResPoolCountInfo

type ResPoolCountInfo struct {
	Total int32 `json:"total,omitempty"`
	Used  int32 `json:"used,omitempty"`
}

type ResPoolDetailArgs

type ResPoolDetailArgs struct {
	ResPoolId string `json:"resPoolId,omitempty"`
}

type ResPoolDetailData

type ResPoolDetailData struct {
	ResPool  *ResPoolInfo    `json:"resPool,omitempty"`
	ResQueue []*ResQueueInfo `json:"resQueue,omitempty"`
}

type ResPoolDetailResult

type ResPoolDetailResult struct {
	Data ResPoolDetailData `json:"data,omitempty"`
	BaseRes
}

func ResPoolDetail

func ResPoolDetail(cli bce.Client, region string, args *ResPoolDetailArgs) (*ResPoolDetailResult, error)

type ResPoolInfo

type ResPoolInfo struct {
	Meta   *ResPoolMeta   `json:"meta,omitempty"`
	Spec   *ResPoolSpec   `json:"spec,omitempty"`
	Status *ResPoolStatus `json:"status,omitempty"`
}

type ResPoolMeta

type ResPoolMeta struct {
	ResPoolId   string `json:"resPoolId,omitempty"`
	ResPoolName string `json:"resPoolName,omitempty"`
	CreatedAt   string `json:"createdAt,omitempty"`
	UpdatedAt   string `json:"updatedAt,omitempty"`
}

type ResPoolSpec

type ResPoolSpec struct {
	K8SVersion         string   `json:"k8sVersion,omitempty"`
	AssociatedPfsID    string   `json:"associatedPfsID,omitempty"`
	Region             string   `json:"region,omitempty"`
	AssociatedCpromIDs []string `json:"associatedCpromIDs,omitempty"`
	CreatedBy          string   `json:"createdBy,omitempty"`
	Description        string   `json:"description,omitempty"`
	ForbidDelete       bool     `json:"forbidDelete,omitempty"`
}

type ResPoolStatus

type ResPoolStatus struct {
	GPUCount  *ResPoolCountInfo `json:"GPUCount,omitempty"`
	NodeCount *ResPoolCountInfo `json:"NodeCount,omitempty"`
	Phase     string            `json:"phase,omitempty"`
}

type ResQueueInfo

type ResQueueInfo struct {
	Name            string            `json:"name,omitempty"`
	NameSpace       string            `json:"nameSpace,omitempty"`
	ParentQueue     string            `json:"parentQueue,omitempty"`
	QueueType       string            `json:"queueType,omitempty"`
	State           string            `json:"state,omitempty"`
	Reclaimable     bool              `json:"reclaimable,omitempty"`
	Preemptable     bool              `json:"preemptable,omitempty"`
	Capability      map[string]string `json:"capability,omitempty"`
	Allocated       map[string]string `json:"allocated,omitempty"`
	DisableOversell bool              `json:"disableOversell,omitempty"`
	CreatedTime     string            `json:"createdTime,omitempty"`
}

type ScaleAppArgs

type ScaleAppArgs struct {
	AppId    string `json:"appId,omitempty"`
	InsCount int32  `json:"insCount,omitempty"`
}

type ScaleAppResult

type ScaleAppResult struct {
	BaseRes
}

func ScaleApp

func ScaleApp(cli bce.Client, region string, args *ScaleAppArgs) (*ScaleAppResult, error)

type StorageConf

type StorageConf struct {
	ShmSize int32         `json:"shmSize,omitempty"`
	Volumns []*VolumnConf `json:"volumns,omitempty"`
}

type TCPSocketAction

type TCPSocketAction struct {
	Port int32 `json:"port,omitempty"`
}

type UpdateAppArgs

type UpdateAppArgs struct {
	AppId     string         `json:"appId,omitempty"`
	AppConf   *CreateAppArgs `json:"appConf,omitempty"`
	ShortDesc string         `json:"shortDesc,omitempty"`
}

type UpdateAppData

type UpdateAppData struct {
	AppId string `json:"appId,omitempty"`
}

type UpdateAppResult

type UpdateAppResult struct {
	Data UpdateAppData `json:"data,omitempty"`
	BaseRes
}

func UpdateApp

func UpdateApp(cli bce.Client, region string, reqBody *bce.Body, args *UpdateAppArgs) (*UpdateAppResult, error)

type VolumnConf

type VolumnConf struct {
	VolumeType string          `json:"volumeType,omitempty"`
	VolumnName string          `json:"volumnName,omitempty"`
	Pfs        *PFSConfig      `json:"pfs,omitempty"`
	Hostpath   *HostPathConfig `json:"hostpath,omitempty"`
}

type VolumnMountConf

type VolumnMountConf struct {
	VolumnName string `json:"volumnName,omitempty"`
	DstPath    string `json:"dstPath,omitempty"`
	ReadOnly   bool   `json:"readOnly,omitempty"`
}

Jump to

Keyboard shortcuts

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