pub struct FlyioClient { /* private fields */ }Expand description
Fly.io API client for managing deployments
Implementations§
Source§impl FlyioClient
impl FlyioClient
pub fn new(api_token: String) -> Self
Sourcepub async fn create_app(
&self,
app_name: &str,
org_slug: &str,
) -> Result<FlyioApp>
pub async fn create_app( &self, app_name: &str, org_slug: &str, ) -> Result<FlyioApp>
Create a new Fly.io app
Sourcepub async fn create_machine(
&self,
app_name: &str,
config: FlyioMachineConfig,
region: &str,
registry_auth: Option<FlyioRegistryAuth>,
) -> Result<FlyioMachine>
pub async fn create_machine( &self, app_name: &str, config: FlyioMachineConfig, region: &str, registry_auth: Option<FlyioRegistryAuth>, ) -> Result<FlyioMachine>
Create a machine (instance) for the app
Sourcepub async fn update_machine(
&self,
app_name: &str,
machine_id: &str,
config: FlyioMachineConfig,
registry_auth: Option<FlyioRegistryAuth>,
) -> Result<FlyioMachine>
pub async fn update_machine( &self, app_name: &str, machine_id: &str, config: FlyioMachineConfig, registry_auth: Option<FlyioRegistryAuth>, ) -> Result<FlyioMachine>
Update a machine’s configuration (image, env vars, etc.)
Sourcepub async fn get_machine(
&self,
app_name: &str,
machine_id: &str,
) -> Result<FlyioMachine>
pub async fn get_machine( &self, app_name: &str, machine_id: &str, ) -> Result<FlyioMachine>
Get machine status
Sourcepub async fn stop_machine(&self, app_name: &str, machine_id: &str) -> Result<()>
pub async fn stop_machine(&self, app_name: &str, machine_id: &str) -> Result<()>
Stop a running machine (graceful shutdown, keeps the machine around so it can be restarted later without recreating its config).
Sourcepub async fn start_machine(
&self,
app_name: &str,
machine_id: &str,
) -> Result<()>
pub async fn start_machine( &self, app_name: &str, machine_id: &str, ) -> Result<()>
Start a stopped machine.
Sourcepub async fn delete_machine(
&self,
app_name: &str,
machine_id: &str,
) -> Result<()>
pub async fn delete_machine( &self, app_name: &str, machine_id: &str, ) -> Result<()>
Delete a machine
Sourcepub async fn delete_app(&self, app_name: &str) -> Result<()>
pub async fn delete_app(&self, app_name: &str) -> Result<()>
Delete a Fly.io app
Sourcepub async fn allocate_ips(&self, app_name: &str) -> Result<()>
pub async fn allocate_ips(&self, app_name: &str) -> Result<()>
Allocate a shared IPv4 and a dedicated IPv6 address for an app
Sourcepub async fn add_certificate(
&self,
app_name: &str,
hostname: &str,
) -> Result<()>
pub async fn add_certificate( &self, app_name: &str, hostname: &str, ) -> Result<()>
Add a custom domain certificate to an app
This tells Fly.io to provision a Let’s Encrypt TLS certificate for the given hostname and route traffic for that hostname to this app via SNI.
Sourcepub async fn delete_certificate(
&self,
app_name: &str,
hostname: &str,
) -> Result<()>
pub async fn delete_certificate( &self, app_name: &str, hostname: &str, ) -> Result<()>
Remove a custom domain certificate from an app
Sourcepub async fn list_machines(&self, app_name: &str) -> Result<Vec<FlyioMachine>>
pub async fn list_machines(&self, app_name: &str) -> Result<Vec<FlyioMachine>>
List machines for an app
Auto Trait Implementations§
impl Freeze for FlyioClient
impl RefUnwindSafe for FlyioClient
impl Send for FlyioClient
impl Sync for FlyioClient
impl Unpin for FlyioClient
impl UnsafeUnpin for FlyioClient
impl UnwindSafe for FlyioClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.