resource

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchFlavorPricing

func FetchFlavorPricing(region string, osType string) (map[string]PricingInfo, error)

FetchFlavorPricing fetches pricing from OTC price API with real specs

func GetCCE

func GetCCE(cfg *config.Config, client *otc.Client, unscopedToken, projectID, resourceID string, raw bool)

GetCCE gets a specific CCE cluster

func GetConsoleECS

func GetConsoleECS(cfg *config.Config, client *otc.Client, unscopedToken, projectID, serverNameOrID string, noBrowser bool)

GetConsoleECS gets VNC console URL for an ECS instance and opens it in browser

func GetECS

func GetECS(cfg *config.Config, client *otc.Client, unscopedToken, projectID, serverNameOrID string, raw bool)

GetECS gets a specific ECS instance by ID or name

func GetKubeconfig

func GetKubeconfig(cfg *config.Config, client *otc.Client, unscopedToken, projectID, clusterNameOrID, outputPath string)

func GetProjectToken

func GetProjectToken(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, raw bool) (string, string, error)

GetProjectToken gets or resolves a project token

func GetSubnet

func GetSubnet(cfg *config.Config, client *otc.Client, unscopedToken, projectID, resourceID string, raw bool)

GetSubnet gets a specific subnet

func GetVPC

func GetVPC(cfg *config.Config, client *otc.Client, unscopedToken, projectID, resourceID string, raw bool)

GetVPC gets a specific VPC

func GetVolume

func GetVolume(cfg *config.Config, client *otc.Client, unscopedToken, projectID, resourceID string, raw bool)

GetVolume gets a specific volume

func ListCCE

func ListCCE(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, raw bool)

ListCCE lists all CCE clusters

func ListECS

func ListECS(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, options map[string]interface{}, raw bool)

ListECS lists all ECS instances with optional filters

func ListFlavors

func ListFlavors(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, raw bool, osType string)

ListPricing lists pricing for all servers from OTC API - sorted

func ListImages

func ListImages(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, options map[string]interface{}, raw bool)

ListImages lists all available ECS images

func ListKeypairs

func ListKeypairs(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, raw bool)

ListKeypairs lists all available SSH keypairs

func ListProjects

func ListProjects(cfg *config.Config, client *otc.Client, unscopedToken string, raw bool)

listProjects lists all OTC projects

func ListSubnet

func ListSubnet(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, raw bool)

ListSubnet lists all subnets

func ListVPC

func ListVPC(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, raw bool)

ListVPC lists all VPCs

func ListVolume

func ListVolume(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, raw bool)

ListVolume lists all volumes

func MakeRequest

func MakeRequest(url, token string) ([]byte, int, error)

MakeRequest makes an authenticated HTTP GET request

Types

type PricingInfo

type PricingInfo struct {
	OpiFlavour string

	RAM                string
	HourlyCost         float64
	MonthlyCost        float64
	OSUnit             string
	ProductIdParameter string
	// contains filtered or unexported fields
}

PricingInfo holds pricing data from OTC Price API

Jump to

Keyboard shortcuts

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