You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**`NodeCloud ☁️`** is a standard library to get a single API on the open cloud with multiple providers. It is a NodeJs library which comes with plugins for each cloud provider. NodeCloud's aim is to abstract away the differences between different cloud providers. It provides an easy to use API for developers in order to interact with different cloud providers.
38
38
39
39
NodeCloud will be useful to you if:
40
40
41
-
- you work on a project which uses multiple cloud providers
42
-
- you are looking for an abstract cloud API which can switch between cloud providers with fewer code changes
43
-
- you are an open-source enthusiast who is into cloud engineering or code generation
44
-
- you want to improve your skills in NodeJS, Typescript and cloud service providers
41
+
-you work on a project which uses multiple cloud providers
42
+
-you are looking for an abstract cloud API which can switch between cloud providers with fewer code changes
43
+
-you are an open-source enthusiast who is into cloud engineering or code generation
44
+
-you want to improve your skills in NodeJS, Typescript and cloud service providers
45
45
46
46
## 📘 Supported Service Providers
47
47
48
-
- Amazon Web Services (AWS)
49
-
- Azure
50
-
- Google Cloud Platform (GCP)
51
-
- DigitalOcean
52
-
- AliCloud
48
+
-Amazon Web Services (AWS)
49
+
-Azure
50
+
-Google Cloud Platform (GCP)
51
+
-DigitalOcean
52
+
-AliCloud
53
53
54
54
_📢 if your required cloud provider plugin is not listed here, we'd love your help to add it :)_
55
55
@@ -95,37 +95,37 @@ This config file can contain an array of objects for all providers and all will
ImageId:"ami-07ebfd5b3428b6f4d", // Image of Ubuntu Server 18.04 LTS
154
-
InstanceType:"t2.micro",
155
-
KeyName:"nodeCloud", // key name of Key pair
156
-
MinCount:1,
157
-
MaxCount:1
158
-
};
159
-
160
-
// create AWS EC2 instance
161
-
computeModule
162
-
.create(instanceParams)
163
-
.then(res=> {
164
-
console.log(`All done ! ${res}`);
165
-
})
166
-
.catch(err=> {
167
-
console.log(`Oops something happened ${err}`);
168
-
});
152
+
constinstanceParams= {
153
+
ImageId:'ami-07ebfd5b3428b6f4d', // Image of Ubuntu Server 18.04 LTS
154
+
InstanceType:'t2.micro',
155
+
KeyName:'nodeCloud', // key name of Key pair
156
+
MinCount:1,
157
+
MaxCount:1,
158
+
};
159
+
160
+
// create AWS EC2 instance
161
+
computeModule
162
+
.create(instanceParams)
163
+
.then(res=> {
164
+
console.log(`All done ! ${res}`);
165
+
})
166
+
.catch(err=> {
167
+
console.log(`Oops something happened ${err}`);
168
+
});
169
169
}
170
170
171
171
functionstopInstance() {
172
-
constparams= {
173
-
InstanceIds: ["i-0928af5c626f85da9"],
174
-
DryRun:false
175
-
};
176
-
177
-
// stop AWS EC2 instance
178
-
computeModule
179
-
.stop(params)
180
-
.then(res=> {
181
-
console.log(res);
182
-
})
183
-
.catch(err=> {
184
-
console.log(err);
185
-
});
172
+
constparams= {
173
+
InstanceIds: ['i-0928af5c626f85da9'],
174
+
DryRun:false,
175
+
};
176
+
177
+
// stop AWS EC2 instance
178
+
computeModule
179
+
.stop(params)
180
+
.then(res=> {
181
+
console.log(res);
182
+
})
183
+
.catch(err=> {
184
+
console.log(err);
185
+
});
186
186
}
187
187
```
188
188
@@ -191,9 +191,9 @@ function stopInstance() {
191
191
NodeCloud officially supports AWS, GCP, Azure, DigitalOcean and AliCloud. If you want to use a community-driven plugin override the providers' list as follows.
For the class-based SDKs there is a minor change in the `node-cloud.yml` to record the main class of an SDK. For the above scenario, it’s the DNS class.
84
84
85
-
- Digital Ocean
85
+
-Digital Ocean
86
86
87
87
```
88
88
DO:
@@ -106,11 +106,11 @@ These functions are located in the generators of the each cloud providers. Each
106
106
107
107
This is the most important part of the code generator tool. Currently, there are four transformers. Two transformers for Google Cloud, and one each for AWS and Azure. All of the transformers runs three main transformations.
108
108
109
-
-`addFunctions`: In this transformation the basic structure of the code is created. Method Nodes are created to the number of functions in the `classData` object. If there are imports related to the class those statments are also added to the dummy **Abstract Syntax Tree**.
109
+
-`addFunctions`: In this transformation the basic structure of the code is created. Method Nodes are created to the number of functions in the `classData` object. If there are imports related to the class those statments are also added to the dummy **Abstract Syntax Tree**.
110
110
111
-
-`addIdentifiers`: In this transformation all the Identifier nodes are updated. After this transformation the code is logically compelete. All the neccessary code parts are added and finalized such as parameter names, parameter types, client names, class name, package names, SDK function names etc.
111
+
-`addIdentifiers`: In this transformation all the Identifier nodes are updated. After this transformation the code is logically compelete. All the neccessary code parts are added and finalized such as parameter names, parameter types, client names, class name, package names, SDK function names etc.
112
112
113
-
-`addComments`: This transformation aims to auto-generate the API documentation. All the comments are added to the structure required by `JSDoc`. The `@category` is used to categorize the generated classes depending on the cloud provider. This tag is from the `better-docs` template used with `JSDoc`.
113
+
-`addComments`: This transformation aims to auto-generate the API documentation. All the comments are added to the structure required by `JSDoc`. The `@category` is used to categorize the generated classes depending on the cloud provider. This tag is from the `better-docs` template used with `JSDoc`.
114
114
115
115
## Understanding the directory structure of generator
116
116
@@ -136,4 +136,4 @@ transformer which transforms the dummy class into an working Nodecloud class for
136
136
137
137
## Running the code generation tool
138
138
139
-
- To build classes run `tsc main && node main` or 'yarn run tool' if inside generator directory and `yarn run generator` if inside nodecloud directory.
139
+
-To build classes run `tsc main && node main` or 'yarn run tool' if inside generator directory and `yarn run generator` if inside nodecloud directory.
0 commit comments