9ed7f07463
Expose the artifactapi remotes API's new mirrorlist field so users can configure extra upstream mirror base URLs. The API load-balances base_url + mirrorlist with failover. - Add optional mirrorlist list attribute to the remote resource schema and the remote data source (read-only). - Wire it end-to-end: TF model, wire model (json mirrorlist,omitempty), modelToAPI/apiToModel, and preserve null/empty list semantics to avoid plan churn. - Scope to rpm/deb/alpine via ValidateConfig (plan-time error on other remote types); API 400 is the backstop. - Docs + rpm example; unit tests for round-trip, null handling, and the type-scoping validation.
39 lines
1.6 KiB
Go
39 lines
1.6 KiB
Go
package provider
|
|
|
|
type remoteAPI struct {
|
|
Name string `json:"name"`
|
|
PackageType string `json:"package_type"`
|
|
RepoType string `json:"repo_type,omitempty"`
|
|
BaseURL string `json:"base_url"`
|
|
Mirrorlist []string `json:"mirrorlist,omitempty"`
|
|
Description string `json:"description,omitempty"`
|
|
Username string `json:"username,omitempty"`
|
|
Password string `json:"password,omitempty"`
|
|
ImmutableTTL int64 `json:"immutable_ttl"`
|
|
MutableTTL int64 `json:"mutable_ttl"`
|
|
CheckMutable bool `json:"check_mutable"`
|
|
Patterns []string `json:"patterns"`
|
|
Blocklist []string `json:"blocklist"`
|
|
MutablePatterns []string `json:"mutable_patterns"`
|
|
ImmutablePatterns []string `json:"immutable_patterns"`
|
|
BanTagsEnabled bool `json:"ban_tags_enabled"`
|
|
BanTags []string `json:"ban_tags"`
|
|
QuarantineEnabled bool `json:"quarantine_enabled"`
|
|
QuarantineDays int64 `json:"quarantine_days"`
|
|
StaleOnError bool `json:"stale_on_error"`
|
|
ReleasesRemote string `json:"releases_remote,omitempty"`
|
|
ManagedBy string `json:"managed_by,omitempty"`
|
|
|
|
UpstreamDialTimeout int64 `json:"upstream_dial_timeout"`
|
|
UpstreamTLSTimeout int64 `json:"upstream_tls_timeout"`
|
|
UpstreamResponseHeaderTimeout int64 `json:"upstream_response_header_timeout"`
|
|
}
|
|
|
|
type virtualAPI struct {
|
|
Name string `json:"name"`
|
|
PackageType string `json:"package_type"`
|
|
Description string `json:"description,omitempty"`
|
|
Members []string `json:"members"`
|
|
ManagedBy string `json:"managed_by,omitempty"`
|
|
}
|