simple

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

README

Simple SDK

The Simple SDK provides a simplified, high-level interface to the NCX Infra Controller REST API. It wraps the standard SDK with a cleaner API and automatic metadata management.

Features

  • Simplified types: Clean request/response structs without OpenAPI-generated boilerplate
  • Automatic metadata: Site, VPC, Subnet, and VPC Prefix are automatically discovered and cached

Build

The simple SDK depends on the standard SDK, which is generated from the OpenAPI spec.

  1. Generate the standard SDK (from the repo root):

    make generate-sdk
    

    Requires openapi-generator (e.g. brew install openapi-generator). To use a different spec:

    OPENAPI_SPEC=/path/to/spec.yaml make generate-sdk
    
  2. Build the simple SDK:

    go build ./sdk/simple/...
    

Use

Add as a dependency

In your project's go.mod:

go get github.com/NVIDIA/ncx-infra-controller-rest/sdk/simple

For local development, use a replace directive:

replace github.com/NVIDIA/ncx-infra-controller-rest => /path/to/ncx-infra-controller-rest
Local development (kind)

After running make kind-reset from the repo root, the API is available at http://localhost:8388 and Keycloak at http://localhost:8082. Use the test-org organization with a token from Keycloak.

1. Get a token (requires jq; run in a separate terminal or before your program):

