api

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package api provides functions to interact with the account API.

Package api provides functions to interact with the agents API.

Package api provides functions to interact with the auth API.

Package api provides functions to interact with the nexus API.

Package api provides functions to interact with the nexus API.

Package api provides functions to interact with the node API.

Package api provides functions to interact with the operator API.

Package api provides functions to interact with the project API.

Package api provides functions to interact with the redundancy class API.

Package api provides functions to interact with the swarm API.

Package api provides functions to interact with the tenant API.

Index

Constants

View Source
const (
	ExpansionStatusSuccess  ExpansionStatus = "success"
	ExpansionStatusPossible ExpansionStatus = "possible"
	ExpansionStatusError    ExpansionStatus = "error"

	RecoveryStatusCompleted RecoveryStatus = "completed"
	RecoveryStatusOngoing   RecoveryStatus = "ongoing"
	RecoveryStatusErrored   RecoveryStatus = "errored"
)

Variables

This section is empty.

Functions

func ConnectSwarm

func ConnectSwarm(urls configuration.URLs, accessToken, tenantID, swarmID string, redundancyClassID string, isDefault bool) error

func CreateTenantAccounts

func CreateTenantAccounts(urls configuration.URLs, accessToken, tenantID string, emails []string) error

func DeleteAgent

func DeleteAgent(urls configuration.URLs, accessToken string, swarmID string, nexusID string, nodeID string, agentID string) error

func DeleteGateway

func DeleteGateway(urls configuration.URLs, accessToken string, tenantID string, gatewayID string) error

func DeleteNexus

func DeleteNexus(urls configuration.URLs, accessToken string, swarmID string, nexusID string) error

func DeleteNode

func DeleteNode(urls configuration.URLs, accessToken string, swarmID, nexusID, nodeID string) error

func DeleteTenantAccountSessions

func DeleteTenantAccountSessions(urls configuration.URLs, accessToken, tenantID, accountID string) error

func DownloadReport

func DownloadReport(output string, downloadedFile *string) request_utils.RequestModifier

func DownloadTenantReport

func DownloadTenantReport(urls configuration.URLs, accessToken, tenantID, from, to, output string) (*string, error)

func EditOperatorRoleInSwarm

func EditOperatorRoleInSwarm(urls configuration.URLs, accessToken, swarmID, operatorID string, req ChangeOperatorPolicyRequestBody) error

func EditOperatorRoleInTenant

func EditOperatorRoleInTenant(urls configuration.URLs, accessToken, tenantID, operatorID string, req ChangeOperatorPolicyRequestBody) error

func EditSwarm

func EditSwarm(urls configuration.URLs, accessToken string, swarmID string, req UpdateSwarmRequest) error

func EditTenant

func EditTenant(urls configuration.URLs, accessToken string, tenantID string, req UpdateTenantRequestBody) error

func EditTenantImage

func EditTenantImage(urls configuration.URLs, accessToken, tenantID, imageURL string) error

func EditTenantSettings

func EditTenantSettings(urls configuration.URLs, accessToken string, tenantID string, settings TenantSettings) error

func ExtractGenericModel

func ExtractGenericModel(response any) request_utils.RequestModifier

func GetDeviceAPIKey

func GetDeviceAPIKey(urls configuration.URLs, deviceID string) (string, error)

func InviteOperatorToSwarm

func InviteOperatorToSwarm(urls configuration.URLs, accessToken, swarmID string, req InviteOperatorRequestBody) error

func InviteOperatorToTenant

func InviteOperatorToTenant(urls configuration.URLs, accessToken, tenantID string, req InviteOperatorRequestBody) error

func PromoteOperator

func PromoteOperator(urls configuration.URLs, email, policyName, secret string) error

func RemoveSwarm

func RemoveSwarm(urls configuration.URLs, accessToken, swarmID string) error

func RemoveSwarmOperator

func RemoveSwarmOperator(urls configuration.URLs, accessToken, swarmID, operatorID string) error

func RemoveTenant

func RemoveTenant(urls configuration.URLs, accessToken, tenantID string) error

func RemoveTenantAccount

func RemoveTenantAccount(urls configuration.URLs, accessToken, tenantID, accountID string) error

func RemoveTenantOperator

func RemoveTenantOperator(urls configuration.URLs, accessToken, tenantID, operatorID string) error

func RemoveTenantProject

func RemoveTenantProject(urls configuration.URLs, accessToken, tenantID, projectID string) error

func RestoreTenantAccount

func RestoreTenantAccount(urls configuration.URLs, accessToken, tenantID, accountID string) error

func RestoreTenantProject

func RestoreTenantProject(urls configuration.URLs, accessToken, tenantID, projectID string) error

func ToggleBanAccount

func ToggleBanAccount(urls configuration.URLs, accessToken, tenantID string, accountID string, banned bool) error

func ToggleBanProject

func ToggleBanProject(urls configuration.URLs, accessToken, tenantID string, projectID string, banned bool) error

func UpdateAccount

func UpdateAccount(urls configuration.URLs, accessToken, tenantID, accountID string, accountBody UpdateAccountRequest) error

func UpdateAgent

func UpdateAgent(urls configuration.URLs, accessToken string, swarmID string, nexusID string, nodeID string, agentID string, nodesBody UpdateNewAgentRequestBody) error

func UpdateGateway

func UpdateGateway(urls configuration.URLs, accessToken string, tenantID string, gatewayID string, gatewayBody UpdateGatewayRequestBody) error

func UpdateNexus

