api

package
v2.2.0-rc25 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigDir                   = "/etc/baetyl"
	ProgramConfigDir            = "/var/lib/baetyl/bin"
	FunctionConfigPrefix        = "baetyl-function-config"
	FunctionProgramConfigPrefix = "baetyl-function-program-config"
	FunctionCodePrefix          = "baetyl-function-code"
	FunctionDefaultConfigFile   = "conf.yml"
)
View Source
const (
	ConfigTypeKV         = "kv"
	ConfigTypeObject     = "object"
	ConfigTypeFunction   = "function"
	ConfigObjectTypeHttp = "http"
)
View Source
const (
	OfflineDuration         = 40 * time.Second
	NodeNumber              = 1
	BaetylCorePrevVersion   = "BaetylCorePrevVersion"
	BaetylCoreFrequency     = "BaetylCoreFrequency"
	BaetylNodeNameKey       = "baetyl-node-name"
	BaetylAppNameKey        = "baetyl-app-name"
	BaetylCoreConfPrefix    = "baetyl-core-conf"
	BaetylCoreContainerPort = 80
	BaetylVersionPrefix     = "baetyl-version-"
	DefaultMode             = "kube"
)
View Source
const (
	CurrentAccount = "current"
	OtherAccount   = "other"
)

Variables

This section is empty.

Functions

func CheckAndParseToken

func CheckAndParseToken(token string, genToken func(map[string]interface{}) (string, error)) (map[string]interface{}, error)

Types

type API

API baetyl api server

func NewAPI

func NewAPI(config *config.CloudConfig) (*API, error)

NewAPI NewAPI

func (*API) CreateApplication

func (api *API) CreateApplication(c *common.Context) (interface{}, error)

CreateApplication create one application

func (*API) CreateCertificate

func (api *API) CreateCertificate(c *common.Context) (interface{}, error)

CreateCertificate create one Certificate

func (*API) CreateConfig

func (api *API) CreateConfig(c *common.Context) (interface{}, error)

CreateConfig create one config

func (*API) CreateNamespace

func (api *API) CreateNamespace(c *common.Context) (interface{}, error)

CreateNamespace create one namespace

func (*API) CreateNode

func (api *API) CreateNode(c *common.Context) (interface{}, error)

CreateNode create one node

func (*API) CreateProperty

func (api *API) CreateProperty(c *common.Context) (interface{}, error)

func (*API) CreateQuota added in v2.1.1

func (api *API) CreateQuota(c *common.Context) (interface{}, error)

CreateQuota for mis server api

  • param namespace
  • param quotaName
  • param quota

func (*API) CreateQuotas added in v2.1.1

func (api *API) CreateQuotas(namespace string, quotas map[string]int) error

func (*API) CreateRegistry

func (api *API) CreateRegistry(c *common.Context) (interface{}, error)

CreateRegistry create one Registry

func (*API) CreateSecret

func (api *API) CreateSecret(c *common.Context) (interface{}, error)

CreateSecret create one secret

func (*API) DeleteApplication

func (api *API) DeleteApplication(c *common.Context) (interface{}, error)

DeleteApplication delete the application

func (*API) DeleteCertificate

func (api *API) DeleteCertificate(c *common.Context) (interface{}, error)

DeleteCertificate delete the Certificate

func (*API) DeleteConfig

func (api *API) DeleteConfig(c *common.Context) (interface{}, error)

DeleteConfig delete the config

func (*API) DeleteNamespace

func (api *API) DeleteNamespace(c *common.Context) (interface{}, error)

func (*API) DeleteNode

func (api *API) DeleteNode(c *common.Context) (interface{}, error)

DeleteNode delete the node

func (*API) DeleteNodeAndAppIndex

func (api *API) DeleteNodeAndAppIndex(namespace string, app *specV1.Application) error

func (*API) DeleteProperty

func (api *API) DeleteProperty(c *common.Context) (interface{}, error)

func (*API) DeleteQuota added in v2.1.1

func (api *API) DeleteQuota(c *common.Context) (interface{}, error)

DeleteQuota for mis server api

  • param namespace
  • param quotaName

func (*API) DeleteQuotaByNamespace added in v2.1.1

func (api *API) DeleteQuotaByNamespace(namespace string) error

DeleteQuotaByNamespace

  • param namespace

func (*API) DeleteRegistry