export CARBIDE_TOKEN=$(curl -s -X POST "http://localhost:8082/realms/carbide-dev/protocol/openid-connect/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "client_id=carbide-api" \
  -d "client_secret=carbide-local-secret" \
  -d "grant_type=password" \
  -d "username=admin@example.com" \
  -d "password=adminpassword" | jq -r .access_token)

export CARBIDE_BASE_URL="http://localhost:8388"
export CARBIDE_ORG="test-org"

2. Use the SDK with environment variables:

package main

import (
    "context"
    "fmt"
    "log"

    "github.com/NVIDIA/ncx-infra-controller-rest/sdk/simple"
)

func main() {
    client, err := simple.NewClientFromEnv()
    if err != nil {
        log.Fatal(err)
    }

    ctx := context.Background()
    if err := client.Authenticate(ctx); err != nil {
        log.Fatal(err)
    }

    // List VPCs
    vpcs, pagination, apiErr := client.GetVpcs(ctx, nil, nil)
    if apiErr != nil {
        log.Fatal(apiErr)
    }
    fmt.Printf("Found %d VPCs\n", len(vpcs))
    for _, vpc := range vpcs {
        fmt.Printf("  - %s (%s)\n", vpc.Name, vpc.ID)
    }
    _ = pagination

    // List machines
    machines, _, apiErr := client.GetMachines(ctx, nil)
    if apiErr != nil {
        log.Fatal(apiErr)
    }
    fmt.Printf("Found %d machines\n", len(machines))
}

Save as main.go in a directory with go.mod (or use a replace directive to point at this repo), then run:

go run .

Or run an example (from repo root, after make kind-reset and port-forwarding):

make test-simple-sdk-example   # runs machine example
go run ./sdk/simple/examples/vpc/
go run ./sdk/simple/examples/vpc/manage/      # full VPC CRUD
go run ./sdk/simple/examples/instance/
go run ./sdk/simple/examples/instance/create/  # create and delete instance
go run ./sdk/simple/examples/instance/filter_by_name/
go run ./sdk/simple/examples/instance/multi_vpc/
go run ./sdk/simple/examples/ipblock/
go run ./sdk/simple/examples/expectedmachine/
go run ./sdk/simple/examples/expectedmachine/batch_manage/

Examples verify the SDK can talk to the stack (list, get, create, update, delete). No build or setup required beyond a running kind cluster with API and Keycloak port-forwarded.

3. Use the SDK with programmatic configuration:

package main

import (
    "context"
    "fmt"
    "log"

    "github.com/NVIDIA/ncx-infra-controller-rest/sdk/simple"
)

func main() {
    token := "your-jwt-from-keycloak" // Get via curl as shown above
    client, err := simple.NewClient(simple.ClientConfig{
        BaseURL: "http://localhost:8388",
        Org:     "test-org",
        Token:   token,
    })
    if err != nil {
        log.Fatal(err)
    }

    ctx := context.Background()
    if err := client.Authenticate(ctx); err != nil {
        log.Fatal(err)
    }

    // List machines
    machines, _, apiErr := client.GetMachines(ctx, nil)
    if apiErr != nil {
        log.Fatal(apiErr)
    }
    fmt.Printf("Found %d machines\n", len(machines))
}

Test users (from main README):

Email Password Roles
admin@example.com adminpassword FORGE_PROVIDER_ADMIN, FORGE_TENANT_ADMIN
testuser@example.com testpassword FORGE_TENANT_ADMIN
provider@example.com providerpassword FORGE_PROVIDER_ADMIN
Programmatic configuration
import (
    "github.com/NVIDIA/ncx-infra-controller-rest/sdk/simple"
)

client, err := simple.NewClient(simple.ClientConfig{
    BaseURL: "https://api.example.com",
    Org:     "my-org",
    Token:   "your-jwt-token",
})
if err != nil {
    log.Fatal(err)
}

// Authenticate to fetch metadata (Site, VPC, etc.)
if err := client.Authenticate(ctx); err != nil {
    log.Fatal(err)
}

// Use the client
vpcs, pagination, apiErr := client.GetVpcs(ctx, nil, nil)
Environment variables

Use NewClientFromEnv() to create a client from environment variables:

Variable Description
CARBIDE_BASE_URL API base URL (e.g. http://localhost:8388 for kind, https://api.example.com for production)
CARBIDE_ORG Organization name (e.g. test-org for kind)
CARBIDE_TOKEN JWT token (or CARBIDE_API_KEY)
client, err := simple.NewClientFromEnv()
if err != nil {
    log.Fatal(err)
}

Documentation

Index

Constants

View Source
const (
	// ServiceOrg is the organization ID the service should use for client initialization
	ServiceOrg            = "vmaas-service"
	FNNVirtualizationType = "FNN"
)
View Source
const (
	// DpuExtensionServiceTypeKubernetesPod is the type of the DPU extension service for Kubernetes Pod
	DpuExtensionServiceTypeKubernetesPod = "KubernetesPod"
)
View Source
const StatusClientClosedRequest = 499

StatusClientClosedRequest is the HTTP status code (499) used when the client closes the connection before the server responds. It is a non-standard code used by nginx and gRPC for cancelled requests.

Variables

View Source
var (
	// NotImplementedError is an error that is returned when a method is not implemented
	NotImplementedError = errors.New("not implemented")
)

Functions

func GetInstanceSshKeyGroupName

func GetInstanceSshKeyGroupName(instanceName string) string

GetInstanceSshKeyGroupName returns the name of the SSH Key Group for an Instance

func GetSSHKeyFingerprint

func GetSSHKeyFingerprint(publicKey string) (*string, error)

GetSSHKeyFingerprint generates the fingerprint for a given SSH public key

func Int32PtrToIntPtr

func Int32PtrToIntPtr(i *int32) *int

Int32PtrToIntPtr converts a *int32 to a *int

func IntPtr

func IntPtr(i int) *int

IntPtr returns a pointer to the provided int

func IntPtrToInt32Ptr

func IntPtrToInt32Ptr(i *int) *int32

IntPtrToInt32Ptr converts a *int to a *int32

func StringPtr

func StringPtr(s string) *string

StringPtr returns a pointer to the provided string

func WithLogger

func WithLogger(ctx context.Context, logger Logger) context.Context

WithLogger returns a new context with the given logger embedded

Types

type ApiError

type ApiError struct {
	Code    int                    `json:"code"`
	Message string                 `json:"message"`
	Data    map[string]interface{} `json:"data"`
}

ApiError is a struct that encapsulates the error response from the API

func HandleResponseError

func HandleResponseError(resp *http.Response, err error) *ApiError

HandleResponseError handles the response error from the API

func (*ApiError) Error

func (ae *ApiError) Error() string

type ApiMetadata

type ApiMetadata struct {

	// Organization is the organization ID for the service using this SDK
	Organization string
	// SiteId is ID of the Site all SDK requests are scoped to
	SiteID string
	// SiteName is the Name of the selected Site
	SiteName string
	// ProviderId is the provider ID for the service using this SDK
	ProviderID string
	// TenantID is the tenant ID for the service using this SDK
	TenantID string
	// VpcId is the ID of the default VPC for the Site
	VpcID string
	// VpcName is the Name of default VPC for the Site
	VpcName string
	// VpcNetworkVirtualizationType is the network virtualization type of the default VPC
	VpcNetworkVirtualizationType string
	// VpcPrefix is the prefix of the default VPC for the Site
	VpcPrefixID string
	// VpcPrefixName is the Prefix Name of the default VPC for the Site
	VpcPrefixName string
	// SubnetID is the ID of the default Subnet for the Site (used when FNN is not supported)
	SubnetID string
	// SubnetName is the Name of the default Subnet for the Site (used when FNN is not supported)
	SubnetName string
	// contains filtered or unexported fields
}

func (*ApiMetadata) Initialize

func (am *ApiMetadata) Initialize(ctx context.Context, org string, apiClient *standard.APIClient) *ApiError

Initialize initializes the ApiMetadata struct. It will try to use preset values if provided, otherwise it will fetch and set the values from the API.

func (*ApiMetadata) IsMinimumAPIVersion

func (am *ApiMetadata) IsMinimumAPIVersion(requiredVersion string) (string, bool)

IsMinimumAPIVersion returns the API version and whether it meets the required minimum. Returns false if the current API version is empty or does not start with "v", as semver.Compare treats two invalid versions as equal (returning 0), which would otherwise produce a false positive.

func (*ApiMetadata) SetDefaultSite

func (am *ApiMetadata) SetDefaultSite(ctx context.Context, apiClient *standard.APIClient) *ApiError

SetDefaultSite try to use the preset SiteId if provided and exists, otherwise fetch and set a default Site for the Organization.

func (*ApiMetadata) SetDefaultSubnet

func (am *ApiMetadata) SetDefaultSubnet(ctx context.Context, apiClient *standard.APIClient) *ApiError

SetDefaultSubnet try to use the preset SubnetId if provided and exists, otherwise fetch and set a default Subnet for the VPC.

func (*ApiMetadata) SetDefaultVPC

func (am *ApiMetadata) SetDefaultVPC(ctx context.Context, apiClient *standard.APIClient) *ApiError

SetDefaultVPC try to use the preset VpcId if provided and exists, otherwise fetch and set a default VPC for the Site.

func (*ApiMetadata) SetDefaultVPCPrefix

func (am *ApiMetadata) SetDefaultVPCPrefix(ctx context.Context, apiClient *standard.APIClient) *ApiError

SetDefaultVPCPrefix try to use the preset VpcPrefixId if provided and exists, otherwise fetch and set a default VPC Prefix for the VPC.

type Client

type Client struct {
	// The configuration for the client supplied by the SDK user
	Config ClientConfig

	// Logger is the logger instance used by the client
	Logger Logger
	// contains filtered or unexported fields
}

Client is a struct that contains the client for the Forge API

func NewClient

func NewClient(config ClientConfig) (*Client, error)

NewClient creates a new simple SDK client

func NewClientFromEnv

func NewClientFromEnv() (*Client, error)

NewClientFromEnv creates a new client from environment variables

func NewClientFromEnvWithLogger

func NewClientFromEnvWithLogger(logger Logger) (*Client, error)

NewClientFromEnvWithLogger creates a new client from environment variables with the specified logger

func (*Client) Authenticate

func (c *Client) Authenticate(ctx context.Context) error

Authenticate initiate session with carbide-rest-api/keycloak and retrieve JWT. It also makes an API call to retrieve service-specific information to cache.

func (*Client) BatchCreateExpectedMachines

func (c *Client) BatchCreateExpectedMachines(ctx context.Context, requests []ExpectedMachineCreateRequest) ([]ExpectedMachine, *ApiError)

func (*Client) BatchUpdateExpectedMachines

func (c *Client) BatchUpdateExpectedMachines(ctx context.Context, updates []ExpectedMachineUpdateRequest) ([]ExpectedMachine, *ApiError)

func (*Client) CreateDpuExtensionService

func (c *Client) CreateDpuExtensionService(ctx context.Context, request DpuExtensionServiceCreateRequest) (*DpuExtensionService, *ApiError)

DpuExtensionService

func (*Client) CreateExpectedMachine

func (c *Client) CreateExpectedMachine(ctx context.Context, request ExpectedMachineCreateRequest) (*ExpectedMachine, *ApiError)

ExpectedMachine

func (*Client) CreateInfinibandPartition

func (c *Client) CreateInfinibandPartition(ctx context.Context, request InfinibandPartitionCreateRequest) (*InfinibandPartition, *ApiError)

InfinibandPartition

func (*Client) CreateInstance

func (c *Client) CreateInstance(ctx context.Context, request InstanceCreateRequest) (*standard.Instance, *ApiError)

Instance

func (*Client) CreateNVLinkLogicalPartition

func (c *Client) CreateNVLinkLogicalPartition(ctx context.Context, request NVLinkLogicalPartitionCreateRequest) (*NVLinkLogicalPartition, *ApiError)

NVLinkLogicalPartition

func (*Client) CreateOperatingSystem

func (c *Client) CreateOperatingSystem(ctx context.Context, request OperatingSystemCreateRequest) (*OperatingSystem, *ApiError)

OperatingSystem

func (*Client) CreateSshKey

func (c *Client) CreateSshKey(ctx context.Context, sshPublicKey string) (*standard.SshKey, *ApiError)

SshKeyGroup

func (*Client) CreateSshKeyGroupForInstance

func (c *Client) CreateSshKeyGroupForInstance(ctx context.Context, instanceName string, sshPublicKeys []string) (*standard.SshKeyGroup, *ApiError)

func (*Client) CreateVpc

func (c *Client) CreateVpc(ctx context.Context, request VpcCreateRequest) (*Vpc, *ApiError)

VPC

func (*Client) DeleteDpuExtensionService

func (c *Client) DeleteDpuExtensionService(ctx context.Context, id string) *ApiError

func (*Client) DeleteDpuExtensionServiceVersion

func (c *Client) DeleteDpuExtensionServiceVersion(ctx context.Context, id string, version string) *ApiError

func (*Client) DeleteExpectedMachine

func (c *Client) DeleteExpectedMachine(ctx context.Context, id string) *ApiError

func (*Client) DeleteInfinibandPartition

func (c *Client) DeleteInfinibandPartition(ctx context.Context, id string) *ApiError

func (*Client) DeleteInstance

func (c *Client) DeleteInstance(ctx context.Context, id string) *ApiError

func (*Client) DeleteNVLinkLogicalPartition

func (c *Client) DeleteNVLinkLogicalPartition(ctx context.Context, id string) *ApiError

func (*Client) DeleteOperatingSystem

func (c *Client) DeleteOperatingSystem(ctx context.Context, id string) *ApiError

func (*Client) DeleteSshKeyGroup

func (c *Client) DeleteSshKeyGroup(ctx context.Context, sshKeyGroupID string) *ApiError

func (*Client) DeleteVpc

func (c *Client) DeleteVpc(ctx context.Context, id string) *ApiError

func (*Client) GetDpuExtensionService

func (c *Client) GetDpuExtensionService(ctx context.Context, id string) (*DpuExtensionService, *ApiError)

func (*Client) GetDpuExtensionServiceVersion

func (c *Client) GetDpuExtensionServiceVersion(ctx context.Context, id string, version string) (*standard.DpuExtensionServiceVersionInfo, *ApiError)

func (*Client) GetDpuExtensionServices

func (c *Client) GetDpuExtensionServices(ctx context.Context, paginationFilter *PaginationFilter) ([]DpuExtensionService, *standard.PaginationResponse, *ApiError)

func (*Client) GetExpectedMachine

func (c *Client) GetExpectedMachine(ctx context.Context, id string) (*ExpectedMachine, *ApiError)

func (*Client) GetExpectedMachines

func (c *Client) GetExpectedMachines(ctx context.Context, paginationFilter *PaginationFilter) ([]ExpectedMachine, *standard.PaginationResponse, *ApiError)

func (*Client) GetInfinibandPartition

func (c *Client) GetInfinibandPartition(ctx context.Context, id string) (*InfinibandPartition, *ApiError)

func (*Client) GetInfinibandPartitions

func (c *Client) GetInfinibandPartitions(ctx context.Context, paginationFilter *PaginationFilter) ([]InfinibandPartition, *standard.PaginationResponse, *ApiError)

func (*Client) GetInstance

func (c *Client) GetInstance(ctx context.Context, id string) (*standard.Instance, *ApiError)

func (*Client) GetInstances

func (c *Client) GetInstances(ctx context.Context, instanceFilter *InstanceFilter, paginationFilter *PaginationFilter) ([]standard.Instance, *standard.PaginationResponse, *ApiError)

func (*Client) GetIpBlock

func (c *Client) GetIpBlock(ctx context.Context, id string) (*IpBlock, *ApiError)

func (*Client) GetIpBlocks

func (c *Client) GetIpBlocks(ctx context.Context, paginationFilter *PaginationFilter) ([]IpBlock, *standard.PaginationResponse, *ApiError)

IpBlock

func (*Client) GetMachine

func (c *Client) GetMachine(ctx context.Context, id string) (*Machine, *ApiError)

func (*Client) GetMachines

func (c *Client) GetMachines(ctx context.Context, paginationFilter *PaginationFilter) ([]Machine, *standard.PaginationResponse, *ApiError)

Machine

func (*Client) GetNVLinkLogicalPartition

func (c *Client) GetNVLinkLogicalPartition(ctx context.Context, id string) (*NVLinkLogicalPartition, *ApiError)

func (*Client) GetNVLinkLogicalPartitions

func (c *Client) GetNVLinkLogicalPartitions(ctx context.Context, paginationFilter *PaginationFilter) ([]NVLinkLogicalPartition, *standard.PaginationResponse, *ApiError)

func (*Client) GetOperatingSystem

func (c *Client) GetOperatingSystem(ctx context.Context, id string) (*OperatingSystem, *ApiError)

func (*Client) GetOperatingSystems

func (c *Client) GetOperatingSystems(ctx context.Context, paginationFilter *PaginationFilter) ([]OperatingSystem, *standard.PaginationResponse, *ApiError)

func (*Client) GetSiteID

func (c *Client) GetSiteID() string

GetSiteID returns the current Site ID from the client

func (*Client) GetSshKeyGroup

func (c *Client) GetSshKeyGroup(ctx context.Context, sshKeyGroupID string) (*standard.SshKeyGroup, *ApiError)

func (*Client) GetSubnetID

func (c *Client) GetSubnetID() string

GetSubnetID returns the current Subnet ID from the client

func (*Client) GetVpc

func (c *Client) GetVpc(ctx context.Context, id string) (*Vpc, *ApiError)

func (*Client) GetVpcID

func (c *Client) GetVpcID() string

GetVpcID returns the current VPC ID from the client

func (*Client) GetVpcPrefixID

func (c *Client) GetVpcPrefixID() string

GetVpcPrefixID returns the current VPC Prefix ID from the client

func (*Client) GetVpcs

func (c *Client) GetVpcs(ctx context.Context, vpcFilter *VpcFilter, paginationFilter *PaginationFilter) ([]Vpc, *standard.PaginationResponse, *ApiError)

func (*Client) IsMinimumAPIVersion

func (c *Client) IsMinimumAPIVersion(requiredVersion string) (string, bool)

IsMinimumAPIVersion returns the API version and whether it meets the required minimum

func (*Client) SetSiteID

func (c *Client) SetSiteID(siteID string)

SetSiteID sets the Site ID for the client. Can be used to override the default Site ID for testing.

func (*Client) SetSubnetID

func (c *Client) SetSubnetID(subnetID string)

SetSubnetID sets the Subnet ID for the client

func (*Client) SetVpcID

func (c *Client) SetVpcID(vpcID string)

SetVpcID sets the VPC ID for the client

func (*Client) SetVpcPrefixID

func (c *Client) SetVpcPrefixID(vpcPrefixID string)

SetVpcPrefixID sets the VPC Prefix ID for the client

func (*Client) UpdateDpuExtensionService

func (c *Client) UpdateDpuExtensionService(ctx context.Context, id string, request DpuExtensionServiceUpdateRequest) (*DpuExtensionService, *ApiError)

func (*Client) UpdateExpectedMachine

func (c *Client) UpdateExpectedMachine(ctx context.Context, id string, request ExpectedMachineUpdateRequest) (*ExpectedMachine, *ApiError)

func (*Client) UpdateInfinibandPartition

func (c *Client) UpdateInfinibandPartition(ctx context.Context, id string, request InfinibandPartitionUpdateRequest) (*InfinibandPartition, *ApiError)

func (*Client) UpdateInstance

func (c *Client) UpdateInstance(ctx context.Context, id string, request InstanceUpdateRequest) (*standard.Instance, *ApiError)

func (*Client) UpdateNVLinkLogicalPartition

func (c *Client) UpdateNVLinkLogicalPartition(ctx context.Context, id string, request NVLinkLogicalPartitionUpdateRequest) (*NVLinkLogicalPartition, *ApiError)

func (*Client) UpdateOperatingSystem

func (c *Client) UpdateOperatingSystem(ctx context.Context, id string, request OperatingSystemUpdateRequest) (*OperatingSystem, *ApiError)

func (*Client) UpdateToken

func (c *Client) UpdateToken(ctx context.Context, token string) error

UpdateToken updates the JWT token and re-authenticates

func (*Client) UpdateVpc

func (c *Client) UpdateVpc(ctx context.Context, id string, request VpcUpdateRequest) (*Vpc, *ApiError)

type ClientConfig

type ClientConfig struct {
	// BaseURL is the base URL of Carbide REST API. For in-cluster requests, use "https://carbide-rest-api.carbide-rest.svc.cluster.local"
	BaseURL string
	// Org is the organization to use for the client. Select desired service org from const.go.
	Org string
	// Token should contain a valid JWT
	Token string
	// Logger is the logger instance to use for SDK logging. If nil, a no-op logger will be used by default.
	Logger Logger
}

ClientConfig is a struct that contains the configuration for the client

type ClientInterface

type ClientInterface interface {
	// Authentication management interfaces
	Authenticate(ctx context.Context) error
	UpdateToken(ctx context.Context, token string) error

	// Instance management interfaces
	CreateInstance(ctx context.Context, request InstanceCreateRequest) (*standard.Instance, *ApiError)
	GetInstances(ctx context.Context, instanceFilter *InstanceFilter, paginationFilter *PaginationFilter) ([]standard.Instance, *standard.PaginationResponse, *ApiError)
	GetInstance(ctx context.Context, id string) (*standard.Instance, *ApiError)
	UpdateInstance(ctx context.Context, id string, request InstanceUpdateRequest) (*standard.Instance, *ApiError)
	DeleteInstance(ctx context.Context, id string) *ApiError

	// IP Block Management interfaces
	GetIpBlocks(ctx context.Context, paginationFilter *PaginationFilter) ([]IpBlock, *standard.PaginationResponse, *ApiError)
	GetIpBlock(ctx context.Context, id string) (*IpBlock, *ApiError)

	// InfiniBand Partition management interfaces
	CreateInfinibandPartition(ctx context.Context, request InfinibandPartitionCreateRequest) (*InfinibandPartition, *ApiError)
	GetInfinibandPartitions(ctx context.Context, paginationFilter *PaginationFilter) ([]InfinibandPartition, *standard.PaginationResponse, *ApiError)
	GetInfinibandPartition(ctx context.Context, id string) (*InfinibandPartition, *ApiError)
	UpdateInfinibandPartition(ctx context.Context, id string, request InfinibandPartitionUpdateRequest) (*InfinibandPartition, *ApiError)
	DeleteInfinibandPartition(ctx context.Context, id string) *ApiError

	// Machine management interfaces
	GetMachines(ctx context.Context, paginationFilter *PaginationFilter) ([]Machine, *standard.PaginationResponse, *ApiError)
	GetMachine(ctx context.Context, id string) (*Machine, *ApiError)

	// Expected Machine management interfaces
	CreateExpectedMachine(ctx context.Context, request ExpectedMachineCreateRequest) (*ExpectedMachine, *ApiError)
	GetExpectedMachines(ctx context.Context, paginationFilter *PaginationFilter) ([]ExpectedMachine, *standard.PaginationResponse, *ApiError)
	GetExpectedMachine(ctx context.Context, id string) (*ExpectedMachine, *ApiError)
	UpdateExpectedMachine(ctx context.Context, id string, request ExpectedMachineUpdateRequest) (*ExpectedMachine, *ApiError)
	DeleteExpectedMachine(ctx context.Context, id string) *ApiError
	BatchCreateExpectedMachines(ctx context.Context, requests []ExpectedMachineCreateRequest) ([]ExpectedMachine, *ApiError)
	BatchUpdateExpectedMachines(ctx context.Context, updates []ExpectedMachineUpdateRequest) ([]ExpectedMachine, *ApiError)

	// Operating System management interfaces
	CreateOperatingSystem(ctx context.Context, request OperatingSystemCreateRequest) (*OperatingSystem, *ApiError)
	GetOperatingSystems(ctx context.Context, paginationFilter *PaginationFilter) ([]OperatingSystem, *standard.PaginationResponse, *ApiError)
	GetOperatingSystem(ctx context.Context, id string) (*OperatingSystem, *ApiError)
	UpdateOperatingSystem(ctx context.Context, id string, request OperatingSystemUpdateRequest) (*OperatingSystem, *ApiError)
	DeleteOperatingSystem(ctx context.Context, id string) *ApiError

	// NVLink Logical Partition management interfaces
	CreateNVLinkLogicalPartition(ctx context.Context, request NVLinkLogicalPartitionCreateRequest) (*NVLinkLogicalPartition, *ApiError)
	GetNVLinkLogicalPartitions(ctx context.Context, paginationFilter *PaginationFilter) ([]NVLinkLogicalPartition, *standard.PaginationResponse, *ApiError)
	GetNVLinkLogicalPartition(ctx context.Context, id string) (*NVLinkLogicalPartition, *ApiError)
	UpdateNVLinkLogicalPartition(ctx context.Context, id string, request NVLinkLogicalPartitionUpdateRequest) (*NVLinkLogicalPartition, *ApiError)
	DeleteNVLinkLogicalPartition(ctx context.Context, id string) *ApiError

	// DPU Extension Service management interfaces
	CreateDpuExtensionService(ctx context.Context, request DpuExtensionServiceCreateRequest) (*DpuExtensionService, *ApiError)
	GetDpuExtensionServices(ctx context.Context, paginationFilter *PaginationFilter) ([]DpuExtensionService, *standard.PaginationResponse, *ApiError)
	GetDpuExtensionService(ctx context.Context, id string) (*DpuExtensionService, *ApiError)
	UpdateDpuExtensionService(ctx context.Context, id string, request DpuExtensionServiceUpdateRequest) (*DpuExtensionService, *ApiError)
	DeleteDpuExtensionService(ctx context.Context, id string) *ApiError
	GetDpuExtensionServiceVersion(ctx context.Context, id string, version string) (*standard.DpuExtensionServiceVersionInfo, *ApiError)
	DeleteDpuExtensionServiceVersion(ctx context.Context, id string, version string) *ApiError

	// VPC management interfaces
	CreateVpc(ctx context.Context, request VpcCreateRequest) (*Vpc, *ApiError)
	GetVpcs(ctx context.Context, vpcFilter *VpcFilter, paginationFilter *PaginationFilter) ([]Vpc, *standard.PaginationResponse, *ApiError)
	GetVpc(ctx context.Context, id string) (*Vpc, *ApiError)
	UpdateVpc(ctx context.Context, id string, request VpcUpdateRequest) (*Vpc, *ApiError)
	DeleteVpc(ctx context.Context, id string) *ApiError
}

ClientInterface defines the methods for the simple SDK Client

type DpuExtensionService

type DpuExtensionService struct {
	ID             string    `json:"id"`
	Name           string    `json:"name"`
	Description    *string   `json:"description"`
	ServiceType    string    `json:"serviceType"`
	Version        *string   `json:"version"`
	ActiveVersions []string  `json:"activeVersions"`
	Status         string    `json:"status"`
	Created        time.Time `json:"created"`
	Updated        time.Time `json:"updated"`
}

DpuExtensionService represents a simplified DPU Extension Service

type DpuExtensionServiceCreateRequest

type DpuExtensionServiceCreateRequest struct {
	Name        string  `json:"name"`
	Description *string `json:"description"`
	ServiceType string  `json:"serviceType"`
	Data        string  `json:"data"`
}

DpuExtensionServiceCreateRequest represents a request to create a DPU Extension Service

type DpuExtensionServiceDeploymentRequest

type DpuExtensionServiceDeploymentRequest struct {
	DpuExtensionServiceID string  `json:"dpuExtensionServiceId"`
	Version               *string `json:"version"`
}

DpuExtensionServiceDeploymentRequest represents a DPU extension service deployment

type DpuExtensionServiceManager

type DpuExtensionServiceManager struct {
	// contains filtered or unexported fields
}

DpuExtensionServiceManager manages DPU Extension Service operations

func NewDpuExtensionServiceManager

func NewDpuExtensionServiceManager(client *Client) DpuExtensionServiceManager

NewDpuExtensionServiceManager creates a new DpuExtensionServiceManager

func (DpuExtensionServiceManager) Create

Create creates a new DPU Extension Service

func (DpuExtensionServiceManager) Delete

Delete deletes a DPU Extension Service

func (DpuExtensionServiceManager) DeleteDpuExtensionServiceVersion

func (dm DpuExtensionServiceManager) DeleteDpuExtensionServiceVersion(ctx context.Context, id string, version string) *ApiError

DeleteDpuExtensionServiceVersion deletes a specific version of a DPU extension service

func (DpuExtensionServiceManager) Get

Get returns a DPU Extension Service by ID

func (DpuExtensionServiceManager) GetDpuExtensionServiceVersion

func (dm DpuExtensionServiceManager) GetDpuExtensionServiceVersion(ctx context.Context, id string, version string) (*standard.DpuExtensionServiceVersionInfo, *ApiError)

GetDpuExtensionServiceVersion returns information about a specific version of a DPU extension service

func (DpuExtensionServiceManager) GetDpuExtensionServices

func (dm DpuExtensionServiceManager) GetDpuExtensionServices(ctx context.Context, paginationFilter *PaginationFilter) ([]DpuExtensionService, *standard.PaginationResponse, *ApiError)

GetDpuExtensionServices returns all DPU Extension Services

func (DpuExtensionServiceManager) Update

Update updates a DPU Extension Service

type DpuExtensionServiceUpdateRequest

type DpuExtensionServiceUpdateRequest struct {
	Name        *string `json:"name"`
	Description *string `json:"description"`
	Data        *string `json:"data"`
}

DpuExtensionServiceUpdateRequest represents a request to update a DPU Extension Service

type ExpectedMachine

type ExpectedMachine struct {
	ID                       string                   `json:"id"`
	BmcMacAddress            string                   `json:"bmcMacAddress"`
	ChassisSerialNumber      string                   `json:"chassisSerialNumber"`
	FallbackDPUSerialNumbers []string                 `json:"fallbackDPUSerialNumbers"`
	SkuID                    *string                  `json:"skuId"`
	Sku                      *standard.Sku            `json:"sku,omitempty"`
	MachineID                *string                  `json:"machineId"`
	Machine                  *standard.MachineSummary `json:"machine,omitempty"`
	Labels                   map[string]string        `json:"labels"`
	Created                  time.Time                `json:"created"`
	Updated                  time.Time                `json:"updated"`
}

ExpectedMachine represents a simplified Expected Machine

type ExpectedMachineCreateRequest

type ExpectedMachineCreateRequest struct {
	BmcMacAddress            string            `json:"bmcMacAddress"`
	BmcUsername              *string           `json:"bmcUsername"`
	BmcPassword              *string           `json:"bmcPassword"`
	ChassisSerialNumber      string            `json:"chassisSerialNumber"`
	FallbackDPUSerialNumbers []string          `json:"fallbackDPUSerialNumbers"`
	Labels                   map[string]string `json:"labels"`
}

ExpectedMachineCreateRequest represents a request to create an Expected Machine

type ExpectedMachineManager

type ExpectedMachineManager struct {
	// contains filtered or unexported fields
}

ExpectedMachineManager manages Expected Machine operations

func NewExpectedMachineManager

func NewExpectedMachineManager(client *Client) ExpectedMachineManager

NewExpectedMachineManager creates a new ExpectedMachineManager

func (ExpectedMachineManager) BatchCreate

BatchCreate creates multiple Expected Machines (max 100 per request)

func (ExpectedMachineManager) BatchUpdate

BatchUpdate updates multiple Expected Machines (max 100 per request). Each request must have ID set.

func (ExpectedMachineManager) Create

Create creates a new Expected Machine

func (ExpectedMachineManager) Delete

func (emm ExpectedMachineManager) Delete(ctx context.Context, id string) *ApiError

Delete deletes an Expected Machine

func (ExpectedMachineManager) Get

Get returns an Expected Machine by ID

func (ExpectedMachineManager) GetExpectedMachines

func (emm ExpectedMachineManager) GetExpectedMachines(ctx context.Context, paginationFilter *PaginationFilter) ([]ExpectedMachine, *standard.PaginationResponse, *ApiError)

GetExpectedMachines returns all Expected Machines

func (ExpectedMachineManager) Update

Update updates an Expected Machine

type ExpectedMachineUpdateRequest

type ExpectedMachineUpdateRequest struct {
	ID                       string            `json:"id,omitempty"` // Required for batch operations
	BmcMacAddress            *string           `json:"bmcMacAddress"`
	BmcUsername              *string           `json:"bmcUsername"`
	BmcPassword              *string           `json:"bmcPassword"`
	ChassisSerialNumber      *string           `json:"chassisSerialNumber"`
	FallbackDPUSerialNumbers []string          `json:"fallbackDPUSerialNumbers"`
	SkuID                    *string           `json:"skuId"`
	Labels                   map[string]string `json:"labels"`
}

ExpectedMachineUpdateRequest represents a request to update an Expected Machine

type InfiniBandInterfaceCreateOrUpdateRequest

type InfiniBandInterfaceCreateOrUpdateRequest struct {
	PartitionID       string  `json:"partitionId"`
	Device            string  `json:"device"`
	Vendor            *string `json:"vendor"`
	DeviceInstance    int     `json:"deviceInstance"`
	IsPhysical        bool    `json:"isPhysical"`
	VirtualFunctionID *int    `json:"virtualFunctionId"`
}

InfiniBandInterfaceCreateOrUpdateRequest represents an InfiniBand interface attachment

type InfinibandPartition

type InfinibandPartition struct {
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	Description  *string   `json:"description"`
	PartitionKey *string   `json:"partitionKey"`
	Created      time.Time `json:"created"`
	Updated      time.Time `json:"updated"`
	Status       string    `json:"status"`
}

InfinibandPartition represents a simplified InfiniBand Partition

type InfinibandPartitionCreateRequest

type InfinibandPartitionCreateRequest struct {
	Name        string  `json:"name"`
	Description *string `json:"description"`
}

InfinibandPartitionCreateRequest represents a request to create an InfiniBand Partition

type InfinibandPartitionManager

type InfinibandPartitionManager struct {
	// contains filtered or unexported fields
}

InfinibandPartitionManager manages InfiniBand Partition operations

func NewInfinibandPartitionManager

func NewInfinibandPartitionManager(client *Client) InfinibandPartitionManager

NewInfinibandPartitionManager creates a new InfinibandPartitionManager

func (InfinibandPartitionManager) Create

Create creates a new InfiniBand Partition

func (InfinibandPartitionManager) Delete

Delete deletes an InfiniBand Partition

func (InfinibandPartitionManager) Get

Get returns an InfiniBand Partition by ID

func (InfinibandPartitionManager) GetInfinibandPartitions

func (ipm InfinibandPartitionManager) GetInfinibandPartitions(ctx context.Context, paginationFilter *PaginationFilter) ([]InfinibandPartition, *standard.PaginationResponse, *ApiError)

GetInfinibandPartitions returns all InfiniBand Partitions

func (InfinibandPartitionManager) Update

Update updates an InfiniBand Partition

type InfinibandPartitionUpdateRequest

type InfinibandPartitionUpdateRequest struct {
	Name        *string `json:"name"`
	Description *string `json:"description"`
}

InfinibandPartitionUpdateRequest represents a request to update an InfiniBand Partition

type InstanceCreateRequest

type InstanceCreateRequest struct {
	Name                           string                                     `json:"name"`
	Description                    *string                                    `json:"description"`
	MachineID                      string                                     `json:"machineId"`
	VpcID                          *string                                    `json:"vpcId"`
	IpxeScript                     string                                     `json:"ipxeScript"`
	UserData                       *string                                    `json:"userData"`
	SSHKeys                        []string                                   `json:"sshKeys"`
	Labels                         map[string]string                          `json:"labels"`
	InfinibandInterfaces           []InfiniBandInterfaceCreateOrUpdateRequest `json:"infinibandInterfaces"`
	NVLinkInterfaces               []NVLinkInterfaceCreateOrUpdateRequest     `json:"nvLinkInterfaces"`
	DpuExtensionServiceDeployments []DpuExtensionServiceDeploymentRequest     `json:"dpuExtensionServiceDeployments"`
}

InstanceCreateRequest represents a simplified request to create an Instance

type InstanceFilter

type InstanceFilter struct {
	Name  *string
	VpcID *string
}

InstanceFilter encapsulates instance list filter parameters

type InstanceManager

type InstanceManager struct {
	// contains filtered or unexported fields
}

InstanceManager manages Instance operations

func NewInstanceManager

func NewInstanceManager(client *Client) InstanceManager

NewInstanceManager creates a new InstanceManager

func (InstanceManager) Create

Create creates a new Instance

func (InstanceManager) Delete

func (im InstanceManager) Delete(ctx context.Context, id string) *ApiError

Delete deletes an Instance

func (InstanceManager) Get

Get returns an Instance by ID

func (InstanceManager) GetInstances

func (im InstanceManager) GetInstances(ctx context.Context, instanceFilter *InstanceFilter, paginationFilter *PaginationFilter) ([]standard.Instance, *standard.PaginationResponse, *ApiError)

GetInstances returns all Instances

func (InstanceManager) Update

Update updates an Instance

type InstanceUpdateRequest

type InstanceUpdateRequest struct {
	Name                           *string                                    `json:"name"`
	Description                    *string                                    `json:"description"`
	IpxeScript                     *string                                    `json:"ipxeScript"`
	UserData                       *string                                    `json:"userData"`
	Labels                         map[string]string                          `json:"labels"`
	InfinibandInterfaces           []InfiniBandInterfaceCreateOrUpdateRequest `json:"infinibandInterfaces"`
	NVLinkInterfaces               []NVLinkInterfaceCreateOrUpdateRequest     `json:"nvLinkInterfaces"`
	DpuExtensionServiceDeployments []DpuExtensionServiceDeploymentRequest     `json:"dpuExtensionServiceDeployments"`
}

InstanceUpdateRequest represents a simplified request to update an Instance

type IpBlock

type IpBlock struct {
	ID              string    `json:"id"`
	Name            *string   `json:"name"`
	Description     *string   `json:"description"`
	SiteID          *string   `json:"siteId"`
	Cidr            string    `json:"cidr"` // prefix/prefixLength
	ProtocolVersion *string   `json:"protocolVersion"`
	Status          string    `json:"status"`
	Created         time.Time `json:"created"`
	Updated         time.Time `json:"updated"`
}

IpBlock represents a simplified IP block

type IpBlockManager

type IpBlockManager struct {
	// contains filtered or unexported fields
}

IpBlockManager manages IP block operations

func NewIpBlockManager

func NewIpBlockManager(client *Client) IpBlockManager

NewIpBlockManager creates a new IpBlockManager

func (IpBlockManager) GetIpBlock

func (im IpBlockManager) GetIpBlock(ctx context.Context, id string) (*IpBlock, *ApiError)

GetIpBlock returns an IP block by ID

func (IpBlockManager) GetIpBlocks

func (im IpBlockManager) GetIpBlocks(ctx context.Context, paginationFilter *PaginationFilter) ([]IpBlock, *standard.PaginationResponse, *ApiError)

GetIpBlocks returns all IP blocks

type Logger

type Logger = *zerolog.Logger

Logger is an alias for *zerolog.Logger

func LoggerFromContext

func LoggerFromContext(ctx context.Context) Logger

LoggerFromContext extracts the logger from the context. If no logger is found in the context, it returns a no-op logger.

func NewNoOpLogger

func NewNoOpLogger() Logger

NewNoOpLogger returns a no-op logger that discards all log messages

type Machine

type Machine struct {
	ID                  string                  `json:"id"`
	InstanceTypeID      *string                 `json:"instanceTypeId"`
	InstanceID          *string                 `json:"instanceId"`
	Vendor              *string                 `json:"vendor"`
	ProductName         *string                 `json:"productName"`
	SerialNumber        *string                 `json:"serialNumber"`
	Hostname            *string                 `json:"hostname"`
	MachineCapabilities []MachineCapability     `json:"machineCapabilities"`
	AdminInterfaces     []MachineAdminInterface `json:"adminInterfaces"`
	MaintenanceMessage  *string                 `json:"maintenanceMessage"`
	Labels              map[string]string       `json:"labels"`
	Status              string                  `json:"status"`
	Created             time.Time               `json:"created"`
	Updated             time.Time               `json:"updated"`
}

Machine represents a simplified Machine

type MachineAdminInterface

type MachineAdminInterface struct {
	ID          *string    `json:"id"`
	IsPrimary   *bool      `json:"isPrimary"`
	MacAddress  *string    `json:"macAddress"`
	IpAddresses []string   `json:"ipAddresses"`
	Created     *time.Time `json:"created"`
	Updated     *time.Time `json:"updated"`
}

MachineAdminInterface describes an interface attached to a machine

type MachineCapability

type MachineCapability struct {
	Type            string  `json:"type"`
	Name            string  `json:"name"`
	Frequency       *string `json:"frequency"`
	Cores           *int    `json:"cores"`
	Threads         *int    `json:"threads"`
	Capacity        *string `json:"capacity"`
	Vendor          *string `json:"vendor"`
	InactiveDevices []int   `json:"inactiveDevices"`
	Count           *int    `json:"count"`
	DeviceType      *string `json:"deviceType"`
}

MachineCapability represents a machine capability

type MachineManager

type MachineManager struct {
	// contains filtered or unexported fields
}

MachineManager manages Machine operations

func NewMachineManager

func NewMachineManager(client *Client) MachineManager

NewMachineManager creates a new MachineManager

func (MachineManager) GetMachine

func (mm MachineManager) GetMachine(ctx context.Context, id string) (*Machine, *ApiError)

GetMachine returns a Machine by ID

func (MachineManager) GetMachines

func (mm MachineManager) GetMachines(ctx context.Context, paginationFilter *PaginationFilter) ([]Machine, *standard.PaginationResponse, *ApiError)

GetMachines returns all Machines

type NVLinkInterfaceCreateOrUpdateRequest

type NVLinkInterfaceCreateOrUpdateRequest struct {
	NVLinkLogicalPartitionID string `json:"nvLinkLogicalPartitionId"`
	DeviceInstance           int    `json:"deviceInstance"`
}

NVLinkInterfaceCreateOrUpdateRequest represents an NVLink interface attachment

type NVLinkLogicalPartition

type NVLinkLogicalPartition struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Description *string   `json:"description"`
	Status      string    `json:"status"`
	Created     time.Time `json:"created"`
	Updated     time.Time `json:"updated"`
}

NVLinkLogicalPartition represents a simplified NVLink Logical Partition

type NVLinkLogicalPartitionCreateRequest

type NVLinkLogicalPartitionCreateRequest struct {
	Name        string  `json:"name"`
	Description *string `json:"description"`
}

NVLinkLogicalPartitionCreateRequest represents a request to create an NVLink Logical Partition

type NVLinkLogicalPartitionManager

type NVLinkLogicalPartitionManager struct {
	// contains filtered or unexported fields
}

NVLinkLogicalPartitionManager manages NVLink Logical Partition operations

func NewNVLinkLogicalPartitionManager

func NewNVLinkLogicalPartitionManager(client *Client) NVLinkLogicalPartitionManager

NewNVLinkLogicalPartitionManager creates a new NVLinkLogicalPartitionManager

func (NVLinkLogicalPartitionManager) Create

Create creates a new NVLink Logical Partition

func (NVLinkLogicalPartitionManager) Delete

Delete deletes an NVLink Logical Partition

func (NVLinkLogicalPartitionManager) Get

Get returns an NVLink Logical Partition by ID

func (NVLinkLogicalPartitionManager) GetNVLinkLogicalPartitions

func (nlm NVLinkLogicalPartitionManager) GetNVLinkLogicalPartitions(ctx context.Context, paginationFilter *PaginationFilter) ([]NVLinkLogicalPartition, *standard.PaginationResponse, *ApiError)

GetNVLinkLogicalPartitions returns all NVLink Logical Partitions

func (NVLinkLogicalPartitionManager) Update

Update updates an NVLink Logical Partition

type NVLinkLogicalPartitionUpdateRequest

type NVLinkLogicalPartitionUpdateRequest struct {
	Name        *string `json:"name"`
	Description *string `json:"description"`
}

NVLinkLogicalPartitionUpdateRequest represents a request to update an NVLink Logical Partition

type OperatingSystem

type OperatingSystem struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Description *string   `json:"description"`
	IpxeScript  *string   `json:"ipxeScript"`
	UserData    *string   `json:"userData"`
	Status      string    `json:"status"`
	Created     time.Time `json:"created"`
	Updated     time.Time `json:"updated"`
}

