onecloud

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DevtoolTelegrafConf = `` /* 1275-byte string literal not displayed */

)
View Source
const (
	NotFoundMsg = "NotFoundError"
)

Variables

This section is empty.

Functions

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 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 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 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 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 GetEndpointsByService

func GetEndpointsByService(s *mcclient.ClientSession, serviceName string) ([]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,
	interfaces []string,
) error

func RegisterServiceEndpoints

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

func RegisterServicePublicInternalEndpoint

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

func ToPlaybook

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

Types

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