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,123 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://us-east-1.api.joyentcloud.com/my/packages
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
+ - ir1aPBPXlfB0WtvHVLONXQ==
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
+ - '14042'
57
+ body:
58
+ encoding: UTF-8
59
+ string: '[{"name":"g3-standard-8-smartos","memory":8192,"disk":807936,"swap":16384,"vcpus":0,"default":false,"id":"28d8c3f1-cf62-422a-a41d-fdf8b5110d00","version":"1.0.0","description":"Standard
60
+ 8 GB RAM 2 vCPUs and bursting 789 GB Disk","group":"Standard"},{"name":"g3-highio-30-kvm","memory":30720,"disk":737280,"swap":61440,"vcpus":4,"default":false,"id":"00747b85-e955-42c3-93b7-bf5cd6b3b82f","version":"1.0.0","description":"High
61
+ I/O 30GB DRAM, 4vCPU 725 GB SSD","group":"High I/O"},{"name":"g3-highio-30-smartos","memory":30720,"disk":737280,"swap":61440,"vcpus":0,"default":false,"id":"58e0f906-ca40-4a09-9284-395f0465a36e","version":"1.0.0","description":"High
62
+ I/O 30GB DRAM, 725GB SSD, 4vCPU bursting","group":"High I/O"},{"name":"g3-highio-15-smartos","memory":15360,"disk":368640,"swap":30720,"vcpus":0,"default":false,"id":"b995c6a2-c2e6-4722-b420-f35da6b6281f","version":"1.0.0","description":"High
63
+ I/O 15GB DRAM 2vCPU and bursting 360 GB SSD","group":"High I/O"},{"name":"g3-highio-15-kvm","memory":15360,"disk":368640,"swap":30720,"vcpus":2,"default":false,"id":"7051f5b0-ad5a-4a12-b8bd-0bbea8cd15ce","version":"1.0.0","description":"High
64
+ I/O 15GB DRAM, 2vCPU 360 GB SSD","group":"High I/O"},{"name":"Extra Small
65
+ 512 MB","memory":512,"disk":15360,"swap":1024,"vcpus":1,"default":false,"id":"bfc06316-c22f-4143-801c-5a6d91812ba0","version":"1.0.0"},{"name":"XL
66
+ 32GB","memory":32768,"disk":778240,"swap":65536,"vcpus":16,"default":false,"id":"e988cb47-90c3-42e3-bc2f-4192c370f60c","version":"1.0.1"},{"name":"Large
67
+ 16GB","memory":16384,"disk":491520,"swap":32768,"vcpus":12,"default":false,"id":"f642bad3-c5c2-40a9-9082-3fe99ec6597a","version":"1.0.1"},{"name":"Small
68
+ 1GB","memory":1024,"disk":30720,"swap":2048,"vcpus":1,"default":true,"id":"d9396ca5-985e-47c6-b90f-6fa0795e60ad","version":"1.0.2"},{"name":"Medium
69
+ 2GB","memory":2048,"disk":61440,"swap":4096,"vcpus":2,"default":false,"id":"3b5fe076-b28c-4d23-bfc7-0435d9a7c412","version":"1.0.2"},{"name":"Medium
70
+ 4GB","memory":4096,"disk":122880,"swap":8192,"vcpus":4,"default":false,"id":"333814c2-b4a7-481f-9f86-73bb4122c7a3","version":"1.0.2"},{"name":"Large
71
+ 8GB","memory":8192,"disk":245760,"swap":16384,"vcpus":8,"default":false,"id":"3c275c86-498b-4f38-9910-82c0cfdffa34","version":"1.0.2"},{"name":"XXL
72
+ 48GB","memory":49152,"disk":1048576,"swap":98304,"vcpus":16,"default":false,"id":"439e5c84-4ea9-403c-aef4-da2e2227a6f9","version":"1.0.2"},{"name":"XXXL
73
+ 64GB","memory":65536,"disk":1572864,"swap":131072,"vcpus":16,"default":false,"id":"a7b1ff0c-faa5-4c2a-826b-21624920bfe7","version":"1.0.2"},{"name":"g3-standard-15-smartos","memory":15360,"disk":1502208,"swap":30720,"vcpus":0,"default":false,"id":"31b0fa76-c0bf-435f-a7d0-1eb18e845af2","version":"1.0.0","description":"Standard
74
+ 15 GB RAM 4 vCPUs and bursting 1467 GB Disk","group":"Standard"},{"name":"g3-highmemory-17.125-smartos","memory":17536,"disk":430080,"swap":35072,"vcpus":0,"default":false,"id":"1f80e822-c392-4cc1-876d-f2a11dcabfa7","version":"1.0.0","description":"High
75
+ Memory 17.1 GB RAM 2 vCPUs and bursting 420 GB Disk","group":"High Memory"},{"name":"g3-highmemory-17.125-kvm","memory":17536,"disk":430080,"swap":35072,"vcpus":2,"default":false,"id":"4531f389-dcf9-4897-b71b-bd92e3abbf45","version":"1.0.0","description":"High
76
+ Memory 17.1 GB RAM 2 vCPUs 420 GB Disk","group":"High Memory"},{"name":"g3-standard-8-kvm","memory":8192,"disk":807936,"swap":16384,"vcpus":2,"default":false,"id":"05d48d7c-2fd1-4290-a439-c98a1c85d248","version":"1.0.0","description":"Standard
77
+ 8 GB RAM 2 vCPUs 789 GB Disk","group":"Standard"},{"name":"g3-standard-30-kvm","memory":30720,"disk":1723392,"swap":61440,"vcpus":8,"default":false,"id":"1992cda2-0084-47e4-b5af-48e552608623","version":"1.0.0","description":"Standard
78
+ 30 GB RAM 8 vCPUs 1683 GB Disk","group":"Standard"},{"name":"g3-standard-1.75-smartos","memory":1792,"disk":57344,"swap":3584,"vcpus":0,"default":false,"id":"a59c0fc1-bb3a-4130-a5a8-fb0e98a5a7b9","version":"1.0.0","description":"Standard
79
+ 1.7 GB RAM 1 vCPU and bursting 56 GB Disk","group":"Standard"},{"name":"g3-standard-7.5-smartos","memory":7680,"disk":755712,"swap":15360,"vcpus":0,"default":false,"id":"6818f873-0bc5-49a2-a8e4-3c79e930e960","version":"1.0.0","description":"Standard
80
+ 7.5 GB RAM 2 vCPUs and bursting 738 GB Disk","group":"Standard"},{"name":"g3-highmemory-34.25-smartos","memory":35072,"disk":863232,"swap":70144,"vcpus":0,"default":false,"id":"1ee16856-6fa6-496c-a2bd-8ec3d923a44b","version":"1.0.0","description":"High
81
+ Memory 34.2 GB RAM 4 vCPUs and bursting 843 GB Disk","group":"High Memory"},{"name":"g3-highmemory-34.25-kvm","memory":35072,"disk":863232,"swap":70144,"vcpus":4,"default":false,"id":"a08b7689-f83d-4fe0-8291-a6a74909bf72","version":"1.0.0","description":"High
82
+ Memory 34.2 GB RAM 4 vCPUs 843 GB Disk","group":"High Memory"},{"name":"g3-standard-3.75-smartos","memory":3840,"disk":125952,"swap":7680,"vcpus":0,"default":false,"id":"2648aba0-f2ae-4efb-97bc-c71ca0de14b1","version":"1.0.0","description":"Standard
83
+ 3.75 GB RAM 1 vCPU and bursting 123 GB Disk","group":"Standard"},{"name":"g3-standard-30-smartos","memory":30720,"disk":1723392,"swap":61440,"vcpus":0,"default":false,"id":"c042153b-49fc-4673-a34d-03d76fefdc46","version":"1.0.0","description":"Standard
84
+ 30 GB RAM 8 vCPUs and bursting 1683 GB Disk","group":"Standard"},{"name":"g3-standard-64-smartos","memory":65536,"disk":2150400,"swap":131072,"vcpus":0,"default":false,"id":"bcb1c6f8-2371-424e-9c69-1cdfc168739d","version":"1.0.0","description":"Standard
85
+ 64 GB RAM 16 vCPUs and bursting 2100 GB Disk","group":"Standard"},{"name":"g3-standard-80-smartos","memory":81920,"disk":2688000,"swap":163840,"vcpus":0,"default":false,"id":"f5f06bb4-3824-4e76-89e7-e3780e378fc1","version":"1.0.0","description":"Standard
86
+ 80 GB RAM 20 vCPUs and bursting 2625 GB Disk","group":"Standard"},{"name":"g3-highmemory-68.375-smartos","memory":70016,"disk":1148928,"swap":140032,"vcpus":0,"default":false,"id":"7d7a5957-f859-4483-83c9-e11e2af7bf24","version":"1.0.0","description":"High
87
+ Memory 68.4 GB RAM 8 vCPUs and bursting 1122 GB Disk","group":"High Memory"},{"name":"g3-standard-0.25-smartos","memory":256,"disk":16384,"swap":512,"vcpus":0,"default":false,"id":"d71da280-92da-489f-9c4c-c91891fa202f","version":"1.0.0","description":"Micro
88
+ 0.25 GB RAM 0.125 vCPU and bursting 16 GB Disk","group":"Standard"},{"name":"g3-standard-48-smartos","memory":49152,"disk":1723392,"swap":98304,"vcpus":0,"default":false,"id":"08f18b9c-0de6-4ee3-bc08-e598caedc953","version":"1.0.0","description":"Standard
89
+ 48 GB RAM 12 vCPUs and bursting 1683 GB Disk","group":"Standard"},{"name":"g3-standard-0.625-smartos","memory":640,"disk":20480,"swap":1280,"vcpus":0,"default":false,"id":"6a6c0056-38b9-4982-90ad-682d63970b4c","version":"1.0.0","description":"Micro
90
+ 0.6 GB RAM 0.15 vCPU and bursting 20 GB Disk","group":"Standard"},{"name":"g3-standard-1-smartos","memory":1024,"disk":33792,"swap":2048,"vcpus":0,"default":false,"id":"11a01166-3f15-4857-bfde-b5c326acd85f","version":"1.0.0","description":"Standard
91
+ 1 GB RAM 0.25 vCPU and bursting 33 GB Disk","group":"Standard"},{"name":"g3-standard-4-smartos","memory":4096,"disk":134144,"swap":8192,"vcpus":0,"default":false,"id":"53be60b7-baa1-4bee-a337-c151b3eb34e9","version":"1.0.0","description":"Standard
92
+ 4 GB RAM 1 vCPU and bursting 131 GB Disk","group":"Standard"},{"name":"g3-standard-32-smartos","memory":32768,"disk":1723392,"swap":65536,"vcpus":0,"default":false,"id":"e8868374-b6dc-40a9-b50c-46b79854b192","version":"1.0.0","description":"Standard
93
+ 32 GB RAM 8 vCPUs and bursting 1683 GB Disk","group":"Standard"},{"name":"g3-standard-0.5-smartos","memory":512,"disk":16384,"swap":1024,"vcpus":0,"default":false,"id":"06a0251c-038f-4eda-8af2-653c46b3aee8","version":"1.0.0","description":"Micro
94
+ 0.5 GB RAM 0.125 vCPU and bursting 16 GB Disk","group":"Standard"},{"name":"g3-standard-2-smartos","memory":2048,"disk":67584,"swap":4096,"vcpus":0,"default":false,"id":"486bb054-6a97-4ba3-97b7-2413d5f8e849","version":"1.0.0","description":"Standard
95
+ 2 GB RAM 1 vCPU and bursting 66 GB Disk","group":"Standard"},{"name":"g3-standard-0.5-kvm","memory":512,"disk":16384,"swap":1024,"vcpus":1,"default":false,"id":"4f262a43-1151-45a0-a29c-e726e878c582","version":"1.0.0","description":"Micro
96
+ 0.5 GB RAM 1 vCPU 16 GB Disk","group":"Standard"},{"name":"g3-standard-7.5-kvm","memory":7680,"disk":755712,"swap":15360,"vcpus":2,"default":false,"id":"823082ec-c845-47c6-88bb-51df88db013d","version":"1.0.0","description":"Standard
97
+ 7.5 GB RAM 2 vCPUs 738 GB Disk","group":"Standard"},{"name":"g3-standard-15-kvm","memory":15360,"disk":1502208,"swap":30720,"vcpus":4,"default":false,"id":"53fdb34a-91bd-4034-ba95-750edfa8bfa9","version":"1.0.0","description":"Standard
98
+ 15 GB RAM 4 vCPUs 1467 GB Disk","group":"Standard"},{"name":"g3-standard-0.25-kvm","memory":256,"disk":16384,"swap":512,"vcpus":1,"default":false,"id":"f13b10ca-1a63-4903-b29e-8615ea3858a6","version":"1.0.0","description":"Micro
99
+ 0.25 GB RAM 1 vCPU 16 GB Disk","group":"Standard"},{"name":"g3-standard-1-kvm","memory":1024,"disk":33792,"swap":2048,"vcpus":1,"default":false,"id":"85284e54-5ae7-41e5-b765-4194655a52e4","version":"1.0.0","description":"Standard
100
+ 1 GB RAM 1 vCPU 33 GB Disk","group":"Standard"},{"name":"g3-standard-3.75-kvm","memory":3840,"disk":125952,"swap":7680,"vcpus":1,"default":false,"id":"6c061105-5822-4e97-81ee-1e127c8d00f6","version":"1.0.0","description":"Standard
101
+ 3.75 GB RAM 1 vCPU 123 GB Disk","group":"Standard"},{"name":"g3-standard-0.625-kvm","memory":640,"disk":20480,"swap":1280,"vcpus":1,"default":false,"id":"a37ba6f5-b643-46a6-8b5c-58eb660b2f09","version":"1.0.0","description":"Standard
102
+ 0.6 GB RAM 1 vCPU 20 GB Disk","group":"Standard"},{"name":"g3-standard-1.75-kvm","memory":1792,"disk":57344,"swap":3584,"vcpus":1,"default":false,"id":"8e5b81e1-e62f-4b3b-b06e-9a7d473ca1da","version":"1.0.0","description":"Standard
103
+ 1.7 GB RAM 1 vCPU 56 GB Disk","group":"Standard"},{"name":"g3-standard-4-kvm","memory":4096,"disk":134144,"swap":8192,"vcpus":1,"default":false,"id":"43e0444f-a065-4ea7-ba96-e941abc0b08f","version":"1.0.0","description":"Standard
104
+ 4 GB RAM 1 vCPU 131 GB Disk","group":"Standard"},{"name":"g3-standard-2-kvm","memory":2048,"disk":67584,"swap":4096,"vcpus":1,"default":false,"id":"8b7b089a-6b18-4057-95e4-24fccdbae6c5","version":"1.0.0","description":"Standard
105
+ 2 GB RAM 1 vCPU 66 GB Disk","group":"Standard"},{"name":"g3-highio-60.5-smartos","memory":61952,"disk":1486848,"swap":123904,"vcpus":0,"default":false,"id":"df9b1ed8-d165-4e3d-bf0d-805d35c9c489","version":"1.0.0","description":"High
106
+ I/O 60.5 GB RAM 8 vCPUs and bursting 1452 GB Disk","group":"High I/O"},{"name":"g3-highmemory-68.375-kvm","memory":70016,"disk":1148928,"swap":140032,"vcpus":8,"default":false,"id":"efa3eaa3-5086-46b2-99af-67621dd7363f","version":"1.0.0","description":"High
107
+ Memory 68.4 GB RAM 8 vCPUs 1122 GB Disk","group":"High Memory"},{"name":"g3-highio-60.5-kvm","memory":61952,"disk":1486848,"swap":123904,"vcpus":8,"default":false,"id":"5f3a2f56-3d95-4141-9880-fc65986be9d2","version":"1.0.0","description":"High
108
+ I/O 60.5 GB RAM 8 vCPUs 1452 GB Disk","group":"High I/O"},{"name":"g3-highcpu-8-kvm","memory":8192,"disk":307200,"swap":14336,"vcpus":8,"default":false,"id":"94444a5d-e03f-451d-a94a-d8c0532832ef","version":"1.1.0","description":"High
109
+ CPU 8 GB RAM 8 vCPUs 300 GB Disk","group":"High CPU"},{"name":"g3-highcpu-4-smartos","memory":4096,"disk":153600,"swap":8192,"vcpus":0,"default":false,"id":"80afced7-4bde-4026-afb5-7b41d5e30e60","version":"1.1.0","description":"High
110
+ CPU 4 GB RAM 4 vCPUs and bursting 150 GB Disk","group":"High CPU"},{"name":"g3-highcpu-24-smartos","memory":24576,"disk":921600,"swap":49152,"vcpus":0,"default":false,"id":"ae9b4795-92f0-4415-bce9-e3a9f02e6d9b","version":"1.1.0","description":"High
111
+ CPU 24 GB RAM 24 vCPUs and bursting 900 GB Disk","group":"High CPU"},{"name":"g3-highcpu-7-smartos","memory":7168,"disk":269312,"swap":14336,"vcpus":0,"default":false,"id":"3da4da4e-26d4-4ad9-84a5-16e41b71bdbe","version":"1.1.0","description":"High
112
+ CPU 7 GB RAM 7 vCPUs and bursting 263 GB Disk","group":"High CPU"},{"name":"g3-highcpu-8-smartos","memory":8192,"disk":307200,"swap":14336,"vcpus":0,"default":false,"id":"cfe77812-d37d-4b01-b61b-4586a702ef9d","version":"1.1.0","description":"High
113
+ CPU 8 GB RAM 8 vCPUs and bursting 300 GB Disk","group":"High CPU"},{"name":"g3-highcpu-1.75-smartos","memory":1792,"disk":76800,"swap":3584,"vcpus":0,"default":false,"id":"b6e1ec3e-5aa9-48db-bf32-72b7d99edc5c","version":"1.1.0","description":"High
114
+ CPU 1.7 GB RAM 2 vCPUs and bursting 75 GB Disk","group":"High CPU"},{"name":"g3-highcpu-16-smartos","memory":16384,"disk":614400,"swap":32768,"vcpus":0,"default":false,"id":"324293ad-474e-45fd-8506-a8c270db4cec","version":"1.1.0","description":"High
115
+ CPU 16 GB RAM 16 vCPUs and bursting 600 GB Disk","group":"High CPU"},{"name":"g3-highcpu-4-kvm","memory":4096,"disk":153600,"swap":8192,"vcpus":4,"default":false,"id":"a5fac9f7-1fc8-442b-87cc-4d2e0b787c39","version":"1.1.0","description":"High
116
+ CPU 4 GB RAM 4 vCPUs 150 GB Disk","group":"High CPU"},{"name":"g3-highcpu-1.75-kvm","memory":1792,"disk":76800,"swap":3584,"vcpus":2,"default":false,"id":"c341ac64-a937-4bbb-8c01-8b972a743098","version":"1.1.0","description":"High
117
+ CPU 1.7 GB RAM 2 vCPUs 75 GB Disk","group":"High CPU"},{"name":"g3-highcpu-7-kvm","memory":7168,"disk":269312,"swap":14336,"vcpus":7,"default":false,"id":"ebb5dffb-04fd-487f-bd03-581ade19f717","version":"1.1.0","description":"High
118
+ CPU 7 GB RAM 7 vCPUs 263 GB Disk","group":"High CPU"},{"name":"g3-devtier-0.25-kvm","memory":256,"disk":16384,"swap":512,"vcpus":1,"default":false,"id":"4dad8aa6-2c7c-e20a-be26-c7f4f1925a9a","version":"1.0.3","description":"DevTier
119
+ - Micro 0.25 GB RAM 1 vCPU 16 GB Disk","group":"Standard"},{"name":"g3-devtier-0.25-smartos","memory":256,"disk":16384,"swap":512,"vcpus":0,"default":false,"id":"9fcd9ab7-bd07-cb3c-9f9a-ac7ec3aa934e","version":"1.0.3","description":"DevTier
120
+ - Micro 0.25 GB RAM 0.125 vCPU and bursting 16 GB Disk","group":"Standard"}]'
121
+ http_version:
122
+ recorded_at: Sun, 15 Feb 2015 09:47:12 GMT
123
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,63 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://us-east-1.api.joyentcloud.com/my/packages/28d8c3f1-cf62-422a-a41d-fdf8b5110d00
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
+ - "+tETfdod/oAXBUdo7tuH/A=="
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
+ - '247'
57
+ body:
58
+ encoding: UTF-8
59
+ string: '{"name":"g3-standard-8-smartos","memory":8192,"disk":807936,"swap":16384,"vcpus":0,"default":false,"id":"28d8c3f1-cf62-422a-a41d-fdf8b5110d00","version":"1.0.0","description":"Standard
60
+ 8 GB RAM 2 vCPUs and bursting 789 GB Disk","group":"Standard"}'
61
+ http_version:
62
+ recorded_at: Sun, 15 Feb 2015 09:47:13 GMT
63
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,4 @@
1
+ hostname = example.com
2
+ version = ~7.0
3
+ username = user
4
+ use_key = 4c:02:f3:b2:09:fb:29:dd:41:97:da:80:bc:69:6c:f8
@@ -0,0 +1,27 @@
1
+ -----BEGIN RSA PRIVATE KEY-----
2
+ MIIEpAIBAAKCAQEAxYK2iurN0l75/HCBZAmDpTp1q2CNC8CPhT77ZqeqEUSS+Gl2
3
+ xrtCyyHdpl6sGYFjRguc2t6tIPqW7aWMiSprP3l4b0BoThjBQqzjY3Nt4W1JEhkX
4
+ swWbpXdrmII75uHoDExIW9Vb1ozfhVzF5VduthUeaar8O5OePrih+r47/Pd6hAUO
5
+ HA2i0q2D5m57I1jrYYRmGE+YWTzo+3ufxdNlbjc4vQWzxAVRM6xEiaOte+71l9oN
6
+ INqGaBuEmcB9UvgGkU1y/bz71SUsZC3WeT6eUFK3p+y9tbKHMz+35NJ6nuwz86i5
7
+ 52qMXeUwBeTKfjnZsj048ExZSkUzsXktjdwqLQIDAQABAoIBAFFe4MWqptEcv/D4
8
+ iNYl9U6FHyVTycgltPs4T2qjeLVUgxhEmuKVE5eMhDyelFiNrdCVyDGDu9/yXWva
9
+ 4GNCTpz/9lYfOtmx6S0G/UdjrslItOn33IOss8sfv/w862DbgTZP1x++bu+dahkP
10
+ d5hcxQfO+5CdGP2Se4drmZAr/5rfv/Z1j3Za6Zp/Q4MBaNz+KvRK7yqYY2GUl8vo
11
+ ITJHGOzV+Y6ePEJWVTY55dWXM/jlRoYf+kj6jZA7BLvpwprvK/amaYXmAegwbxxX
12
+ c9QMrs6BhWofdA44iBQngoov1mMQpebmcSenGcm0aolOifOpLLoONbztSl9oinxE
13
+ /CSQhiECgYEA+zfGi38dlZdmibASwErlBTnbPT4msxP/LFANglY+225ePYZocMto
14
+ lkxlC1Bf9eeEPWsMptzo69gEnATW3JK6dE+K3dnpaUkOHzi/LL5+RAFTi7uu+MFd
15
+ imi/py5yD74x3J+Z0uKErRRovYjC3sUsE/cXU+8Wdza/SMM4o+rpDScCgYEAyUU2
16
+ pC2j+QDwX5rQu4sX0L3Kpz6q7MLaIWVraWqlprXAMWdjlkBEhMcgHw9FS5DXCpf+
17
+ xm+9geJ1hkmujarox4aJAmbO3xlN0rfsbHvdh1WXv5Ji9DtwAcC4Ida+Kjl71Hz6
18
+ HlVMaQbA5rcmIzm+p70rDe9bSOMGsjlGTGjNiosCgYB0Ha+zwqmV/0jx02SXZQa+
19
+ h6OChzu0AkYr4USdPegH3NfKcFnN6PcKoX0C4b+5Fa3WBajvZ6RxfoOC6em2QkvU
20
+ fv+c06BDffT9EWmr8NDD9ij7qWCSsi3eT9RmHd2y0SKS62JaS0EwDwLquE/6UACz
21
+ qb4qmZQ0viVkKHgBrA7UeQKBgQC0dSIwwdsq/vSGQ8Cy5ltMBV8V5NJLxcjd+Jj9
22
+ w2kSuBLCOPjJVoYYppDeSErRHeQw02bTdIxtUCYfaSDgVESx4KYnSRZiYcWtEMsh
23
+ 2U0eclfEo/OlF0WtzKVLcca/BRtJwWRgngoMgMmkEsJXAwc2Th20OM+X4jW2xjOJ
24
+ fs4LUQKBgQDLqKPLZ6IZMo34d83q1OphrWJwwcHfl7Z/ZElJJkMEGrjidBEKa+ON
25
+ CmqeWpLMDJ5B5KmcyC32TRgQkch2Zlz2JLpINLB78KjXHJtIvVnydMDGb3u4Kttt
26
+ CWI3RcLWfDDDmDunFeaWwTLG09D5K+U6f2SY0StEmzFys0JeQRMQbA==
27
+ -----END RSA PRIVATE KEY-----
@@ -0,0 +1 @@
1
+ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDFgraK6s3SXvn8cIFkCYOlOnWrYI0LwI+FPvtmp6oRRJL4aXbGu0LLId2mXqwZgWNGC5za3q0g+pbtpYyJKms/eXhvQGhOGMFCrONjc23hbUkSGRezBZuld2uYgjvm4egMTEhb1VvWjN+FXMXlV262FR5pqvw7k54+uKH6vjv893qEBQ4cDaLSrYPmbnsjWOthhGYYT5hZPOj7e5/F02VuNzi9BbPEBVEzrESJo6177vWX2g0g2oZoG4SZwH1S+AaRTXL9vPvVJSxkLdZ5Pp5QUren7L21soczP7fk0nqe7DPzqLnnaoxd5TAF5Mp+OdmyPTjwTFlKRTOxeS2N3Cot
@@ -0,0 +1,47 @@
1
+ require 'spec_helper'
2
+
3
+ describe Smartdc::Api::Analytics do
4
+ describe ".describe_analytics", vcr: { cassette_name: 'analytics/describe' } do
5
+ it "receives list of analytic describe" do
6
+ expect(Smartdc.describe_analytics.content.count).to be > 0
7
+ end
8
+ end
9
+
10
+ describe ".create_analytic", vcr: { cassette_name: 'analytics/create' } do
11
+ let(:analytic) { { module: 'syscall', stat: 'syscalls' } }
12
+
13
+ it "creates a new analytic" do
14
+ expect(Smartdc.create_analytic(analytic).content.count).to be > 0
15
+ end
16
+ end
17
+
18
+ describe ".analytics", vcr: { cassette_name: 'analytics/index' } do
19
+ it "receives list of analytics" do
20
+ expect(Smartdc.analytics.content.count).to be > 0
21
+ end
22
+ end
23
+
24
+ context "machine exists" do
25
+ let(:id) do
26
+ VCR.use_cassette('analytics/index') { Smartdc.analytics.content.first['id'] }
27
+ end
28
+
29
+ describe ".analytic", vcr: { cassette_name: 'analytics/show' } do
30
+ it "receives a analytic" do
31
+ expect(Smartdc.analytic(id).content['id']).to eq(id)
32
+ end
33
+ end
34
+
35
+ describe ".value_analytic", vcr: { cassette_name: 'analytics/value' } do
36
+ it "values a analytic" do
37
+ expect(Smartdc.value_analytic(id).content['value']).to eq(0)
38
+ end
39
+ end
40
+
41
+ describe ".destroy_analytic", vcr: { cassette_name: 'analytics/destroy' } do
42
+ it "removes a analytic" do
43
+ expect(Smartdc.destroy_analytic(id).status).to eq(204)
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe Smartdc::Api::Datacenters do
4
+ describe ".datacenters", vcr: { cassette_name: 'datacenters/index' } do
5
+ it "receives list of datacenters" do
6
+ expect(Smartdc.datacenters.content.count).to be > 0
7
+ end
8
+ end
9
+
10
+ describe ".datacenter", vcr: { cassette_name: 'datacenters/show' } do
11
+ let(:name) do
12
+ VCR.use_cassette('datacenters/index') { Smartdc.datacenters.content.first[0] }
13
+ end
14
+
15
+ it "receives a datacenter" do
16
+ expect(Smartdc.datacenter(name).content['message']).to match(/#{name}/)
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe Smartdc::Api::Images do
4
+ describe ".images", vcr: { cassette_name: 'images/index' } do
5
+ it "receives list of images" do
6
+ expect(Smartdc.images.content.count).to be > 0
7
+ end
8
+ end
9
+
10
+ describe ".image", vcr: { cassette_name: 'images/show' } do
11
+ let(:id) do
12
+ VCR.use_cassette('images/index') { Smartdc.images.content.first['id'] }
13
+ end
14
+
15
+ it "receives a image" do
16
+ expect(Smartdc.image(id).content['id']).to eq(id)
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,34 @@
1
+ require 'spec_helper'
2
+
3
+ describe Smartdc::Api::Keys do
4
+ let(:key) do
5
+ {
6
+ name: 'example',
7
+ key: File.read(File.expand_path('./spec/fixtures/ssh/id_rsa.pub'))
8
+ }
9
+ end
10
+
11
+ describe ".create_key", vcr: { cassette_name: 'keys/create' } do
12
+ it "creates a new key" do
13
+ expect(Smartdc.create_key(key).content['name']).to eq(key[:name])
14
+ end
15
+ end
16
+
17
+ describe ".keys", vcr: { cassette_name: 'keys/index' } do
18
+ it "receives list of keys" do
19
+ expect(Smartdc.keys.content.count).to be > 0
20
+ end
21
+ end
22
+
23
+ describe ".key", vcr: { cassette_name: 'keys/show' } do
24
+ it "receives a key" do
25
+ expect(Smartdc.key(key[:name]).content['name']).to eq(key[:name])
26
+ end
27
+ end
28
+
29
+ describe ".destroy_key", vcr: { cassette_name: 'keys/destroy' } do
30
+ it "removes a key" do
31
+ expect(Smartdc.destroy_key(key[:name]).status).to eq(204)
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ describe Smartdc::Api::Machines::Metadata do
4
+ let(:id) do
5
+ VCR.use_cassette('machines/index') { Smartdc.machines.content.first['id'] }
6
+ end
7
+
8
+ describe ".update_machine_metadata", vcr: { cassette_name: 'machines/metadata/update' } do
9
+ let(:metadata) { { key: :value } }
10
+
11
+ it "creates a new machine metadata" do
12
+ expect(Smartdc.update_machine_metadata(id, metadata).content.count).to be > 0
13
+ end
14
+ end
15
+
16
+ describe ".machine_metadata", vcr: { cassette_name: 'machines/metadata/index' } do
17
+ it "receives list of machine metadata" do
18
+ expect(Smartdc.machine_metadata(id).content.count).to be > 0
19
+ end
20
+ end
21
+
22
+ describe ".destroy_machine_metadata", vcr: { cassette_name: 'machines/metadata/destroy' } do
23
+ it "removes a machine metadata" do
24
+ expect(Smartdc.destroy_machine_metadata(id, 'key').status).to eq(204)
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,38 @@
1
+ require 'spec_helper'
2
+
3
+ describe Smartdc::Api::Machines::Snapshots do
4
+ let(:snapshot) { { name: 'example' } }
5
+ let(:id) do
6
+ VCR.use_cassette('machines/index') { Smartdc.machines.content.first['id'] }
7
+ end
8
+
9
+ describe ".create_machine_snapshot", vcr: { cassette_name: 'machines/snapshots/create' } do
10
+ it "creates a new machine snapshot" do
11
+ expect(Smartdc.create_machine_snapshot(id, snapshot).content.count).to be > 0
12
+ end
13
+ end
14
+
15
+ describe ".machine_snapshots", vcr: { cassette_name: 'machines/snapshots/index' } do
16
+ it "receives list of machine snapshots" do
17
+ expect(Smartdc.machine_snapshots(id).content.count).to be > 0
18
+ end
19
+ end
20
+
21
+ describe ".machine_snapshot", vcr: { cassette_name: 'machines/snapshots/show' } do
22
+ it "receives a machine snapshot" do
23
+ expect(Smartdc.machine_snapshot(id, snapshot[:name]).content['name']).to eq(snapshot[:name])
24
+ end
25
+ end
26
+
27
+ describe ".start_machine_snapshot", vcr: { cassette_name: 'machines/snapshots/start' } do
28
+ it "starts a machine snapshot" do
29
+ expect(Smartdc.start_machine_snapshot(id, snapshot[:name]).status).to eq(202)
30
+ end
31
+ end
32
+
33
+ describe ".destroy_machine_snapshot", vcr: { cassette_name: 'machines/snapshots/destroy' } do
34
+ it "removes a machine snapshot" do
35
+ expect(Smartdc.destroy_machine_snapshot(id, snapshot[:name]).status).to eq(204)
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ describe Smartdc::Api::Machines::Tags do
4
+ let(:id) do
5
+ VCR.use_cassette('machines/index') { Smartdc.machines.content.first['id'] }
6
+ end
7
+
8
+ describe ".create_machine_tag", vcr: { cassette_name: 'machines/tags/create' } do
9
+ let(:tag) { { key: :value } }
10
+
11
+ it "creates a new machine tag" do
12
+ expect(Smartdc.create_machine_tag(id, tag).content.count).to be > 0
13
+ end
14
+ end
15
+
16
+ describe ".machine_tags", vcr: { cassette_name: 'machines/tags/index' } do
17
+ it "receives list of machine tags" do
18
+ expect(Smartdc.machine_tags(id).content.count).to be > 0
19
+ end
20
+ end
21
+
22
+ describe ".machine_tag", vcr: { cassette_name: 'machines/tags/show' } do
23
+ it "receives a machine tag" do
24
+ expect(Smartdc.machine_tag(id, 'key').content).to eq('"value"')
25
+ end
26
+ end
27
+
28
+ describe ".destroy_machine_tag", vcr: { cassette_name: 'machines/tags/destroy' } do
29
+ it "removes a machine tag" do
30
+ expect(Smartdc.destroy_machine_tag(id, 'key').status).to eq(204)
31
+ end
32
+ end
33
+ end