func (api *API) DeleteRegistry(c *common.Context) (interface{}, error)

DeleteRegistry delete the Registry

func (*API) DeleteSecret

func (api *API) DeleteSecret(c *common.Context) (interface{}, error)

DeleteSecret delete the secret

func (*API) GenInitCmdFromNode

func (api *API) GenInitCmdFromNode(c *common.Context) (interface{}, error)

GenInitCmdFromNode generate install command

func (*API) GetAppByCertificate

func (api *API) GetAppByCertificate(c *common.Context) (interface{}, error)

GetAppByCertificate list app

func (*API) GetAppByConfig

func (api *API) GetAppByConfig(c *common.Context) (interface{}, error)

func (*API) GetAppByNode

func (api *API) GetAppByNode(c *common.Context) (interface{}, error)

GetAppByNode list app

func (*API) GetAppByRegistry

func (api *API) GetAppByRegistry(c *common.Context) (interface{}, error)

GetAppByRegistry list app

func (*API) GetAppBySecret

func (api *API) GetAppBySecret(c *common.Context) (interface{}, error)

GetAppBySecret list app

func (*API) GetApplication

func (api *API) GetApplication(c *common.Context) (interface{}, error)

GetApplication get a application

func (*API) GetCertificate

func (api *API) GetCertificate(c *common.Context) (interface{}, error)

GetCertificate get a Certificate

func (*API) GetConfig

func (api *API) GetConfig(c *common.Context) (interface{}, error)

GetConfig get a config

func (*API) GetCoreAppConfigs added in v2.2.0

func (api *API) GetCoreAppConfigs(c *common.Context) (interface{}, error)

func (*API) GetCoreAppVersions added in v2.2.0

func (api *API) GetCoreAppVersions(c *common.Context) (interface{}, error)

func (*API) GetNamespace

func (api *API) GetNamespace(c *common.Context) (interface{}, error)

GetNamespace get one namespace

func (*API) GetNode

func (api *API) GetNode(c *common.Context) (interface{}, error)

GetNode get a node

func (*API) GetNodeDeployHistory

func (api *API) GetNodeDeployHistory(c *common.Context) (interface{}, error)

GetNodeDeployHistory list node // TODO will support later

func (*API) GetNodeProperties added in v2.1.1

func (api *API) GetNodeProperties(c *common.Context) (interface{}, error)

func (*API) GetNodeStats

func (api *API) GetNodeStats(c *common.Context) (interface{}, error)

GetNodeStats get a node stats

func (*API) GetNodes

func (api *API) GetNodes(c *common.Context) (interface{}, error)

func (*API) GetProperty

func (api *API) GetProperty(c *common.Context) (interface{}, error)

func (*API) GetQuota

func (api *API) GetQuota(c *common.Context) (interface{}, error)

GetQuota for admin api

func (*API) GetQuotaForMis added in v2.1.1

func (api *API) GetQuotaForMis(c *common.Context) (interface{}, error)

GetQuota for mis server api

  • param namespace

func (*API) GetRegistry

func (api *API) GetRegistry(c *common.Context) (interface{}, error)

GetRegistry get a Registry

func (*API) GetSecret

func (api *API) GetSecret(c *common.Context) (interface{}, error)

GetSecret get a secret

func (*API) GetSysAppCertificates added in v2.2.0

func (api *API) GetSysAppCertificates(c *common.Context) (interface{}, error)

func (*API) GetSysAppConfigs added in v2.2.0

func (api *API) GetSysAppConfigs(c *common.Context) (interface{}, error)

func (*API) GetSysAppRegistries added in v2.2.0

func (api *API) GetSysAppRegistries(c *common.Context) (interface{}, error)

func (*API) GetSysAppSecrets added in v2.2.0

func (api *API) GetSysAppSecrets(c *common.Context) (interface{}, error)

func (*API) ImportFunction

func (api *API) ImportFunction(c *common.Context) (interface{}, error)

ImportFunction ImportFunction

func (*API) InitQuotas added in v2.1.1

func (api *API) InitQuotas(namespace string) error

InitQuotas

  • param namespace

func (*API) ListApplication

func (api *API) ListApplication(c *common.Context) (interface{}, error)

ListApplication list application

func (*API) ListBucketObjects

func (api *API) ListBucketObjects(c *common.Context) (interface{}, error)

Deprecated ListBucketObjects ListBucketObjects

