Skip to content

Commit 944de49

Browse files
authored
Merge pull request #104 from leopardslab/generator-do
Code Generator for Digital Ocean Cloud Provider
2 parents 3eae29f + c0ad650 commit 944de49

File tree

203 files changed

+32477
-1396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+32477
-1396
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ jspm_packages
4242
# code coverage
4343
coverage
4444
# .coveralls.yml didn't see it in master branch
45+
46+

README.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
[![Mailing list : Scorelab](https://img.shields.io/badge/Mailing%20list-Scorelab-blue.svg)](https://groups.google.com/g/score-community)
1818
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-ff69b4.svg?style=flat)](https://github.com/leopardslab/nodecloud/issues)
1919

20-
Table of Content
20+
Table of Content
2121

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

7272
### NodeCloud Plugins
7373

74-
| Plugin | Installation |
75-
| -------------------- | --------------------------------------------------------------------------------- |
76-
| AWS plugin | `yarn add @nodecloud/aws-plugin` or `npm i @nodecloud/aws-plugin` |
77-
| Azure plugin | `yarn add @nodecloud/gcp-plugin` or `npm i @nodecloud/gcp-plugin` |
78-
| Google Cloud plugin | `yarn add @nodecloud/azure-plugin` or `npm i @nodecloud/azure-plugin` |
79-
| Alibaba plugin | `yarn add nodecloud-ali-plugin` or `npm i nodecloud-ali-plugin` |
80-
| Digital Ocean plugin | `yarn add nodecloud-digitalocean-plugin` or `npm i nodecloud-digitalocean-plugin` |
74+
| Plugin | Installation |
75+
| -------------------- | --------------------------------------------------------------------- |
76+
| AWS plugin | `yarn add @nodecloud/aws-plugin` or `npm i @nodecloud/aws-plugin` |
77+
| Azure plugin | `yarn add @nodecloud/gcp-plugin` or `npm i @nodecloud/gcp-plugin` |
78+
| Google Cloud plugin | `yarn add @nodecloud/azure-plugin` or `npm i @nodecloud/azure-plugin` | |
79+
| Digital Ocean plugin | `yarn add @nodecloud/do-plugin` or `npm i @nodecloud/do-plugin` |
80+
| Alibaba plugin | `yarn add nodecloud-ali-plugin` or `npm i nodecloud-ali-plugin` |
8181

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

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

102103
const providers = [
103104
{
104105
name: "aws",
105106
tag: "aws",
106107
plugin: nodeCloudAwsPlugin,
107-
configPath: "C:\\Users\\Rajitha\\opensource\\aws_cred.json",
108+
configPath: "C:\\Users\\Rajitha\\opensource\\aws_cred.json"
108109
},
109110
{
110111
name: "google",
111112
tag: "google",
112113
plugin: nodeCloudGcpPlugin,
113114
configPath: {
114115
projectId: "astral-hold-276807",
115-
keyFilename: "C:\\Users\\Rajitha\\opensource\\gcp_cred.json",
116-
},
116+
keyFilename: "C:\\Users\\Rajitha\\opensource\\gcp_cred.json"
117+
}
117118
},
118119
{
119120
name: "azure",
120121
tag: "azure",
121-
plugin: nodeCloudAzurePlugin,
122+
plugin: nodeCloudAzurePlugin
122123
},
124+
{
125+
name: "digitalocean",
126+
tag: "do",
127+
plugin: nodeCloudDoPlugin
128+
}
123129
];
124130
module.exports = providers;
125131
```
@@ -133,11 +139,11 @@ The below code is an example of usage in AWS.
133139
```js
134140
const nc = require("@nodecloud/common"); // NodeCloud common module
135141
const optionsProvider = {
136-
overrideProviders: false,
142+
overrideProviders: false
137143
};
138144
const ncProviders = nc.getProviders(optionsProvider);
139145
const options = {
140-
apiVersion: "2017-11-01",
146+
apiVersion: "2017-11-01"
141147
};
142148

143149
const computeModule = ncProviders.aws.compute(options);
@@ -148,33 +154,33 @@ function launchInstance() {
148154
InstanceType: "t2.micro",
149155
KeyName: "nodeCloud", // key name of Key pair
150156
MinCount: 1,
151-
MaxCount: 1,
157+
MaxCount: 1
152158
};
153159