func UpdateNexus(urls configuration.URLs, accessToken string, swarmID string, nexusID string, nexusBody UpdateNexusRequestBody) error

func UpdateNode

func UpdateNode(urls configuration.URLs, accessToken string, swarmID, nexusID, nodeID string, nodeBody UpdateNewNodeRequestBody) error

func UpdateProject

func UpdateProject(urls configuration.URLs, accessToken, tenantID, projectID string, projectBody UpdateTenantProjectRequestBody) error

func VerifyDNS

func VerifyDNS(urls configuration.URLs, accessToken string, tenantID string) error

Types

type APIKeyResponse

type APIKeyResponse struct {
	APIKey string `json:"api_key"`
	Status string `json:"status,omitempty"`
}

type Account

type Account struct {
	ID                 string              `json:"id"`
	FirstName          string              `json:"first_name"`
	LastName           string              `json:"last_name"`
	Internal           bool                `json:"internal"`
	Banned             bool                `json:"banned"`
	CreatedAt          time.Time           `json:"created_at"`
	DeletedAt          *time.Time          `json:"deleted_at"`
	MaxAllowedProjects int                 `json:"max_allowed_projects"`
	Emails             []AccountEmail      `json:"emails"`
	TwoFactorEnabled   bool                `json:"two_factor_enabled"`
	EndpointGateway    string              `json:"endpoint_gateway"`
	TenantID           string              `json:"tenant_id"`
	AuthProvider       AccountAuthProvider `json:"auth_provider"`
}

func GetTenantAccount

func GetTenantAccount(urls configuration.URLs, accessToken, tenantID, accountID string) (*Account, error)

type AccountAuthProvider

type AccountAuthProvider string

type AccountEmail

type AccountEmail struct {
	ID        string    `json:"id"`
	Email     string    `json:"email"`
	Verified  bool      `json:"verified"`
	Default   bool      `json:"default"`
	CreatedAt time.Time `json:"created_at"`
}

type AgentConfig

type AgentConfig struct {
	ID         string `json:"id"`
	MountPoint string `json:"mount_point"`
	Disk       string `json:"disk"`
	Port       int    `json:"port"`
	Secret     string `json:"secret"`
}

type AgentModel

type AgentModel string
const (
	UnknownAgentModel AgentModel = "unknown"
	CellAgentModel    AgentModel = "cell"
	VirtualAgentModel AgentModel = "virtual"
)

type AgentVolume

type AgentVolume struct {
	MountPoint string `json:"mount_point"`
	Disk       string `json:"disk"`
}

type AnsibleConfig

type AnsibleConfig struct {
	Nodes []NodeConfig `json:"nodes"`
}

type BulkInsertNewAgentRequestBody

type BulkInsertNewAgentRequestBody struct {
	Agents []CreateNewAgentRequestBody `json:"agents"`
}

type BulkInsertNewNodeRequestBody

type BulkInsertNewNodeRequestBody struct {
	Nodes []CreateNewNodeRequestBody `json:"nodes"`
}

type ChallengeResponseModel

type ChallengeResponseModel struct {
	Challenge string `json:"challenge"`
	Salt      string `json:"salt" example:"SGVsbG8gd29ybGQ="`
}

type ChangeOperatorPolicyRequestBody

type ChangeOperatorPolicyRequestBody struct {
	PolicyID string `json:"policy_id"`
}

type CreateGatewayRequestBody

type CreateGatewayRequestBody struct {
	Name          string                 `json:"name"`
	Location      string                 `json:"location"`
	Configuration map[string]interface{} `json:"configuration"`
}

type CreateNewAgentRequestBody

type CreateNewAgentRequestBody struct {
	Port     int                    `json:"port"`
	Features map[string]interface{} `json:"features"`
	Volume   AgentVolume            `json:"volume"`
}

type CreateNewNodeRequestBody

type CreateNewNodeRequestBody struct {
	Name          string                      `json:"name"`
	Label         *string                     `json:"label"`
	Configuration map[string]interface{}      `json:"config" swaggertype:"object,string"`
	PublicIP      string                      `json:"public_ip"`
	PrivateIP     string                      `json:"private_ip"`
	Agents        []CreateNewAgentRequestBody `json:"agents"`
}

type CreateNexusRequestBody

type CreateNexusRequestBody struct {
	Name        string `json:"name" `
	Description string `json:"description,omitempty"`
	Location    string `json:"location"`
	ProviderID  string `json:"provider_id,omitempty"`
}

type CreateNodeBodyRequest

type CreateNodeBodyRequest struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	NexusID     string `json:"nexus_id"`
	SecretID    string `json:"secret_id"`
}

type CreateRedundancyClassRequestBody

type CreateRedundancyClassRequestBody struct {
	Name              string   `json:"name"`
	Description       string   `json:"description"`
	InnerK            int      `json:"inner_k"`
	InnerN            int      `json:"inner_n"`
	OuterK            int      `json:"outer_k"`
	OuterN            int      `json:"outer_n"`
	AntiAffinityGroup int      `json:"anti_affinity_group"`
	Nexuses           []string `json:"nexuses"`
}

type CreateSwarmRequest

type CreateSwarmRequest struct {
	Name          string                 `json:"name"`
	Configuration map[string]interface{} `json:"configuration"`
	Description   *string                `json:"description"`
}

type CreateTenantRequestBody

type CreateTenantRequestBody struct {
	Name        string          `json:"name"`
	Description *string         `json:"description"`
	Settings    *TenantSettings `json:"settings"`
	CouponCode  *string         `json:"coupon_code"`
	Zone        *string         `json:"zone"`
	ZKEnabled   *bool           `json:"zk_enabled"`
}

