Skip to content

This repository contains an implementation of a client for the Virtomize Unattended Install Images API for Go

License

Notifications You must be signed in to change notification settings

Virtomize/uii-go-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Donate GoDoc Go Report Card License Website Twitter LinkedIn

UUI Golang API

This repository contains the go client implementation of Virtomize Unattended Install Images API.

Add to project

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

Build an ISO

Building an ISO requires two steps.

  1. 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")
  2. 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.

Register an API token

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.

API-Token tab

There, create a new API token by clicking "Create" and give it a name. Then click save. Create a token

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. Save token

Contribution

Thank you for participating to this project. Please see our Contribution Guidlines for more information.

Pre-Commit

This repo uses pre-commit hooks. Please install pre-commit and do pre-commit install

Conventional Commits

Format commit messaged according to Conventional Commits standard.

Semantic Versioning

Whenever you need to version something make use of Semantic Versioning.

About

This repository contains an implementation of a client for the Virtomize Unattended Install Images API for Go

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published