Module: Fog::CDN::AWS::DistributionHelper
- Included in:
- Distribution, StreamingDistribution
- Defined in:
- lib/fog/aws/models/cdn/distribution_helper.rb
Instance Method Summary collapse
- #custom_origin? ⇒ Boolean
- #destroy ⇒ Object
- #disable ⇒ Object
- #disabled? ⇒ Boolean
- #enable ⇒ Object
- #enabled? ⇒ Boolean
- #ready? ⇒ Boolean
Instance Method Details
#custom_origin? ⇒ Boolean
26 27 28 29 |
# File 'lib/fog/aws/models/cdn/distribution_helper.rb', line 26 def custom_origin? requires :identity not custom_origin.nil? end |
#destroy ⇒ Object
9 10 11 12 13 14 |
# File 'lib/fog/aws/models/cdn/distribution_helper.rb', line 9 def destroy requires :identity, :etag, :caller_reference raise "Distribution must be disabled to be deleted" unless disabled? delete_distribution(identity, etag) true end |
#disable ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fog/aws/models/cdn/distribution_helper.rb', line 48 def disable requires :identity reload if etag.nil? or caller_reference.nil? if enabled? self.enabled = false response = put_distribution_config(identity, etag, ) etag = response.headers['ETag'] merge_attributes(response.body) end true end |
#disabled? ⇒ Boolean
21 22 23 24 |
# File 'lib/fog/aws/models/cdn/distribution_helper.rb', line 21 def disabled? requires :identity not enabled? and ready? end |
#enable ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fog/aws/models/cdn/distribution_helper.rb', line 36 def enable requires :identity reload if etag.nil? or caller_reference.nil? unless enabled? self.enabled = true response = put_distribution_config(identity, etag, ) etag = response.headers['ETag'] merge_attributes(response.body) end true end |
#enabled? ⇒ Boolean
16 17 18 19 |
# File 'lib/fog/aws/models/cdn/distribution_helper.rb', line 16 def enabled? requires :identity !!enabled and ready? end |
#ready? ⇒ Boolean
31 32 33 34 |
# File 'lib/fog/aws/models/cdn/distribution_helper.rb', line 31 def ready? requires :identity status == 'Deployed' end |