type DNSChallengeRecord

type DNSChallengeRecord struct {
	Type  string `json:"type"`
	Name  string `json:"name"`
	Value string `json:"value"`
}

type DeviceRegistrationResponse

type DeviceRegistrationResponse struct {
	DeviceCode string `json:"device_code"`
	ClientURL  string `json:"client_url"`
}

func RegisterDevice

func RegisterDevice(urls configuration.URLs, uuid string) (*DeviceRegistrationResponse, error)

type Distributor

type Distributor struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	OwnerID     string    `json:"owner_id"`
	CreatedAt   time.Time `json:"created_at"`
	DeletedAt   time.Time `json:"deleted_at"`
	ImageURL    string    `json:"image_url"`
}

type DistributorCoupon

type DistributorCoupon struct {
	ID             string    `json:"id"`
	Name           string    `json:"name"`
	Description    string    `json:"description"`
	Redemptions    int       `json:"redemptions"`
	MaxRedemptions int64     `json:"max_redemptions"`
	Code           string    `json:"code"`
	Zone           string    `json:"zone"`
	CreatedAt      time.Time `json:"created_at"`
	ExternalID     string    `json:"external_id"`
}

func (*DistributorCoupon) ToHumanReadableDistributorCode

func (c *DistributorCoupon) ToHumanReadableDistributorCode() *HumanReadableDistributorCoupon

type DistributorCouponCodeResponseModel

type DistributorCouponCodeResponseModel struct {
	CouponCode string `json:"coupon_code"`
}

type DistributorCouponList

type DistributorCouponList struct {
	Coupons []*DistributorCoupon `json:"coupons"`
}

type DistributorList

type DistributorList struct {
	Distributors []*Distributor `json:"distributors"`
}

type DistributorReportResponseModel

type DistributorReportResponseModel struct {
	Report []TenantReport `json:"report"`
}

type EnabledAuthProvidersConfig

type EnabledAuthProvidersConfig struct {
	GoogleClientID         *string `json:"google_client_id"`
	MicrosoftApplicationID *string `json:"microsoft_application_id"`
	MicrosoftDirectoryID   *string `json:"microsoft_directory_id"`
}

type ErrorResponseModel

type ErrorResponseModel struct {
	Message string `json:"message"`
	Param   string `json:"param"`
}

type EvaluatedStatusType

type EvaluatedStatusType string

type ExpansionStatus

type ExpansionStatus string

type Gateway

type Gateway struct {
	ID             string     `json:"id"`
	Name           string     `json:"name"`
	Location       string     `json:"location"`
	CreatedAt      time.Time  `json:"created_at"`
	DeletedAt      *time.Time `json:"deleted_at"`
	Secret         string     `json:"secret"`
	OrganizationID *string    `json:"organization_id"`
}

func GetGateway

func GetGateway(urls configuration.URLs, accessToken string, tenantID string, gatewayID string) (*Gateway, error)

type GatewayInstance

type GatewayInstance struct {
	ID              string                 `json:"id"`
	GatewayID       string                 `json:"gateway_id"`
	IP              string                 `json:"ip"`
	Status          map[string]interface{} `json:"status"`
	StatusUpdatedAt *time.Time             `json:"status_updated_at"`
	CreatedAt       time.Time              `json:"created_at"`
	Features        map[string]interface{} `json:"features"`
	EvaluatedStatus GatewayStatus          `json:"evaluated_status"`
}

type GatewayInstanceListResponse

type GatewayInstanceListResponse struct {
	Data []*GatewayInstance `json:"data"`
}

type GatewayStatus

type GatewayStatus string
const (
	UnknownGatewayStatus  GatewayStatus = "unknown"
	InactiveGatewayStatus GatewayStatus = "inactive"
	ActiveGatewayStatus   GatewayStatus = "active"
	OfflineGatewayStatus  GatewayStatus = "offline"
	OnlineGatewayStatus   GatewayStatus = "online"
)

type GatewayTenant

type GatewayTenant struct {
	ID            string                 `json:"id"`
	GatewayID     string                 `json:"gateway_id"`
	TenantID      string                 `json:"tenant_id"`
	CreatedAt     time.Time              `json:"created_at"`
	DeletedAt     *time.Time             `json:"deleted_at"`
	HardDeleteAt  *time.Time             `json:"hard_delete_at"`
	Configuration map[string]interface{} `json:"configuration"`
	Hidden        bool                   `json:"hidden"`
}

type GatewayWithGatewayTenant

type GatewayWithGatewayTenant struct {
	Gateway       *Gateway       `json:"gateway"`
	GatewayTenant *GatewayTenant `json:"gateway_tenant"`
}

func CreateGateway

func CreateGateway(urls configuration.URLs, accessToken string, tenantID string, gatewayBody CreateGatewayRequestBody) (*GatewayWithGatewayTenant, error)

type GenericIDResponseModel

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

func AssignTenantToCoupon

func AssignTenantToCoupon(urls configuration.URLs, accessToken, tenantID, CouponCode string) (*GenericIDResponseModel, error)

func CreateProject

func CreateProject(urls configuration.URLs, accessToken, name string, description *string, imageUrl *string) (*GenericIDResponseModel, error)

func CreateSwarm

func CreateSwarm(urls configuration.URLs, accessToken string, req CreateSwarmRequest) (*GenericIDResponseModel, error)

func CreateTenant

func CreateTenant(urls configuration.URLs, accessToken string, req CreateTenantRequestBody) (*GenericIDResponseModel, error)