154160
// create AWS EC2 instance
155161
computeModule
156162
.create(instanceParams)
157-
.then((res) => {
163+
.then(res => {
158164
console.log(`All done ! ${res}`);
159165
})
160-
.catch((err) => {
166+
.catch(err => {
161167
console.log(`Oops something happened ${err}`);
162168
});
163169
}
164170

165171
function stopInstance() {
166172
const params = {
167173
InstanceIds: ["i-0928af5c626f85da9"],
168-
DryRun: false,
174+
DryRun: false
169175
};
170176

171177
// stop AWS EC2 instance
172178
computeModule
173179
.stop(params)
174-
.then((res) => {
180+
.then(res => {
175181
console.log(res);
176182
})
177-
.catch((err) => {
183+
.catch(err => {
178184
console.log(err);
179185
});
180186
}
@@ -187,7 +193,7 @@ NodeCloud officially supports AWS, GCP, Azure, DigitalOcean and AliCloud. If you
187193
```js
188194
const nodeCloud = require("nodecloud");
189195
const options = {
190-
overrideProviders: true,
196+
overrideProviders: true
191197
};
192198
const ncProviders = nodeCloud.getProviders(options);
193199
```
@@ -198,18 +204,19 @@ const ncProviders = nodeCloud.getProviders(options);
198204
| ----------------------- | ----------------------------------- | :-----------------------------------: | :-------------------------------: | :---------------------------------------------------------------------: | :---------------------------------------: | :---------------------------------------------------: |
199205
| Compute | IaaS | EC2 | Compute Engine | Virtual Machine | Droplets | ECS |
200206
| | Faas | AWS Lambda\* | Cloud Functions\* | Azure Functions\* | - | Function Compute\* |
201-
| | Containers | ECS, EKS | Google Kubernetes Engine | AKS, Azure Service Fabric\* | DO Kubernetes\* | Container Service*, Container Service for Kubernetes* |
207+
| | Containers | ECS, EKS | Google Kubernetes Engine | AKS, Azure Service Fabric\* | DO Kubernetes | Container Service*, Container Service for Kubernetes* |
202208
| | Containers (without infrastructure) | AWS Fargate\* | Cloud Run\* | - | - | ECI\* |
203209
| | Paas | AWS Elastic Beanstalk | App Engine\* | App Service | - | Simple Application Server\* |
204210
| Storage | Object Storage | S3 | Cloud Storage | Azure Blob Storage | Spaces\* | Bucket (OSS) |
205211
| | Block Storage | EBS | Persistent Disks | Disk Storage | Volumes | NAS\* |
206212
| Networking | Load Balancer | ELB | Cloud Load Balancing\* | Azure Load Balancer | DO Load Balancer | SLB |
207213
| | Peering/Dedicated Interconnect | Direct Connect | Cloud Interconnect\* | ExpressRoute\* | - | Express Connect\* |
208-
| | DNS | Route53 | Google Domains, Cloud DNS | Azure DNS | DO DNS\* | Alibaba Cloud DNS\* |
209-
| 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) |
214+
| | DNS | Route53 | Google Domains, Cloud DNS | Azure DNS | DO DNS | Alibaba Cloud DNS\* |
215+
| 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) |
210216
| | NoSQL: key-value | DynamoDB | Cloud Firestore, Cloud Bigtable\* | Table Storage | Managed Databases(Redis)\* | ApsaraDB for Redis\* |
211217
| | NoSQL: indexed | Amazon SimpleDB\* | Cloud Firestore | Cosmos DB | - | ApsaraDB for MongoDB\* |
212218
| Security/ Authorization | Identity Access Management | AWS IAM | Cloud IAM\* | Azure Active Directory*, Azure Role Based Access Control* | - | Resource Access Management\* |
219+
| Management | Key Management | AWS-KMS | - | - | Do-Keys | - |
213220

214221
\*yet to be implemented
215222

212 KB
Loading
11.3 MB
Loading
36.4 MB
Loading
1.55 MB
Loading

docs/AWS_ArchivalStorage.html

Lines changed: 54 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,20 @@ <h3>Classes</h3>
119119
</li>
120120
</ul>
121121
</div>
122+
<div class="category">
123+
<h2>Digital Ocean</h2>
124+
<h3>Classes</h3>
125+
<ul>
126+
<li><a href="DO_BlockStorage.html">DO_BlockStorage</a></li>
127+
<li><a href="DO_ComputeInstance.html">DO_ComputeInstance</a></li>
128+
<li><a href="DO_DNS.html">DO_DNS</a></li>
129+
<li><a href="DO_KeyManagement.html">DO_KeyManagement</a></li>
130+
<li><a href="DO_Kubernetes.html">DO_Kubernetes</a></li>
131+
<li><a href="DO_LoadBalancer.html">DO_LoadBalancer</a></li>
132+
<li><a href="DO_NoSql.html">DO_NoSql</a></li>
133+
<li><a href="DO_RDBMS.html">DO_RDBMS</a></li>
134+
</ul>
135+
</div>
122136
<div class="category">
123137
<h2>Google Cloud</h2>
124138
<h3>Classes</h3>
@@ -222,15 +236,16 @@ <h5>Parameters:</h5>
222236
<dl class="details">
223237
<p class="tag-source">
224238
<a
225-
href="AWS_aws-archivalStorage.js.html"
239+
href="AWS_storage_aws-archivalStorage.js.html"
226240
class="button"
227241
>View Source</a
228242
>
229243
<span>
230-
<a href="AWS_aws-archivalStorage.js.html"
231-
>AWS/aws-archivalStorage.js</a
244+
<a href="AWS_storage_aws-archivalStorage.js.html"
245+
>AWS/storage/aws-archivalStorage.js</a
232246
>,
233-
<a href="AWS_aws-archivalStorage.js.html#line12"
247+
<a
248+
href="AWS_storage_aws-archivalStorage.js.html#line12"
234249
>line 12</a
235250
>
236251
</span>
@@ -292,14 +307,17 @@ <h5>Parameters:</h5>
292307

293308
<dl class="details">
294309
<p class="tag-source">
295-
<a href="AWS_aws-archivalStorage.js.html" class="button"
310+
<a
311+
href="AWS_storage_aws-archivalStorage.js.html"
312+
class="button"
296313
>View Source</a
297314
>
298315
<span>
299-
<a href="AWS_aws-archivalStorage.js.html"
300-
>AWS/aws-archivalStorage.js</a
316+
<a href="AWS_storage_aws-archivalStorage.js.html"
317+
>AWS/storage/aws-archivalStorage.js</a
301318
>,
302-
<a href="AWS_aws-archivalStorage.js.html#line24"
319+
<a
320+
href="AWS_storage_aws-archivalStorage.js.html#line24"
303321
>line 24</a
304322
>
305323
</span>
@@ -370,14 +388,17 @@ <h5>Parameters:</h5>
370388

371389
<dl class="details">
372390
<p class="tag-source">
373-
<a href="AWS_aws-archivalStorage.js.html" class="button"
391+
<a
392+
href="AWS_storage_aws-archivalStorage.js.html"
393+
class="button"
374394
>View Source</a
375395
>
376396
<span>
377-
<a href="AWS_aws-archivalStorage.js.html"
378-
>AWS/aws-archivalStorage.js</a
397+
<a href="AWS_storage_aws-archivalStorage.js.html"
398+
>AWS/storage/aws-archivalStorage.js</a
379399
>,
380-
<a href="AWS_aws-archivalStorage.js.html#line56"
400+
<a
401+
href="AWS_storage_aws-archivalStorage.js.html#line56"
381402
>line 56</a
382403
>
383404
</span>
@@ -448,14 +469,17 @@ <h5>Parameters:</h5>
448469

449470
<dl class="details">
450471
<p class="tag-source">
451-
<a href="AWS_aws-archivalStorage.js.html" class="button"
472+
<a
473+
href="AWS_storage_aws-archivalStorage.js.html"
474+
class="button"
452475
>View Source</a
453476
>
454477
<span>
455-
<a href="AWS_aws-archivalStorage.js.html"
456-
>AWS/aws-archivalStorage.js</a
478+
<a href="AWS_storage_aws-archivalStorage.js.html"
479+
>AWS/storage/aws-archivalStorage.js</a
457480
>,
458-
<a href="AWS_aws-archivalStorage.js.html#line40"
481+
<a
482+
href="AWS_storage_aws-archivalStorage.js.html#line40"
459483
>line 40</a
460484
>
461485
</span>
@@ -526,14 +550,17 @@ <h5>Parameters:</h5>
526550

527551
<dl class="details">
528552
<p class="tag-source">
529-
<a href="AWS_aws-archivalStorage.js.html" class="button"
553+
<a
554+
href="AWS_storage_aws-archivalStorage.js.html"
555+
class="button"
530556
>View Source</a
531557
>
532558
<span>
533-
<a href="AWS_aws-archivalStorage.js.html"
534-
>AWS/aws-archivalStorage.js</a
559+
<a href="AWS_storage_aws-archivalStorage.js.html"
560+
>AWS/storage/aws-archivalStorage.js</a
535561
>,
536-
<a href="AWS_aws-archivalStorage.js.html#line88"
562+
<a
563+
href="AWS_storage_aws-archivalStorage.js.html#line88"
537564
>line 88</a
538565
>
539566
</span>
@@ -609,14 +636,17 @@ <h5>Parameters:</h5>
609636

610637
<dl class="details">
611638
<p class="tag-source">
612-
<a href="AWS_aws-archivalStorage.js.html" class="button"
639+
<a
640+
href="AWS_storage_aws-archivalStorage.js.html"
641+
class="button"
613642
>View Source</a
614643
>
615644
<span>
616-
<a href="AWS_aws-archivalStorage.js.html"
617-
>AWS/aws-archivalStorage.js</a
645+
<a href="AWS_storage_aws-archivalStorage.js.html"
646+
>AWS/storage/aws-archivalStorage.js</a
618647
>,
619-
<a href="AWS_aws-archivalStorage.js.html#line72"
648+
<a
649+
href="AWS_storage_aws-archivalStorage.js.html#line72"
620650
>line 72</a
621651
>
622652
</span>

0 commit comments

Comments
 (0)