cloudcix

package module
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

README

Cloudcix Go API Library

Go Reference

The Cloudcix Go library provides convenient access to the Cloudcix REST API from applications written in Go.

It is generated with Stainless.

Installation

import (
	"github.com/TVKain/cloudcix-go" // imported as cloudcix
)

Or to pin the version:

go get -u 'github.com/TVKain/cloudcix-go@v0.15.0'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/TVKain/cloudcix-go"
	"github.com/TVKain/cloudcix-go/option"
)

func main() {
	client := cloudcix.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("CLOUDCIX_API_KEY")
	)
	backups, err := client.Compute.Backups.List(context.TODO(), cloudcix.ComputeBackupListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", backups.Metadata)
}

Request fields

The cloudcix library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `json:"...,required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, cloudcix.String(string), cloudcix.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := cloudcix.ExampleParams{
	ID:   "id_xxx",               // required property
	Name: cloudcix.String("..."), // optional property

	Point: cloudcix.Point{
		X: 0,               // required field will serialize as 0
		Y: cloudcix.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: cloudcix.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[cloudcix.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of its variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := cloudcix.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Compute.Backups.List(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

Errors

When the API returns a non-success status code, we return an error with type *cloudcix.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Compute.Backups.List(context.TODO(), cloudcix.ComputeBackupListParams{})
if err != nil {
	var apierr *cloudcix.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/compute/backups/": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Compute.Backups.List(
	ctx,
	cloudcix.ComputeBackupListParams{},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper cloudcix.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := cloudcix.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Compute.Backups.List(
	context.TODO(),
	cloudcix.ComputeBackupListParams{},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
backups, err := client.Compute.Backups.List(
	context.TODO(),
	cloudcix.ComputeBackupListParams{},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", backups)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: cloudcix.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := cloudcix.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (CLOUDCIX_API_KEY, CLOUDCIX_BASE_URL). This should be used to initialize new clients.

func File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

type BaseIPAddress

type BaseIPAddress struct {
	// The ID of the IPAddress record.
	ID int64 `json:"id,required"`
	// The IP address of the IPAddress record.
	Address string `json:"address,required"`
	// Timestamp, in ISO format, of when the IPAddress record was created.
	Created string `json:"created,required"`
	// A verbose name given to the IPAddress record.
	Name string `json:"name,required"`
	// The note attached to IPAddress that made it.
	Notes    string                `json:"notes,required"`
	PublicIP BaseIPAddressPublicIP `json:"public_ip,required"`
	// The ID of the Public IPAddress record.
	PublicIPID int64 `json:"public_ip_id,required"`
	// The ID of the Subnet record.
	SubnetID int64 `json:"subnet_id,required"`
	// Timestamp, in ISO format, of when the IPAddress record was last updated.
	Updated string `json:"updated,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Address     respjson.Field
		Created     respjson.Field
		Name        respjson.Field
		Notes       respjson.Field
		PublicIP    respjson.Field
		PublicIPID  respjson.Field
		SubnetID    respjson.Field
		Updated     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BaseIPAddress) RawJSON

func (r BaseIPAddress) RawJSON() string

Returns the unmodified JSON received from the API

func (*BaseIPAddress) UnmarshalJSON

func (r *BaseIPAddress) UnmarshalJSON(data []byte) error

type BaseIPAddressPublicIP

type BaseIPAddressPublicIP struct {
	// The ID of the Public IPAddress record.
	ID int64 `json:"id,required"`
	// The actual address of the Public IPAddress record.
	Address string `json:"address,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Address     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BaseIPAddressPublicIP) RawJSON

func (r BaseIPAddressPublicIP) RawJSON() string

Returns the unmodified JSON received from the API

func (*BaseIPAddressPublicIP) UnmarshalJSON

func (r *BaseIPAddressPublicIP) UnmarshalJSON(data []byte) error

type Bom

type Bom struct {
	// How many units of a billable entity that a Resource utilises
	Quantity int64 `json:"quantity,required"`
	// An identifier for a billable entity that a Resource utilises
	SKUName string `json:"sku_name,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Quantity    respjson.Field
		SKUName     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Bom) RawJSON

func (r Bom) RawJSON() string

Returns the unmodified JSON received from the API

func (*Bom) UnmarshalJSON

func (r *Bom) UnmarshalJSON(data []byte) error

type Client

type Client struct {
	Options []option.RequestOption
	Compute ComputeService
	Network NetworkService
	Project ProjectService
	Storage StorageService
}

Client creates a struct with services and top level methods that help with interacting with the cloudcix API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r Client)

NewClient generates a new client with the default option read from the environment (CLOUDCIX_API_KEY, CLOUDCIX_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type ComputeBackup

type ComputeBackup struct {
	// The ID of the Compute Backups record
	ID int64 `json:"id,required"`
	// Timestamp, in ISO format, of when the Compute Backups record was created.
	Created string `json:"created,required"`
	// The Compute Instance the Compute Backup record is of.
	Instance ComputeBackupInstance `json:"instance,required"`
	// The user-friendly name given to this Compute Backups instance
	Name string `json:"name,required"`
	// The id of the Project that this Compute Backups belongs to
	ProjectID int64 `json:"project_id,required"`
	// An array of the specs for the Compute Backups
	Specs []Bom `json:"specs,required"`
	// The current state of the Compute Backups
	State string `json:"state,required"`
	// The type of the Compute Backups
	Type string `json:"type,required"`
	// Timestamp, in ISO format, of when the Compute Backups record was last updated.
	Updated string `json:"updated,required"`
	// URL that can be used to run methods in the API associated with the Compute
	// Backups instance.
	Uri string `json:"uri,required" format:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Created     respjson.Field
		Instance    respjson.Field
		Name        respjson.Field
		ProjectID   respjson.Field
		Specs       respjson.Field
		State       respjson.Field
		Type        respjson.Field
		Updated     respjson.Field
		Uri         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeBackup) RawJSON

func (r ComputeBackup) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeBackup) UnmarshalJSON

func (r *ComputeBackup) UnmarshalJSON(data []byte) error

type ComputeBackupInstance

type ComputeBackupInstance struct {
	// The ID of the Compute Instance the Compute Backup is of.
	ID int64 `json:"id"`
	// The user-friendly name of the Compute Instance the Compute Backup is of.
	Name string `json:"name"`
	// The current state of the Compute Instance the Compute Backup is of.
	State string `json:"state"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		State       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Compute Instance the Compute Backup record is of.

func (ComputeBackupInstance) RawJSON

func (r ComputeBackupInstance) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeBackupInstance) UnmarshalJSON

func (r *ComputeBackupInstance) UnmarshalJSON(data []byte) error

type ComputeBackupListParams

type ComputeBackupListParams struct {
	// The limit of the number of objects returned per page
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// The field to use for ordering. Possible fields and the default are outlined in
	// the individual method descriptions.
	Order param.Opt[string] `query:"order,omitzero" json:"-"`
	// The page of records to return, assuming `limit` number of records per page.
	Page param.Opt[int64] `query:"page,omitzero" json:"-"`
	// Filter the result to objects that do not match the specified filters. Possible
	// filters are outlined in the individual list method descriptions.
	Exclude any `query:"exclude,omitzero" json:"-"`
	// Filter the result to objects that match the specified filters. Possible filters
	// are outlined in the individual list method descriptions.
	Search any `query:"search,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ComputeBackupListParams) URLQuery

func (r ComputeBackupListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ComputeBackupListParams's query parameters as `url.Values`.

type ComputeBackupListResponse

type ComputeBackupListResponse struct {
	Metadata ListMetadata    `json:"_metadata"`
	Content  []ComputeBackup `json:"content"`
	// Maximum number of records returned per page.
	Count int64 `json:"count"`
	// Page number of the current results.
	Page int64 `json:"page"`
	// Total number of matching records.
	Total int64 `json:"total"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata    respjson.Field
		Content     respjson.Field
		Count       respjson.Field
		Page        respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeBackupListResponse) RawJSON

func (r ComputeBackupListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeBackupListResponse) UnmarshalJSON

func (r *ComputeBackupListResponse) UnmarshalJSON(data []byte) error

type ComputeBackupNewParams

type ComputeBackupNewParams struct {
	// The id of the Compute Instance the Compute Backup is to be taken of.
	InstanceID int64 `json:"instance_id,required"`
	// The ID of the User's Project into which this new Compute Backups should be
	// added.
	ProjectID int64 `json:"project_id,required"`
	// The user-friendly name for the Compute Backup. If not sent, it will default to
	// the name "Backup HyperV" or "Backup LXD" depending on the type chosen.
	Name param.Opt[string] `json:"name,omitzero"`
	// The type of Compute Backup to create. Valid options are:
	//
	// - "hyperv"
	// - "lxd"
	Type param.Opt[string] `json:"type,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeBackupNewParams) MarshalJSON

func (r ComputeBackupNewParams) MarshalJSON() (data []byte, err error)

func (*ComputeBackupNewParams) UnmarshalJSON

func (r *ComputeBackupNewParams) UnmarshalJSON(data []byte) error

type ComputeBackupResponse

type ComputeBackupResponse struct {
	Content ComputeBackup `json:"content"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeBackupResponse) RawJSON

func (r ComputeBackupResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeBackupResponse) UnmarshalJSON

func (r *ComputeBackupResponse) UnmarshalJSON(data []byte) error

type ComputeBackupService

type ComputeBackupService struct {
	Options []option.RequestOption
}

ComputeBackupService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewComputeBackupService method instead.

func NewComputeBackupService

func NewComputeBackupService(opts ...option.RequestOption) (r ComputeBackupService)

NewComputeBackupService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ComputeBackupService) Get

func (r *ComputeBackupService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *ComputeBackup, err error)

Retrieve detailed information about a specific backup, including its type (LXD or Hyper-V), associated instance, project, validity timestamp, and current state.

func (*ComputeBackupService) List

Retrieve a paginated list of instance backups (LXD and/or Hyper-V) across your projects. Supports filtering by type, project, instance, state, and other attributes. Results can be ordered and paginated.

## Filtering

The following fields and modifiers can be used to filter records from the list;

- resource_links\_\_contra_resource_id (gt, gte, in, isnull, lt, lte, range) - created (gt, gte, in, isnull, lt, lte, range) - id (gt, gte, in, isnull, lt, lte, range) - name (in, icontains, iendswith, iexact, istartswith) - project_id (gt, gte, in, isnull, lt, lte, range) - project\_\_address_id (gt, gte, in, isnull, lt, lte, range) - project\_\_name (in, icontains, iendswith, iexact, istartswith) - project\_\_region_id (gt, gte, in, isnull, lt, lte, range) - project\_\_reseller_id (gt, gte, in, isnull, lt, lte, range) - state (gt, gte, in, isnull, lt, lte, range) - type - updated (gt, gte, in, isnull, lt, lte, range)

To search, simply add `?search[field]=value` to include records that match the request, or `?exclude[field]=value` to exclude them. To use modifiers, simply add `?search[field__modifier]` and `?exclude[field__modifier]`

## Ordering

The following fields can be used to order the results of the list;

- name (default) - id - project_id - state

To reverse the ordering, simply prepend a `-` character to the request. So `?order=field` orders by `field` in ascending order, while `?order=-field` orders in descending order instead.

func (*ComputeBackupService) New

Create a new backup from a running compute instance (LXD or Hyper-V). Specify the backup type, instance to backup and project. The instance must be in a running state to create a backup.

func (*ComputeBackupService) Update

Update a backup to change its name or state. Set state to delete to initiate backup deletion and free up repository storage space.

type ComputeBackupUpdateParam

type ComputeBackupUpdateParam struct {
	// The user-friendly name for the Compute Backups Resource. If not sent, it will
	// default to the current name.
	Name param.Opt[string] `json:"name,omitzero"`
	// Change the state of the Compute Backup, triggering the CloudCIX Robot to perform
	// the requested action. Users can only request state changes from certain current
	// states:
	//
	// - running -> delete
	State param.Opt[string] `json:"state,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeBackupUpdateParam) MarshalJSON

func (r ComputeBackupUpdateParam) MarshalJSON() (data []byte, err error)

func (*ComputeBackupUpdateParam) UnmarshalJSON

func (r *ComputeBackupUpdateParam) UnmarshalJSON(data []byte) error

type ComputeBackupUpdateParams

type ComputeBackupUpdateParams struct {
	ComputeBackupUpdate ComputeBackupUpdateParam
	// contains filtered or unexported fields
}

func (ComputeBackupUpdateParams) MarshalJSON

func (r ComputeBackupUpdateParams) MarshalJSON() (data []byte, err error)

func (*ComputeBackupUpdateParams) UnmarshalJSON

func (r *ComputeBackupUpdateParams) UnmarshalJSON(data []byte) error

type ComputeGPU

type ComputeGPU struct {
	// The ID of the Compute GPU record
	ID int64 `json:"id,required"`
	// Timestamp, in ISO format, of when the Compute GPU record was created.
	Created string `json:"created,required"`
	// The "lxd" Compute Instance the Compute GPU is attached to.
	Instance ComputeGPUInstance `json:"instance,required"`
	// The user-friendly name given to this Compute GPU
	Name string `json:"name,required"`
	// The id of the Project that this Compute GPU belongs to
	ProjectID int64 `json:"project_id,required"`
	// An array of the specs for the Compute GPU
	Specs []Bom `json:"specs,required"`
	// The current state of the Compute GPU
	State string `json:"state,required"`
	// Timestamp, in ISO format, of when the Compute GPU record was last updated.
	Updated string `json:"updated,required"`
	// URL that can be used to run methods in the API associated with the Compute GPU
	// instance.
	Uri string `json:"uri,required" format:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Created     respjson.Field
		Instance    respjson.Field
		Name        respjson.Field
		ProjectID   respjson.Field
		Specs       respjson.Field
		State       respjson.Field
		Updated     respjson.Field
		Uri         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeGPU) RawJSON

func (r ComputeGPU) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeGPU) UnmarshalJSON

func (r *ComputeGPU) UnmarshalJSON(data []byte) error

type ComputeGPUAttachParams