type GenericPaginatedResponse

type GenericPaginatedResponse[T interface{}] struct {
	Data     []T  `json:"data"`
	NextPage *int `json:"next_page"`
	Count    int  `json:"count"`
}

func GetAgent

func GetAgent(urls configuration.URLs, accessToken string, swarmID, nexusID, nodeID, agentID string) (*GenericPaginatedResponse[*NewAgent], error)

func ListAgents

func ListAgents(urls configuration.URLs, accessToken string, swarmID string, nexusID, nodeID, sort string, filter string) (*GenericPaginatedResponse[*NewAgent], error)

func ListAgentsForRC

func ListAgentsForRC(urls configuration.URLs, accessToken string, swarmID string, rcID, sort string, filter string) (*GenericPaginatedResponse[*NewAgent], error)

func ListGateways

func ListGateways(urls configuration.URLs, accessToken string, tenantID string, sort string, filter string) (*GenericPaginatedResponse[*Gateway], error)

func ListNexuses

func ListNexuses(urls configuration.URLs, accessToken string, swarmID string, sort string, filter string) (*GenericPaginatedResponse[*Nexus], error)

func ListNodes

func ListNodes(urls configuration.URLs, accessToken string, swarmID string, nexusID, sort string, filter string) (*GenericPaginatedResponse[*NewNode], error)

func ListRedundancyClasses

func ListRedundancyClasses(urls configuration.URLs, accessToken, swamID, sort, filter string) (*GenericPaginatedResponse[*RedundancyClass], error)

func ListSwarmsV2

func ListSwarmsV2(urls configuration.URLs, accessToken string, sort string, filter string) (*GenericPaginatedResponse[*Swarm], error)

func ListTenantAccounts

func ListTenantAccounts(urls configuration.URLs, accessToken, tenantID, sort, filter string) (*GenericPaginatedResponse[*Account], error)

func ListTenantProjects

func ListTenantProjects(urls configuration.URLs, accessToken, tenantID, sort, filter string) (*GenericPaginatedResponse[*ProjectItem], error)

func ListTenants

func ListTenants(urls configuration.URLs, accessToken, sort, filter string) (*GenericPaginatedResponse[*Tenant], error)

type GetAgentEvaluatedStatusResponse

type GetAgentEvaluatedStatusResponse struct {
	Status EvaluatedStatusType `json:"status"`
}

func GetAgentStatus

func GetAgentStatus(urls configuration.URLs, accessToken, swarmID, nexusID, nodeID, agentID string) (*GetAgentEvaluatedStatusResponse, error)

type HumanReadableDistributorCoupon

type HumanReadableDistributorCoupon struct {
	ID             string    `json:"id"`
	Name           string    `json:"name"`
	Description    string    `json:"description"`
	Redemptions    int       `json:"redemptions"`
	MaxRedemptions string    `json:"max_redemptions"`
	Code           string    `json:"code"`
	Zone           string    `json:"zone"`
	CreatedAt      time.Time `json:"created_at"`
	ExternalID     string    `json:"external_id"`
}

type HumanReadableStatus

type HumanReadableStatus struct {
	Status            string `json:"status"`
	ChildType         string `json:"child_type"`
	ChildCount        int    `json:"child_count"`
	ChildOnlineCount  int    `json:"child_online_count"`
	ChildOfflineCount int    `json:"child_offline_count"`
	ChildPendingCount int    `json:"child_pending_count"`
	ChildWarningCount int    `json:"child_warning_count"`
	ChildErrorCount   int    `json:"child_error_count"`
}

type InviteOperatorRequestBody

type InviteOperatorRequestBody struct {
	Email     string  `json:"email"`
	FirstName *string `json:"first_name"`
	LastName  *string `json:"last_name"`
	PolicyID  string  `json:"policy_id"`
}

type MonitoredResourceForSeverityNotifications

type MonitoredResourceForSeverityNotifications map[string]SeverityForNotificationType

type NewAgent

type NewAgent struct {
	ID                 string                 `json:"id"`
	NodeID             string                 `json:"node_id"`
	PublicKey          *string                `json:"public_key"`
	Features           map[string]interface{} `json:"features"`
	CreatedAt          time.Time              `json:"created"`
	DeletedAt          *time.Time             `json:"deleted"`
	LastStatusUpdateAt time.Time              `json:"last_status_update_at"`
	Secret             string                 `json:"secret"`
	Online             bool                   `json:"online"`
	ConnectedOn        *time.Time             `json:"connected_on"`
	Model              AgentModel             `json:"model"`
	Serial             *string                `json:"serial"`
	Version            *string                `json:"version"`
	Port               int                    `json:"cccp_port"`
	TotalStorage       int64                  `json:"total_storage"`
	UsedStorage        int64                  `json:"used_storage"`
	Volume             AgentVolume            `json:"volume"`
	CRN                map[string]interface{} `json:"crn"`
	AnnouncedPrivateIP *string                `json:"announced_private_ip"`
	AnnouncedPublicIP  *string                `json:"announced_public_ip"`
}

type NewAgentResponse

type NewAgentResponse struct {
	ID       string                 `json:"id"`
	Secret   string                 `json:"secret"`
	Port     int                    `json:"port"`
	Features map[string]interface{} `json:"features"`
	Volume   AgentVolume            `json:"volume"`
	CRN      map[string]interface{} `json:"crn"`
}

type NewAgentsResponse

type NewAgentsResponse struct {
	Agents []*NewAgentResponse `json:"agents"`
}

