endpoints

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 85 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// TaskCleanDurationTimestamp job/deployment exist time, default 7 days
	TaskCleanDurationTimestamp int64 = 7 * 24 * 60 * 60
)

Functions

func InternalReverseHandler

func InternalReverseHandler(handler func(context.Context, *http.Request, map[string]string) error) http.Handler

func ProxyMetrics

func ProxyMetrics(ctx context.Context, r *http.Request, vars map[string]string) error

Types

type Endpoints

type Endpoints struct {
	Mns *mns.Mns
	Ess *ess.Ess

	CloudAccount    *cloud_account.CloudAccount
	Addons          *addons.Addons
	JS              jsonstore.JsonStore
	CachedJS        jsonstore.JsonStore
	SteveAggregator *steve.Aggregator
	Resource        *resource.Resource
	Credential      tokenpb.TokenServiceServer
	ClusterSvc      clusterpb.ClusterServiceServer
	PipelineSvc     pipelinepb.PipelineServiceServer

	CronService cronpb.CronServiceServer

	SteveCacheConfig *steveCacheConfig
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, db *dbclient.DBClient, js jsonstore.JsonStore, cachedJS jsonstore.JsonStore, options ...Option) *Endpoints

func (*Endpoints) AddCloudClusters

func (e *Endpoints) AddCloudClusters(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) AddCloudNodes

func (e *Endpoints) AddCloudNodes(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) AddNodes

func (e *Endpoints) AddNodes(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) AddonScale

