This repository contains the go client implementation of Virtomize Unattended Install Images API.
To use this client, first add it to your Go project by running go get
from your command line
go get github.com/virtomize/uii-go-api
Building an ISO requires two steps.
-
Create a client object by using the
NewClient
function. This requires the API token created in the UI (see below).c, err := client.NewClient("myTokenHere")
-
Building the ISO by using
Build
on the client object.c, err := uiiclient.NewClient("myTokenHere") if (err != nil){ // handle error } err = c.Build("/tmp/my-iso.iso", uiiclient.BuildArgs{ Distribution: "debian", Version: "11", Hostname: "my-debian", Networks: []uiiclient.NetworkArgs{ { DHCP: true, NoInternet: false, } }, }, uiiclient.BuildOpts{}) if err != nil { // handle error }
Build
requires 3 parameters:- A path to the output file
- A set of required parameters represented by the
BuildArgs
struct. This struct should be fully initialized with valid values. - A set of optional parameters represented by the
BuildOpts
struct. All members of this struct can be left uninitialized and the API will pick sensible default values.
Before using this client library, you need to register an API token under your account. For this, login into the website and go to the "API-Token" tab.
There, create a new API token by clicking "Create" and give it a name. Then click save.
A new token will be created. Copy this token, as it will be hidden, once you log out. There, create a new API token by clicking "Create" and give it a name. Then click save.
Thank you for participating to this project. Please see our Contribution Guidlines for more information.
This repo uses pre-commit hooks. Please install pre-commit and do pre-commit install
Format commit messaged according to Conventional Commits standard.
Whenever you need to version something make use of Semantic Versioning.