cloudconnexa

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Overview

Package cloudconnexa provides a Go client library for the CloudConnexa API. It offers comprehensive functionality for managing VPN networks, hosts, connectors, routes, users, and other CloudConnexa resources through a simple Go interface.

Index

Constants

View Source
const (
	// InternetAccessSplitTunnelOn enables split tunneling for internet access.
	InternetAccessSplitTunnelOn = "SPLIT_TUNNEL_ON"
	// InternetAccessSplitTunnelOff disables split tunneling for internet access.
	InternetAccessSplitTunnelOff = "SPLIT_TUNNEL_OFF"
	// InternetAccessRestrictedInternet restricts internet access.
	InternetAccessRestrictedInternet = "RESTRICTED_INTERNET"
)

Variables

View Source
var ErrCredentialsRequired = errors.New("both client_id and client_secret credentials must be specified")

ErrCredentialsRequired is returned when client ID or client secret is missing.

View Source
var (
	// ErrDNSRecordNotFound is returned when a DNS record is not found.
	ErrDNSRecordNotFound = errors.New("dns record not found")
)
View Source
var (
	// ErrUserGroupNotFound is returned when a user group cannot be found
	ErrUserGroupNotFound = errors.New("user group not found")
)
View Source
var (
	// ErrUserNotFound is returned when a user cannot be found
	ErrUserNotFound = errors.New("user not found")
)

Functions

This section is empty.

Types

type AccessGroup added in v2.0.20

type AccessGroup struct {
	ID          string       `json:"id"`
	Name        string       `json:"name"`
	Description string       `json:"description,omitempty"`
	Source      []AccessItem `json:"source"`
	Destination []AccessItem `json:"destination"`
}

AccessGroup represents a group of access rules that define network access permissions. It contains source and destination rules that determine what resources can access each other.

type AccessGroupPageResponse added in v2.0.18

type AccessGroupPageResponse struct {
	Content          []AccessGroup `json:"content"`
	NumberOfElements int           `json:"numberOfElements"`
	Page             int           `json:"page"`
	Size             int           `json:"size"`
	Success          bool          `json:"success"`
	TotalElements    int           `json:"totalElements"`
	TotalPages       int           `json:"totalPages"`
}

AccessGroupPageResponse represents a paginated response from the CloudConnexa API containing a list of access groups and pagination metadata.

type AccessGroupsService added in v2.0.18

type AccessGroupsService service

AccessGroupsService handles communication with the CloudConnexa API for access group operations.

func (*AccessGroupsService) Create added in v2.0.18

func (c *AccessGroupsService) Create(accessGroup *AccessGroup) (*AccessGroup, error)

Create creates a new access group in the CloudConnexa API. It returns the created access group with its assigned ID.

func (*AccessGroupsService) Delete added in v2.0.18

func (c *AccessGroupsService) Delete(id string) error

Delete removes an access group from the CloudConnexa API by its ID.

func (*AccessGroupsService) Get added in v2.0.18

Get retrieves a specific access group by its ID from the CloudConnexa API.

func (*AccessGroupsService) GetAccessGroupsByPage added in v2.0.18

func (c *AccessGroupsService) GetAccessGroupsByPage(page int, size int) (AccessGroupPageResponse, error)

GetAccessGroupsByPage retrieves a paginated list of access groups from the CloudConnexa API. It returns the access groups for the specified page and page size.

func (*AccessGroupsService) GetByName added in v2.3.3

func (c *AccessGroupsService) GetByName(name string) (*AccessGroup, error)

GetByName retrieves an access group by its name name: The name of the access group to retrieve Returns the access group and any error that occurred

func (*AccessGroupsService) List added in v2.0.18

func (c *AccessGroupsService) List() ([]AccessGroup, error)

List retrieves all access groups from the CloudConnexa API. It handles pagination internally and returns a complete list of access groups.

func (*AccessGroupsService) Update added in v2.0.18

func (c *AccessGroupsService) Update(id string, accessGroup *AccessGroup) (*AccessGroup, error)

Update updates an existing access group in the CloudConnexa API. It returns the updated access group.

type AccessItem added in v2.0.20

type AccessItem struct {
	Type       string   `json:"type"`
	AllCovered bool     `json:"allCovered"`
	Parent     string   `json:"parent,omitempty"`
	Children   []string `json:"children,omitempty"`
}

AccessItem represents a single access rule item that can be either a source or destination. It defines what resources are covered by the access rule and their relationships.

type Application added in v2.0.5

type Application struct {
	Name            string              `json:"name"`
	Description     string              `json:"description"`
	NetworkItemType string              `json:"networkItemType"`
	NetworkItemID   string              `json:"networkItemId"`
	ID              string              `json:"id"`
	Routes          []*ApplicationRoute `json:"routes"`
	Config          *ApplicationConfig  `json:"config"`
}

Application represents a host application with its configuration and routing information.

type ApplicationConfig added in v2.0.5

type ApplicationConfig struct {
	CustomServiceTypes []*CustomApplicationType `json:"customServiceTypes"`
	ServiceTypes       []string                 `json:"serviceTypes"`
}

ApplicationConfig represents the configuration for an application including custom service types and predefined service types.

type ApplicationPageResponse added in v2.0.5

type ApplicationPageResponse struct {
	Content          []ApplicationResponse `json:"content"`
	NumberOfElements int                   `json:"numberOfElements"`
	Page             int                   `json:"page"`
	Size             int                   `json:"size"`
	Success          bool                  `json:"success"`
	TotalElements    int                   `json:"totalElements"`
	TotalPages       int                   `json:"totalPages"`
}

ApplicationPageResponse represents a paginated response from the CloudConnexa API containing a list of applications and pagination metadata.

type ApplicationResponse added in v2.0.5

type ApplicationResponse struct {
	Application
	Routes []*Route `json:"routes"`
}

ApplicationResponse represents the response structure for application operations, extending the base Application with additional route information.

type ApplicationRoute added in v2.0.5

type ApplicationRoute struct {
	Value           string `json:"value"`
	AllowEmbeddedIP bool   `json:"allowEmbeddedIp"`
}

ApplicationRoute represents a route configuration for an application.

type Client

type Client struct {
	BaseURL           string
	Token             string
	ReadRateLimiter   *rate.Limiter
	UpdateRateLimiter *rate.Limiter

	UserAgent string

	HostConnectors      *HostConnectorsService
	NetworkConnectors   *NetworkConnectorsService
	DNSRecords          *DNSRecordsService
	Hosts               *HostsService
	HostIPServices      *HostIPServicesService
	NetworkIPServices   *NetworkIPServicesService
	HostApplications    *HostApplicationsService
	NetworkApplications *NetworkApplicationsService
	Networks            *NetworksService
	Routes              *RoutesService
	HostRoutes          *HostRoutesService
	Users               *UsersService
	UserGroups          *UserGroupsService
	VPNRegions          *VPNRegionsService
	LocationContexts    *LocationContextsService
	AccessGroups        *AccessGroupsService
	Settings            *SettingsService
	Sessions            *SessionsService
	Devices             *DevicesService
	// contains filtered or unexported fields
}

Client represents a CloudConnexa API client with all service endpoints.

func NewClient

func NewClient(baseURL, clientID, clientSecret string) (*Client, error)

NewClient creates a new CloudConnexa API client with the given credentials. It authenticates using OAuth2 client credentials flow and returns a configured client.

func (*Client) AssignLimits added in v2.3.0

func (c *Client) AssignLimits(res *http.Response, rateLimiter *rate.Limiter) error

AssignLimits adjusts the rate limiter according to values received in response headers from the API

func (*Client) DoRequest

func (c *Client) DoRequest(req *http.Request) ([]byte, error)

DoRequest executes an HTTP request with authentication and rate limiting. It automatically adds the Bearer token, sets headers, and handles errors.

func (*Client) GetV1Url added in v2.0.20

func (c *Client) GetV1Url() string

GetV1Url returns the base URL for CloudConnexa API v1 endpoints.

type CountryCheck added in v2.0.20

type CountryCheck struct {
	Allowed   bool     `json:"allowed"`
	Countries []string `json:"countries"`
}

CountryCheck represents the country-based access control configuration.

type Credentials

type Credentials struct {
	AccessToken string `json:"access_token"`
}

Credentials represents the OAuth2 token response from CloudConnexa API.

type CustomApplicationType added in v2.0.5

type CustomApplicationType struct {
	IcmpType []Range `json:"icmpType"`
	Port     []Range `json:"port"`
	Protocol string  `json:"protocol"`
}

CustomApplicationType represents a custom application type configuration.

