Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type BaseIPAddress
- type BaseIPAddressPublicIP
- type Bom
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type ComputeBackup
- type ComputeBackupInstance
- type ComputeBackupListParams
- type ComputeBackupListResponse
- type ComputeBackupNewParams
- type ComputeBackupResponse
- type ComputeBackupService
- func (r *ComputeBackupService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *ComputeBackup, err error)
- func (r *ComputeBackupService) List(ctx context.Context, query ComputeBackupListParams, ...) (res *ComputeBackupListResponse, err error)
- func (r *ComputeBackupService) New(ctx context.Context, body ComputeBackupNewParams, opts ...option.RequestOption) (res *ComputeBackup, err error)
- func (r *ComputeBackupService) Update(ctx context.Context, id int64, body ComputeBackupUpdateParams, ...) (res *ComputeBackup, err error)
- type ComputeBackupUpdateParam
- type ComputeBackupUpdateParams
- type ComputeGPU
- type ComputeGPUAttachParams
- type ComputeGPUAttachParamsSpec
- type ComputeGPUInstance
- type ComputeGPUListParams
- type ComputeGPUListResponse
- type ComputeGPUResponse
- type ComputeGPUService
- func (r *ComputeGPUService) Attach(ctx context.Context, body ComputeGPUAttachParams, opts ...option.RequestOption) (res *ComputeGPU, err error)
- func (r *ComputeGPUService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *ComputeGPU, err error)
- func (r *ComputeGPUService) List(ctx context.Context, query ComputeGPUListParams, opts ...option.RequestOption) (res *ComputeGPUListResponse, err error)
- func (r *ComputeGPUService) Update(ctx context.Context, id int64, body ComputeGPUUpdateParams, ...) (res *ComputeGPU, err error)
- type ComputeGPUUpdateParam
- type ComputeGPUUpdateParams
- type ComputeImage
- type ComputeImageGetResponseEnvelope
- type ComputeImageListParams
- type ComputeImageListResponse
- type ComputeImageService
- type ComputeInstance
- type ComputeInstanceInterface
- type ComputeInstanceInterfaceIpv4Address
- type ComputeInstanceInterfaceIpv6Address
- type ComputeInstanceListParams
- type ComputeInstanceListResponse
- type ComputeInstanceMetadata
- type ComputeInstanceNewParams
- type ComputeInstanceNewParamsInterface
- type ComputeInstanceNewParamsInterfaceIpv4Address
- type ComputeInstanceNewParamsInterfaceIpv6Address
- type ComputeInstanceNewParamsMetadata
- type ComputeInstanceNewParamsSpec
- type ComputeInstanceResponse
- type ComputeInstanceService
- func (r *ComputeInstanceService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *ComputeInstance, err error)
- func (r *ComputeInstanceService) List(ctx context.Context, query ComputeInstanceListParams, ...) (res *ComputeInstanceListResponse, err error)
- func (r *ComputeInstanceService) New(ctx context.Context, body ComputeInstanceNewParams, ...) (res *ComputeInstance, err error)
- func (r *ComputeInstanceService) Update(ctx context.Context, id int64, body ComputeInstanceUpdateParams, ...) (res *ComputeInstance, err error)
- type ComputeInstanceUpdateInterfaceIpv4AddressParam
- type ComputeInstanceUpdateInterfaceIpv6AddressParam
- type ComputeInstanceUpdateInterfaceParam
- type ComputeInstanceUpdateMetadataParam
- type ComputeInstanceUpdateParam
- type ComputeInstanceUpdateParams
- type ComputeInstanceUpdateSpecParam
- type ComputeService
- type ComputeSnapshot
- type ComputeSnapshotInstance
- type ComputeSnapshotListParams
- type ComputeSnapshotListResponse
- type ComputeSnapshotMetadata
- type ComputeSnapshotNewParams
- type ComputeSnapshotResponse
- type ComputeSnapshotService
- func (r *ComputeSnapshotService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *ComputeSnapshot, err error)
- func (r *ComputeSnapshotService) List(ctx context.Context, query ComputeSnapshotListParams, ...) (res *ComputeSnapshotListResponse, err error)
- func (r *ComputeSnapshotService) New(ctx context.Context, body ComputeSnapshotNewParams, ...) (res *ComputeSnapshot, err error)
- func (r *ComputeSnapshotService) Update(ctx context.Context, id int64, body ComputeSnapshotUpdateParams, ...) (res *ComputeSnapshot, err error)
- type ComputeSnapshotUpdateParam
- type ComputeSnapshotUpdateParams
- type Error
- type ListMetadata
- type NetworkFirewall
- type NetworkFirewallListParams
- type NetworkFirewallListResponse
- type NetworkFirewallNewParams
- type NetworkFirewallNewParamsRule
- type NetworkFirewallResponse
- type NetworkFirewallRule
- type NetworkFirewallService
- func (r *NetworkFirewallService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *NetworkFirewall, err error)
- func (r *NetworkFirewallService) List(ctx context.Context, query NetworkFirewallListParams, ...) (res *NetworkFirewallListResponse, err error)
- func (r *NetworkFirewallService) New(ctx context.Context, body NetworkFirewallNewParams, ...) (res *NetworkFirewall, err error)
- func (r *NetworkFirewallService) Update(ctx context.Context, id int64, body NetworkFirewallUpdateParams, ...) (res *NetworkFirewall, err error)
- type NetworkFirewallUpdateParam
- type NetworkFirewallUpdateParams
- type NetworkFirewallUpdateRuleParam
- type NetworkIPGroup
- type NetworkIPGroupListParams
- type NetworkIPGroupListResponse
- type NetworkIPGroupNewParams
- type NetworkIPGroupResponse
- type NetworkIPGroupService
- func (r *NetworkIPGroupService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)
- func (r *NetworkIPGroupService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *NetworkIPGroup, err error)
- func (r *NetworkIPGroupService) List(ctx context.Context, query NetworkIPGroupListParams, ...) (res *NetworkIPGroupListResponse, err error)
- func (r *NetworkIPGroupService) New(ctx context.Context, body NetworkIPGroupNewParams, ...) (res *NetworkIPGroup, err error)
- func (r *NetworkIPGroupService) Update(ctx context.Context, id int64, body NetworkIPGroupUpdateParams, ...) (res *NetworkIPGroup, err error)
- type NetworkIPGroupUpdateParam
- type NetworkIPGroupUpdateParams
- type NetworkRouter
- type NetworkRouterListParams
- type NetworkRouterListResponse
- type NetworkRouterMetadata
- type NetworkRouterNetwork
- type NetworkRouterNewParams
- type NetworkRouterNewParamsMetadata
- type NetworkRouterNewParamsNetwork
- type NetworkRouterResponse
- type NetworkRouterService
- func (r *NetworkRouterService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *NetworkRouter, err error)
- func (r *NetworkRouterService) List(ctx context.Context, query NetworkRouterListParams, ...) (res *NetworkRouterListResponse, err error)
- func (r *NetworkRouterService) New(ctx context.Context, body NetworkRouterNewParams, opts ...option.RequestOption) (res *NetworkRouter, err error)
- func (r *NetworkRouterService) Update(ctx context.Context, id int64, body NetworkRouterUpdateParams, ...) (res *NetworkRouter, err error)
- type NetworkRouterUpdateMetadataParam
- type NetworkRouterUpdateNetworkParam
- type NetworkRouterUpdateParam
- type NetworkRouterUpdateParams
- type NetworkService
- type NetworkVpn
- type NetworkVpnListParams
- type NetworkVpnListResponse
- type NetworkVpnMetadata
- type NetworkVpnMetadataChildSa
- type NetworkVpnNewParams
- type NetworkVpnNewParamsMetadata
- type NetworkVpnNewParamsMetadataChildSa
- type NetworkVpnResponse
- type NetworkVpnService
- func (r *NetworkVpnService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *NetworkVpn, err error)
- func (r *NetworkVpnService) List(ctx context.Context, query NetworkVpnListParams, opts ...option.RequestOption) (res *NetworkVpnListResponse, err error)
- func (r *NetworkVpnService) New(ctx context.Context, body NetworkVpnNewParams, opts ...option.RequestOption) (res *NetworkVpn, err error)
- func (r *NetworkVpnService) Update(ctx context.Context, id int64, body NetworkVpnUpdateParams, ...) (res *NetworkVpn, err error)
- type NetworkVpnUpdateMetadataChildSaParam
- type NetworkVpnUpdateMetadataParam
- type NetworkVpnUpdateParam
- type NetworkVpnUpdateParams
- type Project
- type ProjectListParams
- type ProjectListResponse
- type ProjectNewParams
- type ProjectResponse
- type ProjectService
- func (r *ProjectService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *Project, err error)
- func (r *ProjectService) List(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) (res *ProjectListResponse, err error)
- func (r *ProjectService) New(ctx context.Context, body ProjectNewParams, opts ...option.RequestOption) (res *Project, err error)
- func (r *ProjectService) Update(ctx context.Context, id int64, body ProjectUpdateParams, ...) (res *Project, err error)
- type ProjectUpdateParam
- type ProjectUpdateParams
- type StorageService
- type StorageVolumeListParams
- type StorageVolumeListResponse
- type StorageVolumeNewParams
- type StorageVolumeNewParamsSpec
- type StorageVolumeService
- func (r *StorageVolumeService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *StorageVolumes, err error)
- func (r *StorageVolumeService) List(ctx context.Context, query StorageVolumeListParams, ...) (res *StorageVolumeListResponse, err error)
- func (r *StorageVolumeService) New(ctx context.Context, body StorageVolumeNewParams, opts ...option.RequestOption) (res *StorageVolumes, err error)
- func (r *StorageVolumeService) Update(ctx context.Context, id int64, body StorageVolumeUpdateParams, ...) (res *StorageVolumes, err error)
- type StorageVolumeUpdateParams
- type StorageVolumes
- type StorageVolumesContraInstance
- type StorageVolumesInstance
- type StorageVolumesMetadata
- type StorageVolumesResponse
- type StorageVolumesUpdateMetadataParam
- type StorageVolumesUpdateParam
- type StorageVolumesUpdateSpecParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 Opt ¶
func Opt[T comparable](v T) param.Opt[T]
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) UnmarshalJSON ¶
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.
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 ¶
func (r *ComputeBackupService) List(ctx context.Context, query ComputeBackupListParams, opts ...option.RequestOption) (res *ComputeBackupListResponse, err error)
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 ¶
func (r *ComputeBackupService) New(ctx context.Context, body ComputeBackupNewParams, opts ...option.RequestOption) (res *ComputeBackup, err error)
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 ¶
func (r *ComputeBackupService) Update(ctx context.Context, id int64, body ComputeBackupUpdateParams, opts ...option.RequestOption) (res *ComputeBackup, err error)
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 ¶
func (r *ComputeGPUService) List(ctx context.Context, query ComputeGPUListParams, opts ...option.RequestOption) (res *ComputeGPUListResponse, err error)
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
func (r ComputeImageGetResponseEnvelope) RawJSON() string
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 ¶
func (r *ComputeImageService) List(ctx context.Context, query ComputeImageListParams, opts ...option.RequestOption) (res *ComputeImageListResponse, err error)
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 ¶
func (r ComputeInstanceInterfaceIpv4Address) RawJSON() string
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 ¶
func (r ComputeInstanceInterfaceIpv6Address) RawJSON() string
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 ¶
func (r *ComputeInstanceService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *ComputeInstance, err error)
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 ¶
func (r *ComputeInstanceService) List(ctx context.Context, query ComputeInstanceListParams, opts ...option.RequestOption) (res *ComputeInstanceListResponse, err error)
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 ¶
func (r *ComputeInstanceService) New(ctx context.Context, body ComputeInstanceNewParams, opts ...option.RequestOption) (res *ComputeInstance, err error)
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 ¶
func (r *ComputeInstanceService) Update(ctx context.Context, id int64, body ComputeInstanceUpdateParams, opts ...option.RequestOption) (res *ComputeInstance, err error)
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 ¶
func (r *ComputeInstanceUpdateInterfaceIpv4AddressParam) UnmarshalJSON(data []byte) error
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 ¶
func (r *ComputeInstanceUpdateInterfaceIpv6AddressParam) UnmarshalJSON(data []byte) error
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 ¶
func (r *ComputeSnapshotService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *ComputeSnapshot, err error)
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 ¶
func (r *ComputeSnapshotService) List(ctx context.Context, query ComputeSnapshotListParams, opts ...option.RequestOption) (res *ComputeSnapshotListResponse, err error)
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 ¶
func (r *ComputeSnapshotService) New(ctx context.Context, body ComputeSnapshotNewParams, opts ...option.RequestOption) (res *ComputeSnapshot, err error)
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 ¶
func (r *ComputeSnapshotService) Update(ctx context.Context, id int64, body ComputeSnapshotUpdateParams, opts ...option.RequestOption) (res *ComputeSnapshot, err error)
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 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 ¶
func (r *NetworkFirewallService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *NetworkFirewall, err error)
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 ¶
func (r *NetworkFirewallService) List(ctx context.Context, query NetworkFirewallListParams, opts ...option.RequestOption) (res *NetworkFirewallListResponse, err error)
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 ¶
func (r *NetworkFirewallService) New(ctx context.Context, body NetworkFirewallNewParams, opts ...option.RequestOption) (res *NetworkFirewall, err error)
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 ¶
func (r *NetworkFirewallService) Update(ctx context.Context, id int64, body NetworkFirewallUpdateParams, opts ...option.RequestOption) (res *NetworkFirewall, err error)
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 ¶
func (r *NetworkIPGroupService) List(ctx context.Context, query NetworkIPGroupListParams, opts ...option.RequestOption) (res *NetworkIPGroupListResponse, err error)
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 ¶
func (r *NetworkIPGroupService) New(ctx context.Context, body NetworkIPGroupNewParams, opts ...option.RequestOption) (res *NetworkIPGroup, err error)
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 ¶
func (r *NetworkIPGroupService) Update(ctx context.Context, id int64, body NetworkIPGroupUpdateParams, opts ...option.RequestOption) (res *NetworkIPGroup, err error)
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 ¶
func (r *NetworkRouterService) List(ctx context.Context, query NetworkRouterListParams, opts ...option.RequestOption) (res *NetworkRouterListResponse, err error)
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 ¶
func (r *NetworkRouterService) New(ctx context.Context, body NetworkRouterNewParams, opts ...option.RequestOption) (res *NetworkRouter, err error)
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 ¶
func (r *NetworkRouterService) Update(ctx context.Context, id int64, body NetworkRouterUpdateParams, opts ...option.RequestOption) (res *NetworkRouter, err error)
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"`
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"`
//
// 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 ¶
func (r *NetworkVpnService) List(ctx context.Context, query NetworkVpnListParams, opts ...option.RequestOption) (res *NetworkVpnListResponse, err error)
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 ¶
func (r *NetworkVpnService) New(ctx context.Context, body NetworkVpnNewParams, opts ...option.RequestOption) (res *NetworkVpn, err error)
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"`
//
// 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) UnmarshalJSON ¶
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 ¶
func (r *ProjectService) List(ctx context.Context, query ProjectListParams, opts ...option.RequestOption) (res *ProjectListResponse, err error)
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 ¶
func (r *StorageVolumeService) List(ctx context.Context, query StorageVolumeListParams, opts ...option.RequestOption) (res *StorageVolumeListResponse, err error)
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 ¶
func (r *StorageVolumeService) New(ctx context.Context, body StorageVolumeNewParams, opts ...option.RequestOption) (res *StorageVolumes, err error)
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 ¶
func (r *StorageVolumeService) Update(ctx context.Context, id int64, body StorageVolumeUpdateParams, opts ...option.RequestOption) (res *StorageVolumes, err error)
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 ¶
func (r StorageVolumesContraInstance) RawJSON() string
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
Source Files
¶
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
|
|