Documentation
¶
Index ¶
- func DiscoverAvailableServices(region string) error
- func FetchAvailableServicesFromAPI(region string) ([]string, error)
- func FetchFlavorPricing(region string, osType string) (map[string]PricingInfo, error)
- func GetCCE(cfg *config.Config, client *otc.Client, ...)
- func GetConsoleECS(cfg *config.Config, client *otc.Client, ...)
- func GetECS(cfg *config.Config, client *otc.Client, ...)
- func GetKubeconfig(cfg *config.Config, client *otc.Client, ...)
- func GetProjectToken(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, ...) (string, string, error)
- func GetSubnet(cfg *config.Config, client *otc.Client, ...)
- func GetVPC(cfg *config.Config, client *otc.Client, ...)
- func GetVolume(cfg *config.Config, client *otc.Client, ...)
- func ListAvailableServices(region string)
- func ListCCE(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, ...)
- func ListECS(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, ...)
- func ListFlavors(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, ...)
- func ListImages(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, ...)
- func ListKeypairs(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, ...)
- func ListProjects(cfg *config.Config, client *otc.Client, unscopedToken string, raw bool)
- func ListServicePricing(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, ...)
- func ListSubnet(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, ...)
- func ListVPC(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, ...)
- func ListVolume(cfg *config.Config, client *otc.Client, unscopedToken, projectID string, ...)
- func MakeRequest(url, token string) ([]byte, int, error)
- type PricingInfo
- type ServiceInfo
- type ServicePricing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscoverAvailableServices ¶ added in v0.1.1
DiscoverAvailableServices fetches and displays services that actually have pricing data
func FetchAvailableServicesFromAPI ¶ added in v0.1.1
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 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 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 ¶
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 ¶
ListSubnet lists all subnets
func ListVolume ¶
ListVolume lists all volumes
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
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