Documentation
¶
Overview ¶
Package types provides the Arcane API endpoint path builders and CLI configuration types.
Each endpoint is a plain function that returns the request path, escaping every caller-supplied segment so resource names with special characters cannot alter the route.
Index ¶
- Constants
- Variables
- func Activities(envID string) string
- func ActivitiesHistory(envID string) string
- func Activity(envID, activityID string) string
- func ActivityCancel(envID, activityID string) string
- func ApiKey(id string) string
- func ApiKeys() string
- func AuthFederated() string
- func AuthLogout() string
- func AuthMe() string
- func AuthMeApiKey(id string) string
- func AuthMeApiKeys() string
- func AuthPassword() string
- func AuthRefresh() string
- func Backup(id string) string
- func BackupRestore(id string) string
- func BackupUpload(id string) string
- func Backups() string
- func BackupsDiscover() string
- func BackupsPolicies() string
- func BackupsRecoveryKey() string
- func BackupsRecoveryKeyGenerate() string
- func BackupsS3() string
- func BackupsS3Destination(id string) string
- func BackupsS3DestinationInUse(id string) string
- func BackupsS3DestinationTest(id string) string
- func BackupsS3Options() string
- func BackupsS3Test() string
- func Container(envID, containerID string) string
- func ContainerAutoUpdate(envID, containerID string) string
- func ContainerCommit(envID, containerID string) string
- func ContainerEdit(envID, containerID string) string
- func ContainerEditConfig(envID, containerID string) string
- func ContainerKill(envID, containerID string) string
- func ContainerPause(envID, containerID string) string
- func ContainerRedeploy(envID, containerID string) string
- func ContainerRegistries() string
- func ContainerRegistriesPullUsage() string
- func ContainerRegistry(id string) string
- func ContainerRegistryTest(id string) string
- func ContainerRestart(envID, containerID string) string
- func ContainerStart(envID, containerID string) string
- func ContainerStop(envID, containerID string) string
- func ContainerUnpause(envID, containerID string) string
- func ContainerUpdate(envID, containerID string) string
- func Containers(envID string) string
- func ContainersCounts(envID string) string
- func Environment(id string) string
- func EnvironmentTest(envID string) string
- func EnvironmentVersion(envID string) string
- func Environments() string
- func Event(id string) string
- func Events() string
- func EventsEnvironment(envID string) string
- func EventsStats() string
- func FederatedCredential(id string) string
- func FederatedCredentials() string
- func GitOpsSync(envID, syncID string) string
- func GitOpsSyncFiles(envID, syncID string) string
- func GitOpsSyncStatus(envID, syncID string) string
- func GitOpsSyncTrigger(envID, syncID string) string
- func GitOpsSyncs(envID string) string
- func GitOpsSyncsImport(envID string) string
- func GitRepositories() string
- func GitRepository(id string) string
- func GitRepositoryBranches(id string) string
- func GitRepositoryFiles(id string) string
- func GitRepositoryTest(id string) string
- func Image(envID, imageID string) string
- func ImageAttestations(envID, name string) string
- func ImageBuild(envID, buildID string) string
- func ImageBuilds(envID string) string
- func ImageExport(envID, name string) string
- func ImageHistory(envID, name string) string
- func ImageTag(envID, name string) string
- func ImageUpdatesCheck(envID, imageRef string) string
- func ImageUpdatesCheckAll(envID string) string
- func ImageUpdatesCheckBatch(envID string) string
- func ImageUpdatesCheckById(envID, imageID string) string
- func ImageUpdatesSummary(envID string) string
- func ImageVulnerabilities(envID, imageID string) string
- func ImageVulnerabilitiesList(envID, imageID string) string
- func ImageVulnerabilitiesScan(envID, imageID string) string
- func ImageVulnerabilitiesSummary(envID, imageID string) string
- func Images(envID string) string
- func ImagesBuild(envID string) string
- func ImagesCounts(envID string) string
- func ImagesPrune(envID string) string
- func ImagesPull(envID string) string
- func ImagesSearch(envID string) string
- func ImagesUpload(envID string) string
- func ImagesVulnerabilitiesSummaries(envID string) string
- func JobRun(envID, jobID string) string
- func JobSchedules(envID string) string
- func Jobs(envID string) string
- func Network(envID, networkID string) string
- func NetworkConnect(envID, networkID string) string
- func NetworkDisconnect(envID, networkID string) string
- func Networks(envID string) string
- func NetworksCounts(envID string) string
- func NetworksPrune(envID string) string
- func NetworksTopology(envID string) string
- func NormalizePaginatedResource(resource string) string
- func NotificationSettingsProvider(envID, provider string) string
- func NotificationsSettings(envID string) string
- func NotificationsTestProvider(envID, provider string) string
- func OIDCDeviceCode() string
- func OIDCDeviceToken() string
- func OIDCStatus() string
- func OidcRoleMapping(id string) string
- func OidcRoleMappings() string
- func Project(envID, projectID string) string
- func ProjectArchive(envID, projectID string) string
- func ProjectBuild(envID, projectID string) string
- func ProjectDestroy(envID, projectID string) string
- func ProjectDown(envID, projectID string) string
- func ProjectPull(envID, projectID string) string
- func ProjectRedeploy(envID, projectID string) string
- func ProjectRestart(envID, projectID string) string
- func ProjectTags(envID, projectID string) string
- func ProjectUnarchive(envID, projectID string) string
- func ProjectUp(envID, projectID string) string
- func ProjectUpdateServices(envID, projectID string) string
- func ProjectWorkspace(envID, projectID string) string
- func ProjectWorkspaceFile(envID, projectID string) string
- func ProjectWorkspaceFileDownload(envID, projectID string) string
- func Projects(envID string) string
- func ProjectsCounts(envID string) string
- func ProjectsTags(envID string) string
- func Role(id string) string
- func Roles() string
- func RolesAvailablePermissions() string
- func Settings(envID string) string
- func SettingsPublic(envID string) string
- func SystemContainersStartAll(envID string) string
- func SystemContainersStopAll(envID string) string
- func SystemConvert(envID string) string
- func SystemDockerInfo(envID string) string
- func SystemPrune(envID string) string
- func SystemStartStopped(envID string) string
- func SystemUpgrade(envID string) string
- func SystemUpgradeAll(envID string) string
- func SystemUpgradeAllStatus(envID string) string
- func SystemUpgradeCheck(envID string) string
- func Template(id string) string
- func TemplateContent(id string) string
- func TemplateDownload(id string) string
- func TemplateFetch() string
- func TemplateRegistry(id string) string
- func Templates() string
- func TemplatesAll() string
- func TemplatesDefault() string
- func TemplatesRegistries() string
- func TemplatesVariables() string
- func UpdaterHistory(envID string) string
- func UpdaterRun(envID string) string
- func UpdaterStatus(envID string) string
- func UploadSession(envID, kind, uploadID string) string
- func UploadSessionChunk(envID, kind, uploadID string, index int) string
- func UploadSessions(envID, kind string) string
- func User(id string) string
- func UserRoleAssignments(userID string) string
- func Users() string
- func Variable(id string) string
- func Variables() string
- func VariablesSync() string
- func VariablesSyncStatus() string
- func Volume(envID, volumeName string) string
- func VolumeBackup(envID, backupID string) string
- func VolumeBackupDownload(envID, backupID string) string
- func VolumeBackupFiles(envID, backupID string) string
- func VolumeBackupPolicy(envID, volumeName string) string
- func VolumeBackupRestore(envID, volumeName, backupID string) string
- func VolumeBackupRestoreFiles(envID, volumeName, backupID string) string
- func VolumeBackupUpload(envID, backupID string) string
- func VolumeBackupUploadRestore(envID, volumeName string) string
- func VolumeBackups(envID, volumeName string) string
- func VolumeRename(envID, volumeName string) string
- func VolumeUsage(envID, volumeName string) string
- func VolumeWorkspace(envID, volumeName string) string
- func VolumeWorkspaceFile(envID, volumeName string) string
- func VolumeWorkspaceFileDownload(envID, volumeName string) string
- func Volumes(envID string) string
- func VolumesCounts(envID string) string
- func VolumesPrune(envID string) string
- func VolumesSizes(envID string) string
- func VulnerabilitiesAll(envID string) string
- func VulnerabilitiesIgnore(envID string) string
- func VulnerabilitiesIgnored(envID string) string
- func VulnerabilitiesScannerStatus(envID string) string
- func VulnerabilitiesSummary(envID string) string
- func VulnerabilityIgnore(envID, ignoreID string) string
- func Webhook(envID, webhookID string) string
- func WebhookTrigger(token string) string
- func Webhooks(envID string) string
- type Config
- func (c *Config) Clone() *Config
- func (c *Config) HasAuth() bool
- func (c *Config) IsConfigured() bool
- func (c *Config) LimitFor(resource string) int
- func (c *Config) SetDefaultLimit(limit int)
- func (c *Config) SetResourceLimit(resource string, limit int)
- func (c *Config) Validate() error
- func (c *Config) ValidateServerURL() error
- type PaginationConfig
- type PaginationResourceConfig
Constants ¶
const ( VersionEndpoint = "/api/version" AppVersionEndpoint = "/api/app-version" )
Version
Variables ¶
var KnownPaginatedResources = []string{
"containers",
"images",
"volumes",
"networks",
"projects",
"environments",
"registries",
"templates",
"repos",
"gitops-syncs",
"users",
"roles",
"events",
"apikeys",
}
KnownPaginatedResources is the canonical list of paginated CLI resources.
Functions ¶
func Activities ¶ added in v2.9.0
func ActivitiesHistory ¶ added in v2.9.0
func ActivityCancel ¶ added in v2.9.0
func AuthFederated ¶ added in v2.9.0
func AuthFederated() string
func AuthLogout ¶ added in v2.9.0
func AuthLogout() string
func AuthMeApiKey ¶ added in v2.9.0
func AuthMeApiKeys ¶ added in v2.9.0
func AuthMeApiKeys() string
func AuthPassword ¶ added in v2.9.0
func AuthPassword() string
func AuthRefresh ¶ added in v2.9.0
func AuthRefresh() string
func BackupRestore ¶ added in v2.9.0
func BackupUpload ¶ added in v2.9.0
func BackupsDiscover ¶ added in v2.9.0
func BackupsDiscover() string
func BackupsPolicies ¶ added in v2.9.0
func BackupsPolicies() string
func BackupsRecoveryKey ¶ added in v2.9.0
func BackupsRecoveryKey() string
func BackupsRecoveryKeyGenerate ¶ added in v2.9.0
func BackupsRecoveryKeyGenerate() string
func BackupsS3Destination ¶ added in v2.9.0
func BackupsS3DestinationInUse ¶ added in v2.9.0
func BackupsS3DestinationTest ¶ added in v2.9.0
func BackupsS3Options ¶ added in v2.9.0
func BackupsS3Options() string
func BackupsS3Test ¶ added in v2.9.0
func BackupsS3Test() string
func ContainerAutoUpdate ¶ added in v2.9.0
func ContainerCommit ¶ added in v2.9.0
func ContainerEdit ¶ added in v2.9.0
func ContainerEditConfig ¶ added in v2.9.0
func ContainerKill ¶ added in v2.9.0
func ContainerPause ¶ added in v2.9.0
func ContainerRedeploy ¶ added in v2.9.0
func ContainerRegistries ¶ added in v2.9.0
func ContainerRegistries() string
func ContainerRegistriesPullUsage ¶ added in v2.9.0
func ContainerRegistriesPullUsage() string
func ContainerRegistry ¶ added in v2.9.0
func ContainerRegistryTest ¶ added in v2.9.0
func ContainerRestart ¶ added in v2.9.0
func ContainerStart ¶ added in v2.9.0
func ContainerStop ¶ added in v2.9.0
func ContainerUnpause ¶ added in v2.9.0
func ContainerUpdate ¶ added in v2.9.0
func Containers ¶ added in v2.9.0
func ContainersCounts ¶ added in v2.9.0
func Environment ¶ added in v2.9.0
func EnvironmentTest ¶ added in v2.9.0
func EnvironmentVersion ¶ added in v2.9.0
func Environments ¶ added in v2.9.0
func Environments() string
func EventsEnvironment ¶ added in v2.9.0
func EventsStats ¶ added in v2.9.0
func EventsStats() string
func FederatedCredential ¶ added in v2.9.0
func FederatedCredentials ¶ added in v2.9.0
func FederatedCredentials() string
func GitOpsSync ¶ added in v2.9.0
func GitOpsSyncFiles ¶ added in v2.9.0
func GitOpsSyncStatus ¶ added in v2.9.0
func GitOpsSyncTrigger ¶ added in v2.9.0
func GitOpsSyncs ¶ added in v2.9.0
func GitOpsSyncsImport ¶ added in v2.9.0
func GitRepositories ¶ added in v2.9.0
func GitRepositories() string
func GitRepository ¶ added in v2.9.0
func GitRepositoryBranches ¶ added in v2.9.0
func GitRepositoryFiles ¶ added in v2.9.0
func GitRepositoryTest ¶ added in v2.9.0
func ImageAttestations ¶ added in v2.9.0
func ImageBuild ¶ added in v2.9.0
func ImageBuilds ¶ added in v2.9.0
func ImageExport ¶ added in v2.9.0
func ImageHistory ¶ added in v2.9.0
func ImageUpdatesCheck ¶ added in v2.9.0
func ImageUpdatesCheckAll ¶ added in v2.9.0
func ImageUpdatesCheckBatch ¶ added in v2.9.0
func ImageUpdatesCheckById ¶ added in v2.9.0
func ImageUpdatesSummary ¶ added in v2.9.0
func ImageVulnerabilities ¶ added in v2.9.0
func ImageVulnerabilitiesList ¶ added in v2.9.0
func ImageVulnerabilitiesScan ¶ added in v2.9.0
func ImageVulnerabilitiesSummary ¶ added in v2.9.0
func ImagesBuild ¶ added in v2.9.0
func ImagesCounts ¶ added in v2.9.0
func ImagesPrune ¶ added in v2.9.0
func ImagesPull ¶ added in v2.9.0
func ImagesSearch ¶ added in v2.9.0
func ImagesUpload ¶ added in v2.9.0
func ImagesVulnerabilitiesSummaries ¶ added in v2.9.0
func JobSchedules ¶ added in v2.9.0
func NetworkConnect ¶ added in v2.9.0
func NetworkDisconnect ¶ added in v2.9.0
func NetworksCounts ¶ added in v2.9.0
func NetworksPrune ¶ added in v2.9.0
func NetworksTopology ¶ added in v2.9.0
func NormalizePaginatedResource ¶
NormalizePaginatedResource normalizes resource names and common aliases.
func NotificationSettingsProvider ¶ added in v2.9.0
func NotificationsSettings ¶ added in v2.9.0
func NotificationsTestProvider ¶ added in v2.9.0
func OIDCDeviceCode ¶ added in v2.9.0
func OIDCDeviceCode() string
func OIDCDeviceToken ¶ added in v2.9.0
func OIDCDeviceToken() string
func OIDCStatus ¶ added in v2.9.0
func OIDCStatus() string
func OidcRoleMapping ¶ added in v2.9.0
func OidcRoleMappings ¶ added in v2.9.0
func OidcRoleMappings() string
func ProjectArchive ¶ added in v2.9.0
func ProjectBuild ¶ added in v2.9.0
func ProjectDestroy ¶ added in v2.9.0
func ProjectDown ¶ added in v2.9.0
func ProjectPull ¶ added in v2.9.0
func ProjectRedeploy ¶ added in v2.9.0
func ProjectRestart ¶ added in v2.9.0
func ProjectTags ¶ added in v2.9.0
func ProjectUnarchive ¶ added in v2.9.0
func ProjectUpdateServices ¶ added in v2.9.0
func ProjectWorkspace ¶ added in v2.9.0
func ProjectWorkspaceFile ¶ added in v2.9.0
func ProjectWorkspaceFileDownload ¶ added in v2.9.0
func ProjectsCounts ¶ added in v2.9.0
func ProjectsTags ¶ added in v2.9.0
func RolesAvailablePermissions ¶ added in v2.9.0
func RolesAvailablePermissions() string
func SettingsPublic ¶ added in v2.9.0
func SystemContainersStartAll ¶ added in v2.9.0
func SystemContainersStopAll ¶ added in v2.9.0
func SystemConvert ¶ added in v2.9.0
func SystemDockerInfo ¶ added in v2.9.0
func SystemPrune ¶ added in v2.9.0
func SystemStartStopped ¶ added in v2.9.0
func SystemUpgrade ¶ added in v2.9.0
func SystemUpgradeAll ¶ added in v2.9.0
func SystemUpgradeAllStatus ¶ added in v2.9.0
func SystemUpgradeCheck ¶ added in v2.9.0
func TemplateContent ¶ added in v2.9.0
func TemplateDownload ¶ added in v2.9.0
func TemplateFetch ¶ added in v2.9.0
func TemplateFetch() string
func TemplateRegistry ¶ added in v2.9.0
func TemplatesAll ¶ added in v2.9.0
func TemplatesAll() string
func TemplatesDefault ¶ added in v2.9.0
func TemplatesDefault() string
func TemplatesRegistries ¶ added in v2.9.0
func TemplatesRegistries() string
func TemplatesVariables ¶ added in v2.9.0
func TemplatesVariables() string
TemplatesVariables is the historical alias for the global variables listing.
func UpdaterHistory ¶ added in v2.9.0
func UpdaterRun ¶ added in v2.9.0
func UpdaterStatus ¶ added in v2.9.0
func UploadSession ¶ added in v2.9.0
func UploadSessionChunk ¶ added in v2.9.0
func UploadSessions ¶ added in v2.9.0
func UserRoleAssignments ¶ added in v2.9.0
func VariablesSync ¶ added in v2.9.0
func VariablesSync() string
func VariablesSyncStatus ¶ added in v2.9.0
func VariablesSyncStatus() string
func VolumeBackup ¶ added in v2.9.0
func VolumeBackupDownload ¶ added in v2.9.0
func VolumeBackupFiles ¶ added in v2.9.0
func VolumeBackupPolicy ¶ added in v2.9.0
func VolumeBackupRestore ¶ added in v2.9.0
func VolumeBackupRestoreFiles ¶ added in v2.9.0
func VolumeBackupUpload ¶ added in v2.9.0
func VolumeBackupUploadRestore ¶ added in v2.9.0
func VolumeBackups ¶ added in v2.9.0
func VolumeRename ¶ added in v2.9.0
func VolumeUsage ¶ added in v2.9.0
func VolumeWorkspace ¶ added in v2.9.0
func VolumeWorkspaceFile ¶ added in v2.9.0
func VolumeWorkspaceFileDownload ¶ added in v2.9.0
func VolumesCounts ¶ added in v2.9.0
func VolumesPrune ¶ added in v2.9.0
func VolumesSizes ¶ added in v2.9.0
func VulnerabilitiesAll ¶ added in v2.9.0
func VulnerabilitiesIgnore ¶ added in v2.9.0
func VulnerabilitiesIgnored ¶ added in v2.9.0
func VulnerabilitiesScannerStatus ¶ added in v2.9.0
func VulnerabilitiesSummary ¶ added in v2.9.0
func VulnerabilityIgnore ¶ added in v2.9.0
func WebhookTrigger ¶ added in v2.9.0
Types ¶
type Config ¶
type Config struct {
// ServerURL is the base URL of the Arcane server (e.g., http://localhost:3552)
ServerURL string `yaml:"server_url" mapstructure:"server_url"`
// APIKey is the API key for authentication (sent as X-API-KEY)
APIKey string `yaml:"api_key,omitempty" mapstructure:"api_key"`
// JWTToken is the JWT access token for authentication (sent as Authorization: Bearer)
JWTToken string `yaml:"jwt_token,omitempty" mapstructure:"jwt_token"`
// RefreshToken is the refresh token for obtaining new access tokens
RefreshToken string `yaml:"refresh_token,omitempty" mapstructure:"refresh_token"`
// DefaultEnvironment is the default environment ID to use
DefaultEnvironment string `yaml:"default_environment,omitempty" mapstructure:"default_environment"`
// FederatedAudience is the default token audience for `arcane-cli auth federated`
FederatedAudience string `yaml:"federated_audience,omitempty" mapstructure:"federated_audience"`
// LogLevel is the logging level (debug, info, warn, error, fatal, panic)
LogLevel string `yaml:"log_level,omitempty" mapstructure:"log_level"`
// CLIUpdateChannel controls which channel self-update uses (stable or next).
CLIUpdateChannel string `yaml:"cli_update_channel,omitempty" mapstructure:"cli_update_channel"`
// Pagination contains global and per-resource pagination configuration.
Pagination PaginationConfig `yaml:"pagination,omitempty" mapstructure:"pagination"`
}
Config holds the CLI configuration for connecting to an Arcane server. It is persisted to disk as YAML and loaded on each CLI invocation.
func (*Config) IsConfigured ¶
IsConfigured returns true if both ServerURL and APIKey are set. This is a quick check to determine if the CLI has been configured without triggering validation errors.
func (*Config) LimitFor ¶
LimitFor returns the configured limit for a resource, falling back to the global default.
func (*Config) SetDefaultLimit ¶
SetDefaultLimit configures the global pagination default.
func (*Config) SetResourceLimit ¶
SetResourceLimit configures per-resource pagination defaults.
func (*Config) Validate ¶
Validate checks if the configuration has all required fields set. It returns an error with instructions if ServerURL or APIKey is missing. This should be called before using the config to make API requests.
func (*Config) ValidateServerURL ¶
ValidateServerURL checks if the configuration has the server URL set. This is useful for commands like `auth login` that do not require prior authentication.
type PaginationConfig ¶
type PaginationConfig struct {
// Default applies to paginated resources that do not have explicit per-resource config.
Default PaginationResourceConfig `yaml:"default,omitempty" mapstructure:"default"`
// Resources contains per-resource pagination settings keyed by resource name.
Resources map[string]PaginationResourceConfig `yaml:"resources,omitempty" mapstructure:"resources"`
}
PaginationConfig contains global and per-resource pagination settings.
type PaginationResourceConfig ¶
type PaginationResourceConfig struct {
// Limit is the default page size for list commands for this resource.
Limit int `yaml:"limit,omitempty" mapstructure:"limit"`
}
PaginationResourceConfig defines pagination options for a specific resource.