fastly 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +35 -0
- data/.travis.yml +3 -4
- data/Gemfile +1 -0
- data/HISTORY.md +11 -1
- data/README.md +5 -1
- data/Rakefile +27 -2
- data/bin/fastly_create_domain +67 -0
- data/lib/fastly.rb +114 -114
- data/lib/fastly/backend.rb +51 -51
- data/lib/fastly/base.rb +9 -9
- data/lib/fastly/belongs_to_service_and_version.rb +10 -10
- data/lib/fastly/cache_setting.rb +3 -3
- data/lib/fastly/client.rb +11 -11
- data/lib/fastly/condition.rb +7 -7
- data/lib/fastly/customer.rb +6 -6
- data/lib/fastly/director.rb +25 -25
- data/lib/fastly/domain.rb +13 -13
- data/lib/fastly/fetcher.rb +7 -7
- data/lib/fastly/gem_version.rb +1 -1
- data/lib/fastly/gzip.rb +5 -5
- data/lib/fastly/header.rb +5 -5
- data/lib/fastly/healthcheck.rb +28 -28
- data/lib/fastly/invoice.rb +36 -36
- data/lib/fastly/match.rb +38 -38
- data/lib/fastly/origin.rb +14 -14
- data/lib/fastly/request_setting.rb +9 -9
- data/lib/fastly/response_object.rb +5 -5
- data/lib/fastly/s3_logging.rb +6 -6
- data/lib/fastly/service.rb +26 -26
- data/lib/fastly/settings.rb +14 -14
- data/lib/fastly/syslog.rb +37 -37
- data/lib/fastly/user.rb +18 -18
- data/lib/fastly/vcl.rb +12 -12
- data/lib/fastly/version.rb +32 -32
- data/test/common.rb +1 -1
- metadata +14 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ef98fd25ca8d8bc9e1b8a59c3f9871bf55297c3
|
4
|
+
data.tar.gz: ca25acfcc5fc2530bb4fe0b3684444de0cc2060b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 342af0046a3402e92d87d2c0dfabf93ffba77674ffe817e21f11ff66f65c0ec14f8b3f02278359865b3898394fe2c8016f6b12297adc1c64d8da8a1d10b2821a
|
7
|
+
data.tar.gz: b9a5b946c3525e4bfe6f6ccf7a186136a5349c5bd9f87d633f3309873a850061397a8b19f3525dcadec20b9f0cf4d1738dd48a9d38860fc578b3feb92e10d3a1
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# inherit_from:
|
2
|
+
# - rubocop-todo.yml
|
3
|
+
|
4
|
+
LineLength:
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
HashSyntax:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
BracesAroundHashParameters:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
BlockNesting:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
AssignmentInCondition:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
CollectionMethods:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
CyclomaticComplexity:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
MethodLength:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
PerlBackrefs:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
RescueModifier:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
HandleExceptions:
|
35
|
+
Enabled: false
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/HISTORY.md
CHANGED
@@ -1,4 +1,14 @@
|
|
1
|
-
#
|
1
|
+
# HEAD
|
2
|
+
|
3
|
+
|
4
|
+
# 2014-07-25 v1.1.3
|
5
|
+
* Add test:unit rake task
|
6
|
+
* Add Rubocop and some rubocop cleanup
|
7
|
+
* Clarify gem name in documentation
|
8
|
+
* Fix a bug in the `Fastly.get_options` method
|
9
|
+
* Add `bin/fastly_create_domain` script to easily create domain
|
10
|
+
|
11
|
+
#### 2014-06-12 v1.1.2
|
2
12
|
* Replace `String#underscore` with `Fastly::Util.class_to_path` method.
|
3
13
|
* Add first true unit test
|
4
14
|
* Add `test_helper.rb`
|
data/README.md
CHANGED
@@ -1,10 +1,14 @@
|
|
1
|
-
# Fastly
|
1
|
+
# Fastly [![Build Status](https://travis-ci.org/fastly/fastly-ruby.svg?branch=master)](https://travis-ci.org/fastly/fastly-ruby)
|
2
2
|
|
3
3
|
Client library for interacting with the Fastly web acceleration service [API](http://docs.fastly.com/api)
|
4
4
|
|
5
5
|
## Example
|
6
6
|
|
7
7
|
```ruby
|
8
|
+
# Gemfile
|
9
|
+
gem 'fastly'
|
10
|
+
|
11
|
+
# some_file.rb
|
8
12
|
fastly = Fastly.new(login_opts)
|
9
13
|
|
10
14
|
current_user = fastly.current_user
|
data/Rakefile
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
|
-
require 'rake/testtask'
|
3
|
-
require 'rdoc/task'
|
4
2
|
|
5
3
|
desc 'Run library from within a Pry console'
|
6
4
|
task :console do
|
@@ -10,12 +8,39 @@ task :console do
|
|
10
8
|
Pry.start
|
11
9
|
end
|
12
10
|
|
11
|
+
namespace :clean do
|
12
|
+
desc 'Remove all trailing whitespace from Ruby files in lib and test'
|
13
|
+
task :whitespace do
|
14
|
+
sh "find {test,lib,bin} -name *.rb -exec sed -i '' 's/[ ]*$//' {} \\\;"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'rubocop/rake_task'
|
19
|
+
|
20
|
+
desc 'Run rubocop'
|
21
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
22
|
+
task.patterns = ['bin/*', 'lib/**/*.rb', 'test/**/*.rb']
|
23
|
+
task.formatters = ['fuubar']
|
24
|
+
task.fail_on_error = true
|
25
|
+
end
|
26
|
+
|
27
|
+
require 'rdoc/task'
|
28
|
+
|
13
29
|
RDoc::Task.new do |rdoc|
|
14
30
|
rdoc.rdoc_dir = 'doc'
|
15
31
|
rdoc.main = 'README.md'
|
16
32
|
rdoc.rdoc_files.include('README.md', 'lib/**/*.rb')
|
17
33
|
end
|
18
34
|
|
35
|
+
namespace :test do
|
36
|
+
desc 'Run all unit tests'
|
37
|
+
task :unit do
|
38
|
+
sh 'bundle exec ruby -Itest -Ilib test/fastly/*_test.rb'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
require 'rake/testtask'
|
43
|
+
|
19
44
|
Rake::TestTask.new do |t|
|
20
45
|
t.libs << 'test'
|
21
46
|
t.test_files = FileList['test/*test.rb']
|
@@ -0,0 +1,67 @@
|
|
1
|
+
#!/bin/env ruby
|
2
|
+
|
3
|
+
##
|
4
|
+
# fastly_upload_vcl - upload raw VCL files to Fastly
|
5
|
+
#
|
6
|
+
# Author:: Fastly Inc <support@fastly.com>
|
7
|
+
# Copyright:: Copyright (c) 2011 Fastly Inc
|
8
|
+
# License:: Distributes under the same terms as Ruby
|
9
|
+
#
|
10
|
+
# = USAGE
|
11
|
+
#
|
12
|
+
# fastly_create_domain <options> <service id> <domain name>
|
13
|
+
#
|
14
|
+
# = CONFIGURATION
|
15
|
+
#
|
16
|
+
# You can either have a config file in ~/.fastly or /etc/fastly with
|
17
|
+
#
|
18
|
+
# api_key = <api_key>
|
19
|
+
#
|
20
|
+
# Alternatively you can pass in any of those options on the command line
|
21
|
+
#
|
22
|
+
# fastly_create_domain --api_key=<key> <service id> <domain name>
|
23
|
+
|
24
|
+
require 'rubygems'
|
25
|
+
require 'fastly'
|
26
|
+
|
27
|
+
def get_options(*files)
|
28
|
+
options = {}
|
29
|
+
files.each do |file|
|
30
|
+
next unless File.exist?(file)
|
31
|
+
options = load_config(file)
|
32
|
+
break
|
33
|
+
end
|
34
|
+
|
35
|
+
while (ARGV.size>0 && ARGV[0] =~ /^-+(\w+)\=(\w+)$/) do
|
36
|
+
options[$1.to_sym] = $2;
|
37
|
+
ARGV.shift;
|
38
|
+
end
|
39
|
+
raise"Couldn't find options from command line arguments or #{files.join(', ')}" unless options.size>0
|
40
|
+
options;
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
# :nodoc:
|
45
|
+
def die(message)
|
46
|
+
warn message
|
47
|
+
exit -1
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
params = get_options("#{ENV['HOME']}/.fastly", "/etc/fastly")
|
52
|
+
|
53
|
+
service_id = ARGV.shift || die("You must pass in a service id")
|
54
|
+
domain_name = ARGV.shift || die("You must pass in a domain name")
|
55
|
+
|
56
|
+
die("Couldn't find any of the config files - #{configs.join(',')}") unless params.keys.size>0
|
57
|
+
|
58
|
+
fastly = Fastly.new(params)
|
59
|
+
|
60
|
+
service = fastly.get_service(service_id) || die("Couldn't find service #{service_id}")
|
61
|
+
version = service.version
|
62
|
+
cloned_version = version.clone
|
63
|
+
domain = fastly.create_domain(:service_id => service.id, :version => cloned_version.number, :name => domain_name)
|
64
|
+
cloned_version.activate!
|
65
|
+
|
66
|
+
puts "Done! Created Domain: #{domain.name}. Active Version: #{domain.version.number}"
|
67
|
+
|
data/lib/fastly.rb
CHANGED
@@ -15,7 +15,7 @@ class Fastly
|
|
15
15
|
require 'fastly/cache_setting'
|
16
16
|
require 'fastly/condition'
|
17
17
|
require 'fastly/customer'
|
18
|
-
require 'fastly/director'
|
18
|
+
require 'fastly/director'
|
19
19
|
require 'fastly/domain'
|
20
20
|
require 'fastly/header'
|
21
21
|
require 'fastly/healthcheck'
|
@@ -36,13 +36,13 @@ class Fastly
|
|
36
36
|
include Fastly::Fetcher
|
37
37
|
|
38
38
|
# Create a new Fastly client. Options are
|
39
|
-
#
|
39
|
+
#
|
40
40
|
# user:: your Fastly login
|
41
41
|
# password:: your Fastly password
|
42
42
|
# api_key:: your Fastly api key
|
43
|
-
#
|
44
|
-
# You only need to pass in C<api_key> OR C<user> and C<password>.
|
45
|
-
#
|
43
|
+
#
|
44
|
+
# You only need to pass in C<api_key> OR C<user> and C<password>.
|
45
|
+
#
|
46
46
|
# Some methods require full username and password rather than just auth token.
|
47
47
|
def initialize(opts)
|
48
48
|
self.client(opts)
|
@@ -78,14 +78,14 @@ class Fastly
|
|
78
78
|
def set_customer(id)
|
79
79
|
raise Fastly::FullAuthRequired "You must be fully authed to set the customer" unless self.fully_authed?;
|
80
80
|
raise Fastly::AdminRequired "You must be an admin to set the customer" unless self.current_user.can_do?(:admin);
|
81
|
-
@current_customer = nil
|
81
|
+
@current_customer = nil
|
82
82
|
client.set_customer(id);
|
83
83
|
end
|
84
84
|
|
85
85
|
# Return a hash representing all commands available.
|
86
86
|
#
|
87
87
|
# Useful for information.
|
88
|
-
def commands
|
88
|
+
def commands
|
89
89
|
client.get('/commands')
|
90
90
|
end
|
91
91
|
|
@@ -113,21 +113,21 @@ class Fastly
|
|
113
113
|
# See http://docs.fastly.com/docs/stats for details.
|
114
114
|
def stats(opts)
|
115
115
|
raise Fastly::Error.new("You can't specify a field or a service for an aggregate request") if opts[:aggregate] && (opts[:field] || opts[:service])
|
116
|
-
|
116
|
+
|
117
117
|
url = "/stats"
|
118
118
|
|
119
119
|
if opts.delete(:aggregate)
|
120
120
|
url += "/aggregate"
|
121
121
|
end
|
122
|
-
|
122
|
+
|
123
123
|
if service = opts.delete(:service)
|
124
124
|
url += "/service/#{service}"
|
125
125
|
end
|
126
|
-
|
126
|
+
|
127
127
|
if field = opts.delete(:field)
|
128
128
|
url += "/field/#{field}"
|
129
129
|
end
|
130
|
-
|
130
|
+
|
131
131
|
client.get_stats(url, opts);
|
132
132
|
end
|
133
133
|
|
@@ -154,7 +154,7 @@ class Fastly
|
|
154
154
|
client.get_stats("/stats/regions")
|
155
155
|
end
|
156
156
|
|
157
|
-
[User, Customer, Backend, CacheSetting, Condition, Director, Domain, Header, Healthcheck, Gzip, Match, Origin, RequestSetting, ResponseObject, Service, S3Logging, Syslog, VCL, Version].each do |klass|
|
157
|
+
[User, Customer, Backend, CacheSetting, Condition, Director, Domain, Header, Healthcheck, Gzip, Match, Origin, RequestSetting, ResponseObject, Service, S3Logging, Syslog, VCL, Version].each do |klass|
|
158
158
|
type = Util.class_to_path(klass)
|
159
159
|
# unless the class doesn't have a list path or it already exists
|
160
160
|
unless klass.list_path.nil? || klass.respond_to?("list_#{type}s".to_sym)
|
@@ -162,7 +162,7 @@ class Fastly
|
|
162
162
|
list(klass, *args)
|
163
163
|
end
|
164
164
|
end
|
165
|
-
|
165
|
+
|
166
166
|
self.send :define_method, "get_#{type}".to_sym do |*args|
|
167
167
|
get(klass, *args)
|
168
168
|
end
|
@@ -184,11 +184,11 @@ class Fastly
|
|
184
184
|
# :method: create_version(opts)
|
185
185
|
# opts must contain a service_id param
|
186
186
|
|
187
|
-
##
|
187
|
+
##
|
188
188
|
# :method: create_backend(opts)
|
189
189
|
# opts must contain service_id, version and name params
|
190
190
|
|
191
|
-
##
|
191
|
+
##
|
192
192
|
# :method: create_director(opts)
|
193
193
|
# opts must contain service_id, version and name params
|
194
194
|
|
@@ -203,11 +203,11 @@ class Fastly
|
|
203
203
|
##
|
204
204
|
# :method: create_origin(opts)
|
205
205
|
# opts must contain service_id, version and name params
|
206
|
-
|
206
|
+
|
207
207
|
##
|
208
208
|
# :method: create_healthcheck(opts)
|
209
209
|
# opts must contain service_id, version and name params
|
210
|
-
|
210
|
+
|
211
211
|
##
|
212
212
|
# :method: create_s3_logging(opts)
|
213
213
|
# opts must contain service_id, version and name params
|
@@ -219,7 +219,7 @@ class Fastly
|
|
219
219
|
##
|
220
220
|
# :method: create_vcl(opts)
|
221
221
|
# opts must contain service_id, version and name params
|
222
|
-
|
222
|
+
|
223
223
|
##
|
224
224
|
# :method: create_condition(opts)
|
225
225
|
# opts must contain service_id, version and name params
|
@@ -248,11 +248,11 @@ class Fastly
|
|
248
248
|
# :method: get_user(id)
|
249
249
|
# Get a User
|
250
250
|
|
251
|
-
##
|
251
|
+
##
|
252
252
|
# :method: get_customer(id)
|
253
253
|
# Get a customer
|
254
254
|
|
255
|
-
##
|
255
|
+
##
|
256
256
|
# :method: get_service(id)
|
257
257
|
# Get a Service
|
258
258
|
|
@@ -264,67 +264,67 @@ class Fastly
|
|
264
264
|
# :method: get_backend(service_id, number, name)
|
265
265
|
# Get a backend
|
266
266
|
|
267
|
-
##
|
267
|
+
##
|
268
268
|
# :method: get_director(service_id, number, name)
|
269
269
|
# Get a Director
|
270
270
|
|
271
|
-
##
|
271
|
+
##
|
272
272
|
# :method: get_domain(service_id, number, name)
|
273
273
|
# Get a Domain
|
274
|
-
|
275
|
-
##
|
274
|
+
|
275
|
+
##
|
276
276
|
# :method: get_healthcheck(service_id, number, name)
|
277
277
|
# Get a Healthcheck
|
278
278
|
|
279
|
-
##
|
279
|
+
##
|
280
280
|
# :method: get_match(service_id, number, name)
|
281
281
|
# Get a Match
|
282
282
|
|
283
|
-
##
|
283
|
+
##
|
284
284
|
# :method: get_origin(service_id, number, name)
|
285
285
|
# Get an Origin
|
286
286
|
|
287
287
|
##
|
288
288
|
# :method: get_s3_logging(service_id, number, name)
|
289
289
|
# Get a S3 logging
|
290
|
-
|
291
|
-
##
|
290
|
+
|
291
|
+
##
|
292
292
|
# :method: get_syslog(service_id, number, name)
|
293
293
|
# Get a Syslog
|
294
294
|
|
295
|
-
##
|
295
|
+
##
|
296
296
|
# :method: get_vcl(service_id, number, name)
|
297
297
|
# Get a VCL
|
298
298
|
|
299
|
-
##
|
299
|
+
##
|
300
300
|
# :method: get_version(service_id, number, name)
|
301
301
|
# Get a Version
|
302
302
|
|
303
|
-
##
|
303
|
+
##
|
304
304
|
# :method: get_settings(service_id, number, name)
|
305
305
|
# Get a Settings
|
306
306
|
|
307
|
-
##
|
307
|
+
##
|
308
308
|
# :method: get_condition(service_id, number, name)
|
309
309
|
# Get a Condition
|
310
310
|
|
311
|
-
##
|
311
|
+
##
|
312
312
|
# :method: get_cache_setting(service_id, number, name)
|
313
313
|
# Get a Cache Setting
|
314
314
|
|
315
|
-
##
|
315
|
+
##
|
316
316
|
# :method: get_gzip(service_id, number, name)
|
317
317
|
# Get a Gzip
|
318
318
|
|
319
|
-
##
|
319
|
+
##
|
320
320
|
# :method: get_header(service_id, number, name)
|
321
321
|
# Get a Header
|
322
322
|
|
323
|
-
##
|
323
|
+
##
|
324
324
|
# :method: get_request_setting(service_id, number, name)
|
325
325
|
# Get a Request Setting
|
326
326
|
|
327
|
-
##
|
327
|
+
##
|
328
328
|
# :method: get_response_object(service_id, number, name)
|
329
329
|
# Get a Response Object
|
330
330
|
|
@@ -333,298 +333,298 @@ class Fastly
|
|
333
333
|
# You can also call
|
334
334
|
# user.save!
|
335
335
|
|
336
|
-
##
|
336
|
+
##
|
337
337
|
# :method: update_customer(customer)
|
338
338
|
# You can also call
|
339
339
|
# customer.save!
|
340
340
|
|
341
|
-
##
|
341
|
+
##
|
342
342
|
# :method: update_service(service)
|
343
343
|
# You can also call
|
344
344
|
# service.save!
|
345
345
|
|
346
|
-
##
|
346
|
+
##
|
347
347
|
# :method: update_version(version)
|
348
348
|
# You can also call
|
349
349
|
# version.save!
|
350
350
|
|
351
|
-
##
|
351
|
+
##
|
352
352
|
# :method: update_backend(backend)
|
353
353
|
# You can also call
|
354
354
|
# backend.save!
|
355
355
|
|
356
|
-
##
|
356
|
+
##
|
357
357
|
# :method: update_director(director)
|
358
358
|
# You can also call
|
359
359
|
# director.save!
|
360
360
|
|
361
|
-
##
|
361
|
+
##
|
362
362
|
# :method: update_domain(domain)
|
363
363
|
# You can also call
|
364
364
|
# domain.save!
|
365
|
-
|
366
|
-
##
|
365
|
+
|
366
|
+
##
|
367
367
|
# :method: update_healthcheck(healthcheck)
|
368
368
|
# You can also call
|
369
369
|
# healthcheck.save!
|
370
370
|
|
371
|
-
##
|
371
|
+
##
|
372
372
|
# :method: update_match(match)
|
373
373
|
# You can also call
|
374
374
|
# match.save!
|
375
375
|
|
376
|
-
##
|
376
|
+
##
|
377
377
|
# :method: update_origin(origin)
|
378
378
|
# You can also call
|
379
379
|
# origin.save!
|
380
|
-
|
381
|
-
##
|
380
|
+
|
381
|
+
##
|
382
382
|
# :method: update_settings(settings)
|
383
383
|
# You can also call
|
384
384
|
# settings.save!
|
385
385
|
|
386
|
-
##
|
386
|
+
##
|
387
387
|
# :method: update_s3_logging(s3_logging)
|
388
388
|
# You can also call
|
389
389
|
# s3_logging.save!
|
390
390
|
|
391
|
-
##
|
391
|
+
##
|
392
392
|
# :method: update_syslog(syslog)
|
393
393
|
# You can also call
|
394
394
|
# syslog.save!
|
395
395
|
|
396
|
-
##
|
396
|
+
##
|
397
397
|
# :method: update_vcl(vcl)
|
398
398
|
# You can also call
|
399
399
|
# vcl.save!
|
400
400
|
|
401
|
-
##
|
401
|
+
##
|
402
402
|
# :method: update_cache_setting(cache_setting)
|
403
403
|
# You can also call
|
404
404
|
# cache_setting.save!
|
405
405
|
|
406
|
-
##
|
406
|
+
##
|
407
407
|
# :method: update_header(header)
|
408
408
|
# You can also call
|
409
409
|
# header.save!
|
410
410
|
|
411
|
-
##
|
411
|
+
##
|
412
412
|
# :method: update_gzip(gzip)
|
413
413
|
# You can also call
|
414
414
|
# gzip.save!
|
415
415
|
|
416
|
-
##
|
416
|
+
##
|
417
417
|
# :method: update_request_setting(request_setting)
|
418
418
|
# You can also call
|
419
419
|
# request_setting.save!
|
420
420
|
|
421
|
-
##
|
421
|
+
##
|
422
422
|
# :method: update_response_object(response_object)
|
423
423
|
# You can also call
|
424
424
|
# response_object.save!
|
425
425
|
|
426
|
-
##
|
426
|
+
##
|
427
427
|
# :method: update_condition(condition)
|
428
428
|
# You can also call
|
429
429
|
# condition.save!
|
430
430
|
|
431
|
-
##
|
431
|
+
##
|
432
432
|
# :method: update_version(version)
|
433
433
|
# You can also call
|
434
434
|
# version.save!
|
435
435
|
|
436
436
|
|
437
|
-
##
|
438
|
-
# :method: delete_user(user)
|
437
|
+
##
|
438
|
+
# :method: delete_user(user)
|
439
439
|
# You can also call
|
440
440
|
# user.delete!
|
441
441
|
|
442
|
-
##
|
442
|
+
##
|
443
443
|
# :method: delete_customer(customer)
|
444
444
|
# You can also call
|
445
445
|
# customer.delete!
|
446
446
|
|
447
|
-
##
|
447
|
+
##
|
448
448
|
# :method: delete_service(service)
|
449
449
|
# You can also call
|
450
450
|
# service.delete!
|
451
451
|
|
452
452
|
|
453
|
-
##
|
453
|
+
##
|
454
454
|
# :method: delete_version(version)
|
455
455
|
# You can also call
|
456
456
|
# version.delete!
|
457
457
|
|
458
458
|
|
459
|
-
##
|
459
|
+
##
|
460
460
|
# :method:delete_backend(backend)
|
461
461
|
# You can also call
|
462
462
|
# backend.delete!
|
463
463
|
|
464
464
|
|
465
|
-
##
|
465
|
+
##
|
466
466
|
# :method: delete_director(backend)
|
467
467
|
# You can also call
|
468
468
|
# backend.delete!
|
469
469
|
|
470
470
|
|
471
|
-
##
|
471
|
+
##
|
472
472
|
# :method: delete_domain(domain
|
473
473
|
# You can also call
|
474
474
|
# domain.delete!
|
475
475
|
|
476
|
-
##
|
476
|
+
##
|
477
477
|
# :method: delete_healthcheck(healthcheck)
|
478
478
|
# You can also call
|
479
479
|
# healthcheck.delete!
|
480
480
|
|
481
|
-
##
|
481
|
+
##
|
482
482
|
# :method: delete_match(match)
|
483
483
|
# You can also call
|
484
484
|
# match.delete!(match)
|
485
485
|
|
486
486
|
|
487
|
-
##
|
487
|
+
##
|
488
488
|
# :method: delete_origin(origin)
|
489
489
|
# You can also call
|
490
490
|
# origin.delete!
|
491
491
|
|
492
|
-
##
|
492
|
+
##
|
493
493
|
# :method: delete_s3_logging(s3_logging)
|
494
494
|
# You can also call
|
495
495
|
# s3_logging.delete!
|
496
496
|
|
497
|
-
##
|
497
|
+
##
|
498
498
|
# :method: delete_syslog(syslog)
|
499
499
|
# You can also call
|
500
500
|
# syslog.delete!
|
501
501
|
|
502
502
|
|
503
|
-
##
|
503
|
+
##
|
504
504
|
# :method: delete_vcl(vcl)
|
505
505
|
# You can also call
|
506
506
|
# vcl.delete!
|
507
507
|
|
508
|
-
##
|
508
|
+
##
|
509
509
|
# :method: delete_cache_setting(cache_setting)
|
510
510
|
# You can also call
|
511
511
|
# cache_setting.delete!
|
512
512
|
|
513
|
-
##
|
513
|
+
##
|
514
514
|
# :method: delete_header(header)
|
515
515
|
# You can also call
|
516
516
|
# header.delete!
|
517
517
|
|
518
|
-
##
|
518
|
+
##
|
519
519
|
# :method: delete_gzip(gzip)
|
520
520
|
# You can also call
|
521
521
|
# gzip.delete!
|
522
522
|
|
523
|
-
##
|
523
|
+
##
|
524
524
|
# :method: delete_request_setting(request_setting)
|
525
525
|
# You can also call
|
526
526
|
# request_setting.delete!
|
527
527
|
|
528
|
-
##
|
528
|
+
##
|
529
529
|
# :method: delete_response_object(response_object)
|
530
530
|
# You can also call
|
531
531
|
# response_object.delete!
|
532
532
|
|
533
|
-
##
|
533
|
+
##
|
534
534
|
# :method: delete_condition(condition)
|
535
535
|
# You can also call
|
536
536
|
# condition.delete!
|
537
537
|
|
538
|
-
##
|
538
|
+
##
|
539
539
|
# :method: delete_version(version)
|
540
540
|
# You can also call
|
541
541
|
# version.delete!
|
542
542
|
|
543
543
|
# :method: list_users(:service_id => service.id, :version => version.number)
|
544
|
-
#
|
544
|
+
#
|
545
545
|
# Get a list of all users
|
546
546
|
|
547
547
|
# :method: list_customers(:service_id => service.id, :version => version.number)
|
548
|
-
#
|
548
|
+
#
|
549
549
|
# Get a list of all customers
|
550
550
|
|
551
551
|
# :method: list_versions(:service_id => service.id, :version => version.number)
|
552
|
-
#
|
552
|
+
#
|
553
553
|
# Get a list of all versions
|
554
554
|
|
555
555
|
# :method: list_services(:service_id => service.id, :version => version.number)
|
556
|
-
#
|
556
|
+
#
|
557
557
|
# Get a list of all services
|
558
558
|
|
559
|
-
# :method: list_backends(:service_id => service.id, :version => version.number)
|
560
|
-
#
|
559
|
+
# :method: list_backends(:service_id => service.id, :version => version.number)
|
560
|
+
#
|
561
561
|
# Get a list of all backends
|
562
562
|
|
563
|
-
# :method: list_directors(:service_id => service.id, :version => version.number)
|
564
|
-
#
|
563
|
+
# :method: list_directors(:service_id => service.id, :version => version.number)
|
564
|
+
#
|
565
565
|
# Get a list of all directors
|
566
566
|
|
567
|
-
# :method: list_domains(:service_id => service.id, :version => version.number)
|
568
|
-
#
|
567
|
+
# :method: list_domains(:service_id => service.id, :version => version.number)
|
568
|
+
#
|
569
569
|
# Get a list of all domains
|
570
570
|
|
571
571
|
# :method: list_healthchecks(:service_id => service.id, :version => version.number)
|
572
|
-
#
|
572
|
+
#
|
573
573
|
# Get a list of all healthchecks
|
574
574
|
|
575
575
|
# :method: list_matchs(:service_id => service.id, :version => version.number)
|
576
|
-
#
|
576
|
+
#
|
577
577
|
# Get a list of all matches
|
578
578
|
|
579
|
-
# :method: list_origins(:service_id => service.id, :version => version.number)
|
580
|
-
#
|
579
|
+
# :method: list_origins(:service_id => service.id, :version => version.number)
|
580
|
+
#
|
581
581
|
# Get a list of all origins
|
582
582
|
|
583
583
|
# :method: list_syslogs(:service_id => service.id, :version => version.number)
|
584
|
-
#
|
584
|
+
#
|
585
585
|
# Get a list of all syslogs
|
586
586
|
|
587
|
-
# :method: list_vcls(:service_id => service.id, :version => version.number)
|
588
|
-
#
|
587
|
+
# :method: list_vcls(:service_id => service.id, :version => version.number)
|
588
|
+
#
|
589
589
|
# Get a list of all vcls
|
590
|
-
|
591
|
-
# :method: list_conditions(:service_id => service.id, :version => version.number)
|
592
|
-
#
|
590
|
+
|
591
|
+
# :method: list_conditions(:service_id => service.id, :version => version.number)
|
592
|
+
#
|
593
593
|
# Get a list of all conditions
|
594
594
|
|
595
595
|
# :method: list_cache_settings(:service_id => service.id, :version => version.number)
|
596
|
-
#
|
596
|
+
#
|
597
597
|
# Get a list of all cache settings
|
598
598
|
|
599
599
|
# :method: list_headers(:service_id => service.id, :version => version.number)
|
600
|
-
#
|
600
|
+
#
|
601
601
|
# Get a list of all headers
|
602
602
|
|
603
603
|
# :method: list_gzips(:service_id => service.id, :version => version.number)
|
604
|
-
#
|
604
|
+
#
|
605
605
|
# Get a list of all gzips
|
606
606
|
|
607
607
|
# :method: list_request_settings(:service_id => service.id, :version => version.number)
|
608
|
-
#
|
608
|
+
#
|
609
609
|
# Get a list of all request_settings
|
610
610
|
|
611
611
|
# :method: list_response_objects(:service_id => service.id, :version => version.number)
|
612
|
-
#
|
612
|
+
#
|
613
613
|
# Get a list of all response_objects
|
614
614
|
|
615
615
|
# :method: list_versions(:service_id => service.id, :version => version.number)
|
616
|
-
#
|
616
|
+
#
|
617
617
|
# Get a list of all versions
|
618
618
|
|
619
619
|
|
620
620
|
|
621
621
|
##
|
622
622
|
# Attempts to load various config options in the form
|
623
|
-
#
|
623
|
+
#
|
624
624
|
# <key> = <value>
|
625
|
-
#
|
625
|
+
#
|
626
626
|
# From a file.
|
627
|
-
#
|
627
|
+
#
|
628
628
|
# Skips whitespace and lines starting with C<#>.
|
629
629
|
#
|
630
630
|
def self.load_config(file)
|
@@ -646,12 +646,12 @@ class Fastly
|
|
646
646
|
end
|
647
647
|
|
648
648
|
##
|
649
|
-
# Tries to load options from the file[s] passed in using,
|
649
|
+
# Tries to load options from the file[s] passed in using,
|
650
650
|
# C<load_options>, stopping when it finds the first one.
|
651
|
-
#
|
652
|
-
# Then it overrides those options with command line options
|
651
|
+
#
|
652
|
+
# Then it overrides those options with command line options
|
653
653
|
# of the form
|
654
|
-
#
|
654
|
+
#
|
655
655
|
# --<key>=<value>
|
656
656
|
#
|
657
657
|
def self.get_options(*files)
|
@@ -664,7 +664,7 @@ class Fastly
|
|
664
664
|
|
665
665
|
while (ARGV.size>0 && ARGV[0] =~ /^-+(\w+)\=(\w+)$/) do
|
666
666
|
options[$1.to_sym] = $2;
|
667
|
-
|
667
|
+
ARGV.shift;
|
668
668
|
end
|
669
669
|
raise"Couldn't find options from command line arguments or #{files.join(', ')}" unless options.size>0
|
670
670
|
options;
|