func (*API) ListBucketObjectsV2

func (api *API) ListBucketObjectsV2(c *common.Context) (interface{}, error)

ListBucketObjectsV2 ListBucketObjectsV2

func (*API) ListBuckets

func (api *API) ListBuckets(c *common.Context) (interface{}, error)

Deprecated ListBuckets ListBuckets

func (*API) ListBucketsV2

func (api *API) ListBucketsV2(c *common.Context) (interface{}, error)

ListBucketsV2 ListBucketsV2

func (*API) ListCertificate

func (api *API) ListCertificate(c *common.Context) (interface{}, error)

ListCertificate list Certificate

func (*API) ListConfig

func (api *API) ListConfig(c *common.Context) (interface{}, error)

ListConfig list config

func (*API) ListFunctionSources

func (api *API) ListFunctionSources(c *common.Context) (interface{}, error)

ListFunctionSources ListFunctionSources

func (*API) ListFunctionVersions

func (api *API) ListFunctionVersions(c *common.Context) (interface{}, error)

ListFunctionVersions list versions of a function

func (*API) ListFunctions

func (api *API) ListFunctions(c *common.Context) (interface{}, error)

ListFunctions list functions

func (*API) ListNode

func (api *API) ListNode(c *common.Context) (interface{}, error)

ListNode list node

func (*API) ListObjectSources

func (api *API) ListObjectSources(c *common.Context) (interface{}, error)

Deprecated ListObjectSources ListObjectSources

func (*API) ListObjectSourcesV2

func (api *API) ListObjectSourcesV2(c *common.Context) (interface{}, error)

ListObjectSourcesV2 ListObjectSourcesV2

func (*API) ListProperty

func (api *API) ListProperty(c *common.Context) (interface{}, error)

func (*API) ListRegistry

func (api *API) ListRegistry(c *common.Context) (interface{}, error)

ListRegistry list Registry

func (*API) ListSecret

func (api *API) ListSecret(c *common.Context) (interface{}, error)

ListSecret list secret

func (*API) NodeNumberCollector

func (api *API) NodeNumberCollector(namespace string) (map[string]int, error)

func (*API) ParseAndCheckNode

func (api *API) ParseAndCheckNode(c *common.Context) (*v1.Node, error)

func (*API) ParseAndCheckNodeMode added in v2.1.1

func (api *API) ParseAndCheckNodeMode(c *common.Context) (*models.NodeMode, error)

func (*API) ParseAndCheckNodeNames

func (api *API) ParseAndCheckNodeNames(c *common.Context) (*models.NodeNames, error)

func (*API) ParseAndCheckProperties added in v2.1.1

func (api *API) ParseAndCheckProperties(c *common.Context) (*models.NodeProperties, error)

func (*API) RefreshRegistryPassword

func (api *API) RefreshRegistryPassword(c *common.Context) (interface{}, error)

func (*API) ReleaseQuota added in v2.1.1

func (api *API) ReleaseQuota(namespace, quotaName string, number int) error

func (*API) ToApplication added in v2.1.1

func (api *API) ToApplication(appView *models.ApplicationView, oldApp *specV1.Application) (*specV1.Application, []specV1.Configuration, error)

func (*API) ToApplicationView added in v2.1.1

func (api *API) ToApplicationView(app *specV1.Application) (*models.ApplicationView, error)

func (*API) ToCertificateView added in v2.2.0

func (api *API) ToCertificateView(s *specV1.Secret) *models.Certificate

func (*API) ToCertificateViewList added in v2.2.0

func (api *API) ToCertificateViewList(s *models.SecretList) *models.CertificateList

func (*API) ToConfiguration added in v2.1.1

func (api *API) ToConfiguration(userID string, configView *models.ConfigurationView) (*specV1.Configuration, error)

func (*API) ToConfigurationView added in v2.1.1

func (api *API) ToConfigurationView(config *specV1.Configuration) (*models.ConfigurationView, error)

func (*API) ToFilteredCertificateView added in v2.2.0

func (api *API) ToFilteredCertificateView(s *specV1.Secret) *models.Certificate

func (*API) ToFilteredCertificateViewList added in v2.2.0

func (api *API) ToFilteredCertificateViewList(s *models.SecretList) *models.CertificateList

func (*API) ToFilteredRegistryView added in v2.2.0

func (api *API) ToFilteredRegistryView(s *specV1.Secret) *models.Registry

func (*API) ToFilteredRegistryViewList added in v2.2.0

func (api *API) ToFilteredRegistryViewList(s *models.SecretList) *models.RegistryList

func (*API) ToFilteredSecretView added in v2.2.0

func (api *API) ToFilteredSecretView(s *specV1.Secret) *models.SecretView

func (*API) ToFilteredSecretViewList added in v2.2.0

func (api *API) ToFilteredSecretViewList(s *models.SecretList) *models.SecretViewList

func (*API) ToRegistryView added in v2.2.0

func (api *API) ToRegistryView(s *specV1.Secret) *models.Registry

func (*API) ToRegistryViewList added in v2.2.0

func (api *API) ToRegistryViewList(s *models.SecretList) *models.RegistryList

func (*API) ToSecretView added in v2.1.1

func (api *API) ToSecretView(s *specV1.Secret) *models.SecretView

func (*API) ToSecretViewList added in v2.1.1

func (api *API) ToSecretViewList(s *models.SecretList) *models.SecretViewList

func (*API) UpdateApplication

func (api *API) UpdateApplication(c *common.Context) (interface{}, error)

UpdateApplication update the application

func (*API) UpdateCertificate

func (api *API) UpdateCertificate(c *common.Context) (interface{}, error)

UpdateCertificate update the Certificate

func (*API) UpdateConfig

func (api *API) UpdateConfig(c *common.Context) (interface{}, error)

UpdateConfig update the config

func (*API) UpdateCoreApp added in v2.2.0

func (api *API) UpdateCoreApp(c *common.Context) (interface{}, error)

func (*API) UpdateNode

func (api *API) UpdateNode(c *common.Context) (interface{}, error)

UpdateNode update the node

func (*API) UpdateNodeAndAppIndex

func (api *API) UpdateNodeAndAppIndex(namespace string, app *specV1.Application) error

func (*API) UpdateNodeMode added in v2.1.1

func (api *API) UpdateNodeMode(c *common.Context) (interface{}, error)

func (*API) UpdateNodeProperties added in v2.1.1

func (api *API) UpdateNodeProperties(c *common.Context) (interface{}, error)

func (*API) UpdateProperty

func (api *API) UpdateProperty(c *common.Context) (interface{}, error)

func (*API) UpdateQuota added in v2.1.1

func (api *API) UpdateQuota(c *common.Context) (interface{}, error)

UpdateQuota for mis server api

  • param namespace
  • param quotaName
  • param quota

func (*API) UpdateRegistry

func (api *API) UpdateRegistry(c *common.Context) (interface{}, error)

UpdateRegistry update the Registry

func (*API) UpdateSecret

func (api *API) UpdateSecret(c *common.Context) (interface{}, error)

UpdateSecret update the secret

func (*API) ValidateResourceForCreating added in v2.2.0

func (api *API) ValidateResourceForCreating(c *common.Context) (interface{}, error)

ValidateResourceForCreating validate when resource create

func (*API) ValidateResourceForDeleting added in v2.2.0

func (api *API) ValidateResourceForDeleting(c *common.Context) (interface{}, error)

ValidateResourceForDeleting validate when resource delete

type InitAPI

type InitAPI struct {
	Init service.InitService
	Auth service.AuthService
}

func NewInitAPI

func NewInitAPI(cfg *config.CloudConfig) (*InitAPI, error)

func (*InitAPI) GetResource

func (api *InitAPI) GetResource(c *common.Context) (interface{}, error)

type SyncAPI

type SyncAPI interface {
	Report(msg specV1.Message) (*specV1.Message, error)
	Desire(msg specV1.Message) (*specV1.Message, error)
}

func NewSyncAPI

func NewSyncAPI(cfg *config.CloudConfig) (SyncAPI, error)

type SyncAPIImpl

type SyncAPIImpl struct {
	Sync service.SyncService
	Node service.NodeService
	// contains filtered or unexported fields
}

func (*SyncAPIImpl) Desire

func (s *SyncAPIImpl) Desire(msg specV1.Message) (*specV1.Message, error)

Desire for node synchronize desire info

func (*SyncAPIImpl) Report

func (s *SyncAPIImpl) Report(msg specV1.Message) (*specV1.Message, error)

Report for node report

Jump to

Keyboard shortcuts

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