Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

rename

  • Loading branch information...
commit 38a9e4a74cad7d79fa8fc0841b23f73d6ce30358 1 parent 008e6bf
Kamil authored
Showing with 132 additions and 132 deletions.
  1. +2 −2 Gemfile.lock
  2. +1 −1  README.md
  3. +8 −8 Rakefile
  4. +5 −5 bin/cvc
  5. +2 −2 bin/cvc_daemon
  6. +4 −4 cv_client.gemspec → cv_collector.gemspec
  7. +0 −31 lib/cv_client.rb
  8. +31 −0 lib/cv_collector.rb
  9. +2 −2 lib/{cv_client → cv_collector}/core/connection.rb
  10. 0  lib/{cv_client → cv_collector}/core/ec_interface.rb
  11. 0  lib/{cv_client → cv_collector}/core/helper.rb
  12. 0  lib/{cv_client → cv_collector}/core/right_aws_emr_patch.rb
  13. 0  lib/{cv_client → cv_collector}/core/s3_parser.rb
  14. +2 −2 lib/{cv_client → cv_collector}/provider/aws/auth.rb
  15. +4 −4 lib/{cv_client → cv_collector}/provider/aws/base.rb
  16. +2 −2 lib/{cv_client → cv_collector}/provider/aws/billing.rb
  17. +2 −2 lib/{cv_client → cv_collector}/provider/aws/billing_programatic.rb
  18. +2 −2 lib/{cv_client → cv_collector}/provider/aws/block_device.rb
  19. +3 −3 lib/{cv_client → cv_collector}/provider/aws/cloudwatch/base.rb
  20. +1 −1  lib/{cv_client → cv_collector}/provider/aws/cloudwatch/ebs.rb
  21. +1 −1  lib/{cv_client → cv_collector}/provider/aws/cloudwatch/ec.rb
  22. +1 −1  lib/{cv_client → cv_collector}/provider/aws/cloudwatch/ec2.rb
  23. +1 −1  lib/{cv_client → cv_collector}/provider/aws/cloudwatch/elb.rb
  24. +1 −1  lib/{cv_client → cv_collector}/provider/aws/cloudwatch/rds.rb
  25. +2 −2 lib/{cv_client → cv_collector}/provider/aws/dynamo_db.rb
  26. +2 −2 lib/{cv_client → cv_collector}/provider/aws/ec2_instance.rb
  27. +2 −2 lib/{cv_client → cv_collector}/provider/aws/ec_instance.rb
  28. +2 −2 lib/{cv_client → cv_collector}/provider/aws/emr.rb
  29. +2 −2 lib/{cv_client → cv_collector}/provider/aws/load_balancer.rb
  30. +2 −2 lib/{cv_client → cv_collector}/provider/aws/rds_instance.rb
  31. +5 −5 lib/{cv_client → cv_collector}/provider/aws/reserved_ec2_instance.rb
  32. +6 −6 lib/{cv_client → cv_collector}/provider/aws/reserved_ec_instance.rb
  33. +6 −6 lib/{cv_client → cv_collector}/provider/aws/reserved_rds_instance.rb
  34. +2 −2 lib/{cv_client → cv_collector}/provider/aws/s3_bucket.rb
  35. +2 −2 lib/{cv_client → cv_collector}/provider/aws/snapshot.rb
  36. +1 −1  lib/{cv_client → cv_collector}/provider/base/auth.rb
  37. +2 −2 lib/{cv_client → cv_collector}/provider/cv/auth.rb
  38. +1 −1  lib/{cv_client → cv_collector}/version.rb
  39. +20 −20 scripts/daemon.rb