func (e *Endpoints) AddonScale(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

Addon Scale

func (*Endpoints) AutoRenewECS

func (e *Endpoints) AutoRenewECS(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) BatchOfflineEdgeCluster

func (e *Endpoints) BatchOfflineEdgeCluster(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) BatchUpgradeEdgeCluster

func (e *Endpoints) BatchUpgradeEdgeCluster(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) CetOnsDetailInfo

func (e *Endpoints) CetOnsDetailInfo(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) CetRedisDetailInfo

func (e *Endpoints) CetRedisDetailInfo(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) CloudResourceOverview

func (e *Endpoints) CloudResourceOverview(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

func (*Endpoints) CloudResourcePermissionCheck

func (e *Endpoints) CloudResourcePermissionCheck(ctx context.Context, userId, orgId, clusterName, action string) error

func (*Endpoints) CloudResourceSetTag

func (e *Endpoints) CloudResourceSetTag(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

only set/unset/filter tag with dice-cluster or dice-project prefix

func (*Endpoints) ClusterHook

func (e *Endpoints) ClusterHook(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

ClusterHook starts steve server when create cluster and stop steve server when delete cluster

func (*Endpoints) ClusterInfo

func (e *Endpoints) ClusterInfo(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) ClusterPreview

func (e *Endpoints) ClusterPreview(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) ClusterUpdate

func (e *Endpoints) ClusterUpdate(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) CreateAccessKey

func (e *Endpoints) CreateAccessKey(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) CreateAccount

func (e *Endpoints) CreateAccount(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

func (*Endpoints) CreateAddonCheck

func (e *Endpoints) CreateAddonCheck(req apistructs.CreateCloudResourceBaseInfo) error

func (*Endpoints) CreateGatewayVpcGrant

func (e *Endpoints) CreateGatewayVpcGrant(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) CreateMysqlAccount

func (e *Endpoints) CreateMysqlAccount(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) CreateMysqlDatabase

func (e *Endpoints) CreateMysqlDatabase(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) CreateMysqlInstance

func (e *Endpoints) CreateMysqlInstance(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) CreateOSS

func (e *Endpoints) CreateOSS(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) CreateOnsGroup

func (e *Endpoints) CreateOnsGroup(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) CreateOnsInstance

func (e *Endpoints) CreateOnsInstance(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) CreateOnsTopic

func (e *Endpoints) CreateOnsTopic(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) CreateRedis

func (e *Endpoints) CreateRedis(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) CreateVPC

func (e *Endpoints) CreateVPC(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

func (*Endpoints) CreateVSW

func (e *Endpoints) CreateVSW(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

func (*Endpoints) DealTaskEvent

func (e *Endpoints) DealTaskEvent(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

DealTaskEvent receive task event

func (*Endpoints) DeleteAccount

func (e *Endpoints) DeleteAccount(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

func (*Endpoints) DeleteGateway

func (e *Endpoints) DeleteGateway(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) DeleteMysql

func (e *Endpoints) DeleteMysql(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) DeleteMysqlDatabase

func (e *Endpoints) DeleteMysqlDatabase(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) DeleteOSSResource

func (e *Endpoints) DeleteOSSResource(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

TODO demo delete

func (*Endpoints) DeleteOns

func (e *Endpoints) DeleteOns(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

TODO, now support process create addon failed but related cloud resource create successfully

func (*Endpoints) DeleteOnsTopic

func (e *Endpoints) DeleteOnsTopic(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) DeleteRedisResource

func (e *Endpoints) DeleteRedisResource(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) DoRemoteAction

func (e *Endpoints) DoRemoteAction(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error

func (*Endpoints) ECSTrending

func (e *Endpoints) ECSTrending(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

func (*Endpoints) GetAccessKey

func (e *Endpoints) GetAccessKey(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

GetAccessKey get access key with cluster name

func (*Endpoints) GetAddonConfig

func (e *Endpoints) GetAddonConfig(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

Get Addon config

func (*Endpoints) GetAddonStatus

func (e *Endpoints) GetAddonStatus(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

Get Addon status

func (*Endpoints) GetCloudAccount

func (e *Endpoints) GetCloudAccount(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

GetCloudAccount Get cloud account

func (*Endpoints) GetCluster

func (e *Endpoints) GetCluster() *clusters.Clusters

func (*Endpoints) GetIdentity

func (*Endpoints) GetMysqlDetailInfo

func (e *Endpoints) GetMysqlDetailInfo(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) GetResourceClass

func (e *Endpoints) GetResourceClass(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) GetResourceClusterTrend

func (e *Endpoints) GetResourceClusterTrend(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) GetResourceGauge

func (e *Endpoints) GetResourceGauge(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) GetResourceProjectTrend

func (e *Endpoints) GetResourceProjectTrend(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) GetScriptInfo

func (e *Endpoints) GetScriptInfo(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

GetScriptInfo Get script info

func (*Endpoints) GetVpcInfoByCluster

func (e *Endpoints) GetVpcInfoByCluster(ak_ctx aliyun_resources.Context, r *http.Request,
	cluster string) (libvpc.Vpc, httpserver.Responser)

func (*Endpoints) GrantMysqlAccountPrivilege

func (e *Endpoints) GrantMysqlAccountPrivilege(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) ImportCluster

func (e *Endpoints) ImportCluster(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) Info

func (e *Endpoints) Info(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

Info demo

func (*Endpoints) InitCluster

func (e *Endpoints) InitCluster(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error

func (*Endpoints) InitClusterRetry

func (e *Endpoints) InitClusterRetry(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) InitRecord

InitRecord Create cloud resource

func (*Endpoints) IsManager

func (e *Endpoints) IsManager(userID string, scopeType apistructs.ScopeType, scopeID string) error

func (*Endpoints) ListAccount

func (e *Endpoints) ListAccount(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

func (*Endpoints) ListAliyunResources

func (e *Endpoints) ListAliyunResources(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

func (*Endpoints) ListECS

func (e *Endpoints) ListECS(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

func (*Endpoints) ListGatewayAndVpc

func (e *Endpoints) ListGatewayAndVpc(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) ListK8SClusters

func (e *Endpoints) ListK8SClusters(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

ListK8SClusters list ready and unready k8s clusters in current org

func (*Endpoints) ListLabels

func (e *Endpoints) ListLabels(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) ListMysql

func (e *Endpoints) ListMysql(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) ListMysqlAccount

func (e *Endpoints) ListMysqlAccount(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) ListMysqlDatabase

func (e *Endpoints) ListMysqlDatabase(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) ListOSS

func (e *Endpoints) ListOSS(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) ListOns

func (e *Endpoints) ListOns(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) ListOnsGroup

func (e *Endpoints) ListOnsGroup(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) ListOnsTopic

func (e *Endpoints) ListOnsTopic(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) ListOrgRunningTasks

func (e *Endpoints) ListOrgRunningTasks(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

ListOrgRunningTasks list running task or service by org id

func (*Endpoints) ListRedis

func (e *Endpoints) ListRedis(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) ListRegion

func (e *Endpoints) ListRegion(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

func (*Endpoints) ListVPC

func (e *Endpoints) ListVPC(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) ListVSW

func (e *Endpoints) ListVSW(ctx context.Context, r *http.Request, vars map[string]string) (
	resp httpserver.Responser, err error)

func (*Endpoints) ListZone

func (e *Endpoints) ListZone(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

func (*Endpoints) LockCluster

func (e *Endpoints) LockCluster(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

lock cluster for auto scale

func (*Endpoints) Logs

func (e *Endpoints) Logs(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) MetricsQuery

func (e *Endpoints) MetricsQuery(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

MetricsQuery handle query request

func (*Endpoints) OfflineEdgeCluster

func (e *Endpoints) OfflineEdgeCluster(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) OrgClusterInfo

func (e *Endpoints) OrgClusterInfo(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) OrgPermCheck

func (e *Endpoints) OrgPermCheck(userID, orgID, action string) error

func (*Endpoints) PermissionCheck

func (e *Endpoints) PermissionCheck(userID, orgID, projectID, action string) error

PermissionCheck Permission check

func (*Endpoints) Query

func (e *Endpoints) Query(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) QueryCloudResourceDetail

func (e *Endpoints) QueryCloudResourceDetail(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

func (*Endpoints) RecordTypeList

func (e *Endpoints) RecordTypeList(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) RegistryReadonly

func (e *Endpoints) RegistryReadonly(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) RegistryRemoveLayers

func (e *Endpoints) RegistryRemoveLayers(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) RegistryRemoveManifests

func (e *Endpoints) RegistryRemoveManifests(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) ResetAccessKey

func (e *Endpoints) ResetAccessKey(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) ResetMysqlAccountPassword

func (e *Endpoints) ResetMysqlAccountPassword(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) ResourceOverviewReport

func (e *Endpoints) ResourceOverviewReport(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) RestartECS

func (e *Endpoints) RestartECS(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) RmNodes

func (e *Endpoints) RmNodes(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) Routes

func (e *Endpoints) Routes() []httpserver.Endpoint

Routes Return routes

func (*Endpoints) ServeScript

func (e *Endpoints) ServeScript(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error

ServeScript Offer script download.

func (*Endpoints) StartECS

func (e *Endpoints) StartECS(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) StopECS

func (e *Endpoints) StopECS(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) SyncTaskStatus

func (e *Endpoints) SyncTaskStatus(interval time.Duration)

SyncTaskStatus sync task status

func (*Endpoints) TagResources

func (e *Endpoints) TagResources(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

func (*Endpoints) TaskClean

func (e *Endpoints) TaskClean(interval time.Duration)

TaskClean clean job/deployment with internal

func (*Endpoints) UnlockCluster

func (e *Endpoints) UnlockCluster(ctx context.Context, r *http.Request, vars map[string]string) (httpserver.Responser, error)

unlock cluster for auto scale

func (*Endpoints) UpdateAddonConfig

func (e *Endpoints) UpdateAddonConfig(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

Update addon config

func (*Endpoints) UpdateLabels

func (e *Endpoints) UpdateLabels(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) UpgradeEdgeCluster

func (e *Endpoints) UpgradeEdgeCluster(ctx context.Context, r *http.Request, vars map[string]string) (resp httpserver.Responser, err error)

func (*Endpoints) VPCTagCluster

func (e *Endpoints) VPCTagCluster(ctx context.Context, r *http.Request, vars map[string]string) (
	httpserver.Responser, error)

type Option

type Option func(*Endpoints)

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

WithBundle With bundle

func WithClusterServiceServer

func WithClusterServiceServer(clusterSvc clusterpb.ClusterServiceServer) Option

func WithCredential

func WithCredential(c tokenpb.TokenServiceServer) Option

WithCredential with accessKey credential

func WithCronServiceServer

func WithCronServiceServer(cronService cronpb.CronServiceServer) Option

func WithOrg

func WithOrg(org org.Interface) Option

func WithOrgResource

func WithOrgResource(o *org_resource.OrgResource) Option

func WithPipelineSvc

func WithPipelineSvc(pipelineSvc pipelinepb.PipelineServiceServer) Option

func WithResourceTable

func WithResourceTable(reportTable *resource.ReportTable) Option

func WithSteveCacheConfig

func WithSteveCacheConfig(size int) Option

Jump to

Keyboard shortcuts

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