smartdc 1.3.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -19
  3. data/.travis.yml +1 -1
  4. data/Gemfile +5 -11
  5. data/README.md +25 -40
  6. data/Rakefile +5 -5
  7. data/bin/sdc +4 -380
  8. data/config.ru +2 -0
  9. data/lib/smartdc.rb +23 -15
  10. data/lib/smartdc/api/analytics.rb +19 -36
  11. data/lib/smartdc/api/analytics/heatmap.rb +6 -15
  12. data/lib/smartdc/api/datacenters.rb +7 -16
  13. data/lib/smartdc/api/images.rb +11 -0
  14. data/lib/smartdc/api/keys.rb +13 -23
  15. data/lib/smartdc/api/machines.rb +26 -60
  16. data/lib/smartdc/api/machines/metadata.rb +15 -0
  17. data/lib/smartdc/api/machines/snapshots.rb +23 -0
  18. data/lib/smartdc/api/machines/tags.rb +19 -0
  19. data/lib/smartdc/api/packages.rb +7 -17
  20. data/lib/smartdc/auth.rb +39 -5
  21. data/lib/smartdc/cli.rb +65 -0
  22. data/lib/smartdc/cli/analytic.rb +52 -0
  23. data/lib/smartdc/cli/datacenter.rb +15 -0
  24. data/lib/smartdc/cli/image.rb +19 -0
  25. data/lib/smartdc/cli/key.rb +26 -0
  26. data/lib/smartdc/cli/machine.rb +79 -0
  27. data/lib/smartdc/cli/machine/metadata.rb +30 -0
  28. data/lib/smartdc/cli/machine/snapshot.rb +38 -0
  29. data/lib/smartdc/cli/machine/tag.rb +33 -0
  30. data/lib/smartdc/cli/package.rb +17 -0
  31. data/lib/smartdc/cli_configure.rb +81 -0
  32. data/lib/smartdc/cli_helper.rb +111 -0
  33. data/lib/smartdc/client.rb +33 -28
  34. data/lib/smartdc/configure.rb +30 -0
  35. data/lib/smartdc/default.rb +35 -0
  36. data/lib/smartdc/version.rb +1 -1
  37. data/smartdc.gemspec +20 -16
  38. data/spec/cassettes/analytics/create.yml +64 -0
  39. data/spec/cassettes/analytics/describe.yml +123 -0
  40. data/spec/cassettes/analytics/destroy.yml +56 -0
  41. data/spec/cassettes/analytics/index.yml +62 -0
  42. data/spec/cassettes/analytics/show.yml +62 -0
  43. data/spec/cassettes/analytics/value.yml +62 -0
  44. data/spec/cassettes/datacenters/index.yml +62 -0
  45. data/spec/cassettes/datacenters/show.yml +64 -0
  46. data/spec/cassettes/images/index.yml +519 -0
  47. data/spec/cassettes/images/show.yml +63 -0
  48. data/spec/cassettes/keys/create.yml +65 -0
  49. data/spec/cassettes/keys/destroy.yml +56 -0
  50. data/spec/cassettes/keys/index.yml +63 -0
  51. data/spec/cassettes/keys/show.yml +63 -0
  52. data/spec/cassettes/machines/create.yml +65 -0
  53. data/spec/cassettes/machines/destroy.yml +56 -0
  54. data/spec/cassettes/machines/index.yml +67 -0
  55. data/spec/cassettes/machines/metadata/destroy.yml +56 -0
  56. data/spec/cassettes/machines/metadata/index.yml +62 -0
  57. data/spec/cassettes/machines/metadata/update.yml +64 -0
  58. data/spec/cassettes/machines/reboot.yml +58 -0
  59. data/spec/cassettes/machines/show.yml +63 -0
  60. data/spec/cassettes/machines/snapshots/create.yml +62 -0
  61. data/spec/cassettes/machines/snapshots/destroy.yml +56 -0
  62. data/spec/cassettes/machines/snapshots/index.yml +62 -0
  63. data/spec/cassettes/machines/snapshots/show.yml +62 -0
  64. data/spec/cassettes/machines/snapshots/start.yml +58 -0
  65. data/spec/cassettes/machines/start.yml +58 -0
  66. data/spec/cassettes/machines/stop.yml +58 -0
  67. data/spec/cassettes/machines/tags/create.yml +64 -0
  68. data/spec/cassettes/machines/tags/destroy.yml +56 -0
  69. data/spec/cassettes/machines/tags/index.yml +62 -0
  70. data/spec/cassettes/machines/tags/show.yml +62 -0
  71. data/spec/cassettes/packages/index.yml +123 -0
  72. data/spec/cassettes/packages/show.yml +63 -0
  73. data/spec/fixtures/config/sdccfg +4 -0
  74. data/spec/fixtures/ssh/id_rsa +27 -0
  75. data/spec/fixtures/ssh/id_rsa.pub +1 -0
  76. data/spec/smartdc/api/analytics_spec.rb +47 -0
  77. data/spec/smartdc/api/datacenters_spec.rb +19 -0
  78. data/spec/smartdc/api/images_spec.rb +19 -0
  79. data/spec/smartdc/api/keys_spec.rb +34 -0
  80. data/spec/smartdc/api/machines/metadata_spec.rb +27 -0
  81. data/spec/smartdc/api/machines/snapshots_spec.rb +38 -0
  82. data/spec/smartdc/api/machines/tags_spec.rb +33 -0
  83. data/spec/smartdc/api/machines_spec.rb +59 -0
  84. data/spec/smartdc/api/packages_spec.rb +19 -0
  85. data/spec/smartdc/auth_spec.rb +25 -0
  86. data/spec/smartdc/cli_configure_spec.rb +32 -0
  87. data/spec/smartdc/client_spec.rb +11 -0
  88. data/spec/smartdc_spec.rb +44 -0
  89. data/spec/spec_helper.rb +25 -8
  90. metadata +176 -83
  91. data/lib/cli_helper.rb +0 -126
  92. data/lib/configure.rb +0 -125
  93. data/lib/smartdc/api/datasets.rb +0 -20
  94. data/lib/smartdc/api/machine/metadata.rb +0 -24
  95. data/lib/smartdc/api/machine/snapshots.rb +0 -35
  96. data/lib/smartdc/api/machine/tags.rb +0 -29
  97. data/lib/smartdc/error.rb +0 -35
  98. data/lib/smartdc/request.rb +0 -83
  99. data/lib/smartdc/response.rb +0 -25
  100. data/lib/smartdc/response/raise_error.rb +0 -38
  101. data/spec/fixtures/analytics.json +0 -26
  102. data/spec/fixtures/datacenter.json +0 -4
  103. data/spec/fixtures/datacenters.json +0 -3
  104. data/spec/fixtures/datasets.json +0 -38
  105. data/spec/fixtures/keys.json +0 -14
  106. data/spec/fixtures/machines.json +0 -36
  107. data/spec/fixtures/packages.json +0 -18
  108. data/spec/fixtures/snapshots.json +0 -8
  109. data/spec/fixtures/tag.json +0 -3
  110. data/spec/unit/smartdc/api/analytics_spec.rb +0 -48
  111. data/spec/unit/smartdc/api/datacenters_spec.rb +0 -28
  112. data/spec/unit/smartdc/api/datasets_spec.rb +0 -28
  113. data/spec/unit/smartdc/api/keys_spec.rb +0 -48
  114. data/spec/unit/smartdc/api/machine/metadata_spec.rb +0 -38
  115. data/spec/unit/smartdc/api/machine/snapshots_spec.rb +0 -48
  116. data/spec/unit/smartdc/api/machine/tags_spec.rb +0 -48
  117. data/spec/unit/smartdc/api/machines_spec.rb +0 -48
  118. data/spec/unit/smartdc/api/packages_spec.rb +0 -28
  119. data/spec/unit/smartdc/client_spec.rb +0 -40
  120. data/spec/unit/smartdc_spec.rb +0 -9
