fastly 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
data/lib/fastly/user.rb
CHANGED
@@ -2,35 +2,35 @@ class Fastly
|
|
2
2
|
# A representation of a User in Fastly
|
3
3
|
class User < Base
|
4
4
|
attr_accessor :id, :name, :login, :customer_id, :role, :password
|
5
|
-
##
|
5
|
+
##
|
6
6
|
# :attr: id
|
7
|
-
#
|
7
|
+
#
|
8
8
|
# The id of this user
|
9
|
-
#
|
9
|
+
#
|
10
10
|
|
11
|
-
##
|
11
|
+
##
|
12
12
|
# :attr: name
|
13
|
-
#
|
14
|
-
# The name of this user
|
15
|
-
#
|
13
|
+
#
|
14
|
+
# The name of this user
|
15
|
+
#
|
16
16
|
|
17
|
-
##
|
17
|
+
##
|
18
18
|
# :attr: customer_id
|
19
|
-
#
|
19
|
+
#
|
20
20
|
# The id of the customer this user belongs to
|
21
|
-
#
|
21
|
+
#
|
22
22
|
|
23
|
-
##
|
23
|
+
##
|
24
24
|
# :attr: role
|
25
|
-
#
|
25
|
+
#
|
26
26
|
# The role this user has (one of admin, owner, superuser, user, engineer, billing)
|
27
|
-
|
28
|
-
|
27
|
+
|
28
|
+
|
29
29
|
# Get the Customer object this user belongs to
|
30
|
-
def customer
|
30
|
+
def customer
|
31
31
|
@customer ||= fetcher.get(Customer, self.customer_id)
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
# Whether or not this User is the owner of the Customer they belong to
|
35
35
|
def owner?
|
36
36
|
customer.owner_id == id
|
@@ -57,6 +57,6 @@ class Fastly
|
|
57
57
|
my_priority < test_priority
|
58
58
|
end
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
61
|
end
|
62
|
-
end
|
62
|
+
end
|
data/lib/fastly/vcl.rb
CHANGED
@@ -2,11 +2,11 @@ class Fastly
|
|
2
2
|
# An internal representation of a Varnish Configuration Language file
|
3
3
|
class VCL < BelongsToServiceAndVersion
|
4
4
|
attr_accessor :service_id, :name, :content, :comment, :main
|
5
|
-
##
|
5
|
+
##
|
6
6
|
# :attr: service_id
|
7
|
-
#
|
7
|
+
#
|
8
8
|
# The id of the service this belongs to.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
|
11
11
|
##
|
12
12
|
# :attr: name
|
@@ -14,21 +14,21 @@ class Fastly
|
|
14
14
|
# The name of the uploaded VCL
|
15
15
|
#
|
16
16
|
|
17
|
-
##
|
17
|
+
##
|
18
18
|
# :attr: version
|
19
|
-
#
|
19
|
+
#
|
20
20
|
# The number of the version this belongs to.
|
21
|
-
#
|
21
|
+
#
|
22
22
|
|
23
|
-
##
|
23
|
+
##
|
24
24
|
# :attr: content
|
25
|
-
#
|
25
|
+
#
|
26
26
|
# The content of this VCL
|
27
|
-
#
|
27
|
+
#
|
28
28
|
|
29
|
-
##
|
30
|
-
# :attr: comment
|
31
|
-
#
|
29
|
+
##
|
30
|
+
# :attr: comment
|
31
|
+
#
|
32
32
|
# a free form comment field
|
33
33
|
#
|
34
34
|
|
data/lib/fastly/version.rb
CHANGED
@@ -2,8 +2,8 @@ class Fastly
|
|
2
2
|
# An iteration of your configuration
|
3
3
|
class Version < Base
|
4
4
|
attr_accessor :service_id, :number, :name, :active, :staging, :testing, :deployed, :comment
|
5
|
-
|
6
|
-
##
|
5
|
+
|
6
|
+
##
|
7
7
|
# :attr: service_id
|
8
8
|
# The id of the service this belongs to.
|
9
9
|
|
@@ -11,59 +11,59 @@ class Fastly
|
|
11
11
|
# :attr: number
|
12
12
|
# The generation of this version
|
13
13
|
|
14
|
-
##
|
14
|
+
##
|
15
15
|
# :attr: name
|
16
|
-
#
|
16
|
+
#
|
17
17
|
# The name of this version.
|
18
|
-
|
19
18
|
|
20
|
-
|
19
|
+
|
20
|
+
##
|
21
21
|
# :attr: active
|
22
|
-
#
|
22
|
+
#
|
23
23
|
# Whether this version is active or not.
|
24
|
-
|
25
24
|
|
26
|
-
|
25
|
+
|
26
|
+
##
|
27
27
|
# :attr: locked
|
28
|
-
#
|
28
|
+
#
|
29
29
|
# Whether this version is locked or not.
|
30
|
-
|
31
30
|
|
32
|
-
|
31
|
+
|
32
|
+
##
|
33
33
|
# :attr: staging
|
34
|
-
#
|
34
|
+
#
|
35
35
|
# Whether this version is in staging or not.
|
36
|
-
|
37
36
|
|
38
|
-
|
37
|
+
|
38
|
+
##
|
39
39
|
# :attr: testing
|
40
|
-
#
|
40
|
+
#
|
41
41
|
# Whether this version is in testing or not.
|
42
|
-
#
|
42
|
+
#
|
43
43
|
|
44
|
-
##
|
44
|
+
##
|
45
45
|
# :attr: deployed
|
46
|
-
#
|
46
|
+
#
|
47
47
|
# Whether this version is deployed or not.
|
48
|
-
#
|
48
|
+
#
|
49
49
|
|
50
|
-
##
|
51
|
-
# :attr: comment
|
50
|
+
##
|
51
|
+
# :attr: comment
|
52
52
|
#
|
53
53
|
# a free form comment field
|
54
|
-
|
54
|
+
|
55
55
|
# Is this Version locked
|
56
56
|
def locked?
|
57
57
|
return @locked.to_i > 0
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
# Set whether this Version is locked
|
61
61
|
def locked=(is_locked)
|
62
62
|
@locked = is_locked ? "1" : "0"
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
# Get the Service object this Version belongs to
|
66
|
-
def service
|
66
|
+
def service
|
67
67
|
fetcher.get(Fastly::Service, service_id)
|
68
68
|
end
|
69
69
|
|
@@ -105,7 +105,7 @@ class Fastly
|
|
105
105
|
|
106
106
|
# Get the generated VCL object for this Version (which must have been activated first)
|
107
107
|
#
|
108
|
-
# Won't return the content of the VCL unless you pass in
|
108
|
+
# Won't return the content of the VCL unless you pass in
|
109
109
|
# :include_content => true
|
110
110
|
# in the opts
|
111
111
|
def generated_vcl(opts={})
|
@@ -114,7 +114,7 @@ class Fastly
|
|
114
114
|
'content' => hash['vcl'] || hash['content'],
|
115
115
|
'name' => hash['md5'],
|
116
116
|
'version' => hash['version'],
|
117
|
-
'service_id' => hash['service']
|
117
|
+
'service_id' => hash['service']
|
118
118
|
}
|
119
119
|
return Fastly::VCL.new(opts, fetcher)
|
120
120
|
end
|
@@ -133,7 +133,7 @@ class Fastly
|
|
133
133
|
|
134
134
|
# Get the named VCL for this version
|
135
135
|
#
|
136
|
-
# Won't return the content of the VCL unless you pass in
|
136
|
+
# Won't return the content of the VCL unless you pass in
|
137
137
|
# :include_content => true
|
138
138
|
# in the opts
|
139
139
|
def vcl(name, opts={})
|
@@ -152,9 +152,9 @@ class Fastly
|
|
152
152
|
hash = fetcher.client.get(Fastly::Version.put_path(self)+"/validate")
|
153
153
|
return !hash.nil?
|
154
154
|
end
|
155
|
-
|
155
|
+
|
156
156
|
private
|
157
|
-
|
157
|
+
|
158
158
|
def self.get_path(service, number)
|
159
159
|
"/service/#{service}/version/#{number}"
|
160
160
|
end
|
@@ -170,5 +170,5 @@ class Fastly
|
|
170
170
|
def self.delete_path(obj)
|
171
171
|
put_path(obj)
|
172
172
|
end
|
173
|
-
end
|
173
|
+
end
|
174
174
|
end
|
data/test/common.rb
CHANGED
@@ -117,7 +117,7 @@ module CommonTests
|
|
117
117
|
assert_equal condition_name, condition.name
|
118
118
|
assert_equal condition_statement, condition.statement
|
119
119
|
|
120
|
-
cache_condition_name = "cache-#{condition_name}"
|
120
|
+
cache_condition_name = "cache-#{condition_name}"
|
121
121
|
cache_condition = @fastly.create_condition(:service_id => service.id, :version => number, :name => cache_condition_name, :statement => condition_statement, :type => "CACHE")
|
122
122
|
assert cache_condition
|
123
123
|
assert_equal cache_condition_name, cache_condition.name
|
metadata
CHANGED
@@ -1,58 +1,61 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fastly Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curb
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.7.15
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.7.15
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: curb-fu
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.6.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.6.1
|
41
41
|
description: Client library for the Fastly acceleration system
|
42
42
|
email:
|
43
43
|
- support@fastly.com
|
44
44
|
executables:
|
45
|
+
- fastly_create_domain
|
45
46
|
- fastly_upload_vcl
|
46
47
|
extensions: []
|
47
48
|
extra_rdoc_files: []
|
48
49
|
files:
|
49
|
-
-
|
50
|
-
-
|
50
|
+
- .gitignore
|
51
|
+
- .rubocop.yml
|
52
|
+
- .travis.yml
|
51
53
|
- Gemfile
|
52
54
|
- HISTORY.md
|
53
55
|
- LICENSE
|
54
56
|
- README.md
|
55
57
|
- Rakefile
|
58
|
+
- bin/fastly_create_domain
|
56
59
|
- bin/fastly_upload_vcl
|
57
60
|
- fastly.gemspec
|
58
61
|
- lib/fastly.rb
|
@@ -101,17 +104,17 @@ require_paths:
|
|
101
104
|
- lib
|
102
105
|
required_ruby_version: !ruby/object:Gem::Requirement
|
103
106
|
requirements:
|
104
|
-
- -
|
107
|
+
- - '>='
|
105
108
|
- !ruby/object:Gem::Version
|
106
109
|
version: '0'
|
107
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
111
|
requirements:
|
109
|
-
- -
|
112
|
+
- - '>='
|
110
113
|
- !ruby/object:Gem::Version
|
111
114
|
version: '0'
|
112
115
|
requirements: []
|
113
116
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.2.
|
117
|
+
rubygems_version: 2.2.1
|
115
118
|
signing_key:
|
116
119
|
specification_version: 4
|
117
120
|
summary: Client library for the Fastly acceleration system
|