resource

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverAvailableServices added in v0.1.1

func DiscoverAvailableServices(region string) error

DiscoverAvailableServices fetches and displays services that actually have pricing data

func FetchAvailableServicesFromAPI added in v0.1.1

func FetchAvailableServicesFromAPI(region string) ([]string, error)

FetchAvailableServicesFromAPI dynamically fetches services from the API

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 ListAvailableServices added in v0.1.1

func ListAvailableServices(region string)

ListAvailableServices lists all available OTC services

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 ListServicePricing added in v0.1.1

func ListServicePricing(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, serviceName string, raw bool, csvOutput bool, filters map[string]string, osFilter string)

ListServicePricing lists pricing for a specific OTC service

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

type ServiceInfo added in v0.1.1

type ServiceInfo struct {
	Code        string
	Name        string
	Description string
}

ServiceInfo holds service metadata

type ServicePricing added in v0.1.1

type ServicePricing struct {
	ServiceName        string
	ResourceName       string
	Region             string
	PriceAmount        string
	OSUnit             string
	ProductIdParameter string
	Description        string
	BillingMode        string
	// Additional fields from API
	OpiFlavour string
	VCPU       string
	RAM        string
}

ServicePricing holds pricing data for any OTC service

func FetchServicePricing added in v0.1.1

func FetchServicePricing(region string, serviceName string, filters map[string]string) ([]ServicePricing, error)

FetchServicePricing fetches pricing from OTC Price API for any service

Jump to

Keyboard shortcuts

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