@@ -0,0 +1,111 @@
1
+ require 'terminal-table'
2
+
3
+ module Smartdc
4
+ module CliHelper
5
+ def use_machine(id)
6
+ if id.nil?
7
+ clicfg = Smartdc::CliConfigure.new
8
+ sdccfg = clicfg.read
9
+ sdccfg[:use_machine]
10
+ else
11
+ id
12
+ end
13
+ end
14
+
15
+ def output(response, options={})
16
+ if options['raw']
17
+ puts response.body
18
+ else
19
+ if response.status < 300
20
+ if options[:table]
21
+ case options[:table]
22
+ when :horizontal, :h
23
+ puts horizontal(response.content, options)
24
+ when :vertical, :v
25
+ puts vertical(response.content, options)
26
+ end
27
+ else
28
+ if options[:message]
29
+ puts options[:message]
30
+ else
31
+ puts response.content[options[:only].to_s]
32
+ end
33
+ end
34
+ else
35
+ puts vertical(response.content)
36
+ end
37
+ end
38
+ end
39
+
40
+ def horizontal(content, options={})
41
+ options[:include] ||= []
42
+ options[:exclude] ||= []
43
+ rows = []
44
+ headings = nil
45
+
46
+ content.each do |row|
47
+ options[:exclude].each do |col|
48
+ row.delete(col.to_s)
49
+ end
50
+
51
+ if !options[:include].empty?
52
+ cols = {}
53
+ options[:include].each do |col|
54
+ cols[col.to_s] = row[col.to_s] if row.key?(col.to_s)
55
+ end
56
+ row = cols
57
+ end
58
+
59
+ rows << row.values
60
+ headings = row.keys if headings.nil?
61
+ end
62
+
63
+ Terminal::Table.new :headings => headings, :rows => rows if !content.empty?
64
+ end
65
+
66
+ def vertical(content, options={})
67
+ options[:exclude] ||= []
68
+ options[:exclude].each do |col|
69
+ content.delete(col.to_s)
70
+ end
71
+
72
+ rows = []
73
+ content.to_a.each do |row|
74
+ rows << row
75
+ end
76
+
77
+ Terminal::Table.new :headings => ['key','value'], :rows => rows if !content.empty?
78
+ end
79
+
80
+ def describe(name, content, options)
81
+ if options['all'] or options['output'] == name
82
+ options[:exclude] ||= []
83
+ rows = []
84
+
85
+ content[name].each do |row|
86
+ cols = []
87
+ if options[:cols] == :all
88
+ options[:exclude].each do |col|
89
+ row.delete(col.to_s)
90
+ end
91
+ cols = row.values
92
+ else
93
+ options[:cols].each do |col|
94
+ if col == 'key'
95
+ cols << row[0]
96
+ else
97
+ cols << row[1][col]
98
+ end
99
+ end
100
+ end
101
+ rows << cols
102
+ end
103
+
104
+ title = options['all'] ? name : nil
105
+ headings = options[:cols] == :all ? content[name][0].keys : options[:cols]
106
+ puts Terminal::Table.new :title => title, :headings => headings, :rows => rows
107
+ puts if options['all']
108
+ end
109
+ end
110
+ end
111
+ end
@@ -1,40 +1,45 @@
1
- require 'smartdc/api/keys'
1
+ require 'cassette-rack'
2
+ require 'smartdc/auth'
2
3
  require 'smartdc/api/datacenters'
