Module: Cloudfront::Distribution::DownloadDistribution

Includes:
Distribution
Included in:
Cloudfront
Defined in:
lib/cloudfront/distribution/download_distribution.rb

Instance Method Summary collapse

Instance Method Details

#download_distribution_create(distribution) ⇒ Faraday::Response

Creates a download distribution.

Parameters:

Returns:

  • (Faraday::Response)

    the response from cloudfront



16
17
18
# File 'lib/cloudfront/distribution/download_distribution.rb', line 16

def download_distribution_create(distribution)
  distribution_create(DOWNLOAD_DISTRIBUTION_URL, distribution)
end

#download_distribution_delete(distribution_id) ⇒ Faraday::Response

Deletes a download distribution.

Parameters:

  • distribution_id (String)

    The id of the distribution to be deleted.

Returns:

  • (Faraday::Response)

    the response from cloudfront



70
71
72
# File 'lib/cloudfront/distribution/download_distribution.rb', line 70

def download_distribution_delete(distribution_id)
  distribution_delete(DOWNLOAD_DISTRIBUTION_URL, distribution_id)
end

#download_distribution_disable(distribution_id) ⇒ Faraday::Response

Disables a download distribution.

Parameters:

  • distribution_id (String)

    The id of the distribution to be disabled.

Returns:

  • (Faraday::Response)

    the response from cloudfront



63
64
65
# File 'lib/cloudfront/distribution/download_distribution.rb', line 63

def download_distribution_disable(distribution_id)
  distribution_disable(DOWNLOAD_DISTRIBUTION_URL, distribution_id)
end

#download_distribution_enable(distribution_id) ⇒ Faraday::Response

Enables a download distribution.

Parameters:

  • distribution_id (String)

    The id of the distribution to be enabled.

Returns:

  • (Faraday::Response)

    the response from cloudfront



56
57
58
# File 'lib/cloudfront/distribution/download_distribution.rb', line 56

def download_distribution_enable(distribution_id)
  distribution_enable(DOWNLOAD_DISTRIBUTION_URL, distribution_id)
end

#download_distribution_get(distribution_id) ⇒ Faraday::Response

Gets the download distribution information.

Parameters:

  • distribution_id (String)

    The id of the distribution to be returned.

Returns:

  • (Faraday::Response)

    the response from cloudfront



31
32
33
# File 'lib/cloudfront/distribution/download_distribution.rb', line 31

def download_distribution_get(distribution_id)
  distribution_get(DOWNLOAD_DISTRIBUTION_URL, distribution_id)
end

#download_distribution_get_config(distribution_id) ⇒ Faraday::Response

Returns the download distribution configuration.

Parameters:

  • distribution_id (String)

    The id of the distribution to be returned.

Returns:

  • (Faraday::Response)

    the response from cloudfront



38
39
40
# File 'lib/cloudfront/distribution/download_distribution.rb', line 38

def download_distribution_get_config(distribution_id)
  distribution_get_config(DOWNLOAD_DISTRIBUTION_URL, distribution_id)
end

#download_distribution_list(max_items = 0, marker = "") ⇒ Faraday::Response

Lists all the download distributions.

Parameters:

  • max_items (int) (defaults to: 0)

    the max items to be retrieved

  • marker (String) (defaults to: "")

    The distribution id from which begins the list.

Returns:

  • (Faraday::Response)

    the response from cloudfront



24
25
26
# File 'lib/cloudfront/distribution/download_distribution.rb', line 24

def download_distribution_list(max_items = 0, marker = "")
  distribution_list(DOWNLOAD_DISTRIBUTION_URL, max_items, marker)
end

#download_distribution_put_config(distribution_id, distribution, etag) ⇒ Faraday::Response

Puts the download distribution configuration. To put a distribution config we must follow a certain process defined in docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowToUpdateDistribution.html

Parameters:

  • distribution_id (String)

    The id of the distribution.

  • distribution (Cloudfront::Helpers::Distribution)

    a distribution configuration wrapper

  • etag (String)

    The etag.

Returns:

  • (Faraday::Response)

    the response from cloudfront



49
50
51
# File 'lib/cloudfront/distribution/download_distribution.rb', line 49

def download_distribution_put_config(distribution_id, distribution, etag)
  distribution_put_config(DOWNLOAD_DISTRIBUTION_URL, distribution_id, distribution, etag)
end