fastly 1.11.0 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84087ced00a3b79ef2752e5f79296e1cc4fe18be
4
- data.tar.gz: 4e4a62a1e37964abd6c728b06fa77f5ea1935f5a
3
+ metadata.gz: ca3240b2ea8b8beb989ec6b9aa120333b130c5d8
4
+ data.tar.gz: 07ecfcc3b385a54ad7f912925910630bad419567
5
5
  SHA512:
6
- metadata.gz: df7ad1099644cc8e4a92e4116d7b3ebb26a071a5ce2a988334cfc7f5a24763ee100dd8a53067312b9bf8b1281c559416e453672bc87f2f2321e3e1c8d896ccac
7
- data.tar.gz: 6a4dd28ad7a7361e9793a78f91f6ebc89c24625ed1f6999dff0b5582bcfeaf2e146c7e1999d606d18788ed76491230819145f35428732253a730df527f703272
6
+ metadata.gz: 19e6a2fa756f57ec010ca22cf79ded5dc3489719d9fdcf8e95b6fba238921fee386ce50bbefa60a3a7c1ddea9cb4dc933202bbc8a6c42859e31f44c4d898fc53
7
+ data.tar.gz: 0ee7a187ae12d82ba30a419a038dfc140e908b2b88f33c23be55bed45681c4750c35b54ea8d459d74a98df924e8de40080adfb5ab158a360a19599bc621e7217
@@ -29,6 +29,8 @@ require 'fastly/request_setting'
29
29
  require 'fastly/response_object'
30
30
  require 'fastly/service'
31
31
  require 'fastly/settings'
32
+ require 'fastly/snippet'
33
+ require 'fastly/dynamic_snippet'
32
34
  require 'fastly/syslog'
33
35
  require 'fastly/s3_logging'
34
36
  require 'fastly/gcs_logging'
@@ -146,7 +148,7 @@ class Fastly
146
148
  client.get_stats('/stats/regions')
147
149
  end
148
150
 
149
- [ACL, ACLEntry, User, Customer, Backend, CacheSetting, Condition, Dictionary, DictionaryItem, Director, Domain, Header, Healthcheck, Gzip, Match, PapertrailLogging, RequestSetting, ResponseObject, Service, S3Logging, Syslog, VCL, Version].each do |klass|
151
+ [ACL, ACLEntry, User, Customer, Backend, CacheSetting, Condition, Dictionary, DictionaryItem, Director, Domain, Header, Healthcheck, Gzip, Match, PapertrailLogging, RequestSetting, ResponseObject, Service, Snippet, S3Logging, Syslog, VCL, Version].each do |klass|
150
152
  type = Util.class_to_path(klass)
151
153
 
152
154
  if klass.respond_to?(:pluralize)
@@ -316,6 +318,10 @@ class Fastly
316
318
  # :method: get_vcl(service_id, number, name)
317
319
  # Get a VCL
318
320
 
321
+ ##
322
+ # :method: get_snippet(service_id, number, name)
323
+ # Get a VCL snippet
324
+
319
325
  ##
320
326
  # :method: get_version(service_id, number, name)
321
327
  # Get a Version
@@ -428,6 +434,11 @@ class Fastly
428
434
  # You can also call
429
435
  # vcl.save!
430
436
 
437
+ ##
438
+ # :method: update_snippet(snippet)
439
+ # You can also call
440
+ # snippet.save!
441
+
431
442
  ##
432
443
  # :method: update_cache_setting(cache_setting)
433
444
  # You can also call
@@ -538,6 +549,11 @@ class Fastly
538
549
  # You can also call
539
550
  # vcl.delete!
540
551
 
552
+ ##
553
+ # :method: delete_snippet(snippet)
554
+ # You can also call
555
+ # snippet.delete!
556
+
541
557
  ##
542
558
  # :method: delete_cache_setting(cache_setting)
543
559
  # You can also call
@@ -625,6 +641,10 @@ class Fastly
625
641
  #
