onecloud

package
v0.0.0-...-6c4e8d0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotFoundMsg          = "NotFoundError"
	K8SSystemClusterName = "system-default"
)
View Source
const (
	DevtoolTelegrafConf = `` /* 1275-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func AllowUserWebLogin

func AllowUserWebLogin(s *mcclient.ClientSession, username string) (jsonutils.JSONObject, error)

func ChangeUserPassword

func ChangeUserPassword(s *mcclient.ClientSession, username string, password string) (jsonutils.JSONObject, error)

func CreateDevtoolTemplate

func CreateDevtoolTemplate(
	s *mcclient.ClientSession,
	name string,
	hosts []string,
	mods []string,
	files map[string]string,
	interval int64,
) (jsonutils.JSONObject, error)

func CreateDynamicSchedtag

func CreateDynamicSchedtag(s *mcclient.ClientSession, name, schedtag, condition string) (jsonutils.JSONObject, error)

func CreateNetwork

func CreateNetwork(
	s *mcclient.ClientSession,
	name string,
	gateway string,
	serverType string,
	wireId string,
	maskLen int,
	startIp string,
	endIp string,
) (jsonutils.JSONObject, error)

func CreateRegion

func CreateRegion(s *mcclient.ClientSession, region, zone string) (jsonutils.JSONObject, error)

func CreateRole

func CreateRole(s *mcclient.ClientSession, roleName, description string) (jsonutils.JSONObject, error)

func CreateSchedtag

func CreateSchedtag(s *mcclient.ClientSession, name string, strategy string, description string) (jsonutils.JSONObject, error)

func CreateService

func CreateService(s *mcclient.ClientSession, svcName, svcType string) (jsonutils.JSONObject, error)

func CreateServiceCertificate

func CreateServiceCertificate(s *mcclient.ClientSession, certName string, certDetails *jsonutils.JSONDict) (jsonutils.JSONObject, error)

func CreateUser

func CreateUser(s *mcclient.ClientSession, username string, password string) (jsonutils.JSONObject, error)

func CreateWire

func CreateWire(s *mcclient.ClientSession, zone string, wire string, bw int, vpc string) (jsonutils.JSONObject, error)

func CreateZone

func CreateZone(s *mcclient.ClientSession, zone string) (jsonutils.JSONObject, error)

func DeleteCommonAlert

func DeleteCommonAlert(s *mcclient.ClientSession, ids []string)

func DeleteResource

func DeleteResource(
	s *mcclient.ClientSession,
	man modulebase.Manager,
	name string,
) error

func DeleteServiceEndpoints

func DeleteServiceEndpoints(s *mcclient.ClientSession, serviceName string) error

func DevtoolTemplateCreateParams

func DevtoolTemplateCreateParams(
	name string,
	hostLines []string,
	mods []string,
	files map[string]string,
	day int64,
	hour int64,
	min int64,
	sec int64,
	interval int64,
	start bool,
	enabled bool,
) (*jsonutils.JSONDict, error)

func DisableEndpoint

func DisableEndpoint(s *mcclient.ClientSession, id string) error

func DisableService

func DisableService(s *mcclient.ClientSession, id string) error

func EnsureAgentAnsiblePlaybookRef

func EnsureAgentAnsiblePlaybookRef(s *mcclient.ClientSession) error

func EnsureDevtoolTemplate

func EnsureDevtoolTemplate(
	s *mcclient.ClientSession,
	name string,
	hosts []string,
	mods []string,
	files map[string]string,
	interval int64,
) (jsonutils.JSONObject, error)

func EnsureDynamicSchedtag

func EnsureDynamicSchedtag(s *mcclient.ClientSession, name, schedtag, condition string) (jsonutils.JSONObject, error)

func EnsureEndpoint

func EnsureEndpoint(
	s *mcclient.ClientSession, svcId, regionId, interfaceType, url, serviceCert string,
) (jsonutils.JSONObject, error)

func EnsureResource

func EnsureResource(
	s *mcclient.ClientSession,
	man modulebase.Manager,
	name string,
	createFunc func() (jsonutils.JSONObject, error),
) (jsonutils.JSONObject, error)

func EnsureRole

func EnsureRole(s *mcclient.ClientSession, roleName, description string) (jsonutils.JSONObject, error)

func EnsureSchedtag

func EnsureSchedtag(s *mcclient.ClientSession, name string, strategy string, description string) (jsonutils.JSONObject, error)

func EnsureService

func EnsureService(s *mcclient.ClientSession, svcName, svcType string) (jsonutils.JSONObject, error)

func EnsureServiceCertificate

func EnsureServiceCertificate(s *mcclient.ClientSession, certName string, certDetails *jsonutils.JSONDict) (jsonutils.JSONObject, error)

func GetCommonAlertOfSys

func GetCommonAlertOfSys(session *mcclient.ClientSession) ([]jsonutils.JSONObject, error)

func GetEndpointsByService

func GetEndpointsByService(s *mcclient.ClientSession, serviceName string) ([]jsonutils.JSONObject, error)

func GetSystemCluster

func GetSystemCluster(s *mcclient.ClientSession) (jsonutils.JSONObject, error)

func InitServiceAccount

func InitServiceAccount(s *mcclient.ClientSession, username string, password string) error

func IsDynamicSchedtagExists

func IsDynamicSchedtagExists(s *mcclient.ClientSession, name string) (jsonutils.JSONObject, bool, error)

func IsEndpointExists

func IsEndpointExists(s *mcclient.ClientSession, svcId, regionId, interfaceType string) (jsonutils.JSONObject, bool, error)

func IsNetworkExists

func IsNetworkExists(s *mcclient.ClientSession, net string) (jsonutils.JSONObject, bool, error)

func IsNotFoundError

func IsNotFoundError(err error) bool

func IsResourceExists

func IsResourceExists(s *mcclient.ClientSession, manager modulebase.Manager, name string) (jsonutils.JSONObject, bool, error)

func IsRoleExists

func IsRoleExists(s *mcclient.ClientSession, roleName string) (jsonutils.JSONObject, bool, error)

func IsSchedtagExists

func IsSchedtagExists(s *mcclient.ClientSession, name string) (jsonutils.JSONObject, bool, error)

func IsServiceExists

func IsServiceExists(s *mcclient.ClientSession, svcName string) (jsonutils.JSONObject, bool, error)

func IsUserExists

func IsUserExists(s *mcclient.ClientSession, username string) (jsonutils.JSONObject, bool, error)

func IsWireExists

func IsWireExists(s *mcclient.ClientSession, wire string) (jsonutils.JSONObject, bool, error)

func IsZoneExists

func IsZoneExists(s *mcclient.ClientSession, zone string) (jsonutils.JSONObject, bool, error)

func NetworkPrivate

func NetworkPrivate(s *mcclient.ClientSession, name string) (jsonutils.JSONObject, error)

func ProjectAddUser

func ProjectAddUser(s *mcclient.ClientSession, projectId string, userId string, roleId string) error

func RegisterServiceEndpointByInterfaces

func RegisterServiceEndpointByInterfaces(
	s *mcclient.ClientSession,
	regionId string,
	serviceName string,
	serviceType string,
	endpointUrl string,
	serviceCert string,
	interfaces []string,
) error

func RegisterServiceEndpoints

func RegisterServiceEndpoints(
	s *mcclient.ClientSession,
	regionId string,
	serviceName string,
	serviceType string,
	serviceCert string,
	interfaceUrls map[string]string,
) error

func RegisterServicePublicInternalEndpoint

func RegisterServicePublicInternalEndpoint(
	s *mcclient.ClientSession,
	regionId string,
	serviceName string,
	serviceType string,
	serviceCert string,
	endpointUrl string,
) error

func SyncServiceConfig

func SyncServiceConfig(
	s *mcclient.ClientSession, syncConf map[string]string, serviceName string,
) (jsonutils.JSONObject, error)

func SyncSystemCluster

func SyncSystemCluster(s *mcclient.ClientSession, id string) error

func ToPlaybook

func ToPlaybook(
	hostLines []string,
	mods []string,
	files map[string]string,
) (*ansible.Playbook, error)

Types

type ClusterComponentType

type ClusterComponentType string
const (
	ClusterComponentTypeMinio        ClusterComponentType = "minio"
	ClusterComponentTypeMonitorMinio ClusterComponentType = "monitorMinio"
	ClusterComponentTypeMonitor      ClusterComponentType = "monitor"
	ClusterComponentTypeThanos       ClusterComponentType = "thanos"
)

type ClusterComponentsStatus

type ClusterComponentsStatus struct {
	CephCSI      *ComponentStatus `json:"cephCSI"`
	Monitor      *ComponentStatus `json:"monitor"`
	FluentBit    *ComponentStatus `json:"fluentbit"`
	Thanos       *ComponentStatus `json:"thanos"`
	Minio        *ComponentStatus `json:"minio"`
	MonitorMinio *ComponentStatus `json:"monitorMinio"`
}

func GetSystemClusterComponentsStatus

func GetSystemClusterComponentsStatus(s *mcclient.ClientSession, id string) (*ClusterComponentsStatus, error)

type ClusterEnableComponentMinioOpt

type ClusterEnableComponentMinioOpt struct {
	k8s.ClusterComponentOptions
	k8s.ClusterComponentMinioSetting
}

func (ClusterEnableComponentMinioOpt) Params

type CommonAlertTem

type CommonAlertTem struct {
	Database    string `json:"database"`
	Measurement string `json:"measurement"`
	//rule operator rule [and|or]
	Operator    string   `json:"operator"`
	Field       []string `json:"field"`
	FieldFunc   string   `json:"field_func"`
	Description string   `json:"description"`

	Reduce        string
	Comparator    string  `json:"comparator"`
	Threshold     float64 `json:"threshold"`
	Filters       []monitorapi.MetricQueryTag
	FieldOpt      string `json:"field_opt"`
	GetPointStr   bool   `json:"get_point_str"`
	Name          string
	ConditionType string `json:"condition_type"`
	From          string `json:"from"`
	Interval      string `json:"interval"`
	GroupBy       string `json:"group_by"`
	Level         string `json:"level"`
	NoDataState   string `json:"no_data_state"`
}

type ComponentStatus

type ComponentStatus struct {
	Id      string `json:"id"`
	Created bool   `json:"created"`
	Enabled bool   `json:"enabled"`
	Status  string `json:"status"`
}

type EnableMinioParams

type EnableMinioParams struct {
	Mode          string
	Replicas      int
	DrivesPerNode int
	AccessKey     string
	SecretKey     string
}

type OCWaiter

type OCWaiter struct {
	apiclient.Waiter
	// contains filtered or unexported fields
}

func (*OCWaiter) WaitForGlance

func (w *OCWaiter) WaitForGlance() error

func (*OCWaiter) WaitForKeystone

func (w *OCWaiter) WaitForKeystone() error

func (*OCWaiter) WaitForPodsWithLabel

func (w *OCWaiter) WaitForPodsWithLabel(kvLabel string) error

WaitForPodsWithLabel will lookup pods with the given label and wait until they are all reporting status as running.

func (*OCWaiter) WaitForRegion

func (w *OCWaiter) WaitForRegion() error

func (*OCWaiter) WaitForScheduler

func (w *OCWaiter) WaitForScheduler() error

func (*OCWaiter) WaitForServicePods

func (w *OCWaiter) WaitForServicePods(serviceName string) error

type Waiter

type Waiter interface {
	apiclient.Waiter

	WaitForServicePods(serviceName string) error
	WaitForKeystone() error
	WaitForRegion() error
	WaitForScheduler() error
	WaitForGlance() error
}

func NewOCWaiter

func NewOCWaiter(
	kubeClient clientset.Interface,
	sessionFactory func() (*mcclient.ClientSession, error),
	timeout time.Duration,
	writer io.Writer,
) Waiter

NewOCWaiter returns a new Onecloud waiter object that check service healthy

Jump to

Keyboard shortcuts

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