OperatingSystem represents a simplified Operating System

type OperatingSystemCreateRequest

type OperatingSystemCreateRequest struct {
	Name        string  `json:"name"`
	Description *string `json:"description"`
	IpxeScript  *string `json:"ipxeScript"`
	UserData    *string `json:"userData"`
}

OperatingSystemCreateRequest represents a request to create an Operating System

type OperatingSystemManager

type OperatingSystemManager struct {
	// contains filtered or unexported fields
}

OperatingSystemManager manages Operating System operations

func NewOperatingSystemManager

func NewOperatingSystemManager(client *Client) OperatingSystemManager

NewOperatingSystemManager creates a new OperatingSystemManager

func (OperatingSystemManager) Create

Create creates a new Operating System

func (OperatingSystemManager) Delete

func (osm OperatingSystemManager) Delete(ctx context.Context, id string) *ApiError

Delete deletes an Operating System

func (OperatingSystemManager) Get

Get returns an Operating System by ID

func (OperatingSystemManager) GetOperatingSystems

func (osm OperatingSystemManager) GetOperatingSystems(ctx context.Context, paginationFilter *PaginationFilter) ([]OperatingSystem, *standard.PaginationResponse, *ApiError)

GetOperatingSystems returns all Operating Systems

func (OperatingSystemManager) Update

