adminweb

package
v0.13.24 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIMode = "managed"

APIMode mirrors restruntime's apiMode ("managed" or "stateless"). AdminWeb cannot import restruntime (restruntime already imports this package), so restruntime sets this once at startup via SetAPIMode(). AuthInfo exposes it so the UI can badge which mode the server (and therefore this running AdminWeb instance) is in.

View Source
var PRICEINFO_CACHE_PATH string = os.Getenv("CBSPIDER_ROOT") + "/cache/priceinfo"

Functions

func AdminWebSessionMiddleware added in v0.12.6

func AdminWebSessionMiddleware(next echo.HandlerFunc) echo.HandlerFunc

AdminWebSessionMiddleware checks server-side session for protected adminweb pages.

func AuthInfo added in v0.12.6

func AuthInfo(c echo.Context) error

AuthInfo returns authentication status and username

func BodyFrame added in v0.9.2

func BodyFrame(c echo.Context) error

BodyFrame renders the body frame

func ClusterManagement added in v0.9.6

func ClusterManagement(c echo.Context) error

func ClusterMgmt added in v0.6.16

func ClusterMgmt(c echo.Context) error

func ConnectionManagement added in v0.9.2

func ConnectionManagement(c echo.Context) error

func Connectionconfig

func Connectionconfig(c echo.Context) error

create Connection page

func Credential

func Credential(c echo.Context) error

================ Credential Info Management create credential page

func CredentialManagement added in v0.9.2

func CredentialManagement(c echo.Context) error

func DBSpec added in v0.12.45

func DBSpec(c echo.Context) error

func DNSZoneManagement added in v0.13.20

func DNSZoneManagement(c echo.Context) error

Handler function to render the DNS Zone management page

func Dashboard added in v0.8.17

func Dashboard(c echo.Context) error

Dashboard renders the dashboard page.

func DiskManagement added in v0.9.2

func DiskManagement(c echo.Context) error

Handler function to render the Disk management page

func DiskMgmt added in v0.6.7

func DiskMgmt(c echo.Context) error

func DownloadPriceInfo added in v0.8.6

func DownloadPriceInfo(c echo.Context) error

func Driver

func Driver(c echo.Context) error

================ Driver Info Management create driver page

func DriverManagement added in v0.9.2

func DriverManagement(c echo.Context) error

DriverManagement - Handles the management of drivers

func FileSystemManagement added in v0.12.5

func FileSystemManagement(c echo.Context) error

func Frame

func Frame(c echo.Context) error

================ Frame

func HandleWebSocket added in v0.9.2

func HandleWebSocket(c echo.Context) error

func KeyPairManagement added in v0.9.2

func KeyPairManagement(c echo.Context) error

Handler function to render the KeyPair management page

func KeyPairMgmt

func KeyPairMgmt(c echo.Context) error

func LeftMenu added in v0.9.2

func LeftMenu(c echo.Context) error

LeftMenu renders the left menu

func Log added in v0.5.4

func Log(c echo.Context) error

================ Log Page

func Login added in v0.12.6

func Login(c echo.Context) error

Login validates credentials from the login form

func Logout added in v0.12.6

func Logout(c echo.Context) error

Logout renders a logout page and clears session

func MainPage added in v0.9.2

func MainPage(c echo.Context) error

MainPage renders the main page with iframes

func MyImageManagement added in v0.9.2

func MyImageManagement(c echo.Context) error

Handler function to render the MyImage management page

func MyImageMgmt added in v0.6.10

func MyImageMgmt(c echo.Context) error

func NICManagement added in v0.12.33

func NICManagement(c echo.Context) error

NICManagement renders the NIC management page.

func NLBManagement added in v0.9.5

func NLBManagement(c echo.Context) error

Handler function to render the NLB management page

func NLBMgmt added in v0.5.11

func NLBMgmt(c echo.Context) error

func PriceInfoRequest added in v0.8.2

func PriceInfoRequest(c echo.Context) error

func PriceInfoTableList added in v0.8.2

func PriceInfoTableList(c echo.Context) error

PriceInfoTableList handles the display of CloudPrice to Table

func PublicIPManagement added in v0.12.33

func PublicIPManagement(c echo.Context) error

PublicIPManagement renders the PublicIP management page.

func Quota added in v0.12.10

func Quota(c echo.Context) error

Quota renders the quota shell page (service type selector + AJAX-driven table).

func QuotaList added in v0.12.10

func QuotaList(c echo.Context) error

