cloudconnexa

package
v2.0.19 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCredentialsRequired = errors.New("both client_id and client_secret credentials must be specified")
View Source
var (
	ErrDnsRecordNotFound = errors.New("dns record not found")
)
View Source
var (
	ErrUserGroupNotFound = errors.New("user group not found")
)
View Source
var (
	ErrUserNotFound = errors.New("user not found")
)

Functions

This section is empty.

Types

type AccessGroupPageResponse added in v2.0.18

type AccessGroupPageResponse struct {
	Content          []AccessGroupResponse `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"`
}

type AccessGroupRequest added in v2.0.18

type AccessGroupRequest struct {
	Name        string              `json:"name"`
	Description string              `json:"description,omitempty"`
	Source      []AccessItemRequest `json:"source"`
	Destination []AccessItemRequest `json:"destination"`
}

type AccessGroupResponse added in v2.0.18

type AccessGroupResponse struct {
	Id          string               `json:"id"`
	Name        string               `json:"name"`
	Description string               `json:"description"`
	Source      []AccessItemResponse `json:"source"`
	Destination []AccessItemResponse `json:"destination"`
}

type AccessGroupsService added in v2.0.18

type AccessGroupsService service

func (*AccessGroupsService) Create added in v2.0.18

func (*AccessGroupsService) Delete added in v2.0.18

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

func (*AccessGroupsService) Get added in v2.0.18

func (*AccessGroupsService) GetAccessGroupsByPage added in v2.0.18

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

func (*AccessGroupsService) List added in v2.0.18

func (*AccessGroupsService) Update added in v2.0.18

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

type AccessItemRequest added in v2.0.18

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

type AccessItemResponse added in v2.0.18

type AccessItemResponse struct {
	Type       string `json:"type"`
	AllCovered bool   `json:"allCovered"`
	Parent     *Item  `json:"parent"`
	Children   []Item `json:"children"`
}

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"`
}

type ApplicationConfig added in v2.0.5

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

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"`
}

type ApplicationResponse added in v2.0.5

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

type ApplicationRoute added in v2.0.5

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

type ApplicationsService added in v2.0.5

type ApplicationsService service

func (*ApplicationsService) Create added in v2.0.5

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

func (*ApplicationsService) Delete added in v2.0.5

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

func (*ApplicationsService) Get added in v2.0.5

func (*ApplicationsService) GetApplicationsByPage added in v2.0.5

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

func (*ApplicationsService) GetByName added in v2.0.6

func (c *ApplicationsService) GetByName(name string) (*ApplicationResponse, error)

func (*ApplicationsService) List added in v2.0.5

func (*ApplicationsService) Update added in v2.0.5

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

type Client

type Client struct {
	BaseURL     string
	Token       string
	RateLimiter *rate.Limiter

	UserAgent string

	Connectors       *ConnectorsService
	DnsRecords       *DNSRecordsService
	Hosts            *HostsService
	IPServices       *IPServicesService
	Applications     *ApplicationsService
	Networks         *NetworksService
	Routes           *RoutesService
	Users            *UsersService
	UserGroups       *UserGroupsService
	VPNRegions       *VPNRegionsService
	LocationContexts *LocationContextsService
	AccessGroups     *AccessGroupsService
	// contains filtered or unexported fields
}

func NewClient

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

func (*Client) DoRequest

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

type ConnectionStatus

type ConnectionStatus string

type Connector

type Connector struct {
	Description      string           `json:"description,omitempty"`
	Id               string           `json:"id,omitempty"`
	Name             string           `json:"name"`
	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 ConnectionStatus `json:"connectionStatus"`
}

type ConnectorPageResponse

type ConnectorPageResponse struct {
	Content          []Connector `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"`
}

type ConnectorsService

type ConnectorsService service

func (*ConnectorsService) Create

func (c *ConnectorsService) Create(connector Connector, networkItemId string) (*Connector, error)

func (*ConnectorsService) Delete

func (c *ConnectorsService) Delete(connectorId string, networkItemId string, networkItemType string) error

func (*ConnectorsService) GetByID

func (c *ConnectorsService) GetByID(connectorID string) (*Connector, error)

func (*ConnectorsService) GetByName

func (c *ConnectorsService) GetByName(name string) (*Connector, error)

func (*ConnectorsService) GetByNetworkID

func (c *ConnectorsService) GetByNetworkID(networkId string) ([]Connector, error)

func (*ConnectorsService) GetByPage

func (c *ConnectorsService) GetByPage(page int, pageSize int) (ConnectorPageResponse, error)

func (*ConnectorsService) GetProfile

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

func (*ConnectorsService) GetToken added in v2.0.2

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

func (*ConnectorsService) List

func (c *ConnectorsService) List() ([]Connector, error)

func (*ConnectorsService) Update added in v2.0.9

func (c *ConnectorsService) Update(connector Connector) (*Connector, error)

type CountryPolicy added in v2.0.16

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

type Credentials

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

type CustomApplicationType added in v2.0.5

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

type CustomIPServiceType

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

type DNSRecordsService

type DNSRecordsService service

func (*DNSRecordsService) Create

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

func (*DNSRecordsService) Delete

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

func (*DNSRecordsService) GetByPage

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

func (*DNSRecordsService) GetDnsRecord

func (c *DNSRecordsService) GetDnsRecord(recordId string) (*DnsRecord, error)

