Documentation
¶
Index ¶
- type Capacity
- type CapacityResult
- type Contract
- type ContractBilling
- type ContractFilter
- type Counters
- type Farm
- type FarmFilter
- type Limit
- type Location
- type NameContractDetails
- type Node
- type NodeContractDetails
- type NodeFilter
- type NodeGPU
- type NodePower
- type NodeStatistics
- type NodeStatisticsResources
- type NodeStatisticsUsers
- type NodeStatus
- type NodeWithNestedCapacity
- type PublicConfig
- type PublicIP
- type RentContractDetails
- type StatsFilter
- type Twin
- type TwinFilter
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capacity ¶
type Capacity struct {
CRU uint64 `json:"cru"`
SRU gridtypes.Unit `json:"sru"`
HRU gridtypes.Unit `json:"hru"`
MRU gridtypes.Unit `json:"mru"`
}
Capacity is the resources needed for workload(cpu, memory, SSD disk, HDD disks)
type CapacityResult ¶
type CapacityResult struct {
Total Capacity `json:"total_resources"`
Used Capacity `json:"used_resources"`
}
CapacityResult is the NodeData capacity results to unmarshal json in it
type ContractBilling ¶
type ContractBilling struct {
AmountBilled uint64 `json:"amountBilled"`
DiscountReceived string `json:"discountReceived"`
Timestamp uint64 `json:"timestamp"`
}
ContractBilling is contract billing info
type ContractFilter ¶
type ContractFilter struct {
ContractID *uint64
TwinID *uint64
NodeID *uint64
Type *string
State *string
Name *string
NumberOfPublicIps *uint64
DeploymentData *string
DeploymentHash *string
}
ContractFilter contract filters
type Counters ¶
type Counters struct {
Nodes int64 `json:"nodes"`
Farms int64 `json:"farms"`
Countries int64 `json:"countries"`
TotalCRU int64 `json:"totalCru"`
TotalSRU int64 `json:"totalSru"`
TotalMRU int64 `json:"totalMru"`
TotalHRU int64 `json:"totalHru"`
PublicIPs int64 `json:"publicIps"`
AccessNodes int64 `json:"accessNodes"`
Gateways int64 `json:"gateways"`
Twins int64 `json:"twins"`
Contracts int64 `json:"contracts"`
NodesDistribution map[string]int64 `json:"nodesDistribution" gorm:"-:all"`
GPUs int64 `json:"gpus"`
}
Counters contains aggregate info about the grid
type Farm ¶
type Farm struct {
Name string `json:"name"`
FarmID int `json:"farmId"`
TwinID int `json:"twinId"`
PricingPolicyID int `json:"pricingPolicyId"`
CertificationType string `json:"certificationType"`
StellarAddress string `json:"stellarAddress"`
Dedicated bool `json:"dedicated"`
PublicIps []PublicIP `json:"publicIps"`
}
type FarmFilter ¶
type FarmFilter struct {
FreeIPs *uint64
TotalIPs *uint64
StellarAddress *string
PricingPolicyID *uint64
FarmID *uint64
TwinID *uint64
Name *string
NameContains *string
CertificationType *string
Dedicated *bool
NodeFreeMRU *uint64
NodeFreeHRU *uint64
NodeFreeSRU *uint64
NodeStatus *string
NodeRentedBy *uint64
NodeAvailableFor *uint64
NodeHasGPU *bool
NodeCertified *bool
Country *string
}
FarmFilter farm filters
type NameContractDetails ¶
type NameContractDetails struct {
Name string `json:"name"`
}
type Node ¶
type Node struct {
ID string `json:"id"`
NodeID int `json:"nodeId"`
FarmID int `json:"farmId"`
TwinID int `json:"twinId"`
Country string `json:"country"`
GridVersion int `json:"gridVersion"`
City string `json:"city"`
Uptime int64 `json:"uptime"`
Created int64 `json:"created"`
FarmingPolicyID int `json:"farmingPolicyId"`
UpdatedAt int64 `json:"updatedAt"`
TotalResources Capacity `json:"total_resources"`
UsedResources Capacity `json:"used_resources"`
Location Location `json:"location"`
PublicConfig PublicConfig `json:"publicConfig"`
Status string `json:"status"` // added node status field for up or down
CertificationType string `json:"certificationType"`
Dedicated bool `json:"dedicated"`
RentContractID uint `json:"rentContractId"`
RentedByTwinID uint `json:"rentedByTwinId"`
SerialNumber string `json:"serialNumber"`
Power NodePower `json:"power"`
NumGPU int `json:"num_gpu"`
ExtraFee uint64 `json:"extraFee"`
}
Node is a struct holding the data for a Node for the nodes view
type NodeContractDetails ¶
type NodeFilter ¶
type NodeFilter struct {
Status *string
FreeMRU *uint64
FreeHRU *uint64
FreeSRU *uint64
TotalMRU *uint64
TotalHRU *uint64
TotalSRU *uint64
TotalCRU *uint64
Country *string
CountryContains *string
City *string
CityContains *string
FarmName *string
FarmNameContains *string
FarmIDs []uint64
FreeIPs *uint64
IPv4 *bool
IPv6 *bool
Domain *bool
Dedicated *bool
Rentable *bool
Rented *bool
RentedBy *uint64
AvailableFor *uint64
NodeID *uint64
TwinID *uint64
CertificationType *string
HasGPU *bool
GpuDeviceID *string
GpuDeviceName *string
GpuVendorID *string
GpuVendorName *string
GpuAvailable *bool
}
NodeFilter node filters
type NodeStatistics ¶
type NodeStatistics struct {
System NodeStatisticsResources `json:"system"`
Total NodeStatisticsResources `json:"total"`
Used NodeStatisticsResources `json:"used"`
Users NodeStatisticsUsers `json:"users"`
}
type NodeStatisticsResources ¶
type NodeStatisticsUsers ¶
type NodeStatus ¶
type NodeStatus struct {
Status string `json:"status"`
}
NodeStatus is used for status endpoint to decode json in
func (*NodeStatus) Deserialize ¶
func (n *NodeStatus) Deserialize(data []byte) error
Deserialize is the deserializer for node status struct
func (*NodeStatus) Serialize ¶
func (n *NodeStatus) Serialize() (json.RawMessage, error)
Serialize is the serializer for node status struct
type NodeWithNestedCapacity ¶
type NodeWithNestedCapacity struct {
ID string `json:"id"`
NodeID int `json:"nodeId"`
FarmID int `json:"farmId"`
TwinID int `json:"twinId"`
Country string `json:"country"`
GridVersion int `json:"gridVersion"`
City string `json:"city"`
Uptime int64 `json:"uptime"`
Created int64 `json:"created"`
FarmingPolicyID int `json:"farmingPolicyId"`
UpdatedAt int64 `json:"updatedAt"`
Capacity CapacityResult `json:"capacity"`
Location Location `json:"location"`
PublicConfig PublicConfig `json:"publicConfig"`
Status string `json:"status"` // added node status field for up or down
CertificationType string `json:"certificationType"`
Dedicated bool `json:"dedicated"`
RentContractID uint `json:"rentContractId"`
RentedByTwinID uint `json:"rentedByTwinId"`
SerialNumber string `json:"serialNumber"`
Power NodePower `json:"power"`
NumGPU int `json:"num_gpu"`
ExtraFee uint64 `json:"extraFee"`
}
Node to be compatible with old view
type PublicConfig ¶
type PublicConfig struct {
Domain string `json:"domain"`
Gw4 string `json:"gw4"`
Gw6 string `json:"gw6"`
Ipv4 string `json:"ipv4"`
Ipv6 string `json:"ipv6"`
}
PublicConfig node public config
type PublicIP ¶
type PublicIP struct {
ID string `json:"id"`
IP string `json:"ip"`
FarmID string `json:"farm_id"`
ContractID int `json:"contract_id"`
Gateway string `json:"gateway"`
}
PublicIP info about public ip in the farm
type RentContractDetails ¶
type RentContractDetails struct {
NodeID uint `json:"nodeId"`
}
type TwinFilter ¶
TwinFilter twin filters