Documentation
¶
Overview ¶
Package api provides functions to interact with the agents API.
Package api provides functions to interact with the auth API.
Index ¶
- Constants
- func DeleteAgent(urls configuration.URLs, accessToken string, swarmID string, nexusID string, ...) error
- func ExtractGenericModel(response any) request_utils.RequestModifier
- func ExtractRefreshCookie(response *string) request_utils.RequestModifier
- func GetDeviceAPIKey(urls configuration.URLs, deviceID string) (string, error)
- func NewMockConfig(profile configuration.ProfileType, apiKey, orgID string) *mockConfig
- func PaginatorHandler[T any](requestFunc request_utils.BoundRequest, urlBuilder URLBuilder, ...) ([]T, error)
- func UpdateAgent(urls configuration.URLs, accessToken string, swarmID string, nexusID string, ...) error
- type APIKeyResponse
- type Account
- type AccountAuthProvider
- type AccountEmail
- type AgentConfig
- type AgentModel
- type AgentVolume
- type AnsibleConfig
- type AuthAPI
- func (api *AuthAPI) Activate(urlConfig configuration.URLs, token string) error
- func (api *AuthAPI) CreateApiKey(urlConfig configuration.URLs, operatorID string, name string, token string, ...) (string, error)
- func (api *AuthAPI) ForgeToken(urlConfig configuration.URLs, operatorID string, email string, password string, ...) (string, error)
- func (api *AuthAPI) GenerateChallenge(urlConfig configuration.URLs, email *string, username *string, ...) (*ChallengeResponseModel, error)
- func (api *AuthAPI) GenerateOldChallenge(urlConfig configuration.URLs, email string) (*ChallengeResponseModel, error)
- func (api *AuthAPI) SignIn(urlConfig configuration.URLs, username string, organization string, ...) (*SignInToken, error)
- func (api *AuthAPI) SignUp(urlConfig configuration.URLs, email string, username string, firstName *string, ...) error
- type AuthAPIInterface
- type BulkInsertNewAgentRequestBody
- type BulkInsertNewNodeRequestBody
- type ChallengeRequestBodyV3
- type ChallengeResponseModel
- type ChangeOperatorPolicyRequestBody
- type CreateGatewayRequestBody
- type CreateNewAgentRequestBody
- type CreateNewNodeRequestBody
- type CreateNexusRequestBody
- type CreateNodeBodyRequest
- type CreateOperatorRequestBodyV2
- type CreateOrganizationRequestBodyV2
- type CreateRedundancyClassRequestBody
- type CreateSwarmRequest
- type CreateTenantRequestBody
- type DNSChallengeRecord
- type DeviceRegistrationResponse
- type Distributor
- type DistributorCoupon
- type DistributorCouponCodeResponseModel
- type DistributorCouponList
- type DistributorList
- type DistributorReportResponseModel
- type EnabledAuthProvidersConfig
- type ErrorResponseModel
- type EvaluatedStatusType
- type ExpansionStatus
- type Gateway
- type GatewayInstance
- type GatewayInstanceListResponse
- type GatewayStatus
- type GatewayTenant
- type GatewayWithGatewayTenant
- type GenericIDResponseModel
- type GenericPaginatedResponse
- func GetAgent(urls configuration.URLs, accessToken string, ...) (*GenericPaginatedResponse[*NewAgent], error)
- func ListAgents(urls configuration.URLs, accessToken string, swarmID string, ...) (*GenericPaginatedResponse[*NewAgent], error)
- func ListAgentsForRC(urls configuration.URLs, accessToken string, swarmID string, rcID, sort string, ...) (*GenericPaginatedResponse[*NewAgent], error)
- type GetAgentEvaluatedStatusResponse
- type HumanReadableDistributorCoupon
- type HumanReadableStatus
- type IAMUser
- type IAMUserEmail
- type IAMUserList
- type InfraAggregateCluster
- type InfraAggregateClusterDetail
- type InfraAggregateDiskDetail
- type InfraAggregateNodeDetail
- type InfraAggregateStatus
- type InfraAggregateStatusCode
- type InfraAggregateVirtualNodeDetail
- type InfraClusterConnectCmdResponse
- type InfraClusterType
- type InfraNodeCPUInfo
- type InfraNodeRAMInfo
- type InfraVirtualStorageType
- type InfrastructureCluster
- type InviteOperatorRequestBody
- type LocationAPI
- func (api *LocationAPI) CreateVirtualCluster(urlConfig configuration.URLs, apiKey string, organizationID string, ...) (*InfrastructureCluster, error)
- func (api *LocationAPI) CreateVirtualNode(urlConfig configuration.URLs, apiKey string, organizationID string, ...) (*InfraAggregateVirtualNodeDetail, error)
- func (api *LocationAPI) List(urlConfig configuration.URLs, apiKey string, organizationID string) ([]InfrastructureCluster, error)
- func (api *LocationAPI) ListAggregated(urlConfig configuration.URLs, apiKey string, organizationID string) ([]InfraAggregateCluster, error)
- type LocationAPIInterface
- type MockLocationAPI
- func (m *MockLocationAPI) CreateVirtualCluster(urlConfig configuration.URLs, apiKey string, organizationID string, ...) (*InfrastructureCluster, error)
- func (m *MockLocationAPI) CreateVirtualNode(urlConfig configuration.URLs, apiKey string, organizationID string, ...) (*InfraAggregateVirtualNodeDetail, error)
- func (m *MockLocationAPI) List(urlConfig configuration.URLs, apiKey string, organizationID string) ([]InfrastructureCluster, error)
- func (m *MockLocationAPI) ListAggregated(urlConfig configuration.URLs, apiKey string, organizationID string) ([]InfraAggregateCluster, error)
- type MonitoredResourceForSeverityNotifications
- type NewAgent
- type NewAgentResponse
- type NewAgentsResponse
- type NewNode
- type NewNodeResponseItem
- type NewNodesResponse
- type Nexus
- type NexusList
- type Node
- type NodeConfig
- type NodeList
- type Notification
- type OperatorAPI
- type OperatorAPIInterface
- type OperatorAPIKey
- type PaginatorHandlerOptions
- type PaginatorHandlerOptionsFunc
- type Policy
- type PolicyList
- type ProjectItem
- type ProjectReport
- type Provider
- type ProviderList
- type RCProgress
- type RCSession
- type RCSessionStatus
- type RecoveryProgress
- type RecoveryStatus
- type RedundancyClass
- type RedundancyClassErrorData
- type RedundancyClassExpanded
- type RedundancyClassList
- type RedundancyClassRecovery
- type Ring
- type RingBulk
- type RingList
- type RingNexus
- type RingNode
- type Severity
- type SeverityForNotificationType
- type SeverityNotificationType
- type SignInToken
- type SignUpRequestBody
- type SummaryDetails
- type SummaryDetailsWithStatusNullable
- type SummaryStatusNullable
- type Swarm
- type SwarmList
- type Tenant
- type TenantList
- type TenantReport
- type TenantReportResponseModel
- type TenantSettings
- type TenantSettingsAccount
- type TenantSettingsProject
- type TenantSwarm
- type TenantSwarmList
- type TokenAndExpirationResponseModel
- type URLBuilder
- type UpdateAccountRequest
- type UpdateAgentVolumeRequest
- type UpdateGatewayRequestBody
- type UpdateNewAgentRequestBody
- type UpdateNewNodeRequestBody
- type UpdateNexusRequestBody
- type UpdateNodeBodyRequest
- type UpdateSwarmRequest
- type UpdateTenantProjectRequestBody
- type UpdateTenantRequestBody
- type UserAPI
- func (a *UserAPI) GetIAMUser(urls configuration.URLs, accessToken, apiKey string, meOrID string) (*IAMUser, error)
- func (a *UserAPI) GetIAMUserSelf(urls configuration.URLs, accessToken, apiKey string) (*IAMUser, error)
- func (a *UserAPI) PromoteIAMUser(urls configuration.URLs, email, policyName, secret string) error
- type UserAPIInterface
- type WhiteLabel
- type WhiteLabelDNS
- type WhiteLabelEmailDomain
- type ZoneMap
- type ZoneResponse
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 DeleteAgent ¶
func ExtractGenericModel ¶
func ExtractGenericModel(response any) request_utils.RequestModifier
func ExtractRefreshCookie ¶
func ExtractRefreshCookie(response *string) request_utils.RequestModifier
func GetDeviceAPIKey ¶
func GetDeviceAPIKey(urls configuration.URLs, deviceID string) (string, error)
func NewMockConfig ¶
func NewMockConfig(profile configuration.ProfileType, apiKey, orgID string) *mockConfig
func PaginatorHandler ¶
func PaginatorHandler[T any]( requestFunc request_utils.BoundRequest, urlBuilder URLBuilder, opts ...PaginatorHandlerOptionsFunc, ) ([]T, error)
func UpdateAgent ¶
func UpdateAgent(urls configuration.URLs, accessToken string, swarmID string, nexusID string, nodeID string, agentID string, nodesBody UpdateNewAgentRequestBody) error
Types ¶
type APIKeyResponse ¶
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"`
}
type AccountAuthProvider ¶
type AccountAuthProvider string
type AccountEmail ¶
type AgentConfig ¶
type AgentModel ¶
type AgentModel string
const ( UnknownAgentModel AgentModel = "unknown" CellAgentModel AgentModel = "cell" VirtualAgentModel AgentModel = "virtual" )
type AgentVolume ¶
type AnsibleConfig ¶
type AnsibleConfig struct {
Nodes []NodeConfig `json:"nodes"`
}
type AuthAPI ¶
type AuthAPI struct {
// contains filtered or unexported fields
}
func NewAuthAPI ¶
func NewAuthAPI(config *configuration.Config) *AuthAPI
func (*AuthAPI) Activate ¶
func (api *AuthAPI) Activate( urlConfig configuration.URLs, token string, ) error
func (*AuthAPI) CreateApiKey ¶
func (*AuthAPI) ForgeToken ¶
func (*AuthAPI) GenerateChallenge ¶
func (api *AuthAPI) GenerateChallenge( urlConfig configuration.URLs, email *string, username *string, organizationName *string, ) (*ChallengeResponseModel, error)
func (*AuthAPI) GenerateOldChallenge ¶
func (api *AuthAPI) GenerateOldChallenge( urlConfig configuration.URLs, email string, ) (*ChallengeResponseModel, error)
func (*AuthAPI) SignIn ¶
func (api *AuthAPI) SignIn( urlConfig configuration.URLs, username string, organization string, password string, tfaCode string, ) (*SignInToken, error)
type AuthAPIInterface ¶
type AuthAPIInterface interface {
Activate(
urlConfig configuration.URLs,
token string,
) error
SignUp(
urlConfig configuration.URLs,
email string,
username string,
firstName *string,
lastName *string,
authenticationPublicKey *string,
organizationName string,
organizationBasePolicy map[string]interface{},
organizationSettings map[string]interface{},
) error
SignIn(
urlConfig configuration.URLs,
username string,
organization string,
password string,
tfaCode string,
) (*SignInToken, error)
GenerateChallenge(
urlConfig configuration.URLs,
email *string,
username *string,
organizationName *string,
) (*ChallengeResponseModel, error)
ForgeToken(
urlConfig configuration.URLs,
operatorID string,
email string,
password string,
tfaCode string,
tokenType string,
token string,
refreshToken string,
) (string, error)
CreateApiKey(
urlConfig configuration.URLs,
operatorID string,
name string,
token string,
forgeApiKeyToken string,
) (string, error)
}
type BulkInsertNewAgentRequestBody ¶
type BulkInsertNewAgentRequestBody struct {
Agents []CreateNewAgentRequestBody `json:"agents"`
}
type BulkInsertNewNodeRequestBody ¶
type BulkInsertNewNodeRequestBody struct {
Nodes []CreateNewNodeRequestBody `json:"nodes"`
}
type ChallengeRequestBodyV3 ¶
type ChallengeRequestBodyV3 struct {
Email *string `json:"email,omitempty"`
Username *string `json:"username,omitempty"`
OrganizationName *string `json:"organization_name,omitempty"`
}
func CreateChallengeRequestBodyV3 ¶
func CreateChallengeRequestBodyV3( email *string, username *string, organizationName *string, ) ChallengeRequestBodyV3
type ChallengeResponseModel ¶
type ChangeOperatorPolicyRequestBody ¶
type ChangeOperatorPolicyRequestBody struct {
PolicyID string `json:"policy_id"`
}
type CreateNewAgentRequestBody ¶
type CreateNewAgentRequestBody struct {
Port int `json:"port"`
Features map[string]interface{} `json:"features"`
Volume AgentVolume `json:"volume"`
}
type CreateNexusRequestBody ¶
type CreateNodeBodyRequest ¶
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 CreateTenantRequestBody ¶
type DNSChallengeRecord ¶
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 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 ErrorResponseModel ¶
type EvaluatedStatusType ¶
type EvaluatedStatusType string
type ExpansionStatus ¶
type ExpansionStatus string
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"`
}
type GenericIDResponseModel ¶
type GenericIDResponseModel struct {
ID string `json:"id"`
}
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)
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 IAMUser ¶
type IAMUser 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 []IAMUserEmail `json:"emails"`
TwoFactorEnabled bool `json:"two_factor_enabled"`
Status string `json:"status"`
PolicyName string `json:"policy_name"`
OrganizationID *string `json:"organization_id"`
}
type IAMUserEmail ¶
type IAMUserList ¶
type IAMUserList struct {
Operators []*IAMUser `json:"operators"`
}
type InfraAggregateCluster ¶
type InfraAggregateCluster struct {
ClusterID string `json:"cluster_id"`
Name string `json:"name"`
Details InfraAggregateClusterDetail `json:"details"`
Type InfraClusterType `json:"type"`
}
type InfraAggregateClusterDetail ¶
type InfraAggregateClusterDetail struct {
LastUpdate time.Time `json:"last_update"`
NextUpdate time.Time `json:"next_update"`
IsUpdateOk bool `json:"is_update_ok"`
Nodes []InfraAggregateNodeDetail `json:"nodes"`
VirtualNodes []InfraAggregateVirtualNodeDetail `json:"virtual_nodes"`
}
type InfraAggregateDiskDetail ¶
type InfraAggregateDiskDetail struct {
DiskUUID string `json:"disk_uuid"`
Path string `json:"path"`
Used bool `json:"used"`
PVRef string `json:"pv_ref,omitempty"`
TotalStorageSizeBytes int64 `json:"total_storage_size_bytes"`
UsedStorageBytes int64 `json:"used_storage_bytes"`
Status InfraAggregateStatus `json:"status"`
}
type InfraAggregateNodeDetail ¶
type InfraAggregateNodeDetail struct {
NodeID string `json:"node_id"`
NodeName string `json:"node_name"`
Status InfraAggregateStatus `json:"status"`
OSName *string `json:"os_name,omitempty"`
CPU *InfraNodeCPUInfo `json:"cpu,omitempty"`
RAM *InfraNodeRAMInfo `json:"ram,omitempty"`
ExternalIP *string `json:"external_ip,omitempty"`
InternalIP *string `json:"internal_ip"`
Disks []InfraAggregateDiskDetail `json:"disks"`
}
type InfraAggregateStatus ¶
type InfraAggregateStatusCode ¶
type InfraAggregateStatusCode string
const ( StatusCodeOk InfraAggregateStatusCode = "status_ok" StatusCodeWarning InfraAggregateStatusCode = "status_warning" StatusCodeError InfraAggregateStatusCode = "status_error" StatusCodeInUse InfraAggregateStatusCode = "status_in_use" )
type InfraAggregateVirtualNodeDetail ¶
type InfraAggregateVirtualNodeDetail struct {
NodeID string `json:"node_id"`
NodeName string `json:"node_name"`
Status InfraAggregateStatus `json:"status"`
StorageType InfraVirtualStorageType `json:"storage_type"`
StorageConfiguration map[string]any `json:"storage_configuration"`
}
type InfraClusterConnectCmdResponse ¶
type InfraClusterConnectCmdResponse struct {
// mandatory, the generated command to use to execute a cluster-connect. It will contains the orgranization-id and its api-key
Command string `` /* 231-byte string literal not displayed */
}
type InfraClusterType ¶
type InfraClusterType string
const ( ClusterTypePhysical InfraClusterType = "physical" ClusterTypeVirtual InfraClusterType = "virtual" )
type InfraNodeCPUInfo ¶
type InfraNodeCPUInfo struct {
Cores int `json:"cores"`
}
type InfraNodeRAMInfo ¶
type InfraNodeRAMInfo struct {
Available float64 `json:"available"`
}
type InfraVirtualStorageType ¶
type InfraVirtualStorageType string
const (
VirtualStorageTypeS3 InfraVirtualStorageType = "s3"
)
type InfrastructureCluster ¶
type LocationAPI ¶
type LocationAPI struct{}
func NewLocationAPI ¶
func NewLocationAPI() *LocationAPI
func (*LocationAPI) CreateVirtualCluster ¶
func (api *LocationAPI) CreateVirtualCluster( urlConfig configuration.URLs, apiKey string, organizationID string, name string, description *string, ) (*InfrastructureCluster, error)
func (*LocationAPI) CreateVirtualNode ¶
func (api *LocationAPI) CreateVirtualNode( urlConfig configuration.URLs, apiKey string, organizationID string, clusterID string, name string, storageType string, configuration map[string]any, ) (*InfraAggregateVirtualNodeDetail, error)
func (*LocationAPI) List ¶
func (api *LocationAPI) List( urlConfig configuration.URLs, apiKey string, organizationID string, ) ([]InfrastructureCluster, error)
func (*LocationAPI) ListAggregated ¶
func (api *LocationAPI) ListAggregated( urlConfig configuration.URLs, apiKey string, organizationID string, ) ([]InfraAggregateCluster, error)
type LocationAPIInterface ¶
type LocationAPIInterface interface {
List(
urlConfig configuration.URLs,
apiKey string,
organizationID string,
) ([]InfrastructureCluster, error)
ListAggregated(
urlConfig configuration.URLs,
apiKey string,
organizationID string,
) ([]InfraAggregateCluster, error)
CreateVirtualCluster(
urlConfig configuration.URLs,
apiKey string,
organizationID string,
name string,
description *string,
) (*InfrastructureCluster, error)
CreateVirtualNode(
urlConfig configuration.URLs,
apiKey string,
organizationID string,
clusterID string,
name string,
storageType string,
configuration map[string]any,
) (*InfraAggregateVirtualNodeDetail, error)
}
type MockLocationAPI ¶
type MockLocationAPI struct {
ListFunc func(urlConfig configuration.URLs, apiKey string, organizationID string) ([]InfrastructureCluster, error)
ListAggregatedFunc func(urlConfig configuration.URLs, apiKey string, organizationID string) ([]InfraAggregateCluster, error)
CreateVirtualFunc func(urlConfig configuration.URLs, apiKey string, organizationID string, name string, description *string) (*InfrastructureCluster, error)
CreateVirtualNodeFunc func(urlConfig configuration.URLs, apiKey string, organizationID string, clusterID string, name string, storageType string, configuration map[string]any) (*InfraAggregateVirtualNodeDetail, error)
}
MockLocationAPI implements LocationAPIInterface for testing
func (*MockLocationAPI) CreateVirtualCluster ¶
func (m *MockLocationAPI) CreateVirtualCluster(urlConfig configuration.URLs, apiKey string, organizationID string, name string, description *string) (*InfrastructureCluster, error)
func (*MockLocationAPI) CreateVirtualNode ¶
func (m *MockLocationAPI) CreateVirtualNode(urlConfig configuration.URLs, apiKey string, organizationID string, clusterID string, name string, storageType string, configuration map[string]any) (*InfraAggregateVirtualNodeDetail, error)
func (*MockLocationAPI) List ¶
func (m *MockLocationAPI) List(urlConfig configuration.URLs, apiKey string, organizationID string) ([]InfrastructureCluster, error)
func (*MockLocationAPI) ListAggregated ¶
func (m *MockLocationAPI) ListAggregated(urlConfig configuration.URLs, apiKey string, organizationID string) ([]InfraAggregateCluster, error)
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 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"`
}
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"`
}
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"`
}
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 Notification ¶
type OperatorAPI ¶
type OperatorAPI struct {
// contains filtered or unexported fields
}
func NewOperatorAPI ¶
func NewOperatorAPI(config *configuration.Config) *OperatorAPI
func (*OperatorAPI) Connect ¶
func (api *OperatorAPI) Connect( urlConfig configuration.URLs, apiKey string, organizationID string, ) (string, error)
type OperatorAPIInterface ¶
type OperatorAPIKey ¶
type OperatorAPIKey struct {
ID string `json:"id" example:"695ed3dd-e77d-42b9-88ed-70bd3a1704ee"`
Name string `json:"name" example:"API Key for Mario Rossi"`
Key string `json:"key" example:"4f2a1b3c5d6e7f8a9b0c1d2e3f4a5b6c"`
OperatorID string `json:"operator_id" example:"695ed3dd-e77d-42b9-88ed-70bd3a1704ee"`
CreatedAt time.Time `json:"created_at" example:"2023-01-18T12:42:59.089247Z"`
ExpiresAt *time.Time `json:"expires_at" example:"2023-01-18T12:42:59.089247Z"`
DeletedAt *time.Time `json:"deleted_at" example:"2023-01-18T12:42:59.089247Z"`
BannedAt *time.Time `json:"banned_at" example:"2023-01-18T12:42:59.089247Z"`
Enabled bool `json:"enabled" example:"true"`
}
type PaginatorHandlerOptions ¶
type PaginatorHandlerOptions struct {
PageSize int
PageNumer int
NextPageNumber *int
FetchAllPages bool
}
func NewDefaultPaginatorHandlerOptions ¶
func NewDefaultPaginatorHandlerOptions() *PaginatorHandlerOptions
func (*PaginatorHandlerOptions) GetNextPageNumber ¶
func (o *PaginatorHandlerOptions) GetNextPageNumber() *int
func (*PaginatorHandlerOptions) SetNextPage ¶
func (o *PaginatorHandlerOptions) SetNextPage(nextPage *int)
type PaginatorHandlerOptionsFunc ¶
type PaginatorHandlerOptionsFunc = func(*PaginatorHandlerOptions) error
func WithFetchAllPages ¶
func WithFetchAllPages(fetchAll bool) PaginatorHandlerOptionsFunc
func WithPageNumber ¶
func WithPageNumber(pageNumber int) PaginatorHandlerOptionsFunc
func WithPageSize ¶
func WithPageSize(pageSize int) PaginatorHandlerOptionsFunc
type PolicyList ¶
type PolicyList struct {
Policies []Policy `json:"policies"`
}
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"`
}
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 ProviderList ¶
type RCProgress ¶
type RCProgress struct {
Session RCSession `json:"session"`
ActiveRecoveries []RecoveryProgress `json:"active_recoveries"`
FailedRecoveries []RecoveryProgress `json:"failed_recoveries"`
CompletionPercent float64 `json:"completion_percent"`
}
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 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"`
}
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"`
}
type RedundancyClassList ¶
type RedundancyClassList struct {
Data []*RedundancyClass `json:"data"`
Page int `json:"page"`
}
type RedundancyClassRecovery ¶
type RedundancyClassRecovery struct {
Message string `json:"message"`
}
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 SeverityForNotificationType ¶
type SeverityForNotificationType map[Severity]SeverityNotificationType
type SeverityNotificationType ¶
type SeverityNotificationType struct {
Threshold int `json:"threshold"`
Notify Notification `json:"notify"`
}
type SignInToken ¶
type SignUpRequestBody ¶
type SignUpRequestBody struct {
Operator CreateOperatorRequestBodyV2 `json:"operator"`
Organization CreateOrganizationRequestBodyV2 `json:"organization"`
}
type SummaryDetails ¶
type SummaryDetailsWithStatusNullable ¶
type SummaryDetailsWithStatusNullable struct {
Details *SummaryDetails `json:"details"`
SummaryStatusNullable
}
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"`
}
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"`
}
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"`
}
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 TenantSwarm ¶
type TenantSwarmList ¶
type TenantSwarmList struct {
Swarms []*TenantSwarm `json:"swarms"`
}
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 UpdateNewAgentRequestBody ¶
type UpdateNewAgentRequestBody struct {
Port *int `json:"port"`
Features map[string]interface{} `json:"features"`
Volume *UpdateAgentVolumeRequest `json:"volume"`
}
type UpdateNexusRequestBody ¶
type UpdateNodeBodyRequest ¶
type UpdateSwarmRequest ¶
type UpdateTenantRequestBody ¶
type UpdateTenantRequestBody struct {
Description *string `json:"description"`
Settings *TenantSettings `json:"settings"`
}
type UserAPI ¶
type UserAPI struct{}
func NewUserAPI ¶
func NewUserAPI() *UserAPI
func (*UserAPI) GetIAMUser ¶
func (*UserAPI) GetIAMUserSelf ¶
func (*UserAPI) PromoteIAMUser ¶
func (a *UserAPI) PromoteIAMUser(urls configuration.URLs, email, policyName, secret string) error
type UserAPIInterface ¶
type UserAPIInterface interface {
GetIAMUser(
urls configuration.URLs,
accessToken, apiKey string,
meOrID string,
) (*IAMUser, error)
GetIAMUserSelf(
urls configuration.URLs,
accessToken, apiKey string,
) (*IAMUser, error)
PromoteIAMUser(
urls configuration.URLs,
email,
policyName,
secret string,
) error
}
type WhiteLabel ¶
type WhiteLabel struct {
DNS *WhiteLabelDNS `json:"dns"`
EmailDomain *WhiteLabelEmailDomain `json:"email_domain"`
}
type WhiteLabelDNS ¶
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"`
}
type ZoneResponse ¶
Click to show internal directories.
Click to hide internal directories.