Created
July 22, 2015 13:21
-
-
Save Lax/037affa7ccb23e456074 to your computer and use it in GitHub Desktop.
Aliyun CMS(Cloud Monitor Service) Demo. https://github.com/Lax/aliyun
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'aliyun' | |
require 'time' | |
$DEBUG=true | |
options = {:access_key_id => "ALIYUN_KEY_ID", | |
:access_key_secret => "ALIYUN_KEY_SECRET", | |
:service => :cms} | |
service = Aliyun::Service.new options | |
parameters = { | |
Namespace: 'acs/ecs', | |
MetricName: 'vm.DiskUtilization', | |
StartTime: (Time.now - 3600).utc.iso8601, | |
Dimensions: "{instanceId:'i-25bux0pzl',mountpoint:'/data'}", | |
RegionId: 'cn-beijing', | |
Length: 1000 | |
} | |
puts service.DescribeMetricDatum parameters |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment