Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Support GridClient types #467

Open
Mahmoud-Emad opened this issue Sep 9, 2024 · 1 comment
Open

Support GridClient types #467

Mahmoud-Emad opened this issue Sep 9, 2024 · 1 comment
Assignees
Milestone

Comments

@Mahmoud-Emad
Copy link
Contributor

Mahmoud-Emad commented Sep 9, 2024

a higher level on the grid needs to be implemented

Huly®: CRYST-470

@Mahmoud-Emad
Copy link
Contributor Author

Mahmoud-Emad commented Sep 9, 2024

Grid Machines Module supported

image

Example of usage

module main

import freeflowuniverse.crystallib.threefold.higher_grid.models
import os

fn do()! {
	mnemonic := os.getenv('TFGRID_MNEMONIC')
	ssh_key := os.getenv('SSH_KEY')

	// Create the GridConfig for deployment
	// Assuming "dev" is the chain network
	mut grid := models.new_grid_client(mnemonic, .dev, ssh_key)

	// Define the VM to be deployed
	mut vms := models.GridMachinesModel{
		name: "Machinesinterface",
		node_id: 177
		network: models.NetworkModel{
			name: "Netselo",
			ip_range: '10.249.0.0/16',
			subnet: '10.249.0.0/24',
		},
		machines: [
			models.MachineModel{
				name: "testmachine",
				network_access: models.MachineNetworkAccessModel{
					public_ip4: false,
					public_ip6: false,
					planetary: true,
					mycelium: true,
				},
				capacity: models.ComputeCapacity{
					cpu: 5
					memory: 2048
				},
			}
		]
	}

	grid.machiens.deploy(vms)!
}

fn main() {
	do()!
}

@despiegk despiegk added this to the later milestone Nov 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants