Overview
+Render CDK provides a streamlined interface for interacting with Render, a platform that + allows you to + build, deploy, and scale your apps with ease. This crate abstracts + Render's API, making it easier to work with Render cloud programmatically.
+Crate Information
+-
+
- Name: render_cdk +
- Version: 0.0.3 +
- Authors: Irfan Ghat +
- Description: This crate provides a streamlined interface for interacting with + Render, a platform that allows you to build, deploy, and scale your apps with ease. +
- Homepage: Cloud Application Hosting for Developers | + Render +
- Repository: Render (github.com) +
- License: MIT +
Current Features
+Work on the resource management module is currently under way. The API supports many of the same actions + available from the Render Dashboard. It currently provides endpoints for managing:
+-
+
- Services +
- Deploys +
- Custom domains +
- Jobs +
The CDK will provide an abstraction that will make it easier to work with the Render cloud + programmatically.
+Examples
+#![allow(unused)]
+
+use render_cdk::environment_management::prelude::*;
+use render_cdk::resource_management::prelude::*;
+use tokio::main;
+
+/// Examples
+#[main]
+async fn main() {
+ // 1. Querying for deployed Services.
+ //
+ // List all Services.
+ let services = ServiceManager::list_all_services("20").await;
+
+ // List all Services by Name and Type.
+ let services = ServiceManager::find_service_by_name_and_type("whoami", "web_service").await;
+
+ // List all Services by Region.
+ let services = ServiceManager::find_service_by_region("oregon", "10").await;
+
+ // List all Services by Environment.
+ let services = ServiceManager::find_service_by_environment("image", "10").await;
+}
+
+ Tests
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[tokio::test]
+ async fn test_list_all_services() {
+ let result = ServiceManager::list_all_services("10").await;
+ // The result should be Ok().
+ assert!(result.is_ok());
+
+ // Validate content.
+ let services = result.unwrap();
+ assert!(!services.is_empty());
+ }
+
+ #[tokio::test]
+ async fn test_find_service_by_name_and_type() {
+ let result = ServiceManager::find_service_by_name_and_type("whoami", "web_service").await;
+ // The result should be Ok().
+ assert!(result.is_ok());
+
+ // Validate content.
+ let services = result.unwrap();
+ assert!(!services.is_empty());
+ }
+
+ #[tokio::test]
+ async fn test_find_service_by_region() {
+ let result = ServiceManager::find_service_by_region("oregon", "10").await;
+ // The result should be Ok().
+ assert!(result.is_ok());
+
+ // Validate content.
+ let services = result.unwrap();
+ assert!(!services.is_empty());
+ }
+
+ #[tokio::test]
+ async fn test_find_service_by_environment() {
+ let result = ServiceManager::find_service_by_environment("image", "10").await;
+ // The result should be Ok().
+ assert!(result.is_ok());
+
+ // Validate data.
+ let services = result.unwrap();
+ assert!(!services.is_empty());
+ }
+}
+
+ Contributing
+Contributions are welcome! Please see the repository for more information on how to + contribute.
+License
+This project is licensed under the MIT License. See the LICENSE file for + details.
+Contact
+For questions, issues, or suggestions, please open an issue on the repository.
+Thank you for using `render_cdk`! We hope this documentation helps you get started quickly.
+