From 8b9d8e4a3ba061e245d7b77a02bd2dceca23fb82 Mon Sep 17 00:00:00 2001 From: mlabouardy Date: Thu, 25 Jul 2019 12:47:19 +0200 Subject: [PATCH] added support of digitalocean --- .circleci/config.yml | 6 +- Dockerfile | 2 +- Godeps/Godeps.json | 10 + README.md | 33 +- dashboard/src/app/app.component.html | 2 +- dashboard/src/app/app.component.ts | 22 +- dashboard/src/app/app.module.ts | 14 +- .../src/app/compute/compute.component.html | 2 + .../digitalocean/digitalocean.component.css | 24 + .../digitalocean/digitalocean.component.html | 224 ++++++ .../digitalocean.component.spec.ts | 25 + .../digitalocean/digitalocean.component.ts | 263 +++++++ .../app/dashboard/dashboard.component.html | 1 + .../digitalocean/digitalocean.component.css | 0 .../digitalocean/digitalocean.component.html | 61 ++ .../digitalocean.component.spec.ts | 25 + .../digitalocean/digitalocean.component.ts | 192 +++++ .../src/app/digitalocean.service.spec.ts | 15 + dashboard/src/app/digitalocean.service.ts | 252 +++++++ .../digitalocean/digitalocean.component.css | 12 + .../digitalocean/digitalocean.component.html | 127 ++++ .../digitalocean.component.spec.ts | 25 + .../digitalocean/digitalocean.component.ts | 105 +++ .../src/app/network/network.component.html | 2 + .../digitalocean/digitalocean.component.css | 53 ++ .../digitalocean/digitalocean.component.html | 158 +++++ .../digitalocean.component.spec.ts | 25 + .../digitalocean/digitalocean.component.ts | 142 ++++ .../src/app/security/security.component.html | 2 + .../digitalocean/digitalocean.component.css | 16 + .../digitalocean/digitalocean.component.html | 144 ++++ .../digitalocean.component.spec.ts | 25 + .../digitalocean/digitalocean.component.ts | 100 +++ .../src/app/storage/storage.component.html | 2 + handlers/digitalocean/account_handler.go | 20 + handlers/digitalocean/action_handler.go | 20 + handlers/digitalocean/cdn_handler.go | 20 + handlers/digitalocean/certificate_handler.go | 20 + handlers/digitalocean/database_handler.go | 20 + handlers/digitalocean/domain_handler.go | 20 + handlers/digitalocean/droplet_handler.go | 20 + handlers/digitalocean/firewall_handler.go | 35 + handlers/digitalocean/floatingip_handler.go | 20 + handlers/digitalocean/handler.go | 57 ++ handlers/digitalocean/keys_handler.go | 20 + handlers/digitalocean/kubernetes_handler.go | 20 + handlers/digitalocean/loadbalancer_handler.go | 20 + handlers/digitalocean/project_handler.go | 20 + handlers/digitalocean/record_handler.go | 20 + handlers/digitalocean/snapshot_handler.go | 20 + handlers/digitalocean/volume_handler.go | 20 + main.go | 22 +- services/digitalocean/account.go | 24 + services/digitalocean/actions.go | 37 + services/digitalocean/cdn.go | 15 + services/digitalocean/certificates.go | 31 + services/digitalocean/databases.go | 15 + services/digitalocean/digitalocean.go | 3 + services/digitalocean/domains.go | 15 + services/digitalocean/droplets.go | 33 + services/digitalocean/firewalls.go | 55 ++ services/digitalocean/floatingips.go | 15 + services/digitalocean/kubernetes.go | 33 + services/digitalocean/loadbalancers.go | 15 + services/digitalocean/projects.go | 15 + services/digitalocean/records.go | 38 + services/digitalocean/snapshots.go | 28 + services/digitalocean/ssh.go | 15 + services/digitalocean/volumes.go | 28 + .../github.com/digitalocean/godo/.gitignore | 1 + .../github.com/digitalocean/godo/.travis.yml | 14 + .../github.com/digitalocean/godo/CHANGELOG.md | 149 ++++ .../digitalocean/godo/CONTRIBUTING.md | 54 ++ .../github.com/digitalocean/godo/LICENSE.txt | 55 ++ vendor/github.com/digitalocean/godo/README.md | 158 +++++ .../github.com/digitalocean/godo/account.go | 60 ++ vendor/github.com/digitalocean/godo/action.go | 104 +++ vendor/github.com/digitalocean/godo/cdn.go | 214 ++++++ .../digitalocean/godo/certificates.go | 126 ++++ .../github.com/digitalocean/godo/databases.go | 667 ++++++++++++++++++ vendor/github.com/digitalocean/godo/doc.go | 11 + .../github.com/digitalocean/godo/domains.go | 337 +++++++++ .../digitalocean/godo/droplet_actions.go | 329 +++++++++ .../github.com/digitalocean/godo/droplets.go | 573 +++++++++++++++ vendor/github.com/digitalocean/godo/errors.go | 24 + .../github.com/digitalocean/godo/firewalls.go | 267 +++++++ .../digitalocean/godo/floating_ips.go | 139 ++++ .../digitalocean/godo/floating_ips_actions.go | 109 +++ vendor/github.com/digitalocean/godo/go.mod | 9 + vendor/github.com/digitalocean/godo/go.sum | 19 + vendor/github.com/digitalocean/godo/godo.go | 404 +++++++++++ .../digitalocean/godo/image_actions.go | 102 +++ vendor/github.com/digitalocean/godo/images.go | 241 +++++++ vendor/github.com/digitalocean/godo/keys.go | 226 ++++++ .../digitalocean/godo/kubernetes.go | 612 ++++++++++++++++ vendor/github.com/digitalocean/godo/links.go | 83 +++ .../digitalocean/godo/load_balancers.go | 317 +++++++++ .../github.com/digitalocean/godo/projects.go | 302 ++++++++ .../github.com/digitalocean/godo/regions.go | 64 ++ vendor/github.com/digitalocean/godo/sizes.go | 68 ++ .../github.com/digitalocean/godo/snapshots.go | 141 ++++ .../github.com/digitalocean/godo/storage.go | 254 +++++++ .../digitalocean/godo/storage_actions.go | 129 ++++ .../github.com/digitalocean/godo/strings.go | 102 +++ vendor/github.com/digitalocean/godo/tags.go | 233 ++++++ .../github.com/digitalocean/godo/timestamp.go | 35 + vendor/github.com/digitalocean/godo/vpcs.go | 183 +++++ .../github.com/google/go-querystring/LICENSE | 27 + .../google/go-querystring/query/encode.go | 320 +++++++++ 109 files changed, 10187 insertions(+), 15 deletions(-) create mode 100644 dashboard/src/app/compute/digitalocean/digitalocean.component.css create mode 100644 dashboard/src/app/compute/digitalocean/digitalocean.component.html create mode 100644 dashboard/src/app/compute/digitalocean/digitalocean.component.spec.ts create mode 100644 dashboard/src/app/compute/digitalocean/digitalocean.component.ts create mode 100644 dashboard/src/app/dashboard/digitalocean/digitalocean.component.css create mode 100644 dashboard/src/app/dashboard/digitalocean/digitalocean.component.html create mode 100644 dashboard/src/app/dashboard/digitalocean/digitalocean.component.spec.ts create mode 100644 dashboard/src/app/dashboard/digitalocean/digitalocean.component.ts create mode 100644 dashboard/src/app/digitalocean.service.spec.ts create mode 100644 dashboard/src/app/digitalocean.service.ts create mode 100644 dashboard/src/app/network/digitalocean/digitalocean.component.css create mode 100644 dashboard/src/app/network/digitalocean/digitalocean.component.html create mode 100644 dashboard/src/app/network/digitalocean/digitalocean.component.spec.ts create mode 100644 dashboard/src/app/network/digitalocean/digitalocean.component.ts create mode 100644 dashboard/src/app/security/digitalocean/digitalocean.component.css create mode 100644 dashboard/src/app/security/digitalocean/digitalocean.component.html create mode 100644 dashboard/src/app/security/digitalocean/digitalocean.component.spec.ts create mode 100644 dashboard/src/app/security/digitalocean/digitalocean.component.ts create mode 100644 dashboard/src/app/storage/digitalocean/digitalocean.component.css create mode 100644 dashboard/src/app/storage/digitalocean/digitalocean.component.html create mode 100644 dashboard/src/app/storage/digitalocean/digitalocean.component.spec.ts create mode 100644 dashboard/src/app/storage/digitalocean/digitalocean.component.ts create mode 100644 handlers/digitalocean/account_handler.go create mode 100644 handlers/digitalocean/action_handler.go create mode 100644 handlers/digitalocean/cdn_handler.go create mode 100644 handlers/digitalocean/certificate_handler.go create mode 100644 handlers/digitalocean/database_handler.go create mode 100644 handlers/digitalocean/domain_handler.go create mode 100644 handlers/digitalocean/droplet_handler.go create mode 100644 handlers/digitalocean/firewall_handler.go create mode 100644 handlers/digitalocean/floatingip_handler.go create mode 100644 handlers/digitalocean/handler.go create mode 100644 handlers/digitalocean/keys_handler.go create mode 100644 handlers/digitalocean/kubernetes_handler.go create mode 100644 handlers/digitalocean/loadbalancer_handler.go create mode 100644 handlers/digitalocean/project_handler.go create mode 100644 handlers/digitalocean/record_handler.go create mode 100644 handlers/digitalocean/snapshot_handler.go create mode 100644 handlers/digitalocean/volume_handler.go create mode 100644 services/digitalocean/account.go create mode 100644 services/digitalocean/actions.go create mode 100644 services/digitalocean/cdn.go create mode 100644 services/digitalocean/certificates.go create mode 100644 services/digitalocean/databases.go create mode 100644 services/digitalocean/digitalocean.go create mode 100644 services/digitalocean/domains.go create mode 100644 services/digitalocean/droplets.go create mode 100644 services/digitalocean/firewalls.go create mode 100644 services/digitalocean/floatingips.go create mode 100644 services/digitalocean/kubernetes.go create mode 100644 services/digitalocean/loadbalancers.go create mode 100644 services/digitalocean/projects.go create mode 100644 services/digitalocean/records.go create mode 100644 services/digitalocean/snapshots.go create mode 100644 services/digitalocean/ssh.go create mode 100644 services/digitalocean/volumes.go create mode 100755 vendor/github.com/digitalocean/godo/.gitignore create mode 100644 vendor/github.com/digitalocean/godo/.travis.yml create mode 100644 vendor/github.com/digitalocean/godo/CHANGELOG.md create mode 100644 vendor/github.com/digitalocean/godo/CONTRIBUTING.md create mode 100644 vendor/github.com/digitalocean/godo/LICENSE.txt create mode 100644 vendor/github.com/digitalocean/godo/README.md create mode 100644 vendor/github.com/digitalocean/godo/account.go create mode 100644 vendor/github.com/digitalocean/godo/action.go create mode 100644 vendor/github.com/digitalocean/godo/cdn.go create mode 100644 vendor/github.com/digitalocean/godo/certificates.go create mode 100644 vendor/github.com/digitalocean/godo/databases.go create mode 100644 vendor/github.com/digitalocean/godo/doc.go create mode 100644 vendor/github.com/digitalocean/godo/domains.go create mode 100644 vendor/github.com/digitalocean/godo/droplet_actions.go create mode 100644 vendor/github.com/digitalocean/godo/droplets.go create mode 100644 vendor/github.com/digitalocean/godo/errors.go create mode 100644 vendor/github.com/digitalocean/godo/firewalls.go create mode 100644 vendor/github.com/digitalocean/godo/floating_ips.go create mode 100644 vendor/github.com/digitalocean/godo/floating_ips_actions.go create mode 100644 vendor/github.com/digitalocean/godo/go.mod create mode 100644 vendor/github.com/digitalocean/godo/go.sum create mode 100644 vendor/github.com/digitalocean/godo/godo.go create mode 100644 vendor/github.com/digitalocean/godo/image_actions.go create mode 100644 vendor/github.com/digitalocean/godo/images.go create mode 100644 vendor/github.com/digitalocean/godo/keys.go create mode 100644 vendor/github.com/digitalocean/godo/kubernetes.go create mode 100644 vendor/github.com/digitalocean/godo/links.go create mode 100644 vendor/github.com/digitalocean/godo/load_balancers.go create mode 100644 vendor/github.com/digitalocean/godo/projects.go create mode 100644 vendor/github.com/digitalocean/godo/regions.go create mode 100644 vendor/github.com/digitalocean/godo/sizes.go create mode 100644 vendor/github.com/digitalocean/godo/snapshots.go create mode 100644 vendor/github.com/digitalocean/godo/storage.go create mode 100644 vendor/github.com/digitalocean/godo/storage_actions.go create mode 100644 vendor/github.com/digitalocean/godo/strings.go create mode 100644 vendor/github.com/digitalocean/godo/tags.go create mode 100644 vendor/github.com/digitalocean/godo/timestamp.go create mode 100644 vendor/github.com/digitalocean/godo/vpcs.go create mode 100644 vendor/github.com/google/go-querystring/LICENSE create mode 100644 vendor/github.com/google/go-querystring/query/encode.go diff --git a/.circleci/config.yml b/.circleci/config.yml index 478ef8ff6..d0320f513 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,13 +60,13 @@ jobs: chmod +x komiser_windows_amd64.exe komiser_darwin_amd64 komiser_linux_amd64 - run: name: Push Linux binary - command: aws s3 cp komiser_linux_amd64 s3://komiser/2.3.0/linux/komiser --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers + command: aws s3 cp komiser_linux_amd64 s3://komiser/2.4.0/linux/komiser --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers - run: name: Push Windows binary - command: aws s3 cp komiser_windows_amd64.exe s3://komiser/2.3.0/windows/komiser --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers + command: aws s3 cp komiser_windows_amd64.exe s3://komiser/2.4.0/windows/komiser --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers - run: name: Push Mac OS X binary - command: aws s3 cp komiser_darwin_amd64 s3://komiser/2.3.0/osx/komiser --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers + command: aws s3 cp komiser_darwin_amd64 s3://komiser/2.4.0/osx/komiser --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers - run: name: Upload IAM policy command: aws s3 cp policy.json s3://komiser/policy.json --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers diff --git a/Dockerfile b/Dockerfile index f26ffb0b2..b43cb955e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.9.4 MAINTAINER mlabouardy -ENV VERSION 2.3.0 +ENV VERSION 2.4.0 ENV PORT 3000 ENV DURATION 30 diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 0e7082f7c..c2042e4e9 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -341,6 +341,11 @@ "Comment": "v0.7.0-12-g80eda21", "Rev": "80eda21e3854386d2a56de1236efe984f6e687de" }, + { + "ImportPath": "github.com/digitalocean/godo", + "Comment": "v1.19.0-2-g4677563", + "Rev": "4677563d2a4e3523791598dcbd3945ead86e5c0c" + }, { "ImportPath": "github.com/elazarl/go-bindata-assetfs", "Comment": "v1.0.0-2-g38087fe", @@ -406,6 +411,11 @@ "Comment": "v1.3.1-4-ge91709a", "Rev": "e91709a02e0e8ff8b86b7aa913fdc9ae9498e825" }, + { + "ImportPath": "github.com/google/go-querystring/query", + "Comment": "v1.0.0-5-gc8c88db", + "Rev": "c8c88dbee036db4e4808d1f2ec8c2e15e11c3f80" + }, { "ImportPath": "github.com/googleapis/gax-go/v2", "Comment": "v1.0.2-1-g9e33419", diff --git a/README.md b/README.md index 4b220eeb7..10b6b535b 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ Stay under budget by uncovering hidden costs, monitoring increases in spend, and **Discuss it on [Product Hunt](https://www.producthunt.com/posts/komiser) 🦄** +*Komiser EE is available in private beta test stage, sign in for free at [https://cloud.komiser.io](https://cloud.komiser.io)* + [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/fold_left.svg?style=social&label=Follow%20%40Komiser)](https://twitter.com/komiseree) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Optimize%20Cost%20and%20Security%20on%20AWS&url=https://github.com/mlabouardy/komiser&via=mlabouardy&hashtags=komiser,aws,gcp,cloud,serverless,devops) **Highlights** @@ -19,7 +21,7 @@ Stay under budget by uncovering hidden costs, monitoring increases in spend, and * Analyze and manage cloud cost, usage, security, and governance in one place. * Control your usage and create visibility across all used services to achieve maximum cost-effectiveness. * Detect potential vulnerabilities that could put your cloud environment at risk. -* Get a deep understanding of how you spend on the AWS, GCP, OVH and Azure. +* Get a deep understanding of how you spend on the AWS, GCP, OVH, DigitalOcean and Azure.