3
- require 'smartdc/api/datasets'
4
+ require 'smartdc/api/images'
4
5
  require 'smartdc/api/packages'
6
+ require 'smartdc/api/keys'
5
7
  require 'smartdc/api/machines'
8
+ require 'smartdc/api/machines/tags'
9
+ require 'smartdc/api/machines/metadata'
10
+ require 'smartdc/api/machines/snapshots'
6
11
  require 'smartdc/api/analytics'
12
+ require 'smartdc/api/analytics/heatmap'
7
13
 
8
14
  module Smartdc
9
15
  class Client
10
- attr_reader :options
16
+ include CassetteRack::Request
17
+ include Smartdc::Api::Datacenters
18
+ include Smartdc::Api::Images
19
+ include Smartdc::Api::Packages
20
+ include Smartdc::Api::Keys
21
+ include Smartdc::Api::Machines
22
+ include Smartdc::Api::Machines::Tags
23
+ include Smartdc::Api::Machines::Metadata
24
+ include Smartdc::Api::Machines::Snapshots
25
+ include Smartdc::Api::Analytics
26
+ include Smartdc::Api::Analytics::Heatmap
11
27
 
12
28
  def initialize(options={})
13
- @options ||= options
14
- end
15
-
16
- def keys()
17
- Smartdc::Api::Keys.new(options)
18
- end
19
-
20
- def datacenters()
21
- Smartdc::Api::Datacenters.new(options)
22
- end
23
-
24
- def datasets()
25
- Smartdc::Api::Datasets.new(options)
26
- end
27
-
28
- def packages()
29
- Smartdc::Api::Packages.new(options)
30
- end
31
-
32
- def machines()
33
- Smartdc::Api::Machines.new(options)
34
- end
35
-
36
- def analytics()
37
- Smartdc::Api::Analytics.new(options)
29
+ options = Smartdc.config.options.merge(options)
30
+ auth = Smartdc::Auth.new(options)
31
+ date = Time.now.gmtime.to_s
32
+
33
+ @request_options = {
34
+ builder: options[:middleware],
35
+ url: options[:url],
36
+ ssl: { verify: options[:ssl_verify] },
37
+ headers: {
38
+ date: date, authorization: auth.signature(date),
39
+ 'content-type' => 'application/json', accept: 'application/json',
40
+ 'x-api-version' => options[:version]
41
+ }
42
+ }
38
43
  end