View
4 Gemfile.lock
@@ -7,7 +7,7 @@ GIT
PATH
remote: .
specs:
- cv_client (0.0.1)
+ cv_collector (0.0.1)
aws-sdk (~> 1.5.5)
faraday (= 0.8.1)
faraday_middleware (= 0.8.7)
@@ -59,7 +59,7 @@ PLATFORMS
DEPENDENCIES
active_support
aws-sdk (= 1.5.5)
- cv_client!
+ cv_collector!
daemons (= 1.1.4)
faraday (= 0.8.1)
faraday_middleware
View
2  README.md
@@ -16,7 +16,7 @@ Ruby 1.9.3
Setup
-----
- gem install cv_client
+ gem install cv_collector
run cvc --help for help
run cvc_daemon --help
View
16 Rakefile
@@ -4,7 +4,7 @@ require "bundler/setup"
PROJECT_ROOT = File.expand_path("..", __FILE__)
$:.unshift "#{PROJECT_ROOT}/lib"
-require "cv_client/version"
+require "cv_collector/version"
require "rspec/core/rake_task"
desc "Run all specs"
@@ -36,7 +36,7 @@ def assemble_distribution(target_dir=Dir.pwd)
end
end
-GEM_BLACKLIST = %w( bundler cv_client )
+GEM_BLACKLIST = %w( bundler cv_collector )
def assemble_gems(target_dir=Dir.pwd)
lines = %x{ bundle show }.strip.split("\n")
@@ -54,7 +54,7 @@ def assemble_gems(target_dir=Dir.pwd)
end
def beta?
- CvClient::VERSION.to_s =~ /pre/
+ CvCollector::VERSION.to_s =~ /pre/
end
def clean(file)
@@ -62,8 +62,8 @@ def clean(file)
end
def distribution_files(type=nil)
- require "cv_client/distribution"
- base_files = CvClient::Distribution.files
+ require "cv_collector/distribution"
+ base_files = CvCollector::Distribution.files
type_files = type ?
Dir[File.expand_path("../dist/resources/#{type}/**/*", __FILE__)] :
[]
@@ -108,7 +108,7 @@ def s3_connect
@s3_connected = true
end
-def store(package_file, filename, bucket="assets.cv_client.com")
+def store(package_file, filename, bucket="assets.cv_collector.com")
s3_connect
puts "storing: #{filename}"
AWS::S3::S3Object.store(filename, File.open(package_file), bucket, :access => :public_read)
@@ -123,8 +123,8 @@ def tempdir
end
def version
- require "cv_client/version"
- CvClient::VERSION
+ require "cv_collector/version"
+ CvCollector::VERSION
end
Dir[File.expand_path("../dist/**/*.rake", __FILE__)].each do |rake|
View
10 bin/cvc
@@ -4,10 +4,10 @@ lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
require 'optparse'
-require 'cv_client'
+require 'cv_collector'
require 'highline/import'
-require 'cv_client/provider/cv/auth'
-require 'cv_client/provider/aws/auth'
+require 'cv_collector/provider/cv/auth'
+require 'cv_collector/provider/aws/auth'
require 'yaml'
options = {}
@@ -29,8 +29,8 @@ OptionParser.new do |opts|
end
end.parse!
-CvClient::Provider::Cv::Auth.new.ask_for_and_save_credentials if options[:cv] or !CvClient::Provider::Cv::Auth.auth_key_file_exists?('cv')
-CvClient::Provider::Aws::Auth.new.ask_for_and_save_credentials if options[:aws]
+CvCollector::Provider::Cv::Auth.new.ask_for_and_save_credentials if options[:cv] or !CvCollector::Provider::Cv::Auth.auth_key_file_exists?('cv')
+CvCollector::Provider::Aws::Auth.new.ask_for_and_save_credentials if options[:aws]
system("cvc_daemon stop")
system("cvc_daemon start")
View
4 bin/cvc_daemon
@@ -4,10 +4,10 @@ scripts = File.expand_path(File.dirname(__FILE__) + '/../scripts')
lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
-require 'cv_client'
+require 'cv_collector'
require 'highline/import'
require 'daemons'
-require 'cv_client/provider/aws/auth'
+require 'cv_collector/provider/aws/auth'
options = {
:app_name => "cvc-daemon",
View
8 cv_client.gemspec → cv_collector.gemspec
@@ -1,11 +1,11 @@
$:.push File.expand_path("../lib", __FILE__)
-require "cv_client/version"
+require "cv_collector/version"
Gem::Specification.new do |gem|
- gem.name = "cv_client"
- gem.version = CvClient::VERSION
+ gem.name = "cv_collector"
+ gem.version = CvCollector::VERSION
gem.platform = Gem::Platform::RUBY
- gem.author = "CvClient"
+ gem.author = "CvCollector"
gem.email = "support@cloudvertical.com"
gem.homepage = "http://www.cloudvertical.com/"
gem.summary = "Gateway library and CLI to interact with CloudVertical API."
View
31 lib/cv_client.rb
@@ -1,31 +0,0 @@
-require 'cv_client/core/connection'
-require 'cv_client/core/helper'
-require 'cv_client/core/ec_interface'
-require 'cv_client/core/right_aws_emr_patch'
-require 'cv_client/core/s3_parser'
-require 'cv_client/provider/base/auth'
-require 'cv_client/provider/cv/auth'
-require 'cv_client/provider/aws/auth'
-require 'cv_client/provider/aws/base'
-require 'cv_client/provider/aws/billing'
-require 'cv_client/provider/aws/ec2_instance'
-require 'cv_client/provider/aws/dynamo_db'
-require 'cv_client/provider/aws/ec_instance'
-require 'cv_client/provider/aws/reserved_ec2_instance'
-require 'cv_client/provider/aws/reserved_rds_instance'
-require 'cv_client/provider/aws/reserved_ec_instance'
-require 'cv_client/provider/aws/rds_instance'
-require 'cv_client/provider/aws/s3_bucket'
-require 'cv_client/provider/aws/billing_programatic'
-require 'cv_client/provider/aws/load_balancer'
-require 'cv_client/provider/aws/block_device'
-require 'cv_client/provider/aws/snapshot'
-require 'cv_client/provider/aws/emr'
-require 'cv_client/provider/aws/cloudwatch/base'
-require 'cv_client/provider/aws/cloudwatch/ec2'
-require 'cv_client/provider/aws/cloudwatch/rds'
-require 'cv_client/provider/aws/cloudwatch/ec'
-require 'cv_client/provider/aws/cloudwatch/elb'
-require 'cv_client/provider/aws/cloudwatch/ebs'
-
-
View
31 lib/cv_collector.rb
@@ -0,0 +1,31 @@
+require 'cv_collector/core/connection'
+require 'cv_collector/core/helper'
+require 'cv_collector/core/ec_interface'
+require 'cv_collector/core/right_aws_emr_patch'
+require 'cv_collector/core/s3_parser'
+require 'cv_collector/provider/base/auth'
+require 'cv_collector/provider/cv/auth'
+require 'cv_collector/provider/aws/auth'
+require 'cv_collector/provider/aws/base'
+require 'cv_collector/provider/aws/billing'
+require 'cv_collector/provider/aws/ec2_instance'
+require 'cv_collector/provider/aws/dynamo_db'
+require 'cv_collector/provider/aws/ec_instance'
+require 'cv_collector/provider/aws/reserved_ec2_instance'
+require 'cv_collector/provider/aws/reserved_rds_instance'
+require 'cv_collector/provider/aws/reserved_ec_instance'
+require 'cv_collector/provider/aws/rds_instance'
+require 'cv_collector/provider/aws/s3_bucket'
+require 'cv_collector/provider/aws/billing_programatic'
+require 'cv_collector/provider/aws/load_balancer'
+require 'cv_collector/provider/aws/block_device'
+require 'cv_collector/provider/aws/snapshot'
+require 'cv_collector/provider/aws/emr'
+require 'cv_collector/provider/aws/cloudwatch/base'
+require 'cv_collector/provider/aws/cloudwatch/ec2'
+require 'cv_collector/provider/aws/cloudwatch/rds'
+require 'cv_collector/provider/aws/cloudwatch/ec'
+require 'cv_collector/provider/aws/cloudwatch/elb'
+require 'cv_collector/provider/aws/cloudwatch/ebs'
+
+
View
4 lib/cv_client/core/connection.rb → lib/cv_collector/core/connection.rb
@@ -1,4 +1,4 @@
-module CvClient
+module CvCollector
module Core
class Connection
# API_URL = 'http://localhost:3000/'
@@ -29,7 +29,7 @@ def post(data, path = '/api/v1/push')
end
end
rescue Faraday::Error::ConnectionFailed => e
- p "CV_CLIENT ERROR: #{e}"
+ p "cv_collector ERROR: #{e}"
end
def split_data(data)
View
0  lib/cv_client/core/ec_interface.rb → lib/cv_collector/core/ec_interface.rb
File renamed without changes
View
0  lib/cv_client/core/helper.rb → lib/cv_collector/core/helper.rb
File renamed without changes
View
0  lib/cv_client/core/right_aws_emr_patch.rb → lib/cv_collector/core/right_aws_emr_patch.rb
File renamed without changes
View
0  lib/cv_client/core/s3_parser.rb → lib/cv_collector/core/s3_parser.rb
File renamed without changes
View
4 lib/cv_client/provider/aws/auth.rb → lib/cv_collector/provider/aws/auth.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class Auth < CvClient::Provider::Base::Auth
+ class Auth < CvCollector::Provider::Base::Auth
def ask_for_credentials
puts "Enter your Amazon Web Services credentials."
View
8 lib/cv_client/provider/aws/base.rb → lib/cv_collector/provider/aws/base.rb
@@ -1,5 +1,5 @@
require 'right_aws'
-module CvClient
+module CvCollector
module Provider
module Aws
class Base
@@ -37,7 +37,7 @@ class Base
class << self
def save_sync
- @connection ||= CvClient::Core::Connection.new
+ @connection ||= CvCollector::Core::Connection.new
@connection.post({:data => [{:sync_type => 'AgentConnection'}], :auth_token => CV_API_KEY}, '/v01/data_syncs.json')
end
end
@@ -85,12 +85,12 @@ def parse_tags(tags)
end
def send
- @connection = CvClient::Core::Connection.new
+ @connection = CvCollector::Core::Connection.new
@connection.post({:data => @data, :auth_token => auth_token}, PATH)
end
def connection
- @connection ||= CvClient::Core::Connection.new
+ @connection ||= CvCollector::Core::Connection.new
return @connection
end
View
4 lib/cv_client/provider/aws/billing.rb → lib/cv_collector/provider/aws/billing.rb
@@ -1,9 +1,9 @@
require 'base64'
require 'json'
-module CvClient
+module CvCollector
module Provider
module Aws
- class Billing < CvClient::Provider::Aws::Base
+ class Billing < CvCollector::Provider::Aws::Base
AWS_BILLING_END_POINT = "https://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=activity-summary"
VENDOR = "aws"
View
4 ...lient/provider/aws/billing_programatic.rb → ...ector/provider/aws/billing_programatic.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class BillingProgramatic < CvClient::Provider::Aws::Base
+ class BillingProgramatic < CvCollector::Provider::Aws::Base
TYPE = "billing"
PATH = "/v01/programatic_statements.json"
View
4 lib/cv_client/provider/aws/block_device.rb → ...cv_collector/provider/aws/block_device.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class BlockDevice < CvClient::Provider::Aws::Base
+ class BlockDevice < CvCollector::Provider::Aws::Base
RESOURCE_TYPE = 'block_device'
STATUSES = {'creating' => 'available', 'available' => 'available', 'in-use' => 'in-use', 'deleting' => 'terminated', 'deleted' => 'terminated', 'error' => 'error'}
View
6 ...cv_client/provider/aws/cloudwatch/base.rb → ...collector/provider/aws/cloudwatch/base.rb
@@ -1,8 +1,8 @@
-module CvClient
+module CvCollector
module Provider
module Aws
module CloudWatch
- class Base < CvClient::Provider::Aws::Base
+ class Base < CvCollector::Provider::Aws::Base
PATH = "/v01/computes/0/usages.json"
PERIOD = 600
@@ -27,7 +27,7 @@ def fetch_data
end
def new?
- @connection ||= CvClient::Core::Connection.new
+ @connection ||= CvCollector::Core::Connection.new
res_type = self.class::RESOURCE_TYPE
body = @connection.get("/v01/usages/is_new?limit=1&resource_type=#{res_type}&format=json", @auth_token).body
p res_type
View
2  lib/cv_client/provider/aws/cloudwatch/ebs.rb → ..._collector/provider/aws/cloudwatch/ebs.rb
@@ -1,5 +1,5 @@
require 'time'
-module CvClient
+module CvCollector
module Provider
module Aws
module CloudWatch
View
2  lib/cv_client/provider/aws/cloudwatch/ec.rb → ...v_collector/provider/aws/cloudwatch/ec.rb
@@ -1,5 +1,5 @@
require 'time'
-module CvClient
+module CvCollector
module Provider
module Aws
module CloudWatch
View
2  lib/cv_client/provider/aws/cloudwatch/ec2.rb → ..._collector/provider/aws/cloudwatch/ec2.rb
@@ -1,5 +1,5 @@
require 'time'
-module CvClient
+module CvCollector
module Provider
module Aws
module CloudWatch
View
2  lib/cv_client/provider/aws/cloudwatch/elb.rb → ..._collector/provider/aws/cloudwatch/elb.rb
@@ -1,5 +1,5 @@
require 'time'
-module CvClient
+module CvCollector
module Provider
module Aws
module CloudWatch
View
2  lib/cv_client/provider/aws/cloudwatch/rds.rb → ..._collector/provider/aws/cloudwatch/rds.rb
@@ -1,5 +1,5 @@
require 'time'
-module CvClient
+module CvCollector
module Provider
module Aws
module CloudWatch
View
4 lib/cv_client/provider/aws/dynamo_db.rb → lib/cv_collector/provider/aws/dynamo_db.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class DynamoDB < CvClient::Provider::Aws::Base
+ class DynamoDB < CvCollector::Provider::Aws::Base
RESOURCE_TYPE = 'dynamo_db'
STATUSES = {}
View
4 lib/cv_client/provider/aws/ec2_instance.rb → ...cv_collector/provider/aws/ec2_instance.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class EC2Instance < CvClient::Provider::Aws::Base
+ class EC2Instance < CvCollector::Provider::Aws::Base
RESOURCE_TYPE = 'instance'
STATUSES = {'pending' => 'running', 'running' => 'running', 'shutting-down' => 'stopped', 'terminated' => 'terminated', 'stopping' => 'stopped', 'stopped' => 'stopped'}
View
4 lib/cv_client/provider/aws/ec_instance.rb → lib/cv_collector/provider/aws/ec_instance.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class EcInstance < CvClient::Provider::Aws::Base
+ class EcInstance < CvCollector::Provider::Aws::Base
RESOURCE_TYPE = 'ec_instance'
STATUSES = {'creating' => 'running', 'deleting' => 'terminated', 'available' => 'running'}
View
4 lib/cv_client/provider/aws/emr.rb → lib/cv_collector/provider/aws/emr.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class Emr < CvClient::Provider::Aws::Base
+ class Emr < CvCollector::Provider::Aws::Base
RESOURCE_TYPE = 'emr'
STATUSES = { 'RUNNING' => 'running', 'WAITING' => 'waiting', 'SHUTTING_DOWN' => 'shutting_down', 'STARTING' => 'starting', 'COMPLETED' => 'completed', 'FAILED' => 'failed', 'TERMINATED' => 'terminated' }
View
4 lib/cv_client/provider/aws/load_balancer.rb → ...v_collector/provider/aws/load_balancer.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class LoadBalancer < CvClient::Provider::Aws::Base
+ class LoadBalancer < CvCollector::Provider::Aws::Base
RESOURCE_TYPE = 'load_balancer'
PATH = "/v01/networks.json"
View
4 lib/cv_client/provider/aws/rds_instance.rb → ...cv_collector/provider/aws/rds_instance.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class RdsInstance < CvClient::Provider::Aws::Base
+ class RdsInstance < CvCollector::Provider::Aws::Base
RESOURCE_TYPE = 'rds_instance'
# API not included info about statuses
View
10 ...ent/provider/aws/reserved_ec2_instance.rb → ...tor/provider/aws/reserved_ec2_instance.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class ReservedEC2Instance < CvClient::Provider::Aws::Base
+ class ReservedEC2Instance < CvCollector::Provider::Aws::Base
RESOURCE_TYPE = 'reserved_ec2_instance'
STATUSES = { 'pending-payment' => 'pending-payment', 'active' => 'active', 'payment-failed' => 'payment-failed', 'retired' => 'retired' }
@@ -54,7 +54,7 @@ def fetch_data()
:currency => 'USD',
:interval => 3600,
:cost => reserved[:aws_usage_price],
- :compute_type => CvClient::Provider::Aws::EC2Instance::RESOURCE_TYPE}]}, "/v01/computes.json")
+ :compute_type => CvCollector::Provider::Aws::EC2Instance::RESOURCE_TYPE}]}, "/v01/computes.json")
end
end
@@ -69,12 +69,12 @@ def fetch_data()
:currency => nil,
:interval => nil,
:cost => nil,
- :compute_type => CvClient::Provider::Aws::EC2Instance::RESOURCE_TYPE}]}, "/v01/computes.json")
+ :compute_type => CvCollector::Provider::Aws::EC2Instance::RESOURCE_TYPE}]}, "/v01/computes.json")
end
{}
# 4 unsign tags
rescue RightAws::AwsError => e
- p "CV_CLIENT ERROR: #{e}"
+ p "cv_collector ERROR: #{e}"
{}
end
View
12 ...ient/provider/aws/reserved_ec_instance.rb → ...ctor/provider/aws/reserved_ec_instance.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class ReservedEcInstance < CvClient::Provider::Aws::Base
+ class ReservedEcInstance < CvCollector::Provider::Aws::Base
RESOURCE_TYPE = 'reserved_ec_instance'
STATUSES = { 'pending-payment' => 'pending-payment', 'active' => 'active', 'payment-failed' => 'payment-failed', 'retired' => 'retired' }
@@ -33,7 +33,7 @@ def fetch_data()
_instances = nil
_reserved_instances.each do |reserved|
reserved[:instance_count].times do
- instance_resources = CvClient::Provider::Aws::EcInstance::INSTANCE_TYPES[reserved[:instance_class]]
+ instance_resources = CvCollector::Provider::Aws::EcInstance::INSTANCE_TYPES[reserved[:instance_class]]
if _inst = marked_as_reserved.find{|instance| instance[:region] == region &&
instance[:cpu] == instance_resources[:cpu] &&
instance[:status] == 'running' &&
@@ -54,7 +54,7 @@ def fetch_data()
:currency => 'USD',
:interval => 3600,
:cost => reserved[:usage_price],
- :compute_type => CvClient::Provider::Aws::EcInstance::RESOURCE_TYPE}]}, "/v01/computes.json")
+ :compute_type => CvCollector::Provider::Aws::EcInstance::RESOURCE_TYPE}]}, "/v01/computes.json")
end
end
@@ -69,12 +69,12 @@ def fetch_data()
:currency => nil,
:interval => nil,
:cost => nil,
- :compute_type => CvClient::Provider::Aws::EcInstance::RESOURCE_TYPE}]}, "/v01/computes.json")
+ :compute_type => CvCollector::Provider::Aws::EcInstance::RESOURCE_TYPE}]}, "/v01/computes.json")
end
{}
# 4 unsign tags
rescue RightAws::AwsError => e
- p "CV_CLIENT ERROR: #{e}"
+ p "cv_collector ERROR: #{e}"
{}
end
View
12 ...ent/provider/aws/reserved_rds_instance.rb → ...tor/provider/aws/reserved_rds_instance.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class ReservedRdsInstance < CvClient::Provider::Aws::Base
+ class ReservedRdsInstance < CvCollector::Provider::Aws::Base
RESOURCE_TYPE = 'reserved_rds_instance'
STATUSES = { 'pending-payment' => 'pending-payment', 'active' => 'active', 'payment-failed' => 'payment-failed', 'retired' => 'retired' }
@@ -32,7 +32,7 @@ def fetch_data()
_instances = nil
_reserved_instances.each do |reserved|
reserved[:instance_count].times do
- instance_resources = CvClient::Provider::Aws::RdsInstance::INSTANCE_TYPES[reserved[:instance_class]]
+ instance_resources = CvCollector::Provider::Aws::RdsInstance::INSTANCE_TYPES[reserved[:instance_class]]
if _inst = marked_as_reserved.find{|instance| instance[:region] == region &&
instance[:cpu] == instance_resources["cpu"] &&
@@ -60,7 +60,7 @@ def fetch_data()
:currency => 'USD',
:interval => 3600,
:cost => reserved[:usage_price],
- :compute_type => CvClient::Provider::Aws::RdsInstance::RESOURCE_TYPE}]}, "/v01/computes.json")
+ :compute_type => CvCollector::Provider::Aws::RdsInstance::RESOURCE_TYPE}]}, "/v01/computes.json")
end
end
@@ -75,12 +75,12 @@ def fetch_data()
:currency => nil,
:interval => nil,
:cost => nil,
- :compute_type => CvClient::Provider::Aws::RdsInstance::RESOURCE_TYPE}]}, "/v01/computes.json")
+ :compute_type => CvCollector::Provider::Aws::RdsInstance::RESOURCE_TYPE}]}, "/v01/computes.json")
end
{}
# 4 unsign tags
rescue RightAws::AwsError => e
- p "CV_CLIENT ERROR: #{e}"
+ p "cv_collector ERROR: #{e}"
{}
end
View
4 lib/cv_client/provider/aws/s3_bucket.rb → lib/cv_collector/provider/aws/s3_bucket.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class S3Bucket < CvClient::Provider::Aws::Base
+ class S3Bucket < CvCollector::Provider::Aws::Base
RESOURCE_TYPE = 's3_bucket'
PATH = "/v01/storage.json"
View
4 lib/cv_client/provider/aws/snapshot.rb → lib/cv_collector/provider/aws/snapshot.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Aws
- class Snapshot < CvClient::Provider::Aws::Base
+ class Snapshot < CvCollector::Provider::Aws::Base
RESOURCE_TYPE = 'snapshot'
STATUSES = {'pending' => 'pending', 'completed' => 'completed', 'error' => 'error'}
View
2  lib/cv_client/provider/base/auth.rb → lib/cv_collector/provider/base/auth.rb
@@ -1,5 +1,5 @@
require 'fileutils'
-module CvClient
+module CvCollector
module Provider
module Base
class Auth
View
4 lib/cv_client/provider/cv/auth.rb → lib/cv_collector/provider/cv/auth.rb
@@ -1,7 +1,7 @@
-module CvClient
+module CvCollector
module Provider
module Cv
- class Auth < CvClient::Provider::Base::Auth
+ class Auth < CvCollector::Provider::Base::Auth
def ask_for_credentials
puts "Enter your Cloud Vertical credentials."
View
2  lib/cv_client/version.rb → lib/cv_collector/version.rb
@@ -1,3 +1,3 @@
-module CvClient
+module CvCollector
VERSION = "0.0.1"
end
View
40 scripts/daemon.rb
@@ -2,7 +2,7 @@
lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
-require File.join(lib, 'cv_client')
+require File.join(lib, 'cv_collector')
require 'yaml'
require 'faraday'
@@ -19,24 +19,24 @@
loop do
components = [
- CvClient::Provider::Aws::Billing,
- CvClient::Provider::Aws::BillingProgramatic,
- CvClient::Provider::Aws::DynamoDB,
- CvClient::Provider::Aws::EC2Instance,
- CvClient::Provider::Aws::ReservedEC2Instance,
- CvClient::Provider::Aws::RdsInstance,
- CvClient::Provider::Aws::ReservedRdsInstance,
- CvClient::Provider::Aws::EcInstance,
- CvClient::Provider::Aws::ReservedEcInstance,
- CvClient::Provider::Aws::LoadBalancer,
- CvClient::Provider::Aws::BlockDevice,
- CvClient::Provider::Aws::Snapshot,
- CvClient::Provider::Aws::Emr,
- CvClient::Provider::Aws::CloudWatch::Ec2,
- CvClient::Provider::Aws::CloudWatch::Rds,
- CvClient::Provider::Aws::CloudWatch::Ec,
- CvClient::Provider::Aws::CloudWatch::Elb,
- CvClient::Provider::Aws::CloudWatch::Ebs
+ CvCollector::Provider::Aws::Billing,
+ CvCollector::Provider::Aws::BillingProgramatic,
+ CvCollector::Provider::Aws::DynamoDB,
+ CvCollector::Provider::Aws::EC2Instance,
+ CvCollector::Provider::Aws::ReservedEC2Instance,
+ CvCollector::Provider::Aws::RdsInstance,
+ CvCollector::Provider::Aws::ReservedRdsInstance,
+ CvCollector::Provider::Aws::EcInstance,
+ CvCollector::Provider::Aws::ReservedEcInstance,
+ CvCollector::Provider::Aws::LoadBalancer,
+ CvCollector::Provider::Aws::BlockDevice,
+ CvCollector::Provider::Aws::Snapshot,
+ CvCollector::Provider::Aws::Emr,
+ CvCollector::Provider::Aws::CloudWatch::Ec2,
+ CvCollector::Provider::Aws::CloudWatch::Rds,
+ CvCollector::Provider::Aws::CloudWatch::Ec,
+ CvCollector::Provider::Aws::CloudWatch::Elb,
+ CvCollector::Provider::Aws::CloudWatch::Ebs
]
components.each do |c|
@@ -45,7 +45,7 @@
obj.send
end
- CvClient::Provider::Aws::Base.save_sync
+ CvCollector::Provider::Aws::Base.save_sync
sleep 60*60
end
Please sign in to comment.
Something went wrong with that request. Please try again.