@@ -37,24 +39,24 @@ Does your company use Komiser? Ask your manager or marketing team if your compa ## Download -Below are the available downloads for the latest version of Komiser (2.3.0). Please download the proper package for your operating system and architecture. +Below are the available downloads for the latest version of Komiser (2.4.0). Please download the proper package for your operating system and architecture. ### Linux: ``` -wget https://cli.komiser.io/2.3.0/linux/komiser +wget https://cli.komiser.io/2.4.0/linux/komiser ``` ### Windows: ``` -wget https://cli.komiser.io/2.3.0/windows/komiser +wget https://cli.komiser.io/2.4.0/windows/komiser ``` ### Mac OS X: ``` -wget https://cli.komiser.io/2.3.0/osx/komiser +wget https://cli.komiser.io/2.4.0/osx/komiser ``` _Note_: make sure to add the execution permission to Komiser `chmod +x komiser` @@ -67,7 +69,7 @@ brew install komiser ### Docker: ``` -docker run -d -p 3000:3000 -e AWS_ACCESS_KEY_ID="" -e AWS_SECRET_ACCESS_KEY="" -e AWS_DEFAULT_REGION="" --name komiser mlabouardy/komiser:2.3.0 +docker run -d -p 3000:3000 -e AWS_ACCESS_KEY_ID="" -e AWS_SECRET_ACCESS_KEY="" -e AWS_DEFAULT_REGION="" --name komiser mlabouardy/komiser:2.4.0 ``` ## How to use @@ -211,6 +213,25 @@ consumer_key=my_consumer_key

+### DigitalOcean + +* To generate a personal access token, log in to the [DigitalOcean Control Panel](https://cloud.digitalocean.com/). + +* Click the **API** link in the main navigation, In the **Personal access tokens** section, click the **Generate New Token** button. + +* Create a *ready-only* scope token. When you click **Generate Token**, your token will be generated. + +* Set *DIGITALOCEAN_ACCESS_TOKEN* environment variable: + +``` +export DIGITALOCEAN_ACCESS_TOKEN= +``` + +* If you point your browser to http://localhost:3000, you should be able to see your projects: + +

+ +

## Options diff --git a/dashboard/src/app/app.component.html b/dashboard/src/app/app.component.html index ae627b7ee..0d04cd597 100644 --- a/dashboard/src/app/app.component.html +++ b/dashboard/src/app/app.component.html @@ -126,7 +126,7 @@

Security

-