func CreateAgent

func CreateAgent(urls configuration.URLs, accessToken string, swarmID string, nexusID string, nodeID string, agentsBody BulkInsertNewAgentRequestBody) (*NewAgentsResponse, error)

type NewNode

type NewNode struct {
	ID            string                 `json:"id"`
	Name          string                 `json:"name"`
	Label         *string                `json:"label"`
	Configuration map[string]interface{} `json:"config"`
	CreatedAt     time.Time              `json:"created_at"`
	DeletedAt     *time.Time             `json:"deleted_at"`
	NexusID       string                 `json:"nexus_id"`
	PrivateIP     string                 `json:"private_ip"`
	PublicIP      string                 `json:"public_ip"`
	CRN           map[string]interface{} `json:"crn"`
}

func GetNode

func GetNode(urls configuration.URLs, accessToken string, swarmID, nexusID, nodeID string) (*NewNode, error)

type NewNodeResponseItem

type NewNodeResponseItem struct {
	ID            string                 `json:"id"`
	Name          string                 `json:"name"`
	Label         *string                `json:"label"`
	Configuration map[string]interface{} `json:"config"`
	PublicIP      string                 `json:"public_ip"`
	PrivateIP     string                 `json:"private_ip"`
	Agents        []NewAgentResponse     `json:"agents"`
	CRN           map[string]interface{} `json:"crn"`
}

type NewNodesResponse

type NewNodesResponse struct {
	Nodes []*NewNodeResponseItem `json:"nodes"`
}

func CreateNodes

func CreateNodes(urls configuration.URLs, accessToken string, swarmID string, nexusID string, nodesBody BulkInsertNewNodeRequestBody) (*NewNodesResponse, error)

type Nexus

type Nexus struct {
	ID           string    `json:"id"`
	Name         string    `json:"name"`
	Description  string    `json:"description"`
	Location     string    `json:"location"`
	CreationDate time.Time `json:"creation_date"`
	LastModified time.Time `json:"last_modified"`
	SwarmID      string    `json:"swarm_id"`
	Capacity     int       `json:"capacity"`
	Used         int       `json:"used"`
}

func CreateNexus

func CreateNexus(urls configuration.URLs, accessToken string, swarmID string, nexusBody CreateNexusRequestBody) (*Nexus, error)

func GetNexus

func GetNexus(urls configuration.URLs, accessToken string, swarmID string, nexusID string) (*Nexus, error)

type NexusList

type NexusList struct {
	Nexuses  []*Nexus `json:"nexuses"`
	Page     int      `json:"page"`
	Count    int      `json:"count"`
	NextPage *int     `json:"next_page"`
}

type Node

type Node struct {
	ID           string                 `json:"id"`
	Name         string                 `json:"name"`
	Description  string                 `json:"description"`
	Status       string                 `json:"status"`
	CreationDate time.Time              `json:"creation_date"`
	ProviderID   string                 `json:"provider_id"`
	SecretID     string                 `json:"secret_id"`
	NexusID      string                 `json:"nexus_id"`
	Config       map[string]interface{} `json:"config"`
}

type NodeConfig

type NodeConfig struct {
	ID        string        `json:"id,omitempty"`
	Name      string        `json:"name"`
	PublicIP  string        `json:"public_ip"`
	PrivateIP string        `json:"private_ip"`
	Label     string        `json:"label,omitempty"`
	Agents    []AgentConfig `json:"agents"`
}

type NodeList

type NodeList struct {
	Nodes []*Node `json:"nodes"`
	Page  int     `json:"page"`
	Count int     `json:"count"`
}

type Notification

type Notification struct {
	NotifyOwner bool     `json:"notify_owner"`
	Emails      []string `json:"emails"`
}

type Operator

type Operator struct {
	ID                 string          `json:"id"`
	FirstName          string          `json:"first_name"`
	LastName           string          `json:"last_name"`
	Internal           bool            `json:"internal"`
	Banned             bool            `json:"banned"`
	CreatedAt          time.Time       `json:"created_at"`
	DeletedAt          *time.Time      `json:"deleted_at"`
	MaxAllowedProjects int             `json:"max_allowed_projects"`
	Email              string          `json:"email"`
	Emails             []OperatorEmail `json:"emails"`
	TwoFactorEnabled   bool            `json:"two_factor_enabled"`
	Status             string          `json:"status"`
	PolicyName         string          `json:"policy_name"`
}

func GetOperator

func GetOperator(urls configuration.URLs, accessToken, meOrID string) (*Operator, error)

func GetOperatorSelf

func GetOperatorSelf(urls configuration.URLs, accessToken string) (*Operator, error)

func GetSwarmOperator

func GetSwarmOperator(urls configuration.URLs, accessToken, swarmID, operatorID string) (*Operator, error)

func GetTenantOperator

func GetTenantOperator(urls configuration.URLs, accessToken, tenantID, operatorID string) (*Operator, error)

type OperatorEmail

type OperatorEmail struct {
	ID        string    `json:"id"`
	Email     string    `json:"email"`
	Verified  bool      `json:"verified"`
	Default   bool      `json:"default"`
	CreatedAt time.Time `json:"created_at"`
}

type OperatorList

type OperatorList struct {
	Operators []*Operator `json:"operators"`
}

func ListSwarmOperators

func ListSwarmOperators(urls configuration.URLs, accessToken, swarmID string) (*OperatorList, error)

func ListTenantOperators

func ListTenantOperators(urls configuration.URLs, accessToken, tenantID string) (*OperatorList, error)

