Skip to content

Latest commit

 

History

History
77 lines (56 loc) · 4.04 KB

File metadata and controls

77 lines (56 loc) · 4.04 KB

InstanceSKUCatalog

Overview

Browse available instance SKU property definitions.

Available Operations

  • List - List instance SKU property catalog

List

List every property key and its allowed values. Use the keys and values here when filling in requirements on orders and procurements.

Example Usage

package main

import(
	"context"
	sfc "github.com/sfcompute/sfc-go"
	"log"
)

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

    s := sfc.New(
        sfc.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
    )

    res, err := s.InstanceSKUCatalog.List(ctx, sfc.Pointer[int64](50), nil, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.ListInstanceSkuPropertyCatalogResponse != nil {
        for {
            // handle items

            res, err = res.Next()

            if err != nil {
                // handle error
            }

            if res == nil {
                break
            }
        }
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
limit *int64 Maximum number of results to return (1-200, default 50).
startingAfter *string Cursor for forward pagination (from a previous response's cursor field).
endingBefore *string Cursor for backward pagination.
opts []operations.Option The options for this request.

Response

*operations.ListInstanceSkuPropertyCatalogResponse, error

Errors

Error Type Status Code Content Type
apierrors.UnauthorizedError 401 application/json
apierrors.UnprocessableEntityError 422 application/json
apierrors.InternalServerError 500 application/json
apierrors.APIError 4XX, 5XX */*