type CustomIPServiceType

type CustomIPServiceType struct {
	IcmpType []Range `json:"icmpType"`
	Port     []Range `json:"port"`
	Protocol string  `json:"protocol"`
}

CustomIPServiceType represents a custom IP service type configuration with ICMP type, port ranges, and protocol.

type DNSRecord added in v2.1.0

type DNSRecord struct {
	ID            string   `json:"id"`
	Domain        string   `json:"domain"`
	Description   string   `json:"description"`
	IPV4Addresses []string `json:"ipv4Addresses"`
	IPV6Addresses []string `json:"ipv6Addresses"`
}

DNSRecord represents a DNS record in CloudConnexa.

type DNSRecordPageResponse added in v2.1.0

type DNSRecordPageResponse struct {
	Content          []DNSRecord `json:"content"`
	NumberOfElements int         `json:"numberOfElements"`
	Page             int         `json:"page"`
	Size             int         `json:"size"`
	Success          bool        `json:"success"`
	TotalElements    int         `json:"totalElements"`
	TotalPages       int         `json:"totalPages"`
}

DNSRecordPageResponse represents a paginated response of DNS records.

type DNSRecordsService

type DNSRecordsService service

DNSRecordsService provides methods for managing DNS records.

func (*DNSRecordsService) Create

func (c *DNSRecordsService) Create(record DNSRecord) (*DNSRecord, error)

Create creates a new DNS record.

func (*DNSRecordsService) Delete

func (c *DNSRecordsService) Delete(recordID string) error

Delete deletes a DNS record by ID.

func (*DNSRecordsService) GetByID added in v2.2.0

func (c *DNSRecordsService) GetByID(recordID string) (*DNSRecord, error)

GetByID retrieves a specific DNS record by ID using the direct API endpoint. This is the preferred method for getting a single DNS record as it uses the direct GET /api/v1/dns-records/{id} endpoint introduced in API v1.1.0.

func (*DNSRecordsService) GetByPage

func (c *DNSRecordsService) GetByPage(page int, pageSize int) (DNSRecordPageResponse, error)

GetByPage retrieves DNS records using pagination.

func (*DNSRecordsService) GetDNSRecord added in v2.1.0

func (c *DNSRecordsService) GetDNSRecord(recordID string) (*DNSRecord, error)

GetDNSRecord retrieves a specific DNS record by ID using pagination search. Deprecated: Use GetByID() instead for better performance with the direct API endpoint.

func (*DNSRecordsService) List added in v2.4.0

func (c *DNSRecordsService) List() ([]DNSRecord, error)

List retrieves all DNS records by paginating through all available pages. Returns a slice of DNS records and any error that occurred.

func (*DNSRecordsService) Update

func (c *DNSRecordsService) Update(record DNSRecord) error

Update updates an existing DNS record.

type DNSServers added in v2.1.1

type DNSServers struct {
	PrimaryIPV4   string `json:"primaryIpV4,omitempty"`
	SecondaryIPV4 string `json:"secondaryIpV4,omitempty"`
}

DNSServers represents DNS server configuration with primary and secondary IPv4 addresses

type DNSZone added in v2.1.1

type DNSZone struct {
	Name      string   `json:"name"`
	Addresses []string `json:"addresses"`
}

DNSZone represents a single DNS zone with name and associated addresses

type DNSZones added in v2.1.1

type DNSZones struct {
	Zones []DNSZone `json:"zones"`
}

DNSZones represents a collection of DNS zones

type DeadPeerDetection added in v2.3.1

type DeadPeerDetection struct {
	TimeoutSec       int    `json:"timeoutSec,omitempty"`
	DeadPeerHandling string `json:"deadPeerHandling,omitempty"`
}

DeadPeerDetection represents a dead peer detection configuration used in ipsec.

type DefaultCheck added in v2.0.20

type DefaultCheck struct {
	Allowed bool `json:"allowed"`
}

DefaultCheck represents the default access control configuration.

type Device

type Device struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	IPv4Address string `json:"ipV4Address"`
	IPv6Address string `json:"ipV6Address"`
}

Device represents a user device configuration

type DeviceDetail added in v2.2.0

type DeviceDetail struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Platform    string `json:"platform,omitempty"`
	Status      string `json:"status"`
	UserID      string `json:"userId"`
}

DeviceDetail represents a device in CloudConnexa. Fields match the API v1.2.0 DeviceResponse schema.

type DeviceListOptions added in v2.2.0

type DeviceListOptions struct {
	UserID string `json:"userId,omitempty"`
	Page   int    `json:"page,omitempty"`
	Size   int    `json:"size,omitempty"`
}

DeviceListOptions represents the options for listing devices.

type DevicePageResponse added in v2.2.0

type DevicePageResponse struct {
	Content          []DeviceDetail `json:"content"`
	NumberOfElements int            `json:"numberOfElements"`
	Page             int            `json:"page"`
	Size             int            `json:"size"`
	Success          bool           `json:"success"`
	TotalElements    int            `json:"totalElements"`
	TotalPages       int            `json:"totalPages"`
}

DevicePageResponse represents a paginated response of devices.

type DeviceStatus added in v2.2.0

type DeviceStatus string

DeviceStatus represents the possible statuses of a device.

const (
	// DeviceStatusActive represents an active device.
	DeviceStatusActive DeviceStatus = "ACTIVE"
	// DeviceStatusInactive represents an inactive device.
	DeviceStatusInactive DeviceStatus = "INACTIVE"
	// DeviceStatusBlocked represents a blocked device.
	DeviceStatusBlocked DeviceStatus = "BLOCKED"
	// DeviceStatusPending represents a pending device.
	DeviceStatusPending DeviceStatus = "PENDING"
)

type DeviceType added in v2.2.0

type DeviceType string

DeviceType represents the type of device.

const (
	// DeviceTypeClient represents a client device.
	DeviceTypeClient DeviceType = "CLIENT"
	// DeviceTypeConnector represents a connector device.
	DeviceTypeConnector DeviceType = "CONNECTOR"
)

type DeviceUpdateRequest added in v2.2.0

type DeviceUpdateRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

DeviceUpdateRequest represents the request body for updating a device.

type DevicesService added in v2.2.0

type DevicesService service

DevicesService provides methods for managing devices.

func (*DevicesService) GetByID added in v2.2.0

func (d *DevicesService) GetByID(deviceID string) (*DeviceDetail, error)

GetByID retrieves a specific device by its ID.

func (*DevicesService) GetByPage added in v2.2.0

func (d *DevicesService) GetByPage(page int, pageSize int) (*DevicePageResponse, error)

GetByPage retrieves devices using pagination.

func (*DevicesService) List added in v2.2.0

List retrieves a list of devices with optional filtering and pagination.

func (*DevicesService) ListAll added in v2.2.0

func (d *DevicesService) ListAll() ([]DeviceDetail, error)

ListAll retrieves all devices by paginating through all available pages.

func (*DevicesService) ListByUserID added in v2.2.0

func (d *DevicesService) ListByUserID(userID string) ([]DeviceDetail, error)

ListByUserID retrieves all devices for a specific user.

func (*DevicesService) Update added in v2.2.0

func (d *DevicesService) Update(deviceID string, updateRequest DeviceUpdateRequest) (*DeviceDetail, error)

Update updates an existing device by its ID.

func (*DevicesService) UpdateDescription added in v2.2.0

func (d *DevicesService) UpdateDescription(deviceID string, description string) (*DeviceDetail, error)

UpdateDescription updates the description of a device.

func (*DevicesService) UpdateName added in v2.2.0

func (d *DevicesService) UpdateName(deviceID string, name string) (*DeviceDetail, error)

UpdateName updates the name of a device.

type DomainRoutingSubnet added in v2.1.1

type DomainRoutingSubnet struct {
	IPV4Address string `json:"ipV4Address"`
	IPV6Address string `json:"ipV6Address"`
}

DomainRoutingSubnet represents subnet configuration for domain routing with IPv4 and IPv6 addresses

type ErrClientResponse added in v2.0.14

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

ErrClientResponse represents an error response from the CloudConnexa API.

func (ErrClientResponse) Body added in v2.4.0

func (e ErrClientResponse) Body() string

Body returns the raw response body of the API error response.

func (ErrClientResponse) Error added in v2.0.14

func (e ErrClientResponse) Error() string

func (ErrClientResponse) StatusCode added in v2.4.0

func (e ErrClientResponse) StatusCode() int

StatusCode returns the HTTP status code of the API error response.

type Host

