Skip to content

Commit

Permalink
Merge pull request #104 from leopardslab/generator-do
Browse files Browse the repository at this point in the history
Code Generator for Digital Ocean Cloud Provider
  • Loading branch information
rehrumesh authored Aug 19, 2021
2 parents 3eae29f + c0ad650 commit 944de49
Show file tree
Hide file tree
Showing 203 changed files with 32,477 additions and 1,396 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ jspm_packages
# code coverage
coverage
# .coveralls.yml didn't see it in master branch


57 changes: 32 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
[![Mailing list : Scorelab](https://img.shields.io/badge/Mailing%20list-Scorelab-blue.svg)](https://groups.google.com/g/score-community)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-ff69b4.svg?style=flat)](https://github.com/leopardslab/nodecloud/issues)

Table of Content
Table of Content

- [Introduction](#introduction)
- [Introduction](#introduction)
- [Supported Service Providers](#-supported-service-providers)
- [Getting Started](#getting-started)
- [NodeCloud Plugins](#nodecloud-plugins)
Expand Down Expand Up @@ -71,13 +71,13 @@ Once `@nodecloud/common` is installed, you need to install the plugins to intera

### NodeCloud Plugins

| Plugin | Installation |
| -------------------- | --------------------------------------------------------------------------------- |
| AWS plugin | `yarn add @nodecloud/aws-plugin` or `npm i @nodecloud/aws-plugin` |
| Azure plugin | `yarn add @nodecloud/gcp-plugin` or `npm i @nodecloud/gcp-plugin` |
| Google Cloud plugin | `yarn add @nodecloud/azure-plugin` or `npm i @nodecloud/azure-plugin` |
| Alibaba plugin | `yarn add nodecloud-ali-plugin` or `npm i nodecloud-ali-plugin` |
| Digital Ocean plugin | `yarn add nodecloud-digitalocean-plugin` or `npm i nodecloud-digitalocean-plugin` |
| Plugin | Installation |
| -------------------- | --------------------------------------------------------------------- |
| AWS plugin | `yarn add @nodecloud/aws-plugin` or `npm i @nodecloud/aws-plugin` |
| Azure plugin | `yarn add @nodecloud/gcp-plugin` or `npm i @nodecloud/gcp-plugin` |
| Google Cloud plugin | `yarn add @nodecloud/azure-plugin` or `npm i @nodecloud/azure-plugin` | |
| Digital Ocean plugin | `yarn add @nodecloud/do-plugin` or `npm i @nodecloud/do-plugin` |
| Alibaba plugin | `yarn add nodecloud-ali-plugin` or `npm i nodecloud-ali-plugin` |

**3️⃣ Create the NodeCloud config file**

Expand All @@ -98,28 +98,34 @@ This config file can contain an array of objects for all providers and all will
const nodeCloudAwsPlugin = require("@nodecloud/aws-plugin");
const nodeCloudGcpPlugin = require("@nodecloud/gcp-plugin");
const nodeCloudAzurePlugin = require("@nodecloud/azure-plugin");
const nodeCloudDoPlugin = require("@nodecloud/do-plugin");

const providers = [
{
name: "aws",
tag: "aws",
plugin: nodeCloudAwsPlugin,
configPath: "C:\\Users\\Rajitha\\opensource\\aws_cred.json",
configPath: "C:\\Users\\Rajitha\\opensource\\aws_cred.json"
},
{
name: "google",
tag: "google",
plugin: nodeCloudGcpPlugin,
configPath: {
projectId: "astral-hold-276807",
keyFilename: "C:\\Users\\Rajitha\\opensource\\gcp_cred.json",
},
keyFilename: "C:\\Users\\Rajitha\\opensource\\gcp_cred.json"
}
},
{
name: "azure",
tag: "azure",
plugin: nodeCloudAzurePlugin,
plugin: nodeCloudAzurePlugin
},
{
name: "digitalocean",
tag: "do",
plugin: nodeCloudDoPlugin
}
];
module.exports = providers;
```
Expand All @@ -133,11 +139,11 @@ The below code is an example of usage in AWS.
```js
const nc = require("@nodecloud/common"); // NodeCloud common module
const optionsProvider = {
overrideProviders: false,
overrideProviders: false
};
const ncProviders = nc.getProviders(optionsProvider);
const options = {
apiVersion: "2017-11-01",
apiVersion: "2017-11-01"
};

const computeModule = ncProviders.aws.compute(options);
Expand All @@ -148,33 +154,33 @@ function launchInstance() {
InstanceType: "t2.micro",
KeyName: "nodeCloud", // key name of Key pair
MinCount: 1,
MaxCount: 1,
MaxCount: 1
};

// create AWS EC2 instance
computeModule
.create(instanceParams)
.then((res) => {
.then(res => {
console.log(`All done ! ${res}`);
})
.catch((err) => {
.catch(err => {
console.log(`Oops something happened ${err}`);
});
}

function stopInstance() {
const params = {
InstanceIds: ["i-0928af5c626f85da9"],
DryRun: false,
DryRun: false
};

// stop AWS EC2 instance
computeModule
.stop(params)
.then((res) => {
.then(res => {
console.log(res);
})
.catch((err) => {
.catch(err => {
console.log(err);
});
}
Expand All @@ -187,7 +193,7 @@ NodeCloud officially supports AWS, GCP, Azure, DigitalOcean and AliCloud. If you
```js
const nodeCloud = require("nodecloud");
const options = {
overrideProviders: true,
overrideProviders: true
};
const ncProviders = nodeCloud.getProviders(options);
```
Expand All @@ -198,18 +204,19 @@ const ncProviders = nodeCloud.getProviders(options);
| ----------------------- | ----------------------------------- | :-----------------------------------: | :-------------------------------: | :---------------------------------------------------------------------: | :---------------------------------------: | :---------------------------------------------------: |
| Compute | IaaS | EC2 | Compute Engine | Virtual Machine | Droplets | ECS |
| | Faas | AWS Lambda\* | Cloud Functions\* | Azure Functions\* | - | Function Compute\* |
| | Containers | ECS, EKS | Google Kubernetes Engine | AKS, Azure Service Fabric\* | DO Kubernetes\* | Container Service*, Container Service for Kubernetes* |
| | Containers | ECS, EKS | Google Kubernetes Engine | AKS, Azure Service Fabric\* | DO Kubernetes | Container Service*, Container Service for Kubernetes* |
| | Containers (without infrastructure) | AWS Fargate\* | Cloud Run\* | - | - | ECI\* |
| | Paas | AWS Elastic Beanstalk | App Engine\* | App Service | - | Simple Application Server\* |
| Storage | Object Storage | S3 | Cloud Storage | Azure Blob Storage | Spaces\* | Bucket (OSS) |
| | Block Storage | EBS | Persistent Disks | Disk Storage | Volumes | NAS\* |
| Networking | Load Balancer | ELB | Cloud Load Balancing\* | Azure Load Balancer | DO Load Balancer | SLB |
| | Peering/Dedicated Interconnect | Direct Connect | Cloud Interconnect\* | ExpressRoute\* | - | Express Connect\* |
| | DNS | Route53 | Google Domains, Cloud DNS | Azure DNS | DO DNS\* | Alibaba Cloud DNS\* |
| Databases | RDBMS | RDS, Amazon Aurora*, Amazon Redshift* | Cloud SQL\*, Cloud Spanner | SQL Database, Azure Database for MySQL*, Azure Database for PostgreSQL* | Managed Databases(PostgreSQL* and MySQL*) | ApsaraDB (MySQL, MariaDB TX, SQL Server, PostgreSQL) |
| | DNS | Route53 | Google Domains, Cloud DNS | Azure DNS | DO DNS | Alibaba Cloud DNS\* |
| Databases | RDBMS | RDS, Amazon Aurora*, Amazon Redshift* | Cloud SQL\*, Cloud Spanner | SQL Database, Azure Database for MySQL*, Azure Database for PostgreSQL* | Managed Databases(PostgreSQL\* and MySQL) | ApsaraDB (MySQL, MariaDB TX, SQL Server, PostgreSQL) |
| | NoSQL: key-value | DynamoDB | Cloud Firestore, Cloud Bigtable\* | Table Storage | Managed Databases(Redis)\* | ApsaraDB for Redis\* |
| | NoSQL: indexed | Amazon SimpleDB\* | Cloud Firestore | Cosmos DB | - | ApsaraDB for MongoDB\* |
| Security/ Authorization | Identity Access Management | AWS IAM | Cloud IAM\* | Azure Active Directory*, Azure Role Based Access Control* | - | Resource Access Management\* |
| Management | Key Management | AWS-KMS | - | - | Do-Keys | - |

\*yet to be implemented

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/generator/high_level_diagrams/do.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 54 additions & 24 deletions docs/AWS_ArchivalStorage.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@ <h3>Classes</h3>
</li>
</ul>
</div>
<div class="category">
<h2>Digital Ocean</h2>
<h3>Classes</h3>
<ul>
<li><a href="DO_BlockStorage.html">DO_BlockStorage</a></li>
<li><a href="DO_ComputeInstance.html">DO_ComputeInstance</a></li>
<li><a href="DO_DNS.html">DO_DNS</a></li>
<li><a href="DO_KeyManagement.html">DO_KeyManagement</a></li>
<li><a href="DO_Kubernetes.html">DO_Kubernetes</a></li>
<li><a href="DO_LoadBalancer.html">DO_LoadBalancer</a></li>
<li><a href="DO_NoSql.html">DO_NoSql</a></li>
<li><a href="DO_RDBMS.html">DO_RDBMS</a></li>
</ul>
</div>
<div class="category">
<h2>Google Cloud</h2>
<h3>Classes</h3>
Expand Down Expand Up @@ -222,15 +236,16 @@ <h5>Parameters:</h5>
<dl class="details">
<p class="tag-source">
<a
href="AWS_aws-archivalStorage.js.html"
href="AWS_storage_aws-archivalStorage.js.html"
class="button"
>View Source</a
>
<span>
<a href="AWS_aws-archivalStorage.js.html"
>AWS/aws-archivalStorage.js</a
<a href="AWS_storage_aws-archivalStorage.js.html"
>AWS/storage/aws-archivalStorage.js</a
>,
<a href="AWS_aws-archivalStorage.js.html#line12"
<a
href="AWS_storage_aws-archivalStorage.js.html#line12"
>line 12</a
>
</span>
Expand Down Expand Up @@ -292,14 +307,17 @@ <h5>Parameters:</h5>

<dl class="details">
<p class="tag-source">
<a href="AWS_aws-archivalStorage.js.html" class="button"
<a
href="AWS_storage_aws-archivalStorage.js.html"
class="button"
>View Source</a
>
<span>
<a href="AWS_aws-archivalStorage.js.html"
>AWS/aws-archivalStorage.js</a
<a href="AWS_storage_aws-archivalStorage.js.html"
>AWS/storage/aws-archivalStorage.js</a
>,
<a href="AWS_aws-archivalStorage.js.html#line24"
<a
href="AWS_storage_aws-archivalStorage.js.html#line24"
>line 24</a
>
</span>
Expand Down Expand Up @@ -370,14 +388,17 @@ <h5>Parameters:</h5>

<dl class="details">
<p class="tag-source">
<a href="AWS_aws-archivalStorage.js.html" class="button"
<a
href="AWS_storage_aws-archivalStorage.js.html"
class="button"
>View Source</a
>
<span>
<a href="AWS_aws-archivalStorage.js.html"
>AWS/aws-archivalStorage.js</a
<a href="AWS_storage_aws-archivalStorage.js.html"
>AWS/storage/aws-archivalStorage.js</a
>,
<a href="AWS_aws-archivalStorage.js.html#line56"
<a
href="AWS_storage_aws-archivalStorage.js.html#line56"
>line 56</a
>
</span>
Expand Down Expand Up @@ -448,14 +469,17 @@ <h5>Parameters:</h5>

<dl class="details">
<p class="tag-source">
<a href="AWS_aws-archivalStorage.js.html" class="button"
<a
href="AWS_storage_aws-archivalStorage.js.html"
class="button"
>View Source</a
>
<span>
<a href="AWS_aws-archivalStorage.js.html"
>AWS/aws-archivalStorage.js</a
<a href="AWS_storage_aws-archivalStorage.js.html"
>AWS/storage/aws-archivalStorage.js</a
>,
<a href="AWS_aws-archivalStorage.js.html#line40"
<a
href="AWS_storage_aws-archivalStorage.js.html#line40"
>line 40</a
>
</span>
Expand Down Expand Up @@ -526,14 +550,17 @@ <h5>Parameters:</h5>

<dl class="details">
<p class="tag-source">
<a href="AWS_aws-archivalStorage.js.html" class="button"
<a
href="AWS_storage_aws-archivalStorage.js.html"
class="button"
>View Source</a
>
<span>
<a href="AWS_aws-archivalStorage.js.html"
>AWS/aws-archivalStorage.js</a
<a href="AWS_storage_aws-archivalStorage.js.html"
>AWS/storage/aws-archivalStorage.js</a
>,
<a href="AWS_aws-archivalStorage.js.html#line88"
<a
href="AWS_storage_aws-archivalStorage.js.html#line88"
>line 88</a
>
</span>
Expand Down Expand Up @@ -609,14 +636,17 @@ <h5>Parameters:</h5>

<dl class="details">
<p class="tag-source">
<a href="AWS_aws-archivalStorage.js.html" class="button"
<a
href="AWS_storage_aws-archivalStorage.js.html"
class="button"
>View Source</a
>
<span>
<a href="AWS_aws-archivalStorage.js.html"
>AWS/aws-archivalStorage.js</a
<a href="AWS_storage_aws-archivalStorage.js.html"
>AWS/storage/aws-archivalStorage.js</a
>,
<a href="AWS_aws-archivalStorage.js.html#line72"
<a
href="AWS_storage_aws-archivalStorage.js.html#line72"
>line 72</a
>
</span>
Expand Down
Loading

0 comments on commit 944de49

Please sign in to comment.