Class: Fog::CDN::AWS::Distribution
- Includes:
- DistributionHelper
- Defined in:
- lib/fog/aws/models/cdn/distribution.rb
Constant Summary collapse
- CONFIG =
items part of DistributionConfig
[ :caller_reference, :origin, :cname, :comment, :enabled, :logging, :trusted_signers, :default_root_object ]
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
-
#initialize(new_attributes = {}) ⇒ Distribution
constructor
A new instance of Distribution.
- #invalidations ⇒ Object
- #save ⇒ Object
Methods included from DistributionHelper
#custom_origin?, #destroy, #disable, #disabled?, #enable, #enabled?, #ready?
Methods inherited from Model
#inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Fog::Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
#initialize(new_attributes = {}) ⇒ Distribution
Returns a new instance of Distribution.
32 33 34 |
# File 'lib/fog/aws/models/cdn/distribution.rb', line 32 def initialize(new_attributes = {}) super(distribution_config_to_attributes(new_attributes)) end |
Instance Method Details
#invalidations ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/fog/aws/models/cdn/distribution.rb', line 36 def invalidations @invalidations ||= begin Fog::CDN::AWS::Invalidations.new( :distribution => self, :service => service ) end end |
#save ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/fog/aws/models/cdn/distribution.rb', line 45 def save requires_one :s3_origin, :custom_origin = response = identity ? put_distribution_config(identity, etag, ) : post_distribution() etag = response.headers['ETag'] merge_attributes(response.body) true end |