2010-11-01 20:44:14 -04:00
|
|
|
module Fog
|
2011-06-15 20:32:15 -04:00
|
|
|
module CDN
|
|
|
|
class AWS
|
2010-11-01 20:44:14 -04:00
|
|
|
class Real
|
|
|
|
|
2011-08-24 15:20:21 -04:00
|
|
|
require 'fog/aws/parsers/cdn/distribution'
|
2010-11-01 20:44:14 -04:00
|
|
|
|
|
|
|
# Get information about a distribution from CloudFront
|
|
|
|
#
|
|
|
|
# ==== Parameters
|
|
|
|
# * distribution_id<~String> - id of distribution
|
|
|
|
#
|
|
|
|
# ==== Returns
|
|
|
|
# * response<~Excon::Response>:
|
|
|
|
# * body<~Hash>:
|
2010-11-09 18:49:38 -05:00
|
|
|
# * 'S3Origin'<~Hash>:
|
|
|
|
# * 'DNSName'<~String> - origin to associate with distribution, ie 'mybucket.s3.amazonaws.com'
|
|
|
|
# * 'OriginAccessIdentity'<~String> - Optional: Used when serving private content
|
|
|
|
# or
|
|
|
|
# * 'CustomOrigin'<~Hash>:
|
|
|
|
# * 'DNSName'<~String> - origin to associate with distribution, ie 'www.example.com'
|
|
|
|
# * 'HTTPPort'<~Integer> - HTTP port of origin, in [80, 443] or (1024...65535)
|
|
|
|
# * 'HTTPSPort'<~Integer> - HTTPS port of origin, in [80, 443] or (1024...65535)
|
|
|
|
# * 'OriginProtocolPolicy'<~String> - Policy on using http vs https, in ['http-only', 'match-viewer']
|
|
|
|
#
|
2010-11-01 20:44:14 -04:00
|
|
|
# * 'Id'<~String> - Id of distribution
|
|
|
|
# * 'LastModifiedTime'<~String> - Timestamp of last modification of distribution
|
|
|
|
# * 'Status'<~String> - Status of distribution
|
|
|
|
# * 'DistributionConfig'<~Array>:
|
|
|
|
# * 'CallerReference'<~String> - Used to prevent replay, defaults to Time.now.to_i.to_s
|
|
|
|
# * 'CNAME'<~Array> - array of associated cnames
|
|
|
|
# * 'Comment'<~String> - comment associated with distribution
|
|
|
|
# * 'Enabled'<~Boolean> - whether or not distribution is enabled
|
2010-11-09 18:49:38 -05:00
|
|
|
# * 'InProgressInvalidationBatches'<~Integer> - number of invalidation batches in progress
|
2010-11-01 20:44:14 -04:00
|
|
|
# * 'Logging'<~Hash>:
|
|
|
|
# * 'Bucket'<~String> - bucket logs are stored in
|
|
|
|
# * 'Prefix'<~String> - prefix logs are stored with
|
|
|
|
# * 'Origin'<~String> - s3 origin bucket
|
|
|
|
# * 'TrustedSigners'<~Array> - trusted signers
|
|
|
|
#
|
|
|
|
# ==== See Also
|
|
|
|
# http://docs.amazonwebservices.com/AmazonCloudFront/latest/APIReference/GetDistribution.html
|
|
|
|
|
|
|
|
def get_distribution(distribution_id)
|
|
|
|
request({
|
|
|
|
:expects => 200,
|
|
|
|
:idempotent => true,
|
|
|
|
:method => 'GET',
|
2011-06-15 20:32:15 -04:00
|
|
|
:parser => Fog::Parsers::CDN::AWS::Distribution.new,
|
2010-11-01 20:44:14 -04:00
|
|
|
:path => "/distribution/#{distribution_id}"
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|