QuotaList returns the quota info for a service type as JSON for AJAX calls.

func QuotaServiceTypeList added in v0.12.10

func QuotaServiceTypeList(c echo.Context) error

QuotaServiceTypeList returns the service type list and provider name as JSON for AJAX calls.

func RDBMSCreateDatabase added in v0.12.20

func RDBMSCreateDatabase(c echo.Context) error

RDBMSCreateDatabase creates a new database via the Spider REST API. For CSPs without CSP-native API (AWS, IBM), UserName/Password are forwarded as MasterUserName/MasterUserPassword.

func RDBMSCreateTable added in v0.12.20

func RDBMSCreateTable(c echo.Context) error

RDBMSCreateTable creates a new table.

func RDBMSDeleteRow added in v0.12.20

func RDBMSDeleteRow(c echo.Context) error

RDBMSDeleteRow deletes rows from a table matching WHERE conditions.

func RDBMSDescribeTable added in v0.12.20

func RDBMSDescribeTable(c echo.Context) error

RDBMSDescribeTable returns column information for a table.

func RDBMSDropDatabase added in v0.12.20

func RDBMSDropDatabase(c echo.Context) error

RDBMSDropDatabase drops a database via the Spider REST API. For CSPs without CSP-native API (AWS, IBM), UserName/Password are forwarded as MasterUserName/MasterUserPassword.

func RDBMSDropTable added in v0.12.20

func RDBMSDropTable(c echo.Context) error

RDBMSDropTable drops a table.

func RDBMSInsertRow added in v0.12.20

func RDBMSInsertRow(c echo.Context) error

RDBMSInsertRow inserts a row into a table.

func RDBMSListDatabases added in v0.12.20

func RDBMSListDatabases(c echo.Context) error

RDBMSListDatabases lists all databases via the Spider REST API. For CSPs without CSP-native API (AWS, IBM), the caller supplies MasterUserName/MasterUserPassword.

func RDBMSListRows added in v0.12.20

func RDBMSListRows(c echo.Context) error

RDBMSListRows returns rows from a table (with LIMIT).

func RDBMSListTables added in v0.12.20

func RDBMSListTables(c echo.Context) error

RDBMSListTables lists all tables in the database.

func RDBMSManagement added in v0.12.20

func RDBMSManagement(c echo.Context) error

Handler function to render the RDBMS management page

func RDBMSSecureTransportStatus added in v0.13.10

func RDBMSSecureTransportStatus(c echo.Context) error

RDBMSSecureTransportStatus proxies to the core Spider API's GET /rdbms/{Name}/secure-transport, which reports whether the RDBMS instance enforces encrypted (TLS/SSL) client connections via standard SQL against the engine itself. This handler does no SQL work of its own — the core API (cmrt.GetRDBMSSecureTransportStatus) is the single implementation; this only bridges AdminWeb's session-cookie auth to the core API's Basic Auth, the same way trySpiderDatabaseCreateAPI does.

func RDBMSTestConnection added in v0.12.20

func RDBMSTestConnection(c echo.Context) error

RDBMSTestConnection tests connectivity to an RDBMS instance.

func Region

func Region(c echo.Context) error

================ Region Info Management create region page

func RegionManagement added in v0.9.2

func RegionManagement(c echo.Context) error

func RegionZone added in v0.7.6

func RegionZone(c echo.Context) error

func S3Management added in v0.10.8

func S3Management(c echo.Context) error

func SecurityGroupManagement added in v0.9.2

func SecurityGroupManagement(c echo.Context) error

Handler function to render the SecurityGroup management page

func SecurityGroupMgmt

func SecurityGroupMgmt(c echo.Context) error

func SetAPIMode added in v0.13.22

func SetAPIMode(mode string)

SetAPIMode is called once by restruntime at startup to mirror its apiMode setting here.

func SpiderInfo

func SpiderInfo(c echo.Context) error

================ Spider Info

func SpiderletVMMointoring added in v0.9.8

func SpiderletVMMointoring(c echo.Context) error

func Top

func Top(c echo.Context) error

================ Top Page

func TopologyAllManagement added in v0.13.24

func TopologyAllManagement(c echo.Context) error

TopologyAllManagement renders one topology of every connection shown on the Dashboard (connections that have at least one resource). Each connection becomes a top-level group ("conn" node). Only the first connection's graph is fetched here; the others are sent as collapsed, not-yet-loaded groups (Lazy) and fetched by the page when they are first expanded (TopologyConnData), since querying every CSP up front can take a long time.

