Documentation ¶
Index ¶
- func LoadConfig(regionAPI, token string) (map[string]map[string]interface{}, error)
- func NewNode(nodeAPI string)
- func SetInfo(region, t string)
- type Body
- type ConfigsInterface
- type DefineCloudAuth
- type DefineCloudAuthInterface
- type DefineSources
- type DefineSourcesInterface
- type NodeInterface
- type RNodeClient
- type Region
- type ServiceInterface
- type TaskInterface
- type TaskStatus
- type TenantInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
Types ¶
type ConfigsInterface ¶
type ConfigsInterface interface { Get() (*model.GlobalConfig, *util.APIHandleError) Put(*model.GlobalConfig) *util.APIHandleError }
ConfigsInterface 数据中心配置API
type DefineCloudAuth ¶
type DefineCloudAuth struct {
GT *api_model.GetUserToken
}
DefineCloudAuth DefineCloudAuth
func (*DefineCloudAuth) GetToken ¶
func (d *DefineCloudAuth) GetToken() ([]byte, error)
GetToken GetToken
func (*DefineCloudAuth) PostToken ¶
func (d *DefineCloudAuth) PostToken() ([]byte, error)
PostToken PostToken
type DefineCloudAuthInterface ¶
type DefineCloudAuthInterface interface { GetToken() ([]byte, error) PostToken() ([]byte, error) PutToken() error }
DefineCloudAuthInterface DefineCloudAuthInterface
type DefineSources ¶
type DefineSources struct { Model Body // contains filtered or unexported fields }
DefineSources DefineSources
func (*DefineSources) DeleteSource ¶
func (d *DefineSources) DeleteSource(sourceAlias string) error
DeleteSource DeleteSource
func (*DefineSources) GetSource ¶
func (d *DefineSources) GetSource(sourceAlias string) ([]byte, error)
GetSource GetSource
func (*DefineSources) PostSource ¶
func (d *DefineSources) PostSource(sourceAlias string) error
PostSource PostSource
func (*DefineSources) PutSource ¶
func (d *DefineSources) PutSource(sourceAlias string) error
PutSource PutSource
type DefineSourcesInterface ¶
type DefineSourcesInterface interface { GetSource(sourceAlias string) ([]byte, error) PostSource(sourceAlias string) error PutSource(SourcesAlias string) error DeleteSource(sourceAlias string) error }
DefineSourcesInterface DefineSourcesInterface
type NodeInterface ¶
type NodeInterface interface { Rule(rule string) ([]*model.HostNode, *util.APIHandleError) Get(node string) (*model.HostNode, *util.APIHandleError) List() ([]*model.HostNode, *util.APIHandleError) Add(node *model.APIHostNode) *util.APIHandleError Up(nid string) *util.APIHandleError Down(nid string) *util.APIHandleError UnSchedulable(nid string) *util.APIHandleError ReSchedulable(nid string) *util.APIHandleError Delete(nid string) *util.APIHandleError Label(nid string, label map[string]string) *util.APIHandleError }
type RNodeClient ¶
type RNodeClient struct {
NodeAPI string
}
func GetNode ¶
func GetNode() *RNodeClient
func (*RNodeClient) Configs ¶
func (r *RNodeClient) Configs() ConfigsInterface
func (*RNodeClient) Nodes ¶
func (r *RNodeClient) Nodes() NodeInterface
func (*RNodeClient) Tasks ¶
func (r *RNodeClient) Tasks() TaskInterface
type Region ¶
type Region struct {
// contains filtered or unexported fields
}
func (*Region) Tenants ¶
func (r *Region) Tenants() TenantInterface
type ServiceInterface ¶
type ServiceInterface interface { Get(name string) (map[string]string, *util.APIHandleError) Pods(serviceAlisa string) ([]*dbmodel.K8sPod, *util.APIHandleError) List() ([]*model.ServiceStruct, *util.APIHandleError) Stop(serviceAlisa, eventID string) *util.APIHandleError Start(serviceAlisa, eventID string) *util.APIHandleError EventLog(serviceAlisa, eventID, level string) ([]*model.MessageData, *util.APIHandleError) }
ServiceInterface ServiceInterface
type TaskInterface ¶
type TaskInterface interface { Get(name string) (*model.Task, *util.APIHandleError) Status(name string) (*TaskStatus, error) HandleTaskStatus(task string) (*map[string]*model.TaskStatus, *util.APIHandleError) Add(task *model.Task) *util.APIHandleError AddGroup(group *model.TaskGroup) *util.APIHandleError Exec(name string, nodes []string) *util.APIHandleError List() ([]*model.Task, *util.APIHandleError) Refresh() *util.APIHandleError }
type TaskStatus ¶
type TaskStatus struct {
Status map[string]model.TaskStatus `json:"status,omitempty"`
}
func HandleTaskStatus ¶
func HandleTaskStatus(task string) (*TaskStatus, error)
type TenantInterface ¶
type TenantInterface interface { Get(name string) *tenant Services() ServiceInterface DefineSources(ss *api_model.SourceSpec) DefineSourcesInterface DefineCloudAuth(gt *api_model.GetUserToken) DefineCloudAuthInterface }
TenantInterface TenantInterface
Click to show internal directories.
Click to hide internal directories.