Documentation
¶
Index ¶
- Constants
- type Api
- func (a *Api) Delete(url string, data []byte) (*[]byte, error)
- func (a *Api) DeviceChown(name, owner string) error
- func (a *Api) DeviceCreateConfig(device string, cfg ConfigCreateRequest) error
- func (a *Api) DeviceDelete(device string) error
- func (a *Api) DeviceDeleteConfig(device, filename string) error
- func (a *Api) DeviceGet(device string) (*Device, error)
- func (a *Api) DeviceList(shared bool, matchTag, byFactory, byGroup, nameIlike, uuid string, ...) (*DeviceList, error)
- func (a *Api) DeviceListConfig(device string) (*DeviceConfigList, error)
- func (a *Api) DeviceListConfigCont(url string) (*DeviceConfigList, error)
- func (a *Api) DeviceListCont(url string) (*DeviceList, error)
- func (a *Api) DeviceListUpdates(device string) (*UpdateList, error)
- func (a *Api) DeviceListUpdatesCont(url string) (*UpdateList, error)
- func (a *Api) DevicePatchConfig(device string, cfg ConfigCreateRequest, force bool) error
- func (a *Api) DeviceRename(curName, newName string) error
- func (a *Api) DeviceSetGroup(device string, group string) error
- func (a *Api) DeviceUpdateEvents(device, correlationId string) ([]UpdateEvent, error)
- func (a *Api) FactoryCancelWave(factory string, wave string) error
- func (a *Api) FactoryCompleteWave(factory string, wave string) error
- func (a *Api) FactoryCreateCA(factory string) (CaCerts, error)
- func (a *Api) FactoryCreateConfig(factory string, cfg ConfigCreateRequest) error
- func (a *Api) FactoryCreateDeviceGroup(factory string, name string, description *string) (*DeviceGroup, error)
- func (a *Api) FactoryCreateWave(factory string, wave *WaveCreate) error
- func (a *Api) FactoryDeleteConfig(factory, filename string) error
- func (a *Api) FactoryDeleteDeviceGroup(factory string, name string) error
- func (a *Api) FactoryGetCA(factory string) (CaCerts, error)
- func (a *Api) FactoryGetWave(factory string, wave string, showTargets bool) (*Wave, error)
- func (a *Api) FactoryListConfig(factory string) (*DeviceConfigList, error)
- func (a *Api) FactoryListConfigCont(url string) (*DeviceConfigList, error)
- func (a *Api) FactoryListDeviceGroup(factory string) (*[]DeviceGroup, error)
- func (a *Api) FactoryListWaves(factory string, limit uint64) ([]Wave, error)
- func (a *Api) FactoryPatchCA(factory string, certs CaCerts) error
- func (a *Api) FactoryPatchConfig(factory string, cfg ConfigCreateRequest, force bool) error
- func (a *Api) FactoryPatchDeviceGroup(factory string, name string, new_name *string, new_desc *string) error
- func (a *Api) FactoryRolloutWave(factory string, wave string, options WaveRolloutOptions) error
- func (a *Api) FactoryStatus(factory string, inactiveThreshold int) (*FactoryStatus, error)
- func (a *Api) FactoryTriggers(factory string) ([]ProjectTrigger, error)
- func (a *Api) FactoryUpdateTrigger(factory string, t ProjectTrigger) error
- func (a *Api) FactoryWaveStatus(factory string, wave string, inactiveThreshold int) (*WaveStatus, error)
- func (a *Api) Get(url string) (*[]byte, error)
- func (a *Api) GetFoundriesTargetsKey(factory string) (*AtsKey, error)
- func (a *Api) GetOauthConfig() OAuthConfig
- func (a *Api) GetWireGuardIps(factory string) ([]WireGuardIp, error)
- func (a *Api) GroupCreateConfig(factory, group string, cfg ConfigCreateRequest) error
- func (a *Api) GroupDeleteConfig(factory, group, filename string) error
- func (a *Api) GroupListConfig(factory, group string) (*DeviceConfigList, error)
- func (a *Api) GroupListConfigCont(url string) (*DeviceConfigList, error)
- func (a *Api) GroupPatchConfig(factory, group string, cfg ConfigCreateRequest, force bool) error
- func (a *Api) JobservRun(runUrl string) (*JobservRun, error)
- func (a *Api) JobservRunArtifact(factory string, build int, run string, artifact string) (*http.Response, error)
- func (a *Api) JobservRuns(factory string, build int) ([]JobservRun, error)
- func (a *Api) JobservTail(url string)
- func (a *Api) Patch(url string, data []byte) (*[]byte, error)
- func (a *Api) Post(url string, data []byte) (*[]byte, error)
- func (a *Api) ProdTargetsGet(factory string, tag string, failNotExist bool) (*AtsTufTargets, error)
- func (a *Api) ProdTargetsList(factory string, failNotExist bool, tags ...string) (map[string]AtsTufTargets, error)
- func (a *Api) Put(url string, data []byte) (*[]byte, error)
- func (a *Api) RawGet(url string, headers *map[string]string) (*http.Response, error)
- func (a *Api) TargetComposeApp(factory string, targetName string, app string) (*ComposeAppBundle, error)
- func (a *Api) TargetCustom(target tuf.FileMeta) (*TufCustom, error)
- func (a *Api) TargetDeleteTargets(factory string, target_names []string) (string, string, error)
- func (a *Api) TargetDeltasCreate(factory string, toVer int, fromVers []int) (string, string, error)
- func (a *Api) TargetGet(factory string, targetName string) (*tuf.FileMeta, error)
- func (a *Api) TargetImageCreate(factory string, targetName string, appShortlist string) (string, string, error)
- func (a *Api) TargetTestArtifact(factory string, target int, testId string, artifact string) (*[]byte, error)
- func (a *Api) TargetTestResults(factory string, target int, testId string) (*TargetTest, error)
- func (a *Api) TargetTesting(factory string) ([]int, error)
- func (a *Api) TargetTests(factory string, target int) (*TargetTestList, error)
- func (a *Api) TargetTestsCont(url string) (*TargetTestList, error)
- func (a *Api) TargetUpdateTags(factory string, target_names []string, tag_names []string) (string, string, error)
- func (a *Api) TargetsList(factory string, version ...string) (tuf.Files, error)
- func (a *Api) TargetsListRaw(factory string) (*[]byte, error)
- func (a *Api) TargetsPut(factory string, data []byte) (string, string, error)
- func (a *Api) TufProdRootGet(factory string) (*AtsTufRoot, error)
- func (a *Api) TufProdRootPost(factory string, root []byte) (string, error)
- func (a *Api) TufRootGet(factory string) (*AtsTufRoot, error)
- func (a *Api) TufRootGetVer(factory string, version int) (*AtsTufRoot, error)
- func (a *Api) TufRootPost(factory string, root []byte) (string, error)
- func (a *Api) UsersList(factory string) ([]FactoryUser, error)
- type AtsKey
- type AtsKeyVal
- type AtsRootMeta
- type AtsTargetsMeta
- type AtsTufRoot
- type AtsTufTargets
- type CaCerts
- type ClientCredentials
- type ComposeApp
- type ComposeAppBundle
- type ComposeAppContent
- type Config
- type ConfigCreateRequest
- type ConfigFile
- type Device
- type DeviceConfig
- type DeviceConfigList
- type DeviceGroup
- type DeviceGroupStatus
- type DeviceList
- type DockerApp
- type EventDetail
- type EventType
- type FactoryStatus
- type FactoryUser
- type HttpError
- type JobservRun
- type NetInfo
- type OAuthConfig
- type OAuthResponse
- type Org
- type ProjectSecret
- type ProjectTrigger
- type RolloutGroupStatus
- type TagStatus
- type TargetStatus
- type TargetTest
- type TargetTestList
- type TargetTestResults
- type TufCustom
- type Update
- type UpdateEvent
- type UpdateList
- type Wave
- type WaveCreate
- type WaveRolloutGroupRef
- type WaveRolloutOptions
- type WaveStatus
- type WireGuardIp
Constants ¶
const URI string = "https://app.foundries.io/oauth"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
func (*Api) DeviceChown ¶ added in v0.19.1
func (*Api) DeviceCreateConfig ¶
func (a *Api) DeviceCreateConfig(device string, cfg ConfigCreateRequest) error
func (*Api) DeviceDelete ¶
func (*Api) DeviceDeleteConfig ¶
func (*Api) DeviceList ¶
func (*Api) DeviceListConfig ¶
func (a *Api) DeviceListConfig(device string) (*DeviceConfigList, error)
func (*Api) DeviceListConfigCont ¶
func (a *Api) DeviceListConfigCont(url string) (*DeviceConfigList, error)
func (*Api) DeviceListCont ¶
func (a *Api) DeviceListCont(url string) (*DeviceList, error)
func (*Api) DeviceListUpdates ¶
func (a *Api) DeviceListUpdates(device string) (*UpdateList, error)
func (*Api) DeviceListUpdatesCont ¶
func (a *Api) DeviceListUpdatesCont(url string) (*UpdateList, error)
func (*Api) DevicePatchConfig ¶
func (a *Api) DevicePatchConfig(device string, cfg ConfigCreateRequest, force bool) error
func (*Api) DeviceRename ¶
func (*Api) DeviceUpdateEvents ¶
func (a *Api) DeviceUpdateEvents(device, correlationId string) ([]UpdateEvent, error)
func (*Api) FactoryCancelWave ¶ added in v0.19.1
func (*Api) FactoryCompleteWave ¶ added in v0.19.1
func (*Api) FactoryCreateConfig ¶
func (a *Api) FactoryCreateConfig(factory string, cfg ConfigCreateRequest) error
func (*Api) FactoryCreateDeviceGroup ¶
func (*Api) FactoryCreateWave ¶ added in v0.19.1
func (a *Api) FactoryCreateWave(factory string, wave *WaveCreate) error
func (*Api) FactoryDeleteConfig ¶
func (*Api) FactoryDeleteDeviceGroup ¶
func (*Api) FactoryGetWave ¶ added in v0.19.1
func (*Api) FactoryListConfig ¶
func (a *Api) FactoryListConfig(factory string) (*DeviceConfigList, error)
func (*Api) FactoryListConfigCont ¶
func (a *Api) FactoryListConfigCont(url string) (*DeviceConfigList, error)
func (*Api) FactoryListDeviceGroup ¶
func (a *Api) FactoryListDeviceGroup(factory string) (*[]DeviceGroup, error)
func (*Api) FactoryListWaves ¶ added in v0.19.1
func (*Api) FactoryPatchConfig ¶
func (a *Api) FactoryPatchConfig(factory string, cfg ConfigCreateRequest, force bool) error
func (*Api) FactoryPatchDeviceGroup ¶
func (*Api) FactoryRolloutWave ¶ added in v0.19.1
func (a *Api) FactoryRolloutWave(factory string, wave string, options WaveRolloutOptions) error
func (*Api) FactoryStatus ¶
func (a *Api) FactoryStatus(factory string, inactiveThreshold int) (*FactoryStatus, error)
func (*Api) FactoryTriggers ¶
func (a *Api) FactoryTriggers(factory string) ([]ProjectTrigger, error)
func (*Api) FactoryUpdateTrigger ¶
func (a *Api) FactoryUpdateTrigger(factory string, t ProjectTrigger) error
func (*Api) FactoryWaveStatus ¶ added in v0.19.1
func (*Api) GetFoundriesTargetsKey ¶ added in v0.19.1
func (*Api) GetOauthConfig ¶ added in v0.19.1
func (a *Api) GetOauthConfig() OAuthConfig
func (*Api) GetWireGuardIps ¶ added in v0.19.1
func (a *Api) GetWireGuardIps(factory string) ([]WireGuardIp, error)
func (*Api) GroupCreateConfig ¶
func (a *Api) GroupCreateConfig(factory, group string, cfg ConfigCreateRequest) error
func (*Api) GroupDeleteConfig ¶
func (*Api) GroupListConfig ¶
func (a *Api) GroupListConfig(factory, group string) (*DeviceConfigList, error)
func (*Api) GroupListConfigCont ¶
func (a *Api) GroupListConfigCont(url string) (*DeviceConfigList, error)
func (*Api) GroupPatchConfig ¶
func (a *Api) GroupPatchConfig(factory, group string, cfg ConfigCreateRequest, force bool) error
func (*Api) JobservRun ¶
func (a *Api) JobservRun(runUrl string) (*JobservRun, error)
func (*Api) JobservRunArtifact ¶
func (*Api) JobservRuns ¶
func (a *Api) JobservRuns(factory string, build int) ([]JobservRun, error)
func (*Api) JobservTail ¶
func (*Api) ProdTargetsGet ¶ added in v0.19.1
func (*Api) ProdTargetsList ¶ added in v0.19.1
func (*Api) TargetComposeApp ¶
func (a *Api) TargetComposeApp(factory string, targetName string, app string) (*ComposeAppBundle, error)
Return a Compose App for a given Target by a Target ID and an App name
func (*Api) TargetDeleteTargets ¶
func (*Api) TargetDeltasCreate ¶ added in v0.19.1
func (*Api) TargetImageCreate ¶
func (*Api) TargetTestArtifact ¶
func (*Api) TargetTestResults ¶
func (*Api) TargetTesting ¶
Return a list of Targets that have been tested
func (*Api) TargetTests ¶
func (a *Api) TargetTests(factory string, target int) (*TargetTestList, error)
func (*Api) TargetTestsCont ¶
func (a *Api) TargetTestsCont(url string) (*TargetTestList, error)
func (*Api) TargetUpdateTags ¶
func (*Api) TargetsList ¶
func (*Api) TargetsPut ¶
func (*Api) TufProdRootGet ¶ added in v0.19.1
func (a *Api) TufProdRootGet(factory string) (*AtsTufRoot, error)
func (*Api) TufProdRootPost ¶ added in v0.19.1
func (*Api) TufRootGet ¶ added in v0.19.1
func (a *Api) TufRootGet(factory string) (*AtsTufRoot, error)
func (*Api) TufRootGetVer ¶ added in v0.19.1
func (a *Api) TufRootGetVer(factory string, version int) (*AtsTufRoot, error)
func (*Api) TufRootPost ¶ added in v0.19.1
type AtsKeyVal ¶ added in v0.19.1
type AtsKeyVal struct { Public string `json:"public,omitempty"` Private string `json:"private,omitempty"` }
ota-tuf serializes root.json differently from Notary. The key representation and signing algoritms differ slightly. These Ats* structs provide an an implementation compatible with ota-tuf and libaktualizr.
type AtsRootMeta ¶ added in v0.19.1
type AtsTargetsMeta ¶ added in v0.19.1
type AtsTargetsMeta struct { tuf.SignedCommon Targets tuf.Files `json:"targets"` }
type AtsTufRoot ¶ added in v0.19.1
type AtsTufTargets ¶ added in v0.19.1
type AtsTufTargets struct { Signatures []tuf.Signature `json:"signatures"` Signed AtsTargetsMeta `json:"signed"` }
type CaCerts ¶
type CaCerts struct { RootCrt string `json:"root-crt"` CaCrt string `json:"ca-crt"` CaCsr string `json:"ca-csr"` TlsCrt string `json:"tls-crt"` TlsCsr string `json:"tls-csr"` CreateCaScript *string `json:"create_ca"` CreateDeviceCaScript *string `json:"create_device_ca"` SignCaScript *string `json:"sign_ca_csr"` SignTlsScript *string `json:"sign_tls_csr"` }
type ClientCredentials ¶
type ClientCredentials struct { Config OAuthConfig URL string }
func NewClientCredentials ¶
func NewClientCredentials(c OAuthConfig) ClientCredentials
func (*ClientCredentials) HasRefreshToken ¶
func (c *ClientCredentials) HasRefreshToken() bool
HasRefreshToken checks if a refresh token is available.
func (*ClientCredentials) IsExpired ¶
func (c *ClientCredentials) IsExpired() (bool, error)
IsExpired checks if the OAuth token is expired.
func (*ClientCredentials) Refresh ¶
func (c *ClientCredentials) Refresh() error
Refresh performs a refresh of the token.
type ComposeApp ¶
type ComposeApp struct {
Uri string `json:"uri"`
}
func (ComposeApp) Hash ¶ added in v0.19.1
func (a ComposeApp) Hash() string
type ComposeAppBundle ¶
type ComposeAppBundle struct { Uri string `json:"uri"` Error string `json:"error"` Warnings []string `json:"warnings"` Manifest map[string]interface{} `json:"manifest"` Content ComposeAppContent `json:"content"` }
type ComposeAppContent ¶
type Config ¶
type Config struct { Factory string Token string ClientCredentials OAuthConfig ExtraHeaders map[string]string }
type ConfigCreateRequest ¶
type ConfigCreateRequest struct { Reason string `json:"reason"` Files []ConfigFile `json:"files"` }
type ConfigFile ¶
type Device ¶
type Device struct { Uuid string `json:"uuid"` Name string `json:"name"` Owner string `json:"owner"` Factory string `json:"factory"` GroupName string `json:"device-group"` // Returned in List API Group *DeviceGroup `json:"group"` // Returned in Get API CreatedAt string `json:"created-at"` LastSeen string `json:"last-seen"` OstreeHash string `json:"ostree-hash"` DockerApps []string `json:"docker-apps,omitempty"` Tag string `json:"tag,omitempty"` Network *NetInfo `json:"network-info,omitempty"` Hardware *json.RawMessage `json:"hardware-info,omitempty"` TargetName string `json:"target-name"` Status string `json:"status"` CurrentUpdate string `json:"current-update"` UpToDate bool `json:"up-to-date"` PublicKey string `json:"public-key"` ActiveConfig *DeviceConfig `json:"active-config,omitempty"` AktualizrToml string `json:"aktualizr-toml,omitempty"` IsProd bool `json:"is-prod"` IsWave bool `json:"is-wave"` }
type DeviceConfig ¶
type DeviceConfig struct { CreatedAt string `json:"created-at"` AppliedAt string `json:"applied-at"` // This is not present in factory config Reason string `json:"reason"` Files []ConfigFile `json:"files"` }
type DeviceConfigList ¶
type DeviceConfigList struct { Configs []DeviceConfig `json:"config"` Total int `json:"total"` Next *string `json:"next"` }
type DeviceGroup ¶
type DeviceGroupStatus ¶ added in v0.19.1
type DeviceList ¶
type EventDetail ¶
type FactoryStatus ¶
type FactoryUser ¶
type HttpError ¶
This is an error returned in case if we've successfully received an HTTP response which contains an unexpected HTTP status code
func AsHttpError ¶
This is much better than err.(HttpError) as it also accounts for wrapped errors.
type JobservRun ¶
type OAuthConfig ¶
type OAuthConfig struct { ClientId string `mapstructure:"client_id"` ClientSecret string `mapstructure:"client_secret"` TokenType string `mapstructure:"token_type"` AccessToken string `mapstructure:"access_token"` RefreshToken string `mapstructure:"refresh_token"` ExpiresIn float64 `mapstructure:"expires_in"` Created string DefaultOrg string }
type OAuthResponse ¶
type ProjectSecret ¶
type ProjectTrigger ¶
type ProjectTrigger struct { Type string `json:"type"` Id int `json:"id,omitempty"` Secrets []ProjectSecret `json:"secrets"` }
type RolloutGroupStatus ¶ added in v0.19.1
type RolloutGroupStatus struct { Name string `json:"name"` RolloutAt string `json:"rollout-at"` DevicesTotal int `json:"devices-total"` DevicesOnline int `json:"devices-online"` DevicesOnWave int `json:"devices-on-wave-version"` DevicesOnNewer int `json:"devices-on-newer-version"` DevicesOnOlder int `json:"devices-on-older-version"` Targets []TargetStatus `json:"targets"` }
type TagStatus ¶
type TagStatus struct { Name string `json:"name"` DevicesTotal int `json:"devices-total"` DevicesOnline int `json:"devices-online"` DevicesOnLatest int `json:"devices-on-latest"` DevicesOnOrphan int `json:"devices-on-orphan"` LatestTarget int `json:"latest-target"` Targets []TargetStatus `json:"targets"` DeviceGroups []DeviceGroupStatus `json:"device-groups"` }
type TargetStatus ¶
type TargetTest ¶
type TargetTest struct { Name string `json:"name"` Id string `json:"test-id"` DeviceUUID string `json:"device-uuid"` DeviceName string `json:"device-name"` Status string `json:"status"` Details string `json:"details"` CreatedOn float32 `json:"created-on"` CompletedOn float32 `json:"completed-on"` Results []TargetTestResults `json:"results"` Artifacts []string `json:"artifacts"` }
type TargetTestList ¶
type TargetTestList struct { Tests []TargetTest `json:"tests"` Total int `json:"total"` Next *string `json:"next"` }
type TargetTestResults ¶
type TufCustom ¶
type TufCustom struct { HardwareIds []string `json:"hardwareIds,omitempty"` Tags []string `json:"tags,omitempty"` TargetFormat string `json:"targetFormat,omitempty"` Version string `json:"version,omitempty"` ComposeApps map[string]ComposeApp `json:"docker_compose_apps,omitempty"` Name string `json:"name,omitempty"` ContainersSha string `json:"containers-sha,omitempty"` LmpManifestSha string `json:"lmp-manifest-sha,omitempty"` OverridesSha string `json:"meta-subscriber-overrides-sha,omitempty"` }
type UpdateEvent ¶
type UpdateEvent struct { Time string `json:"deviceTime"` Type EventType `json:"eventType"` Detail EventDetail `json:"event"` }
type UpdateList ¶
type Wave ¶ added in v0.19.1
type Wave struct { Name string `json:"name"` Version string `json:"version"` Tag string `json:"tag"` Targets *json.RawMessage `json:"targets"` CreatedAt string `json:"created-at"` FinishedAt string `json:"finished-at"` Status string `json:"status"` RolloutGroups map[string]WaveRolloutGroupRef `json:"rollout-groups"` }
type WaveCreate ¶ added in v0.19.1
type WaveRolloutGroupRef ¶ added in v0.19.1
type WaveRolloutOptions ¶ added in v0.19.1
type WaveRolloutOptions struct {
Group string `json:"group"`
}
type WaveStatus ¶ added in v0.19.1
type WaveStatus struct { Name string `json:"name"` Version int `json:"version"` Tag string `json:"tag"` Status string `json:"status"` CreatedAt string `json:"created-at"` FinishedAt string `json:"finished-at"` TotalDevices int `json:"total-devices"` UpdatedDevices int `json:"updated-devices"` ScheduledDevices int `json:"scheduled-devices"` UnscheduledDevices int `json:"unscheduled-devices"` RolloutGroups []RolloutGroupStatus `json:"rollout-groups"` OtherGroups []RolloutGroupStatus `json:"other-groups"` }