rainbond: github.com/goodrain/rainbond/api/region Index | Files

package region

import "github.com/goodrain/rainbond/api/region"

Index

Package Files

cloudAuth.go cluster.go monitor.go node.go notification.go region.go service.go tenant.go types.go

Variables

var AllTenant string

AllTenant AllTenant

func LoadConfig Uses

func LoadConfig(regionAPI, token string) (map[string]map[string]interface{}, error)

LoadConfig load config

func SetInfo Uses

func SetInfo(region, t string)

SetInfo 设置

type APIConf Uses

type APIConf struct {
    Endpoints []string `yaml:"endpoints"`
    Token     string   `yaml:"token"`
    AuthType  string   `yaml:"auth_type"`
    Cacert    string   `yaml:"client-ca-file"`
    Cert      string   `yaml:"tls-cert-file"`
    CertKey   string   `yaml:"tls-private-key-file"`
}

APIConf region api config

type ClusterInterface Uses

type ClusterInterface interface {
    GetClusterInfo() (*model.ClusterResource, *util.APIHandleError)
    GetClusterHealth() (*utilhttp.ResponseBody, *util.APIHandleError)
}

ClusterInterface cluster api

type ConfigsInterface Uses

type ConfigsInterface interface {
    Get() (*model.GlobalConfig, *util.APIHandleError)
    Put(*model.GlobalConfig) *util.APIHandleError
}

ConfigsInterface 数据中心配置API

type MonitorInterface Uses

type MonitorInterface interface {
    GetRule(name string) (*model.AlertingNameConfig, *util.APIHandleError)
    GetAllRule() (*model.AlertingRulesConfig, *util.APIHandleError)
    DelRule(name string) (*utilhttp.ResponseBody, *util.APIHandleError)
    AddRule(path string) (*utilhttp.ResponseBody, *util.APIHandleError)
    RegRule(ruleName string, path string) (*utilhttp.ResponseBody, *util.APIHandleError)
}

ClusterInterface cluster api

type NodeConditionInterface Uses

type NodeConditionInterface interface {
    List() ([]client.NodeCondition, *util.APIHandleError)
    Delete(conditionType client.NodeConditionType) ([]client.NodeCondition, *util.APIHandleError)
}

NodeConditionInterface node condition manage api

type NodeInterface Uses

type NodeInterface interface {
    GetNodeByRule(rule string) ([]*client.HostNode, *util.APIHandleError)
    Get(node string) (*client.HostNode, *util.APIHandleError)
    GetNodeResource(node string) (*client.NodePodResource, *util.APIHandleError)
    List() ([]*client.HostNode, *util.APIHandleError)
    GetAllNodeHealth() (map[string][]map[string]string, *util.APIHandleError)
    Add(node *client.APIHostNode) (*client.HostNode, *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) NodeLabelInterface
    Condition(nid string) NodeConditionInterface
    Install(nid string) *util.APIHandleError
    UpdateNodeStatus(nid, status string) (*client.HostNode, *util.APIHandleError)
}

NodeInterface node api

type NodeLabelInterface Uses

type NodeLabelInterface interface {
    Add(k, v string) *util.APIHandleError
    Delete(k string) *util.APIHandleError
    List() (map[string]string, *util.APIHandleError)
}

NodeLabelInterface node label interface

type NotificationInterface Uses

type NotificationInterface interface {
    GetNotification(start string, end string) ([]*model.NotificationEvent, *util.APIHandleError)
    HandleNotification(serviceName string, message string) ([]*model.NotificationEvent, *util.APIHandleError)
}

NotificationInterface cluster api

type Region Uses

type Region interface {
    Tenants(name string) TenantInterface
    Resources() ResourcesInterface
    Tasks() TaskInterface
    Nodes() NodeInterface
    Cluster() ClusterInterface
    Configs() ConfigsInterface
    Version() string
    Monitor() MonitorInterface
    Notification() NotificationInterface
    DoRequest(path, method string, body io.Reader, decode *utilhttp.ResponseBody) (int, error)
}

Region region api

func GetRegion Uses

func GetRegion() Region

GetRegion GetRegion

func NewRegion Uses

func NewRegion(c APIConf) (Region, error)

NewRegion NewRegion

type ResourcesInterface Uses

type ResourcesInterface interface {
    Tenants(tenantName string) ResourcesTenantInterface
}

ResourcesInterface ResourcesInterface

type ResourcesTenantInterface Uses

type ResourcesTenantInterface interface {
    Get() (*model.TenantResource, *util.APIHandleError)
}

ResourcesTenantInterface ResourcesTenantInterface

type ServiceDeployInfo Uses

type ServiceDeployInfo struct {
    Namespace    string            `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
    Statefuleset string            `protobuf:"bytes,2,opt,name=statefuleset,proto3" json:"statefuleset,omitempty"`
    Deployment   string            `protobuf:"bytes,3,opt,name=deployment,proto3" json:"deployment,omitempty"`
    Pods         map[string]string `protobuf:"bytes,4,rep,name=pods,proto3" json:"pods,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
    Services     map[string]string `protobuf:"bytes,5,rep,name=services,proto3" json:"services,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
    Endpoints    map[string]string `protobuf:"bytes,6,rep,name=endpoints,proto3" json:"endpoints,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
    Secrets      map[string]string `protobuf:"bytes,7,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
    Ingresses    map[string]string `protobuf:"bytes,8,rep,name=ingresses,proto3" json:"ingresses,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
    Replicatset  map[string]string `protobuf:"bytes,9,rep,name=replicatset,proto3" json:"replicatset,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
    Status       string            `protobuf:"bytes,10,opt,name=status,proto3" json:"status,omitempty"`
}

ServiceDeployInfo service deploy info

type ServiceInterface Uses

type ServiceInterface interface {
    Get() (*serviceInfo, *util.APIHandleError)
    GetDeployInfo() (*ServiceDeployInfo, *util.APIHandleError)
    Pods() ([]*podInfo, *util.APIHandleError)
    List() ([]*dbmodel.TenantServices, *util.APIHandleError)
    Stop(eventID string) (string, *util.APIHandleError)
    Start(eventID string) (string, *util.APIHandleError)
    EventLog(eventID, level string) ([]*model.MessageData, *util.APIHandleError)
}

ServiceInterface ServiceInterface

type TaskInterface Uses

type TaskInterface interface {
    Get(name string) (*model.Task, *util.APIHandleError)
    GetTaskStatus(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)
}

TaskInterface task api

type TenantInterface Uses

type TenantInterface interface {
    Get() (*dbmodel.Tenants, *util.APIHandleError)
    List() ([]*dbmodel.Tenants, *util.APIHandleError)
    Delete() *util.APIHandleError
    Services(serviceAlias string) ServiceInterface
}

TenantInterface TenantInterface

Package region imports 23 packages (graph) and is imported by 2 packages. Updated 2019-09-13. Refresh now. Tools for package owners.