type ComputeGPUAttachParams struct {
	// The ID of the LXD Resource the GPU is requested to be mounted to.
	InstanceID int64 `json:"instance_id,required"`
	// The ID of the Project which this GPU Resource should be in.
	ProjectID int64 `json:"project_id,required"`
	// List of specs (SKUs) for the GPU resource.
	Specs []ComputeGPUAttachParamsSpec `json:"specs,omitzero,required"`
	// The user-friendly name for the Compute GPU. If not sent, it will default to the
	// name 'GPU'
	Name param.Opt[string] `json:"name,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeGPUAttachParams) MarshalJSON

func (r ComputeGPUAttachParams) MarshalJSON() (data []byte, err error)

func (*ComputeGPUAttachParams) UnmarshalJSON

func (r *ComputeGPUAttachParams) UnmarshalJSON(data []byte) error

type ComputeGPUAttachParamsSpec

type ComputeGPUAttachParamsSpec struct {
	// The name of the SKU for the GPU
	SKUName param.Opt[string] `json:"sku_name,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeGPUAttachParamsSpec) MarshalJSON

func (r ComputeGPUAttachParamsSpec) MarshalJSON() (data []byte, err error)

func (*ComputeGPUAttachParamsSpec) UnmarshalJSON

func (r *ComputeGPUAttachParamsSpec) UnmarshalJSON(data []byte) error

type ComputeGPUInstance

type ComputeGPUInstance struct {
	// The ID of the "lxd" Compute Instance the Compute GPU is attached to.
	ID int64 `json:"id"`
	// The user-friendly name of the "lxd" Compute Instance the Compute GPU is attached
	// to.
	Name string `json:"name"`
	// The current state of the "lxd" Compute Instance the Compute GPU is attached to.
	State string `json:"state"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		State       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The "lxd" Compute Instance the Compute GPU is attached to.

func (ComputeGPUInstance) RawJSON

func (r ComputeGPUInstance) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeGPUInstance) UnmarshalJSON

func (r *ComputeGPUInstance) UnmarshalJSON(data []byte) error

type ComputeGPUListParams

type ComputeGPUListParams struct {
	// The limit of the number of objects returned per page
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// The field to use for ordering. Possible fields and the default are outlined in
	// the individual method descriptions.
	Order param.Opt[string] `query:"order,omitzero" json:"-"`
	// The page of records to return, assuming `limit` number of records per page.
	Page param.Opt[int64] `query:"page,omitzero" json:"-"`
	// Filter the result to objects that do not match the specified filters. Possible
	// filters are outlined in the individual list method descriptions.
	Exclude any `query:"exclude,omitzero" json:"-"`
	// Filter the result to objects that match the specified filters. Possible filters
	// are outlined in the individual list method descriptions.
	Search any `query:"search,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ComputeGPUListParams) URLQuery

func (r ComputeGPUListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ComputeGPUListParams's query parameters as `url.Values`.

type ComputeGPUListResponse

type ComputeGPUListResponse struct {
	Metadata ListMetadata `json:"_metadata"`
	Content  []ComputeGPU `json:"content"`
	// Maximum number of records returned per page.
	Count int64 `json:"count"`
	// Page number of the current results.
	Page int64 `json:"page"`
	// Total number of matching records.
	Total int64 `json:"total"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata    respjson.Field
		Content     respjson.Field
		Count       respjson.Field
		Page        respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeGPUListResponse) RawJSON

func (r ComputeGPUListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeGPUListResponse) UnmarshalJSON

func (r *ComputeGPUListResponse) UnmarshalJSON(data []byte) error

type ComputeGPUResponse

type ComputeGPUResponse struct {
	Content ComputeGPU `json:"content"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeGPUResponse) RawJSON

func (r ComputeGPUResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeGPUResponse) UnmarshalJSON

func (r *ComputeGPUResponse) UnmarshalJSON(data []byte) error

type ComputeGPUService

type ComputeGPUService struct {
	Options []option.RequestOption
}

ComputeGPUService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewComputeGPUService method instead.

func NewComputeGPUService

func NewComputeGPUService(opts ...option.RequestOption) (r ComputeGPUService)

NewComputeGPUService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ComputeGPUService) Attach

func (r *ComputeGPUService) Attach(ctx context.Context, body ComputeGPUAttachParams, opts ...option.RequestOption) (res *ComputeGPU, err error)

Attach a GPU hardware accelerator to a running LXD instance. Specify the target LXD instance ID, project, and GPU specifications (SKUs) to provision and attach the GPU resource.

func (*ComputeGPUService) Get

func (r *ComputeGPUService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *ComputeGPU, err error)

Retrieve detailed information about a specific GPU resource, including its attached LXD instance, capacity specifications, current state, and project information.

func (*ComputeGPUService) List

Retrieve a paginated list of GPU resources across your projects. Supports filtering by project, region, state, and other attributes. Results can be ordered and paginated.

## Filtering

The following fields and modifiers can be used to filter records from the list;

- resource_links\_\_contra_resource_id (gt, gte, in, isnull, lt, lte, range) - created (gt, gte, in, isnull, lt, lte, range) - id (gt, gte, in, isnull, lt, lte, range) - name (in, icontains, iendswith, iexact, istartswith) - project_id (gt, gte, in, isnull, lt, lte, range) - project\_\_address_id (gt, gte, in, isnull, lt, lte, range) - project\_\_name (in, icontains, iendswith, iexact, istartswith) - project\_\_region_id (gt, gte, in, isnull, lt, lte, range) - project\_\_reseller_id (gt, gte, in, isnull, lt, lte, range) - state (gt, gte, in, isnull, lt, lte, range) - updated (gt, gte, in, isnull, lt, lte, range)

To search, simply add `?search[field]=value` to include records that match the request, or `?exclude[field]=value` to exclude them. To use modifiers, simply add `?search[field__modifier]` and `?exclude[field__modifier]`

## Ordering

The following fields can be used to order the results of the list;

- name (default) - id - project_id

To reverse the ordering, simply prepend a `-` character to the request. So `?order=field` orders by `field` in ascending order, while `?order=-field` orders in descending order instead.

func (*ComputeGPUService) Update

func (r *ComputeGPUService) Update(ctx context.Context, id int64, body ComputeGPUUpdateParams, opts ...option.RequestOption) (res *ComputeGPU, err error)

Update a GPU resource to change its state. Set state to delete to initiate detachment from the LXD instance.

type ComputeGPUUpdateParam

type ComputeGPUUpdateParam struct {
	// The user-friendly name for the GPU Resource.
	Name param.Opt[string] `json:"name,omitzero"`
	// Change the state of the Compute GPU, triggering the CloudCIX Robot to perform
	// the requested action.
	//
	// To detach a Compute GPU from an lxd Compute Instance, send request to change the
	// state to delete
	State param.Opt[string] `json:"state,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeGPUUpdateParam) MarshalJSON

func (r ComputeGPUUpdateParam) MarshalJSON() (data []byte, err error)

func (*ComputeGPUUpdateParam) UnmarshalJSON

func (r *ComputeGPUUpdateParam) UnmarshalJSON(data []byte) error

type ComputeGPUUpdateParams

type ComputeGPUUpdateParams struct {
	ComputeGPUUpdate ComputeGPUUpdateParam
	// contains filtered or unexported fields
}

func (ComputeGPUUpdateParams) MarshalJSON

func (r ComputeGPUUpdateParams) MarshalJSON() (data []byte, err error)

func (*ComputeGPUUpdateParams) UnmarshalJSON

func (r *ComputeGPUUpdateParams) UnmarshalJSON(data []byte) error

type ComputeImage

type ComputeImage struct {
	// The ID of the Image.
	ID int64 `json:"id,required"`
	// The name of the file containing the Image.
	Filename string `json:"filename,required"`
	// Is a unique word to define each Image.
	OsVariant string `json:"os_variant,required"`
	// The name of the Image.
	SKUName string `json:"sku_name,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Filename    respjson.Field
		OsVariant   respjson.Field
		SKUName     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeImage) RawJSON

func (r ComputeImage) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeImage) UnmarshalJSON

func (r *ComputeImage) UnmarshalJSON(data []byte) error

type ComputeImageGetResponseEnvelope added in v0.5.0

type ComputeImageGetResponseEnvelope struct {
	Content ComputeImage `json:"content"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeImageGetResponseEnvelope) RawJSON added in v0.5.0

Returns the unmodified JSON received from the API

func (*ComputeImageGetResponseEnvelope) UnmarshalJSON added in v0.5.0

func (r *ComputeImageGetResponseEnvelope) UnmarshalJSON(data []byte) error

type ComputeImageListParams

type ComputeImageListParams struct {
	// The limit of the number of objects returned per page
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// The field to use for ordering. Possible fields and the default are outlined in
	// the individual method descriptions.
	Order param.Opt[string] `query:"order,omitzero" json:"-"`
	// The page of records to return, assuming `limit` number of records per page.
	Page param.Opt[int64] `query:"page,omitzero" json:"-"`
	// Filter the result to objects that do not match the specified filters. Possible
	// filters are outlined in the individual list method descriptions.
	Exclude any `query:"exclude,omitzero" json:"-"`
	// Filter the result to objects that match the specified filters. Possible filters
	// are outlined in the individual list method descriptions.
	Search any `query:"search,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ComputeImageListParams) URLQuery

func (r ComputeImageListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ComputeImageListParams's query parameters as `url.Values`.

type ComputeImageListResponse

type ComputeImageListResponse struct {
	Metadata ListMetadata   `json:"_metadata"`
	Content  []ComputeImage `json:"content"`
	// Maximum number of records returned per page.
	Count int64 `json:"count"`
	// Page number of the current results.
	Page int64 `json:"page"`
	// Total number of matching records.
	Total int64 `json:"total"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata    respjson.Field
		Content     respjson.Field
		Count       respjson.Field
		Page        respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeImageListResponse) RawJSON

func (r ComputeImageListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeImageListResponse) UnmarshalJSON

func (r *ComputeImageListResponse) UnmarshalJSON(data []byte) error

type ComputeImageService

type ComputeImageService struct {
	Options []option.RequestOption
}

ComputeImageService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewComputeImageService method instead.

func NewComputeImageService

func NewComputeImageService(opts ...option.RequestOption) (r ComputeImageService)

NewComputeImageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ComputeImageService) Get

func (r *ComputeImageService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *ComputeImage, err error)

Retrieve detailed information about a specific operating system image, including its SKU name, filename, and OS variant.

func (*ComputeImageService) List

Retrieve a paginated list of available operating system images. Supports filtering by region, SKU name, and OS variant. Results can be ordered and paginated.

## Filtering

The following fields and modifiers can be used to filter records from the list;

- id (gt, gte, in, isnull, lt, lte, range) - os_variant (in, icontains, iendswith, iexact, istartswith) - region_id (gt, gte, in, isnull, lt, lte, range) - sku_name (in, icontains, iendswith, iexact, istartswith) - type

To search, simply add `?search[field]=value` to include records that match the request, or `?exclude[field]=value` to exclude them. To use modifiers, simply add `?search[field__modifier]` and `?exclude[field__modifier]`

## Ordering

The following fields can be used to order the results of the list;

- sku_name (default) - id

To reverse the ordering, simply prepend a `-` character to the request. So `?order=field` orders by `field` in ascending order, while `?order=-field` orders in descending order instead.

type ComputeInstance

type ComputeInstance struct {
	// The ID of the Compute Instance record
	ID int64 `json:"id,required"`
	// Timestamp, in ISO format, of when the Compute Instance record was created.
	Created string `json:"created,required"`
	// Number of days after a user sets the state of the Compute Instance Resource to
	// Scrub (8) before it is executed by robot.
	GracePeriod int64 `json:"grace_period,required"`
	// Array of the interfaces for the Compute Instance
	Interfaces []ComputeInstanceInterface `json:"interfaces,required"`
	// The metadata details of the Compute Instance
	Metadata ComputeInstanceMetadata `json:"metadata,required"`
	// The human-friendly name given to this Compute Instance
	Name string `json:"name,required"`
	// The id of the Project that this Compute Instance belongs to
	ProjectID int64 `json:"project_id,required"`
	Specs     Bom   `json:"specs,required"`
	// The current state of the Compute Instance
	State string `json:"state,required"`
	// The type of the Compute Instance
	Type string `json:"type,required"`
	// Timestamp, in ISO format, of when the Compute Instance record was last updated.
	Updated string `json:"updated,required"`
	// URL that can be used to run methods in the API associated with the Compute
	// Instance.
	Uri string `json:"uri,required" format:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Created     respjson.Field
		GracePeriod respjson.Field
		Interfaces  respjson.Field
		Metadata    respjson.Field
		Name        respjson.Field
		ProjectID   respjson.Field
		Specs       respjson.Field
		State       respjson.Field
		Type        respjson.Field
		Updated     respjson.Field
		Uri         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeInstance) RawJSON

func (r ComputeInstance) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeInstance) UnmarshalJSON

func (r *ComputeInstance) UnmarshalJSON(data []byte) error

type ComputeInstanceInterface

type ComputeInstanceInterface struct {
	// Indicates if this interface functions as the network gateway for the Compute
	// instance.
	Gateway bool `json:"gateway"`
	// An array of the IPv4 addresses on the Interface.
	Ipv4Addresses []ComputeInstanceInterfaceIpv4Address `json:"ipv4_addresses"`
	// An array of the IPv6 addresses on the Interface.
	Ipv6Addresses []ComputeInstanceInterfaceIpv6Address `json:"ipv6_addresses"`
	// The VLAN assigned to this Interface
	Vlan int64 `json:"vlan"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Gateway       respjson.Field
		Ipv4Addresses respjson.Field
		Ipv6Addresses respjson.Field
		Vlan          respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeInstanceInterface) RawJSON

func (r ComputeInstanceInterface) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeInstanceInterface) UnmarshalJSON

func (r *ComputeInstanceInterface) UnmarshalJSON(data []byte) error

type ComputeInstanceInterfaceIpv4Address

type ComputeInstanceInterfaceIpv4Address struct {
	// The ID of the IP Address record on the Interface.
	ID int64 `json:"id"`
	// The IP address on the Interface.
	Address string `json:"address"`
	// Flag indicating if the IP Address is NATted to a Public IP Address
	Nat bool `json:"nat"`
	// The Public IP address that the address is NATted to.
	PublicIP string `json:"public_ip"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Address     respjson.Field
		Nat         respjson.Field
		PublicIP    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeInstanceInterfaceIpv4Address) RawJSON

Returns the unmodified JSON received from the API

func (*ComputeInstanceInterfaceIpv4Address) UnmarshalJSON

func (r *ComputeInstanceInterfaceIpv4Address) UnmarshalJSON(data []byte) error

type ComputeInstanceInterfaceIpv6Address

type ComputeInstanceInterfaceIpv6Address struct {
	// The ID of the IP Address record on the Interface.
	ID int64 `json:"id"`
	// The IP address on the Interface.
	Address string `json:"address"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Address     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeInstanceInterfaceIpv6Address) RawJSON

Returns the unmodified JSON received from the API

func (*ComputeInstanceInterfaceIpv6Address) UnmarshalJSON

func (r *ComputeInstanceInterfaceIpv6Address) UnmarshalJSON(data []byte) error

type ComputeInstanceListParams

type ComputeInstanceListParams struct {
	// The limit of the number of objects returned per page
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// The field to use for ordering. Possible fields and the default are outlined in
	// the individual method descriptions.
	Order param.Opt[string] `query:"order,omitzero" json:"-"`
	// The page of records to return, assuming `limit` number of records per page.
	Page param.Opt[int64] `query:"page,omitzero" json:"-"`
	// Filter the result to objects that do not match the specified filters. Possible
	// filters are outlined in the individual list method descriptions.
	Exclude any `query:"exclude,omitzero" json:"-"`
	// Filter the result to objects that match the specified filters. Possible filters
	// are outlined in the individual list method descriptions.
	Search any `query:"search,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ComputeInstanceListParams) URLQuery

func (r ComputeInstanceListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ComputeInstanceListParams's query parameters as `url.Values`.

type ComputeInstanceListResponse

type ComputeInstanceListResponse struct {
	Metadata ListMetadata      `json:"_metadata"`
	Content  []ComputeInstance `json:"content"`
	// Maximum number of records returned per page.
	Count int64 `json:"count"`
	// Page number of the current results.
	Page int64 `json:"page"`
	// Total number of matching records.
	Total int64 `json:"total"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata    respjson.Field
		Content     respjson.Field
		Count       respjson.Field
		Page        respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeInstanceListResponse) RawJSON

func (r ComputeInstanceListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeInstanceListResponse) UnmarshalJSON

func (r *ComputeInstanceListResponse) UnmarshalJSON(data []byte) error

type ComputeInstanceMetadata

type ComputeInstanceMetadata struct {
	// DNS server IP addresses for the Compute Instance. Returned if the type is "lxd".
	DNS string `json:"dns"`
	// Primary DNS server IPv4 address for the VM. Returned if the type is "hyperv".
	Dns4 string `json:"dns4"`
	// Primary DNS server IPv6 address for the VM. Returned if the type is "hyperv".
	Dns6 string `json:"dns6"`
	// The name of the instance type. It will be either "container" or "vm". Returned
	// if the type is "lxd".
	InstanceType string `json:"instance_type"`
	// Configuration file to be used by Cloud Init. Returned if the type is "lxd".
	Userdata string `json:"userdata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DNS          respjson.Field
		Dns4         respjson.Field
		Dns6         respjson.Field
		InstanceType respjson.Field
		Userdata     respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The metadata details of the Compute Instance

func (ComputeInstanceMetadata) RawJSON

func (r ComputeInstanceMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeInstanceMetadata) UnmarshalJSON

func (r *ComputeInstanceMetadata) UnmarshalJSON(data []byte) error

type ComputeInstanceNewParams

type ComputeInstanceNewParams struct {
	// Optional. The metadata required to configure in an Compute Instance.
	Metadata ComputeInstanceNewParamsMetadata `json:"metadata,omitzero,required"`
	// The ID of the Project which this Compute Intsance Resource should be in.
	ProjectID int64 `json:"project_id,required"`
	// List of specs (SKUs) for the Compute Instance resource.
	Specs []ComputeInstanceNewParamsSpec `json:"specs,omitzero,required"`
	// The number of days after a Compute Intsance is closed before it is permanently
	// deleted.
	GracePeriod param.Opt[int64] `json:"grace_period,omitzero"`
	// The user-friendly name for the Compute Intsance type. If not sent and the type
	// is "lxd", it will default to the name 'LXD'. If not sent and the type is
	// "hyperv", it will default to the name 'HyperV'.
	Name param.Opt[string] `json:"name,omitzero"`
	// The type of Compute Instance to create. Valid options are:
	//
	// - "hyperv"
	// - "lxd"
	Type param.Opt[string] `json:"type,omitzero"`
	// Optional. A list of network interfaces that represent the interfaces that will
	// be configured on the LXD instance.
	Interfaces []ComputeInstanceNewParamsInterface `json:"interfaces,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeInstanceNewParams) MarshalJSON

func (r ComputeInstanceNewParams) MarshalJSON() (data []byte, err error)

func (*ComputeInstanceNewParams) UnmarshalJSON

func (r *ComputeInstanceNewParams) UnmarshalJSON(data []byte) error

type ComputeInstanceNewParamsInterface

type ComputeInstanceNewParamsInterface struct {
	// Flag representing if this interface will be the Gateway Interface to the Public
	// Internet.
	Gateway param.Opt[bool] `json:"gateway,omitzero"`
	// A list of IPv4 address objects to be assigned to this interface. All addresses
	// in this list must be from the same network.
	Ipv4Addresses []ComputeInstanceNewParamsInterfaceIpv4Address `json:"ipv4_addresses,omitzero"`
	// A list of IPv6 address objects to be assigned to this interface. All addresses
	// in this list must be from the same network as the `ipv4_addresses`.
	Ipv6Addresses []ComputeInstanceNewParamsInterfaceIpv6Address `json:"ipv6_addresses,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeInstanceNewParamsInterface) MarshalJSON

func (r ComputeInstanceNewParamsInterface) MarshalJSON() (data []byte, err error)

func (*ComputeInstanceNewParamsInterface) UnmarshalJSON

func (r *ComputeInstanceNewParamsInterface) UnmarshalJSON(data []byte) error

type ComputeInstanceNewParamsInterfaceIpv4Address

type ComputeInstanceNewParamsInterfaceIpv4Address struct {
	// An RFC1918 IPv4 address to be configured on this interface on the Compute
	// Instance instance.
	Address param.Opt[string] `json:"address,omitzero"`
	// Optional, Flag indicating if this address should be NATted to a Public IP
	// Address. If not sent, it will default to False.
	Nat param.Opt[bool] `json:"nat,omitzero"`
	// Public IP
	PublicIP param.Opt[string] `json:"public_ip,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeInstanceNewParamsInterfaceIpv4Address) MarshalJSON

func (r ComputeInstanceNewParamsInterfaceIpv4Address) MarshalJSON() (data []byte, err error)

func (*ComputeInstanceNewParamsInterfaceIpv4Address) UnmarshalJSON

func (r *ComputeInstanceNewParamsInterfaceIpv4Address) UnmarshalJSON(data []byte) error

type ComputeInstanceNewParamsInterfaceIpv6Address

type ComputeInstanceNewParamsInterfaceIpv6Address struct {
	// An IPv6 address to be configured on this interface on the Compute Instance
	// instance.
	Address param.Opt[string] `json:"address,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeInstanceNewParamsInterfaceIpv6Address) MarshalJSON

func (r ComputeInstanceNewParamsInterfaceIpv6Address) MarshalJSON() (data []byte, err error)

func (*ComputeInstanceNewParamsInterfaceIpv6Address) UnmarshalJSON

func (r *ComputeInstanceNewParamsInterfaceIpv6Address) UnmarshalJSON(data []byte) error

type ComputeInstanceNewParamsMetadata

type ComputeInstanceNewParamsMetadata struct {
	// Optional. A string containing IP Addresses, separated by commas, that represent
	// the DNS servers that the Compute Instance will use.
	DNS param.Opt[string] `json:"dns,omitzero"`
	// Optional, The Compute Instance instance type of the VM. Valid options are
	// "container" or "virtual-machine". If not sent it will default to "container".
	InstanceType param.Opt[string] `json:"instance_type,omitzero"`
	// Cloud Init allows Mime Multi-part messages, or files that start with a given set
	// of strings. It is a requirement to configure at minimum one user with a password
	// or ssh key that is in the sudo group.
	//
	// Reference: https://cloudinit.readthedocs.io/en/latest/explanation/format.html
	//
	// A hashed password can be generated using `openssl passwd -6 'yourpassword'`
	//
	// Example:
	//
	// “`yaml
	// #cloud-config
	// users:
	//   - name: administrator
	//     groups: sudo
	//     shell: /bin/bash
	//     lock_passwd: false
	//     passwd: < HASHED PASWWORD >
	//     ssh_authorized_keys:
	//   - < HASHED PASWWORD >
	//
	// chpasswd:
	//
	//	expire: false
	//
	// ssh_pwauth: true
	// “`
	Userdata param.Opt[string] `json:"userdata,omitzero"`
	// contains filtered or unexported fields
}

Optional. The metadata required to configure in an Compute Instance.

func (ComputeInstanceNewParamsMetadata) MarshalJSON

func (r ComputeInstanceNewParamsMetadata) MarshalJSON() (data []byte, err error)

func (*ComputeInstanceNewParamsMetadata) UnmarshalJSON

func (r *ComputeInstanceNewParamsMetadata) UnmarshalJSON(data []byte) error

type ComputeInstanceNewParamsSpec

type ComputeInstanceNewParamsSpec struct {
	// The quantity of the SKU to configure the Compute Instance instance with.
	Quantity param.Opt[int64] `json:"quantity,omitzero"`
	// The name of the SKU to configure on the Compute Instance instacne
	SKUName param.Opt[string] `json:"sku_name,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeInstanceNewParamsSpec) MarshalJSON

func (r ComputeInstanceNewParamsSpec) MarshalJSON() (data []byte, err error)

func (*ComputeInstanceNewParamsSpec) UnmarshalJSON

func (r *ComputeInstanceNewParamsSpec) UnmarshalJSON(data []byte) error

type ComputeInstanceResponse

type ComputeInstanceResponse struct {
	Content ComputeInstance `json:"content"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeInstanceResponse) RawJSON

func (r ComputeInstanceResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeInstanceResponse) UnmarshalJSON

func (r *ComputeInstanceResponse) UnmarshalJSON(data []byte) error

type ComputeInstanceService

type ComputeInstanceService struct {
	Options []option.RequestOption
}

ComputeInstanceService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewComputeInstanceService method instead.

func NewComputeInstanceService

func NewComputeInstanceService(opts ...option.RequestOption) (r ComputeInstanceService)

NewComputeInstanceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ComputeInstanceService) Get

Retrieve detailed information about a specific compute instance, including its type (LXD or Hyper-V), resource specifications, network interfaces, OS image, current state, and project information.

func (*ComputeInstanceService) List

Retrieve a paginated list of compute instances (LXD and/or Hyper-V) across your projects. Supports filtering by type, project, state, name, and other attributes. Results can be ordered and paginated.

## Filtering

The following fields and modifiers can be used to filter records from the list;

- created (gt, gte, in, isnull, lt, lte, range) - id (gt, gte, in, isnull, lt, lte, range) - name (in, icontains, iendswith, iexact, istartswith) - project_id (gt, gte, in, isnull, lt, lte, range) - project\_\_address_id (gt, gte, in, isnull, lt, lte, range) - project\_\_name (in, icontains, iendswith, iexact, istartswith) - project\_\_region_id (gt, gte, in, isnull, lt, lte, range) - project\_\_reseller_id (gt, gte, in, isnull, lt, lte, range) - state (gt, gte, in, isnull, lt, lte, range) - type - updated (gt, gte, in, isnull, lt, lte, range)

To search, simply add `?search[field]=value` to include records that match the request, or `?exclude[field]=value` to exclude them. To use modifiers, simply add `?search[field__modifier]` and `?exclude[field__modifier]`

## Ordering

The following fields can be used to order the results of the list;

- name (default) - id - project_id - state

To reverse the ordering, simply prepend a `-` character to the request. So `?order=field` orders by `field` in ascending order, while `?order=-field` orders in descending order instead.

func (*ComputeInstanceService) New

Create a new compute instance (LXD or Hyper-V). Specify the instance type, project, OS image, resource specifications (SKUs for CPU, RAM, storage), and network interfaces. The instance will be provisioned and started automatically.

func (*ComputeInstanceService) Update

Update a compute instance to modify its configuration or change its state. You can update resource specifications (CPU, RAM, storage), network interfaces, or change the instance state (stop, restart, delete, update_running, update_stopped).

type ComputeInstanceUpdateInterfaceIpv4AddressParam

type ComputeInstanceUpdateInterfaceIpv4AddressParam struct {
	// An RFC1918 IPv4 address to be configured on this interface on the Compute
	// Instance instance.
	Address param.Opt[string] `json:"address,omitzero"`
	// Optional, Flag indicating if this address should be NATted to a Public IP
	// Address. If not sent, it will default to False.
	Nat param.Opt[bool] `json:"nat,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeInstanceUpdateInterfaceIpv4AddressParam) MarshalJSON

func (r ComputeInstanceUpdateInterfaceIpv4AddressParam) MarshalJSON() (data []byte, err error)

func (*ComputeInstanceUpdateInterfaceIpv4AddressParam) UnmarshalJSON

type ComputeInstanceUpdateInterfaceIpv6AddressParam

type ComputeInstanceUpdateInterfaceIpv6AddressParam struct {
	// An IPv6 address to be configured on this interface on the Compute Instance
	// instance.
	Address param.Opt[string] `json:"address,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeInstanceUpdateInterfaceIpv6AddressParam) MarshalJSON

func (r ComputeInstanceUpdateInterfaceIpv6AddressParam) MarshalJSON() (data []byte, err error)

func (*ComputeInstanceUpdateInterfaceIpv6AddressParam) UnmarshalJSON

type ComputeInstanceUpdateInterfaceParam

type ComputeInstanceUpdateInterfaceParam struct {
	// Flag representing if this interface will be the Gateway Interface to the Public
	// Internet.
	Gateway param.Opt[bool] `json:"gateway,omitzero"`
	// A list of IPv4 address objects to be assigned to this interface. All addresses
	// in this list must be from the same network.
	Ipv4Addresses []ComputeInstanceUpdateInterfaceIpv4AddressParam `json:"ipv4_addresses,omitzero"`
	// A list of IPv6 address objects to be assigned to this interface. All addresses
	// in this list must be from the same network as the `ipv4_addresses`.
	Ipv6Addresses []ComputeInstanceUpdateInterfaceIpv6AddressParam `json:"ipv6_addresses,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeInstanceUpdateInterfaceParam) MarshalJSON

func (r ComputeInstanceUpdateInterfaceParam) MarshalJSON() (data []byte, err error)

func (*ComputeInstanceUpdateInterfaceParam) UnmarshalJSON

func (r *ComputeInstanceUpdateInterfaceParam) UnmarshalJSON(data []byte) error

type ComputeInstanceUpdateMetadataParam

type ComputeInstanceUpdateMetadataParam struct {
	// Optional. A string containing IP Addresses, separated by commas, that represent
	// the DNS servers that the Compute Instance will use.
	DNS param.Opt[string] `json:"dns,omitzero"`
	// Optional, The Compute Instance instance type of the VM. Valid options are
	// "container" or "virtual-machine". If not sent it will default to "container".
	InstanceType param.Opt[string] `json:"instance_type,omitzero"`
	// Cloud Init allows Mime Multi-part messages, or files that start with a given set
	// of strings. It is a requirement to configure at minimum one user with a password
	// or ssh key that is in the sudo group.
	//
	// Reference: https://cloudinit.readthedocs.io/en/latest/explanation/format.html
	//
	// A hashed password can be generated using `openssl passwd -6 'yourpassword'`
	//
	// Example:
	//
	// “`yaml
	// #cloud-config
	// users:
	//   - name: administrator
	//     groups: sudo
	//     shell: /bin/bash
	//     lock_passwd: false
	//     passwd: < HASHED PASWWORD >
	//     ssh_authorized_keys:
	//   - < HASHED PASWWORD >
	//
	// chpasswd:
	//
	//	expire: false
	//
	// ssh_pwauth: true
	// “`
	Userdata param.Opt[string] `json:"userdata,omitzero"`
	// contains filtered or unexported fields
}

Optional. The metadata required to configure in an Compute Instance.

func (ComputeInstanceUpdateMetadataParam) MarshalJSON

func (r ComputeInstanceUpdateMetadataParam) MarshalJSON() (data []byte, err error)

func (*ComputeInstanceUpdateMetadataParam) UnmarshalJSON

func (r *ComputeInstanceUpdateMetadataParam) UnmarshalJSON(data []byte) error

type ComputeInstanceUpdateParam

type ComputeInstanceUpdateParam struct {
	// Optional. The metadata required to configure in an Compute Instance.
	Metadata ComputeInstanceUpdateMetadataParam `json:"metadata,omitzero,required"`
	// List of specs (SKUs) for the Compute Instance resource.
	Specs []ComputeInstanceUpdateSpecParam `json:"specs,omitzero,required"`
	// The number of days after a Compute Intsance is closed before it is permanently
	// deleted.
	GracePeriod param.Opt[int64] `json:"grace_period,omitzero"`
	// The user-friendly name for the Compute Intsance type. If not sent and the type
	// is "lxd", it will default to the name 'LXD'. If not sent and the type is
	// "hyperv", it will default to the name 'VM HyperV'.
	Name param.Opt[string] `json:"name,omitzero"`
	// Change the state of the Compute Instance, triggering the CloudCIX Robot to
	// perform the requested action. Users can only request state changes from certain
	// current states, with specific allowed target states:
	//
	// - running -> stop, delete, or update_running
	// - stopped -> restart, delete, or update_stopped
	// - delete_queue -> restart or stop
	State param.Opt[string] `json:"state,omitzero"`
	// Optional. A list of network interfaces that represent the interfaces that will
	// be configured on the LXD instance.
	Interfaces []ComputeInstanceUpdateInterfaceParam `json:"interfaces,omitzero"`
	// contains filtered or unexported fields
}

The properties Metadata, Specs are required.

func (ComputeInstanceUpdateParam) MarshalJSON

func (r ComputeInstanceUpdateParam) MarshalJSON() (data []byte, err error)

func (*ComputeInstanceUpdateParam) UnmarshalJSON

func (r *ComputeInstanceUpdateParam) UnmarshalJSON(data []byte) error

type ComputeInstanceUpdateParams

type ComputeInstanceUpdateParams struct {
	ComputeInstanceUpdate ComputeInstanceUpdateParam
	// contains filtered or unexported fields
}

func (ComputeInstanceUpdateParams) MarshalJSON

func (r ComputeInstanceUpdateParams) MarshalJSON() (data []byte, err error)

func (*ComputeInstanceUpdateParams) UnmarshalJSON

func (r *ComputeInstanceUpdateParams) UnmarshalJSON(data []byte) error

type ComputeInstanceUpdateSpecParam

type ComputeInstanceUpdateSpecParam struct {
	// The quantity of the SKU to configure the Compute Instance instance with.
	Quantity param.Opt[int64] `json:"quantity,omitzero"`
	// The name of the SKU to configure on the Compute Instance instacne
	SKUName param.Opt[string] `json:"sku_name,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeInstanceUpdateSpecParam) MarshalJSON

func (r ComputeInstanceUpdateSpecParam) MarshalJSON() (data []byte, err error)

func (*ComputeInstanceUpdateSpecParam) UnmarshalJSON

func (r *ComputeInstanceUpdateSpecParam) UnmarshalJSON(data []byte) error

type ComputeService

type ComputeService struct {
	Options   []option.RequestOption
	Backups   ComputeBackupService
	GPUs      ComputeGPUService
	Images    ComputeImageService
	Instances ComputeInstanceService
	Snapshots ComputeSnapshotService
}

ComputeService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewComputeService method instead.

func NewComputeService

func NewComputeService(opts ...option.RequestOption) (r ComputeService)

NewComputeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type ComputeSnapshot

type ComputeSnapshot struct {
	// The ID of the Compute Snapshots record
	ID int64 `json:"id,required"`
	// Timestamp, in ISO format, of when the Compute Snapshots record was created.
	Created string `json:"created,required"`
	// The Compute Instance the Compute Snapshot record is of.
	Instance ComputeSnapshotInstance `json:"instance,required"`
	// The metadata details of the The metadata details of the "hyperv" Compute
	// Snapshot. Returned if the type is "hyperv".
	Metadata ComputeSnapshotMetadata `json:"metadata,required"`
	// The user-friendly name given to this Compute Snapshots instance
	Name string `json:"name,required"`
	// The id of the Project that this Compute Snapshots belongs to
	ProjectID int64 `json:"project_id,required"`
	// An array of the specs for the Compute Snapshots
	Specs []Bom `json:"specs,required"`
	// The current state of the Compute Snapshots
	State string `json:"state,required"`
	// The type of the Compute Snapshots
	Type string `json:"type,required"`
	// Timestamp, in ISO format, of when the Compute Snapshots record was last updated.
	Updated string `json:"updated,required"`
	// URL that can be used to run methods in the API associated with the Compute
	// Snapshots instance.
	Uri string `json:"uri,required" format:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Created     respjson.Field
		Instance    respjson.Field
		Metadata    respjson.Field
		Name        respjson.Field
		ProjectID   respjson.Field
		Specs       respjson.Field
		State       respjson.Field
		Type        respjson.Field
		Updated     respjson.Field
		Uri         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeSnapshot) RawJSON

func (r ComputeSnapshot) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeSnapshot) UnmarshalJSON

func (r *ComputeSnapshot) UnmarshalJSON(data []byte) error

type ComputeSnapshotInstance

type ComputeSnapshotInstance struct {
	// The ID of the Compute Instance the Compute Snapshot is of.
	ID int64 `json:"id"`
	// The user-friendly name of the Compute Instance the Compute Snapshot is of.
	Name string `json:"name"`
	// The current state of the Compute Instance the Compute Snapshot is of.
	State string `json:"state"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		State       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Compute Instance the Compute Snapshot record is of.

func (ComputeSnapshotInstance) RawJSON

func (r ComputeSnapshotInstance) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeSnapshotInstance) UnmarshalJSON

func (r *ComputeSnapshotInstance) UnmarshalJSON(data []byte) error

type ComputeSnapshotListParams

type ComputeSnapshotListParams struct {
	// The limit of the number of objects returned per page
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// The field to use for ordering. Possible fields and the default are outlined in
	// the individual method descriptions.
	Order param.Opt[string] `query:"order,omitzero" json:"-"`
	// The page of records to return, assuming `limit` number of records per page.
	Page param.Opt[int64] `query:"page,omitzero" json:"-"`
	// Filter the result to objects that do not match the specified filters. Possible
	// filters are outlined in the individual list method descriptions.
	Exclude any `query:"exclude,omitzero" json:"-"`
	// Filter the result to objects that match the specified filters. Possible filters
	// are outlined in the individual list method descriptions.
	Search any `query:"search,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ComputeSnapshotListParams) URLQuery

func (r ComputeSnapshotListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ComputeSnapshotListParams's query parameters as `url.Values`.

type ComputeSnapshotListResponse

type ComputeSnapshotListResponse struct {
	Metadata ListMetadata      `json:"_metadata"`
	Content  []ComputeSnapshot `json:"content"`
	// Maximum number of records returned per page.
	Count int64 `json:"count"`
	// Page number of the current results.
	Page int64 `json:"page"`
	// Total number of matching records.
	Total int64 `json:"total"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata    respjson.Field
		Content     respjson.Field
		Count       respjson.Field
		Page        respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeSnapshotListResponse) RawJSON

func (r ComputeSnapshotListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeSnapshotListResponse) UnmarshalJSON

func (r *ComputeSnapshotListResponse) UnmarshalJSON(data []byte) error

type ComputeSnapshotMetadata

type ComputeSnapshotMetadata struct {
	// Indicates if the "hyperv" Compute Snapshot is currently active.
	Active bool `json:"active"`
	// Indicates if the "hyperv" Compute Snapshot should remove the subtree when
	// deleted.
	RemoveSubtree bool `json:"remove_subtree"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Active        respjson.Field
		RemoveSubtree respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The metadata details of the The metadata details of the "hyperv" Compute Snapshot. Returned if the type is "hyperv".

func (ComputeSnapshotMetadata) RawJSON

func (r ComputeSnapshotMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeSnapshotMetadata) UnmarshalJSON

func (r *ComputeSnapshotMetadata) UnmarshalJSON(data []byte) error

type ComputeSnapshotNewParams

type ComputeSnapshotNewParams struct {
	// The id of the Compute Instance the Compute Snapshot is to be taken of.
	InstanceID int64 `json:"instance_id,required"`
	// The ID of the User's Project into which this new Compute Snapshots should be
	// added.
	ProjectID int64 `json:"project_id,required"`
	// The user-friendly name for the Compute Snapshot Resource. If not sent, it will
	// default to the name "Compute Snapshot"
	Name param.Opt[string] `json:"name,omitzero"`
	// The type of Compute Snapshot to create. Valid options are:
	//
	// - "hyperv"
	// - "lxd"
	Type param.Opt[string] `json:"type,omitzero"`
	// contains filtered or unexported fields
}

func (ComputeSnapshotNewParams) MarshalJSON

func (r ComputeSnapshotNewParams) MarshalJSON() (data []byte, err error)

func (*ComputeSnapshotNewParams) UnmarshalJSON

func (r *ComputeSnapshotNewParams) UnmarshalJSON(data []byte) error

type ComputeSnapshotResponse

type ComputeSnapshotResponse struct {
	Content ComputeSnapshot `json:"content"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ComputeSnapshotResponse) RawJSON

func (r ComputeSnapshotResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ComputeSnapshotResponse) UnmarshalJSON

func (r *ComputeSnapshotResponse) UnmarshalJSON(data []byte) error

type ComputeSnapshotService

type ComputeSnapshotService struct {
	Options []option.RequestOption
}

ComputeSnapshotService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewComputeSnapshotService method instead.

func NewComputeSnapshotService

func NewComputeSnapshotService(opts ...option.RequestOption) (r ComputeSnapshotService)

NewComputeSnapshotService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ComputeSnapshotService) Get

Retrieve detailed information about a specific snapshot, including its type (LXD or Hyper-V), associated instance, project, creation timestamp, and current state.

func (*ComputeSnapshotService) List

Retrieve a paginated list of instance snapshots (LXD and/or Hyper-V) across your projects. Supports filtering by type, project, instance, state, and other attributes. Results can be ordered and paginated.

## Filtering

The following fields and modifiers can be used to filter records from the list;

- resource_links\_\_contra_resource_id (gt, gte, in, isnull, lt, lte, range) - created (gt, gte, in, isnull, lt, lte, range) - id (gt, gte, in, isnull, lt, lte, range) - name (in, icontains, iendswith, iexact, istartswith) - project_id (gt, gte, in, isnull, lt, lte, range) - project\_\_address_id (gt, gte, in, isnull, lt, lte, range) - project\_\_name (in, icontains, iendswith, iexact, istartswith) - project\_\_region_id (gt, gte, in, isnull, lt, lte, range) - project\_\_reseller_id (gt, gte, in, isnull, lt, lte, range) - state (gt, gte, in, isnull, lt, lte, range) - type - updated (gt, gte, in, isnull, lt, lte, range)

To search, simply add `?search[field]=value` to include records that match the request, or `?exclude[field]=value` to exclude them. To use modifiers, simply add `?search[field__modifier]` and `?exclude[field__modifier]`

## Ordering

The following fields can be used to order the results of the list;

- name (default) - id - project_id - state

To reverse the ordering, simply prepend a `-` character to the request. So `?order=field` orders by `field` in ascending order, while `?order=-field` orders in descending order instead.

func (*ComputeSnapshotService) New

Create a new snapshot from a running compute instance (LXD or Hyper-V). Specify the snapshot type, instance to snapshot, and project. The instance must be in a running state to create a snapshot.

func (*ComputeSnapshotService) Update

Update a snapshot to change its name or state. Set state to delete to initiate snapshot deletion and free up storage space.

type ComputeSnapshotUpdateParam

type ComputeSnapshotUpdateParam struct {
	// Change the state of the Compute Snapshot, triggering the CloudCIX Robot to
	// perform the requested action. Users can only request state changes from certain
	// current states:
	//
	// - running -> update_running or delete
	State string `json:"state,required"`
	// The user-friendly name for the Compute Snapshots Resource. If not sent, it will
	// default to the name current name.
	Name param.Opt[string] `json:"name,omitzero"`
	// contains filtered or unexported fields
}

The property State is required.

func (ComputeSnapshotUpdateParam) MarshalJSON

func (r ComputeSnapshotUpdateParam) MarshalJSON() (data []byte, err error)

func (*ComputeSnapshotUpdateParam) UnmarshalJSON

func (r *ComputeSnapshotUpdateParam) UnmarshalJSON(data []byte) error

type ComputeSnapshotUpdateParams

type ComputeSnapshotUpdateParams struct {
	ComputeSnapshotUpdate ComputeSnapshotUpdateParam
	// contains filtered or unexported fields
}

func (ComputeSnapshotUpdateParams) MarshalJSON

func (r ComputeSnapshotUpdateParams) MarshalJSON() (data []byte, err error)

func (*ComputeSnapshotUpdateParams) UnmarshalJSON

func (r *ComputeSnapshotUpdateParams) UnmarshalJSON(data []byte) error

type Error

type Error = apierror.Error

type ListMetadata

type ListMetadata struct {
	// The value of limit that was used for the request
	Limit int64 `json:"limit,required"`
	// The value of order that was used for the request
	Order string `json:"order,required"`
	// The value of page that was used for the request
	Page int64 `json:"page,required"`
	// The total number of records found for the given search
	TotalRecords int64 `json:"total_records,required"`
	// A list of warnings generated during execution. Any invalid search filters used
	// will cause a warning to be generated, for example.
	Warnings []string `json:"warnings,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Limit        respjson.Field
		Order        respjson.Field
		Page         respjson.Field
		TotalRecords respjson.Field
		Warnings     respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ListMetadata) RawJSON

func (r ListMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*ListMetadata) UnmarshalJSON

func (r *ListMetadata) UnmarshalJSON(data []byte) error

type NetworkFirewall

type NetworkFirewall struct {
	// The ID of the Network Firewall record
	ID int64 `json:"id,required"`
	// Timestamp, in ISO format, of when the Network Firewall record was created.
	Created string `json:"created,required"`
	// The user-friendly name given to this Network Firewall instance
	Name string `json:"name,required"`
	// The id of the Project that this Network Firewall belongs to
	ProjectID int64 `json:"project_id,required"`
	// List of rules for this Network Firewall.
	Rules []NetworkFirewallRule `json:"rules,required"`
	// An array of the specs for the Network Firewall
	Specs []Bom `json:"specs,required"`
	// The current state of the Network Firewall
	State string `json:"state,required"`
	// The type of the Network Firewall
	Type string `json:"type,required"`
	// Timestamp, in ISO format, of when the Network Firewall record was last updated.
	Updated string `json:"updated,required"`
	// URL that can be used to run methods in the API associated with the Network
	// Firewall instance.
	Uri string `json:"uri,required" format:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Created     respjson.Field
		Name        respjson.Field
		ProjectID   respjson.Field
		Rules       respjson.Field
		Specs       respjson.Field
		State       respjson.Field
		Type        respjson.Field
		Updated     respjson.Field
		Uri         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkFirewall) RawJSON

func (r NetworkFirewall) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkFirewall) UnmarshalJSON

func (r *NetworkFirewall) UnmarshalJSON(data []byte) error

type NetworkFirewallListParams

type NetworkFirewallListParams struct {
	// The limit of the number of objects returned per page
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// The field to use for ordering. Possible fields and the default are outlined in
	// the individual method descriptions.
	Order param.Opt[string] `query:"order,omitzero" json:"-"`
	// The page of records to return, assuming `limit` number of records per page.
	Page param.Opt[int64] `query:"page,omitzero" json:"-"`
	// Filter the result to objects that do not match the specified filters. Possible
	// filters are outlined in the individual list method descriptions.
	Exclude any `query:"exclude,omitzero" json:"-"`
	// Filter the result to objects that match the specified filters. Possible filters
	// are outlined in the individual list method descriptions.
	Search any `query:"search,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (NetworkFirewallListParams) URLQuery

func (r NetworkFirewallListParams) URLQuery() (v url.Values, err error)

URLQuery serializes NetworkFirewallListParams's query parameters as `url.Values`.

type NetworkFirewallListResponse

type NetworkFirewallListResponse struct {
	Metadata ListMetadata      `json:"_metadata"`
	Content  []NetworkFirewall `json:"content"`
	// Maximum number of records returned per page.
	Count int64 `json:"count"`
	// Page number of the current results.
	Page int64 `json:"page"`
	// Total number of matching records.
	Total int64 `json:"total"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata    respjson.Field
		Content     respjson.Field
		Count       respjson.Field
		Page        respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkFirewallListResponse) RawJSON

func (r NetworkFirewallListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkFirewallListResponse) UnmarshalJSON

func (r *NetworkFirewallListResponse) UnmarshalJSON(data []byte) error

type NetworkFirewallNewParams

type NetworkFirewallNewParams struct {
	// The ID of the Project which this Network Firewall should be created in. Each
	// project can have exactly ONE project firewall and ONE geo firewall maximum.
	ProjectID int64 `json:"project_id,required"`
	// The user-friendly name for the Network Firewall type. If not sent and the type
	// is "geo", it will default to the name 'Geofilter'. If not sent and the type is
	// "project", it will default to the name 'Firewall'.
	Name param.Opt[string] `json:"name,omitzero"`
	// The type of Network Firewall to create. Each project can have exactly ONE of
	// each type. Valid options are:
	//
	//   - "geo" A Geofilter Firewall to allow or block traffic from/to specific
	//     countries using global IP Address Groups (member_id = 0) that contain country
	//     IP ranges.
	//   - "project" A Project Firewall with fine-grained rules for specific
	//     source/destination IPs, ports, and protocols. Can reference your member's IP
	//     Address Groups using '@groupname' syntax.
	Type param.Opt[string] `json:"type,omitzero"`
	// A list of the rules to be configured in the Network Firewall type. They will be
	// applied in the order they are sent.
	Rules []NetworkFirewallNewParamsRule `json:"rules,omitzero"`
	// contains filtered or unexported fields
}

func (NetworkFirewallNewParams) MarshalJSON

func (r NetworkFirewallNewParams) MarshalJSON() (data []byte, err error)

func (*NetworkFirewallNewParams) UnmarshalJSON

func (r *NetworkFirewallNewParams) UnmarshalJSON(data []byte) error

type NetworkFirewallNewParamsRule

type NetworkFirewallNewParamsRule struct {
	// Optional. A flag that states whether traffic matching this rule should be
	// allowed to pass through the Network Firewall Type. If not sent, it wlll default
	// to False.
	Allow param.Opt[bool] `json:"allow,omitzero"`
	// Optional description of what the rule is for.
	Description param.Opt[string] `json:"description,omitzero"`
	// Required if type is "project".
	//
	// A Subnet, IP Address or the name of a Project Network IP Group with `@`
	// prepended that indicates what the destination of traffic should be in order to
	// match this rule.
	//
	// It can also be just a `*` character, which will indicate that any destination is
	// allowed.
	//
	// Both source and destination must use the same IP Version.
	Destination param.Opt[string] `json:"destination,omitzero"`
	// Required if type is "geo".
	//
	// The name of a Geo Network IP Group with `@` prepended.
	GroupName param.Opt[string] `json:"group_name,omitzero"`
	// Optional. Flag indicating the direction of traffic this rule applies to:
	//
	// - true: Inbound rule (traffic coming INTO your project/network)
	// - false: Outbound rule (traffic going OUT FROM your project/network)
	//
	// If not sent, it will default to False (outbound rule).
	Inbound param.Opt[bool] `json:"inbound,omitzero"`
	// Required if type is "project".
	//
	// A string that indicates what the destination port of traffic should be in order
	// to match this rule. The range for valid ports are between 1 - 65535 inclusive.
	//
	// Allowed Values: `22`: Only port 22 is allowed `20-25`: Ports between 20 and 25
	// inclusive are allowed `22,24-25,444`: Combination of one or more single port and
	// single port ranges with comma separated are allowed “: No port is required if
	// the protocol is 'any' or 'icmp'
	Port param.Opt[string] `json:"port,omitzero"`
	// Required if type is "project".
	//
	// A string that indicates what protocol traffic should be using in order to match
	// this rule. The supported protocols are; - 'icmp' - 'tcp' - 'udp'
	//
	// The special case protocol 'any' is allowed and allows any protocol through.
	Protocol param.Opt[string] `json:"protocol,omitzero"`
	// Required if type is "project".
	//
	// A Subnet, IP Address or the name of a Project Network IP Group with `@`
	// prepended that indicates what the destination of traffic should be in order to
	// match this rule.
	//
	// It can also be just a `*` character, which will indicate that any source is
	// allowed.
	//
	// Both source and destination must use the same IP Version.
	Source param.Opt[string] `json:"source,omitzero"`
	// Required if type is "project".
	//
	// A zone is a logical grouping of network interfaces or traffic sources that share
	// the same trust level. Firewall rules are defined in terms of traffic flows,
	// simplifying policy management. If not sent, it will default to `Public`.
	//
	// Supported options are:
	//
	//   - `Public`: Represents connections between the CloudCIX Project networks and the
	//     public internet.
	//   - `Private`: Represents connections between the CloudCIX Project networks.
	//   - `VPNS2S`: Represents connections between the CloudCIX Project Networks and the
	//     Customers' on-premises network.
	Zone param.Opt[string] `json:"zone,omitzero"`
	// contains filtered or unexported fields
}

func (NetworkFirewallNewParamsRule) MarshalJSON

func (r NetworkFirewallNewParamsRule) MarshalJSON() (data []byte, err error)

func (*NetworkFirewallNewParamsRule) UnmarshalJSON

func (r *NetworkFirewallNewParamsRule) UnmarshalJSON(data []byte) error

type NetworkFirewallResponse

type NetworkFirewallResponse struct {
	Content NetworkFirewall `json:"content"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkFirewallResponse) RawJSON

func (r NetworkFirewallResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkFirewallResponse) UnmarshalJSON

func (r *NetworkFirewallResponse) UnmarshalJSON(data []byte) error

type NetworkFirewallRule

type NetworkFirewallRule struct {
	// True to allow traffic, False to deny.
	Allow bool `json:"allow"`
	// Optional description of the rule. Returned if the type is "project".
	Description string `json:"description"`
	// Destination address or subnet. Use \* for any. Returned if the type is
	// "project".
	Destination string `json:"destination"`
	// The name of the Geo IP Address Group. Returned if the type is "geo".
	GroupName string `json:"group_name"`
	// True if the rule applies to inbound traffic.
	Inbound bool `json:"inbound"`
	// Order of rule evaluation (lower runs first). Returned if the type is "project".
	Order int64 `json:"order"`
	// Port or port range (e.g. 80, 443, 1000-2000). Not required for ICMP or ANY.
	// Returned if the type is "project".
	Port string `json:"port"`
	// Network protocol (any, icmp, tcp, udp). Returned if the type is "project".
	Protocol string `json:"protocol"`
	// Source address or subnet. Use \* for any. Returned if the type is "project".
	Source string `json:"source"`
	// IP version (4 or 6). Returned if the type is "project".
	Version int64 `json:"version"`
	// The zone in the firewall that the rule is applied to.
	Zone string `json:"zone"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Allow       respjson.Field
		Description respjson.Field
		Destination respjson.Field
		GroupName   respjson.Field
		Inbound     respjson.Field
		Order       respjson.Field
		Port        respjson.Field
		Protocol    respjson.Field
		Source      respjson.Field
		Version     respjson.Field
		Zone        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkFirewallRule) RawJSON

func (r NetworkFirewallRule) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkFirewallRule) UnmarshalJSON

func (r *NetworkFirewallRule) UnmarshalJSON(data []byte) error

type NetworkFirewallService

type NetworkFirewallService struct {
	Options []option.RequestOption
}

NetworkFirewallService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewNetworkFirewallService method instead.

func NewNetworkFirewallService

func NewNetworkFirewallService(opts ...option.RequestOption) (r NetworkFirewallService)

NewNetworkFirewallService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*NetworkFirewallService) Get

Retrieve detailed information about a specific firewall configuration, including its type (project or geo), associated router, complete list of rules, and current state.

func (*NetworkFirewallService) List

Retrieve a paginated list of network firewall configurations across your projects. Supports filtering by type (project or geo), project, state, and other attributes. Results can be ordered and paginated.

## Filtering

The following fields and modifiers can be used to filter records from the list;

- created (gt, gte, in, isnull, lt, lte, range) - id (gt, gte, in, isnull, lt, lte, range) - name (in, icontains, iendswith, iexact, istartswith) - project_id (gt, gte, in, isnull, lt, lte, range) - project\_\_address_id (gt, gte, in, isnull, lt, lte, range) - project\_\_name (in, icontains, iendswith, iexact, istartswith) - project\_\_region_id (gt, gte, in, isnull, lt, lte, range) - project\_\_reseller_id (gt, gte, in, isnull, lt, lte, range) - state (gt, gte, in, isnull, lt, lte, range) - type - updated (gt, gte, in, isnull, lt, lte, range)

To search, simply add `?search[field]=value` to include records that match the request, or `?exclude[field]=value` to exclude them. To use modifiers, simply add `?search[field__modifier]` and `?exclude[field__modifier]`

## Ordering

The following fields can be used to order the results of the list;

- name (default) - id - project_id

To reverse the ordering, simply prepend a `-` character to the request. So `?order=field` orders by `field` in ascending order, while `?order=-field` orders in descending order instead.

func (*NetworkFirewallService) New

Create a new firewall configuration with one or more rules. Specify the firewall type (project for fine-grained rules or geo for country-based filtering), project, router, and the list of rules to apply. Rules are evaluated in the order provided.

func (*NetworkFirewallService) Update

Update a firewall configuration to modify its name, rules, or state. You can replace the entire rule list or change the firewall state to update_running or delete.

type NetworkFirewallUpdateParam

type NetworkFirewallUpdateParam struct {
	// Change the state of the Network Firewall, triggering the CloudCIX Robot to
	// perform the requested action. Users can only request state changes from certain
	// current states:
	//
	// - running -> update_running or delete
	State string `json:"state,required"`
	// The user-friendly name for the Network Firewall type. If not sent, it will
	// default to current name.
	Name param.Opt[string] `json:"name,omitzero"`
	// CRITICAL WARNING: This completely replaces ALL existing firewall rules. Any
	// rules not included in this update will be permanently deleted. You must include
	// the complete list of all rules you want to keep, both existing and new ones.
	//
	// A list of the rules to be configured in the Network Firewall type. They will be
	// applied in the order they are sent.
	Rules []NetworkFirewallUpdateRuleParam `json:"rules,omitzero"`
	// contains filtered or unexported fields
}

The property State is required.

func (NetworkFirewallUpdateParam) MarshalJSON

func (r NetworkFirewallUpdateParam) MarshalJSON() (data []byte, err error)

func (*NetworkFirewallUpdateParam) UnmarshalJSON

func (r *NetworkFirewallUpdateParam) UnmarshalJSON(data []byte) error

type NetworkFirewallUpdateParams

type NetworkFirewallUpdateParams struct {
	NetworkFirewallUpdate NetworkFirewallUpdateParam
	// contains filtered or unexported fields
}

func (NetworkFirewallUpdateParams) MarshalJSON

func (r NetworkFirewallUpdateParams) MarshalJSON() (data []byte, err error)

func (*NetworkFirewallUpdateParams) UnmarshalJSON

func (r *NetworkFirewallUpdateParams) UnmarshalJSON(data []byte) error

type NetworkFirewallUpdateRuleParam

type NetworkFirewallUpdateRuleParam struct {
	// Optional. A flag that states whether traffic matching this rule should be
	// allowed to pass through the Network Firewall Type. If not sent, it wlll default
	// to False.
	Allow param.Opt[bool] `json:"allow,omitzero"`
	// Optional description of what the rule is for.
	Description param.Opt[string] `json:"description,omitzero"`
	// Required if type is "project".
	//
	// A Subnet, IP Address or the name of a Project Network IP Group with `@`
	// prepended that indicates what the destination of traffic should be in order to
	// match this rule.
	//
	// It can also be just a `*` character, which will indicate that any destination is
	// allowed.
	//
	// Both source and destination must use the same IP Version.
	Destination param.Opt[string] `json:"destination,omitzero"`
	// Required if type is "geo".
	//
	// The name of a Geo Network IP Group with `@` prepended.
	GroupName param.Opt[string] `json:"group_name,omitzero"`
	// Optional. Flag indicating the direction of traffic this rule applies to:
	//
	// - true: Inbound rule (traffic coming INTO your project/network)
	// - false: Outbound rule (traffic going OUT FROM your project/network)
	//
	// If not sent, it will default to False (outbound rule).
	Inbound param.Opt[bool] `json:"inbound,omitzero"`
	// Required if type is "project".
	//
	// A string that indicates what the destination port of traffic should be in order
	// to match this rule. The range for valid ports are between 1 - 65535 inclusive.
	//
	// Allowed Values: `22`: Only port 22 is allowed `20-25`: Ports between 20 and 25
	// inclusive are allowed `22,24-25,444`: Combination of one or more single port and
	// single port ranges with comma separated are allowed “: No port is required if
	// the protocol is 'any' or 'icmp'
	Port param.Opt[string] `json:"port,omitzero"`
	// Required if type is "project".
	//
	// A string that indicates what protocol traffic should be using in order to match
	// this rule. The supported protocols are; - 'icmp' - 'tcp' - 'udp'
	//
	// The special case protocol 'any' is allowed and allows any protocol through.
	Protocol param.Opt[string] `json:"protocol,omitzero"`
	// Required if type is "project".
	//
	// A Subnet, IP Address or the name of a Project Network IP Group with `@`
	// prepended that indicates what the destination of traffic should be in order to
	// match this rule.
	//
	// It can also be just a `*` character, which will indicate that any source is
	// allowed.
	//
	// Both source and destination must use the same IP Version.
	Source param.Opt[string] `json:"source,omitzero"`
	// Required if type is "project".
	//
	// A zone is a logical grouping of network interfaces or traffic sources that share
	// the same trust level. Firewall rules are defined in terms of traffic flows,
	// simplifying policy management. If not sent, it will default to `Public`.
	//
	// Supported options are:
	//
	//   - `Public`: Represents connections between the CloudCIX Project networks and the
	//     public internet.
	//   - `Private`: Represents connections between the CloudCIX Project networks.
	//   - `VPNS2S`: Represents connections between the CloudCIX Project Networks and the
	//     Customers' on-premises network.
	Zone param.Opt[string] `json:"zone,omitzero"`
	// contains filtered or unexported fields
}

func (NetworkFirewallUpdateRuleParam) MarshalJSON

func (r NetworkFirewallUpdateRuleParam) MarshalJSON() (data []byte, err error)

func (*NetworkFirewallUpdateRuleParam) UnmarshalJSON

func (r *NetworkFirewallUpdateRuleParam) UnmarshalJSON(data []byte) error

type NetworkIPGroup

type NetworkIPGroup struct {
	// The ID of the Network IP Goup record
	ID int64 `json:"id,required"`
	// An array of CIDR addresses in the Network IP Group.
	Cidrs []string `json:"cidrs,required"`
	// Timestamp, in ISO format, of when the Network IP Group was created.
	Created string `json:"created,required"`
	// The name of the Network IP Group.
	Name string `json:"name,required"`
	// The type of the Network IP Group
	Type string `json:"type,required"`
	// Timestamp, in ISO format, of when the Network IP Group was last updated.
	Updated string `json:"updated,required"`
	// The absolute URL of the Network IP Group record that can be used to perform
	// `Read`, `Update` and `Delete`
	Uri string `json:"uri,required"`
	// The IP Version of the CIDRs in the group.
	Version int64 `json:"version,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Cidrs       respjson.Field
		Created     respjson.Field
		Name        respjson.Field
		Type        respjson.Field
		Updated     respjson.Field
		Uri         respjson.Field
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkIPGroup) RawJSON

func (r NetworkIPGroup) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkIPGroup) UnmarshalJSON

func (r *NetworkIPGroup) UnmarshalJSON(data []byte) error

type NetworkIPGroupListParams

type NetworkIPGroupListParams struct {
	// The limit of the number of objects returned per page
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// The field to use for ordering. Possible fields and the default are outlined in
	// the individual method descriptions.
	Order param.Opt[string] `query:"order,omitzero" json:"-"`
	// The page of records to return, assuming `limit` number of records per page.
	Page param.Opt[int64] `query:"page,omitzero" json:"-"`
	// Filter the result to objects that do not match the specified filters. Possible
	// filters are outlined in the individual list method descriptions.
	Exclude any `query:"exclude,omitzero" json:"-"`
	// Filter the result to objects that match the specified filters. Possible filters
	// are outlined in the individual list method descriptions.
	Search any `query:"search,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (NetworkIPGroupListParams) URLQuery

func (r NetworkIPGroupListParams) URLQuery() (v url.Values, err error)

URLQuery serializes NetworkIPGroupListParams's query parameters as `url.Values`.

type NetworkIPGroupListResponse

type NetworkIPGroupListResponse struct {
	Metadata ListMetadata     `json:"_metadata"`
	Content  []NetworkIPGroup `json:"content"`
	// Maximum number of records returned per page.
	Count int64 `json:"count"`
	// Page number of the current results.
	Page int64 `json:"page"`
	// Total number of matching records.
	Total int64 `json:"total"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata    respjson.Field
		Content     respjson.Field
		Count       respjson.Field
		Page        respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkIPGroupListResponse) RawJSON

func (r NetworkIPGroupListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkIPGroupListResponse) UnmarshalJSON

func (r *NetworkIPGroupListResponse) UnmarshalJSON(data []byte) error

type NetworkIPGroupNewParams

type NetworkIPGroupNewParams struct {
	// An array of CIDR addresses in the IP Address Group. Can include individual IP
	// addresses (e.g., "91.103.3.36") or network ranges (e.g., "90.103.2.0/24"). All
	// addresses must match the specified IP version. Use these groups in firewall
	// rules to allow/block traffic from multiple locations with a single rule.
	Cidrs []string `json:"cidrs,omitzero,required"`
	// The name to be given to the new IP Address Group. Used to identify the group
	// when creating firewall rules or geo-filters. Must start with a letter and
	// contain only letters, numbers, underscores, and hyphens.
	Name string `json:"name,required"`
	// The IP version of the IP Address Group Objects in the IP Address Group. Accepted
	// versions are 4 and 6. If not sent, it will default to 4.
	Version param.Opt[int64] `json:"version,omitzero"`
	// contains filtered or unexported fields
}

func (NetworkIPGroupNewParams) MarshalJSON

func (r NetworkIPGroupNewParams) MarshalJSON() (data []byte, err error)

func (*NetworkIPGroupNewParams) UnmarshalJSON

func (r *NetworkIPGroupNewParams) UnmarshalJSON(data []byte) error

type NetworkIPGroupResponse

type NetworkIPGroupResponse struct {
	Content NetworkIPGroup `json:"content"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkIPGroupResponse) RawJSON

func (r NetworkIPGroupResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkIPGroupResponse) UnmarshalJSON

func (r *NetworkIPGroupResponse) UnmarshalJSON(data []byte) error

type NetworkIPGroupService

type NetworkIPGroupService struct {
	Options []option.RequestOption
}

NetworkIPGroupService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewNetworkIPGroupService method instead.

func NewNetworkIPGroupService

func NewNetworkIPGroupService(opts ...option.RequestOption) (r NetworkIPGroupService)

NewNetworkIPGroupService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*NetworkIPGroupService) Delete

func (r *NetworkIPGroupService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)

Delete an Network IP Group from the system. Only project type Network IP Groups can be updated. Groups currently in use by firewall rules cannot be deleted.

func (*NetworkIPGroupService) Get

func (r *NetworkIPGroupService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *NetworkIPGroup, err error)

Retrieve detailed information about a specific Network IP Group including its name, IP version, and list of CIDR networks.

func (*NetworkIPGroupService) List

Retrieve a paginated list of Network IP Groups.

## Filtering

The following fields and modifiers can be used to filter records from the list;

- created (gt, gte, in, isnull, lt, lte, range) - id (gt, gte, in, isnull, lt, lte, range) - name (in, icontains, iendswith, iexact, istartswith) - type - updated (gt, gte, in, isnull, lt, lte, range) - version (gt, gte, in, isnull, lt, lte, range)

To search, simply add `?search[field]=value` to include records that match the request, or `?exclude[field]=value` to exclude them. To use modifiers, simply add `?search[field__modifier]` and `?exclude[field__modifier]`

## Ordering

The following fields can be used to order the results of the list;

- name (default) - created - updated - version

To reverse the ordering, simply prepend a `-` character to the request. So `?order=field` orders by `field` in ascending order, while `?order=-field` orders in descending order instead.

func (*NetworkIPGroupService) New

Create a new Network IP Group. Specify a name, IP version (IPv4 or IPv6), and a list of CIDR networks to include in the group. Groups can be used in firewall rules for access control. Only project type Network IP Groups can be created.

func (*NetworkIPGroupService) Update

Update a Network IP Group's configuration. Modify the group name, IP version, or the list of CIDR networks included in the group. Only project type Network IP Groups can be updated.

type NetworkIPGroupUpdateParam

type NetworkIPGroupUpdateParam struct {
	// An array of CIDR addresses in the IP Address Group. Can include individual IP
	// addresses (e.g., "91.103.3.36") or network ranges (e.g., "90.103.2.0/24"). All
	// addresses must match the specified IP version. Use these groups in firewall
	// rules to allow/block traffic from multiple locations with a single rule.
	Cidrs []string `json:"cidrs,omitzero,required"`
	// The name to be given to the new IP Address Group. Used to identify the group
	// when creating firewall rules or geo-filters. Must start with a letter and
	// contain only letters, numbers, underscores, and hyphens.
	Name string `json:"name,required"`
	// The IP version of the IP Address Group Objects in the IP Address Group. Accepted
	// versions are 4 and 6. If not sent, it will default to 4.
	Version param.Opt[int64] `json:"version,omitzero"`
	// contains filtered or unexported fields
}

The properties Cidrs, Name are required.

func (NetworkIPGroupUpdateParam) MarshalJSON

func (r NetworkIPGroupUpdateParam) MarshalJSON() (data []byte, err error)

func (*NetworkIPGroupUpdateParam) UnmarshalJSON

func (r *NetworkIPGroupUpdateParam) UnmarshalJSON(data []byte) error

type NetworkIPGroupUpdateParams

type NetworkIPGroupUpdateParams struct {
	NetworkIPGroupUpdate NetworkIPGroupUpdateParam
	// contains filtered or unexported fields
}

func (NetworkIPGroupUpdateParams) MarshalJSON

func (r NetworkIPGroupUpdateParams) MarshalJSON() (data []byte, err error)

func (*NetworkIPGroupUpdateParams) UnmarshalJSON

func (r *NetworkIPGroupUpdateParams) UnmarshalJSON(data []byte) error

type NetworkRouter

type NetworkRouter struct {
	// The ID of the Router Resource record
	ID int64 `json:"id,required"`
	// Timestamp, in ISO format, of when the Router Resource record was created.
	Created string `json:"created,required"`
	// Number of days after a user sets the state of the Router to Scrub (8) before it
	// is executed by robot. The default value is 7 days for a Router.
	GracePeriod int64                 `json:"grace_period,required"`
	Metadata    NetworkRouterMetadata `json:"metadata,required"`
	// The user-friendly name given to this Router Resource instance
	Name string `json:"name,required"`
	// An array of the list of networks defined on the Router
	Networks []NetworkRouterNetwork `json:"networks,required"`
	// The id of the Project that this Router Resource belongs to
	ProjectID int64 `json:"project_id,required"`
	// An array of the specs for the Router Resource
	Specs []Bom `json:"specs,required"`
	// The current state of the Router Resource
	State string `json:"state,required"`
	// The type of the Network Router
	Type string `json:"type,required"`
	// Timestamp, in ISO format, of when the Router Resource record was last updated.
	Updated string `json:"updated,required"`
	// URL that can be used to run methods in the API associated with the Network
	// Routers instance.
	Uri string `json:"uri,required" format:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Created     respjson.Field
		GracePeriod respjson.Field
		Metadata    respjson.Field
		Name        respjson.Field
		Networks    respjson.Field
		ProjectID   respjson.Field
		Specs       respjson.Field
		State       respjson.Field
		Type        respjson.Field
		Updated     respjson.Field
		Uri         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkRouter) RawJSON

func (r NetworkRouter) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkRouter) UnmarshalJSON

func (r *NetworkRouter) UnmarshalJSON(data []byte) error

type NetworkRouterListParams

type NetworkRouterListParams struct {
	// The limit of the number of objects returned per page
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// The field to use for ordering. Possible fields and the default are outlined in
	// the individual method descriptions.
	Order param.Opt[string] `query:"order,omitzero" json:"-"`
	// The page of records to return, assuming `limit` number of records per page.
	Page param.Opt[int64] `query:"page,omitzero" json:"-"`
	// Filter the result to objects that do not match the specified filters. Possible
	// filters are outlined in the individual list method descriptions.
	Exclude any `query:"exclude,omitzero" json:"-"`
	// Filter the result to objects that match the specified filters. Possible filters
	// are outlined in the individual list method descriptions.
	Search any `query:"search,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (NetworkRouterListParams) URLQuery

func (r NetworkRouterListParams) URLQuery() (v url.Values, err error)

URLQuery serializes NetworkRouterListParams's query parameters as `url.Values`.

type NetworkRouterListResponse

type NetworkRouterListResponse struct {
	Metadata ListMetadata    `json:"_metadata"`
	Content  []NetworkRouter `json:"content"`
	// Maximum number of records returned per page.
	Count int64 `json:"count"`
	// Page number of the current results.
	Page int64 `json:"page"`
	// Total number of matching records.
	Total int64 `json:"total"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata    respjson.Field
		Content     respjson.Field
		Count       respjson.Field
		Page        respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkRouterListResponse) RawJSON

func (r NetworkRouterListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkRouterListResponse) UnmarshalJSON

func (r *NetworkRouterListResponse) UnmarshalJSON(data []byte) error

type NetworkRouterMetadata

type NetworkRouterMetadata struct {
	Ipv4Address BaseIPAddress `json:"ipv4_address,required"`
	// The ID of the assigned public IPv4 address for the Router.
	Ipv4AddressID int64         `json:"ipv4_address_id,required"`
	Ipv6Address   BaseIPAddress `json:"ipv6_address,required"`
	// The ID of the assigned public IPv6 address for the Router.
	Ipv6AddressID int64 `json:"ipv6_address_id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Ipv4Address   respjson.Field
		Ipv4AddressID respjson.Field
		Ipv6Address   respjson.Field
		Ipv6AddressID respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkRouterMetadata) RawJSON

func (r NetworkRouterMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkRouterMetadata) UnmarshalJSON

func (r *NetworkRouterMetadata) UnmarshalJSON(data []byte) error

type NetworkRouterNetwork

type NetworkRouterNetwork struct {
	// The destination address range of the target network of the static route.
	// Returned if the type is "static_route".
	Destination string `json:"destination"`
	// The IPv4 address range of the network. Returned if the type is "router".
	Ipv4 string `json:"ipv4"`
	// The IPv6 address range of the network. Returned if the type is "router".
	Ipv6 string `json:"ipv6"`
	// The name of the network. Returned if the type is "router".
	Name string `json:"name"`
	// Flag indicating if traffic from the destination can route to the Public
	// internet. Returned if the type is "static_route".
	Nat bool `json:"nat"`
	// An IP address from one of the networks configured on the Router in the Project
	// to forward the packet to. Returned if the type is "static_route".
	Nexthop string `json:"nexthop"`
	// The VLAN ID of the network. Returned if the type is "router".
	Vlan int64 `json:"vlan"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Destination respjson.Field
		Ipv4        respjson.Field
		Ipv6        respjson.Field
		Name        respjson.Field
		Nat         respjson.Field
		Nexthop     respjson.Field
		Vlan        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkRouterNetwork) RawJSON

func (r NetworkRouterNetwork) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkRouterNetwork) UnmarshalJSON

func (r *NetworkRouterNetwork) UnmarshalJSON(data []byte) error

type NetworkRouterNewParams

type NetworkRouterNewParams struct {
	// Option if type is "router". If not sent, defaults will be applied.
	//
	// An array of the list of networks defined on the Router. To create a new network
	// on the Network Router, append an object to the list with an `ipv4` key for an
	// available RFC 1918 address range. The `ipv6` and `vlan` values will be generated
	// based on what is available in the region. If networks is not sent, the default
	// address range 10.0.0.1/24 will be assigned to `ipv4`.
	Networks []NetworkRouterNewParamsNetwork `json:"networks,omitzero,required"`
	// The ID of the User's Project into which this Network Router should be added.
	ProjectID int64 `json:"project_id,required"`
	// The user-friendly name for the Network Router. If not sent and the type is
	// "router", it will default to the name 'Router'. If not sent and the type is
	// "static_route", it will default to the name 'Static Route'.
	Name param.Opt[string] `json:"name,omitzero"`
	// The type of Network Router to create. Valid options are:
	//
	//   - "router" A virtual route that manages IP forwarding, and participate in
	//     routing decisions for the Project.
	//   - "static_route" Maps a destination network to a nexthop IP, enabling
	//     deterministic packet forwarding.
	Type param.Opt[string] `json:"type,omitzero"`
	// Required if type is "static_route".
	//
	// Metadata for the Static Route resource.
	Metadata NetworkRouterNewParamsMetadata `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (NetworkRouterNewParams) MarshalJSON

func (r NetworkRouterNewParams) MarshalJSON() (data []byte, err error)

func (*NetworkRouterNewParams) UnmarshalJSON

func (r *NetworkRouterNewParams) UnmarshalJSON(data []byte) error

type NetworkRouterNewParamsMetadata

type NetworkRouterNewParamsMetadata struct {
	// CIDR notation of the destination address range of the target network of the
	// static route.
	//
	// Note:
	//
	//   - The sent address range cannot overlap with the destination of other Static
	//     Routes in the same Project.
	//   - The sent address range can overlap with the networks configured on the Router
	//     in the Project.
	//   - The sent address range cannot overlap with the "remote_ts" of Network VPNs in
	//     the same Project.
	Destination param.Opt[string] `json:"destination,omitzero"`
	// Flag indicating if traffic from the destination can be routed to the Public
	// internet via the Project's Router. It will default to False if not sent.
	Nat param.Opt[bool] `json:"nat,omitzero"`
	// An IP address from one of the networks configured on the Router in the Project
	// to forward the packet to.
	Nexthop param.Opt[string] `json:"nexthop,omitzero"`
	// contains filtered or unexported fields
}

Required if type is "static_route".

Metadata for the Static Route resource.

func (NetworkRouterNewParamsMetadata) MarshalJSON

func (r NetworkRouterNewParamsMetadata) MarshalJSON() (data []byte, err error)

func (*NetworkRouterNewParamsMetadata) UnmarshalJSON

func (r *NetworkRouterNewParamsMetadata) UnmarshalJSON(data []byte) error

type NetworkRouterNewParamsNetwork

type NetworkRouterNewParamsNetwork struct {
	// The IPv4 address range of the network
	Ipv4 param.Opt[string] `json:"ipv4,omitzero"`
	// The IPv6 address range of the network
	Ipv6 param.Opt[string] `json:"ipv6,omitzero"`
	// The name of the network
	Name param.Opt[string] `json:"name,omitzero"`
	// The VLAN
	Vlan param.Opt[int64] `json:"vlan,omitzero"`
	// contains filtered or unexported fields
}

func (NetworkRouterNewParamsNetwork) MarshalJSON

func (r NetworkRouterNewParamsNetwork) MarshalJSON() (data []byte, err error)

func (*NetworkRouterNewParamsNetwork) UnmarshalJSON

func (r *NetworkRouterNewParamsNetwork) UnmarshalJSON(data []byte) error

type NetworkRouterResponse

type NetworkRouterResponse struct {
	Content NetworkRouter `json:"content"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkRouterResponse) RawJSON

func (r NetworkRouterResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkRouterResponse) UnmarshalJSON

func (r *NetworkRouterResponse) UnmarshalJSON(data []byte) error

type NetworkRouterService

type NetworkRouterService struct {
	Options []option.RequestOption
}

NetworkRouterService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewNetworkRouterService method instead.

func NewNetworkRouterService

func NewNetworkRouterService(opts ...option.RequestOption) (r NetworkRouterService)

NewNetworkRouterService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*NetworkRouterService) Get

func (r *NetworkRouterService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *NetworkRouter, err error)

Retrieve detailed information about a specific network router configuration, including its type (router or static_route), associated networking details, and current state.

func (*NetworkRouterService) List

Retrieve a paginated list of network routers from all your projects. Each project has at most one router. Supports filtering by type (router or static_route), project, state, name, and other attributes. Results can be ordered and paginated.

## Filtering

The following fields and modifiers can be used to filter records from the list;

- created (gt, gte, in, isnull, lt, lte, range) - id (gt, gte, in, isnull, lt, lte, range) - name (in, icontains, iendswith, iexact, istartswith) - project_id (gt, gte, in, isnull, lt, lte, range) - project\_\_address_id (gt, gte, in, isnull, lt, lte, range) - project\_\_name (in, icontains, iendswith, iexact, istartswith) - project\_\_region_id (gt, gte, in, isnull, lt, lte, range) - project\_\_reseller_id (gt, gte, in, isnull, lt, lte, range) - state (gt, gte, in, isnull, lt, lte, range) - type - updated (gt, gte, in, isnull, lt, lte, range)

To search, simply add `?search[field]=value` to include records that match the request, or `?exclude[field]=value` to exclude them. To use modifiers, simply add `?search[field__modifier]` and `?exclude[field__modifier]`

## Ordering

The following fields can be used to order the results of the list;

- name (default) - id - project_id

To reverse the ordering, simply prepend a `-` character to the request. So `?order=field` orders by `field` in ascending order, while `?order=-field` orders in descending order instead.

func (*NetworkRouterService) New

Create a new Network Routers Resource entry using data given by user for a specified type, "router" or "static_route".

Create a new netwotk router for a project. Each project can have only one of the type "router". For this type, optionally define one or more private networks using RFC 1918 addresses (10.x.x.x, 172.16-31.x.x, 192.168.x.x). If no networks are specified, a default 10.0.0.1/24 network is created. Additional networks can be added later through the update operation.

One or more of the Network Router of the type "static_route" can be added to the Project to manage mapping a destination network to a nexthop IP.

func (*NetworkRouterService) Update

Update a network router to modify its name, add new private networks, rename existing networks, or change its state. When adding networks, specify new IPv4 CIDR ranges. When updating existing networks, reference them by VLAN ID.

For static routes, they can be renamed or have there state changed,

type NetworkRouterUpdateMetadataParam

type NetworkRouterUpdateMetadataParam struct {
	// CIDR notation of the destination address range of the target network of the
	// static route. The destination cannot be updated.
	Destination param.Opt[string] `json:"destination,omitzero"`
	// Flag indicating if traffic from the destination can be routed to the Public
	// internet via the Project's Router.
	Nat param.Opt[bool] `json:"nat,omitzero"`
	// An IP address from one of the networks configured on the Router in the Project
	// to forward the packet to. The nexthop cannot be updated.
	Nexthop param.Opt[string] `json:"nexthop,omitzero"`
	// contains filtered or unexported fields
}

Metadata for the Netork Routers of the type "static_route".

func (NetworkRouterUpdateMetadataParam) MarshalJSON

func (r NetworkRouterUpdateMetadataParam) MarshalJSON() (data []byte, err error)

func (*NetworkRouterUpdateMetadataParam) UnmarshalJSON

func (r *NetworkRouterUpdateMetadataParam) UnmarshalJSON(data []byte) error

type NetworkRouterUpdateNetworkParam

type NetworkRouterUpdateNetworkParam struct {
	// The IPv4 address range of the network
	Ipv4 string `json:"ipv4,required"`
	// The IPv6 address range of the network
	Ipv6 string `json:"ipv6,required"`
	// The VLAN ID of the network.
	Vlan int64 `json:"vlan,required"`
	// The name of the network
	Name        param.Opt[string] `json:"name,omitzero"`
	TriggerAttr param.Opt[string] `json:"trigger_attr,omitzero"`
	// contains filtered or unexported fields
}

The properties Ipv4, Ipv6, Vlan are required.

func (NetworkRouterUpdateNetworkParam) MarshalJSON

func (r NetworkRouterUpdateNetworkParam) MarshalJSON() (data []byte, err error)

func (*NetworkRouterUpdateNetworkParam) UnmarshalJSON

func (r *NetworkRouterUpdateNetworkParam) UnmarshalJSON(data []byte) error

type NetworkRouterUpdateParam

type NetworkRouterUpdateParam struct {
	// Networks for the Netork Routers of the type "router".
	//
	// An array of the list of networks defined on the Network Router. Existing
	// networks (vlan property is not None) can have their names updated but IPv4/IPv6
	// ranges and VLAN cannot be modified. To create a new network on the Network
	// Router, append an object to the list with an `ipv4` key for an available RFC
	// 1918 address range. The `ipv6` and `vlan` values will be generated based on what
	// is available in the region.
	Networks []NetworkRouterUpdateNetworkParam `json:"networks,omitzero,required"`
	// Change the state of the Network Router, triggering the CloudCIX Robot to perform
	// the requested action.
	//
	// Available state transitions:
	//
	// From running state, you can transition to:
	//
	//   - update_running - Apply pending configuration changes while keeping the router
	//     operational
	//   - delete - Mark the router for deletion (requires all other project resources to
	//     be deleted first)
	//
	// From delete_queue state, you can transition to:
	//
	// - restart - Restore a router that was previously marked for deletion
	//
	// Note: To delete a router, all other resources in the project must first be in
	// one of these states: delete, delete_queue, or deleting.
	State string `json:"state,required"`
	// The user-friendly name for the Network Router. If not sent, it will default to
	// current name.
	Name param.Opt[string] `json:"name,omitzero"`
	// Metadata for the Netork Routers of the type "static_route".
	Metadata NetworkRouterUpdateMetadataParam `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

The properties Networks, State are required.

func (NetworkRouterUpdateParam) MarshalJSON

func (r NetworkRouterUpdateParam) MarshalJSON() (data []byte, err error)

func (*NetworkRouterUpdateParam) UnmarshalJSON

func (r *NetworkRouterUpdateParam) UnmarshalJSON(data []byte) error

type NetworkRouterUpdateParams

type NetworkRouterUpdateParams struct {
	NetworkRouterUpdate NetworkRouterUpdateParam
	// contains filtered or unexported fields
}

func (NetworkRouterUpdateParams) MarshalJSON

func (r NetworkRouterUpdateParams) MarshalJSON() (data []byte, err error)

func (*NetworkRouterUpdateParams) UnmarshalJSON

func (r *NetworkRouterUpdateParams) UnmarshalJSON(data []byte) error

type NetworkService

type NetworkService struct {
	Options   []option.RequestOption
	Firewalls NetworkFirewallService
	IPGroups  NetworkIPGroupService
	Routers   NetworkRouterService
	Vpns      NetworkVpnService
}

NetworkService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewNetworkService method instead.

func NewNetworkService

func NewNetworkService(opts ...option.RequestOption) (r NetworkService)

NewNetworkService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type NetworkVpn

type NetworkVpn struct {
	// The ID of the Network VPN record
	ID int64 `json:"id,required"`
	// Timestamp, in ISO format, of when the Network VPN record was created.
	Created string `json:"created,required"`
	// The metadata for the configuration of the IKE and IPSec phases of the Network
	// VPN.
	Metadata NetworkVpnMetadata `json:"metadata,required"`
	// The user-friendly name given to this Network VPN instance
	Name string `json:"name,required"`
	// The id of the Project that this Network VPN belongs to
	ProjectID int64 `json:"project_id,required"`
	// An array of the specs for the Network VPN
	Specs []Bom `json:"specs,required"`
	// The current state of the Network VPN
	State string `json:"state,required"`
	// The type of the Network VPN
	Type string `json:"type,required"`
	// Timestamp, in ISO format, of when the Network VPN record was last updated.
	Updated string `json:"updated,required"`
	// URL that can be used to run methods in the API associated with the Network VPN
	// instance.
	Uri string `json:"uri,required" format:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Created     respjson.Field
		Metadata    respjson.Field
		Name        respjson.Field
		ProjectID   respjson.Field
		Specs       respjson.Field
		State       respjson.Field
		Type        respjson.Field
		Updated     respjson.Field
		Uri         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkVpn) RawJSON

func (r NetworkVpn) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkVpn) UnmarshalJSON

func (r *NetworkVpn) UnmarshalJSON(data []byte) error

type NetworkVpnListParams

type NetworkVpnListParams struct {
	// The limit of the number of objects returned per page
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// The field to use for ordering. Possible fields and the default are outlined in
	// the individual method descriptions.
	Order param.Opt[string] `query:"order,omitzero" json:"-"`
	// The page of records to return, assuming `limit` number of records per page.
	Page param.Opt[int64] `query:"page,omitzero" json:"-"`
	// Filter the result to objects that do not match the specified filters. Possible
	// filters are outlined in the individual list method descriptions.
	Exclude any `query:"exclude,omitzero" json:"-"`
	// Filter the result to objects that match the specified filters. Possible filters
	// are outlined in the individual list method descriptions.
	Search any `query:"search,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (NetworkVpnListParams) URLQuery

func (r NetworkVpnListParams) URLQuery() (v url.Values, err error)

URLQuery serializes NetworkVpnListParams's query parameters as `url.Values`.

type NetworkVpnListResponse

type NetworkVpnListResponse struct {
	Metadata ListMetadata `json:"_metadata"`
	Content  []NetworkVpn `json:"content"`
	// Maximum number of records returned per page.
	Count int64 `json:"count"`
	// Page number of the current results.
	Page int64 `json:"page"`
	// Total number of matching records.
	Total int64 `json:"total"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata    respjson.Field
		Content     respjson.Field
		Count       respjson.Field
		Page        respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkVpnListResponse) RawJSON

func (r NetworkVpnListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkVpnListResponse) UnmarshalJSON

func (r *NetworkVpnListResponse) UnmarshalJSON(data []byte) error

type NetworkVpnMetadata

type NetworkVpnMetadata struct {
	// An array of Child SAs (Security Associations) of the routes for the Network VPN.
	ChildSas []NetworkVpnMetadataChildSa `json:"child_sas"`
	// Authentication algorithms for the IKE phase.
	IkeAuthentication string `json:"ike_authentication"`
	// Diffie-Helmen groups for the IKE phase.
	IkeDhGroups string `json:"ike_dh_groups"`
	// Encryption algorithms for the IKE phase.
	IkeEncryption string `json:"ike_encryption"`
	// The gateway type (public_ip or hostname ) for the IKE phase.
	IkeGatewayType string `json:"ike_gateway_type"`
	// The gateway value (IP or hostname) for the IKE phase.
	IkeGatewayValue string `json:"ike_gateway_value"`
	// The lifetime of the IKE phase in seconds.
	IkeLifetime int64 `json:"ike_lifetime"`
	// The local identifier of the IKE phase in the region.
	IkeLocalIdentifier string `json:"ike_local_identifier"`
	// The pre shared key of the IKE phase.
	IkePreSharedKey string `json:"ike_pre_shared_key"`
	// The remote identifier of the IKE phase on the customers side of the VPN.
	IkeRemoteIdentifier string `json:"ike_remote_identifier"`
	// The version of the IKE phase
	IkeVersion int64 `json:"ike_version"`
	// Authentication algorithms for the IPSec phase.
	IpsecAuthentication string `json:"ipsec_authentication"`
	// Encryption algorithms for the IPSec phase.
	IpsecEncryption string `json:"ipsec_encryption"`
	// The establish time for the IPSec phase.
	IpsecEstablishTime string `json:"ipsec_establish_time"`
	// The lifetime of the IPSec phase in seconds.
	IpsecLifetime int64 `json:"ipsec_lifetime"`
	// Perfect Forward Secrecy groups for the IPSec phase.
	IpsecPfsGroups string `json:"ipsec_pfs_groups"`
	// STIF number for the Network VPN.
	StifNumber int64 `json:"stif_number"`
	// Flag for it traffic selectors are enabled.
	TrafficSelector bool `json:"traffic_selector"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChildSas            respjson.Field
		IkeAuthentication   respjson.Field
		IkeDhGroups         respjson.Field
		IkeEncryption       respjson.Field
		IkeGatewayType      respjson.Field
		IkeGatewayValue     respjson.Field
		IkeLifetime         respjson.Field
		IkeLocalIdentifier  respjson.Field
		IkePreSharedKey     respjson.Field
		IkeRemoteIdentifier respjson.Field
		IkeVersion          respjson.Field
		IpsecAuthentication respjson.Field
		IpsecEncryption     respjson.Field
		IpsecEstablishTime  respjson.Field
		IpsecLifetime       respjson.Field
		IpsecPfsGroups      respjson.Field
		StifNumber          respjson.Field
		TrafficSelector     respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The metadata for the configuration of the IKE and IPSec phases of the Network VPN.

func (NetworkVpnMetadata) RawJSON

func (r NetworkVpnMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkVpnMetadata) UnmarshalJSON

func (r *NetworkVpnMetadata) UnmarshalJSON(data []byte) error

type NetworkVpnMetadataChildSa

type NetworkVpnMetadataChildSa struct {
	// The CIDR notation of a subnet configured on the Network Router in the same
	// Project
	LocalTs string `json:"local_ts"`
	// CIDR notation of a subnet on the Customer side of the Network VPN.
	RemoteTs string `json:"remote_ts"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LocalTs     respjson.Field
		RemoteTs    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkVpnMetadataChildSa) RawJSON

func (r NetworkVpnMetadataChildSa) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkVpnMetadataChildSa) UnmarshalJSON

func (r *NetworkVpnMetadataChildSa) UnmarshalJSON(data []byte) error

type NetworkVpnNewParams

type NetworkVpnNewParams struct {
	// The ID of the User's Project into which this Network VPN should be added.
	ProjectID int64 `json:"project_id,required"`
	// The user-friendly name for the Network VPN. If not sent, it will default to the
	// name 'VPNS2S'
	Name param.Opt[string] `json:"name,omitzero"`
	// The type of Network VPN to create. Valid options are:
	//
	// - "site-to-site"
	Type param.Opt[string] `json:"type,omitzero"`
	// Optional. The metadata required to configure the Network VPN instance.
	Metadata NetworkVpnNewParamsMetadata `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (NetworkVpnNewParams) MarshalJSON

func (r NetworkVpnNewParams) MarshalJSON() (data []byte, err error)

func (*NetworkVpnNewParams) UnmarshalJSON

func (r *NetworkVpnNewParams) UnmarshalJSON(data []byte) error

type NetworkVpnNewParamsMetadata

type NetworkVpnNewParamsMetadata struct {
	// Optional. A string containing a comma separated array of authentication
	// algorithms for the IKE phase of the Network VPN. If not sent, it will default to
	// `SHA384`.
	//
	// The IKE phase authentication algorithms supported are;
	//
	// - `SHA1`
	// - `SHA256`
	// - `SHA384`
	//
	// Please ensure that each entry in the array matches one of the above strings
	// exactly. Duplicate entries will be ignored.
	IkeAuthentication param.Opt[string] `json:"ike_authentication,omitzero"`
	// Optional. A string containing a comma separated array of Diffie-Helmen groups
	// for the IKE phase of the Network VPN. If not sent, it will default to
	// `Group 24`.
	//
	// The IKE phase Diffie-Helmen groups supported are;
	//
	// - `Group 1`
	// - `Group 2`
	// - `Group 5`
	// - `Group 19`
	// - `Group 20`
	// - `Group 24`
	//
	// Please ensure that each entry in the array matches one of the above strings
	// exactly. Duplicate entries will be ignored.
	IkeDhGroups param.Opt[string] `json:"ike_dh_groups,omitzero"`
	// Optional. A string containing a comma separated array of encryption algorithms
	// for the IKE phase of the Network VPN. If not sent, it will default to "256 bit
	// AES-CBC".
	//
	// The IKE phase encryption algorithms supported are;
	//
	// - `128 bit AES-CBC`
	// - `192 bit AES-CBC`
	// - `256 bit AES-CBC`
	//
	// Please ensure that each entry in the array matches one of the above strings
	// exactly. Duplicate entries will be ignored.
	IkeEncryption param.Opt[string] `json:"ike_encryption,omitzero"`
	// The type of data that is stored in the `ike_gateway_value` field. It can only
	// either "public_ip" or "hostname". If not sent, it will default to "public_ip".
	IkeGatewayType param.Opt[string] `json:"ike_gateway_type,omitzero"`
	// The value used as the IKE gateway for the Network VPN. The type for this value
	// depends on what type was sent for the "ike_gateway_type".
	//
	// For "public_ip", this value must be a string containing an IP address. For
	// "hostname", this value must be a valid hostname.
	IkeGatewayValue param.Opt[string] `json:"ike_gateway_value,omitzero"`
	// Optional. The lifetime of the IKE phase in seconds. Must be a value between 180
	// and 86400 inclusive. If not sent, it will default to 28800.
	IkeLifetime param.Opt[int64] `json:"ike_lifetime,omitzero"`
	// The pre shared key to use for setting up the IKE phase of the Network VPN.
	//
	// Note that the pre shared key cannot contain any of the following special
	// characters;
	//
	// - `"`
	// - `'`
	// - `@`
	// - `+`
	// - `-`
	// - `/`
	// - `\`
	// - `|`
	// - `=`
	IkePreSharedKey param.Opt[string] `json:"ike_pre_shared_key,omitzero"`
	// Optional. String value of the chosen version for the IKE phase. If not sent, it
	// will default to "v2-only".
	//
	// The IKE phase versions supported are;
	//
	// - `v1-only`
	// - `v2-only`
	//
	// Please ensure the sent string matches one of these exactly.
	IkeVersion param.Opt[string] `json:"ike_version,omitzero"`
	// Optional. A string containing a comma separated array of authentication
	// algorithms for the IPSec phase of the Site-to-Site Network VPN. If not sent, it
	// will default to "SHA256".
	//
	// The IPSec phase authentication algorithms supported are;
	//
	// - `SHA1`
	// - `SHA256`
	//
	// Please ensure that each entry in the array matches one of the above strings
	// exactly. Duplicate entries will be ignored.
	IpsecAuthentication param.Opt[string] `json:"ipsec_authentication,omitzero"`
	// Optional. A string containing a comma separated array of encryption algorithms
	// for the IPSEC phase of the Network VPN. If not sent, it will default to "AES
	// 256".
	//
	// The IPSEC phase encryption algorithms supported are;
	//
	// - `AES 128`
	// - `AES 192`
	// - `AES 256`
	// - `AES 128 GCM`
	// - `AES 192 GCM`
	// - `AES 256 GCM`
	//
	// Please ensure that each entry in the array matches one of the above strings
	// exactly. Duplicate entries will be ignored.
	IpsecEncryption param.Opt[string] `json:"ipsec_encryption,omitzero"`
	// Optional. String value of the chosen establish_time for the IPSec phase. If not
	// sent, it will default to "Immediately".
	//
	// The IPSec phase establish time values supported are;
	//
	// - `Immediately`
	// - `On Traffic`
	//
	// Please ensure the sent string matches one of these exactly.
	IpsecEstablishTime param.Opt[string] `json:"ipsec_establish_time,omitzero"`
	// Optional. The lifetime of the IPSec phase in seconds. It be a value between 180
	// and 86400 inclusive. If not sent, it will default to 3600.
	IpsecLifetime param.Opt[int64] `json:"ipsec_lifetime,omitzero"`
	// Optional. A string containing a comma separated array of Perfect Forward Secrecy
	// (PFS) groups for the IPSec phase of the Network VPN. If not sent, it will
	// default to "Group 20".
	//
	// The IPSec phase PFS groups supported are;
	//
	// - `Group 1`
	// - `Group 2`
	// - `Group 5`
	// - `Group 14`
	// - `Group 19`
	// - `Group 20`
	// - `Group 24`
	//
	// Please ensure that each entry in the array matches one of the above strings
	// exactly. Duplicate entries will be ignored.
	IpsecPfsGroups param.Opt[string] `json:"ipsec_pfs_groups,omitzero"`
	// Optional. Boolean value stating if traffic selectors are to be used in
	// configuring vpn tunnel. If not sent, it will default to false.
	//
	// By default, 0.0.0.0/0 will be used for the default local and remote CIDRs. If
	// true, then each of the local and remote CIDRs will be added to the configuration
	// negotiation with peer.
	TrafficSelector param.Opt[bool] `json:"traffic_selector,omitzero"`
	// An array of Child SAs (Security Associations) to create the initial routes for
	// the VPN.
	ChildSas []NetworkVpnNewParamsMetadataChildSa `json:"child_sas,omitzero"`
	// contains filtered or unexported fields
}

Optional. The metadata required to configure the Network VPN instance.

func (NetworkVpnNewParamsMetadata) MarshalJSON

func (r NetworkVpnNewParamsMetadata) MarshalJSON() (data []byte, err error)

func (*NetworkVpnNewParamsMetadata) UnmarshalJSON

func (r *NetworkVpnNewParamsMetadata) UnmarshalJSON(data []byte) error

type NetworkVpnNewParamsMetadataChildSa

type NetworkVpnNewParamsMetadataChildSa struct {
	// The local Subnet in Network VPN's Project that will be configured as part of
	// this route in a Child SA.
	LocalTs param.Opt[string] `json:"local_ts,omitzero"`
	// CIDR notation of the Remote Subnet on the Customer side of the Network VPN that
	// should be given access through the VPN.
	//
	// Note:
	//
	//   - The sent address range can overlap with the subnets configured on the Router
	//     in the Project for the VPNS2S.
	//   - The sent address range cannot overlap with a remote subnet of another VPN in
	//     the same Project.
	RemoteTs param.Opt[string] `json:"remote_ts,omitzero"`
	// contains filtered or unexported fields
}

func (NetworkVpnNewParamsMetadataChildSa) MarshalJSON

func (r NetworkVpnNewParamsMetadataChildSa) MarshalJSON() (data []byte, err error)

func (*NetworkVpnNewParamsMetadataChildSa) UnmarshalJSON

func (r *NetworkVpnNewParamsMetadataChildSa) UnmarshalJSON(data []byte) error

type NetworkVpnResponse

type NetworkVpnResponse struct {
	Content NetworkVpn `json:"content"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkVpnResponse) RawJSON

func (r NetworkVpnResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkVpnResponse) UnmarshalJSON

func (r *NetworkVpnResponse) UnmarshalJSON(data []byte) error

type NetworkVpnService

type NetworkVpnService struct {
	Options []option.RequestOption
}

NetworkVpnService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewNetworkVpnService method instead.

func NewNetworkVpnService

func NewNetworkVpnService(opts ...option.RequestOption) (r NetworkVpnService)

NewNetworkVpnService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*NetworkVpnService) Get

func (r *NetworkVpnService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *NetworkVpn, err error)

Attempt to read a Network VPN Resource record by the given `id`, returning a 404 if it does not exist

func (*NetworkVpnService) List

Retrieve a list of Network VPNs Resources

## Filtering

The following fields and modifiers can be used to filter records from the list;

- created (gt, gte, in, isnull, lt, lte, range) - id (gt, gte, in, isnull, lt, lte, range) - name (in, icontains, iendswith, iexact, istartswith) - project_id (gt, gte, in, isnull, lt, lte, range) - project\_\_address_id (gt, gte, in, isnull, lt, lte, range) - project\_\_name (in, icontains, iendswith, iexact, istartswith) - project\_\_region_id (gt, gte, in, isnull, lt, lte, range) - project\_\_reseller_id (gt, gte, in, isnull, lt, lte, range) - state (gt, gte, in, isnull, lt, lte, range) - type - updated (gt, gte, in, isnull, lt, lte, range)

To search, simply add `?search[field]=value` to include records that match the request, or `?exclude[field]=value` to exclude them. To use modifiers, simply add `?search[field__modifier]` and `?exclude[field__modifier]`

## Ordering

The following fields can be used to order the results of the list;

- name (default) - id - project_id

To reverse the ordering, simply prepend a `-` character to the request. So `?order=field` orders by `field` in ascending order, while `?order=-field` orders in descending order instead.

func (*NetworkVpnService) New

Create a new Network VPN Resource entry using data given by user.

func (*NetworkVpnService) Update

func (r *NetworkVpnService) Update(ctx context.Context, id int64, body NetworkVpnUpdateParams, opts ...option.RequestOption) (res *NetworkVpn, err error)

Attempt to update a Network VPN Resource record by the given `id`, returning a 404 if it does not exist

type NetworkVpnUpdateMetadataChildSaParam

type NetworkVpnUpdateMetadataChildSaParam struct {
	// The local Subnet in Network VPN's Project that will be configured as part of
	// this route in a Child SA.
	LocalTs param.Opt[string] `json:"local_ts,omitzero"`
	// CIDR notation of the Remote Subnet on the Customer side of the Network VPN that
	// should be given access through the VPN.
	//
	// Note:
	//
	//   - The sent address range can overlap with the subnets configured on the Router
	//     in the Project for the VPNS2S.
	//   - The sent address range cannot overlap with a remote subnet of another VPN in
	//     the same Project.
	RemoteTs param.Opt[string] `json:"remote_ts,omitzero"`
	// contains filtered or unexported fields
}

func (NetworkVpnUpdateMetadataChildSaParam) MarshalJSON

func (r NetworkVpnUpdateMetadataChildSaParam) MarshalJSON() (data []byte, err error)

func (*NetworkVpnUpdateMetadataChildSaParam) UnmarshalJSON

func (r *NetworkVpnUpdateMetadataChildSaParam) UnmarshalJSON(data []byte) error

type NetworkVpnUpdateMetadataParam

type NetworkVpnUpdateMetadataParam struct {
	// Optional. A string containing a comma separated array of authentication
	// algorithms for the IKE phase of the Network VPN. If not sent, it will default to
	// the current value.
	//
	// The IKE phase authentication algorithms supported are;
	//
	// - `SHA1`
	// - `SHA256`
	// - `SHA384`
	//
	// Please ensure that each entry in the array matches one of the above strings
	// exactly. Duplicate entries will be ignored.
	IkeAuthentication param.Opt[string] `json:"ike_authentication,omitzero"`
	// Optional. A string containing a comma separated array of Diffie-Helmen groups
	// for the IKE phase of the Network VPN. If not sent, it will default to the
	// current value.
	//
	// The IKE phase Diffie-Helmen groups supported are;
	//
	// - `Group 1`
	// - `Group 2`
	// - `Group 5`
	// - `Group 19`
	// - `Group 20`
	// - `Group 24`
	//
	// Please ensure that each entry in the array matches one of the above strings
	// exactly. Duplicate entries will be ignored.
	IkeDhGroups param.Opt[string] `json:"ike_dh_groups,omitzero"`
	// Optional. A string containing a comma separated array of encryption algorithms
	// for the IKE phase of the Network VPN. If not sent, it will default to the
	// current value.
	//
	// The IKE phase encryption algorithms supported are;
	//
	// - `128 bit AES-CBC`
	// - `192 bit AES-CBC`
	// - `256 bit AES-CBC`
	//
	// Please ensure that each entry in the array matches one of the above strings
	// exactly. Duplicate entries will be ignored.
	IkeEncryption param.Opt[string] `json:"ike_encryption,omitzero"`
	// The type of data that is stored in the `ike_gateway_value` field. It can only
	// either "public_ip" or "hostname". If not sent, it will default to the current
	// value.
	IkeGatewayType param.Opt[string] `json:"ike_gateway_type,omitzero"`
	// The value used as the IKE gateway for the Network VPN. The type for this value
	// depends on what type was sent for the "ike_gateway_type".
	//
	// For "public_ip", this value must be a string containing an IP address. For
	// "hostname", this value must be a valid hostname.
	IkeGatewayValue param.Opt[string] `json:"ike_gateway_value,omitzero"`
	// Optional. The lifetime of the IKE phase in seconds. Must be a value between 180
	// and 86400 inclusive. If not sent, it will default to the current value.
	IkeLifetime param.Opt[int64] `json:"ike_lifetime,omitzero"`
	// The pre shared key to use for setting up the IKE phase of the Network VPN.
	//
	// Note that the pre shared key cannot contain any of the following special
	// characters;
	//
	// - `"`
	// - `'`
	// - `@`
	// - `+`
	// - `-`
	// - `/`
	// - `\`
	// - `|`
	// - `=`
	IkePreSharedKey param.Opt[string] `json:"ike_pre_shared_key,omitzero"`
	// Optional. String value of the chosen version for the IKE phase. If not sent, it
	// will default to the current value.
	//
	// The IKE phase versions supported are;
	//
	// - `v1-only`
	// - `v2-only`
	//
	// Please ensure the sent string matches one of these exactly.
	IkeVersion param.Opt[string] `json:"ike_version,omitzero"`
	// Optional. A string containing a comma separated array of authentication
	// algorithms for the IPSec phase of the Site-to-Site Network VPN. If not sent, it
	// will default to the current value.
	//
	// The IPSec phase authentication algorithms supported are;
	//
	// - `SHA1`
	// - `SHA256`
	//
	// Please ensure that each entry in the array matches one of the above strings
	// exactly. Duplicate entries will be ignored.
	IpsecAuthentication param.Opt[string] `json:"ipsec_authentication,omitzero"`
	// Optional. A string containing a comma separated array of encryption algorithms
	// for the IPSEC phase of the Network VPN. If not sent, it will default to the
	// current value.
	//
	// The IPSEC phase encryption algorithms supported are;
	//
	// - `AES 128`
	// - `AES 192`
	// - `AES 256`
	// - `AES 128 GCM`
	// - `AES 192 GCM`
	// - `AES 256 GCM`
	//
	// Please ensure that each entry in the array matches one of the above strings
	// exactly. Duplicate entries will be ignored.
	IpsecEncryption param.Opt[string] `json:"ipsec_encryption,omitzero"`
	// Optional. String value of the chosen establish_time for the IPSec phase. If not
	// sent, it will default to the current value.
	//
	// The IPSec phase establish time values supported are;
	//
	// - `Immediately`
	// - `On Traffic`
	//
	// Please ensure the sent string matches one of these exactly.
	IpsecEstablishTime param.Opt[string] `json:"ipsec_establish_time,omitzero"`
	// Optional. The lifetime of the IPSec phase in seconds. It be a value between 180
	// and 86400 inclusive. If not sent, it will default to the current value.
	IpsecLifetime param.Opt[int64] `json:"ipsec_lifetime,omitzero"`
	// Optional. A string containing a comma separated array of Perfect Forward Secrecy
	// (PFS) groups for the IPSec phase of the Network VPN. If not sent, it will
	// default to the current value.
	//
	// The IPSec phase PFS groups supported are;
	//
	// - `Group 1`
	// - `Group 2`
	// - `Group 5`
	// - `Group 14`
	// - `Group 19`
	// - `Group 20`
	// - `Group 24`
	//
	// Please ensure that each entry in the array matches one of the above strings
	// exactly. Duplicate entries will be ignored.
	IpsecPfsGroups param.Opt[string] `json:"ipsec_pfs_groups,omitzero"`
	// Optional. Boolean value stating if traffic selectors are to be used in
	// configuring vpn tunnel. If not sent, it will default to the current value.
	//
	// By default, 0.0.0.0/0 will be used for the default local and remote CIDRs. If
	// true, then each of the local and remote CIDRs will be added to the configuration
	// negotiation with peer.
	TrafficSelector param.Opt[bool] `json:"traffic_selector,omitzero"`
	// An array of Child SAs (Security Associations) to create the initial routes for
	// the VPN.
	ChildSas []NetworkVpnUpdateMetadataChildSaParam `json:"child_sas,omitzero"`
	// contains filtered or unexported fields
}

Optional. The metadata required to configure the Network VPN instance

func (NetworkVpnUpdateMetadataParam) MarshalJSON

func (r NetworkVpnUpdateMetadataParam) MarshalJSON() (data []byte, err error)

func (*NetworkVpnUpdateMetadataParam) UnmarshalJSON

func (r *NetworkVpnUpdateMetadataParam) UnmarshalJSON(data []byte) error

type NetworkVpnUpdateParam

type NetworkVpnUpdateParam struct {
	// The user-friendly name for the Network VPN type. If not sent, it will default to
	// current name.
	Name param.Opt[string] `json:"name,omitzero"`
	// Change the state of the Network VPN, triggering the CloudCIX Robot to perform
	// the requested action. Users can only request state changes from certain current
	// states:
	//
	// - running -> update_running or delete
	State param.Opt[string] `json:"state,omitzero"`
	// Optional. The metadata required to configure the Network VPN instance
	Metadata NetworkVpnUpdateMetadataParam `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (NetworkVpnUpdateParam) MarshalJSON

func (r NetworkVpnUpdateParam) MarshalJSON() (data []byte, err error)

func (*NetworkVpnUpdateParam) UnmarshalJSON

func (r *NetworkVpnUpdateParam) UnmarshalJSON(data []byte) error

type NetworkVpnUpdateParams

type NetworkVpnUpdateParams struct {
	NetworkVpnUpdate NetworkVpnUpdateParam
	// contains filtered or unexported fields
}

func (NetworkVpnUpdateParams) MarshalJSON

func (r NetworkVpnUpdateParams) MarshalJSON() (data []byte, err error)

func (*NetworkVpnUpdateParams) UnmarshalJSON

func (r *NetworkVpnUpdateParams) UnmarshalJSON(data []byte) error

type Project

type Project struct {
	// The ID of the Project.
	ID int64 `json:"id,required"`
	// The ID of the Project address.
	AddressID int64 `json:"address_id,required"`
	// A flag stating whether or not the Project is classified as closed. A Project is
	// classified as closed when all the infrastructure in it is in a Closed (99)
	// state.
	Closed bool `json:"closed,required"`
	// The date that the Project entry was created
	Created string `json:"created,required"`
	// The ID of the User that manages the Project
	ManagerID int64 `json:"manager_id,required"`
	// The name of the Project.
	Name string `json:"name,required"`
	// The note attached to the Project.
	Note string `json:"note,required"`
	// The region ID that the Project is in.
	RegionID int64 `json:"region_id,required"`
	// The Address ID that will send the bill for the Project to the customer.
	ResellerID int64 `json:"reseller_id,required"`
	// The date that the Project entry was last updated
	Updated string `json:"updated,required"`
	// The absolute URL of the Project that can be used to perform `Read`, `Update` and
	// `Delete`
	Uri string `json:"uri,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		AddressID   respjson.Field
		Closed      respjson.Field
		Created     respjson.Field
		ManagerID   respjson.Field
		Name        respjson.Field
		Note        respjson.Field
		RegionID    respjson.Field
		ResellerID  respjson.Field
		Updated     respjson.Field
		Uri         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Project) RawJSON

func (r Project) RawJSON() string

Returns the unmodified JSON received from the API

func (*Project) UnmarshalJSON

func (r *Project) UnmarshalJSON(data []byte) error

type ProjectListParams

type ProjectListParams struct {
	// The limit of the number of objects returned per page
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// The field to use for ordering. Possible fields and the default are outlined in
	// the individual method descriptions.
	Order param.Opt[string] `query:"order,omitzero" json:"-"`
	// The page of records to return, assuming `limit` number of records per page.
	Page param.Opt[int64] `query:"page,omitzero" json:"-"`
	// Filter the result to objects that do not match the specified filters. Possible
	// filters are outlined in the individual list method descriptions.
	Exclude any `query:"exclude,omitzero" json:"-"`
	// Filter the result to objects that match the specified filters. Possible filters
	// are outlined in the individual list method descriptions.
	Search any `query:"search,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ProjectListParams) URLQuery

func (r ProjectListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ProjectListParams's query parameters as `url.Values`.

type ProjectListResponse

type ProjectListResponse struct {
	Metadata ListMetadata `json:"_metadata"`
	Content  []Project    `json:"content"`
	// Maximum number of records returned per page.
	Count int64 `json:"count"`
	// Page number of the current results.
	Page int64 `json:"page"`
	// Total number of matching records.
	Total int64 `json:"total"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata    respjson.Field
		Content     respjson.Field
		Count       respjson.Field
		Page        respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProjectListResponse) RawJSON

func (r ProjectListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProjectListResponse) UnmarshalJSON

func (r *ProjectListResponse) UnmarshalJSON(data []byte) error

type ProjectNewParams

type ProjectNewParams struct {
	// The name of the Project. Must be unique within an Address' Project collection.
	Name string `json:"name,required"`
	// The Address ID of the CloudCIX region that the Project will be deployed in.
	RegionID int64 `json:"region_id,required"`
	// An optional note providing a description of what the Project is used for.
	Note param.Opt[string] `json:"note,omitzero"`
	// contains filtered or unexported fields
}

func (ProjectNewParams) MarshalJSON

func (r ProjectNewParams) MarshalJSON() (data []byte, err error)

func (*ProjectNewParams) UnmarshalJSON

func (r *ProjectNewParams) UnmarshalJSON(data []byte) error

type ProjectResponse

type ProjectResponse struct {
	Content Project `json:"content"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProjectResponse) RawJSON

func (r ProjectResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProjectResponse) UnmarshalJSON

func (r *ProjectResponse) UnmarshalJSON(data []byte) error

type ProjectService

type ProjectService struct {
	Options []option.RequestOption
}

ProjectService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProjectService method instead.

func NewProjectService

func NewProjectService(opts ...option.RequestOption) (r ProjectService)

NewProjectService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProjectService) Get

func (r *ProjectService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *Project, err error)

Retrieve detailed information about a specific project, including its region, address, manager, creation date, and associated notes.

func (*ProjectService) List

Retrieve a paginated list of your cloud projects. Supports filtering by region, name, manager, and other attributes. Results can be ordered and paginated.

## Filtering

The following fields and modifiers can be used to filter records from the list;

- address_id (gt, gte, in, isnull, lt, lte, range) - all_projects - archived (gt, gte, in, isnull, lt, lte, range) - created (gt, gte, in, isnull, lt, lte, range) - id (gt, gte, in, isnull, lt, lte, range) - manager_id (gt, gte, in, isnull, lt, lte, range) - name (in, icontains, iendswith, iexact, istartswith) - region_id (gt, gte, in, isnull, lt, lte, range) - reseller_id (gt, gte, in, isnull, lt, lte, range) - updated (gt, gte, in, isnull, lt, lte, range)

To search, simply add `?search[field]=value` to include records that match the request, or `?exclude[field]=value` to exclude them. To use modifiers, simply add `?search[field__modifier]` and `?exclude[field__modifier]`

## Ordering

The following fields can be used to order the results of the list;

- name (default) - region_id - address_id - created - manager_id

To reverse the ordering, simply prepend a `-` character to the request. So `?order=field` orders by `field` in ascending order, while `?order=-field` orders in descending order instead.

func (*ProjectService) New

func (r *ProjectService) New(ctx context.Context, body ProjectNewParams, opts ...option.RequestOption) (res *Project, err error)

Create a new cloud project in a specified region. Projects provide isolated network environments for deploying and managing your cloud resources. Specify the region and optionally provide a name and notes.

func (*ProjectService) Update

func (r *ProjectService) Update(ctx context.Context, id int64, body ProjectUpdateParams, opts ...option.RequestOption) (res *Project, err error)

Update a project to modify its name or notes. Projects cannot be moved between regions after creation.

type ProjectUpdateParam

type ProjectUpdateParam struct {
	// The name of the Project. Must be unique within an Address' Project collection.
	Name param.Opt[string] `json:"name,omitzero"`
	// A note about the project to store information. No length limit.
	Note param.Opt[string] `json:"note,omitzero"`
	// contains filtered or unexported fields
}

func (ProjectUpdateParam) MarshalJSON

func (r ProjectUpdateParam) MarshalJSON() (data []byte, err error)

func (*ProjectUpdateParam) UnmarshalJSON

func (r *ProjectUpdateParam) UnmarshalJSON(data []byte) error

type ProjectUpdateParams

type ProjectUpdateParams struct {
	ProjectUpdate ProjectUpdateParam
	// contains filtered or unexported fields
}

func (ProjectUpdateParams) MarshalJSON

func (r ProjectUpdateParams) MarshalJSON() (data []byte, err error)

func (*ProjectUpdateParams) UnmarshalJSON

func (r *ProjectUpdateParams) UnmarshalJSON(data []byte) error

type StorageService

type StorageService struct {
	Options []option.RequestOption
	Volumes StorageVolumeService
}

StorageService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStorageService method instead.

func NewStorageService

func NewStorageService(opts ...option.RequestOption) (r StorageService)

NewStorageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type StorageVolumeListParams

type StorageVolumeListParams struct {
	// The limit of the number of objects returned per page
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// The field to use for ordering. Possible fields and the default are outlined in
	// the individual method descriptions.
	Order param.Opt[string] `query:"order,omitzero" json:"-"`
	// The page of records to return, assuming `limit` number of records per page.
	Page param.Opt[int64] `query:"page,omitzero" json:"-"`
	// Filter the result to objects that do not match the specified filters. Possible
	// filters are outlined in the individual list method descriptions.
	Exclude any `query:"exclude,omitzero" json:"-"`
	// Filter the result to objects that match the specified filters. Possible filters
	// are outlined in the individual list method descriptions.
	Search any `query:"search,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (StorageVolumeListParams) URLQuery

func (r StorageVolumeListParams) URLQuery() (v url.Values, err error)

URLQuery serializes StorageVolumeListParams's query parameters as `url.Values`.

type StorageVolumeListResponse

type StorageVolumeListResponse struct {
	Metadata ListMetadata     `json:"_metadata"`
	Content  []StorageVolumes `json:"content"`
	// Maximum number of records returned per page.
	Count int64 `json:"count"`
	// Page number of the current results.
	Page int64 `json:"page"`
	// Total number of matching records.
	Total int64 `json:"total"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metadata    respjson.Field
		Content     respjson.Field
		Count       respjson.Field
		Page        respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (StorageVolumeListResponse) RawJSON

func (r StorageVolumeListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*StorageVolumeListResponse) UnmarshalJSON

func (r *StorageVolumeListResponse) UnmarshalJSON(data []byte) error

type StorageVolumeNewParams

type StorageVolumeNewParams struct {
	// The ID of the Project which this Storage Volume should be in.
	ProjectID int64 `json:"project_id,required"`
	// List of specs (SKUs) for the Storage Volume drive.
	Specs []StorageVolumeNewParamsSpec `json:"specs,omitzero,required"`
	// Required if type is "hyperv".
	//
	// The ID of a Compute Instance with the type "hyperv" the Storage Volume is to be
	// mounted to.
	InstanceID param.Opt[int64] `json:"instance_id,omitzero"`
	// The user-friendly name for the Storage Volume type. If not sent and the type is
	// "cephfs", it will default to the name 'Ceph'. If not sent and the type is
	// "hyperv", it will default to the name 'Storage HyperV'.
	Name param.Opt[string] `json:"name,omitzero"`
	// The type of Storage Volume to create. Valid options are:
	//
	//   - "cephfs" A Ceph file system volume which can be mounted to one or more Compute
	//     Instances of the type "lxd"
	//   - "hyperv" A volume which can be mounted as a secondary drive to a Compute
	//     Instance of the type "hyperv"
	Type param.Opt[string] `json:"type,omitzero"`
	// contains filtered or unexported fields
}

func (StorageVolumeNewParams) MarshalJSON

func (r StorageVolumeNewParams) MarshalJSON() (data []byte, err error)

func (*StorageVolumeNewParams) UnmarshalJSON

func (r *StorageVolumeNewParams) UnmarshalJSON(data []byte) error

type StorageVolumeNewParamsSpec

type StorageVolumeNewParamsSpec struct {
	// The quantity (GB) of the SKU to configure the Storage Volume drive with.
	Quantity param.Opt[int64] `json:"quantity,omitzero"`
	// The name of the SKU for the Storage Volume drive.
	SKUName param.Opt[string] `json:"sku_name,omitzero"`
	// contains filtered or unexported fields
}

func (StorageVolumeNewParamsSpec) MarshalJSON

func (r StorageVolumeNewParamsSpec) MarshalJSON() (data []byte, err error)

func (*StorageVolumeNewParamsSpec) UnmarshalJSON

func (r *StorageVolumeNewParamsSpec) UnmarshalJSON(data []byte) error

type StorageVolumeService

type StorageVolumeService struct {
	Options []option.RequestOption
}

StorageVolumeService contains methods and other services that help with interacting with the cloudcix API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStorageVolumeService method instead.

func NewStorageVolumeService

func NewStorageVolumeService(opts ...option.RequestOption) (r StorageVolumeService)

NewStorageVolumeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*StorageVolumeService) Get

func (r *StorageVolumeService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *StorageVolumes, err error)

Retrieve detailed information about a specific storage volume including its type, capacity, mount status, and associated instances.

func (*StorageVolumeService) List

Retrieve a paginated list of storage volumes accessible to the requesting user. Filter by volume type (Ceph or Hyper-V), project, region, and other attributes.

## Filtering

The following fields and modifiers can be used to filter records from the list;

- resource_links\_\_contra_resource_id (gt, gte, in, isnull, lt, lte, range) - created (gt, gte, in, isnull, lt, lte, range) - id (gt, gte, in, isnull, lt, lte, range) - name (in, icontains, iendswith, iexact, istartswith) - project_id (gt, gte, in, isnull, lt, lte, range) - project\_\_address_id (gt, gte, in, isnull, lt, lte, range) - project\_\_name (in, icontains, iendswith, iexact, istartswith) - project\_\_region_id (gt, gte, in, isnull, lt, lte, range) - project\_\_reseller_id (gt, gte, in, isnull, lt, lte, range) - state (gt, gte, in, isnull, lt, lte, range) - type - updated (gt, gte, in, isnull, lt, lte, range)

To search, simply add `?search[field]=value` to include records that match the request, or `?exclude[field]=value` to exclude them. To use modifiers, simply add `?search[field__modifier]` and `?exclude[field__modifier]`

## Ordering

The following fields can be used to order the results of the list;

- name (default) - id - project_id

To reverse the ordering, simply prepend a `-` character to the request. So `?order=field` orders by `field` in ascending order, while `?order=-field` orders in descending order instead.

func (*StorageVolumeService) New

Create a new storage volume in a project. Specify volume type (Ceph or Hyper-V), storage capacity using SKUs, and configuration options. Ceph volumes can be mounted to multiple LXD instances. Hyper-V volumes are attached as secondary drives to Hyper-V instances.

func (*StorageVolumeService) Update

Update a storage volume's configuration. Modify volume name, increase storage capacity (cannot decrease), mount/unmount from instances (Ceph), or trigger state changes for resource management.

type StorageVolumeUpdateParams

type StorageVolumeUpdateParams struct {
	StorageVolumesUpdate StorageVolumesUpdateParam
	// contains filtered or unexported fields
}

func (StorageVolumeUpdateParams) MarshalJSON

func (r StorageVolumeUpdateParams) MarshalJSON() (data []byte, err error)

func (*StorageVolumeUpdateParams) UnmarshalJSON

func (r *StorageVolumeUpdateParams) UnmarshalJSON(data []byte) error

type StorageVolumes

type StorageVolumes struct {
	// The ID of the Storage Volume record
	ID int64 `json:"id,required"`
	// A list of Compute Instances the Storage Volume is mounted to.
	ContraInstances []StorageVolumesContraInstance `json:"contra_instances,required"`
	// Timestamp, in ISO format, of when the Storage Volume was created.
	Created string `json:"created,required"`
	// The "hyperv" Compute Instance the "hyperv" Storage Volume is attached to.
	Instance StorageVolumesInstance `json:"instance,required"`
	// The metadata object of "ceph" Storage Volumes
	Metadata StorageVolumesMetadata `json:"metadata,required"`
	// The user-friendly name given to this Storage Volume
	Name string `json:"name,required"`
	// The ID of the Project that this Storage Volume belongs to
	ProjectID int64 `json:"project_id,required"`
	// An array of the specs for the Storage Volume
	Specs []Bom `json:"specs,required"`
	// The current state of the Storage Volume
	State string `json:"state,required"`
	// The type of the Storage Volume
	Type string `json:"type,required"`
	// Timestamp, in ISO format, of when the Storage Volume was last updated.
	Updated string `json:"updated,required"`
	// URL that can be used to run methods in the API associated with the Storage
	// Volumes instance.
	Uri string `json:"uri,required" format:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		ContraInstances respjson.Field
		Created         respjson.Field
		Instance        respjson.Field
		Metadata        respjson.Field
		Name            respjson.Field
		ProjectID       respjson.Field
		Specs           respjson.Field
		State           respjson.Field
		Type            respjson.Field
		Updated         respjson.Field
		Uri             respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (StorageVolumes) RawJSON

func (r StorageVolumes) RawJSON() string

Returns the unmodified JSON received from the API

func (*StorageVolumes) UnmarshalJSON

func (r *StorageVolumes) UnmarshalJSON(data []byte) error

type StorageVolumesContraInstance

type StorageVolumesContraInstance struct {
	// The ID of the Compute Instance the Storage Volume is attached to.
	ID int64 `json:"id"`
	// The user-friendly name given to the Compute Instance the Storage Volume is
	// attached to.
	Name string `json:"name"`
	// The current state of the Compute Instance the Storage Volume is attached to.
	State string `json:"state"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		State       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (StorageVolumesContraInstance) RawJSON

Returns the unmodified JSON received from the API

func (*StorageVolumesContraInstance) UnmarshalJSON

func (r *StorageVolumesContraInstance) UnmarshalJSON(data []byte) error

type StorageVolumesInstance

type StorageVolumesInstance struct {
	// The ID of the "hyperv" Compute Instance the "hyperv" Storage Volume is attached
	// to.
	ID int64 `json:"id"`
	// The user-friendly name of the "hyperv" Compute Instance the "hyperv" Storage
	// Volume is attached to.
	Name string `json:"name"`
	// The current state of the "hyperv" Compute Instance the "hyperv" Storage Volume
	// is attached to.
	State string `json:"state"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		State       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The "hyperv" Compute Instance the "hyperv" Storage Volume is attached to.

func (StorageVolumesInstance) RawJSON

func (r StorageVolumesInstance) RawJSON() string

Returns the unmodified JSON received from the API

func (*StorageVolumesInstance) UnmarshalJSON

func (r *StorageVolumesInstance) UnmarshalJSON(data []byte) error

type StorageVolumesMetadata

type StorageVolumesMetadata struct {
	// List of IDs of "lxd" Compute instances which the "ceph" Storage Volume should be
	// attached to.
	AttachInstanceIDs []int64 `json:"attach_instance_ids"`
	// List of IDs of "lxd" Compute instances which the "ceph" Storage Volume should be
	// detached from.
	DetachInstanceIDs []int64 `json:"detach_instance_ids"`
	// The mpunt path of the "ceph" Storage Volume on the "lxd" Compute instances.
	MountPath string `json:"mount_path"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AttachInstanceIDs respjson.Field
		DetachInstanceIDs respjson.Field
		MountPath         respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The metadata object of "ceph" Storage Volumes

func (StorageVolumesMetadata) RawJSON

func (r StorageVolumesMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*StorageVolumesMetadata) UnmarshalJSON

func (r *StorageVolumesMetadata) UnmarshalJSON(data []byte) error

type StorageVolumesResponse

type StorageVolumesResponse struct {
	Content StorageVolumes `json:"content"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Content     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (StorageVolumesResponse) RawJSON

func (r StorageVolumesResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*StorageVolumesResponse) UnmarshalJSON

func (r *StorageVolumesResponse) UnmarshalJSON(data []byte) error

type StorageVolumesUpdateMetadataParam

type StorageVolumesUpdateMetadataParam struct {
	// The mount path for the Ceph file system volume inside the LXC instance.
	MountPath param.Opt[string] `json:"mount_path,omitzero"`
	// A list of IDs for running or stopped Compute Instances with the type "lxd" in
	// the project to mount this Ceph file system volume to. If not sent, it will
	// default to an empty list.
	AttachInstanceIDs []int64 `json:"attach_instance_ids,omitzero"`
	// A list of IDs for running or stopped Compute Instances with the type "lxd" in
	// the project to unmount this Ceph file system volume from. If not sent, it will
	// default to an empty list.
	DetachInstanceIDs []int64 `json:"detach_instance_ids,omitzero"`
	// contains filtered or unexported fields
}

Required if type is "cephfs".

Metadata for the Storage Volume drive with the type "cephfs".

func (StorageVolumesUpdateMetadataParam) MarshalJSON

func (r StorageVolumesUpdateMetadataParam) MarshalJSON() (data []byte, err error)

func (*StorageVolumesUpdateMetadataParam) UnmarshalJSON

func (r *StorageVolumesUpdateMetadataParam) UnmarshalJSON(data []byte) error

type StorageVolumesUpdateParam

type StorageVolumesUpdateParam struct {
	// The user-friendly name for the Storage Volume. If not sent, it will default to
	// current name.
	Name param.Opt[string] `json:"name,omitzero"`
	// Change the state of the Storage Volume, triggering the CloudCIX Robot to perform
	// the requested action. Users can only request state changes from certain current
	// states:
	//
	// - running -> update_running or delete
	State param.Opt[string] `json:"state,omitzero"`
	// Required if type is "cephfs".
	//
	// Metadata for the Storage Volume drive with the type "cephfs".
	Metadata StorageVolumesUpdateMetadataParam `json:"metadata,omitzero"`
	// List of specs (SKUs) for the Storage Volume drive. Only required if increasing
	// the current size of the Storage Volume.
	Specs []StorageVolumesUpdateSpecParam `json:"specs,omitzero"`
	// contains filtered or unexported fields
}

func (StorageVolumesUpdateParam) MarshalJSON

func (r StorageVolumesUpdateParam) MarshalJSON() (data []byte, err error)

func (*StorageVolumesUpdateParam) UnmarshalJSON

func (r *StorageVolumesUpdateParam) UnmarshalJSON(data []byte) error

type StorageVolumesUpdateSpecParam

type StorageVolumesUpdateSpecParam struct {
	// The quantity (GB) of the SKU to configure the Storage Volume drive with.
	Quantity param.Opt[int64] `json:"quantity,omitzero"`
	// The name of the SKU for the Storage Volume drive.
	SKUName param.Opt[string] `json:"sku_name,omitzero"`
	// contains filtered or unexported fields
}

func (StorageVolumesUpdateSpecParam) MarshalJSON

func (r StorageVolumesUpdateSpecParam) MarshalJSON() (data []byte, err error)

func (*StorageVolumesUpdateSpecParam) UnmarshalJSON

func (r *StorageVolumesUpdateSpecParam) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
packages
shared

Jump to

Keyboard shortcuts

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