func TopologyConnData added in v0.13.24

func TopologyConnData(c echo.Context) error

TopologyConnData returns one connection's graph for the all-connections view (ids prefixed and roots placed under the connection group): {nodes, edges, error}.

func TopologyConnections added in v0.13.24

func TopologyConnections(c echo.Context) error

TopologyConnections returns the connections with resources for the topology page's selector: [{name, provider, region: "region/zone"}].

func TopologyManagement added in v0.12.33

func TopologyManagement(c echo.Context) error

TopologyManagement renders the topology visualization page.

func VMImage

func VMImage(c echo.Context) error

func VMManagement added in v0.9.2

func VMManagement(c echo.Context) error

func VMMgmt

func VMMgmt(c echo.Context) error

func VMMointoring added in v0.9.8

func VMMointoring(c echo.Context) error

func VMSpec

func VMSpec(c echo.Context) error

func VPCMgmt

func VPCMgmt(c echo.Context) error

func VPCSubnetManagement added in v0.9.2

func VPCSubnetManagement(c echo.Context) error

Handler function to render the VPC-Subnet management page

Types

type ClaudeContent added in v0.10.3

type ClaudeContent struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

type ClaudeMessage added in v0.10.3

type ClaudeMessage struct {
	Role    string          `json:"role"`
	Content []ClaudeContent `json:"content"`
}

------------------- Data Structures for Claude -------------------

type ClaudeRequestBody added in v0.10.3

type ClaudeRequestBody struct {
	Model       string          `json:"model"`
	MaxTokens   int             `json:"max_tokens"`
	Temperature float64         `json:"temperature"`
	System      string          `json:"system"`
	Messages    []ClaudeMessage `json:"messages"`
}

type ConnectionConfig added in v0.8.17

type ConnectionConfig struct {
	ConfigName     string `json:"ConfigName"`
	ProviderName   string `json:"ProviderName"`
	DriverName     string `json:"DriverName"`
	CredentialName string `json:"CredentialName"`
	RegionName     string `json:"RegionName"`
}

================ Connection Config Info Management

type ConnectionConfigs added in v0.8.17

type ConnectionConfigs struct {
	ConnectionConfigs []ConnectionConfig `json:"connectionconfig"`
}

type CountResponse added in v0.8.17

type CountResponse struct {
	Count int `json:"count"`
}

type CredentialInfo added in v0.9.2

type CredentialInfo struct {
	CredentialName   string `json:"CredentialName"`
	ProviderName     string `json:"ProviderName"`
	KeyValueInfoList []struct {
		Key   string `json:"Key"`
		Value string `json:"Value"`
	} `json:"KeyValueInfoList"`
}

type CredentialMetaInfo added in v0.9.2

type CredentialMetaInfo struct {
	Credential []string `json:"Credential"`
}

type Credentials added in v0.9.2

type Credentials struct {
	Credentials []CredentialInfo `json:"credential"`
}

type DashboardData added in v0.8.17

type DashboardData struct {
	ServerIP           string
	TotalConnections   int
	ConnectionsByCloud map[string]int
	Providers          []string
	ResourceCounts     map[string][]ResourceCounts
	Regions            map[string]string
	ShowEmpty          bool
	APIUsername        string
	APIPassword        string
}

DashboardData aggregates the data for rendering the dashboard

type DriverInfo added in v0.9.2

type DriverInfo struct {
	DriverName        string `json:"DriverName"`
	DriverLibFileName string `json:"DriverLibFileName"`
	ProviderName      string `json:"ProviderName"`
}

type Drivers added in v0.9.2

type Drivers struct {
	Drivers []DriverInfo `json:"driver"`
}

type FileSystemInfo added in v0.12.5

type FileSystemInfo struct {
	IId            IID        `json:"IId"`
	Name           string     `json:"Name"`
	Zone           string     `json:"Zone"`
	VpcIID         IID        `json:"VpcIID"`
	FileSystemType string     `json:"FileSystemType"`
	Status         string     `json:"Status"`
	CreatedTime    string     `json:"CreatedTime"`
	AccessSubnets  []IID      `json:"AccessSubnets,omitempty"`
	KeyValueList   []KeyValue `json:"KeyValueList,omitempty"`
}

type IID added in v0.12.5

type IID struct {
	NameId   string `json:"NameId"`
	SystemId string `json:"SystemId"`
}

type KeyValue added in v0.12.5