39
44
  end
40
45
  end
@@ -0,0 +1,30 @@
1
+ module Smartdc
2
+ module Configure
3
+ class << self
4
+ def attributes
5
+ @attributes ||= %i[
6
+ url version ssl_verify middleware
7
+ username use_key rsa_path
8
+ ]
9
+ end
10
+
11
+ def setup
12
+ attributes.each do |attribute|
13
+ if Smartdc::Default.respond_to?(attribute)
14
+ instance_variable_set(:"@#{attribute}", Smartdc::Default.send(attribute))
15
+ end
16
+ end
17
+ end
18
+
19
+ def options
20
+ Hash[
21
+ Smartdc::Configure.attributes.map do |attribute|
22
+ [attribute, instance_variable_get(:"@#{attribute}")]
23
+ end
24
+ ]
25
+ end
26
+
27
+ attr_accessor *Smartdc::Configure.attributes
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,35 @@
1
+ require 'faraday'
2
+
3
+ module Smartdc
4
+ module Default
5
+ URL = 'https://us-east-1.api.joyentcloud.com'.freeze
6
+ VERSION = '~7.0'.freeze
7
+ SSL_VERIFY = true.freeze
8
+ RSA_PATH = '~/.ssh'.freeze
9
+ MIDDLEWARE = Faraday::RackBuilder.new do |builder|
10
+ builder.adapter Faraday.default_adapter
11
+ end
12
+
13
+ class << self
14
+ def url
15
+ URL
16
+ end
17
+
18
+ def version
19
+ VERSION
20
+ end
21
+
22
+ def ssl_verify
23
+ SSL_VERIFY
24
+ end
25
+
26
+ def rsa_path
27
+ RSA_PATH
28
+ end
29
+
30
+ def middleware
31
+ MIDDLEWARE
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,3 +1,3 @@
1
1
  module Smartdc
2
- VERSION = '1.3.0'
2
+ VERSION = '2.0.0'.freeze
3
3
  end
@@ -1,23 +1,27 @@
1
- # -*- encoding: utf-8 -*-
1
+ # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'smartdc/version'
5
5
 
6
- Gem::Specification.new do |gem|
7
- gem.name = "smartdc"
8
- gem.version = Smartdc::VERSION
9
- gem.authors = ["ogom"]
10
- gem.email = ["ogom@hotmail.co.jp"]
11
- gem.description = %q{SmartDataCenter client and SmartDataCenter Command Line Interface.}
12
- gem.summary = %q{Joyent SmartDataCenter CloudApi client by ruby.}
13
- gem.homepage = "http://github.com/ogom/ruby-smartdc"
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "smartdc"
8
+ spec.version = Smartdc::VERSION
9
+ spec.authors = ["ogom"]
10
+ spec.email = ["ogom@hotmail.co.jp"]
11
+ spec.summary = %q{Joyent CloudAPI client by Ruby.}
12
+ spec.description = %q{Joyent CloudAPI client and command line interface.}
13
+ spec.homepage = "http://github.com/ogom/ruby-smartdc"
14
+ spec.license = "MIT"
14
15
 
15
- gem.files = `git ls-files`.split($/)
16
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
- gem.require_paths = ["lib"]
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
19
20
 