type Host struct {
	ID             string          `json:"id,omitempty"`
	Name           string          `json:"name"`
	Description    string          `json:"description"`
	Domain         string          `json:"domain,omitempty"`
	InternetAccess string          `json:"internetAccess"`
	SystemSubnets  []string        `json:"systemSubnets"`
	Connectors     []HostConnector `json:"connectors"`
}

Host represents a host in CloudConnexa.

type HostApplicationsService added in v2.0.22

type HostApplicationsService service

HostApplicationsService handles communication with the CloudConnexa API for host application operations.

func (*HostApplicationsService) Create added in v2.0.22

func (c *HostApplicationsService) Create(application *Application) (*ApplicationResponse, error)

Create creates a new host application.

func (*HostApplicationsService) Delete added in v2.0.22

func (c *HostApplicationsService) Delete(id string) error

Delete removes a host application by its ID.

func (*HostApplicationsService) Get added in v2.0.22

Get retrieves a specific host application by its ID.

func (*HostApplicationsService) GetApplicationsByPage added in v2.0.22

func (c *HostApplicationsService) GetApplicationsByPage(page int, pageSize int) (ApplicationPageResponse, error)

GetApplicationsByPage retrieves a paginated list of host applications from the CloudConnexa API. It returns the applications for the specified page and page size.

func (*HostApplicationsService) GetByName added in v2.3.3

GetByName retrieves an application by its name name: The name of the application to retrieve Returns the application and any error that occurred

func (*HostApplicationsService) List added in v2.0.22

List retrieves all host applications from the CloudConnexa API. It handles pagination internally and returns a complete list of applications.

func (*HostApplicationsService) Update added in v2.0.22

func (c *HostApplicationsService) Update(id string, application *Application) (*ApplicationResponse, error)

Update updates an existing host application by its ID.

type HostConnector added in v2.0.22

type HostConnector struct {
	ID               string `json:"id,omitempty"`
	Name             string `json:"name"`
	Description      string `json:"description,omitempty"`
	NetworkItemID    string `json:"networkItemId"`
	NetworkItemType  string `json:"networkItemType"`
	VpnRegionID      string `json:"vpnRegionId"`
	IPv4Address      string `json:"ipV4Address"`
	IPv6Address      string `json:"ipV6Address"`
	Profile          string `json:"profile"`
	ConnectionStatus string `json:"connectionStatus"`
	Licensed         bool   `json:"licensed"`
}

HostConnector represents a host connector in CloudConnexa.

type HostConnectorPageResponse added in v2.0.22

type HostConnectorPageResponse struct {
	Content          []HostConnector `json:"content"`
	NumberOfElements int             `json:"numberOfElements"`
	Page             int             `json:"page"`
	Size             int             `json:"size"`
	Success          bool            `json:"success"`
	TotalElements    int             `json:"totalElements"`
	TotalPages       int             `json:"totalPages"`
}

HostConnectorPageResponse represents a paginated response of host connectors.

type HostConnectorsService added in v2.0.22

type HostConnectorsService service

HostConnectorsService provides methods for managing host connectors.

func (*HostConnectorsService) Activate added in v2.4.0

func (c *HostConnectorsService) Activate(connectorID string) error

Activate activates a suspended host connector. connectorID: The ID of the connector to activate Returns any error that occurred

func (*HostConnectorsService) Create added in v2.0.22

func (c *HostConnectorsService) Create(connector HostConnector, hostID string) (*HostConnector, error)

Create creates a new host connector for the specified host.

func (*HostConnectorsService) Delete added in v2.0.22

func (c *HostConnectorsService) Delete(connectorID string, hostID string) error

Delete deletes a host connector by ID.

func (*HostConnectorsService) GetByID added in v2.0.22

func (c *HostConnectorsService) GetByID(id string) (*HostConnector, error)

GetByID retrieves a specific host connector by ID.

func (*HostConnectorsService) GetByName added in v2.3.3

func (c *HostConnectorsService) GetByName(name string) (*HostConnector, error)

GetByName retrieves a connector by its name name: The name of the connector to retrieve Returns the connector and any error that occurred

func (*HostConnectorsService) GetByPage added in v2.0.22

func (c *HostConnectorsService) GetByPage(page int, pageSize int) (HostConnectorPageResponse, error)

GetByPage retrieves host connectors using pagination.

func (*HostConnectorsService) GetByPageAndHostID added in v2.1.0

func (c *HostConnectorsService) GetByPageAndHostID(page int, pageSize int, hostID string) (HostConnectorPageResponse, error)

GetByPageAndHostID retrieves host connectors using pagination, optionally filtered by host ID.

func (*HostConnectorsService) GetProfile added in v2.0.22

func (c *HostConnectorsService) GetProfile(id string) (string, error)

GetProfile retrieves the profile configuration for a host connector.

func (*HostConnectorsService) GetToken added in v2.0.22

func (c *HostConnectorsService) GetToken(id string) (string, error)

GetToken retrieves an encrypted token for a host connector.

func (*HostConnectorsService) List added in v2.0.22

func (c *HostConnectorsService) List() ([]HostConnector, error)

List retrieves all host connectors.

func (*HostConnectorsService) ListByHostID added in v2.1.0

func (c *HostConnectorsService) ListByHostID(hostID string) ([]HostConnector, error)

ListByHostID retrieves all host connectors for a specific host ID.

func (*HostConnectorsService) Suspend added in v2.4.0

func (c *HostConnectorsService) Suspend(connectorID string) error

Suspend suspends an active host connector. connectorID: The ID of the connector to suspend Returns any error that occurred

func (*HostConnectorsService) Update added in v2.0.22

func (c *HostConnectorsService) Update(connector HostConnector) (*HostConnector, error)

Update updates an existing host connector.

type HostIPServicePageResponse added in v2.2.1

type HostIPServicePageResponse struct {
	Content          []HostIPServiceResponse `json:"content"`
	NumberOfElements int                     `json:"numberOfElements"`
	Page             int                     `json:"page"`
	Size             int                     `json:"size"`
	Success          bool                    `json:"success"`
	TotalElements    int                     `json:"totalElements"`
	TotalPages       int                     `json:"totalPages"`
}

HostIPServicePageResponse represents a paginated response from the CloudConnexa API containing a list of IP services and pagination metadata.

type HostIPServiceResponse added in v2.2.1

type HostIPServiceResponse struct {
	Name            string           `json:"name"`
	Description     string           `json:"description"`
	NetworkItemType string           `json:"networkItemType"`
	NetworkItemID   string           `json:"networkItemId"`
	ID              string           `json:"id"`
	Type            string           `json:"type"`
	Config          *IPServiceConfig `json:"config"`
}

HostIPServiceResponse represents the response structure for IP service operations. Updated for API v1.1.0: Removed duplicate routing information to match the simplified DTO.

type HostIPServicesService added in v2.0.22

type HostIPServicesService service

HostIPServicesService provides methods for managing IP services.

func (*HostIPServicesService) Create added in v2.0.22

func (c *HostIPServicesService) Create(ipService *IPService) (*HostIPServiceResponse, error)

Create creates a new IP service.

func (*HostIPServicesService) Delete added in v2.0.22

func (c *HostIPServicesService) Delete(ipServiceID string) error

Delete removes an IP service by its ID.

func (*HostIPServicesService) Get added in v2.0.22

Get retrieves a specific IP service by its ID.

func (*HostIPServicesService) GetByName added in v2.3.3

GetByName retrieves an IP Service by its name name: The name of the IP Service to retrieve Returns the IP Service and any error that occurred

func (*HostIPServicesService) GetIPByPage added in v2.0.22

func (c *HostIPServicesService) GetIPByPage(page int, pageSize int) (HostIPServicePageResponse, error)

GetIPByPage retrieves IP services using pagination.

func (*HostIPServicesService) List added in v2.0.22

List retrieves all IP services by paginating through all available pages.

func (*HostIPServicesService) Update added in v2.0.22

Update updates an existing IP service by its ID.

type HostPageResponse

type HostPageResponse struct {
	Content          []Host `json:"content"`
	NumberOfElements int    `json:"numberOfElements"`
	Page             int    `json:"page"`
	Size             int    `json:"size"`
	Success          bool   `json:"success"`
	TotalElements    int    `json:"totalElements"`
	TotalPages       int    `json:"totalPages"`
}

HostPageResponse represents a paginated response of hosts.

type HostRoute added in v2.4.0