626
642
  # Get a list of all vcls
627
643
 
644
+ # :method: list_snippets(:service_id => service.id, :version => version.number)
645
+ #
646
+ # Get a list of all vcl snippets
647
+
628
648
  # :method: list_conditions(:service_id => service.id, :version => version.number)
629
649
  #
630
650
  # Get a list of all conditions
@@ -0,0 +1,31 @@
1
+ class Fastly
2
+ # VCL Snippets are blocks of VCL logic inserted into your service's configuration that don't require custom VCL.
3
+ class DynamicSnippet < Base
4
+ attr_accessor :service_id, :snippet_id, :content
5
+ ##
6
+ # :attr: service_id
7
+ #
8
+ # The id of the service this belongs to.
9
+ #
10
+
11
+ ##
12
+ # :attr: content
13
+ #
14
+ # The VCL code that specifies exactly what the snippet does
15
+ #
16
+
17
+ ##
18
+ # :attr: snippet_id
19
+ #
20
+ # The ID of this dynamic snippet
21
+ #
22
+
23
+ def self.get_path(object)
24
+ "/service/#{object.service_id}/snippet/#{object.snippet_id}"
25
+ end
26
+
27
+ def self.put_path(object)
28
+ get_path(object)
29
+ end
30
+ end
31
+ end
@@ -1,4 +1,4 @@
1
1
  # The current version of the library
2
2
  class Fastly
3
- VERSION = "1.11.0"
3
+ VERSION = "1.12.0"
4
4
  end
@@ -0,0 +1,53 @@
1
+ class Fastly
2
+ # VCL Snippets are blocks of VCL logic inserted into your service's configuration that don't require custom VCL.
3
+ class Snippet < BelongsToServiceAndVersion
4
+ attr_accessor :id, :service_id, :name, :dynamic, :type, :content, :priority
5
+ ##
6
+ # :attr: id
7
+ #
8
+ # The id of the snippet (useful for dynamic snippet reference)
9
+ #
10
+
11
+ ##
12
+ # :attr: service_id
13
+ #
14
+ # The id of the service this belongs to.
15
+ #
16
+
17
+ ##
18
+ # :attr: name
19
+ #
20
+ # The name of the uploaded VCL snippet.
21
+ #
22
+
23
+ ##
24
+ # :attr: version
25
+ #
26
+ # The number of the version this belongs to.
27
+ #
28
+
29
+ ##
30
+ # :attr: dynamic
31
+ #
32
+ # Sets the snippet version to regular (0) or dynamic (1).
33
+ #
34
+
35
+ ##
36
+ # :attr: type
37
+ #
38
+ # The location in generated VCL where the snippet should be placed.
39
+ #
40
+
41
+ ##
42
+ # :attr: content
43
+ #
44
+ # The VCL code that specifies exactly what the snippet does
45
+ #
46
+
47
+ ##
48
+ # :attr: priority
49
+ #
50
+ # Priority determines the ordering for multiple snippets. Lower numbers execute first.
51
+ #
52
+ end
53
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fastly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-12 00:00:00.000000000 Z
11
+ date: 2017-08-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Client library for the Fastly acceleration system
14
14
  email:
@@ -49,6 +49,7 @@ files:
49
49
  - lib/fastly/dictionary_item.rb
50
50
  - lib/fastly/director.rb
51
51
  - lib/fastly/domain.rb
52
+ - lib/fastly/dynamic_snippet.rb
52
53
  - lib/fastly/fetcher.rb
53
54
  - lib/fastly/gcs_logging.rb
54
55
  - lib/fastly/gem_version.rb
@@ -63,6 +64,7 @@ files:
63
64
  - lib/fastly/s3_logging.rb
64
65
  - lib/fastly/service.rb
65
66
  - lib/fastly/settings.rb
67
+ - lib/fastly/snippet.rb
66
68
  - lib/fastly/syslog.rb
67
69
  - lib/fastly/user.rb
68
70
  - lib/fastly/util.rb