linodeapi 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +42 -0
- data/dev/spec.yml +152 -9
- data/lib/linodeapi.rb +0 -7
- data/linodeapi.gemspec +2 -2
- metadata +4 -5
- data/lib/linodeapi/api.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6394f88d9c7358a4903ea5245de4916b3d0318c6
|
4
|
+
data.tar.gz: 4fc2de46d5e3aaf95844b4720bda4285e81f7ba4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9364ea374b898fa6035724c49233f74b003a7732d0f047d3b386eae0a1c9da9be8ffb39560f08d99f9b923afbd2121932d55de4b27a104d261cd4a2be9de711
|
7
|
+
data.tar.gz: 9e90e89aea6e51a67bad8cbed56c8b277c01a4aaed11d292020af15596d10e3cd09b1de5c5deacc2d597b6185b4794f49a18c827e4836f2f78de19e62763ca6b
|
data/README.md
CHANGED
@@ -12,6 +12,48 @@ Ruby API wrapper for the [Linode API](https://www.linode.com/api)
|
|
12
12
|
|
13
13
|
## Usage
|
14
14
|
|
15
|
+
Create an API object from the LinodeAPI::Raw class, by providing it with either an API key or username and password:
|
16
|
+
|
17
|
+
```
|
18
|
+
require 'linodeapi'
|
19
|
+
|
20
|
+
api_one = LinodeAPI::Raw(apikey: 'YOUR_KEY_HERE')
|
21
|
+
api_two = LinodeAPI::Raw(username: 'akerl', password: 'cyberpond')
|
22
|
+
```
|
23
|
+
|
24
|
+
The Raw API object is a faithful representation of Linode's [API spec](https://www.linode.com/api/utility/api.spec), parsed directly from the upstream source at runtime. Calls can be made using the methods shown in Linode's [API docs](https://www.linode.com/api):
|
25
|
+
|
26
|
+
```
|
27
|
+
# cat list.rb
|
28
|
+
require 'linodeapi'
|
29
|
+
|
30
|
+
api = LinodeAPI::Raw.new(apikey: 'KEY')
|
31
|
+
|
32
|
+
result = api.linode.list
|
33
|
+
|
34
|
+
puts "#{result.size} Linodes found: #{result.map(&:label).join(', ')}"
|
35
|
+
p result.first
|
36
|
+
```
|
37
|
+
|
38
|
+
```
|
39
|
+
# ruby list.rb
|
40
|
+
6 Linodes found: miro, olhado, quara, grego, ela, quim
|
41
|
+
#<OpenStruct alert_cpu_enabled=0, alert_bwin_enabled=0, alert_bwquota_enabled=0, alert_diskio_threshold=1000, backupwindow=4, watchdog=1, distributionvendor="Arch", datacenterid=6, status=1, alert_diskio_enabled=0, create_dt="2014-07-30 20:09:12.0", totalhd=49152, alert_bwquota_threshold=80, totalram=2048, alert_bwin_threshold=5, linodeid=591319, alert_bwout_threshold=5, alert_bwout_enabled=0, backupsenabled=0, alert_cpu_threshold=90, planid=2, backupweeklyday=0, label="miro", lpm_displaygroup="cluster", totalxfer=3000>
|
42
|
+
```
|
43
|
+
|
44
|
+
Arguments passed in are named just like in the docs:
|
45
|
+
|
46
|
+
```
|
47
|
+
api.linode.ip.list(linodeid: 591319)
|
48
|
+
```
|
49
|
+
|
50
|
+
The library will raise an exception if you exclude a required parameter:
|
51
|
+
|
52
|
+
```
|
53
|
+
api.linode.create
|
54
|
+
# ArgumentError: linode.create requires planid
|
55
|
+
```
|
56
|
+
|
15
57
|
## Installation
|
16
58
|
|
17
59
|
gem install linodeapi
|
data/dev/spec.yml
CHANGED
@@ -80,6 +80,10 @@ avail:
|
|
80
80
|
kernels:
|
81
81
|
- desc: List available kernels.
|
82
82
|
- params:
|
83
|
+
- iskvm:
|
84
|
+
- desc: Limits the results to show only KVM kernels
|
85
|
+
- required: false
|
86
|
+
- type: :boolean
|
83
87
|
- isxen:
|
84
88
|
- desc: Limits the results to show only Xen kernels
|
85
89
|
- required: false
|
@@ -479,14 +483,18 @@ linode:
|
|
479
483
|
- desc: Enable the disableUpdateDB filesystem helper
|
480
484
|
- required: false
|
481
485
|
- type: :boolean
|
486
|
+
- helper_distro:
|
487
|
+
- desc: Enable the Distro filesystem helper. Corrects fstab and inittab/upstart
|
488
|
+
entries depending on the kernel you're booting. You want this.
|
489
|
+
- required: false
|
490
|
+
- type: :boolean
|
482
491
|
- helper_network:
|
483
492
|
- desc: Automatically creates network configuration files for your distro
|
484
493
|
and places them into your filesystem.
|
485
494
|
- required: false
|
486
495
|
- type: :boolean
|
487
496
|
- helper_xen:
|
488
|
-
- desc:
|
489
|
-
entries depending on the kernel you're booting. You want this.
|
497
|
+
- desc: Deprecated - use helper_distro.
|
490
498
|
- required: false
|
491
499
|
- type: :boolean
|
492
500
|
- kernelid:
|
@@ -522,6 +530,10 @@ linode:
|
|
522
530
|
- desc: 'One of ''default'', ''single'', ''binbash'' '
|
523
531
|
- required: false
|
524
532
|
- type: :string
|
533
|
+
- virt_mode:
|
534
|
+
- desc: 'Controls the virtualization mode. One of ''paravirt'', ''fullvirt'' '
|
535
|
+
- required: false
|
536
|
+
- type: :string
|
525
537
|
- throws:
|
526
538
|
- NOTFOUND
|
527
539
|
- VALIDATION
|
@@ -580,14 +592,18 @@ linode:
|
|
580
592
|
- desc: Enable the disableUpdateDB filesystem helper
|
581
593
|
- required: false
|
582
594
|
- type: :boolean
|
595
|
+
- helper_distro:
|
596
|
+
- desc: Enable the Distro filesystem helper. Corrects fstab and inittab/upstart
|
597
|
+
entries depending on the kernel you're booting. You want this.
|
598
|
+
- required: false
|
599
|
+
- type: :boolean
|
583
600
|
- helper_network:
|
584
601
|
- desc: Automatically creates network configuration files for your distro
|
585
602
|
and places them into your filesystem.
|
586
603
|
- required: false
|
587
604
|
- type: :boolean
|
588
605
|
- helper_xen:
|
589
|
-
- desc:
|
590
|
-
entries depending on the kernel you're booting. You want this.
|
606
|
+
- desc: Deprecated - use helper_distro.
|
591
607
|
- required: false
|
592
608
|
- type: :boolean
|
593
609
|
- kernelid:
|
@@ -623,6 +639,10 @@ linode:
|
|
623
639
|
- desc: 'One of ''default'', ''single'', ''binbash'' '
|
624
640
|
- required: false
|
625
641
|
- type: :string
|
642
|
+
- virt_mode:
|
643
|
+
- desc: 'Controls the virtualization mode. One of ''paravirt'', ''fullvirt'' '
|
644
|
+
- required: false
|
645
|
+
- type: :string
|
626
646
|
- throws:
|
627
647
|
- NOTFOUND
|
628
648
|
- VALIDATION
|
@@ -1174,13 +1194,19 @@ nodebalancer:
|
|
1174
1194
|
- required: false
|
1175
1195
|
- type: :string
|
1176
1196
|
- check_body:
|
1177
|
-
- desc: When check=
|
1197
|
+
- desc: When check=http, a regex to match within the first 16,384 bytes of
|
1198
|
+
the response body
|
1178
1199
|
- required: false
|
1179
1200
|
- type: :string
|
1180
1201
|
- check_interval:
|
1181
1202
|
- desc: Seconds between health check probes. 2-3600
|
1182
1203
|
- required: false
|
1183
1204
|
- type: :numeric
|
1205
|
+
- check_passive:
|
1206
|
+
- desc: Enable passive checks based on observing communication with back-end
|
1207
|
+
nodes.
|
1208
|
+
- required: false
|
1209
|
+
- type: :boolean
|
1184
1210
|
- check_path:
|
1185
1211
|
- desc: When check=http, the path to request
|
1186
1212
|
- required: false
|
@@ -1261,13 +1287,19 @@ nodebalancer:
|
|
1261
1287
|
- required: false
|
1262
1288
|
- type: :string
|
1263
1289
|
- check_body:
|
1264
|
-
- desc: When check=
|
1290
|
+
- desc: When check=http, a regex to match within the first 16,384 bytes of
|
1291
|
+
the response body
|
1265
1292
|
- required: false
|
1266
1293
|
- type: :string
|
1267
1294
|
- check_interval:
|
1268
1295
|
- desc: Seconds between health check probes. 2-3600
|
1269
1296
|
- required: false
|
1270
1297
|
- type: :numeric
|
1298
|
+
- check_passive:
|
1299
|
+
- desc: Enable passive checks based on observing communication with back-end
|
1300
|
+
nodes.
|
1301
|
+
- required: false
|
1302
|
+
- type: :boolean
|
1271
1303
|
- check_path:
|
1272
1304
|
- desc: When check=http, the path to request
|
1273
1305
|
- required: false
|
@@ -1440,6 +1472,117 @@ nodebalancer:
|
|
1440
1472
|
- throws:
|
1441
1473
|
- NOTFOUND
|
1442
1474
|
- VALIDATION
|
1475
|
+
professionalservices:
|
1476
|
+
scope:
|
1477
|
+
create:
|
1478
|
+
- desc: Creates a new Professional Services scope submission
|
1479
|
+
- params:
|
1480
|
+
- application_quantity:
|
1481
|
+
- desc: How many separate applications or websites are involved in this migration?
|
1482
|
+
- required: false
|
1483
|
+
- type: :string
|
1484
|
+
- content_management:
|
1485
|
+
- desc: Centralized interfaces for editing, organizing, and publishing content
|
1486
|
+
- required: false
|
1487
|
+
- type: :string
|
1488
|
+
- crossover:
|
1489
|
+
- desc: These can assist in providing reliable crossover--failures of individual
|
1490
|
+
components can be transparent to the application.
|
1491
|
+
- required: false
|
1492
|
+
- type: :string
|
1493
|
+
- current_provider:
|
1494
|
+
- desc: ''
|
1495
|
+
- required: false
|
1496
|
+
- type: :string
|
1497
|
+
- customer_name:
|
1498
|
+
- desc: ''
|
1499
|
+
- required: false
|
1500
|
+
- type: :string
|
1501
|
+
- database_server:
|
1502
|
+
- desc: Generally used by applications to provide an organized way to capture
|
1503
|
+
and manipulate data
|
1504
|
+
- required: false
|
1505
|
+
- type: :string
|
1506
|
+
- email_address:
|
1507
|
+
- desc: ''
|
1508
|
+
- required: false
|
1509
|
+
- type: :string
|
1510
|
+
- linode_datacenter:
|
1511
|
+
- desc: Which datacenters would you like your Linodes to be deployed in?
|
1512
|
+
- required: false
|
1513
|
+
- type: :string
|
1514
|
+
- linode_plan:
|
1515
|
+
- desc: Which Linode plans would you like to deploy?
|
1516
|
+
- required: false
|
1517
|
+
- type: :string
|
1518
|
+
- mail_filtering:
|
1519
|
+
- desc: Services here manipulate recieved messages in various ways
|
1520
|
+
- required: false
|
1521
|
+
- type: :string
|
1522
|
+
- mail_retrieval:
|
1523
|
+
- desc: User mail clients connect to these to retrieve delivered mail
|
1524
|
+
- required: false
|
1525
|
+
- type: :string
|
1526
|
+
- mail_transfer:
|
1527
|
+
- desc: Mail transfer agents facilitate message transfer between servers
|
1528
|
+
- required: false
|
1529
|
+
- type: :string
|
1530
|
+
- managed:
|
1531
|
+
- desc: ''
|
1532
|
+
- required: false
|
1533
|
+
- type: :string
|
1534
|
+
- monitoring:
|
1535
|
+
- desc: Constant monitoring of your deployed systems--these can also provide
|
1536
|
+
automatic notifications for service failures.
|
1537
|
+
- required: false
|
1538
|
+
- type: :string
|
1539
|
+
- notes:
|
1540
|
+
- desc: ''
|
1541
|
+
- required: false
|
1542
|
+
- type: :string
|
1543
|
+
- phone_number:
|
1544
|
+
- desc: ''
|
1545
|
+
- required: false
|
1546
|
+
- type: :string
|
1547
|
+
- provider_access:
|
1548
|
+
- desc: What types of server access do you have at your current provider?
|
1549
|
+
- required: false
|
1550
|
+
- type: :string
|
1551
|
+
- replication:
|
1552
|
+
- desc: Redundant services often have shared state--replication automatically
|
1553
|
+
propagates state changes between individual components.
|
1554
|
+
- required: false
|
1555
|
+
- type: :string
|
1556
|
+
- requested_service:
|
1557
|
+
- desc: ''
|
1558
|
+
- required: false
|
1559
|
+
- type: :string
|
1560
|
+
- server_quantity:
|
1561
|
+
- desc: How many separate servers are involved in this migration?
|
1562
|
+
- required: false
|
1563
|
+
- type: :string
|
1564
|
+
- system_administration:
|
1565
|
+
- desc: Various web interfaces for performing system administration tasks
|
1566
|
+
- required: false
|
1567
|
+
- type: :string
|
1568
|
+
- ticket_number:
|
1569
|
+
- desc: ''
|
1570
|
+
- required: false
|
1571
|
+
- type: :string
|
1572
|
+
- web_cache:
|
1573
|
+
- desc: Caching mechanisms provide temporary storage for web requests--cached
|
1574
|
+
content can generally be retrieved faster.
|
1575
|
+
- required: false
|
1576
|
+
- type: :string
|
1577
|
+
- web_server:
|
1578
|
+
- desc: These provide network protocol handling for hosting websites.
|
1579
|
+
- required: false
|
1580
|
+
- type: :string
|
1581
|
+
- webmail:
|
1582
|
+
- desc: Access and administrate mail via web interfaces
|
1583
|
+
- required: false
|
1584
|
+
- type: :string
|
1585
|
+
- throws: []
|
1443
1586
|
stackscript:
|
1444
1587
|
create:
|
1445
1588
|
- desc: Create a StackScript.
|
@@ -1558,6 +1701,6 @@ user:
|
|
1558
1701
|
- type: :string
|
1559
1702
|
- throws:
|
1560
1703
|
- AUTHFAIL
|
1561
|
-
-
|
1562
|
-
-
|
1563
|
-
-
|
1704
|
+
- NEEDTOKEN
|
1705
|
+
- PASSWORDEXPIRED
|
1706
|
+
- KEYLIMIT
|
data/lib/linodeapi.rb
CHANGED
@@ -10,13 +10,6 @@ module LinodeAPI
|
|
10
10
|
SPEC_URL = 'https://api.linode.com/?api_action=api.spec'
|
11
11
|
|
12
12
|
class << self
|
13
|
-
##
|
14
|
-
# Insert a helper .new() method for creating a new API object
|
15
|
-
|
16
|
-
def new(*args)
|
17
|
-
self::API.new(*args)
|
18
|
-
end
|
19
|
-
|
20
13
|
def spec
|
21
14
|
@spec ||= { type: :group, subs: fetch_spec }
|
22
15
|
end
|
data/linodeapi.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'linodeapi'
|
3
|
-
s.version = '0.
|
3
|
+
s.version = '0.2.0'
|
4
4
|
s.date = Time.now.strftime("%Y-%m-%d")
|
5
5
|
|
6
6
|
s.summary = 'Linode API wrapper'
|
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
|
16
16
|
s.add_dependency 'httparty', '~> 0.13.1'
|
17
17
|
|
18
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
18
|
+
s.add_development_dependency 'rubocop', '~> 0.33.0'
|
19
19
|
s.add_development_dependency 'rake', '~> 10.4.0'
|
20
20
|
s.add_development_dependency 'coveralls', '~> 0.8.0'
|
21
21
|
s.add_development_dependency 'rspec', '~> 3.3.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linodeapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Les Aker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.33.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.33.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -125,7 +125,6 @@ files:
|
|
125
125
|
- dev/cache_spec.rb
|
126
126
|
- dev/spec.yml
|
127
127
|
- lib/linodeapi.rb
|
128
|
-
- lib/linodeapi/api.rb
|
129
128
|
- lib/linodeapi/raw.rb
|
130
129
|
- linodeapi.gemspec
|
131
130
|
- spec/linodeapi_spec.rb
|