type HostRoute struct {
	ID              string `json:"id,omitempty"`
	Type            string `json:"type,omitempty"`
	Subnet          string `json:"subnet,omitempty"`
	Domain          string `json:"domain,omitempty"`
	Description     string `json:"description,omitempty"`
	ParentRouteID   string `json:"parentRouteId,omitempty"`
	NetworkItemID   string `json:"networkItemId,omitempty"`
	AllowEmbeddedIP bool   `json:"allowEmbeddedIp,omitempty"`
}

HostRoute represents a host route configuration.

type HostRoutePageResponse added in v2.4.0

type HostRoutePageResponse struct {
	Success          bool        `json:"success"`
	Content          []HostRoute `json:"content"`
	TotalElements    int         `json:"totalElements"`
	TotalPages       int         `json:"totalPages"`
	NumberOfElements int         `json:"numberOfElements"`
	Page             int         `json:"page"`
	Size             int         `json:"size"`
}

HostRoutePageResponse represents a paginated response of host routes.

type HostRoutesService added in v2.4.0

type HostRoutesService service

HostRoutesService provides methods for managing host routes.

func (*HostRoutesService) Create added in v2.4.0

func (c *HostRoutesService) Create(hostID string, route HostRoute) (*HostRoute, error)

Create creates a new route for a host. hostID: The ID of the host to create the route for route: The route configuration to create Returns the created route and any error that occurred

func (*HostRoutesService) Delete added in v2.4.0

func (c *HostRoutesService) Delete(routeID string) error

Delete removes a host route by its ID. routeID: The ID of the route to delete Returns any error that occurred during deletion

func (*HostRoutesService) GetByID added in v2.4.0

func (c *HostRoutesService) GetByID(routeID string) (*HostRoute, error)

GetByID retrieves a specific host route by its ID. routeID: The ID of the route to retrieve Returns the route and any error that occurred

func (*HostRoutesService) GetByPage added in v2.4.0

func (c *HostRoutesService) GetByPage(hostID string, page int, size int) (HostRoutePageResponse, error)

GetByPage retrieves host routes using pagination. hostID: The ID of the host to get routes for page: The page number to retrieve size: The number of items per page Returns a page of routes and any error that occurred

func (*HostRoutesService) List added in v2.4.0

func (c *HostRoutesService) List(hostID string) ([]HostRoute, error)

List retrieves all routes for a host by paginating through all available pages. hostID: The ID of the host to get routes for Returns a slice of routes and any error that occurred

func (*HostRoutesService) Update added in v2.4.0

func (c *HostRoutesService) Update(route HostRoute) error

Update updates an existing host route. route: The updated route configuration (must include ID) Returns any error that occurred during the update

type HostsService

type HostsService service

HostsService provides methods for managing hosts.

func (*HostsService) Create

func (c *HostsService) Create(host Host) (*Host, error)

Create creates a new host.

func (*HostsService) Delete

func (c *HostsService) Delete(hostID string) error

Delete deletes a host by ID.

func (*HostsService) Get

func (c *HostsService) Get(id string) (*Host, error)

Get retrieves a specific host by ID.

func (*HostsService) GetByName

func (c *HostsService) GetByName(name string) (*Host, error)

GetByName retrieves a host by its name name: The name of the host to retrieve Returns the host and any error that occurred

func (*HostsService) GetHostsByPage

func (c *HostsService) GetHostsByPage(page int, size int) (HostPageResponse, error)

GetHostsByPage retrieves hosts using pagination.

func (*HostsService) List

func (c *HostsService) List() ([]Host, error)

List retrieves all hosts.

func (*HostsService) Update

func (c *HostsService) Update(host Host) error

Update updates an existing host.

type IP added in v2.1.0

type IP struct {
	IP          string `json:"ip"`
	Description string `json:"description"`
}

IP represents an IP address with its description.

type IPCheck added in v2.1.0

type IPCheck struct {
	Allowed bool `json:"allowed"`
	Ips     []IP `json:"ips"`
}

IPCheck represents the IP-based access control configuration.

type IPSecConfig added in v2.3.1

type IPSecConfig struct {
	Platform                     string      `json:"platform,omitempty"`
	ConnectorState               string      `json:"connectorState,omitempty"`
	AuthenticationType           string      `json:"authenticationType,omitempty"`
	RemoteSitePublicIP           string      `json:"remoteSitePublicIp,omitempty"`
	PreSharedKey                 string      `json:"preSharedKey,omitempty"`
	CaCertificate                string      `json:"caCertificate,omitempty"`
	CaCertificateFileName        string      `json:"caCertificateFileName,omitempty"`
	PeerCertificate              string      `json:"peerCertificate,omitempty"`
	RemoteGatewayCertificate     string      `json:"remoteGatewayCertificate,omitempty"`
	PeerCertificatePrivateKey    string      `json:"peerCertificatePrivateKey,omitempty"`
	PeerCertificateKeyPassphrase string      `json:"peerCertificateKeyPassphrase,omitempty"`
	PairedAwsConnectorID         string      `json:"pairedAwsConnectorId,omitempty"`
	IkeProtocol                  IkeProtocol `json:"ikeProtocol,omitempty"`
	ServerID                     string      `json:"serverId,omitempty"`
	ServerIP                     string      `json:"serverIp,omitempty"`
	Hostname                     string      `json:"hostname,omitempty"`
	Domain                       string      `json:"domain,omitempty"`
}

IPSecConfig represents a network connector ipsec configuration.

type IPService

type IPService struct {
	Name            string            `json:"name"`
	Description     string            `json:"description"`
	NetworkItemType string            `json:"networkItemType"`
	NetworkItemID   string            `json:"networkItemId"`
	ID              string            `json:"id"`
	Type            string            `json:"type"`
	Routes          []*IPServiceRoute `json:"routes"`
	Config          *IPServiceConfig  `json:"config"`
}

IPService represents an IP service with its configuration and routing information.

type IPServiceConfig

type IPServiceConfig struct {
	CustomServiceTypes []*CustomIPServiceType `json:"customServiceTypes"`
	ServiceTypes       []string               `json:"serviceTypes"`
}

IPServiceConfig represents the configuration for an IP service including custom service types and predefined service types.

type IPServiceRoute added in v2.0.1

type IPServiceRoute struct {
	Description string `json:"description"`
	Value       string `json:"value"`
}

IPServiceRoute represents a route configuration for an IP service.

type IkeProtocol added in v2.3.1

type IkeProtocol struct {
	ProtocolVersion   string            `json:"protocolVersion,omitempty"`
	Phase1            Phase             `json:"phase1,omitempty"`
	Phase2            Phase             `json:"phase2,omitempty"`
	Rekey             Rekey             `json:"rekey,omitempty"`
	DeadPeerDetection DeadPeerDetection `json:"deadPeerDetection,omitempty"`
	StartupAction     string            `json:"startupAction,omitempty"`
}

IkeProtocol represents an ike protocol configuration for ipsec config.

type Item added in v2.0.18

type Item struct {
	ID string `json:"id"`
}

Item represents a basic resource with an identifier.

type LocationContext added in v2.0.16

type LocationContext struct {
	ID            string        `json:"id"`
	Name          string        `json:"name"`
	Description   string        `json:"description,omitempty"`
	UserGroupsIDs []string      `json:"userGroupsIds"`
	IPCheck       *IPCheck      `json:"ipCheck,omitempty"`
	CountryCheck  *CountryCheck `json:"countryCheck,omitempty"`
	DefaultCheck  *DefaultCheck `json:"defaultCheck"`
}

LocationContext represents a location context in CloudConnexa with its associated checks and user groups.

type LocationContextPageResponse added in v2.0.16

type LocationContextPageResponse struct {
	Content          []LocationContext `json:"content"`
	NumberOfElements int               `json:"numberOfElements"`
	Page             int               `json:"page"`
	Size             int               `json:"size"`
	Success          bool              `json:"success"`
	TotalElements    int               `json:"totalElements"`
	TotalPages       int               `json:"totalPages"`
}

LocationContextPageResponse represents a paginated response from the CloudConnexa API containing a list of location contexts and pagination metadata.

type LocationContextsService added in v2.0.16

type LocationContextsService service

LocationContextsService provides methods for managing location contexts.

func (*LocationContextsService) Create added in v2.0.16

func (c *LocationContextsService) Create(locationContext *LocationContext) (*LocationContext, error)

Create creates a new location context.

func (*LocationContextsService) Delete added in v2.0.16

func (c *LocationContextsService) Delete(id string) error

Delete removes a location context by its ID.

func (*LocationContextsService) Get added in v2.0.16

Get retrieves a specific location context by its ID.

func (*LocationContextsService) GetByName added in v2.3.3

func (c *LocationContextsService) GetByName(name string) (*LocationContext, error)

