Skip to main content
GET
/
plans
/
operating_systems
Go (SDK)
package main

import(
	"context"
	"os"
	latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
	"log"
)

func main() {
    ctx := context.Background()

    s := latitudeshgosdk.New(
        latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
    )

    res, err := s.OperatingSystems.ListPlans(ctx, latitudeshgosdk.Pointer[int64](20), latitudeshgosdk.Pointer[int64](1))
    if err != nil {
        log.Fatal(err)
    }
    if res.Object != nil {
        for {
            // handle items

            res, err = res.Next()

            if err != nil {
                // handle error
            }

            if res == nil {
                break
            }
        }
    }
}
{
  "data": [
    {
      "id": "os_mw49QDB5qagKb",
      "type": "operating_system",
      "attributes": {
        "name": "windows_server_2019_std_v1 72.62",
        "distro": "rhel",
        "slug": "rockylinux_8",
        "version": "72.62",
        "user": "Carmine",
        "features": {},
        "provisionable_on": [
          "g3.l40s.large-28",
          "g3.h100.medium-29"
        ]
      }
    }
  ],
  "meta": {}
}

Authorizations

Authorization
string
header
required

Query Parameters

page[size]
integer
default:20

Number of items to return per page

Required range: x >= 1
page[number]
integer
default:1

Page number to return (starts at 1)

Required range: x >= 1

Response

200 - application/vnd.api+json

Success

data
object[]