type KeyValue struct {
	Key   string `json:"Key"`
	Value string `json:"Value"`
}

type NameWidth

type NameWidth struct {
	Name  string
	Width string
}

type Providers added in v0.9.2

type Providers struct {
	Providers []string `json:"cloudos"`
}

type RegionInfo added in v0.9.2

type RegionInfo struct {
	RegionName       string `json:"RegionName"`
	ProviderName     string `json:"ProviderName"`
	KeyValueInfoList []struct {
		Key   string `json:"Key"`
		Value string `json:"Value"`
	} `json:"KeyValueInfoList"`
}

type RegionMetaInfo added in v0.9.2

type RegionMetaInfo struct {
	Region []string `json:"Region"`
}

type Regions added in v0.9.2

type Regions struct {
	Regions []RegionInfo `json:"region"`
}

type ResourceCounts added in v0.8.17

type ResourceCounts struct {
	ConnectionName       string `json:"connectionName"`
	RegionName           string `json:"regionName"`
	VPCs                 int    `json:"vpcs"`
	Subnets              int    `json:"subnets"`
	SecurityGroups       int    `json:"securityGroups"`
	VMs                  int    `json:"vms"`
	KeyPairs             int    `json:"keyPairs"`
	Disks                int    `json:"disks"`
	NetworkLoadBalancers int    `json:"nlbs"`
	PublicIPs            int    `json:"publicIPs"`
	NICs                 int    `json:"nics"`
	Clusters             int    `json:"clusters"`
	MyImages             int    `json:"myImages"`
	S3Buckets            int    `json:"s3Buckets"`
	RDBMSInstances       int    `json:"rdbmsInstances"`
	// NA marks resources that the connection's driver does not support (key: resource name, ex: "cluster").
	// Derived from the Driver Capability API on every render, so it follows driver changes dynamically.
	NA map[string]bool `json:"na"`
}

ResourceCounts holds the counts for various resources

type S3BucketInfo added in v0.10.8

type S3BucketInfo struct {
	Name             string `json:"Name"`
	BucketRegion     string `json:"BucketRegion,omitempty"`
	CreationDate     string `json:"CreationDate"`
	VersioningStatus string `json:"VersioningStatus"`
	CORSStatus       string `json:"CORSStatus"`
}

type S3ObjectInfo added in v0.10.8

type S3ObjectInfo struct {
	ETag         string `json:"ETag"`
	Key          string `json:"Key"`
	LastModified string `json:"LastModified"`
	Size         int64  `json:"Size"`
	ContentType  string `json:"ContentType"`
}

type TemplateData added in v0.11.9

type TemplateData struct {
	Data           cres.CloudPrice
	CachedFileName string
	TotalItems     int
	SimpleMode     string
	APIUsername    string
	APIPassword    string
}

TemplateData structure to render the HTML template

type TopoEdge added in v0.12.33

type TopoEdge struct {
	Source string `json:"source"`
	Target string `json:"target"`
	Label  string `json:"label,omitempty"`
	Kind   string `json:"kind,omitempty"` // vm-nic, nic-sg, nic-pub, nlb-vm, rdbms-sg, cluster-sg, nlb-subnet, rdbms-subnet, cluster-subnet
}

type TopoNode added in v0.12.33

type TopoNode struct {
	ID        string            `json:"id"`
	Name      string            `json:"name,omitempty"` // Spider NameId of a registered resource (used by delete); empty for unregistered nodes
	Label     string            `json:"label"`
	Kind      string            `json:"kind"`   // vpc, subnet, sg, vm, nic, privateip, publicip, nlb, rdbms, cluster, nodegroup, k8snode
	Parent    string            `json:"parent"` // compound parent node id
	PrivateIP string            `json:"privateIP,omitempty"`
	PublicIP  string            `json:"publicIP,omitempty"`
	Status    string            `json:"status,omitempty"`
	Info      map[string]string `json:"info,omitempty"`      // extra key/values shown in the detail panel
	Public    bool              `json:"public,omitempty"`    // reachable from the Internet (public NLB, publicly accessible RDBMS)
	Conn      string            `json:"conn,omitempty"`      // connection name (all-connections view only; used by delete)
	Lazy      bool              `json:"lazy,omitempty"`      // connection group whose graph is loaded on first expand
	InfoOrder []string          `json:"infoOrder,omitempty"` // display order of Info keys (others follow, sorted)
}

type VMStatusMap added in v0.9.2

type VMStatusMap map[string]string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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