diff --git a/docs.png b/docs.png new file mode 100644 index 0000000..b40a686 Binary files /dev/null and b/docs.png differ diff --git a/docs/public/assets/css/main.css b/docs/public/assets/css/main.css new file mode 100644 index 0000000..1da5447 --- /dev/null +++ b/docs/public/assets/css/main.css @@ -0,0 +1,147 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + letter-spacing: 1px; +} + +html { + scroll-behavior: smooth; +} + +body { + font-family: "Poppins", sans-serif; + background-color: #131321; + color: #D8DEE9; + margin: 0; + display: flex; +} + +.sidebar { + background-color: #1B1B2F; + padding: 20px; + width: 300px; + box-shadow: 0 4rem 4rem 0 rgba(0, 0, 0, 0.3); +} + +.sidebar h1 { + font-size: 28px; + font-weight: 600; + background: #131321; + box-shadow: 0 1rem 4rem 0 rgba(19, 166, 211, 0.3); + border-radius: 9px; + color: #bec4c5; + padding: 1rem; + display: flex; + flex-direction: column; + gap: 2px; + text-align: right; + transition: 200ms all ease; + cursor: pointer; +} + +.sidebar h1 span { + font-size: 16px; + font-weight: 500; + color: #608b97; +} + +.sidebar h1:hover { + color: #D8DEE9; +} + +.sidebar nav { + width: 330px; + margin-top: 40px; + display: flex; + flex-direction: column; + position: fixed; +} + +.sidebar a { + width: 90%; + color: #b7bbc2; + text-decoration: none; + margin-bottom: 10px; + padding: 10px; + border-radius: 5px; + transition: background 0.1s; + border-radius: 21px; +} + +.sidebar a:hover { + background-color: #1B1B2F; + box-shadow: 0 1rem 9rem 0 rgba(0, 0, 0, 0.3); +} + +.content { + flex-grow: 1; + padding: 40px; +} + +.content section { + margin-bottom: 40px; + width: 1000px; +} + +.content h2 { + font-size: 28px; + margin-bottom: 20px; +} + +.content p { + font-size: 16px; + line-height: 1.6; +} + +.content ul { + list-style-type: disc; + padding-left: 20px; +} + +.content a { + color: #88C0D0; + text-decoration: none; +} + +.content a:hover { + text-decoration: underline; +} + +pre { + background-color: #3B4252; + padding: 20px; + border-radius: 5px; + overflow-x: auto; + opacity: .5; + transition: 200ms all ease; +} + +pre:hover { + opacity: 1; + box-shadow: 0 2rem 2rem 0 rgba(0, 0, 0, 0.3); +} + +code { + color: #a1b391; +} + +@media (max-width: 1366px) { + .sidebar { + width: 700px; + } + + .sidebar nav { + width: 328px; + } +} + +@media (max-width: 1300px) { + .sidebar { + width: 700px; + } + + .sidebar nav { + width: 280px; + } +} \ No newline at end of file diff --git a/docs/public/index.html b/docs/public/index.html new file mode 100644 index 0000000..a1c1c7e --- /dev/null +++ b/docs/public/index.html @@ -0,0 +1,169 @@ + + + + + + + Render CDK Documentation + + + + + + + + +
+
+

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

+ +
+
+

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:

+ +

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.

+
+
+ + + \ No newline at end of file diff --git a/rust/src/iaas/mod.rs b/rust/src/iaas/mod.rs new file mode 100644 index 0000000..a91a0e3 --- /dev/null +++ b/rust/src/iaas/mod.rs @@ -0,0 +1 @@ +pub mod tf_parser; \ No newline at end of file diff --git a/rust/src/iaas/tf_parser.rs b/rust/src/iaas/tf_parser.rs new file mode 100644 index 0000000..e69de29 diff --git a/rust/src/lib.rs b/rust/src/lib.rs index e6af6d2..e52f601 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1,3 +1,4 @@ pub mod environment_management; +pub mod iaas; pub mod resource_management; pub mod state;