Skip to content

wandelbotsgmbh/nova-api-client-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

nova-api-client-go

A simple client for the Wandelbots Nova API.

basic usage

go get github.com/wandelbotsgmbh/nova-api-client-go/v24

Example:

func ListControllers(host string, cell string) ([]v24.ControllerInstance, error) {
	client, err := v24.NewClientWithResponses(host)
	if err != nil {
		return nil, err
	}

	resp, err := client.ListControllersWithResponse(context.TODO(), cell)
	if err != nil {
		return []v24.ControllerInstance{}, err
	}

	if !StatusSuccessfull(resp.StatusCode()) {
		return []v24.ControllerInstance{}, fmt.Errorf("failed to list controllers %s", resp.Status())
	}

	return resp.JSON200.Instances, nil
}