Update updates an Operating System

type OperatingSystemUpdateRequest

type OperatingSystemUpdateRequest struct {
	Name        *string `json:"name"`
	Description *string `json:"description"`
	IpxeScript  *string `json:"ipxeScript"`
	UserData    *string `json:"userData"`
}

OperatingSystemUpdateRequest represents a request to update an Operating System

type PaginationFilter

type PaginationFilter struct {
	// PageNumber is the page number to retrieve
	PageNumber *int
	// PageSize is the number of items per page
	PageSize *int
	// OrderBy is the field to order the results by
	OrderBy *string
}

PaginationFilter is a struct that encapsulates supported query parameters for pagination

type SshKeyGroupManager

type SshKeyGroupManager struct {
	// contains filtered or unexported fields
}

SshKeyGroupManager manages SSH Key Group operations

func NewSshKeyGroupManager

func NewSshKeyGroupManager(client *Client) SshKeyGroupManager

NewSshKeyGroupManager creates a new SshKeyGroupManager

func (SshKeyGroupManager) CreateSshKey

func (skm SshKeyGroupManager) CreateSshKey(ctx context.Context, sshPublicKey string) (*standard.SshKey, *ApiError)

CreateSshKey creates a new SSH Key (uses fingerprint as name)

func (SshKeyGroupManager) CreateSshKeyGroupForInstance

