Documentation
¶
Index ¶
- type AttachedApp
- type BillingStatus
- type BuildFinalImage
- type BuildResponse
- type BuildStrategyAttempt
- type BuildTimings
- type BuilderMeta
- type Client
- func (c *Client) CreateAttachment(ctx context.Context, clusterId string, input CreateAttachmentInput) (CreateAttachmentResponse, error)
- func (c *Client) CreateBuild(ctx context.Context, in CreateBuildRequest) (*BuildResponse, error)
- func (c *Client) CreateCluster(ctx context.Context, input CreateClusterInput) (CreateClusterResponse, error)
- func (c *Client) CreateDatabase(ctx context.Context, id string, input CreateDatabaseInput) (CreateDatabaseResponse, error)
- func (c *Client) CreateFlyManagedBuilder(ctx context.Context, orgSlug string, region string) (CreateFlyManagedBuilderResponse, error)
- func (c *Client) CreateManagedClusterBackup(ctx context.Context, clusterID string, input CreateManagedClusterBackupInput) (CreateManagedClusterBackupResponse, error)
- func (c *Client) CreateRelease(ctx context.Context, request CreateReleaseRequest) (release *Release, err error)
- func (c *Client) CreateUser(ctx context.Context, id string, input CreateUserInput) (CreateUserResponse, error)
- func (c *Client) CreateUserWithRole(ctx context.Context, id string, input CreateUserWithRoleInput) (CreateUserWithRoleResponse, error)
- func (c *Client) DeleteAttachment(ctx context.Context, clusterId string, appName string) (DeleteAttachmentResponse, error)
- func (c *Client) DeleteUser(ctx context.Context, id string, username string) error
- func (c *Client) DestroyCluster(ctx context.Context, orgSlug string, id string) error
- func (c *Client) EnsureDepotBuilder(ctx context.Context, in EnsureDepotBuilderRequest) (*EnsureDepotBuilderResponse, error)
- func (c *Client) FinishBuild(ctx context.Context, in FinishBuildRequest) (*BuildResponse, error)
- func (c *Client) GetAllAppsCurrentReleaseTimestamps(ctx context.Context) (out *map[string]time.Time, err error)
- func (c *Client) GetCurrentRelease(ctx context.Context, appName string) (release *Release, err error)
- func (c *Client) GetManagedCluster(ctx context.Context, orgSlug string, id string) (GetManagedClusterResponse, error)
- func (c *Client) GetManagedClusterById(ctx context.Context, id string) (GetManagedClusterResponse, error)
- func (c *Client) GetOrganization(ctx context.Context, orgSlug string) (*Organization, error)
- func (c *Client) GetUserCredentials(ctx context.Context, id string, username string) (GetUserCredentialsResponse, error)
- func (c *Client) ListDatabases(ctx context.Context, id string) (ListDatabasesResponse, error)
- func (c *Client) ListMPGRegions(ctx context.Context, orgSlug string) (ListMPGRegionsResponse, error)
- func (c *Client) ListManagedClusterBackups(ctx context.Context, clusterID string) (ListManagedClusterBackupsResponse, error)
- func (c *Client) ListManagedClusters(ctx context.Context, orgSlug string, deleted bool) (ListManagedClustersResponse, error)
- func (c *Client) ListOrganizations(ctx context.Context, admin bool) ([]Organization, error)
- func (c *Client) ListReleases(ctx context.Context, appName string, limit int) ([]Release, error)
- func (c *Client) ListUsers(ctx context.Context, id string) (ListUsersResponse, error)
- func (c *Client) RestoreManagedClusterBackup(ctx context.Context, clusterID string, input RestoreManagedClusterBackupInput) (RestoreManagedClusterBackupResponse, error)
- func (c *Client) UpdateRelease(ctx context.Context, releaseID, status string, metadata any) (response *Release, err error)
- func (c *Client) UpdateUserRole(ctx context.Context, id string, username string, input UpdateUserRoleInput) (UpdateUserRoleResponse, error)
- type CreateAttachmentInput
- type CreateAttachmentResponse
- type CreateBuildRequest
- type CreateClusterInput
- type CreateClusterResponse
- type CreateDatabaseInput
- type CreateDatabaseResponse
- type CreateFlyManagedBuilderInput
- type CreateFlyManagedBuilderParams
- type CreateFlyManagedBuilderResponse
- type CreateManagedClusterBackupInput
- type CreateManagedClusterBackupResponse
- type CreateReleaseRequest
- type CreateUserInput
- type CreateUserResponse
- type CreateUserWithRoleInput
- type CreateUserWithRoleResponse
- type Database
- type DeleteAttachmentResponse
- type DeploymentStrategy
- type DetailedErrors
- type EnsureDepotBuilderRequest
- type EnsureDepotBuilderResponse
- type FinishBuildRequest
- type FlyManagedBuilder
- type GetManagedClusterCredentialsResponse
- type GetManagedClusterResponse
- type GetUserCredentialsResponse
- type ListDatabasesResponse
- type ListMPGRegionsResponse
- type ListManagedClusterBackupsResponse
- type ListManagedClustersResponse
- type ListUsersResponse
- type MPGRegion
- type ManagedCluster
- type ManagedClusterBackup
- type ManagedClusterIpAssignments
- type NewClientOpts
- type Organization
- type Release
- type RestoreManagedClusterBackupInput
- type RestoreManagedClusterBackupResponse
- type UpdateUserRoleInput
- type UpdateUserRoleResponse
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttachedApp ¶ added in v0.4.2
type BillingStatus ¶ added in v0.3.214
type BillingStatus string
const ( BillingStatusCurrent BillingStatus = "CURRENT" BillingStatusDelinquent BillingStatus = "DELINQUENT" BillingStatusPastDue BillingStatus = "PAST_DUE" BillingStatusSourceRequired BillingStatus = "SOURCE_REQUIRED" BillingStatusSuspended BillingStatus = "SUSPENDED" BillingStatusTrialActive BillingStatus = "TRIAL_ACTIVE" BillingStatusTrialEnded BillingStatus = "TRIAL_ENDED" )
type BuildFinalImage ¶ added in v0.3.214
type BuildResponse ¶ added in v0.3.214
type BuildStrategyAttempt ¶ added in v0.3.214
type BuildTimings ¶ added in v0.3.214
type BuilderMeta ¶ added in v0.3.214
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewWithOptions ¶
func NewWithOptions(ctx context.Context, opts NewClientOpts) (*Client, error)
func (*Client) CreateAttachment ¶ added in v0.4.2
func (c *Client) CreateAttachment(ctx context.Context, clusterId string, input CreateAttachmentInput) (CreateAttachmentResponse, error)
CreateAttachment creates a ManagedServiceAttachment record linking an app to a managed Postgres cluster
func (*Client) CreateBuild ¶ added in v0.3.214
func (c *Client) CreateBuild(ctx context.Context, in CreateBuildRequest) (*BuildResponse, error)
func (*Client) CreateCluster ¶ added in v0.3.111
func (c *Client) CreateCluster(ctx context.Context, input CreateClusterInput) (CreateClusterResponse, error)
func (*Client) CreateDatabase ¶ added in v0.3.210
func (c *Client) CreateDatabase(ctx context.Context, id string, input CreateDatabaseInput) (CreateDatabaseResponse, error)
func (*Client) CreateFlyManagedBuilder ¶ added in v0.3.149
func (*Client) CreateManagedClusterBackup ¶ added in v0.3.198
func (c *Client) CreateManagedClusterBackup(ctx context.Context, clusterID string, input CreateManagedClusterBackupInput) (CreateManagedClusterBackupResponse, error)
CreateManagedClusterBackup creates a new backup for a managed Postgres cluster
func (*Client) CreateRelease ¶ added in v0.3.214
func (*Client) CreateUser ¶ added in v0.3.99
func (c *Client) CreateUser(ctx context.Context, id string, input CreateUserInput) (CreateUserResponse, error)
func (*Client) CreateUserWithRole ¶ added in v0.3.211
func (c *Client) CreateUserWithRole(ctx context.Context, id string, input CreateUserWithRoleInput) (CreateUserWithRoleResponse, error)
func (*Client) DeleteAttachment ¶ added in v0.4.2
func (c *Client) DeleteAttachment(ctx context.Context, clusterId string, appName string) (DeleteAttachmentResponse, error)
DeleteAttachment removes a ManagedServiceAttachment record linking an app to a managed Postgres cluster
func (*Client) DeleteUser ¶ added in v0.3.211
func (*Client) DestroyCluster ¶ added in v0.3.145
DestroyCluster permanently destroys a managed Postgres cluster
func (*Client) EnsureDepotBuilder ¶ added in v0.3.214
func (c *Client) EnsureDepotBuilder(ctx context.Context, in EnsureDepotBuilderRequest) (*EnsureDepotBuilderResponse, error)
func (*Client) FinishBuild ¶ added in v0.3.214
func (c *Client) FinishBuild(ctx context.Context, in FinishBuildRequest) (*BuildResponse, error)
func (*Client) GetAllAppsCurrentReleaseTimestamps ¶ added in v0.3.214
func (*Client) GetCurrentRelease ¶ added in v0.3.214
func (c *Client) GetCurrentRelease(ctx context.Context, appName string) (release *Release, err error)
GetCurrentRelease retrieves the current release for an app. Returns nil release (without error) if the app has no current release (404).
func (*Client) GetManagedCluster ¶
func (*Client) GetManagedClusterById ¶ added in v0.3.99
func (*Client) GetOrganization ¶ added in v0.3.214
func (*Client) GetUserCredentials ¶ added in v0.3.211
func (*Client) ListDatabases ¶ added in v0.3.210
func (*Client) ListMPGRegions ¶ added in v0.3.145
func (c *Client) ListMPGRegions(ctx context.Context, orgSlug string) (ListMPGRegionsResponse, error)
ListMPGRegions returns the list of regions available for Managed Postgres TODO: Implement the actual API endpoint on the backend
func (*Client) ListManagedClusterBackups ¶ added in v0.3.198
func (c *Client) ListManagedClusterBackups(ctx context.Context, clusterID string) (ListManagedClusterBackupsResponse, error)
ListManagedClusterBackups returns the list of backups for a managed Postgres cluster
func (*Client) ListManagedClusters ¶
func (*Client) ListOrganizations ¶ added in v0.3.214
func (*Client) ListReleases ¶ added in v0.3.214
func (*Client) RestoreManagedClusterBackup ¶ added in v0.3.198
func (c *Client) RestoreManagedClusterBackup(ctx context.Context, clusterID string, input RestoreManagedClusterBackupInput) (RestoreManagedClusterBackupResponse, error)
RestoreManagedClusterBackup restores a managed Postgres cluster from a backup
func (*Client) UpdateRelease ¶ added in v0.3.214
func (*Client) UpdateUserRole ¶ added in v0.3.211
func (c *Client) UpdateUserRole(ctx context.Context, id string, username string, input UpdateUserRoleInput) (UpdateUserRoleResponse, error)
type CreateAttachmentInput ¶ added in v0.4.2
type CreateAttachmentInput struct {
AppName string `json:"app_name"`
}
type CreateAttachmentResponse ¶ added in v0.4.2
type CreateBuildRequest ¶ added in v0.3.214
type CreateClusterInput ¶ added in v0.3.111
type CreateClusterResponse ¶ added in v0.3.111
type CreateClusterResponse struct {
Ok bool `json:"ok"`
Errors DetailedErrors `json:"errors"`
Data struct {
Id string `json:"id"`
Name string `json:"name"`
Status *string `json:"status"`
Plan string `json:"plan"`
Environment *string `json:"environment"`
Region string `json:"region"`
Organization fly.Organization `json:"organization"`
Replicas int `json:"replicas"`
Disk int `json:"disk"`
IpAssignments ManagedClusterIpAssignments `json:"ip_assignments"`
PostGISEnabled bool `json:"postgis_enabled"`
} `json:"data"`
}
type CreateDatabaseInput ¶ added in v0.3.210
type CreateDatabaseInput struct {
Name string `json:"name"`
}
type CreateDatabaseResponse ¶ added in v0.3.210
type CreateDatabaseResponse struct {
Data Database `json:"data"`
}
type CreateFlyManagedBuilderInput ¶ added in v0.3.149
type CreateFlyManagedBuilderInput struct {
Builder CreateFlyManagedBuilderParams `json:"builder"`
}
type CreateFlyManagedBuilderParams ¶ added in v0.3.149
type CreateFlyManagedBuilderParams struct {
Region string `json:"region"`
}
type CreateFlyManagedBuilderResponse ¶ added in v0.3.149
type CreateFlyManagedBuilderResponse struct {
Data FlyManagedBuilder `json:"data"`
Errors DetailedErrors `json:"errors"`
}
type CreateManagedClusterBackupInput ¶ added in v0.3.198
type CreateManagedClusterBackupInput struct {
Type string `json:"type"`
}
type CreateManagedClusterBackupResponse ¶ added in v0.3.198
type CreateManagedClusterBackupResponse struct {
Data ManagedClusterBackup `json:"data"`
}
type CreateReleaseRequest ¶ added in v0.3.214
type CreateReleaseRequest struct {
AppName string `json:"app_name"`
BuildId int64 `json:"build_id"`
Definition any `json:"definition"`
Image string `json:"image"`
Strategy DeploymentStrategy `json:"strategy"`
}
type CreateUserInput ¶ added in v0.3.99
type CreateUserResponse ¶ added in v0.3.99
type CreateUserResponse struct {
ConnectionUri string `json:"connection_uri"`
Ok bool `json:"ok"`
Errors DetailedErrors `json:"errors"`
}
type CreateUserWithRoleInput ¶ added in v0.3.211
type CreateUserWithRoleResponse ¶ added in v0.3.211
type CreateUserWithRoleResponse struct {
Data User `json:"data"`
}
type DeleteAttachmentResponse ¶ added in v0.4.2
type DeleteAttachmentResponse struct {
Data struct {
Message string `json:"message"`
} `json:"data"`
}
type DeploymentStrategy ¶ added in v0.3.214
type DeploymentStrategy string
const ( // Launch all new instances before shutting down previous instances DeploymentStrategyBluegreen DeploymentStrategy = "BLUEGREEN" // Ensure new instances are healthy before continuing with a rolling deployment DeploymentStrategyCanary DeploymentStrategy = "CANARY" // Deploy new instances all at once DeploymentStrategyImmediate DeploymentStrategy = "IMMEDIATE" // Incrementally replace old instances with new ones DeploymentStrategyRolling DeploymentStrategy = "ROLLING" // Incrementally replace old instances with new ones, 1 by 1 DeploymentStrategyRollingOne DeploymentStrategy = "ROLLING_ONE" // Deploy new instances all at once DeploymentStrategySimple DeploymentStrategy = "SIMPLE" )
type DetailedErrors ¶ added in v0.3.99
type DetailedErrors struct {
Detail string `json:"detail"`
}
type EnsureDepotBuilderRequest ¶ added in v0.3.214
type EnsureDepotBuilderResponse ¶ added in v0.3.214
type FinishBuildRequest ¶ added in v0.3.214
type FinishBuildRequest struct {
BuildId int64 `json:"build_id"`
AppName string `json:"app_name"`
MachineId string `json:"machine_id"`
Status string `json:"status"`
StrategiesAttempted []BuildStrategyAttempt `json:"strategies_attempted"`
BuilderMeta BuilderMeta `json:"builder_meta"`
FinalImage BuildFinalImage `json:"final_image"`
Timings BuildTimings `json:"timings"`
Logs string `json:"logs"`
}
type FlyManagedBuilder ¶ added in v0.3.149
type GetManagedClusterCredentialsResponse ¶ added in v0.3.112
type GetManagedClusterResponse ¶
type GetManagedClusterResponse struct {
Data ManagedCluster `json:"data"`
Credentials GetManagedClusterCredentialsResponse `json:"credentials"`
}
type GetUserCredentialsResponse ¶ added in v0.3.211
type ListDatabasesResponse ¶ added in v0.3.210
type ListDatabasesResponse struct {
Data []Database `json:"data"`
}
type ListMPGRegionsResponse ¶ added in v0.3.145
type ListMPGRegionsResponse struct {
Data []MPGRegion `json:"data"`
}
type ListManagedClusterBackupsResponse ¶ added in v0.3.198
type ListManagedClusterBackupsResponse struct {
Data []ManagedClusterBackup `json:"data"`
}
type ListManagedClustersResponse ¶
type ListManagedClustersResponse struct {
Data []ManagedCluster `json:"data"`
}
type ListUsersResponse ¶ added in v0.3.211
type ListUsersResponse struct {
Data []User `json:"data"`
}
type ManagedCluster ¶
type ManagedCluster struct {
Id string `json:"id"`
Name string `json:"name"`
Region string `json:"region"`
Status string `json:"status"`
Plan string `json:"plan"`
Disk int `json:"disk"`
Replicas int `json:"replicas"`
Organization fly.Organization `json:"organization"`
IpAssignments ManagedClusterIpAssignments `json:"ip_assignments"`
AttachedApps []AttachedApp `json:"attached_apps"`
}
type ManagedClusterBackup ¶ added in v0.3.198
type ManagedClusterIpAssignments ¶
type ManagedClusterIpAssignments struct {
Direct string `json:"direct"`
}
type NewClientOpts ¶
type Organization ¶ added in v0.3.214
type Organization struct {
ID string `json:"id"`
InternalNumericID uint64 `json:"internal_numeric_id"`
Slug string `json:"slug"`
RawSlug string `json:"raw_slug"`
PaidPlan bool `json:"paid_plan"`
Personal bool `json:"personal"`
BillingStatus BillingStatus `json:"billing_status"`
ProvisionsBetaExtensions bool `json:"provisions_beta_extensions"`
Name string `json:"name"`
Billable bool `json:"billable"`
RemoteBuilderImage string `json:"remote_builder_image"`
}
type Release ¶ added in v0.3.214
type Release struct {
ID string `json:"id"`
Version int `json:"version"`
Stable bool `json:"stable"`
InProgress bool `json:"in_progress"`
Status string `json:"status"`
DeploymentStrategy DeploymentStrategy `json:"strategy"`
User string `json:"user"`
CreatedAt time.Time `json:"created_at"`
ImageRef string `json:"image_ref"`
}
type RestoreManagedClusterBackupInput ¶ added in v0.3.198
type RestoreManagedClusterBackupInput struct {
BackupId string `json:"backup_id"`
}
type RestoreManagedClusterBackupResponse ¶ added in v0.3.198
type RestoreManagedClusterBackupResponse struct {
Data ManagedCluster `json:"data"`
}
type UpdateUserRoleInput ¶ added in v0.3.211
type UpdateUserRoleInput struct {
Role string `json:"role"` // 'schema_admin' | 'writer' | 'reader'
}
type UpdateUserRoleResponse ¶ added in v0.3.211
type UpdateUserRoleResponse struct {
Data User `json:"data"`
}