|
@@ -14,8 +14,14 @@ require 'neoinfra/cloudwatch'
|
|
module NeoInfra
|
|
module NeoInfra
|
|
# Provide informations about the accounts available
|
|
# Provide informations about the accounts available
|
|
class Aws
|
|
class Aws
|
|
- def regions
|
|
|
|
|
|
+
|
|
|
|
+ def initialize
|
|
@cfg = NeoInfra::Config.new
|
|
@cfg = NeoInfra::Config.new
|
|
|
|
+ neo4j_url = "http://#{@cfg.neo4j[:host]}:#{@cfg.neo4j[:port]}"
|
|
|
|
+ Neo4j::Session.open(:server_db, neo4j_url)
|
|
|
|
+ end
|
|
|
|
+
|
|
|
|
+ def regions
|
|
account = @cfg.accounts.first
|
|
account = @cfg.accounts.first
|
|
base_conf = {
|
|
base_conf = {
|
|
provider: 'AWS',
|
|
provider: 'AWS',
|
|
@@ -35,7 +41,6 @@ module NeoInfra
|
|
end
|
|
end
|
|
|
|
|
|
def azs(region)
|
|
def azs(region)
|
|
- @cfg = NeoInfra::Config.new
|
|
|
|
account = @cfg.accounts.first
|
|
account = @cfg.accounts.first
|
|
base_conf = {
|
|
base_conf = {
|
|
provider: 'AWS',
|
|
provider: 'AWS',
|
|
@@ -48,9 +53,6 @@ module NeoInfra
|
|
end
|
|
end
|
|
|
|
|
|
def load_regions
|
|
def load_regions
|
|
- @cfg = NeoInfra::Config.new
|
|
|
|
- neo4j_url = "http://#{@cfg.neo4j[:host]}:#{@cfg.neo4j[:port]}"
|
|
|
|
- Neo4j::Session.open(:server_db, neo4j_url)
|
|
|
|
regions.each do |region|
|
|
regions.each do |region|
|
|
next unless Region.where(region: region).empty?
|
|
next unless Region.where(region: region).empty?
|
|
r = Region.new(
|
|
r = Region.new(
|
|
@@ -67,10 +69,7 @@ module NeoInfra
|
|
end
|
|
end
|
|
|
|
|
|
def load_buckets
|
|
def load_buckets
|
|
- @cfg = NeoInfra::Config.new
|
|
|
|
cw = NeoInfra::Cloudwatch.new
|
|
cw = NeoInfra::Cloudwatch.new
|
|
- neo4j_url = "http://#{@cfg.neo4j[:host]}:#{@cfg.neo4j[:port]}"
|
|
|
|
- Neo4j::Session.open(:server_db, neo4j_url)
|
|
|
|
@cfg.accounts.each do |account|
|
|
@cfg.accounts.each do |account|
|
|
base_conf = {
|
|
base_conf = {
|
|
provider: 'AWS',
|
|
provider: 'AWS',
|
|
@@ -92,9 +91,6 @@ module NeoInfra
|
|
end
|
|
end
|
|
|
|
|
|
def load_rds
|
|
def load_rds
|
|
- @cfg = NeoInfra::Config.new
|
|
|
|
- neo4j_url = "http://#{@cfg.neo4j[:host]}:#{@cfg.neo4j[:port]}"
|
|
|
|
- Neo4j::Session.open(:server_db, neo4j_url)
|
|
|
|
@cfg.accounts.each do |account|
|
|
@cfg.accounts.each do |account|
|
|
base_conf = {
|
|
base_conf = {
|
|
aws_access_key_id: account[:key],
|
|
aws_access_key_id: account[:key],
|