20
- gem.add_runtime_dependency(%q<faraday>, ["~> 0.8"])
21
- gem.add_runtime_dependency(%q<thor>, ["~> 0.18"])
22
- gem.add_runtime_dependency(%q<terminal-table>, ["~> 1.4"])
21
+ spec.add_dependency 'cassette-rack'
22
+ spec.add_dependency 'thor'
23
+ spec.add_dependency 'terminal-table'
24
+
25
+ spec.add_development_dependency 'bundler'
26
+ spec.add_development_dependency 'rake'
23
27
  end
@@ -0,0 +1,64 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://us-east-1.api.joyentcloud.com/my/analytics/instrumentations
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"module":"syscall","stat":"syscalls"}'
9
+ headers:
10
+ Date: ''
11
+ Authorization: ''
12
+ Content-Type:
13
+ - application/json
14
+ Accept:
15
+ - application/json
16
+ X-Api-Version:
17
+ - "~7.0"
18
+ User-Agent:
19
+ - Faraday v0.9.1
20
+ Accept-Encoding:
21
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ X-Api-Version:
28
+ - 7.2.0
29
+ Server:
30
+ - Joyent SmartDataCenter 7.2.0
31
+ Request-Id: ''
32
+ Content-Type:
33
+ - application/json
34
+ Access-Control-Expose-Headers:
35
+ - Api-Version, Request-Id, Response-Time
36
+ Strict-Transport-Security:
37
+ - max-age=6570000
38
+ Date: ''
39
+ X-Request-Id: ''
40
+ Location:
41
+ - "/<USERNAME>/analytics/instrumentations/256"
42
+ Content-Md5:
43
+ - vcSXwZ1T0mBEzB5VAzOrFg==
44
+ Access-Control-Allow-Origin:
45
+ - "*"
46
+ Response-Time: ''
47
+ X-Response-Time: ''
48
+ Connection:
49
+ - Keep-Alive
50
+ Access-Control-Allow-Headers:
51
+ - Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, Api-Version,
52
+ Response-Time
53
+ Access-Control-Allow-Methods:
54
+ - GET, HEAD, POST
55
+ Api-Version:
56
+ - 7.2.0
57
+ Content-Length:
58
+ - '382'
59
+ body:
60
+ encoding: UTF-8
61
+ string: '{"module":"syscall","stat":"syscalls","predicate":{},"decomposition":[],"value-dimension":1,"value-arity":"scalar","enabled":true,"retention-time":600,"idle-max":3600,"transformations":{},"nsources":0,"granularity":1,"persist-data":false,"crtime":1424000674378,"value-scope":"interval","id":"256","uris":[{"uri":"/<USERNAME>/analytics/instrumentations/256/value/raw","name":"value_raw"}]}'
62
+ http_version:
63
+ recorded_at: Sun, 15 Feb 2015 11:44:36 GMT
64
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,123 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://us-east-1.api.joyentcloud.com/my/analytics
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Date: ''
11
+ Authorization: ''
12
+ Content-Type:
13
+ - application/json
14
+ Accept:
15
+ - application/json
16
+ X-Api-Version:
17
+ - "~7.0"
18
+ User-Agent:
19
+ - Faraday v0.9.1
20
+ Accept-Encoding:
21
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
+ response:
23
+ status:
24
+ code: 200
25
+ message: OK
26
+ headers:
27
+ X-Api-Version:
28
+ - 7.2.0
29
+ Server:
30
+ - Joyent SmartDataCenter 7.2.0
31
+ Request-Id: ''
32
+ Content-Type:
33
+ - application/json
34
+ Access-Control-Expose-Headers:
35
+ - Api-Version, Request-Id, Response-Time
36
+ Strict-Transport-Security:
37
+ - max-age=6570000
38
+ Date: ''
39
+ X-Request-Id: ''
40
+ Content-Md5:
41
+ - XITArtu6vj84zHPuBiuzNQ==
42
+ Access-Control-Allow-Origin:
43
+ - "*"
44
+ Response-Time: ''
45
+ X-Response-Time: ''
46
+ Connection:
47
+ - Keep-Alive
48
+ Access-Control-Allow-Headers:
49
+ - Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, Api-Version,
50
+ Response-Time
51
+ Access-Control-Allow-Methods:
52
+ - GET, HEAD
53
+ Api-Version:
54
+ - 7.2.0
55
+ Content-Length:
56
+ - '11086'
57
+ body:
58
+ encoding: UTF-8
59
+ string: '{"modules":{"apache":{"label":"Apache"},"cpu":{"label":"CPU"},"ldapjs":{"label":"ldapjs"},"memory":{"label":"Memory"},"mysql":{"label":"MySQL"},"syscall":{"label":"System
60
+ calls"},"fs":{"label":"Filesystem"},"node":{"label":"Node.js 0.4.x"},"nic":{"label":"Network
61
+ interface"},"vm":{"label":"Virtual Machine"},"tcp":{"label":"TCP"},"zfs":{"label":"ZFS"},"unix":{"label":"OS"}},"fields":{"zonename":{"label":"zone
62
+ name","type":"string"},"pid":{"label":"process identifier","type":"string"},"execname":{"label":"application
63
+ name","type":"string"},"psargs":{"label":"process arguments","type":"string"},"ppid":{"label":"parent
64
+ process identifier","type":"string"},"pexecname":{"label":"parent application
65
+ name","type":"string"},"ppsargs":{"label":"parent process arguments","type":"string"},"raddr":{"label":"remote
66
+ IP address","type":"string"},"rport":{"label":"remote TCP port","type":"string"},"http_method":{"label":"method","type":"string"},"http_url":{"label":"URL","type":"string"},"http_path":{"label":"URL
67
+ path","type":"string"},"latency":{"label":"latency","type":"time"},"subsecond":{"label":"subsecond
68
+ offset","type":"subsecond"},"leavereason":{"label":"reason leaving CPU","type":"string"},"runtime":{"label":"time
69
+ on CPU","type":"time"},"cpumode":{"label":"CPU mode","type":"string"},"optype":{"label":"operation
70
+ type","type":"string"},"ldapbinddn":{"label":"bind DN","type":"string"},"ldaprequestdn":{"label":"request
71
+ DN","type":"string"},"status":{"label":"status","type":"string"},"ldapfilter":{"label":"search
72
+ filter","type":"string"},"ldapscope":{"label":"search scope","type":"string"},"user":{"label":"client
73
+ username","type":"string"},"client":{"label":"client hostname","type":"string"},"command":{"label":"command","type":"string"},"cputime":{"label":"CPU
74
+ time","type":"time"},"querysubstr":{"label":"query substring","type":"string"},"database":{"label":"database
75
+ name","type":"string"},"parsed":{"label":"parsed","type":"string"},"statement":{"label":"statement
76
+ type","type":"string"},"rowsmatched":{"label":"rows matched","type":"number"},"rowschanged":{"label":"rows
77
+ changed","type":"number"},"table":{"label":"table name","type":"string"},"syscall":{"label":"syscall","type":"string"},"fstype":{"label":"filesystem
78
+ type","type":"string"},"size":{"label":"size","type":"size"},"offset":{"label":"offset","type":"size"},"gctype":{"label":"GC
79
+ type","type":"string"},"http_origin":{"label":"reported origin IP","type":"string"},"buffered":{"label":"bytes
80
+ buffered on socket","type":"size"},"direction":{"label":"sent/received","type":"string"},"vmmmuctx":{"label":"VM
81
+ MMU context","type":"string"},"errno":{"label":"error code","type":"string"},"zdataset":{"label":"ZFS
82
+ dataset","type":"string"},"walltime":{"label":"process runtime","type":"time"},"rss":{"label":"resident
83
+ set size","type":"size"},"contract":{"label":"contract identifier","type":"string"},"pmodel":{"label":"process
84
+ model","type":"string"},"nthreads":{"label":"number of threads","type":"number"}},"types":{"string":{"name":"string","arity":"discrete","unit":""},"time":{"arity":"numeric","unit":"seconds","abbr":"s","base":10,"power":-9,"name":"time"},"subsecond":{"arity":"numeric","unit":"seconds","abbr":"s","base":10,"power":-3,"name":"subsecond"},"size":{"arity":"numeric","unit":"bytes","abbr":"B","base":2,"name":"size"},"number":{"arity":"numeric","name":"number","unit":""}},"metrics":[{"module":"apache","stat":"httpd_ops","label":"HTTP
85
+ requests","interval":"interval","fields":["zonename","pid","execname","psargs","ppid","pexecname","ppsargs","raddr","rport","http_method","http_url","http_path","latency"],"unit":"requests"},{"module":"cpu","stat":"thread_samples","label":"thread
86
+ samples","interval":"interval","fields":["zonename","pid","execname","psargs","ppid","pexecname","ppsargs","subsecond"],"unit":"samples"},{"module":"cpu","stat":"thread_executions","label":"thread
87
+ executions","interval":"interval","fields":["zonename","pid","execname","psargs","ppid","pexecname","ppsargs","leavereason","runtime","subsecond"],"unit":"operations"},{"module":"cpu","stat":"usage","label":"aggregated
88
+ CPU usage","interval":"point","fields":["zonename","cpumode"],"unit":"percent
89
+ of 1 CPU"},{"module":"cpu","stat":"waittime","label":"aggregated wait time","interval":"interval","fields":["zonename"],"type":"time"},{"module":"ldapjs","stat":"connections","label":"connections","interval":"interval","fields":["zonename","pid","execname","psargs","raddr"],"unit":"connections"},{"module":"ldapjs","stat":"ops","label":"all
90
+ operations","interval":"interval","fields":["zonename","pid","execname","psargs","raddr","optype","ldapbinddn","ldaprequestdn","status","latency"],"unit":"operations"},{"module":"ldapjs","stat":"search_ops","label":"search
91
+ operations","interval":"interval","fields":["zonename","pid","execname","psargs","raddr","ldapbinddn","ldaprequestdn","status","ldapfilter","ldapscope","latency"],"unit":"operations"},{"module":"memory","stat":"rss","label":"resident
92
+ set size","interval":"point","fields":["zonename"],"type":"size"},{"module":"memory","stat":"rss_limit","label":"maximum
93
+ resident set size","interval":"point","fields":["zonename"],"type":"size"},{"module":"memory","stat":"swap","label":"virtual
94
+ memory reserved","interval":"point","fields":["zonename"],"type":"size"},{"module":"memory","stat":"swap_limit","label":"maximum
95
+ virtual memory reserved","interval":"point","fields":["zonename"],"type":"size"},{"module":"memory","stat":"reclaimed_bytes","label":"excess
96
+ memory reclaimed","interval":"interval","fields":["zonename"],"type":"size"},{"module":"memory","stat":"pageins","label":"pages
97
+ paged in","interval":"interval","fields":["zonename"],"unit":"pages"},{"module":"mysql","stat":"connections","label":"connections","interval":"interval","fields":["zonename","pid","execname","psargs","user","client","latency"],"unit":"connections"},{"module":"mysql","stat":"commands","label":"commands","interval":"interval","fields":["zonename","pid","execname","psargs","command","user","client","status","latency","cputime"],"unit":"commands"},{"module":"mysql","stat":"queries","label":"queries","interval":"interval","fields":["zonename","pid","execname","psargs","querysubstr","database","user","client","parsed","status","latency","cputime"],"unit":"queries"},{"module":"mysql","stat":"statements","label":"statements","interval":"interval","fields":["zonename","pid","execname","psargs","statement","status","rowsmatched","rowschanged","latency","cputime"],"unit":"statements"},{"module":"mysql","stat":"filesort","label":"filesort","interval":"interval","fields":["zonename","pid","execname","psargs","database","table","latency","cputime"],"unit":"filesorts"},{"module":"syscall","stat":"syscalls","label":"system
98
+ calls","interval":"interval","fields":["zonename","pid","execname","psargs","ppid","pexecname","ppsargs","syscall","subsecond","latency","cputime"],"unit":"syscalls"},{"module":"fs","stat":"logical_ops","label":"logical
99
+ filesystem operations","interval":"interval","fields":["zonename","pid","execname","psargs","ppid","pexecname","ppsargs","fstype","optype","latency"],"unit":"operations"},{"module":"fs","stat":"logical_rwops","label":"logical
100
+ read/write operations","interval":"interval","fields":["zonename","pid","execname","psargs","ppid","pexecname","ppsargs","fstype","optype","size","offset","latency"],"unit":"operations"},{"module":"fs","stat":"logical_rwbytes","label":"logical
101
+ bytes read/written","interval":"interval","fields":["zonename","optype"],"type":"size"},{"module":"node","stat":"gc_ops","label":"garbage
102
+ collection operations","interval":"interval","fields":["zonename","pid","execname","psargs","ppid","pexecname","ppsargs","gctype","latency"],"unit":"operations"},{"module":"node","stat":"httpc_ops","label":"HTTP
103
+ client operations","interval":"interval","fields":["zonename","pid","execname","psargs","ppid","pexecname","ppsargs","raddr","rport","http_method","http_url","http_path","latency"],"unit":"operations"},{"module":"node","stat":"httpd_ops","label":"HTTP
104
+ server operations","interval":"interval","fields":["zonename","pid","execname","psargs","ppid","pexecname","ppsargs","http_origin","raddr","rport","http_method","http_url","http_path","latency"],"unit":"operations"},{"module":"node","stat":"socket_ops","label":"socket
105
+ operations","interval":"interval","fields":["zonename","pid","execname","psargs","ppid","pexecname","ppsargs","optype","raddr","rport","size","buffered"],"unit":"operations"},{"module":"nic","stat":"vnic_bytes","label":"VNIC
106
+ bytes sent and received","interval":"interval","fields":["zonename","direction"],"type":"size"},{"module":"nic","stat":"vnic_packets","label":"VNIC
107
+ packets sent and received","interval":"interval","fields":["zonename","direction"],"unit":"packets"},{"module":"vm","stat":"thread_samples","label":"thread
108
+ samples","interval":"interval","fields":["zonename","subsecond","vmmmuctx"],"unit":"samples"},{"module":"vm","stat":"physio_ops","label":"disk
109
+ I/O operations","interval":"interval","fields":["zonename","optype","latency","size","offset","errno"],"unit":"operations"},{"module":"vm","stat":"physio_bytes","label":"disk
110
+ bytes read and written","interval":"interval","fields":["zonename","optype"],"type":"size"},{"module":"tcp","stat":"accepts","label":"accepts","interval":"interval","fields":["zonename","pid","execname","psargs","ppid","pexecname","ppsargs","rport","raddr"],"unit":"accepts"},{"module":"zfs","stat":"arc_ops","label":"ARC
111
+ operations","interval":"interval","fields":["zonename","execname","psargs","pid","pexecname","ppsargs","ppid","optype"],"unit":"operations"},{"module":"zfs","stat":"dataset_unused_quota","label":"unused
112
+ quota","interval":"point","fields":["zdataset"],"type":"size"},{"module":"zfs","stat":"dataset_used","label":"used
113
+ space","interval":"point","fields":["zdataset"],"type":"size"},{"module":"zfs","stat":"dataset_quota","label":"quota
114
+ size","interval":"point","fields":["zdataset"],"type":"size"},{"module":"unix","stat":"proc_execs","label":"process
115
+ execs","interval":"interval","fields":["zonename","execname","subsecond","psargs","ppid","ppsargs","pexecname","pid"],"unit":"processes"},{"module":"unix","stat":"proc_forks","label":"process
116
+ forks","interval":"interval","fields":["zonename","execname","subsecond","psargs","ppid","pid"],"unit":"processes"},{"module":"unix","stat":"proc_exits","label":"process
117
+ exits","interval":"interval","fields":["zonename","execname","subsecond","psargs","ppsargs","pexecname","ppid","pid","walltime"],"unit":"processes"},{"module":"unix","stat":"thr_creates","label":"thread
118
+ creations","interval":"interval","fields":["zonename","execname","subsecond","psargs","ppsargs","pexecname","ppid","pid"],"unit":"threads"},{"module":"unix","stat":"processes","label":"processes","interval":"interval","fields":["zonename","execname","pid","ppid","rss","contract","psargs","pmodel","nthreads"],"unit":"processes"}],"transformations":{"geolocate":{"label":"geolocate
119
+ IP addresses","fields":["raddr"]},"reversedns":{"label":"reverse dns IP addresses
120
+ lookup","fields":["raddr"]}}}'
121
+ http_version:
122
+ recorded_at: Sun, 15 Feb 2015 11:37:46 GMT
123
+ recorded_with: VCR 2.9.3