pub struct ShuttleApiClient {
pub client: ClientWithMiddleware,
pub api_url: String,
pub api_key: Option<String>,
}
Fields§
§client: ClientWithMiddleware
§api_url: String
§api_key: Option<String>
Implementations§
Source§impl ShuttleApiClient
impl ShuttleApiClient
pub fn new( api_url: String, api_key: Option<String>, headers: Option<HeaderMap>, timeout: Option<u64>, ) -> Self
pub fn set_auth_bearer(&self, builder: RequestBuilder) -> RequestBuilder
pub async fn get_device_auth_ws( &self, ) -> Result<WebSocketStream<MaybeTlsStream<TcpStream>>>
pub async fn check_project_name( &self, project_name: &str, ) -> Result<ParsedJson<bool>>
pub async fn get_current_user(&self) -> Result<ParsedJson<UserResponse>>
pub async fn deploy( &self, project: &str, deployment_req: DeploymentRequest, ) -> Result<ParsedJson<DeploymentResponse>>
pub async fn upload_archive( &self, project: &str, data: Vec<u8>, ) -> Result<ParsedJson<UploadArchiveResponse>>
pub async fn redeploy( &self, project: &str, deployment_id: &str, ) -> Result<ParsedJson<DeploymentResponse>>
pub async fn stop_service(&self, project: &str) -> Result<ParsedJson<String>>
pub async fn get_service_resources( &self, project: &str, ) -> Result<ParsedJson<ResourceListResponse>>
pub async fn delete_service_resource( &self, project: &str, resource_type: &ResourceType, ) -> Result<ParsedJson<String>>
pub async fn provision_resource( &self, project: &str, req: ProvisionResourceRequest, ) -> Result<ParsedJson<ResourceResponse>>
pub async fn get_secrets( &self, project: &str, ) -> Result<ParsedJson<ResourceResponse>>
pub async fn list_certificates( &self, project: &str, ) -> Result<ParsedJson<CertificateListResponse>>
pub async fn add_certificate( &self, project: &str, subject: String, ) -> Result<ParsedJson<CertificateResponse>>
pub async fn delete_certificate( &self, project: &str, subject: String, ) -> Result<ParsedJson<String>>
pub async fn create_project( &self, name: &str, ) -> Result<ParsedJson<ProjectResponse>>
pub async fn get_project( &self, project: &str, ) -> Result<ParsedJson<ProjectResponse>>
pub async fn get_projects_list(&self) -> Result<ParsedJson<ProjectListResponse>>
pub async fn update_project( &self, project: &str, req: ProjectUpdateRequest, ) -> Result<ParsedJson<ProjectResponse>>
pub async fn delete_project(&self, project: &str) -> Result<ParsedJson<String>>
pub async fn get_deployment_logs( &self, project: &str, deployment_id: &str, ) -> Result<ParsedJson<LogsResponse>>
pub async fn get_project_logs( &self, project: &str, ) -> Result<ParsedJson<LogsResponse>>
pub async fn get_deployments( &self, project: &str, page: i32, per_page: i32, ) -> Result<ParsedJson<DeploymentListResponse>>
pub async fn get_current_deployment( &self, project: &str, ) -> Result<ParsedJson<Option<DeploymentResponse>>>
pub async fn get_deployment( &self, project: &str, deployment_id: &str, ) -> Result<ParsedJson<DeploymentResponse>>
pub async fn reset_api_key(&self) -> Result<()>
pub async fn ws_get( &self, path: impl AsRef<str>, ) -> Result<WebSocketStream<MaybeTlsStream<TcpStream>>>
pub async fn get<T: Serialize>( &self, path: impl AsRef<str>, body: Option<T>, ) -> Result<Response>
pub async fn get_json<R>(&self, path: impl AsRef<str>) -> Result<ParsedJson<R>>where
R: for<'de> Deserialize<'de>,
pub async fn get_json_with_body<R, T: Serialize>(
&self,
path: impl AsRef<str>,
body: T,
) -> Result<ParsedJson<R>>where
R: for<'de> Deserialize<'de>,
pub async fn post<T: Serialize>( &self, path: impl AsRef<str>, body: Option<T>, ) -> Result<Response>
pub async fn post_json<T: Serialize, R>(
&self,
path: impl AsRef<str>,
body: Option<T>,
) -> Result<ParsedJson<R>>where
R: for<'de> Deserialize<'de>,
pub async fn put<T: Serialize>( &self, path: impl AsRef<str>, body: Option<T>, ) -> Result<Response>
pub async fn put_json<T: Serialize, R>(
&self,
path: impl AsRef<str>,
body: Option<T>,
) -> Result<ParsedJson<R>>where
R: for<'de> Deserialize<'de>,
pub async fn delete<T: Serialize>( &self, path: impl AsRef<str>, body: Option<T>, ) -> Result<Response>
pub async fn delete_json<R>(
&self,
path: impl AsRef<str>,
) -> Result<ParsedJson<R>>where
R: for<'de> Deserialize<'de>,
pub async fn delete_json_with_body<R, T: Serialize>(
&self,
path: impl AsRef<str>,
body: T,
) -> Result<ParsedJson<R>>where
R: for<'de> Deserialize<'de>,
Trait Implementations§
Source§impl Clone for ShuttleApiClient
impl Clone for ShuttleApiClient
Source§fn clone(&self) -> ShuttleApiClient
fn clone(&self) -> ShuttleApiClient
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ShuttleApiClient
impl !RefUnwindSafe for ShuttleApiClient
impl Send for ShuttleApiClient
impl Sync for ShuttleApiClient
impl Unpin for ShuttleApiClient
impl !UnwindSafe for ShuttleApiClient
Blanket Implementations§
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