GetByName retrieves a location context by its name name: The name of the location context to retrieve Returns the location context and any error that occurred

func (*LocationContextsService) GetLocationContextByPage added in v2.0.16

func (c *LocationContextsService) GetLocationContextByPage(page int, pageSize int) (LocationContextPageResponse, error)

GetLocationContextByPage retrieves location contexts using pagination.

func (*LocationContextsService) List added in v2.0.16

List retrieves all location contexts by paginating through all available pages.

func (*LocationContextsService) Update added in v2.0.16

func (c *LocationContextsService) Update(id string, locationContext *LocationContext) (*LocationContext, error)

Update updates an existing location context by its ID.

type Network

type Network struct {
	ID                string             `json:"id"`
	Name              string             `json:"name"`
	Description       string             `json:"description"`
	Egress            bool               `json:"egress"`
	InternetAccess    string             `json:"internetAccess"`
	SystemSubnets     []string           `json:"systemSubnets"`
	Connectors        []NetworkConnector `json:"connectors"`
	Routes            []Route            `json:"routes"`
	TunnelingProtocol string             `json:"tunnelingProtocol"`
}

Network represents a network in CloudConnexa.

type NetworkApplicationsService added in v2.0.22

type NetworkApplicationsService service

NetworkApplicationsService provides methods for managing network applications.

func (*NetworkApplicationsService) Create added in v2.0.22

Create creates a new network application.

func (*NetworkApplicationsService) Delete added in v2.0.22

func (c *NetworkApplicationsService) Delete(id string) error

Delete removes a network application by its ID.

func (*NetworkApplicationsService) Get added in v2.0.22

Get retrieves a specific network application by its ID.

func (*NetworkApplicationsService) GetApplicationsByPage added in v2.0.22

func (c *NetworkApplicationsService) GetApplicationsByPage(page int, pageSize int) (ApplicationPageResponse, error)

GetApplicationsByPage retrieves network applications using pagination.

func (*NetworkApplicationsService) GetByName added in v2.3.3

GetByName retrieves a network application by its name name: The name of the network application to retrieve Returns the network application and any error that occurred

func (*NetworkApplicationsService) List added in v2.0.22

List retrieves all network applications by paginating through all available pages.

func (*NetworkApplicationsService) Update added in v2.0.22

func (c *NetworkApplicationsService) Update(id string, application *Application) (*ApplicationResponse, error)

Update updates an existing network application by its ID.

type NetworkConnector

type NetworkConnector struct {
	ID                string       `json:"id,omitempty"`
	Name              string       `json:"name"`
	Description       string       `json:"description,omitempty"`
	NetworkItemID     string       `json:"networkItemId"`
	NetworkItemType   string       `json:"networkItemType"`
	VpnRegionID       string       `json:"vpnRegionId"`
	IPv4Address       string       `json:"ipV4Address"`
	IPv6Address       string       `json:"ipV6Address"`
	Profile           string       `json:"profile"`
	ConnectionStatus  string       `json:"connectionStatus"`
	IPSecConfig       *IPSecConfig `json:"ipSecConfig,omitempty"`
	TunnelingProtocol string       `json:"tunnelingProtocol"`
	Licensed          bool         `json:"licensed"`
}

NetworkConnector represents a network connector configuration.

type NetworkConnectorPageResponse added in v2.0.22

type NetworkConnectorPageResponse struct {
	Content          []NetworkConnector `json:"content"`
	NumberOfElements int                `json:"numberOfElements"`
	Page             int                `json:"page"`
	Size             int                `json:"size"`
	Success          bool               `json:"success"`
	TotalElements    int                `json:"totalElements"`
	TotalPages       int                `json:"totalPages"`
}

NetworkConnectorPageResponse represents a paginated response of network connectors.

type NetworkConnectorsService added in v2.0.22

type NetworkConnectorsService service

NetworkConnectorsService provides methods for managing network connectors.

func (*NetworkConnectorsService) Activate added in v2.4.0

func (c *NetworkConnectorsService) Activate(connectorID string) error

Activate activates a suspended network connector. connectorID: The ID of the connector to activate Returns any error that occurred

func (*NetworkConnectorsService) Create added in v2.0.22

func (c *NetworkConnectorsService) Create(connector NetworkConnector, networkID string) (*NetworkConnector, error)

Create creates a new network connector.

func (*NetworkConnectorsService) Delete added in v2.0.22

func (c *NetworkConnectorsService) Delete(connectorID string, networkID string) error

Delete removes a network connector by its ID and network ID.

func (*NetworkConnectorsService) GetByID added in v2.0.22

GetByID retrieves a specific network connector by its ID.

func (*NetworkConnectorsService) GetByName added in v2.3.3

func (c *NetworkConnectorsService) GetByName(name string) (*NetworkConnector, error)

GetByName retrieves a network connector by its name name: The name of the network connector to retrieve Returns the network connector and any error that occurred

func (*NetworkConnectorsService) GetByPage added in v2.0.22

func (c *NetworkConnectorsService) GetByPage(page int, pageSize int) (NetworkConnectorPageResponse, error)

GetByPage retrieves network connectors using pagination.

func (*NetworkConnectorsService) GetByPageAndNetworkID added in v2.1.0

func (c *NetworkConnectorsService) GetByPageAndNetworkID(page int, pageSize int, networkID string) (NetworkConnectorPageResponse, error)

GetByPageAndNetworkID retrieves network connectors for a specific network using pagination.

func (*NetworkConnectorsService) GetProfile added in v2.0.22

func (c *NetworkConnectorsService) GetProfile(id string) (string, error)

GetProfile retrieves the profile configuration for a specific network connector.

func (*NetworkConnectorsService) GetToken added in v2.0.22

func (c *NetworkConnectorsService) GetToken(id string) (string, error)

GetToken retrieves an encrypted token for a specific network connector.

func (*NetworkConnectorsService) List added in v2.0.22

List retrieves all network connectors by paginating through all available pages.

func (*NetworkConnectorsService) ListByNetworkID added in v2.1.0

func (c *NetworkConnectorsService) ListByNetworkID(networkID string) ([]NetworkConnector, error)

ListByNetworkID retrieves all network connectors for a specific network by paginating through all available pages.

func (*NetworkConnectorsService) StartIPsec added in v2.2.0

func (c *NetworkConnectorsService) StartIPsec(connectorID string) error

StartIPsec starts an IPsec tunnel for the specified network connector.

func (*NetworkConnectorsService) StopIPsec added in v2.2.0

func (c *NetworkConnectorsService) StopIPsec(connectorID string) error

StopIPsec stops an IPsec tunnel for the specified network connector.

func (*NetworkConnectorsService) Suspend added in v2.4.0

func (c *NetworkConnectorsService) Suspend(connectorID string) error

Suspend suspends an active network connector. connectorID: The ID of the connector to suspend Returns any error that occurred

func (*NetworkConnectorsService) Update added in v2.0.22

Update updates an existing network connector.

type NetworkIPServicePageResponse added in v2.2.1

type NetworkIPServicePageResponse struct {
	Content          []NetworkIPServiceResponse `json:"content"`
	NumberOfElements int                        `json:"numberOfElements"`
	Page             int                        `json:"page"`
	Size             int                        `json:"size"`
	Success          bool                       `json:"success"`
	TotalElements    int                        `json:"totalElements"`
	TotalPages       int                        `json:"totalPages"`
}

NetworkIPServicePageResponse represents a paginated response from the CloudConnexa API containing a list of IP services and pagination metadata.

type NetworkIPServiceResponse added in v2.2.1

type NetworkIPServiceResponse struct {
	Name            string           `json:"name"`
	Description     string           `json:"description"`
	NetworkItemType string           `json:"networkItemType"`
	NetworkItemID   string           `json:"networkItemId"`
	ID              string           `json:"id"`
	Type            string           `json:"type"`
	Config          *IPServiceConfig `json:"config"`
	Routes          []*Route         `json:"routes"`
}

NetworkIPServiceResponse represents the response structure for Network IP service operations.

type NetworkIPServicesService added in v2.0.22

type NetworkIPServicesService service

NetworkIPServicesService handles communication with the CloudConnexa IP Services API

func (*NetworkIPServicesService) Create added in v2.0.22

Create creates a new IP service ipService: The IP service configuration to create Returns the created IP service and any error that occurred

func (*NetworkIPServicesService) Delete added in v2.0.22

func (c *NetworkIPServicesService) Delete(IPServiceID string) error

Delete removes an IP service by its ID IPServiceID: The ID of the IP service to delete Returns any error that occurred during deletion

func (*NetworkIPServicesService) Get added in v2.0.22

Get retrieves a specific IP service by its ID id: The ID of the IP service to retrieve Returns the IP service and any error that occurred

func (*NetworkIPServicesService) GetByName added in v2.3.3

GetByName retrieves a network IP service by its name name: The name of the network IP service to retrieve Returns the network IP service and any error that occurred

func (*NetworkIPServicesService) GetIPByPage added in v2.0.22

func (c *NetworkIPServicesService) GetIPByPage(page int, pageSize int) (NetworkIPServicePageResponse, error)

GetIPByPage retrieves a page of IP services with pagination page: The page number to retrieve pageSize: The number of items per page Returns a page of IP services and any error that occurred

func (*NetworkIPServicesService) List added in v2.0.22

List retrieves all IP services by paginating through all available pages Returns a slice of IP services and any error that occurred

func (*NetworkIPServicesService) Update added in v2.0.22

Update updates an existing IP service id: The ID of the IP service to update service: The updated IP service configuration Returns the updated IP service and any error that occurred

type NetworkPageResponse

type NetworkPageResponse struct {
	Content          []Network `json:"content"`
	NumberOfElements int       `json:"numberOfElements"`
	Page             int       `json:"page"`
	Size             int       `json:"size"`
	Success          bool      `json:"success"`
	TotalElements    int       `json:"totalElements"`
	TotalPages       int       `json:"totalPages"`
}

NetworkPageResponse represents a paginated response of networks.

type NetworksService

type NetworksService service

NetworksService provides methods for managing networks.

func (*NetworksService) Create

func (c *NetworksService) Create(network Network) (*Network, error)

Create creates a new network. network: The network configuration to create Returns the created network and any error that occurred

func (*NetworksService) Delete

func (c *NetworksService) Delete(networkID string) error

Delete removes a network by its ID. networkID: The ID of the network to delete Returns any error that occurred during deletion

func (*NetworksService) Get

func (c *NetworksService) Get(id string) (*Network, error)

Get retrieves a specific network by its ID. id: The ID of the network to retrieve Returns the network and any error that occurred

func (*NetworksService) GetByName

func (c *NetworksService) GetByName(name string) (*Network, error)

GetByName retrieves a network by its name name: The name of the network to retrieve Returns the network and any error that occurred

func (*NetworksService) GetByPage

func (c *NetworksService) GetByPage(page int, size int) (NetworkPageResponse, error)

GetByPage retrieves networks using pagination. page: The page number to retrieve size: The number of items per page Returns a NetworkPageResponse containing the networks and pagination information

func (*NetworksService) List

func (c *NetworksService) List() ([]Network, error)

List retrieves all networks by paginating through all available pages. Returns a slice of all networks and any error that occurred

func (*NetworksService) Update

func (c *NetworksService) Update(network Network) error

Update updates an existing network. network: The updated network configuration Returns any error that occurred during the update

type Phase added in v2.3.1

type Phase struct {
	EncryptionAlgorithms []string `json:"encryptionAlgorithms,omitempty"`
	IntegrityAlgorithms  []string `json:"integrityAlgorithms,omitempty"`
	DiffieHellmanGroups  []string `json:"diffieHellmanGroups,omitempty"`
	LifetimeSec          int      `json:"lifetimeSec"`
}

Phase represents a phase configuration used in ipsec.

type Range

type Range struct {
	LowerValue int `json:"lowerValue"`
	UpperValue int `json:"upperValue"`
	Value      int `json:"value,omitempty"`
}

Range represents a range of values with lower and upper bounds, or a single value.

type Rekey added in v2.3.1

type Rekey struct {
	MarginTimeSec    int `json:"marginTimeSec"`
	FuzzPercent      int `json:"fuzzPercent"`
	ReplayWindowSize int `json:"replayWindowSize"`
}

Rekey represents a rekey configuration used in ipsec.

type Route

type Route struct {
	ID              string `json:"id,omitempty"`
	Type            string `json:"type,omitempty"`
	Subnet          string `json:"subnet,omitempty"`
	Domain          string `json:"domain,omitempty"`
	Description     string `json:"description,omitempty"`
	ParentRouteID   string `json:"parentRouteId,omitempty"`
	NetworkItemID   string `json:"networkItemId,omitempty"`
	AllowEmbeddedIP bool   `json:"allowEmbeddedIp,omitempty"`
}

Route represents a network route configuration

type RoutePageResponse

type RoutePageResponse struct {
	Success          bool    `json:"success"`
	Content          []Route `json:"content"`
	TotalElements    int     `json:"totalElements"`
	TotalPages       int     `json:"totalPages"`
	NumberOfElements int     `json:"numberOfElements"`
	Page             int     `json:"page"`
	Size             int     `json:"size"`
}

RoutePageResponse represents a paginated response of network routes

type RoutesService

type RoutesService service

RoutesService provides methods for managing network routes

func (*RoutesService) Create

func (c *RoutesService) Create(networkID string, route Route) (*Route, error)

Create creates a new route in a network networkID: The ID of the network to create the route in route: The route configuration to create Returns the created route and any error that occurred

func (*RoutesService) Delete

func (c *RoutesService) Delete(id string) error

Delete removes a route by its ID id: The ID of the route to delete Returns any error that occurred during deletion

func (*RoutesService) Get

func (c *RoutesService) Get(routeID string) (*Route, error)

Get retrieves a specific route by searching through all networks routeID: The ID of the route to retrieve Returns the route and any error that occurred

func (*RoutesService) GetByPage

func (c *RoutesService) GetByPage(networkID string, page int, size int) (RoutePageResponse, error)

GetByPage retrieves network routes using pagination networkID: The ID of the network to get routes for page: The page number to retrieve size: The number of items per page Returns a page of routes and any error that occurred

func (*RoutesService) GetNetworkRoute

func (c *RoutesService) GetNetworkRoute(networkID string, routeID string) (*Route, error)

GetNetworkRoute retrieves a specific route from a network networkID: The ID of the network containing the route routeID: The ID of the route to retrieve Returns the route and any error that occurred

func (*RoutesService) List

func (c *RoutesService) List(networkID string) ([]Route, error)

List retrieves all routes for a network by paginating through all available pages networkID: The ID of the network to get routes for Returns a slice of routes and any error that occurred

func (*RoutesService) Update

func (c *RoutesService) Update(route Route) error

Update updates an existing route route: The updated route configuration Returns any error that occurred during the update

type Session added in v2.2.0

type Session struct {
	SessionID        string    `json:"sessionId"`
	UserID           string    `json:"userId"`
	DeviceID         string    `json:"deviceId"`
	RegionID         string    `json:"regionId"`
	BytesIn          int64     `json:"bytesIn"`
	BytesOut         int64     `json:"bytesOut"`
	ConnectorName    string    `json:"connectorName,omitempty"`
	UserName         string    `json:"userName,omitempty"`
	DeviceName       string    `json:"deviceName,omitempty"`
	ClientIP         string    `json:"clientIp,omitempty"`
	StartDateTime    time.Time `json:"startDateTime"`
	VpnIPv4          string    `json:"vpnIpv4,omitempty"`
	NetworkName      string    `json:"networkName,omitempty"`
	RegionName       string    `json:"regionName,omitempty"`
	ConnectionStatus string    `json:"connectionStatus,omitempty"`
}

Session represents an OpenVPN session in CloudConnexa. Fields match the API v1.2.0 SessionResponse schema.

type SessionStatus added in v2.2.0

type SessionStatus string

SessionStatus represents the possible statuses of an OpenVPN session.

const (
	// SessionStatusActive represents an active session.
	SessionStatusActive SessionStatus = "ACTIVE"
	// SessionStatusCompleted represents a completed session.
	SessionStatusCompleted SessionStatus = "COMPLETED"
	// SessionStatusFailed represents a failed session.
	SessionStatusFailed SessionStatus = "FAILED"
)

type SessionsListOptions added in v2.2.0

type SessionsListOptions struct {
	StartDate     *time.Time    `json:"startDate,omitempty"`
	EndDate       *time.Time    `json:"endDate,omitempty"`
	Status        SessionStatus `json:"status,omitempty"`
	ReturnOnlyNew bool          `json:"returnOnlyNew,omitempty"`
	Size          int           `json:"size"`
	Cursor        string        `json:"cursor,omitempty"`
}

SessionsListOptions represents the options for listing sessions.

type SessionsResponse added in v2.2.0

type SessionsResponse struct {
	Sessions   []Session `json:"sessions"`
	NextCursor string    `json:"nextCursor,omitempty"`
}

SessionsResponse represents the response from the sessions API endpoint.

type SessionsService added in v2.2.0

type SessionsService service

SessionsService provides methods for managing OpenVPN sessions.

func (*SessionsService) List added in v2.2.0

List retrieves a list of OpenVPN sessions with optional filtering. The size parameter is required and must be between 1 and 100. Returns a SessionsResponse containing sessions and optional next cursor for pagination.

func (*SessionsService) ListActive added in v2.2.0

func (s *SessionsService) ListActive(size int) (*SessionsResponse, error)

ListActive retrieves all active sessions.

func (*SessionsService) ListAll added in v2.2.0

func (s *SessionsService) ListAll(options SessionsListOptions) ([]Session, error)

ListAll retrieves all sessions by automatically handling pagination. This method will make multiple API calls if necessary to retrieve all sessions. Use with caution as it may result in many API calls for large datasets.

func (*SessionsService) ListByDateRange added in v2.2.0

func (s *SessionsService) ListByDateRange(startDate, endDate time.Time, size int) (*SessionsResponse, error)

ListByDateRange retrieves sessions within a specific date range.

func (*SessionsService) ListByStatus added in v2.2.0

func (s *SessionsService) ListByStatus(status SessionStatus, size int) (*SessionsResponse, error)

ListByStatus retrieves sessions with a specific status.

type SettingsService added in v2.1.1

type SettingsService service

SettingsService handles operations related to system settings

func (*SettingsService) GetAccessVisibilityEnabled added in v2.2.2

func (c *SettingsService) GetAccessVisibilityEnabled() (bool, error)

GetAccessVisibilityEnabled retrieves whether Access Visibility is enabled

func (*SettingsService) GetClientOptions added in v2.1.1

func (c *SettingsService) GetClientOptions() ([]string, error)

GetClientOptions retrieves the client options configuration

func (*SettingsService) GetConnectionTimeout added in v2.1.1

func (c *SettingsService) GetConnectionTimeout() (int, error)

GetConnectionTimeout retrieves the connection timeout value

func (*SettingsService) GetDNSLogEnabled added in v2.2.2

func (c *SettingsService) GetDNSLogEnabled() (bool, error)

GetDNSLogEnabled retrieves whether DNS Log is enabled

func (*SettingsService) GetDNSProxyEnabled added in v2.1.1

func (c *SettingsService) GetDNSProxyEnabled() (bool, error)

GetDNSProxyEnabled retrieves whether DNS proxy is enabled

func (*SettingsService) GetDNSServers added in v2.1.1

func (c *SettingsService) GetDNSServers() (*DNSServers, error)

GetDNSServers retrieves the current DNS server configuration

func (*SettingsService) GetDNSZones added in v2.1.1

func (c *SettingsService) GetDNSZones() ([]DNSZone, error)

GetDNSZones retrieves the current DNS zones configuration

func (*SettingsService) GetDefaultConnectAuth added in v2.1.1

func (c *SettingsService) GetDefaultConnectAuth() (string, error)

GetDefaultConnectAuth retrieves the default connection authentication method

func (*SettingsService) GetDefaultDNSSuffix added in v2.1.1

func (c *SettingsService) GetDefaultDNSSuffix() (string, error)

GetDefaultDNSSuffix retrieves the default DNS suffix

func (*SettingsService) GetDefaultDeviceAllowancePerUser added in v2.1.1

func (c *SettingsService) GetDefaultDeviceAllowancePerUser() (int, error)

GetDefaultDeviceAllowancePerUser retrieves the default device allowance per user

func (*SettingsService) GetDefaultRegion added in v2.1.1

func (c *SettingsService) GetDefaultRegion() (string, error)

GetDefaultRegion retrieves the default region setting

func (*SettingsService) GetDeviceEnforcement added in v2.1.1

func (c *SettingsService) GetDeviceEnforcement() (string, error)

GetDeviceEnforcement retrieves the device enforcement policy

func (*SettingsService) GetDomainRoutingSubnet added in v2.1.1

func (c *SettingsService) GetDomainRoutingSubnet() (*DomainRoutingSubnet, error)

GetDomainRoutingSubnet retrieves the domain routing subnet configuration

func (*SettingsService) GetForceUpdateDeviceAllowanceEnabled added in v2.1.1

func (c *SettingsService) GetForceUpdateDeviceAllowanceEnabled() (bool, error)

GetForceUpdateDeviceAllowanceEnabled retrieves whether force update device allowance is enabled

func (*SettingsService) GetProfileDistribution added in v2.1.1

func (c *SettingsService) GetProfileDistribution() (string, error)

GetProfileDistribution retrieves the profile distribution method

func (*SettingsService) GetSnatEnabled added in v2.1.1

func (c *SettingsService) GetSnatEnabled() (bool, error)

GetSnatEnabled retrieves whether SNAT is enabled

func (*SettingsService) GetSubnet added in v2.1.1

func (c *SettingsService) GetSubnet() (*Subnet, error)

GetSubnet retrieves the subnet configuration

func (*SettingsService) GetTopology added in v2.1.1

func (c *SettingsService) GetTopology() (string, error)

GetTopology retrieves the network topology setting

func (*SettingsService) GetTrustedDevicesAllowed added in v2.1.1

func (c *SettingsService) GetTrustedDevicesAllowed() (bool, error)

GetTrustedDevicesAllowed retrieves whether trusted devices are allowed

func (*SettingsService) GetTwoFactorAuthEnabled added in v2.1.1

func (c *SettingsService) GetTwoFactorAuthEnabled() (bool, error)

GetTwoFactorAuthEnabled retrieves whether two-factor authentication is enabled

func (*SettingsService) SetAccessVisibilityEnabled added in v2.2.2

func (c *SettingsService) SetAccessVisibilityEnabled(value bool) error

SetAccessVisibilityEnabled sets whether Access Visibility is enabled

func (*SettingsService) SetClientOptions added in v2.1.1

func (c *SettingsService) SetClientOptions(value []string) ([]string, error)

SetClientOptions updates the client options configuration

func (*SettingsService) SetConnectionTimeout added in v2.1.1

func (c *SettingsService) SetConnectionTimeout(value int) (int, error)

SetConnectionTimeout sets the connection timeout value

func (*SettingsService) SetDNSLogEnabled added in v2.2.2

func (c *SettingsService) SetDNSLogEnabled(value bool) error

SetDNSLogEnabled sets whether DNS Log is enabled

func (*SettingsService) SetDNSProxyEnabled added in v2.1.1

func (c *SettingsService) SetDNSProxyEnabled(value bool) (bool, error)

SetDNSProxyEnabled sets whether DNS proxy is enabled

func (*SettingsService) SetDNSServers added in v2.1.1

func (c *SettingsService) SetDNSServers(value *DNSServers) (*DNSServers, error)

SetDNSServers updates the DNS server configuration

func (*SettingsService) SetDNSZones added in v2.1.1

func (c *SettingsService) SetDNSZones(value []DNSZone) ([]DNSZone, error)

SetDNSZones updates the DNS zones configuration

func (*SettingsService) SetDefaultConnectAuth added in v2.1.1

func (c *SettingsService) SetDefaultConnectAuth(value string) (string, error)

SetDefaultConnectAuth sets the default connection authentication method

func (*SettingsService) SetDefaultDNSSuffix added in v2.1.1

func (c *SettingsService) SetDefaultDNSSuffix(value string) (string, error)

SetDefaultDNSSuffix sets the default DNS suffix

func (*SettingsService) SetDefaultDeviceAllowancePerUser added in v2.1.1

func (c *SettingsService) SetDefaultDeviceAllowancePerUser(value int) (int, error)

SetDefaultDeviceAllowancePerUser sets the default device allowance per user

func (*SettingsService) SetDefaultRegion added in v2.1.1

func (c *SettingsService) SetDefaultRegion(value string) (string, error)

SetDefaultRegion sets the default region

func (*SettingsService) SetDeviceEnforcement added in v2.1.1

func (c *SettingsService) SetDeviceEnforcement(value string) (string, error)

SetDeviceEnforcement sets the device enforcement policy

func (*SettingsService) SetDomainRoutingSubnet added in v2.1.1

func (c *SettingsService) SetDomainRoutingSubnet(value DomainRoutingSubnet) (*DomainRoutingSubnet, error)

SetDomainRoutingSubnet updates the domain routing subnet configuration

func (*SettingsService) SetForceUpdateDeviceAllowanceEnabled added in v2.1.1

func (c *SettingsService) SetForceUpdateDeviceAllowanceEnabled(value bool) (bool, error)

SetForceUpdateDeviceAllowanceEnabled sets whether force update device allowance is enabled

func (*SettingsService) SetProfileDistribution added in v2.1.1

func (c *SettingsService) SetProfileDistribution(value string) (string, error)

SetProfileDistribution sets the profile distribution method

func (*SettingsService) SetSnatEnabled added in v2.1.1

func (c *SettingsService) SetSnatEnabled(value bool) (bool, error)

SetSnatEnabled sets whether SNAT is enabled

func (*SettingsService) SetSubnet added in v2.1.1

func (c *SettingsService) SetSubnet(value Subnet) (*Subnet, error)

SetSubnet updates the subnet configuration

func (*SettingsService) SetTopology added in v2.1.1

func (c *SettingsService) SetTopology(value string) (string, error)

SetTopology sets the network topology

func (*SettingsService) SetTrustedDevicesAllowed added in v2.1.1

func (c *SettingsService) SetTrustedDevicesAllowed(value bool) (bool, error)

SetTrustedDevicesAllowed sets whether trusted devices are allowed

func (*SettingsService) SetTwoFactorAuthEnabled added in v2.1.1

func (c *SettingsService) SetTwoFactorAuthEnabled(value bool) (bool, error)

SetTwoFactorAuthEnabled sets whether two-factor authentication is enabled

type Subnet added in v2.1.1

type Subnet struct {
	IPV4Address []string `json:"ipV4Address"`
	IPV6Address []string `json:"ipV6Address"`
}

Subnet represents network subnet configuration with IPv4 and IPv6 address ranges

type User

type User struct {
	ID                string   `json:"id"`
	Username          string   `json:"username"`
	Role              string   `json:"role"`
	Email             string   `json:"email,omitempty"`
	AuthType          string   `json:"authType"`
	FirstName         string   `json:"firstName,omitempty"`
	LastName          string   `json:"lastName,omitempty"`
	GroupID           string   `json:"groupId"`
	SecondaryGroupIDs []string `json:"secondaryGroupIds,omitempty"`
	Status            string   `json:"status"`
	Devices           []Device `json:"devices"`
	ConnectionStatus  string   `json:"connectionStatus"`
	Licensed          bool     `json:"licensed"`
}

User represents a user configuration. Fields match the API v1.2.0 UserResponse schema.

type UserGroup

type UserGroup struct {
	ConnectAuth        string   `json:"connectAuth"`
	ID                 string   `json:"id"`
	InternetAccess     string   `json:"internetAccess"`
	MaxDevice          int      `json:"maxDevice"`
	Name               string   `json:"name"`
	SystemSubnets      []string `json:"systemSubnets"`
	VpnRegionIDs       []string `json:"vpnRegionIds"`
	AllRegionsIncluded bool     `json:"allRegionsIncluded"`
}

UserGroup represents a user group configuration

type UserGroupPageResponse

type UserGroupPageResponse struct {
	Content          []UserGroup `json:"content"`
	NumberOfElements int         `json:"numberOfElements"`
	Page             int         `json:"page"`
	Size             int         `json:"size"`
	Success          bool        `json:"success"`
	TotalElements    int         `json:"totalElements"`
	TotalPages       int         `json:"totalPages"`
}

UserGroupPageResponse represents a paginated response of user groups

type UserGroupsService

type UserGroupsService service

UserGroupsService provides methods for managing user groups

func (*UserGroupsService) Create

func (c *UserGroupsService) Create(userGroup *UserGroup) (*UserGroup, error)

Create creates a new user group userGroup: The user group configuration to create Returns the created user group and any error that occurred

func (*UserGroupsService) Delete

func (c *UserGroupsService) Delete(id string) error

Delete removes a user group by its ID id: The ID of the user group to delete Returns any error that occurred during deletion

func (*UserGroupsService) Get

func (c *UserGroupsService) Get(id string) (*UserGroup, error)

Get retrieves a user group by its ID using pagination search. Deprecated: Use GetByID() instead for better performance with the direct API endpoint. id: The ID of the user group to retrieve Returns the user group and any error that occurred

func (*UserGroupsService) GetByID added in v2.2.0

func (c *UserGroupsService) GetByID(id string) (*UserGroup, error)

GetByID retrieves a user group by its ID using the direct API endpoint. This is the preferred method for getting a single user group as it uses the direct GET /api/v1/user-groups/{id} endpoint introduced in API v1.1.0. id: The ID of the user group to retrieve Returns the user group and any error that occurred

func (*UserGroupsService) GetByName

func (c *UserGroupsService) GetByName(name string) (*UserGroup, error)

GetByName retrieves a user group by its name name: The name of the user group to retrieve Returns the user group and any error that occurred

func (*UserGroupsService) GetByPage

func (c *UserGroupsService) GetByPage(page int, pageSize int) (UserGroupPageResponse, error)

GetByPage retrieves user groups using pagination page: The page number to retrieve pageSize: The number of items per page Returns a page of user groups and any error that occurred

func (*UserGroupsService) List

func (c *UserGroupsService) List() ([]UserGroup, error)

List retrieves all user groups by paginating through all available pages Returns a slice of user groups and any error that occurred

func (*UserGroupsService) Update

func (c *UserGroupsService) Update(id string, userGroup *UserGroup) (*UserGroup, error)

Update updates an existing user group id: The ID of the user group to update userGroup: The updated user group configuration Returns the updated user group and any error that occurred

type UserPageResponse

type UserPageResponse struct {
	Content          []User `json:"content"`
	NumberOfElements int    `json:"numberOfElements"`
	Page             int    `json:"page"`
	Size             int    `json:"size"`
	Success          bool   `json:"success"`
	TotalElements    int    `json:"totalElements"`
	TotalPages       int    `json:"totalPages"`
}

UserPageResponse represents a paginated response of users

type UsersService

type UsersService service

UsersService provides methods for managing users

func (*UsersService) Activate added in v2.4.0

func (c *UsersService) Activate(userID string) error

Activate activates a suspended user userID: The ID of the user to activate Returns any error that occurred

func (*UsersService) Create

func (c *UsersService) Create(user User) (*User, error)

Create creates a new user user: The user configuration to create Returns the created user and any error that occurred

func (*UsersService) Delete

func (c *UsersService) Delete(userID string) error

Delete deletes a user by ID userID: The ID of the user to delete Returns any error that occurred

func (*UsersService) Get

func (c *UsersService) Get(userID string) (*User, error)

Get retrieves a user by ID userID: The ID of the user to retrieve Returns the user and any error that occurred

func (*UsersService) GetByID added in v2.1.0

func (c *UsersService) GetByID(userID string) (*User, error)

GetByID retrieves a user by ID userID: The ID of the user to retrieve Returns the user and any error that occurred

func (*UsersService) GetByPage

func (c *UsersService) GetByPage(page int, pageSize int) (UserPageResponse, error)

GetByPage retrieves users using pagination page: The page number to retrieve pageSize: The number of items per page Returns a page of users and any error that occurred

func (*UsersService) GetByUsername added in v2.0.10

func (c *UsersService) GetByUsername(username string) (*User, error)

GetByUsername retrieves a user by username username: The username to search for Returns the user and any error that occurred

func (*UsersService) List

func (c *UsersService) List(username string, role string) (*User, error)

List retrieves a user by username and role username: The username to search for role: The role to filter by Returns the user and any error that occurred

func (*UsersService) Suspend added in v2.4.0

func (c *UsersService) Suspend(userID string) error

Suspend suspends an active user userID: The ID of the user to suspend Returns any error that occurred

func (*UsersService) Update

func (c *UsersService) Update(user User) error

Update updates an existing user user: The user configuration to update Returns any error that occurred

type VPNRegionsService

type VPNRegionsService service

VPNRegionsService provides methods for managing VPN regions

func (*VPNRegionsService) GetByID added in v2.1.0

func (c *VPNRegionsService) GetByID(regionID string) (*VpnRegion, error)

GetByID retrieves a specific VPN region by ID regionID: The ID of the VPN region to retrieve Returns the VPN region and any error that occurred

func (*VPNRegionsService) List added in v2.1.0

func (c *VPNRegionsService) List() ([]VpnRegion, error)

List retrieves all VPN regions Returns a slice of VPN regions and any error that occurred

type VpnRegion

type VpnRegion struct {
	ID         string `json:"id"`
	Continent  string `json:"continent"`
	Country    string `json:"country"`
	CountryISO string `json:"countryIso"`
	RegionName string `json:"regionName"`
}

VpnRegion represents a VPN region configuration

Jump to

Keyboard shortcuts

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