Skip to content

Instantly share code, notes, and snippets.

@Lax
Created July 22, 2015 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lax/037affa7ccb23e456074 to your computer and use it in GitHub Desktop.
Save Lax/037affa7ccb23e456074 to your computer and use it in GitHub Desktop.
Aliyun CMS(Cloud Monitor Service) Demo. https://github.com/Lax/aliyun
#!/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