modulebase

package
v0.3.10-0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 56

Documentation

Index

Constants

View Source
const (
	DEFAULT_NAME_FIELD_NAME = "name"
	DEFAULT_ID_FIELD_NAME   = "id"
)

Variables

This section is empty.

Functions

func Delete

func Delete(manager ResourceManager, session *mcclient.ClientSession, path string, body jsonutils.JSONObject, respKey string) (jsonutils.JSONObject, error)

func Get

func Get(manager ResourceManager, session *mcclient.ClientSession, path string, respKey string) (jsonutils.JSONObject, error)

func GetAppOptions

func GetAppOptions(s *mcclient.ClientSession, serviceType string) (jsonutils.JSONObject, error)

func GetPProfByType

func GetPProfByType(s *mcclient.ClientSession, serviceType string, profileType string, seconds int) (io.Reader, error)

func GetRegisterdModules

func GetRegisterdModules() ([]string, []string)

func GetScopeResources

func GetScopeResources(s *mcclient.ClientSession, serviceType string) (jsonutils.JSONObject, error)

func GetStats

func GetStats(s *mcclient.ClientSession, path string, serviceType string) (jsonutils.JSONObject, error)

path: stats, db_stats, worker_stats

func GetVersion

func GetVersion(s *mcclient.ClientSession, serviceType string) (string, error)
func Head(manager ResourceManager, session *mcclient.ClientSession, path string, respKey string) (jsonutils.JSONObject, error)

func ListResult2JSON

func ListResult2JSON(result *ListResult) jsonutils.JSONObject

func ListResult2JSONWithKey

func ListResult2JSONWithKey(result *ListResult, key string) jsonutils.JSONObject

func Patch

func Patch(manager ResourceManager, session *mcclient.ClientSession, path string, body jsonutils.JSONObject, respKey string) (jsonutils.JSONObject, error)

func Post

func Post(manager ResourceManager, session *mcclient.ClientSession, path string, body jsonutils.JSONObject, respKey string) (jsonutils.JSONObject, error)

func Put

func Put(manager ResourceManager, session *mcclient.ClientSession, path string, body jsonutils.JSONObject, respKey string) (jsonutils.JSONObject, error)

func RawRequest

func RawRequest(manager ResourceManager, session *mcclient.ClientSession,
	method httputils.THttpMethod, path string,
	header http.Header, body io.Reader) (*http.Response, error)

func Register

func Register(mod IBaseManager)

func RegisterJointModule

func RegisterJointModule(mod IBaseManager)

func SubmitResults2JSON

func SubmitResults2JSON(results []SubmitResult) jsonutils.JSONObject

Types

type BaseManager

type BaseManager struct {
	// contains filtered or unexported fields
}

func NewBaseManager

func NewBaseManager(serviceType, endpointType, version string, columns, adminColumns []string) *BaseManager

func (*BaseManager) GetColumns

func (this *BaseManager) GetColumns(session *mcclient.ClientSession) []string

func (*BaseManager) SetVersion

func (this *BaseManager) SetVersion(v string)

type IBaseManager

type IBaseManager interface {
	Version() string
	// GetApiVersion() string
	GetKeyword() string
	KeyString() string
	ServiceType() string
	EndpointType() string
	GetColumns(session *mcclient.ClientSession) []string
	List(session *mcclient.ClientSession, params jsonutils.JSONObject) (*ListResult, error)
}

type IResourceManager

