Documentation ¶
Index ¶
- Constants
- Variables
- func AuthorizationHeader(token string) string
- func BoolPointer(val bool) *bool
- func GetAccessToken(ctx context.Context, email, password, otp string) (token string, err error)
- func GetAccessTokenForCLISession(ctx context.Context, id string) (string, error)
- func IntPointer(val int) *int
- func IsClientError(err error) bool
- func IsNotAuthenticatedError(err error) bool
- func IsNotFoundError(err error) bool
- func IsServerError(err error) bool
- func NewHTTPClient(logger Logger, transport http.RoundTripper) (*http.Client, error)
- func Pointer[T any](val T) *T
- func SetBaseURL(url string)
- func SetErrorLog(log bool)
- func SetInstrumenter(i InstrumentationService)
- func SetTransport(t http.RoundTripper)
- func StringPointer(val string) *string
- func WithAuthorizationHeader(ctx context.Context, hdr string) context.Context
- type AllocateIPAddressInput
- type ApiError
- type App
- type AppBasic
- type AppCertificate
- type AppCertificateCompact
- type AppCertsCompact
- type AppCompact
- type AppInfo
- type AttachPostgresClusterInput
- type AttachPostgresClusterPayload
- type Billable
- type CLISession
- type CLISessionAuth
- type CheckDomainResult
- type Client
- func (c *Client) AddCertificate(ctx context.Context, appName, hostname string) (*AppCertificate, *HostnameCheck, error)
- func (c *Client) AllocateIPAddress(ctx context.Context, appName string, addrType string, region string, ...) (*IPAddress, error)
- func (c *Client) AllocateSharedIPAddress(ctx context.Context, appName string) (net.IP, error)
- func (client *Client) AttachPostgresCluster(ctx context.Context, input AttachPostgresClusterInput) (*AttachPostgresClusterPayload, error)
- func (c *Client) Authenticated() bool
- func (c *Client) CanPerformBluegreenDeployment(ctx context.Context, appName string) (bool, error)
- func (c *Client) CheckAppCertificate(ctx context.Context, appName, hostname string) (*AppCertificate, *HostnameCheck, error)
- func (c *Client) CheckDomain(ctx context.Context, name string) (*CheckDomainResult, error)
- func (c *Client) ClosestWireguardGatewayRegion(ctx context.Context) (*Region, error)
- func (c *Client) CreateAndRegisterDomain(organizationID string, name string) (*Domain, error)
- func (client *Client) CreateApp(ctx context.Context, input CreateAppInput) (*App, error)
- func (c *Client) CreateDelegatedWireGuardToken(ctx context.Context, org *Organization, name string) (*DelegatedWireGuardToken, error)
- func (c *Client) CreateDoctorUrl(ctx context.Context) (putUrl string, err error)
- func (c *Client) CreateDomain(organizationID string, name string) (*Domain, error)
- func (c *Client) CreateOrganization(ctx context.Context, organizationname string) (*Organization, error)
- func (c *Client) CreateOrganizationInvite(ctx context.Context, id, email string) (*Invitation, error)
- func (c *Client) CreateWireGuardPeer(ctx context.Context, org *Organization, region, name, pubkey string) (*CreatedWireGuardPeer, error)
- func (client *Client) DeleteApp(ctx context.Context, appName string) error
- func (c *Client) DeleteCertificate(ctx context.Context, appName, hostname string) (*DeleteCertificatePayload, error)
- func (c *Client) DeleteDelegatedWireGuardToken(ctx context.Context, org *Organization, name, token *string) error
- func (c *Client) DeleteOrganization(ctx context.Context, id string) (deletedid string, err error)
- func (c *Client) DeleteOrganizationMembership(ctx context.Context, orgId, userId string) (string, string, error)
- func (client *Client) DetachPostgresCluster(ctx context.Context, input DetachPostgresClusterInput) error
- func (client *Client) EnablePostgresConsul(ctx context.Context, appName string) (*PostgresEnableConsulPayload, error)
- func (client *Client) EnsureRemoteBuilder(ctx context.Context, orgID, appName string) (*GqlMachine, *App, error)
- func (c *Client) ExportDNSRecords(ctx context.Context, domainId string) (string, error)
- func (client *Client) GetApp(ctx context.Context, appName string) (*App, error)
- func (client *Client) GetAppBasic(ctx context.Context, appName string) (*AppBasic, error)
- func (c *Client) GetAppCertificates(ctx context.Context, appName string) ([]AppCertificateCompact, error)
- func (client *Client) GetAppCompact(ctx context.Context, appName string) (*AppCompact, error)
- func (c *Client) GetAppCurrentReleaseMachines(ctx context.Context, appName string) (*Release, error)
- func (c *Client) GetAppLimitedAccessTokens(ctx context.Context, appName string) ([]LimitedAccessToken, error)
- func (c *Client) GetAppLogs(ctx context.Context, appName, token, region, instanceID string) (entries []LogEntry, nextToken string, err error)
- func (c *Client) GetAppNameFromVolume(ctx context.Context, volID string) (*string, error)
- func (c *Client) GetAppReleasesMachines(ctx context.Context, appName, status string, limit int) ([]Release, error)
- func (c *Client) GetAppSecrets(ctx context.Context, appName string) ([]Secret, error)
- func (client *Client) GetApps(ctx context.Context, role *string) ([]App, error)
- func (client *Client) GetAppsForOrganization(ctx context.Context, orgID string) ([]App, error)
- func (c *Client) GetCurrentUser(ctx context.Context) (*User, error)
- func (c *Client) GetDNSRecords(ctx context.Context, domainName string) ([]*DNSRecord, error)
- func (c *Client) GetDelegatedWireGuardTokens(ctx context.Context, slug string) ([]*DelegatedWireGuardTokenHandle, error)
- func (client *Client) GetDetailedOrganizationBySlug(ctx context.Context, slug string) (*OrganizationDetails, error)
- func (c *Client) GetDomain(ctx context.Context, name string) (*Domain, error)
- func (c *Client) GetDomains(ctx context.Context, organizationSlug string) ([]*Domain, error)
- func (c *Client) GetIPAddresses(ctx context.Context, appName string) ([]IPAddress, error)
- func (client *Client) GetLatestImageDetails(ctx context.Context, image string) (*ImageVersion, error)
- func (client *Client) GetLatestImageTag(ctx context.Context, repository string, snapshotId *string) (string, error)
- func (c *Client) GetLoggedCertificates(ctx context.Context, slug string) ([]LoggedCertificate, error)
- func (client *Client) GetMachine(ctx context.Context, machineId string) (*GqlMachine, error)
- func (c *Client) GetNearestRegion(ctx context.Context) (*Region, error)
- func (client *Client) GetOrganizationBySlug(ctx context.Context, slug string) (*Organization, error)
- func (client *Client) GetOrganizations(ctx context.Context, filters ...OrganizationFilter) ([]Organization, error)
- func (c *Client) GetWireGuardPeer(ctx context.Context, slug, name string) (*WireGuardPeer, error)
- func (c *Client) GetWireGuardPeers(ctx context.Context, slug string) ([]*WireGuardPeer, error)
- func (c *Client) ImportDNSRecords(ctx context.Context, domainId string, zonefile string) ([]ImportDnsWarning, []ImportDnsChange, error)
- func (c *Client) IssueSSHCertificate(ctx context.Context, org OrganizationImpl, principals []string, ...) (*IssuedCertificate, error)
- func (client *Client) ListPostgresClusterAttachments(ctx context.Context, appName, postgresAppName string) ([]*PostgresClusterAttachment, error)
- func (c *Client) Logger() Logger
- func (client *Client) MoveApp(ctx context.Context, appName string, orgID string) (*App, error)
- func (*Client) NewRequest(q string) *graphql.Request
- func (c *Client) PlatformRegions(ctx context.Context) ([]Region, *Region, error)
- func (c *Client) ReleaseIPAddress(ctx context.Context, appName string, ip string) error
- func (c *Client) RemoveWireGuardPeer(ctx context.Context, org *Organization, name string) error
- func (client *Client) ResolveImageForApp(ctx context.Context, appName, imageRef string) (*Image, error)
- func (c *Client) RevokeLimitedAccessToken(ctx context.Context, id string) error
- func (c *Client) Run(req *graphql.Request) (Query, error)
- func (c *Client) RunWithContext(ctx context.Context, req *graphql.Request) (Query, error)
- func (c *Client) SetSecrets(ctx context.Context, appName string, secrets map[string]string) (*Release, error)
- func (c *Client) UnsetSecrets(ctx context.Context, appName string, keys []string) (*Release, error)
- func (c *Client) ValidateWireGuardPeers(ctx context.Context, peerIPs []string) (invalid []string, err error)
- type ClientOptions
- type ConsulCheckStatus
- type CreateAppInput
- type CreateOrganizationInvitation
- type CreateOrganizationPayload
- type CreateVolumeRequest
- type CreatedWireGuardPeer
- type DNSConfig
- type DNSRecord
- type DNSRecords
- type Definition
- type DelegatedWireGuardToken
- type DelegatedWireGuardTokenHandle
- type DeleteCertificatePayload
- type DeleteOrganizationMembershipPayload
- type DeleteOrganizationPayload
- type DetachPostgresClusterInput
- type Domain
- type Duration
- func (d Duration) MarshalJSON() ([]byte, error)
- func (d Duration) MarshalTOML() ([]byte, error)
- func (d *Duration) MarshalText() ([]byte, error)
- func (d *Duration) ParseDuration(v any) error
- func (d *Duration) UnmarshalJSON(b []byte) error
- func (d *Duration) UnmarshalTOML(v any) error
- func (d *Duration) UnmarshalText(text []byte) error
- type EnsureRemoteBuilderInput
- type Error
- type Errors
- type Extensions
- type File
- type GqlMachine
- type HTTPOptions
- type HTTPResponseOptions
- type HealthCheckStatus
- type HostnameCheck
- type IPAddress
- type Image
- type ImageVersion
- type ImportDnsChange
- type ImportDnsWarning
- type InstrumentationService
- type Invitation
- type IssuedCertificate
- type LaunchMachineInput
- type LimitedAccessToken
- type ListenSocket
- type LogEntry
- type LoggedCertificate
- type Logger
- type LoggingTransport
- type Machine
- func (m *Machine) AllHealthChecks() *HealthCheckStatus
- func (m *Machine) FullImageRef() string
- func (m *Machine) GetLatestEventOfTypeAfterType(latestEventType, firstEventType string) *MachineEvent
- func (m *Machine) HasProcessGroup(desired string) bool
- func (m *Machine) ImageRefWithVersion() string
- func (m *Machine) ImageRepository() string
- func (m *Machine) ImageVersion() string
- func (m *Machine) IsActive() bool
- func (m *Machine) IsAppsV2() bool
- func (m *Machine) IsFlyAppsConsole() bool
- func (m *Machine) IsFlyAppsPlatform() bool
- func (m *Machine) IsFlyAppsReleaseCommand() bool
- func (m *Machine) IsReleaseCommandMachine() bool
- func (m *Machine) MostRecentStartTimeAfterLaunch() (time.Time, error)
- func (m *Machine) ProcessGroup() string
- func (m *Machine) TopLevelChecks() *HealthCheckStatus
- type MachineCheck
- type MachineCheckStatus
- type MachineConfig
- type MachineEvent
- type MachineExecRequest
- type MachineExecResponse
- type MachineExitEvent
- type MachineGuest
- type MachineHTTPHeader
- type MachineIP
- type MachineImageRef
- type MachineInit
- type MachineLease
- type MachineLeaseData
- type MachineMetrics
- type MachineMonitorEvent
- type MachineMount
- type MachinePort
- type MachineProcess
- type MachinePsResponse
- type MachineRequest
- type MachineRestart
- type MachineRestartPolicy
- type MachineService
- type MachineServiceConcurrency
- type MachineStartResponse
- type Organization
- type OrganizationBasic
- type OrganizationDetails
- type OrganizationFilter
- type OrganizationImpl
- type OrganizationMembershipEdge
- type OrganizationType
- type PostgresClusterAttachment
- type PostgresEnableConsulPayload
- type ProcessStat
- type ProxyProtoOptions
- type Query
- type Region
- type Release
- type ReleaseIPAddressInput
- type RemoveMachineInput
- type RestartMachineInput
- type SSHCertificate
- type Secret
- type SetSecretsInput
- type SetSecretsInputSecret
- type SignedUrl
- type Static
- type StopConfig
- type StopMachineInput
- type TLSOptions
- type Transport
- type UnsetSecretsInput
- type UpdateVolumeRequest
- type User
- type VMSize
- type Volume
- type VolumeSnapshot
- type WireGuardPeer
- type WireGuardPeerStatus
Constants ¶
const ( MachineConfigMetadataKeyFlyManagedPostgres = "fly-managed-postgres" MachineConfigMetadataKeyFlyPlatformVersion = "fly_platform_version" MachineConfigMetadataKeyFlyReleaseId = "fly_release_id" MachineConfigMetadataKeyFlyReleaseVersion = "fly_release_version" MachineConfigMetadataKeyFlyProcessGroup = "fly_process_group" MachineConfigMetadataKeyFlyPreviousAlloc = "fly_previous_alloc" MachineConfigMetadataKeyFlyctlVersion = "fly_flyctl_version" MachineFlyPlatformVersion2 = "v2" MachineProcessGroupApp = "app" MachineProcessGroupFlyAppReleaseCommand = "fly_app_release_command" MachineProcessGroupFlyAppConsole = "fly_app_console" MachineStateDestroyed = "destroyed" MachineStateDestroying = "destroying" MachineStateStarted = "started" MachineStateStopped = "stopped" MachineStateCreated = "created" DefaultVMSize = "shared-cpu-1x" DefaultGPUVMSize = "performance-8x" )
const ( MIN_MEMORY_MB_PER_SHARED_CPU = 256 MIN_MEMORY_MB_PER_CPU = 2048 MAX_MEMORY_MB_PER_SHARED_CPU = 2048 MAX_MEMORY_MB_PER_CPU = 8192 )
Variables ¶
var ErrNotFound = errors.New("Not Found")
ErrNotFound - Error to return when something is not found
var ErrUnknown = errors.New("An unknown server error occurred, please try again")
ErrUnknown - Error to return when an unknown server error occurs
var MachinePresets map[string]*MachineGuest = map[string]*MachineGuest{ "shared-cpu-1x": {CPUKind: "shared", CPUs: 1, MemoryMB: 1 * MIN_MEMORY_MB_PER_SHARED_CPU}, "shared-cpu-2x": {CPUKind: "shared", CPUs: 2, MemoryMB: 2 * MIN_MEMORY_MB_PER_SHARED_CPU}, "shared-cpu-4x": {CPUKind: "shared", CPUs: 4, MemoryMB: 4 * MIN_MEMORY_MB_PER_SHARED_CPU}, "shared-cpu-8x": {CPUKind: "shared", CPUs: 8, MemoryMB: 8 * MIN_MEMORY_MB_PER_SHARED_CPU}, "performance-1x": {CPUKind: "performance", CPUs: 1, MemoryMB: 1 * MIN_MEMORY_MB_PER_CPU}, "performance-2x": {CPUKind: "performance", CPUs: 2, MemoryMB: 2 * MIN_MEMORY_MB_PER_CPU}, "performance-4x": {CPUKind: "performance", CPUs: 4, MemoryMB: 4 * MIN_MEMORY_MB_PER_CPU}, "performance-8x": {CPUKind: "performance", CPUs: 8, MemoryMB: 8 * MIN_MEMORY_MB_PER_CPU}, "performance-16x": {CPUKind: "performance", CPUs: 16, MemoryMB: 16 * MIN_MEMORY_MB_PER_CPU}, "a100-40gb": {GPUKind: "a100-pcie-40gb", GPUs: 1, CPUKind: "performance", CPUs: 8, MemoryMB: 16 * MIN_MEMORY_MB_PER_CPU}, "a100-80gb": {GPUKind: "a100-sxm4-80gb", GPUs: 1, CPUKind: "performance", CPUs: 8, MemoryMB: 16 * MIN_MEMORY_MB_PER_CPU}, "l40s": {GPUKind: "l40s", GPUs: 1, CPUKind: "performance", CPUs: 8, MemoryMB: 16 * MIN_MEMORY_MB_PER_CPU}, }
TODO - Determine if we want allocate max memory allocation, or minimum per # cpus.
Functions ¶
func AuthorizationHeader ¶
func GetAccessToken ¶
GetAccessToken - uses email, password and possible otp to get token
func GetAccessTokenForCLISession ¶
GetAccessTokenForCLISession Obtains the access token for the session
func IsClientError ¶
func IsNotAuthenticatedError ¶
func IsNotFoundError ¶
func IsServerError ¶
func NewHTTPClient ¶
func SetInstrumenter ¶
func SetInstrumenter(i InstrumentationService)
func SetTransport ¶
func SetTransport(t http.RoundTripper)
func StringPointer ¶
StringPointer - Returns a pointer to a string
Types ¶
type AllocateIPAddressInput ¶
type ApiError ¶
func ErrorFromResp ¶
type App ¶
type App struct { ID string Name string State string Status string Deployed bool Hostname string AppURL string Version int NetworkID int Release *Release Organization Organization Secrets []Secret CurrentRelease *Release Releases struct { Nodes []Release } IPAddresses struct { Nodes []IPAddress } IPAddress *IPAddress Certificates struct { Nodes []AppCertificate } Certificate AppCertificate PostgresAppRole *struct { Name string } Image *Image ImageUpgradeAvailable bool ImageVersionTrackingEnabled bool ImageDetails ImageVersion LatestImageDetails ImageVersion PlatformVersion string LimitedAccessTokens *struct { Nodes []LimitedAccessToken } }
type AppBasic ¶
type AppBasic struct { ID string Name string PlatformVersion string Organization *OrganizationBasic }
type AppCertificate ¶
type AppCertificate struct { ID string AcmeDNSConfigured bool AcmeALPNConfigured bool Configured bool CertificateAuthority string CreatedAt time.Time DNSProvider string DNSValidationInstructions string DNSValidationHostname string DNSValidationTarget string Hostname string Source string ClientStatus string IsApex bool IsWildcard bool Issued struct { Nodes []struct { ExpiresAt time.Time Type string } } }
type AppCertificateCompact ¶
type AppCertsCompact ¶
type AppCertsCompact struct { Certificates struct { Nodes []AppCertificateCompact } }
type AppCompact ¶
type AppCompact struct { ID string Name string Status string Deployed bool Hostname string AppURL string Organization *OrganizationBasic PlatformVersion string PostgresAppRole *struct { Name string } ImageDetails ImageVersion }
func (*AppCompact) IsPostgresApp ¶
func (app *AppCompact) IsPostgresApp() bool
type AttachPostgresClusterInput ¶
type AttachPostgresClusterInput struct { AppID string `json:"appId"` PostgresClusterAppID string `json:"postgresClusterAppId"` DatabaseName *string `json:"databaseName,omitempty"` DatabaseUser *string `json:"databaseUser,omitempty"` VariableName *string `json:"variableName,omitempty"` ManualEntry bool `json:"manualEntry,omitempty"` }
type CLISession ¶
type CLISession struct { ID string `json:"id"` URL string `json:"auth_url,omitempty"` AccessToken string `json:"access_token,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
func GetCLISessionState ¶
func GetCLISessionState(ctx context.Context, id string) (CLISession, error)
func StartCLISession ¶
func StartCLISession(sessionName string, args map[string]interface{}) (CLISession, error)
StartCLISession starts a session with the platform via web
func StartCLISessionWebAuth ¶
func StartCLISessionWebAuth(machineName string, signup bool) (CLISession, error)
StartCLISessionWebAuth starts a session with the platform via web auth
type CLISessionAuth ¶
type CLISessionAuth struct {
CLISession
}
type CheckDomainResult ¶
type Client ¶
Client - API client encapsulating the http and GraphQL clients
func NewClientFromOptions ¶
func NewClientFromOptions(opts ClientOptions) *Client
func (*Client) AddCertificate ¶
func (c *Client) AddCertificate(ctx context.Context, appName, hostname string) (*AppCertificate, *HostnameCheck, error)
func (*Client) AllocateIPAddress ¶
func (*Client) AllocateSharedIPAddress ¶
func (*Client) AttachPostgresCluster ¶
func (client *Client) AttachPostgresCluster(ctx context.Context, input AttachPostgresClusterInput) (*AttachPostgresClusterPayload, error)
func (*Client) Authenticated ¶
func (*Client) CanPerformBluegreenDeployment ¶
func (*Client) CheckAppCertificate ¶
func (c *Client) CheckAppCertificate(ctx context.Context, appName, hostname string) (*AppCertificate, *HostnameCheck, error)
func (*Client) CheckDomain ¶
func (*Client) ClosestWireguardGatewayRegion ¶
func (*Client) CreateAndRegisterDomain ¶
func (*Client) CreateDelegatedWireGuardToken ¶
func (c *Client) CreateDelegatedWireGuardToken(ctx context.Context, org *Organization, name string) (*DelegatedWireGuardToken, error)
func (*Client) CreateDoctorUrl ¶
func (*Client) CreateDomain ¶
func (*Client) CreateOrganization ¶
func (*Client) CreateOrganizationInvite ¶
func (*Client) CreateWireGuardPeer ¶
func (c *Client) CreateWireGuardPeer(ctx context.Context, org *Organization, region, name, pubkey string) (*CreatedWireGuardPeer, error)
func (*Client) DeleteCertificate ¶
func (*Client) DeleteDelegatedWireGuardToken ¶
func (*Client) DeleteOrganization ¶
func (*Client) DeleteOrganizationMembership ¶
func (*Client) DetachPostgresCluster ¶
func (client *Client) DetachPostgresCluster(ctx context.Context, input DetachPostgresClusterInput) error
func (*Client) EnablePostgresConsul ¶
func (*Client) EnsureRemoteBuilder ¶
func (*Client) ExportDNSRecords ¶
func (*Client) GetAppBasic ¶
func (*Client) GetAppCertificates ¶
func (*Client) GetAppCompact ¶
func (*Client) GetAppCurrentReleaseMachines ¶
func (*Client) GetAppLimitedAccessTokens ¶
func (*Client) GetAppLogs ¶
func (*Client) GetAppNameFromVolume ¶
func (*Client) GetAppReleasesMachines ¶
func (*Client) GetAppSecrets ¶
func (*Client) GetAppsForOrganization ¶
func (*Client) GetDNSRecords ¶
func (*Client) GetDelegatedWireGuardTokens ¶
func (*Client) GetDetailedOrganizationBySlug ¶
func (*Client) GetDomains ¶
func (*Client) GetIPAddresses ¶
func (*Client) GetLatestImageDetails ¶
func (*Client) GetLatestImageTag ¶
func (*Client) GetLoggedCertificates ¶
func (*Client) GetMachine ¶
func (*Client) GetNearestRegion ¶
func (*Client) GetOrganizationBySlug ¶
func (*Client) GetOrganizations ¶
func (client *Client) GetOrganizations(ctx context.Context, filters ...OrganizationFilter) ([]Organization, error)
func (*Client) GetWireGuardPeer ¶
func (*Client) GetWireGuardPeers ¶
func (*Client) ImportDNSRecords ¶
func (c *Client) ImportDNSRecords(ctx context.Context, domainId string, zonefile string) ([]ImportDnsWarning, []ImportDnsChange, error)
func (*Client) IssueSSHCertificate ¶
func (*Client) ListPostgresClusterAttachments ¶
func (*Client) NewRequest ¶
NewRequest - creates a new GraphQL request
func (*Client) PlatformRegions ¶
func (*Client) ReleaseIPAddress ¶
func (*Client) RemoveWireGuardPeer ¶
func (*Client) ResolveImageForApp ¶
func (*Client) RevokeLimitedAccessToken ¶
func (*Client) RunWithContext ¶
RunWithContext - Runs a GraphQL request within a Go context
func (*Client) SetSecrets ¶
func (*Client) UnsetSecrets ¶
type ClientOptions ¶
type ConsulCheckStatus ¶
type ConsulCheckStatus string
const ( Critical ConsulCheckStatus = "critical" Warning ConsulCheckStatus = "warning" Passing ConsulCheckStatus = "passing" )
type CreateAppInput ¶
type CreateOrganizationInvitation ¶
type CreateOrganizationInvitation struct {
Invitation Invitation
}
type CreateOrganizationPayload ¶
type CreateOrganizationPayload struct {
Organization Organization
}
type CreateVolumeRequest ¶
type CreateVolumeRequest struct { Name string `json:"name"` Region string `json:"region"` SizeGb *int `json:"size_gb"` Encrypted *bool `json:"encrypted"` RequireUniqueZone *bool `json:"require_unique_zone"` MachinesOnly *bool `json:"machines_only"` SnapshotRetention *int `json:"snapshot_retention"` // restore from snapshot SnapshotID *string `json:"snapshot_id"` // fork from remote volume SourceVolumeID *string `json:"source_volume_id"` ComputeRequirements *MachineGuest `json:"compute"` }
type CreatedWireGuardPeer ¶
type DNSRecords ¶
type Definition ¶
type Definition map[string]interface{}
func DefinitionPtr ¶
func DefinitionPtr(in map[string]interface{}) *Definition
type DelegatedWireGuardToken ¶
type DelegatedWireGuardToken struct {
Token string
}
type DelegatedWireGuardTokenHandle ¶
type DelegatedWireGuardTokenHandle struct {
Name string
}
type DeleteCertificatePayload ¶
type DeleteCertificatePayload struct { App App Certificate AppCertificate }
type DeleteOrganizationMembershipPayload ¶
type DeleteOrganizationMembershipPayload struct { Organization *Organization User *User }
type DeleteOrganizationPayload ¶
type DeleteOrganizationPayload struct {
DeletedOrganizationId string
}
type Duration ¶
func MustParseDuration ¶
MustParseDuration is like ParseDuration but panics if the expression cannot be parsed. It simplifies safe initialization of global variables holding durations Same idea than regexp.MustCompile
func ParseDuration ¶
Compile parses a duration and returns, if successful, a Duration object.
func (Duration) MarshalJSON ¶
func (Duration) MarshalTOML ¶
func (*Duration) MarshalText ¶
func (*Duration) ParseDuration ¶
func (*Duration) UnmarshalJSON ¶
func (*Duration) UnmarshalTOML ¶
func (*Duration) UnmarshalText ¶
type Error ¶
type Error struct { Message string Path []string Extensions Extensions }
type Extensions ¶
type File ¶
type File struct { // GuestPath is the path on the machine where the file will be written and must be an absolute path. // For example: /full/path/to/file.json GuestPath string `json:"guest_path,omitempty"` // The base64 encoded string of the file contents. RawValue *string `json:"raw_value,omitempty"` // The name of the secret that contains the base64 encoded file contents. SecretName *string `json:"secret_name,omitempty"` }
@description A file that will be written to the Machine. One of RawValue or SecretName must be set.
type GqlMachine ¶
type GqlMachine struct { ID string Name string State string Region string Config MachineConfig App *AppCompact IPs struct { Nodes []*MachineIP } }
type HTTPOptions ¶
type HTTPOptions struct { Compress *bool `json:"compress,omitempty" toml:"compress,omitempty"` Response *HTTPResponseOptions `json:"response,omitempty" toml:"response,omitempty"` H2Backend *bool `json:"h2_backend,omitempty" toml:"h2_backend,omitempty"` }
type HTTPResponseOptions ¶
type HealthCheckStatus ¶
type HealthCheckStatus struct {
Total, Passing, Warn, Critical int
}
func (*HealthCheckStatus) AllPassing ¶
func (hcs *HealthCheckStatus) AllPassing() bool
type HostnameCheck ¶
type HostnameCheck struct { ARecords []string `json:"aRecords"` AAAARecords []string `json:"aaaaRecords"` CNAMERecords []string `json:"cnameRecords"` SOA string `json:"soa"` DNSProvider string `json:"dnsProvider"` DNSVerificationRecord string `json:"dnsVerificationRecord"` ResolvedAddresses []string `json:"resolvedAddresses"` }
type ImageVersion ¶
type ImageVersion struct { Registry string Repository string Tag string Version string Digest string }
func (*ImageVersion) FullImageRef ¶
func (img *ImageVersion) FullImageRef() string
type ImportDnsChange ¶
type ImportDnsWarning ¶
type InstrumentationService ¶
type Invitation ¶
type IssuedCertificate ¶
type LaunchMachineInput ¶
type LaunchMachineInput struct { Config *MachineConfig `json:"config,omitempty"` Region string `json:"region,omitempty"` Name string `json:"name,omitempty"` SkipLaunch bool `json:"skip_launch,omitempty"` SkipServiceRegistration bool `json:"skip_service_registration,omitempty"` LSVD bool `json:"lsvd,omitempty"` LeaseTTL int `json:"lease_ttl,omitempty"` // Client side only ID string `json:"-"` SkipHealthChecks bool `json:"-"` RequiresReplacement bool `json:"-"` Timeout int `json:"-"` }
type LimitedAccessToken ¶
type ListenSocket ¶
type LogEntry ¶
type LogEntry struct { Timestamp string Message string Level string Instance string Region string Meta struct { Instance string Region string Event struct { Provider string } HTTP struct { Request struct { ID string Method string Version string } Response struct { StatusCode int `json:"status_code"` } } Error struct { Code int Message string } URL struct { Full string } } }
type LoggedCertificate ¶
type Logger ¶
type Logger interface { Debug(v ...interface{}) Debugf(format string, v ...interface{}) }
type LoggingTransport ¶
type LoggingTransport struct { InnerTransport http.RoundTripper Logger Logger // contains filtered or unexported fields }
type Machine ¶
type Machine struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` State string `json:"state,omitempty"` Region string `json:"region,omitempty"` ImageRef MachineImageRef `json:"image_ref,omitempty"` // InstanceID is unique for each version of the machine InstanceID string `json:"instance_id,omitempty"` Version string `json:"version,omitempty"` // PrivateIP is the internal 6PN address of the machine. PrivateIP string `json:"private_ip,omitempty"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` Config *MachineConfig `json:"config,omitempty"` Events []*MachineEvent `json:"events,omitempty"` Checks []*MachineCheckStatus `json:"checks,omitempty"` LeaseNonce string `json:"nonce,omitempty"` }
func (*Machine) AllHealthChecks ¶
func (m *Machine) AllHealthChecks() *HealthCheckStatus
func (*Machine) FullImageRef ¶
func (*Machine) GetLatestEventOfTypeAfterType ¶
func (m *Machine) GetLatestEventOfTypeAfterType(latestEventType, firstEventType string) *MachineEvent
Finds the latest event of type latestEventType, which happened after the most recent event of type firstEventType
func (*Machine) HasProcessGroup ¶
func (*Machine) ImageRefWithVersion ¶
func (*Machine) ImageRepository ¶
func (*Machine) ImageVersion ¶
func (*Machine) IsFlyAppsConsole ¶
func (*Machine) IsFlyAppsPlatform ¶
func (*Machine) IsFlyAppsReleaseCommand ¶
func (*Machine) IsReleaseCommandMachine ¶
func (*Machine) MostRecentStartTimeAfterLaunch ¶
func (*Machine) ProcessGroup ¶
func (*Machine) TopLevelChecks ¶
func (m *Machine) TopLevelChecks() *HealthCheckStatus
type MachineCheck ¶
type MachineCheck struct { // The port to connect to, often the same as internal_port Port *int `json:"port,omitempty"` // tcp or http Type *string `json:"type,omitempty"` // The time between connectivity checks Interval *Duration `json:"interval,omitempty"` // The maximum time a connection can take before being reported as failing its health check Timeout *Duration `json:"timeout,omitempty"` // The time to wait after a VM starts before checking its health GracePeriod *Duration `json:"grace_period,omitempty"` // For http checks, the HTTP method to use to when making the request HTTPMethod *string `json:"method,omitempty"` // For http checks, the path to send the request to HTTPPath *string `json:"path,omitempty"` // For http checks, whether to use http or https HTTPProtocol *string `json:"protocol,omitempty"` // For http checks with https protocol, whether or not to verify the TLS certificate HTTPSkipTLSVerify *bool `json:"tls_skip_verify,omitempty"` // If the protocol is https, the hostname to use for TLS certificate validation HTTPTLSServerName *string `json:"tls_server_name,omitempty"` HTTPHeaders []MachineHTTPHeader `json:"headers,omitempty"` }
@description An optional object that defines one or more named checks. The key for each check is the check name.
type MachineCheckStatus ¶
type MachineCheckStatus struct { Name string `json:"name,omitempty"` Status ConsulCheckStatus `json:"status,omitempty"` Output string `json:"output,omitempty"` UpdatedAt *time.Time `json:"updated_at,omitempty"` }
type MachineConfig ¶
type MachineConfig struct { // An object filled with key/value pairs to be set as environment variables Env map[string]string `json:"env,omitempty"` Init MachineInit `json:"init,omitempty"` Guest *MachineGuest `json:"guest,omitempty"` Metadata map[string]string `json:"metadata,omitempty"` Mounts []MachineMount `json:"mounts,omitempty"` Services []MachineService `json:"services,omitempty"` Metrics *MachineMetrics `json:"metrics,omitempty"` Checks map[string]MachineCheck `json:"checks,omitempty"` Statics []*Static `json:"statics,omitempty"` // The docker image to run Image string `json:"image,omitempty"` Files []*File `json:"files,omitempty"` Schedule string `json:"schedule,omitempty"` // Optional boolean telling the Machine to destroy itself once it’s complete (default false) AutoDestroy bool `json:"auto_destroy,omitempty"` Restart MachineRestart `json:"restart,omitempty"` DNS *DNSConfig `json:"dns,omitempty"` Processes []MachineProcess `json:"processes,omitempty"` // Standbys enable a machine to be a standby for another. In the event of a hardware failure, // the standby machine will be started. Standbys []string `json:"standbys,omitempty"` StopConfig *StopConfig `json:"stop_config,omitempty"` // Deprecated: use Guest instead VMSize string `json:"size,omitempty"` // Deprecated: use Service.Autostart instead DisableMachineAutostart *bool `json:"disable_machine_autostart,omitempty"` }
func (*MachineConfig) ProcessGroup ¶
func (c *MachineConfig) ProcessGroup() string
type MachineEvent ¶
type MachineEvent struct { Type string `json:"type,omitempty"` Status string `json:"status,omitempty"` Request *MachineRequest `json:"request,omitempty"` Source string `json:"source,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` }
func (*MachineEvent) Time ¶
func (e *MachineEvent) Time() time.Time
type MachineExecRequest ¶
type MachineExecResponse ¶
type MachineExitEvent ¶
type MachineExitEvent struct { ExitCode int `json:"exit_code,omitempty"` GuestExitCode int `json:"guest_exit_code,omitempty"` GuestSignal int `json:"guest_signal,omitempty"` OOMKilled bool `json:"oom_killed,omitempty"` RequestedStop bool `json:"requested_stop,omitempty"` Restarting bool `json:"restarting,omitempty"` Signal int `json:"signal,omitempty"` ExitedAt time.Time `json:"exited_at,omitempty"` }
type MachineGuest ¶
type MachineGuest struct { CPUKind string `json:"cpu_kind,omitempty" toml:"cpu_kind,omitempty"` CPUs int `json:"cpus,omitempty" toml:"cpus,omitempty"` MemoryMB int `json:"memory_mb,omitempty" toml:"memory_mb,omitempty"` GPUs int `json:"gpus,omitempty" toml:"gpus,omitempty"` GPUKind string `json:"gpu_kind,omitempty" toml:"gpu_kind,omitempty"` HostDedicationID string `json:"host_dedication_id,omitempty" toml:"host_dedication_id,omitempty"` KernelArgs []string `json:"kernel_args,omitempty" toml:"kernel_args,omitempty"` }
func (*MachineGuest) SetSize ¶
func (mg *MachineGuest) SetSize(size string) error
func (*MachineGuest) String ¶
func (mg *MachineGuest) String() string
String returns a string representation of the guest Formatted as "[cpu_kind], XGB RAM" Returns "" if nil
func (*MachineGuest) ToSize ¶
func (mg *MachineGuest) ToSize() string
ToSize converts Guest into VMSize on a best effort way
type MachineHTTPHeader ¶
type MachineHTTPHeader struct { // The header name Name string `json:"name,omitempty"` // The header value Values []string `json:"values,omitempty"` }
@description For http checks, an array of objects with string field Name and array of strings field Values. The key/value pairs specify header and header values that will get passed with the check call.
type MachineImageRef ¶
type MachineInit ¶
type MachineLease ¶
type MachineLease struct { Status string `json:"status,omitempty"` Data *MachineLeaseData `json:"data,omitempty"` Message string `json:"message,omitempty"` Code string `json:"code,omitempty"` }
type MachineLeaseData ¶
type MachineMetrics ¶
type MachineMonitorEvent ¶
type MachineMonitorEvent struct {
ExitEvent *MachineExitEvent `json:"exit_event,omitempty"`
}
type MachineMount ¶
type MachineMount struct { Encrypted bool `json:"encrypted,omitempty"` Path string `json:"path,omitempty"` SizeGb int `json:"size_gb,omitempty"` Volume string `json:"volume,omitempty"` Name string `json:"name,omitempty"` ExtendThresholdPercent int `json:"extend_threshold_percent,omitempty"` AddSizeGb int `json:"add_size_gb,omitempty"` SizeGbLimit int `json:"size_gb_limit,omitempty"` }
type MachinePort ¶
type MachinePort struct { Port *int `json:"port,omitempty" toml:"port,omitempty"` StartPort *int `json:"start_port,omitempty" toml:"start_port,omitempty"` EndPort *int `json:"end_port,omitempty" toml:"end_port,omitempty"` Handlers []string `json:"handlers,omitempty" toml:"handlers,omitempty"` ForceHTTPS bool `json:"force_https,omitempty" toml:"force_https,omitempty"` TLSOptions *TLSOptions `json:"tls_options,omitempty" toml:"tls_options,omitempty"` HTTPOptions *HTTPOptions `json:"http_options,omitempty" toml:"http_options,omitempty"` ProxyProtoOptions *ProxyProtoOptions `json:"proxy_proto_options,omitempty" toml:"proxy_proto_options,omitempty"` }
func (*MachinePort) ContainsPort ¶
func (mp *MachinePort) ContainsPort(port int) bool
func (*MachinePort) HasNonHttpPorts ¶
func (mp *MachinePort) HasNonHttpPorts() bool
type MachineProcess ¶
type MachinePsResponse ¶
type MachinePsResponse []ProcessStat
type MachineRequest ¶
type MachineRequest struct { ExitEvent *MachineExitEvent `json:"exit_event,omitempty"` MonitorEvent *MachineMonitorEvent `json:"MonitorEvent,omitempty"` RestartCount int `json:"restart_count,omitempty"` }
func (*MachineRequest) GetExitCode ¶
func (mr *MachineRequest) GetExitCode() (int, error)
returns the ExitCode from MonitorEvent if it exists, otherwise ExitEvent error when MonitorEvent and ExitEvent are both nil
type MachineRestart ¶
type MachineRestart struct { // * no - Never try to restart a Machine automatically when its main process exits, whether that’s on purpose or on a crash. // * always - Always restart a Machine automatically and never let it enter a stopped state, even when the main process exits cleanly. // * on-failure - Try up to MaxRetries times to automatically restart the Machine if it exits with a non-zero exit code. Default when no explicit policy is set, and for Machines with schedules. Policy MachineRestartPolicy `json:"policy,omitempty" enums:"no,always,on-failure"` // When policy is on-failure, the maximum number of times to attempt to restart the Machine before letting it stop. MaxRetries int `json:"max_retries,omitempty"` }
@description The Machine restart policy defines whether and how flyd restarts a Machine after its main process exits. See https://fly.io/docs/machines/guides-examples/machine-restart-policy/.
type MachineRestartPolicy ¶
type MachineRestartPolicy string
var ( MachineRestartPolicyNo MachineRestartPolicy = "no" MachineRestartPolicyOnFailure MachineRestartPolicy = "on-failure" MachineRestartPolicyAlways MachineRestartPolicy = "always" )
type MachineService ¶
type MachineService struct { Protocol string `json:"protocol,omitempty" toml:"protocol,omitempty"` InternalPort int `json:"internal_port,omitempty" toml:"internal_port,omitempty"` Autostop *bool `json:"autostop,omitempty"` Autostart *bool `json:"autostart,omitempty"` MinMachinesRunning *int `json:"min_machines_running,omitempty"` Ports []MachinePort `json:"ports,omitempty" toml:"ports,omitempty"` Checks []MachineCheck `json:"checks,omitempty" toml:"checks,omitempty"` Concurrency *MachineServiceConcurrency `json:"concurrency,omitempty" toml:"concurrency"` ForceInstanceKey *string `json:"force_instance_key" toml:"force_instance_key"` ForceInstanceDescription *string `json:"force_instance_description,omitempty" toml:"force_instance_description"` }
type MachineStartResponse ¶
type Organization ¶
type Organization struct { ID string InternalNumericID string Name string RemoteBuilderImage string RemoteBuilderApp *App Slug string RawSlug string Type string PaidPlan bool Billable bool Settings map[string]any Domains struct { Nodes *[]*Domain Edges *[]*struct { Cursor *string Node *Domain } } WireGuardPeer *WireGuardPeer WireGuardPeers struct { Nodes *[]*WireGuardPeer Edges *[]*struct { Cursor *string Node *WireGuardPeer } } DelegatedWireGuardTokens struct { Nodes *[]*DelegatedWireGuardTokenHandle Edges *[]*struct { Cursor *string Node *DelegatedWireGuardTokenHandle } } LoggedCertificates *struct { Nodes []LoggedCertificate } LimitedAccessTokens *struct { Nodes []LimitedAccessToken } }
func (*Organization) GetID ¶
func (o *Organization) GetID() string
func (*Organization) GetSlug ¶
func (o *Organization) GetSlug() string
type OrganizationBasic ¶
func (*OrganizationBasic) GetID ¶
func (o *OrganizationBasic) GetID() string
func (*OrganizationBasic) GetSlug ¶
func (o *OrganizationBasic) GetSlug() string
type OrganizationDetails ¶
type OrganizationFilter ¶
type OrganizationFilter func(*organizationFilter)
var AdminOnly OrganizationFilter = func(f *organizationFilter) { f.admin = true }
type OrganizationImpl ¶
type OrganizationType ¶
type OrganizationType string
const ( OrganizationTypePersonal OrganizationType = "PERSONAL" )
type PostgresEnableConsulPayload ¶
type PostgresEnableConsulPayload struct {
ConsulURL string `json:"consulUrl"`
}
type ProcessStat ¶
type ProxyProtoOptions ¶
type ProxyProtoOptions struct {
Version string `json:"version,omitempty" toml:"version,omitempty"`
}
type Query ¶
type Query struct { Errors Errors Apps struct { PageInfo struct { HasNextPage bool EndCursor string } Nodes []App } App App AppCompact AppCompact AppBasic AppBasic AppCertsCompact AppCertsCompact Viewer User GqlMachine GqlMachine Organizations struct { Nodes []Organization } Organization *Organization OrganizationDetails OrganizationDetails Volume struct { App struct { Name string } } Domain *Domain Node interface{} Nodes []interface{} Platform struct { RequestRegion string Regions []Region } NearestRegion *Region LatestImageTag string LatestImageDetails ImageVersion // mutations CreateApp struct { App App } SetSecrets struct { Release Release } UnsetSecrets struct { Release Release } EnsureRemoteBuilder *struct { App *App URL string Release Release } EnsureMachineRemoteBuilder *struct { App *App Machine *GqlMachine } CreateDoctorUrl SignedUrl AddCertificate struct { Certificate *AppCertificate Check *HostnameCheck } DeleteCertificate DeleteCertificatePayload CheckCertificate struct { App *App Certificate *AppCertificate Check *HostnameCheck } AllocateIPAddress struct { App App IPAddress IPAddress } ReleaseIPAddress struct { App App } CreateDomain struct { Domain *Domain } CreateAndRegisterDomain struct { Domain *Domain } CheckDomain *CheckDomainResult ExportDnsZone struct { Contents string } ImportDnsZone struct { Warnings []ImportDnsWarning Changes []ImportDnsChange } CreateOrganization CreateOrganizationPayload DeleteOrganization DeleteOrganizationPayload AddWireGuardPeer CreatedWireGuardPeer EstablishSSHKey SSHCertificate IssueCertificate IssuedCertificate CreateDelegatedWireGuardToken DelegatedWireGuardToken DeleteDelegatedWireGuardToken DelegatedWireGuardToken RemoveWireGuardPeer struct { Organization Organization } AttachPostgresCluster *AttachPostgresClusterPayload EnablePostgresConsul *PostgresEnableConsulPayload CreateOrganizationInvitation CreateOrganizationInvitation ValidateWireGuardPeers struct { InvalidPeerIPs []string } PostgresAttachments struct { Nodes []*PostgresClusterAttachment } DeleteOrganizationMembership *DeleteOrganizationMembershipPayload UpdateRemoteBuilder struct { Organization Organization } CanPerformBluegreenDeployment bool }
Query - Master query which encapsulates all possible returned structures
type ReleaseIPAddressInput ¶
type RemoveMachineInput ¶
type RestartMachineInput ¶
type SSHCertificate ¶
type SSHCertificate struct {
Certificate string
}
type SetSecretsInput ¶
type SetSecretsInput struct { AppID string `json:"appId"` Secrets []SetSecretsInputSecret `json:"secrets"` }
type SetSecretsInputSecret ¶
type StopConfig ¶
type StopMachineInput ¶
type TLSOptions ¶
type Transport ¶
type UnsetSecretsInput ¶
type UpdateVolumeRequest ¶
type UpdateVolumeRequest struct {
SnapshotRetention *int `json:"snapshot_retention"`
}
type Volume ¶
type Volume struct { ID string `json:"id"` Name string `json:"name"` State string `json:"state"` SizeGb int `json:"size_gb"` Region string `json:"region"` Zone string `json:"zone"` Encrypted bool `json:"encrypted"` AttachedMachine *string `json:"attached_machine_id"` AttachedAllocation *string `json:"attached_alloc_id"` CreatedAt time.Time `json:"created_at"` HostDedicationID string `json:"host_dedication_id"` SnapshotRetention int `json:"snapshot_retention"` }
func (Volume) IsAttached ¶
type VolumeSnapshot ¶
type WireGuardPeer ¶
Source Files ¶
- api.go
- auth.go
- casting.go
- cli_session.go
- client.go
- context.go
- duration.go
- error.go
- http.go
- machine_types.go
- resource_apps.go
- resource_certificates.go
- resource_deploy.go
- resource_dns.go
- resource_doctor.go
- resource_domains.go
- resource_images.go
- resource_ip_addresses.go
- resource_logs.go
- resource_machines.go
- resource_organizations.go
- resource_platform.go
- resource_postgres.go
- resource_regions.go
- resource_releases.go
- resource_remote_builders.go
- resource_secrets.go
- resource_ssh.go
- resource_tokens.go
- resource_user.go
- resource_volumes.go
- resource_wireguard.go
- types.go
- volume_types.go