type Policy

type Policy struct {
	ID        string `json:"id"`
	AuthorID  string `json:"author_id"`
	Name      string `json:"name"`
	UserCount int    `json:"user_count"`
	Version   string `json:"version"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type PolicyList

type PolicyList struct {
	Policies []Policy `json:"policies"`
}

func ListTenantPolicies

func ListTenantPolicies(urls configuration.URLs, accessToken, tenantID string) (*PolicyList, error)

type ProjectItem

type ProjectItem struct {
	ProjectID          string     `json:"project_id"`
	ProjectName        string     `json:"project_name"`
	ProjectDescription string     `json:"project_description"`
	ProjectEmail       string     `json:"project_email"`
	ProjectCreatedAt   time.Time  `json:"project_created_at"`
	ProjectDeletedAt   *time.Time `json:"project_deleted_at"`
	ProjectBannedAt    *time.Time `json:"project_banned_at"`
	ProjectImageURL    string     `json:"project_image_url"`
	ProjectTenantID    string     `json:"project_tenant_id"`
	RootAccountEmail   string     `json:"root_account_email"`
	RootAccountID      string     `json:"root_account_id"`
}

func GetTenantProject

func GetTenantProject(urls configuration.URLs, accessToken, tenantID, projectID string) (*ProjectItem, error)

type ProjectReport

type ProjectReport struct {
	ID                  string        `json:"id"`
	ExternalID          string        `json:"external_id"`
	ProjectName         string        `json:"project_name"`
	StorageBH           string        `json:"storage_bh"`
	StorageAVGTB        string        `json:"storage_avg_tb"`
	StorageMaxTB        string        `json:"storage_max_tb"`
	StorageTB           string        `json:"storage_tb"`
	StorageReservedTB   string        `json:"storage_reserved_tb"`
	BandwidthReservedTB string        `json:"bandwidth_reserved_tb"`
	EgressTB            string        `json:"egress_tb"`
	IngressTB           string        `json:"ingress_tb"`
	FromTime            string        `json:"from_time"`
	ToTime              string        `json:"to_time"`
	Status              string        `json:"status"`
	Timestamp           time.Duration `json:"timestamp"`
}

type Provider

type Provider struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	SwarmID string `json:"swarm_id"`
	Email   string `json:"email"`
}

type ProviderList

type ProviderList struct {
	Providers []Provider `json:"providers"`
	Page      int        `json:"page"`
	Count     int        `json:"count"`
}

type RCProgress

type RCProgress struct {
	Session           RCSession          `json:"session"`
	ActiveRecoveries  []RecoveryProgress `json:"active_recoveries"`
	FailedRecoveries  []RecoveryProgress `json:"failed_recoveries"`
	CompletionPercent float64            `json:"completion_percent"`
}

func CheckRedundancyClassRecoveryStatus

func CheckRedundancyClassRecoveryStatus(urls configuration.URLs, accessToken, swarmID, redundancyClassID string) (*RCProgress, error)

type RCSession

type RCSession struct {
	Status RCSessionStatus `json:"status"`
}

type RCSessionStatus

type RCSessionStatus string
const (
	RCSessionStatusRunning   RCSessionStatus = "running"
	RCSessionStatusCompleted RCSessionStatus = "completed"
	RCSessionStatusFailed    RCSessionStatus = "failed"
)

type RecoveryProgress

type RecoveryProgress struct {
	RecoveryID      string  `json:"recovery_id"`
	ProgressPercent float64 `json:"progress_percent"`
}

type RecoveryStatus

type RecoveryStatus string

type RedundancyClass

type RedundancyClass struct {
	ID                string    `json:"id"`
	Name              string    `json:"name"`
	Description       string    `json:"description"`
	InnerK            int       `json:"inner_k"`
	InnerN            int       `json:"inner_n"`
	OuterK            int       `json:"outer_k"`
	OuterN            int       `json:"outer_n"`
	AntiAffinityGroup int       `json:"anti_affinity_group"`
	Capacity          int       `json:"capacity"`
	CreationDate      time.Time `json:"creation_date"`
	SwarmID           string    `json:"swarm_id"`
}

func CreateRedundancyClass

func CreateRedundancyClass(urls configuration.URLs, accessToken, swamID string, redundancyClass CreateRedundancyClassRequestBody) (*RedundancyClass, error)

func GetRedundancyClass

func GetRedundancyClass(urls configuration.URLs, accessToken, redundancyClassID string) (*RedundancyClass, error)

type RedundancyClassErrorData

type RedundancyClassErrorData struct {
	IssueFound []interface{} `json:"issue_found"`
}

type RedundancyClassExpanded

type RedundancyClassExpanded struct {
	Status         ExpansionStatus `json:"status"`
	Message        string          `json:"message"`
	ExpandedSize   int64           `json:"expanded_size"`
	AgentsInvolved []string        `json:"agents_involved"`
}

func ExpandRedundancyClass

func ExpandRedundancyClass(urls configuration.URLs, accessToken, swarmID, redundancyClassID string, dryRun bool) (*RedundancyClassExpanded, error)

type RedundancyClassList

type RedundancyClassList struct {
	Data []*RedundancyClass `json:"data"`
	Page int                `json:"page"`
}

type RedundancyClassRecovery

type RedundancyClassRecovery struct {
	Message string `json:"message"`
}

func RecoverRedundancyClass

func RecoverRedundancyClass(urls configuration.URLs, accessToken, swarmID, redundancyClassID string, dryRun bool) (*RedundancyClassRecovery, error)

type Ring

type Ring struct {
	ID           string      `json:"id"`
	N            int         `json:"n"`
	K            int         `json:"k"`
	SwarmID      string      `json:"swarm_id"`
	Capacity     int         `json:"capacity"`
	Used         int         `json:"used"`
	Status       string      `json:"status"`
	CreationDate string      `json:"creation_date"`
	Nexuses      []RingNexus `json:"nexuses"`
	Nodes        []RingNode  `json:"nodes"`
}

type RingBulk

type RingBulk struct {
	RedundancyClassID string   `json:"redundancy_class_id"`
	Nexuses           []string `json:"nexuses"`
	RingsNumber       *int     `json:"number_of_rings"`
	AntiAffinityGroup *int     `json:"anti_affinity_group"`
}

type RingList

type RingList struct {
	Data  []*Ring `json:"data"`
	Page  int     `json:"page"`
	Count int     `json:"count"`
}

type RingNexus

type RingNexus struct {
	NexusID  string `json:"nexus_id"`
	N        int    `json:"n"`
	K        int    `json:"k"`
	Sequence int    `json:"sequence"`
}

type RingNode

type RingNode struct {
	NodeID    string `json:"node_id"`
	NexusID   string `json:"nexus_id"`
	Sequence1 int    `json:"sequence1"`
	Sequence2 int    `json:"sequence2"`
}

type Severity

type Severity string

type SeverityForNotificationType

type SeverityForNotificationType map[Severity]SeverityNotificationType

type SeverityNotificationType

type SeverityNotificationType struct {
	Threshold int          `json:"threshold"`
	Notify    Notification `json:"notify"`
}

type SummaryDetails

type SummaryDetails struct {
	Pending int `json:"pending"`
	Online  int `json:"online"`
	Offline int `json:"offline"`
	Warning int `json:"warning"`
	Error   int `json:"error"`
}

type SummaryDetailsWithStatusNullable

type SummaryDetailsWithStatusNullable struct {
	Details *SummaryDetails `json:"details"`
	SummaryStatusNullable
}

func CheckRedundancyClassStatus

func CheckRedundancyClassStatus(urls configuration.URLs, accessToken, swarmID, redundancyClassID string) (*SummaryDetailsWithStatusNullable, error)

func GetSwarmStatus

func GetSwarmStatus(urls configuration.URLs, accessToken, swarmID string) (*SummaryDetailsWithStatusNullable, error)

func (*SummaryDetailsWithStatusNullable) ToHumanReadableStatus

func (s *SummaryDetailsWithStatusNullable) ToHumanReadableStatus(childEntityType string) HumanReadableStatus

type SummaryStatusNullable

type SummaryStatusNullable struct {
	EvaluatedStatus              *EvaluatedStatusType `json:"evaluated_status"`
	EvaluatedStatusLastUpdatedAt *time.Time           `json:"evaluated_status_last_updated_at"`
}

type Swarm

type Swarm struct {
	ID             string                 `json:"id"`
	Name           string                 `json:"name"`
	Configuration  map[string]interface{} `json:"configuration"`
	Size           int64                  `json:"size"`
	OwnerID        string                 `json:"owner_id"`
	Used           int64                  `json:"used"`
	CreationDate   time.Time              `json:"creation_date"`
	Description    *string                `json:"description"`
	OrganizationID *string                `json:"organization_id"`
}

func GetSwarm

func GetSwarm(urls configuration.URLs, accessToken, ownerID string, swarmID string) (*Swarm, error)

func ListSwarms

func ListSwarms(urls configuration.URLs, accessToken, ownerID string) ([]*Swarm, error)

type SwarmList

type SwarmList struct {
	Swarms []Swarm `json:"swarms"`
}

func GetTenantCouponSwarms

func GetTenantCouponSwarms(urls configuration.URLs, accessToken, tenantID string) (*SwarmList, error)

type Tenant

type Tenant struct {
	ID          string          `json:"id"`
	Name        string          `json:"name"`
	Description *string         `json:"description"`
	OwnerID     string          `json:"owner_id"`
	CreatedAt   time.Time       `json:"created_at"`
	DeletedAt   *time.Time      `json:"deleted_at"`
	Settings    *TenantSettings `json:"settings"`
	CouponID    *string         `json:"coupon_id"`
}

func GetTenant

func GetTenant(urls configuration.URLs, accessToken, tenantID string) (*Tenant, error)

type TenantList

type TenantList struct {
	Tenants []*Tenant `json:"tenants"`
}

type TenantReport

type TenantReport struct {
	ID         string        `json:"id"`
	ExternalID string        `json:"external_id"`
	TenantName string        `json:"tenant_name"`
	Code       string        `json:"code"`
	StorageBH  string        `json:"storage_bh"`
	StorageGB  string        `json:"storage_gb"`
	EngressGB  string        `json:"engress_gb"`
	FromTime   string        `json:"from_time"`
	ToTime     string        `json:"to_time"`
	Status     string        `json:"status"`
	Timestamp  time.Duration `json:"timestamp"`
}

type TenantReportResponseModel

type TenantReportResponseModel struct {
	Report []ProjectReport `json:"report"`
}

func GetTenantReport

func GetTenantReport(urls configuration.URLs, accessToken, tenantID, from, to string) (*TenantReportResponseModel, error)

type TenantSettings

type TenantSettings struct {
	ConsoleURL        *string                                    `json:"console_url"`
	GatewayURL        *string                                    `json:"gateway_url"`
	Project           *TenantSettingsProject                     `json:"project"`
	Account           *TenantSettingsAccount                     `json:"account"`
	AllowedDomains    *[]string                                  `json:"allowed_domains"`
	BlockedDomains    *[]string                                  `json:"blocked_domains"`
	Notifications     *MonitoredResourceForSeverityNotifications `json:"notifications"`
	SignupDisabled    bool                                       `json:"signup_disabled"`
	SupportLink       *string                                    `json:"support_link"`
	DisplayName       *string                                    `json:"display_name"`
	WhitelabelEnabled bool                                       `json:"whitelabel_enabled"`
	WhiteLabel        *WhiteLabel                                `json:"white_label"`
}

type TenantSettingsAccount

type TenantSettingsAccount struct {
	DefaultMaxProject          *int                        `json:"default_max_project"`
	EnabledAuthProviders       *[]AccountAuthProvider      `json:"enabled_auth_providers"`
	EnabledAuthProvidersConfig *EnabledAuthProvidersConfig `json:"enabled_auth_providers_config"`
}

type TenantSettingsProject

type TenantSettingsProject struct {
	DefaultMaxProjectEgressBandwidth *int64 `json:"default_max_egress_bandwidth"`
	DefaultMaxProjectStorage         *int64 `json:"default_max_storage"`
}

type TenantSwarm

type TenantSwarm struct {
	ID                  string `json:"id"`
	SwarmID             string `json:"swarm_id"`
	TenantID            string `json:"tenant_id"`
	RedundancyClassID   string `json:"redundancy_class_id"`
	Default             bool   `json:"default"`
	SwarmName           string `json:"swarm_name"`
	RedundancyClassName string `json:"redundancy_class_name"`
}

type TenantSwarmList

type TenantSwarmList struct {
	Swarms []*TenantSwarm `json:"swarms"`
}

func ListAvailableTenantSwarms

func ListAvailableTenantSwarms(urls configuration.URLs, accessToken, tenantID string) (*TenantSwarmList, error)

type TokenAndExpirationResponseModel

type TokenAndExpirationResponseModel struct {
	Token   string    `json:"token"`
	Exp     int       `json:"exp"`
	ExpDate time.Time `json:"expDate"`
}

type URLBuilder

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

func NewURLBuilder

func NewURLBuilder(baseURL string) *URLBuilder

func (*URLBuilder) Build

func (ub *URLBuilder) Build() string

func (*URLBuilder) Path

func (ub *URLBuilder) Path(segments ...string) *URLBuilder

func (*URLBuilder) QueryParam

func (ub *URLBuilder) QueryParam(key, value string) *URLBuilder

func (*URLBuilder) QueryParamInt

func (ub *URLBuilder) QueryParamInt(key string, value int) *URLBuilder

type UpdateAccountRequest

type UpdateAccountRequest struct {
	FirstName          *string `json:"first_name"`
	LastName           *string `json:"last_name"`
	EndpointGateway    *string `json:"endpoint_gateway"`
	Internal           *bool   `json:"internal"`
	MaxAllowedProjects *int    `json:"max_allowed_projects"`
}

type UpdateAgentVolumeRequest

type UpdateAgentVolumeRequest struct {
	MountPoint *string `json:"mount_point"`
	Disk       *string `json:"disk"`
}

type UpdateGatewayRequestBody

type UpdateGatewayRequestBody struct {
	Name     *string `json:"name"`
	Location *string `json:"location"`
}

type UpdateNewAgentRequestBody

type UpdateNewAgentRequestBody struct {
	Port     *int                      `json:"port"`
	Features map[string]interface{}    `json:"features"`
	Volume   *UpdateAgentVolumeRequest `json:"volume"`
}

type UpdateNewNodeRequestBody

type UpdateNewNodeRequestBody struct {
	Name      *string `json:"name"`
	Label     *string `json:"label"`
	PublicIP  *string `json:"public_ip"`
	PrivateIP *string `json:"private_ip"`
}

type UpdateNexusRequestBody

type UpdateNexusRequestBody struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Location    string `json:"location"`
}

type UpdateNodeBodyRequest

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

type UpdateSwarmRequest

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

type UpdateTenantProjectRequestBody

type UpdateTenantProjectRequestBody struct {
	Name        *string `json:"name"`
	Description *string `json:"description"`
	ImageURL    *string `json:"image_url"`
}

type UpdateTenantRequestBody

type UpdateTenantRequestBody struct {
	Description *string         `json:"description"`
	Settings    *TenantSettings `json:"settings"`
}

type WhiteLabel

type WhiteLabel struct {
	DNS         *WhiteLabelDNS         `json:"dns"`
	EmailDomain *WhiteLabelEmailDomain `json:"email_domain"`
}

type WhiteLabelDNS

type WhiteLabelDNS struct {
	Value     string `json:"value"`
	Challenge string `json:"challenge"`
	Verified  bool   `json:"verified"`
}

type WhiteLabelEmailDomain

type WhiteLabelEmailDomain struct {
	Value     string               `json:"value"`
	User      *string              `json:"user"`
	Challenge []DNSChallengeRecord `json:"challenge"`
	Verified  bool                 `json:"verified"`
}

type ZoneMap

type ZoneMap struct {
	Zones map[string]ZoneResponse `json:"zones"`
}

func GetGatewayZones

func GetGatewayZones(urls configuration.URLs) (*ZoneMap, error)

type ZoneResponse

type ZoneResponse struct {
	Name        string `json:"name"`
	Key         string `json:"key"`
	Description string `json:"description"`
}

Jump to

Keyboard shortcuts

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