Documentation
¶
Overview ¶
Copyright © 2025 Hyperbolic Labs
Copyright © 2025 Hyperbolic Labs ¶
Copyright © 2025 Hyperbolic Labs ¶
Copyright © 2025 Hyperbolic Labs ¶
Copyright © 2025 Hyperbolic Labs ¶
Copyright © 2025 Hyperbolic Labs ¶
Copyright © 2025 Hyperbolic Labs ¶
Copyright © 2025 Hyperbolic Labs
Index ¶
- func Execute()
- func GetAPIKey() (string, error)
- func SaveConfig(config *Config) error
- type APIClient
- type BalanceResponse
- type BareMetalNetworkOption
- type BareMetalOptions
- type BareMetalRentalRequest
- type CPU
- type Config
- type ExchangeTokenResponse
- type GPU
- type Hardware
- type Image
- type Instance
- type InstancesResponse
- type Location
- type MarketplaceResponse
- type OnDemandGPU
- type OnDemandInstance
- type OnDemandInstanceForTerminate
- type OnDemandInstanceMeta
- type OnDemandInstanceResources
- type OnDemandInstanceSpecs
- type OnDemandNetworking
- type OnDemandPortForward
- type OnDemandRentResponse
- type OnDemandTerminateRequest
- type PortMapping
- type Price
- type Pricing
- type RAM
- type RentRequest
- type SpotRentResponse
- type Storage
- type TempTokenResponse
- type TerminateRequest
- type TokenStatusResponse
- type UserInstance
- type UserInstanceDetails
- type UserInstanceGPU
- type UserInstanceHardware
- type UserInstancePrice
- type UserInstancePricing
- type UserResponse
- type VirtualMachineOption
- type VirtualMachineOptions
- type VirtualMachineRentalRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIClient ¶ added in v0.0.2
type APIClient struct {
// contains filtered or unexported fields
}
APIClient represents the HTTP client for making API requests
func NewAPIClient ¶ added in v0.0.2
func NewAPIClient() *APIClient
NewAPIClient creates a new API client
type BalanceResponse ¶
type BalanceResponse struct {
Credits int `json:"credits"`
}
Balance response structure
type BareMetalNetworkOption ¶
type BareMetalNetworkOption struct { GPUCount int `json:"gpuCount"` CostPerHour float64 `json:"costPerHour"` }
BareMetalNetworkOption represents network configuration for bare metal instances
type BareMetalOptions ¶
type BareMetalOptions struct { Ethernet BareMetalNetworkOption `json:"ethernet"` Infiniband BareMetalNetworkOption `json:"infiniband"` }
BareMetalOptions represents the response from /v2/marketplace/bare-metal-options
type BareMetalRentalRequest ¶
type ExchangeTokenResponse ¶ added in v0.0.2
type Instance ¶
type Instance struct { ID string `json:"id"` Status string `json:"status"` Hardware Hardware `json:"hardware"` GpusTotal int `json:"gpus_total"` GpusReserved int `json:"gpus_reserved"` Location Location `json:"location"` Pricing Pricing `json:"pricing"` ClusterName string `json:"cluster_name"` SupplierID string `json:"supplier_id"` }
type InstancesResponse ¶
type InstancesResponse struct {
Instances []UserInstance `json:"instances"`
}
Response structure for the Hyperbolic Instances API (spot instances)
type MarketplaceResponse ¶
type MarketplaceResponse struct {
Instances []Instance `json:"instances"`
}
Response structure for the Hyperbolic API
type OnDemandGPU ¶
type OnDemandGPU struct {
Count int `json:"count"`
}
type OnDemandInstance ¶
type OnDemandInstance struct { ID int `json:"id"` CreatedAt string `json:"createdAt"` UpdatedAt *string `json:"updatedAt"` DeletedAt *string `json:"deletedAt"` UserID string `json:"userId"` StartedAt string `json:"startedAt"` TerminatedAt *string `json:"terminatedAt"` ExternalID string `json:"externalId"` RentalProvider string `json:"rentalProvider"` CostPerHour int `json:"costPerHour"` Status string `json:"status"` Meta OnDemandInstanceMeta `json:"meta"` }
On-demand instance structures
type OnDemandInstanceForTerminate ¶
type OnDemandInstanceForTerminate struct {
ID int `json:"id"`
}
Lightweight struct for termination - only need ID
type OnDemandInstanceMeta ¶
type OnDemandInstanceMeta struct { Name string `json:"name"` Tags []string `json:"tags,omitempty"` Type string `json:"type,omitempty"` PublicIP string `json:"public_ip,omitempty"` GPUCount int `json:"gpu_count,omitempty"` Resources *OnDemandInstanceResources `json:"resources,omitempty"` HostnodeID string `json:"hostnode_id,omitempty"` InternalIP string `json:"internal_ip,omitempty"` RentalType string `json:"rental_type"` SSHCommand string `json:"ssh_command,omitempty"` PortForwards []OnDemandPortForward `json:"port_forwards,omitempty"` OperatingSystem string `json:"operating_system,omitempty"` TimestampCreation string `json:"timestamp_creation,omitempty"` // Bare metal specific fields SubOrder *string `json:"sub_order,omitempty"` NodeCount int `json:"node_count,omitempty"` NetworkType string `json:"network_type,omitempty"` SpecsPerNode *OnDemandInstanceSpecs `json:"specs_per_node,omitempty"` Username string `json:"username,omitempty"` NodeNetworking []OnDemandNetworking `json:"node_networking,omitempty"` CreationTimestamp string `json:"creation_timestamp,omitempty"` }
type OnDemandInstanceResources ¶
type OnDemandInstanceResources struct { RAMGb int `json:"ram_gb"` StorageGb int `json:"storage_gb"` VCPUCount int `json:"vcpu_count"` GPUs map[string]OnDemandGPU `json:"gpus"` }
type OnDemandInstanceSpecs ¶
type OnDemandNetworking ¶
type OnDemandPortForward ¶
type OnDemandRentResponse ¶
type OnDemandTerminateRequest ¶
type OnDemandTerminateRequest struct {
RentalID int `json:"rentalId"`
}
type PortMapping ¶
type RentRequest ¶
type SpotRentResponse ¶
type SpotRentResponse struct { InstanceID string `json:"instance_id"` Status string `json:"status"` Message string `json:"message"` }
Response structures
type TempTokenResponse ¶ added in v0.0.2
type TempTokenResponse struct { TempToken string `json:"tempToken"` LoginURL string `json:"loginUrl"` ExpiresAt string `json:"expiresAt"` }
Response structures for the CLI login API
type TerminateRequest ¶
type TerminateRequest struct {
ID string `json:"id"`
}
type TokenStatusResponse ¶ added in v0.0.2
type UserInstance ¶
type UserInstance struct { ID string `json:"id"` Start string `json:"start"` End *string `json:"end"` Created string `json:"created"` SSHCommand string `json:"sshCommand"` PortMappings []PortMapping `json:"portMappings"` Instance UserInstanceDetails `json:"instance"` }
type UserInstanceDetails ¶
type UserInstanceDetails struct { ID string `json:"id"` Status string `json:"status"` Hardware UserInstanceHardware `json:"hardware"` Pricing UserInstancePricing `json:"pricing"` GPUCount int `json:"gpu_count"` }
type UserInstanceGPU ¶
type UserInstanceHardware ¶
type UserInstanceHardware struct {
GPUs []UserInstanceGPU `json:"gpus"`
}
type UserInstancePrice ¶
type UserInstancePricing ¶
type UserInstancePricing struct {
Price UserInstancePrice `json:"price"`
}
type UserResponse ¶
type UserResponse struct { Email string `json:"email"` Picture interface{} `json:"picture"` Provider string `json:"provider"` EmailVerified bool `json:"email_verified"` Name string `json:"name"` PublicKey string `json:"public_key"` OnboardedAt time.Time `json:"onboarded_at"` OnboardedFor string `json:"onboarded_for"` Meta interface{} `json:"meta"` ReferralCode string `json:"referral_code"` ID string `json:"id"` IsActive bool `json:"is_active"` APIKey string `json:"api_key"` Role string `json:"role"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` CompletedPromos []interface{} `json:"completed_promos"` Roles []interface{} `json:"roles"` }
type VirtualMachineOption ¶
type VirtualMachineOption struct { GPUCount int `json:"gpuCount"` CostPerHour float64 `json:"costPerHour"` }
VirtualMachineOption represents a VM option from the API
type VirtualMachineOptions ¶
type VirtualMachineOptions []VirtualMachineOption
VirtualMachineOptions represents the response from /v2/marketplace/virtual-machine-options
type VirtualMachineRentalRequest ¶
type VirtualMachineRentalRequest struct { ConfigID string `json:"configId"` GPUCount string `json:"gpuCount"` }
OnDemand request structures