Documentation
¶
Index ¶
- Variables
- type Account
- type Farm
- type FarmFilter
- type FarmUpdate
- type Interface
- type Location
- type Node
- type NodeFilter
- type NodeUpdate
- type RegistrarClient
- func (c *RegistrarClient) CreateAccount(relays []string, rmbEncKey string) (account Account, mnemonic string, err error)
- func (c *RegistrarClient) CreateFarm(farmName, stellarAddr string, dedicated bool) (farmID uint64, err error)
- func (c *RegistrarClient) EnsureAccount(relays []string, rmbEncKey string) (account Account, err error)
- func (c *RegistrarClient) GetAccount(twinID uint64) (account Account, err error)
- func (c *RegistrarClient) GetAccountByPK(publicKey []byte) (account Account, err error)
- func (c *RegistrarClient) GetFarm(farmID uint64) (farm Farm, err error)
- func (c *RegistrarClient) GetNode(id uint64) (node Node, err error)
- func (c *RegistrarClient) GetNodeByTwinID(id uint64) (node Node, err error)
- func (c *RegistrarClient) GetZosVersion() (version ZosVersion, err error)
- func (c *RegistrarClient) ListFarms(filter FarmFilter) (farms []Farm, err error)
- func (c *RegistrarClient) ListNodes(opts NodeFilter) (nodes []Node, err error)
- func (c *RegistrarClient) Mnemonic() string
- func (c *RegistrarClient) RegisterNode(node Node) (nodeID uint64, err error)
- func (c *RegistrarClient) ReportUptime(report UptimeReport) (err error)
- func (c *RegistrarClient) SetZosVersion(v string, safeToUpgrade bool) (err error)
- func (c *RegistrarClient) UpdateAccount(opts ...UpdateAccountOpts) (err error)
- func (c *RegistrarClient) UpdateFarm(farmID uint64, update FarmUpdate) (err error)
- func (c *RegistrarClient) UpdateNode(updateOpts NodeUpdate) (err error)
- type Resources
- type UpdateAccountOpts
- type UptimeReport
- type ZosVersion
Constants ¶
This section is empty.
Variables ¶
var ErrorAccountNotFound = fmt.Errorf("failed to get requested account from node registrar")
var ErrorFarmNotFound = fmt.Errorf("failed to get requested farm from node registrar")
var ErrorNodeNotFound = fmt.Errorf("failed to get requested node from node registrar")
Functions ¶
This section is empty.
Types ¶
type FarmFilter ¶
type FarmFilter struct {
FarmID *uint64
FarmName *string
TwinID *uint64
Dedicated *bool
Page *uint32
Size *uint32
}
FarmFilter represents filtering options for listing farms
type FarmUpdate ¶
FarmUpdate represents the data needed to update an existing farm
type Node ¶
type Node struct {
NodeID uint64 `json:"node_id"`
FarmID uint64 `json:"farm_id"`
TwinID uint64 `json:"twin_id"`
Location Location `json:"location"`
Resources Resources `json:"resources"`
Interfaces []Interface `json:"interfaces"`
SecureBoot bool `json:"secure_boot"`
Virtualized bool `json:"virtualized"`
SerialNumber string `json:"serial_number"`
UptimeReports []UptimeReport `json:"uptime"`
LastSeen *time.Time `json:"last_seen"`
Online bool `json:"online"`
Approved bool
}
type NodeFilter ¶
type NodeFilter struct {
NodeID *uint64
FarmID *uint64
TwinID *uint64
Status *string
Healthy *bool
Online *bool
LastSeen *int64
Page *uint32
Size *uint32
}
NodeFilter represents filtering options for listing nodes
type NodeUpdate ¶
type NodeUpdate struct {
FarmID *uint64
Location *Location
Resources *Resources
Interfaces []Interface
SecureBoot *bool
Virtualized *bool
SerialNumber *string
Status *string
Healthy *bool
Approved *bool
}
NodeUpdate represents update options for a node
type RegistrarClient ¶
type RegistrarClient struct {
// contains filtered or unexported fields
}
func NewRegistrarClient ¶
func NewRegistrarClient(baseURL string, mnemonicOrSeed ...string) (cli RegistrarClient, err error)
NewRegistrarClient creates a new client with optional seed or mnemonic
func (*RegistrarClient) CreateAccount ¶
func (c *RegistrarClient) CreateAccount(relays []string, rmbEncKey string) (account Account, mnemonic string, err error)
CreateAccount create new account on the registrar with uniqe mnemonic.
func (*RegistrarClient) CreateFarm ¶
func (c *RegistrarClient) CreateFarm(farmName, stellarAddr string, dedicated bool) (farmID uint64, err error)
CreateFarm create new farm on the registrar with uniqe name.
func (*RegistrarClient) EnsureAccount ¶
func (c *RegistrarClient) EnsureAccount(relays []string, rmbEncKey string) (account Account, err error)
EnsureAccount ensures that an account is created with specific seed/mnemonic.
func (*RegistrarClient) GetAccount ¶
func (c *RegistrarClient) GetAccount(twinID uint64) (account Account, err error)
GetAccount get an account using either its twinID
func (*RegistrarClient) GetAccountByPK ¶
func (c *RegistrarClient) GetAccountByPK(publicKey []byte) (account Account, err error)
GetAccountByPK get an account using either its its publicKey.
func (*RegistrarClient) GetFarm ¶
func (c *RegistrarClient) GetFarm(farmID uint64) (farm Farm, err error)
GetFarm get a farm using its farmID
func (*RegistrarClient) GetNode ¶
func (c *RegistrarClient) GetNode(id uint64) (node Node, err error)
GetNode gets registered node details using nodeID
func (*RegistrarClient) GetNodeByTwinID ¶
func (c *RegistrarClient) GetNodeByTwinID(id uint64) (node Node, err error)
GetNodeByTwinID gets registered node details using twinID
func (*RegistrarClient) GetZosVersion ¶
func (c *RegistrarClient) GetZosVersion() (version ZosVersion, err error)
GetZosVersion gets zos version for specific network
func (*RegistrarClient) ListFarms ¶
func (c *RegistrarClient) ListFarms(filter FarmFilter) (farms []Farm, err error)
ListFarms gets a list of farms using filter options
func (*RegistrarClient) ListNodes ¶
func (c *RegistrarClient) ListNodes(opts NodeFilter) (nodes []Node, err error)
ListNodes lists registered nodes details using (nodeID, twinID, farmID).
func (*RegistrarClient) Mnemonic ¶
func (c *RegistrarClient) Mnemonic() string
func (*RegistrarClient) RegisterNode ¶
func (c *RegistrarClient) RegisterNode(node Node) (nodeID uint64, err error)
RegisterNode register physical/virtual nodes with on TFGrid.
func (*RegistrarClient) ReportUptime ¶
func (c *RegistrarClient) ReportUptime(report UptimeReport) (err error)
ReportUptime update node Uptime.
func (*RegistrarClient) SetZosVersion ¶
func (c *RegistrarClient) SetZosVersion(v string, safeToUpgrade bool) (err error)
SetZosVersion sets zos version for specific network only valid for network admin
func (*RegistrarClient) UpdateAccount ¶
func (c *RegistrarClient) UpdateAccount(opts ...UpdateAccountOpts) (err error)
UpdateAccount update the account configuration (relays or rmbEncKey).
func (*RegistrarClient) UpdateFarm ¶
func (c *RegistrarClient) UpdateFarm(farmID uint64, update FarmUpdate) (err error)
UpdateFarm updates an existing farm's configuration
func (*RegistrarClient) UpdateNode ¶
func (c *RegistrarClient) UpdateNode(updateOpts NodeUpdate) (err error)
UpdateNode update node configuration (farmID, interfaces, resources, location, secureBoot, virtualized).
type UpdateAccountOpts ¶
type UpdateAccountOpts func(*accountCfg)
func UpdateAccountWithRMBEncKey ¶
func UpdateAccountWithRMBEncKey(rmbEncKey string) UpdateAccountOpts
UpdateAccountWithRMBEncKey update the account rmb encryption key
func UpdateAccountWithRelays ¶
func UpdateAccountWithRelays(relays []string) UpdateAccountOpts
UpdateAccountWithRelays update the account relays