Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 693 Bytes

README.md

File metadata and controls

30 lines (23 loc) · 693 Bytes

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
}