func (skm SshKeyGroupManager) CreateSshKeyGroupForInstance(ctx context.Context, instanceName string, sshPublicKeys []string) (*standard.SshKeyGroup, *ApiError)

CreateSshKeyGroupForInstance creates a new SSH Key Group for the specified Instance

func (SshKeyGroupManager) DeleteSshKeyGroup

func (skm SshKeyGroupManager) DeleteSshKeyGroup(ctx context.Context, sshKeyGroupID string) *ApiError

DeleteSshKeyGroup deletes an SSH Key Group

func (SshKeyGroupManager) GetSshKeyGroup

func (skm SshKeyGroupManager) GetSshKeyGroup(ctx context.Context, sshKeyGroupID string) (*standard.SshKeyGroup, *ApiError)

GetSshKeyGroup returns an SSH Key Group by ID

func (SshKeyGroupManager) IsSSHKeyGroupMatching

func (skm SshKeyGroupManager) IsSSHKeyGroupMatching(existingGroup *standard.SshKeyGroup, wantedSshKeyIDs []string) bool

IsSSHKeyGroupMatching checks if an existing group matches the wanted SSH key IDs

type Vpc

type Vpc struct {
	ID                        string    `json:"id"`
	Name                      string    `json:"name"`
	Description               *string   `json:"description"`
	NetworkVirtualizationType string    `json:"networkVirtualizationType"`
	Created                   time.Time `json:"created"`
	Updated                   time.Time `json:"updated"`
}