type IResourceManager interface {
	Manager
	GetMetadata(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	SetMetadata(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
}

type JointManager

type JointManager interface {
	IBaseManager
	MasterManager() Manager
	SlaveManager() Manager
	Get(s *mcclient.ClientSession, mid, sid string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	ListDescendent(s *mcclient.ClientSession, mid string, params jsonutils.JSONObject) (*ListResult, error)
	ListDescendent2(s *mcclient.ClientSession, sid string, params jsonutils.JSONObject) (*ListResult, error)
	ListAscendent(s *mcclient.ClientSession, mid string, params jsonutils.JSONObject) (*ListResult, error)
	Attach(s *mcclient.ClientSession, mid, sid string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	BatchAttach(s *mcclient.ClientSession, mid string, sids []string, params jsonutils.JSONObject) []SubmitResult
	BatchAttach2(s *mcclient.ClientSession, mid string, sids []string, params jsonutils.JSONObject) []SubmitResult
	Detach(s *mcclient.ClientSession, mid, sid string, query jsonutils.JSONObject) (jsonutils.JSONObject, error)
	BatchDetach(s *mcclient.ClientSession, mid string, sids []string) []SubmitResult
	BatchDetach2(s *mcclient.ClientSession, mid string, sids []string) []SubmitResult
	Update(s *mcclient.ClientSession, mid, sid string, query jsonutils.JSONObject, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	BatchUpdate(s *mcclient.ClientSession, mid string, sids []string, query jsonutils.JSONObject, params jsonutils.JSONObject) []SubmitResult
	Patch(s *mcclient.ClientSession, mid, sid string, query jsonutils.JSONObject, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	BatchPatch(s *mcclient.ClientSession, mid string, sids []string, query jsonutils.JSONObject, params jsonutils.JSONObject) []SubmitResult
}

func GetJointModule

func GetJointModule(session *mcclient.ClientSession, name string) (JointManager, error)

func GetJointModule2

func GetJointModule2(session *mcclient.ClientSession, mod1 Manager, mod2 Manager) (JointManager, error)

type JointResourceManager

type JointResourceManager struct {
	ResourceManager
	Master Manager
	Slave  Manager
}

func (*JointResourceManager) Attach

func (*JointResourceManager) BatchAttach

func (this *JointResourceManager) BatchAttach(s *mcclient.ClientSession, mid string, sids []string, params jsonutils.JSONObject) []SubmitResult

func (*JointResourceManager) BatchAttach2

func (this *JointResourceManager) BatchAttach2(s *mcclient.ClientSession, mid string, sids []string, params jsonutils.JSONObject) []SubmitResult

func (*JointResourceManager) BatchDetach

func (this *JointResourceManager) BatchDetach(s *mcclient.ClientSession, mid string, sids []string) []SubmitResult

func (*JointResourceManager) BatchDetach2

func (this *JointResourceManager) BatchDetach2(s *mcclient.ClientSession, mid string, sids []string) []SubmitResult

func (*JointResourceManager) BatchPatch

func (this *JointResourceManager) BatchPatch(s *mcclient.ClientSession, mid string, sids []string, query jsonutils.JSONObject, params jsonutils.JSONObject) []SubmitResult

func (*JointResourceManager) BatchUpdate

func (this *JointResourceManager) BatchUpdate(s *mcclient.ClientSession, mid string, sids []string, query jsonutils.JSONObject, params jsonutils.JSONObject) []SubmitResult

func (*JointResourceManager) Detach

func (*JointResourceManager) Get

func (*JointResourceManager) ListAscendent

func (this *JointResourceManager) ListAscendent(s *mcclient.ClientSession, mid string, params jsonutils.JSONObject) (*ListResult, error)

func (*JointResourceManager) ListDescendent

func (this *JointResourceManager) ListDescendent(s *mcclient.ClientSession, mid string, params jsonutils.JSONObject) (*ListResult, error)

func (*JointResourceManager) ListDescendent2

func (this *JointResourceManager) ListDescendent2(s *mcclient.ClientSession, sid string, params jsonutils.JSONObject) (*ListResult, error)

func (*JointResourceManager) MasterManager

func (this *JointResourceManager) MasterManager() Manager

func (*JointResourceManager) Patch

func (*JointResourceManager) SlaveManager

func (this *JointResourceManager) SlaveManager() Manager

func (*JointResourceManager) Update

type ListResult

type ListResult struct {
	Data   []jsonutils.JSONObject `json:"data,allowempty"`
	Total  int
	Limit  int
	Offset int

	NextMarker  string
	MarkerField string
	MarkerOrder string
}

func JSON2ListResult

func JSON2ListResult(result jsonutils.JSONObject) *ListResult

func List

func List(manager ResourceManager, session *mcclient.ClientSession, path, respKey string) (*ListResult, error)

func ListWorkers

func ListWorkers(s *mcclient.ClientSession, serviceType string) (*ListResult, error)

func SubmitResults2ListResult

func SubmitResults2ListResult(results []SubmitResult) *ListResult

type Manager

type Manager interface {
	IBaseManager
	/* resource list
	   GET <base_url>/<resource_plural_keyword>
	   e.g GET <base_url>/alarms
	   querystring stores in params
	   e.g. GET <base_url>/alarms?limit=20&offset=20&search=test

	   return list of resources in json format
	   { "<resource_plural_keyword>": [ {object details}, {object details}, ...] }, limit: 20, offset: 20, total: 2000}
	*/
	// List(session *mcclient.ClientSession, params jsonutils.JSONObject) (*ListResult, error)
	/*
	   resource list in a context
	   GET <base_url>/<context_plural_keyword>/<context_id>/<resource_plural_keyword>?querystring
	   e.g. GET <base_url>/nodes/1/labels?name=xxx
	   ListInContext(s, params, &modules.Labels, label_id)
	   return:
	   { "<resource_plural_keyword>": [ {object details}, {object details}, ...] }, limit: 20, offset: 20, total: 2000}
	*/
	ListInContext(session *mcclient.ClientSession, params jsonutils.JSONObject, ctx Manager, ctxid string) (*ListResult, error)
	ListInContexts(session *mcclient.ClientSession, params jsonutils.JSONObject, ctxs []ManagerContext) (*ListResult, error)
	/*
	  GET <base_url>/<resource_plural_keyword>/<resource_id>
	  e.g GET <base_url>/alarams/1

	*/
	Get(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	GetInContext(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)
	GetInContexts(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)
	GetId(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (string, error)
	GetIdInContext(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctx Manager, ctxid string) (string, error)
	GetIdInContexts(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctxs []ManagerContext) (string, error)
	GetById(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	GetByIdInContext(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)
	GetByIdInContexts(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)
	GetByName(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	GetByNameInContext(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)
	GetByNameInContexts(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)
	/*
	  HEAD <base_url>/<resource_plural_keyword>/<resource_id>
	  e.g HEAD <base_url>/alarams/1

	*/
	Head(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	HeadInContext(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)
	HeadInContexts(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)
	BatchGet(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject) []SubmitResult
	BatchGetInContext(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult
	BatchGetInContexts(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult
	GetSpecific(session *mcclient.ClientSession, id string, spec string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	GetSpecificInContext(session *mcclient.ClientSession, id string, spec string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)
	GetSpecificInContexts(session *mcclient.ClientSession, id string, spec string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)
	/*
	  POST <base_url>/<resource_plural_keyword>/<resource_id>
	  e.g POST <base_url>/alarams/1

	*/
	Create(session *mcclient.ClientSession, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	CreateInContext(session *mcclient.ClientSession, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)
	CreateInContexts(session *mcclient.ClientSession, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)
	BatchCreate(session *mcclient.ClientSession, params jsonutils.JSONObject, count int) []SubmitResult
	BatchCreateInContext(session *mcclient.ClientSession, params jsonutils.JSONObject, count int, ctx Manager, ctxid string) []SubmitResult
	BatchCreateInContexts(session *mcclient.ClientSession, params jsonutils.JSONObject, count int, ctxs []ManagerContext) []SubmitResult
	Update(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	Put(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	PutSpecific(session *mcclient.ClientSession, id string, spec string, query jsonutils.JSONObject, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	PutInContext(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)
	PutInContexts(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)
	BatchUpdate(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject) []SubmitResult
	BatchParamsUpdate(session *mcclient.ClientSession, idlist []string, params []jsonutils.JSONObject) []SubmitResult
	BatchPut(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject) []SubmitResult
	BatchPutInContext(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult
	BatchPutInContexts(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult
	Patch(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	PatchInContext(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)
	PatchInContexts(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)
	BatchPatch(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject) []SubmitResult
	BatchPatchInContext(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult
	BatchPatchInContexts(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult
	PerformAction(session *mcclient.ClientSession, id string, action string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	PerformClassAction(session *mcclient.ClientSession, action string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
	PerformActionInContext(session *mcclient.ClientSession, id string, action string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)
	PerformActionInContexts(session *mcclient.ClientSession, id string, action string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)
	BatchPerformAction(session *mcclient.ClientSession, idlist []string, action string, params jsonutils.JSONObject) []SubmitResult
	BatchPerformActionInContext(session *mcclient.ClientSession, idlist []string, action string, params jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult
	BatchPerformActionInContexts(session *mcclient.ClientSession, idlist []string, action string, params jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult
	Delete(session *mcclient.ClientSession, id string, body jsonutils.JSONObject) (jsonutils.JSONObject, error)
	DeleteWithParam(session *mcclient.ClientSession, id string, query jsonutils.JSONObject, body jsonutils.JSONObject) (jsonutils.JSONObject, error)
	DeleteInContext(session *mcclient.ClientSession, id string, body jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)
	DeleteInContextWithParam(session *mcclient.ClientSession, id string, query jsonutils.JSONObject, body jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)
	DeleteInContexts(session *mcclient.ClientSession, id string, body jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)
	DeleteInContextsWithParam(session *mcclient.ClientSession, id string, query jsonutils.JSONObject, body jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)
	BatchDelete(session *mcclient.ClientSession, idlist []string, body jsonutils.JSONObject) []SubmitResult
	BatchDeleteWithParam(session *mcclient.ClientSession, idlist []string, query jsonutils.JSONObject, body jsonutils.JSONObject) []SubmitResult
	BatchDeleteInContext(session *mcclient.ClientSession, idlist []string, body jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult
	BatchDeleteInContextWithParam(session *mcclient.ClientSession, idlist []string, query jsonutils.JSONObject, body jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult
	BatchDeleteInContexts(session *mcclient.ClientSession, idlist []string, body jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult
	BatchDeleteInContextsWithParam(session *mcclient.ClientSession, idlist []string, query jsonutils.JSONObject, body jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult
}

func GetModule

func GetModule(session *mcclient.ClientSession, name string) (Manager, error)

type ManagerContext

type ManagerContext struct {
	InstanceManager Manager
	InstanceId      string
}

type ResourceManager

type ResourceManager struct {
	BaseManager

	Keyword       string
	KeywordPlural string
	// contains filtered or unexported fields
}

func (*ResourceManager) BatchCreate

func (this *ResourceManager) BatchCreate(session *mcclient.ClientSession, params jsonutils.JSONObject, count int) []SubmitResult

func (*ResourceManager) BatchCreateInContext

func (this *ResourceManager) BatchCreateInContext(session *mcclient.ClientSession, params jsonutils.JSONObject, count int, ctx Manager, ctxid string) []SubmitResult

func (*ResourceManager) BatchCreateInContexts

func (this *ResourceManager) BatchCreateInContexts(session *mcclient.ClientSession, params jsonutils.JSONObject, count int, ctxs []ManagerContext) []SubmitResult

func (*ResourceManager) BatchDelete

func (this *ResourceManager) BatchDelete(session *mcclient.ClientSession, idlist []string, body jsonutils.JSONObject) []SubmitResult

func (*ResourceManager) BatchDeleteInContext

func (this *ResourceManager) BatchDeleteInContext(session *mcclient.ClientSession, idlist []string, body jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult

func (*ResourceManager) BatchDeleteInContextWithParam

func (this *ResourceManager) BatchDeleteInContextWithParam(session *mcclient.ClientSession, idlist []string, params, body jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult

func (*ResourceManager) BatchDeleteInContexts

func (this *ResourceManager) BatchDeleteInContexts(session *mcclient.ClientSession, idlist []string, body jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult

func (*ResourceManager) BatchDeleteInContextsWithParam

func (this *ResourceManager) BatchDeleteInContextsWithParam(session *mcclient.ClientSession, idlist []string, params, body jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult

func (*ResourceManager) BatchDeleteWithParam

func (this *ResourceManager) BatchDeleteWithParam(session *mcclient.ClientSession, idlist []string, params, body jsonutils.JSONObject) []SubmitResult

func (*ResourceManager) BatchGet

func (this *ResourceManager) BatchGet(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject) []SubmitResult

func (*ResourceManager) BatchGetInContext

func (this *ResourceManager) BatchGetInContext(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult

func (*ResourceManager) BatchGetInContexts

func (this *ResourceManager) BatchGetInContexts(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult

func (*ResourceManager) BatchParamsPutInContexts

func (this *ResourceManager) BatchParamsPutInContexts(session *mcclient.ClientSession, idlist []string, params []jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult

func (*ResourceManager) BatchParamsUpdate

func (this *ResourceManager) BatchParamsUpdate(session *mcclient.ClientSession, idlist []string, params []jsonutils.JSONObject) []SubmitResult

func (*ResourceManager) BatchPatch

func (this *ResourceManager) BatchPatch(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject) []SubmitResult

func (*ResourceManager) BatchPatchInContext

func (this *ResourceManager) BatchPatchInContext(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult

func (*ResourceManager) BatchPatchInContexts

func (this *ResourceManager) BatchPatchInContexts(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult

func (*ResourceManager) BatchPerformAction

func (this *ResourceManager) BatchPerformAction(session *mcclient.ClientSession, idlist []string, action string, params jsonutils.JSONObject) []SubmitResult

func (*ResourceManager) BatchPerformActionInContext

func (this *ResourceManager) BatchPerformActionInContext(session *mcclient.ClientSession, idlist []string, action string, params jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult

func (*ResourceManager) BatchPerformActionInContexts

func (this *ResourceManager) BatchPerformActionInContexts(session *mcclient.ClientSession, idlist []string, action string, params jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult

func (*ResourceManager) BatchPerformClassAction

func (this *ResourceManager) BatchPerformClassAction(session *mcclient.ClientSession, action string, batchParams []jsonutils.JSONObject) []SubmitResult

func (*ResourceManager) BatchPerformClassActionInContexts

func (this *ResourceManager) BatchPerformClassActionInContexts(session *mcclient.ClientSession, action string, batchParams []jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult

func (*ResourceManager) BatchPut

func (this *ResourceManager) BatchPut(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject) []SubmitResult

func (*ResourceManager) BatchPutInContext

func (this *ResourceManager) BatchPutInContext(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult

func (*ResourceManager) BatchPutInContexts

func (this *ResourceManager) BatchPutInContexts(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult

func (*ResourceManager) BatchUpdate

func (this *ResourceManager) BatchUpdate(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject) []SubmitResult

func (*ResourceManager) ContextPath

func (this *ResourceManager) ContextPath(ctxs []ManagerContext) string

func (*ResourceManager) Create

func (*ResourceManager) CreateInContext

func (this *ResourceManager) CreateInContext(session *mcclient.ClientSession, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)

func (*ResourceManager) CreateInContexts

func (this *ResourceManager) CreateInContexts(session *mcclient.ClientSession, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)

func (*ResourceManager) Delete

func (*ResourceManager) DeleteInContext

func (this *ResourceManager) DeleteInContext(session *mcclient.ClientSession, id string, body jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)

func (*ResourceManager) DeleteInContextWithParam

func (this *ResourceManager) DeleteInContextWithParam(session *mcclient.ClientSession, id string, query jsonutils.JSONObject, body jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)

func (*ResourceManager) DeleteInContexts

func (this *ResourceManager) DeleteInContexts(session *mcclient.ClientSession, id string, body jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)

func (*ResourceManager) DeleteInContextsWithParam

func (this *ResourceManager) DeleteInContextsWithParam(session *mcclient.ClientSession, id string, params, body jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)

func (*ResourceManager) DeleteWithParam

func (this *ResourceManager) DeleteWithParam(session *mcclient.ClientSession, id string, params, body jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (ResourceManager) EndpointType

func (this ResourceManager) EndpointType() string

func (*ResourceManager) Get

func (*ResourceManager) GetById

func (*ResourceManager) GetByIdInContext

func (this *ResourceManager) GetByIdInContext(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)

func (*ResourceManager) GetByIdInContexts

func (this *ResourceManager) GetByIdInContexts(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)

func (*ResourceManager) GetByName

func (this *ResourceManager) GetByName(session *mcclient.ClientSession, name string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*ResourceManager) GetByNameInContext

func (this *ResourceManager) GetByNameInContext(session *mcclient.ClientSession, name string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)

func (*ResourceManager) GetByNameInContexts

func (this *ResourceManager) GetByNameInContexts(session *mcclient.ClientSession, name string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)

func (*ResourceManager) GetId

func (this *ResourceManager) GetId(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (string, error)

func (*ResourceManager) GetIdInContext

func (this *ResourceManager) GetIdInContext(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctx Manager, ctxid string) (string, error)

func (*ResourceManager) GetIdInContexts

func (this *ResourceManager) GetIdInContexts(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctxs []ManagerContext) (string, error)

func (*ResourceManager) GetInContext

func (this *ResourceManager) GetInContext(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)

func (*ResourceManager) GetInContexts

func (this *ResourceManager) GetInContexts(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)

func (ResourceManager) GetKeyword

func (this ResourceManager) GetKeyword() string

func (*ResourceManager) GetMetadata

func (this *ResourceManager) GetMetadata(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*ResourceManager) GetSpecific

func (this *ResourceManager) GetSpecific(session *mcclient.ClientSession, id string, spec string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*ResourceManager) GetSpecificInContext

func (this *ResourceManager) GetSpecificInContext(session *mcclient.ClientSession, id string, spec string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)

func (*ResourceManager) GetSpecificInContexts

func (this *ResourceManager) GetSpecificInContexts(session *mcclient.ClientSession, id string, spec string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)

func (*ResourceManager) Head

func (*ResourceManager) HeadInContext

func (this *ResourceManager) HeadInContext(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)

func (*ResourceManager) HeadInContexts

func (this *ResourceManager) HeadInContexts(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)

func (ResourceManager) KeyString

func (this ResourceManager) KeyString() string

func (*ResourceManager) List

func (this *ResourceManager) List(session *mcclient.ClientSession, params jsonutils.JSONObject) (*ListResult, error)

func (*ResourceManager) ListInContext

func (this *ResourceManager) ListInContext(session *mcclient.ClientSession, params jsonutils.JSONObject, ctx Manager, ctxid string) (*ListResult, error)

func (*ResourceManager) ListInContexts

func (this *ResourceManager) ListInContexts(session *mcclient.ClientSession, params jsonutils.JSONObject, ctxs []ManagerContext) (*ListResult, error)

func (*ResourceManager) Patch

func (*ResourceManager) PatchInContext

func (this *ResourceManager) PatchInContext(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)

func (*ResourceManager) PatchInContexts

func (this *ResourceManager) PatchInContexts(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)

func (*ResourceManager) PerformAction

func (this *ResourceManager) PerformAction(session *mcclient.ClientSession, id string, action string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*ResourceManager) PerformActionInContext

func (this *ResourceManager) PerformActionInContext(session *mcclient.ClientSession, id string, action string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)

func (*ResourceManager) PerformActionInContexts

func (this *ResourceManager) PerformActionInContexts(session *mcclient.ClientSession, id string, action string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)

func (*ResourceManager) PerformClassAction

func (this *ResourceManager) PerformClassAction(session *mcclient.ClientSession, action string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*ResourceManager) PerformClassActionInContexts

func (this *ResourceManager) PerformClassActionInContexts(session *mcclient.ClientSession, action string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)

func (*ResourceManager) Put

func (*ResourceManager) PutInContext

func (this *ResourceManager) PutInContext(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)

func (*ResourceManager) PutInContexts

func (this *ResourceManager) PutInContexts(session *mcclient.ClientSession, id string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)

func (*ResourceManager) PutSpecific

func (this *ResourceManager) PutSpecific(session *mcclient.ClientSession, id string, spec string, query, body jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*ResourceManager) PutSpecificInContext

func (this *ResourceManager) PutSpecificInContext(session *mcclient.ClientSession, id string, spec string, query, body jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)

func (*ResourceManager) PutSpecificInContexts

func (this *ResourceManager) PutSpecificInContexts(session *mcclient.ClientSession, id string, spec string, query, body jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)

func (ResourceManager) ServiceType

func (this ResourceManager) ServiceType() string

func (*ResourceManager) SetEnableFilter

func (this *ResourceManager) SetEnableFilter(enable bool) *ResourceManager

func (*ResourceManager) SetMetadata

func (this *ResourceManager) SetMetadata(session *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)

func (*ResourceManager) SetNameField

func (this *ResourceManager) SetNameField(fn string) *ResourceManager

func (*ResourceManager) SetReadFilter

func (this *ResourceManager) SetReadFilter(filter TResourceFilter) *ResourceManager

func (*ResourceManager) SetWriteFilter

func (this *ResourceManager) SetWriteFilter(filter TResourceFilter) *ResourceManager

func (ResourceManager) URLPath

func (this ResourceManager) URLPath() string

func (*ResourceManager) Update

func (ResourceManager) Version

func (this ResourceManager) Version() string

type SubmitResult

type SubmitResult struct {
	Status int
	Id     interface{}
	Data   jsonutils.JSONObject
}

func BatchDo

func BatchDo(ids []string, do func(id string) (jsonutils.JSONObject, error)) []SubmitResult

func BatchDoClassAction

func BatchDoClassAction(
	batchParams []jsonutils.JSONObject, do func(jsonutils.JSONObject) (jsonutils.JSONObject, error),
) []SubmitResult

func BatchParamsDo

func BatchParamsDo(
	ids []string, params []jsonutils.JSONObject,
	do func(id string, param jsonutils.JSONObject) (jsonutils.JSONObject, error),
) []SubmitResult

Jump to

Keyboard shortcuts

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