func (*DNSRecordsService) Update

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

type DefaultPolicy added in v2.0.16

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

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"`
}

type DnsRecord

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

type DnsRecordPageResponse

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"`
}

type ErrClientResponse added in v2.0.14

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

func (ErrClientResponse) Error added in v2.0.14

func (e ErrClientResponse) Error() string

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     []Connector `json:"connectors"`
}

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"`
}

type HostsService

type HostsService service

func (*HostsService) Create

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

func (*HostsService) Delete

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

func (*HostsService) Get

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

func (*HostsService) GetByName

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

func (*HostsService) GetHostsByPage

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

func (*HostsService) List

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

func (*HostsService) Update

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

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"`
}

type IPServiceConfig

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

type IPServicePageResponse

type IPServicePageResponse struct {
	Content          []IPServiceResponse `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"`
}

type IPServiceResponse added in v2.0.2

type IPServiceResponse struct {
	IPService
	Routes []*Route `json:"routes"`
}

type IPServiceRoute added in v2.0.1

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

type IPServicesService

type IPServicesService service

func (*IPServicesService) Create

func (c *IPServicesService) Create(ipService *IPService) (*IPServiceResponse, error)

func (*IPServicesService) Delete

func (c *IPServicesService) Delete(ipServiceId string) error

func (*IPServicesService) Get

func (c *IPServicesService) Get(serviceID string) (*IPServiceResponse, error)

func (*IPServicesService) GetIPByPage

func (c *IPServicesService) GetIPByPage(page int, pageSize int) (IPServicePageResponse, error)

func (*IPServicesService) List

func (c *IPServicesService) List() ([]IPServiceResponse, error)

func (*IPServicesService) Update

func (c *IPServicesService) Update(id string, service *IPService) (*IPServiceResponse, error)

type Ip added in v2.0.16

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

type IpPolicy added in v2.0.16

type IpPolicy struct {
	Allowed bool `json:"allowed"`
	Ips     []Ip `json:"ips"`
}

type Item added in v2.0.18

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

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"`
	IpPolicy      *IpPolicy      `json:"ipPolicy,omitempty"`
	CountryPolicy *CountryPolicy `json:"countryPolicy,omitempty"`
	DefaultPolicy *DefaultPolicy `json:"defaultPolicy"`
}

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"`
}

type LocationContextsService added in v2.0.16

type LocationContextsService service

func (*LocationContextsService) Create added in v2.0.16

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

func (*LocationContextsService) Delete added in v2.0.16

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

func (*LocationContextsService) Get added in v2.0.16

func (*LocationContextsService) GetLocationContextByPage added in v2.0.16

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

func (*LocationContextsService) List added in v2.0.16

func (*LocationContextsService) Update added in v2.0.16

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

type Network

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

type NetworkConnector

type NetworkConnector struct {
	Description     string `json:"description"`
	Id              string `json:"id"`
	IPv4Address     string `json:"ipV4Address"`
	IPv6Address     string `json:"ipV6Address"`
	Name            string `json:"name"`
	NetworkItemId   string `json:"networkItemId"`
	NetworkItemType string `json:"networkItemType"`
	VpnRegionId     string `json:"vpnRegionId"`
}

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"`
}

type NetworksService

type NetworksService service

func (*NetworksService) Create

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

func (*NetworksService) Delete

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

func (*NetworksService) Get

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

func (*NetworksService) GetByName

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

func (*NetworksService) GetByPage

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

func (*NetworksService) List

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

func (*NetworksService) Update

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

type Range

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

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"`
}

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"`
}

type RoutesService

type RoutesService service

func (*RoutesService) Create

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

func (*RoutesService) Delete

func (c *RoutesService) Delete(networkId string, routeId string) error

func (*RoutesService) Get

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

func (*RoutesService) GetByPage

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

func (*RoutesService) GetNetworkRoute

func (c *RoutesService) GetNetworkRoute(networkId string, routeId string) (*Route, error)

func (*RoutesService) List

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

func (*RoutesService) Update

func (c *RoutesService) Update(networkId string, route Route) error

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"`
	Status           string           `json:"status"`
	Devices          []Device         `json:"devices"`
	ConnectionStatus ConnectionStatus `json:"connectionStatus"`
}

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"`
}

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"`
}

type UserGroupsService

type UserGroupsService service

func (*UserGroupsService) Create

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

func (*UserGroupsService) Delete

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

func (*UserGroupsService) Get

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

func (*UserGroupsService) GetByName

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

func (*UserGroupsService) GetByPage

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

func (*UserGroupsService) List

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

func (*UserGroupsService) Update

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

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"`
}

type UsersService

type UsersService service

func (*UsersService) Create

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

func (*UsersService) Delete

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

func (*UsersService) Get

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

func (*UsersService) GetById added in v2.0.10

func (c *UsersService) GetById(userId string) (*User, error)

func (*UsersService) GetByPage

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

func (*UsersService) GetByUsername added in v2.0.10

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

func (*UsersService) List

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

func (*UsersService) Update

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

type VPNRegionsService

type VPNRegionsService service

func (*VPNRegionsService) GetVpnRegion

func (c *VPNRegionsService) GetVpnRegion(regionId string) (*VpnRegion, error)

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"`
}

Jump to

Keyboard shortcuts

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