Vpc represents a simplified VPC

type VpcCreateRequest

type VpcCreateRequest struct {
	Name                      string  `json:"name"`
	Description               *string `json:"description"`
	NetworkVirtualizationType string  `json:"networkVirtualizationType"`
}

VpcCreateRequest is a request to create a VPC

type VpcFilter

type VpcFilter struct {
	SiteID *string
}

VpcFilter encapsulates VPC filter parameters

type VpcManager

type VpcManager struct {
	// contains filtered or unexported fields
}

VpcManager manages VPC operations

func NewVpcManager

func NewVpcManager(client *Client) VpcManager

NewVpcManager creates a new VpcManager

func (VpcManager) CreateVpc

func (vm VpcManager) CreateVpc(ctx context.Context, request VpcCreateRequest) (*Vpc, *ApiError)

CreateVpc creates a new VPC

func (VpcManager) DeleteVpc

func (vm VpcManager) DeleteVpc(ctx context.Context, id string) *ApiError

DeleteVpc deletes a VPC

func (VpcManager) GetVpc

func (vm VpcManager) GetVpc(ctx context.Context, id string) (*Vpc, *ApiError)

GetVpc returns a VPC by ID

func (VpcManager) GetVpcs

func (vm VpcManager) GetVpcs(ctx context.Context, vpcFilter *VpcFilter, paginationFilter *PaginationFilter) ([]Vpc, *standard.PaginationResponse, *ApiError)

GetVpcs returns all VPCs

func (VpcManager) UpdateVpc

func (vm VpcManager) UpdateVpc(ctx context.Context, id string, request VpcUpdateRequest) (*Vpc, *ApiError)

UpdateVpc updates a VPC

type VpcUpdateRequest

type VpcUpdateRequest struct {
	Name        *string `json:"name"`
	Description *string `json:"description"`
}

VpcUpdateRequest is a request to update a VPC

Directories

Path Synopsis
examples
expectedmachine command
instance command
instance/create command
ipblock command
machine command
vpc command
vpc/manage command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL