Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d826b39
chore: update formatter conf and apply formatter
pranjalwalia Jul 6, 2022
0d172c8
chore: update nodecloud conf
pranjalwalia Jul 6, 2022
6e40593
feat: add SDK in workspace generator
pranjalwalia Jul 6, 2022
260bd55
feat: add parser for service aliyun
pranjalwalia Jul 6, 2022
0e6e998
feat: update parser consumption
pranjalwalia Jul 6, 2022
83d0048
tests: add tests for the aliyun parser
pranjalwalia Jul 6, 2022
11fa9bc
chore: update main file
pranjalwalia Jul 6, 2022
eed5587
chore: update formatter spacing and apply
pranjalwalia Jul 9, 2022
0030f25
Merge pull request #137 from masterchief01/formatter-commit
rajitha1998 Jul 16, 2022
5c80a22
Merge branch 'generator-ali' of github.com:masterchief01/nodecloud in…
pranjalwalia Jul 16, 2022
150374c
chore: run formatter on remaining files
pranjalwalia Jul 16, 2022
afaa449
chore: addition of transformations to generator
pranjalwalia Jul 16, 2022
856345b
chore: removal of redundant identifiers
pranjalwalia Jul 16, 2022
cb492ea
chore: update tests transformer with dummy class
pranjalwalia Jul 16, 2022
a9f6de8
chore: update annotation for ali class dummyFile
pranjalwalia Jul 22, 2022
20382ea
chore: generate transpiled output, format tests
pranjalwalia Jul 22, 2022
097ed8c
Merge pull request #138 from masterchief01/aliyun-parser
rajitha1998 Jul 23, 2022
f24d975
Merge branch 'generator-ali' of github.com:masterchief01/nodecloud in…
pranjalwalia Jul 29, 2022
cacfa2f
Merge pull request #139 from masterchief01/aliyun-transformer
rajitha1998 Aug 4, 2022
b302e56
feat: add nodecloud plugin starter for alicloud
pranjalwalia Aug 12, 2022
7830745
chore: update env credential checks
pranjalwalia Aug 12, 2022
a41c193
Merge pull request #140 from masterchief01/package-workspace
rajitha1998 Aug 20, 2022
14a45ea
feat: update ali-cloud plugin
pranjalwalia Aug 29, 2022
16d411b
docs: update docs for nodecloud and generator
pranjalwalia Sep 3, 2022
ab516eb
feat: add plugin usage examples
pranjalwalia Sep 3, 2022
bfac1b1
Merge pull request #141 from masterchief01/package-services
rajitha1998 Sep 8, 2022
fd66534
Merge pull request #143 from masterchief01/generator-docs
rajitha1998 Sep 8, 2022
6f7a8ac
Merge pull request #144 from masterchief01/plugin-usage
rajitha1998 Sep 8, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
dist
*.js
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
dist
coverage
generator/**/*.yml
*.yml
12 changes: 6 additions & 6 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"tabWidth": 4,
"singleQuote": true,
"printWidth": 80,
"useTabs": true,
"trailingComma": "es5"
{
"tabWidth": 2,
"singleQuote": true,
"printWidth": 80,
"useTabs": false,
"trailingComma": "es5"
}
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ 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 nodeCloudAliPlugin = require("@nodecloud/ali-plugin");

const providers = [
{
Expand All @@ -125,8 +126,14 @@ const providers = [
name: "digitalocean",
tag: "do",
plugin: nodeCloudDoPlugin
}
},
{
name: "alicloud",
tag: "alicloud",
plugin: aliplugin,
},
];

module.exports = providers;
```

Expand Down Expand Up @@ -205,7 +212,7 @@ 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 (without infrastructure) | AWS Fargate\* | Cloud Run\* | - | - | ECI\* |
| | 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\* |
Expand All @@ -214,7 +221,7 @@ const ncProviders = nodeCloud.getProviders(options);
| | 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\* |
| | 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 | - |

Expand Down
Binary file added assets/generator/high_level_diagrams/ali.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.
51 changes: 51 additions & 0 deletions examples/compute/ali-eci.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const nodeCloud = require('../../lib/');
const optionsProvider = {
overrideProviders: false,
};
const ncProviders = nodeCloud.getProviders(optionsProvider);

// get containerInstance object for AliCloud
const containers = ncProviders.alicloud.containerInstance();

async function createContainerGroup() {
const instanceParams = {
regionId: 'cn-hangzhou',
containerGroupName: 'test-group-1',
container: [
{
command: ['/bin/sh', '-c', 'echo 1'],
cpu: 1,
memory: 512,
image: 'ubuntu',
name: 'test-container-1',
},
],
};
try {
const res = await containers.create(instanceParams);
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function listContainerGroup() {
try {
const res = await containers.list({ regionId: 'cn-hangzhou' });
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function deleteContainerGroup() {
try {
const res = await containers.delete({
regionId: 'cn-hangzhou',
containerGroupId: 'eci-bp1ikor0s871wa5pahke',
});
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}
58 changes: 58 additions & 0 deletions examples/compute/ali-ecs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
const nodeCloud = require('../../lib/');
const optionsProvider = {
overrideProviders: false,
};
const ncProviders = nodeCloud.getProviders(optionsProvider);

// get compute object for AliCloud
const compute = ncProviders.alicloud.computeInstance();

async function createInstance() {
const instanceParams = {
regionId: 'cn-hongkong',
imageId: 'ubuntu_20_04_x64_20G_alibase_20220215.vhd',
instanceType: 'ecs.n4.large',
};
try {
const res = await compute.create(instanceParams);
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function listInstances() {
try {
const res = await compute.list({ regionId: 'cn-hongkong' });
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function destroyInstance() {
try {
const res = await compute.destroy({ instanceId: 'i-2zmq8q8' });
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function describeInstanceTypes() {
try {
const res = await compute.listInstanceTypes({ maxResults: 10 });
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function describeImageTypes() {
try {
const res = await compute.describeImages({ regionId: 'cn-hongkong' });
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}
55 changes: 55 additions & 0 deletions examples/database/ali-nosql.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const nodeCloud = require('../../lib/');
const optionsProvider = {
overrideProviders: false,
};
const ncProviders = nodeCloud.getProviders(optionsProvider);

// get containerInstance object for AliCloud
const nosql = ncProviders.alicloud.nosql();

async function createInstance() {
const instanceParams = {
regionId: 'ap-southeast-1',
engine: 'MongoDB',
engineVersion: '4.2',
DBInstanceClass: 'dds.mongo.standard',
DBInstanceStorage: 10, // GB
};
try {
const res = await nosql.createInstance(instanceParams);
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function deleteInstance() {
try {
const res = await nosql.deleteInstance({
DBInstanceId: 'dds-gs58537d0d9724c4',
});
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function listInstances() {
try {
const res = await nosql.listInstances({});
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function describeInstance() {
try {
const res = await nosql.describeInstance({
DBInstanceId: 'dds-gs5581f86ac37b14',
});
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}
48 changes: 48 additions & 0 deletions examples/database/ali-rdbms.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
const nodeCloud = require('../../lib/');
const optionsProvider = {
overrideProviders: false,
};
const ncProviders = nodeCloud.getProviders(optionsProvider);

// get containerInstance object for AliCloud
const rdbms = ncProviders.alicloud.rdbms();

async function createInstance() {
const instanceParams = {
DBInstanceClass: 'rds.mysql.t1.small',
regionId: 'ap-southeast-1',
engine: 'MySQL',
engineVersion: '5.6',
DBInstanceStorage: 10,
DBInstanceNetType: 'Intranet',
securityIPList: '0.0.0.0/0',
payType: 'Postpaid',
DBInstanceStorageType: 'local_ssd',
};
try {
const res = await rdbms.createInstance(instanceParams);
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function deleteInstance() {
try {
const res = await rdbms.deleteInstance({
DBInstanceId: 'rm-1udg1v5w25c8gmpx3',
});
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function listInstances() {
try {
const res = await rdbms.listInstances({ regionId: 'ap-southeast-1' });
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}
53 changes: 53 additions & 0 deletions examples/network/ali-slb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const nodeCloud = require('../../lib/');
const optionsProvider = {
overrideProviders: false,
};
const ncProviders = nodeCloud.getProviders(optionsProvider);

// get containerInstance object for AliCloud
const loadbalancer = ncProviders.alicloud.loadbalancer();

async function createInstance() {
try {
const res = await loadbalancer.create(
'cn-hangzhou',
'test-slb',
'slb.s1.small',
{}
);
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function deleteInstance() {
try {
const res = await loadbalancer.delete('lb-1udjouk9sqkq5lvke5cd6', {});
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function listInstances() {
try {
const res = await loadbalancer.list('cn-hangzhou', {});
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}

async function describeInstances() {
try {
const res = await loadbalancer.describe(
'cn-hangzhou',
'lb-1udjouk9sqkq5lvke5cd6',
{}
);
console.log('All done! ', res);
} catch (err) {
console.log(`Oops something happened ${err}`);
}
}
Loading