Class: Aws::CloudFront::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::CloudFront::Client
- Includes:
- Aws::ClientStubs
- Defined in:
- lib/aws-sdk-cloudfront/client.rb
Overview
An API client for CloudFront. To construct a client, you need to configure a ‘:region` and `:credentials`.
client = Aws::CloudFront::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
See #initialize for a full list of supported configuration options.
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#create_cloud_front_origin_access_identity(params = {}) ⇒ Types::CreateCloudFrontOriginAccessIdentityResult
Creates a new origin access identity.
-
#create_distribution(params = {}) ⇒ Types::CreateDistributionResult
Creates a new web distribution.
-
#create_distribution_with_tags(params = {}) ⇒ Types::CreateDistributionWithTagsResult
Create a new distribution with tags.
-
#create_field_level_encryption_config(params = {}) ⇒ Types::CreateFieldLevelEncryptionConfigResult
Create a new field-level encryption configuration.
-
#create_field_level_encryption_profile(params = {}) ⇒ Types::CreateFieldLevelEncryptionProfileResult
Create a field-level encryption profile.
-
#create_invalidation(params = {}) ⇒ Types::CreateInvalidationResult
Create a new invalidation.
-
#create_public_key(params = {}) ⇒ Types::CreatePublicKeyResult
Add a new public key to CloudFront to use, for example, for field-level encryption.
-
#create_streaming_distribution(params = {}) ⇒ Types::CreateStreamingDistributionResult
Creates a new RTMP distribution.
-
#create_streaming_distribution_with_tags(params = {}) ⇒ Types::CreateStreamingDistributionWithTagsResult
Create a new streaming distribution with tags.
-
#delete_cloud_front_origin_access_identity(params = {}) ⇒ Struct
Delete an origin access identity.
-
#delete_distribution(params = {}) ⇒ Struct
Delete a distribution.
-
#delete_field_level_encryption_config(params = {}) ⇒ Struct
Remove a field-level encryption configuration.
-
#delete_field_level_encryption_profile(params = {}) ⇒ Struct
Remove a field-level encryption profile.
-
#delete_public_key(params = {}) ⇒ Struct
Remove a public key you previously added to CloudFront.
-
#delete_streaming_distribution(params = {}) ⇒ Struct
Delete a streaming distribution.
-
#get_cloud_front_origin_access_identity(params = {}) ⇒ Types::GetCloudFrontOriginAccessIdentityResult
Get the information about an origin access identity.
-
#get_cloud_front_origin_access_identity_config(params = {}) ⇒ Types::GetCloudFrontOriginAccessIdentityConfigResult
Get the configuration information about an origin access identity.
-
#get_distribution(params = {}) ⇒ Types::GetDistributionResult
Get the information about a distribution.
-
#get_distribution_config(params = {}) ⇒ Types::GetDistributionConfigResult
Get the configuration information about a distribution.
-
#get_field_level_encryption(params = {}) ⇒ Types::GetFieldLevelEncryptionResult
Get the field-level encryption configuration information.
-
#get_field_level_encryption_config(params = {}) ⇒ Types::GetFieldLevelEncryptionConfigResult
Get the field-level encryption configuration information.
-
#get_field_level_encryption_profile(params = {}) ⇒ Types::GetFieldLevelEncryptionProfileResult
Get the field-level encryption profile information.
-
#get_field_level_encryption_profile_config(params = {}) ⇒ Types::GetFieldLevelEncryptionProfileConfigResult
Get the field-level encryption profile configuration information.
-
#get_invalidation(params = {}) ⇒ Types::GetInvalidationResult
Get the information about an invalidation.
-
#get_public_key(params = {}) ⇒ Types::GetPublicKeyResult
Get the public key information.
-
#get_public_key_config(params = {}) ⇒ Types::GetPublicKeyConfigResult
Return public key configuration informaation.
-
#get_streaming_distribution(params = {}) ⇒ Types::GetStreamingDistributionResult
Gets information about a specified RTMP distribution, including the distribution configuration.
-
#get_streaming_distribution_config(params = {}) ⇒ Types::GetStreamingDistributionConfigResult
Get the configuration information about a streaming distribution.
-
#list_cloud_front_origin_access_identities(params = {}) ⇒ Types::ListCloudFrontOriginAccessIdentitiesResult
Lists origin access identities.
-
#list_distributions(params = {}) ⇒ Types::ListDistributionsResult
List CloudFront distributions.
-
#list_distributions_by_web_acl_id(params = {}) ⇒ Types::ListDistributionsByWebACLIdResult
List the distributions that are associated with a specified AWS WAF web ACL.
-
#list_field_level_encryption_configs(params = {}) ⇒ Types::ListFieldLevelEncryptionConfigsResult
List all field-level encryption configurations that have been created in CloudFront for this account.
-
#list_field_level_encryption_profiles(params = {}) ⇒ Types::ListFieldLevelEncryptionProfilesResult
Request a list of field-level encryption profiles that have been created in CloudFront for this account.
-
#list_invalidations(params = {}) ⇒ Types::ListInvalidationsResult
Lists invalidation batches.
-
#list_public_keys(params = {}) ⇒ Types::ListPublicKeysResult
List all public keys that have been added to CloudFront for this account.
-
#list_streaming_distributions(params = {}) ⇒ Types::ListStreamingDistributionsResult
List streaming distributions.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResult
List tags for a CloudFront resource.
-
#tag_resource(params = {}) ⇒ Struct
Add tags to a CloudFront resource.
-
#untag_resource(params = {}) ⇒ Struct
Remove tags from a CloudFront resource.
-
#update_cloud_front_origin_access_identity(params = {}) ⇒ Types::UpdateCloudFrontOriginAccessIdentityResult
Update an origin access identity.
-
#update_distribution(params = {}) ⇒ Types::UpdateDistributionResult
Updates the configuration for a web distribution.
-
#update_field_level_encryption_config(params = {}) ⇒ Types::UpdateFieldLevelEncryptionConfigResult
Update a field-level encryption configuration.
-
#update_field_level_encryption_profile(params = {}) ⇒ Types::UpdateFieldLevelEncryptionProfileResult
Update a field-level encryption profile.
-
#update_public_key(params = {}) ⇒ Types::UpdatePublicKeyResult
Update public key information.
-
#update_streaming_distribution(params = {}) ⇒ Types::UpdateStreamingDistributionResult
Update a streaming distribution.
Class Method Summary collapse
- .errors_module ⇒ Object private
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
-
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
- #waiter_names ⇒ Object deprecated private Deprecated.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
302 303 304 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 302 def initialize(*args) super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
4265 4266 4267 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 4265 def identifier @identifier end |
Class Method Details
.errors_module ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
4268 4269 4270 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 4268 def errors_module Errors end |
Instance Method Details
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 4126 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config) context[:gem_name] = 'aws-sdk-cloudfront' context[:gem_version] = '1.26.0' Seahorse::Client::Request.new(handlers, context) end |
#create_cloud_front_origin_access_identity(params = {}) ⇒ Types::CreateCloudFrontOriginAccessIdentityResult
Creates a new origin access identity. If you’re using Amazon S3 for your origin, you can use an origin access identity to require users to access your content using a CloudFront URL instead of the Amazon S3 URL. For more information about how to use origin access identities, see [Serving Private Content through CloudFront] in the *Amazon CloudFront Developer Guide*.
[1]: docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html
350 351 352 353 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 350 def create_cloud_front_origin_access_identity(params = {}, = {}) req = build_request(:create_cloud_front_origin_access_identity, params) req.send_request() end |
#create_distribution(params = {}) ⇒ Types::CreateDistributionResult
Creates a new web distribution. You create a CloudFront distribution to tell CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery. Send a ‘POST` request to the `/CloudFront API version/distribution`/`distribution ID` resource.
When you update a distribution, there are more required fields than when you create a distribution. When you update your distribution by using [UpdateDistribution], follow the steps included in the documentation to get the current configuration and then make your updates. This helps to make sure that you include all of the required fields. To view a summary, see [Required Fields for Create Distribution and Update Distribution] in the *Amazon CloudFront Developer Guide*.
[1]: docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.html [2]: docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-overview-required-fields.html
754 755 756 757 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 754 def create_distribution(params = {}, = {}) req = build_request(:create_distribution, params) req.send_request() end |
#create_distribution_with_tags(params = {}) ⇒ Types::CreateDistributionWithTagsResult
Create a new distribution with tags.
1150 1151 1152 1153 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1150 def (params = {}, = {}) req = build_request(:create_distribution_with_tags, params) req.send_request() end |
#create_field_level_encryption_config(params = {}) ⇒ Types::CreateFieldLevelEncryptionConfigResult
Create a new field-level encryption configuration.
1224 1225 1226 1227 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1224 def create_field_level_encryption_config(params = {}, = {}) req = build_request(:create_field_level_encryption_config, params) req.send_request() end |
#create_field_level_encryption_profile(params = {}) ⇒ Types::CreateFieldLevelEncryptionProfileResult
Create a field-level encryption profile.
1284 1285 1286 1287 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1284 def create_field_level_encryption_profile(params = {}, = {}) req = build_request(:create_field_level_encryption_profile, params) req.send_request() end |
#create_invalidation(params = {}) ⇒ Types::CreateInvalidationResult
Create a new invalidation.
1330 1331 1332 1333 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1330 def create_invalidation(params = {}, = {}) req = build_request(:create_invalidation, params) req.send_request() end |
#create_public_key(params = {}) ⇒ Types::CreatePublicKeyResult
Add a new public key to CloudFront to use, for example, for field-level encryption. You can add a maximum of 10 public keys with one AWS account.
1374 1375 1376 1377 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1374 def create_public_key(params = {}, = {}) req = build_request(:create_public_key, params) req.send_request() end |
#create_streaming_distribution(params = {}) ⇒ Types::CreateStreamingDistributionResult
Creates a new RTMP distribution. An RTMP distribution is similar to a web distribution, but an RTMP distribution streams media files using the Adobe Real-Time Messaging Protocol (RTMP) instead of serving files using HTTP.
To create a new distribution, submit a ‘POST` request to the *CloudFront API version*/distribution resource. The request body must include a document with a StreamingDistributionConfig element. The response echoes the `StreamingDistributionConfig` element and returns other information about the RTMP distribution.
To get the status of your request, use the *GET StreamingDistribution* API action. When the value of ‘Enabled` is `true` and the value of `Status` is `Deployed`, your distribution is ready. A distribution usually deploys in less than 15 minutes.
For more information about web distributions, see [Working with RTMP Distributions] in the *Amazon CloudFront Developer Guide*.
Beginning with the 2012-05-05 version of the CloudFront API, we made substantial changes to the format of the XML document that you include in the request body when you create or update a web distribution or an RTMP distribution, and when you invalidate objects. With previous versions of the API, we discovered that it was too easy to accidentally delete one or more values for an element that accepts multiple values, for example, CNAMEs and trusted signers. Our changes for the 2012-05-05 release are intended to prevent these accidental deletions and to notify you when there’s a mismatch between the number of values you say you’re specifying in the ‘Quantity` element and the number of values specified.
[1]: docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-rtmp.html
1489 1490 1491 1492 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1489 def create_streaming_distribution(params = {}, = {}) req = build_request(:create_streaming_distribution, params) req.send_request() end |
#create_streaming_distribution_with_tags(params = {}) ⇒ Types::CreateStreamingDistributionWithTagsResult
Create a new streaming distribution with tags.
1581 1582 1583 1584 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1581 def (params = {}, = {}) req = build_request(:create_streaming_distribution_with_tags, params) req.send_request() end |
#delete_cloud_front_origin_access_identity(params = {}) ⇒ Struct
Delete an origin access identity.
1608 1609 1610 1611 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1608 def delete_cloud_front_origin_access_identity(params = {}, = {}) req = build_request(:delete_cloud_front_origin_access_identity, params) req.send_request() end |
#delete_distribution(params = {}) ⇒ Struct
Delete a distribution.
1635 1636 1637 1638 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1635 def delete_distribution(params = {}, = {}) req = build_request(:delete_distribution, params) req.send_request() end |
#delete_field_level_encryption_config(params = {}) ⇒ Struct
Remove a field-level encryption configuration.
1662 1663 1664 1665 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1662 def delete_field_level_encryption_config(params = {}, = {}) req = build_request(:delete_field_level_encryption_config, params) req.send_request() end |
#delete_field_level_encryption_profile(params = {}) ⇒ Struct
Remove a field-level encryption profile.
1689 1690 1691 1692 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1689 def delete_field_level_encryption_profile(params = {}, = {}) req = build_request(:delete_field_level_encryption_profile, params) req.send_request() end |
#delete_public_key(params = {}) ⇒ Struct
Remove a public key you previously added to CloudFront.
1716 1717 1718 1719 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1716 def delete_public_key(params = {}, = {}) req = build_request(:delete_public_key, params) req.send_request() end |
#delete_streaming_distribution(params = {}) ⇒ Struct
Delete a streaming distribution. To delete an RTMP distribution using the CloudFront API, perform the following steps.
**To delete an RTMP distribution using the CloudFront API**:
-
Disable the RTMP distribution.
-
Submit a ‘GET Streaming Distribution Config` request to get the current configuration and the `Etag` header for the distribution.
-
Update the XML document that was returned in the response to your ‘GET Streaming Distribution Config` request to change the value of `Enabled` to `false`.
-
Submit a ‘PUT Streaming Distribution Config` request to update the configuration for your distribution. In the request body, include the XML document that you updated in Step 3. Then set the value of the HTTP `If-Match` header to the value of the `ETag` header that CloudFront returned when you submitted the `GET Streaming Distribution Config` request in Step 2.
-
Review the response to the ‘PUT Streaming Distribution Config` request to confirm that the distribution was successfully disabled.
-
Submit a ‘GET Streaming Distribution Config` request to confirm that your changes have propagated. When propagation is complete, the value of `Status` is `Deployed`.
-
Submit a ‘DELETE Streaming Distribution` request. Set the value of the HTTP `If-Match` header to the value of the `ETag` header that CloudFront returned when you submitted the `GET Streaming Distribution Config` request in Step 2.
-
Review the response to your ‘DELETE Streaming Distribution` request to confirm that the distribution was successfully deleted.
For information about deleting a distribution using the CloudFront console, see [Deleting a Distribution] in the *Amazon CloudFront Developer Guide*.
[1]: docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowToDeleteDistribution.html
1786 1787 1788 1789 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1786 def delete_streaming_distribution(params = {}, = {}) req = build_request(:delete_streaming_distribution, params) req.send_request() end |
#get_cloud_front_origin_access_identity(params = {}) ⇒ Types::GetCloudFrontOriginAccessIdentityResult
Get the information about an origin access identity.
1819 1820 1821 1822 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1819 def get_cloud_front_origin_access_identity(params = {}, = {}) req = build_request(:get_cloud_front_origin_access_identity, params) req.send_request() end |
#get_cloud_front_origin_access_identity_config(params = {}) ⇒ Types::GetCloudFrontOriginAccessIdentityConfigResult
Get the configuration information about an origin access identity.
1850 1851 1852 1853 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 1850 def get_cloud_front_origin_access_identity_config(params = {}, = {}) req = build_request(:get_cloud_front_origin_access_identity_config, params) req.send_request() end |
#get_distribution(params = {}) ⇒ Types::GetDistributionResult
Get the information about a distribution.
2026 2027 2028 2029 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2026 def get_distribution(params = {}, = {}) req = build_request(:get_distribution, params) req.send_request() end |
#get_distribution_config(params = {}) ⇒ Types::GetDistributionConfigResult
Get the configuration information about a distribution.
2186 2187 2188 2189 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2186 def get_distribution_config(params = {}, = {}) req = build_request(:get_distribution_config, params) req.send_request() end |
#get_field_level_encryption(params = {}) ⇒ Types::GetFieldLevelEncryptionResult
Get the field-level encryption configuration information.
2231 2232 2233 2234 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2231 def get_field_level_encryption(params = {}, = {}) req = build_request(:get_field_level_encryption, params) req.send_request() end |
#get_field_level_encryption_config(params = {}) ⇒ Types::GetFieldLevelEncryptionConfigResult
Get the field-level encryption configuration information.
2274 2275 2276 2277 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2274 def get_field_level_encryption_config(params = {}, = {}) req = build_request(:get_field_level_encryption_config, params) req.send_request() end |
#get_field_level_encryption_profile(params = {}) ⇒ Types::GetFieldLevelEncryptionProfileResult
Get the field-level encryption profile information.
2315 2316 2317 2318 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2315 def get_field_level_encryption_profile(params = {}, = {}) req = build_request(:get_field_level_encryption_profile, params) req.send_request() end |
#get_field_level_encryption_profile_config(params = {}) ⇒ Types::GetFieldLevelEncryptionProfileConfigResult
Get the field-level encryption profile configuration information.
2355 2356 2357 2358 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2355 def get_field_level_encryption_profile_config(params = {}, = {}) req = build_request(:get_field_level_encryption_profile_config, params) req.send_request() end |
#get_invalidation(params = {}) ⇒ Types::GetInvalidationResult
Get the information about an invalidation.
2394 2395 2396 2397 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2394 def get_invalidation(params = {}, = {}) req = build_request(:get_invalidation, params) req.send_request() end |
#get_public_key(params = {}) ⇒ Types::GetPublicKeyResult
Get the public key information.
2429 2430 2431 2432 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2429 def get_public_key(params = {}, = {}) req = build_request(:get_public_key, params) req.send_request() end |
#get_public_key_config(params = {}) ⇒ Types::GetPublicKeyConfigResult
Return public key configuration informaation
2462 2463 2464 2465 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2462 def get_public_key_config(params = {}, = {}) req = build_request(:get_public_key_config, params) req.send_request() end |
#get_streaming_distribution(params = {}) ⇒ Types::GetStreamingDistributionResult
Gets information about a specified RTMP distribution, including the distribution configuration.
2520 2521 2522 2523 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2520 def get_streaming_distribution(params = {}, = {}) req = build_request(:get_streaming_distribution, params) req.send_request() end |
#get_streaming_distribution_config(params = {}) ⇒ Types::GetStreamingDistributionConfigResult
Get the configuration information about a streaming distribution.
2565 2566 2567 2568 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2565 def get_streaming_distribution_config(params = {}, = {}) req = build_request(:get_streaming_distribution_config, params) req.send_request() end |
#list_cloud_front_origin_access_identities(params = {}) ⇒ Types::ListCloudFrontOriginAccessIdentitiesResult
Lists origin access identities.
2611 2612 2613 2614 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2611 def list_cloud_front_origin_access_identities(params = {}, = {}) req = build_request(:list_cloud_front_origin_access_identities, params) req.send_request() end |
#list_distributions(params = {}) ⇒ Types::ListDistributionsResult
List CloudFront distributions.
2784 2785 2786 2787 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2784 def list_distributions(params = {}, = {}) req = build_request(:list_distributions, params) req.send_request() end |
#list_distributions_by_web_acl_id(params = {}) ⇒ Types::ListDistributionsByWebACLIdResult
List the distributions that are associated with a specified AWS WAF web ACL.
2966 2967 2968 2969 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 2966 def list_distributions_by_web_acl_id(params = {}, = {}) req = build_request(:list_distributions_by_web_acl_id, params) req.send_request() end |
#list_field_level_encryption_configs(params = {}) ⇒ Types::ListFieldLevelEncryptionConfigsResult
List all field-level encryption configurations that have been created in CloudFront for this account.
3022 3023 3024 3025 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 3022 def list_field_level_encryption_configs(params = {}, = {}) req = build_request(:list_field_level_encryption_configs, params) req.send_request() end |
#list_field_level_encryption_profiles(params = {}) ⇒ Types::ListFieldLevelEncryptionProfilesResult
Request a list of field-level encryption profiles that have been created in CloudFront for this account.
3074 3075 3076 3077 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 3074 def list_field_level_encryption_profiles(params = {}, = {}) req = build_request(:list_field_level_encryption_profiles, params) req.send_request() end |
#list_invalidations(params = {}) ⇒ Types::ListInvalidationsResult
Lists invalidation batches.
3126 3127 3128 3129 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 3126 def list_invalidations(params = {}, = {}) req = build_request(:list_invalidations, params) req.send_request() end |
#list_public_keys(params = {}) ⇒ Types::ListPublicKeysResult
List all public keys that have been added to CloudFront for this account.
3171 3172 3173 3174 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 3171 def list_public_keys(params = {}, = {}) req = build_request(:list_public_keys, params) req.send_request() end |
#list_streaming_distributions(params = {}) ⇒ Types::ListStreamingDistributionsResult
List streaming distributions.
3225 3226 3227 3228 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 3225 def list_streaming_distributions(params = {}, = {}) req = build_request(:list_streaming_distributions, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResult
List tags for a CloudFront resource.
3255 3256 3257 3258 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 3255 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Add tags to a CloudFront resource.
3288 3289 3290 3291 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 3288 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Remove tags from a CloudFront resource.
3316 3317 3318 3319 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 3316 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_cloud_front_origin_access_identity(params = {}) ⇒ Types::UpdateCloudFrontOriginAccessIdentityResult
Update an origin access identity.
3361 3362 3363 3364 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 3361 def update_cloud_front_origin_access_identity(params = {}, = {}) req = build_request(:update_cloud_front_origin_access_identity, params) req.send_request() end |
#update_distribution(params = {}) ⇒ Types::UpdateDistributionResult
Updates the configuration for a web distribution.
When you update a distribution, there are more required fields than when you create a distribution. When you update your distribution by using this API action, follow the steps here to get the current configuration and then make your updates, to make sure that you include all of the required fields. To view a summary, see [Required Fields for Create Distribution and Update Distribution] in the *Amazon CloudFront Developer Guide*.
The update process includes getting the current distribution configuration, updating the XML document that is returned to make your changes, and then submitting an ‘UpdateDistribution` request to make the updates.
For information about updating a distribution using the CloudFront console instead, see [Creating a Distribution] in the *Amazon CloudFront Developer Guide*.
**To update a web distribution using the CloudFront API**
-
Submit a [GetDistributionConfig] request to get the current configuration and an ‘Etag` header for the distribution.
<note markdown=“1”> If you update the distribution again, you must get a new ‘Etag` header.
</note>
-
Update the XML document that was returned in the response to your ‘GetDistributionConfig` request to include your changes.
When you edit the XML file, be aware of the following:
* You must strip out the ETag parameter that is returned.
-
Additional fields are required when you update a distribution. There may be fields included in the XML file for features that you haven’t configured for your distribution. This is expected and required to successfully update the distribution.
-
You can’t change the value of ‘CallerReference`. If you try to change this value, CloudFront returns an `IllegalUpdate` error.
-
The new configuration replaces the existing configuration; the values that you specify in an ‘UpdateDistribution` request are not merged into your existing configuration. When you add, delete, or replace values in an element that allows multiple values (for example, `CNAME`), you must specify all of the values that you want to appear in the updated distribution. In addition, you must update the corresponding `Quantity` element.
-
-
Submit an ‘UpdateDistribution` request to update the configuration for your distribution:
-
In the request body, include the XML document that you updated in Step 2. The request body must include an XML document with a ‘DistributionConfig` element.
-
Set the value of the HTTP ‘If-Match` header to the value of the `ETag` header that CloudFront returned when you submitted the `GetDistributionConfig` request in Step 1.
-
-
Review the response to the ‘UpdateDistribution` request to confirm that the configuration was successfully updated.
-
Optional: Submit a [GetDistribution] request to confirm that your changes have propagated. When propagation is complete, the value of ‘Status` is `Deployed`.
[1]: docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-overview-required-fields.html [2]: docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-creating-console.html [3]: docs.aws.amazon.com/cloudfront/latest/APIReference/API_GetDistributionConfig.html [4]: docs.aws.amazon.com/cloudfront/latest/APIReference/API_GetDistribution.html
3829 3830 3831 3832 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 3829 def update_distribution(params = {}, = {}) req = build_request(:update_distribution, params) req.send_request() end |
#update_field_level_encryption_config(params = {}) ⇒ Types::UpdateFieldLevelEncryptionConfigResult
Update a field-level encryption configuration.
3910 3911 3912 3913 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 3910 def update_field_level_encryption_config(params = {}, = {}) req = build_request(:update_field_level_encryption_config, params) req.send_request() end |
#update_field_level_encryption_profile(params = {}) ⇒ Types::UpdateFieldLevelEncryptionProfileResult
Update a field-level encryption profile.
3977 3978 3979 3980 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 3977 def update_field_level_encryption_profile(params = {}, = {}) req = build_request(:update_field_level_encryption_profile, params) req.send_request() end |
#update_public_key(params = {}) ⇒ Types::UpdatePublicKeyResult
Update public key information. Note that the only value you can change is the comment.
4027 4028 4029 4030 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 4027 def update_public_key(params = {}, = {}) req = build_request(:update_public_key, params) req.send_request() end |
#update_streaming_distribution(params = {}) ⇒ Types::UpdateStreamingDistributionResult
Update a streaming distribution.
4117 4118 4119 4120 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 4117 def update_streaming_distribution(params = {}, = {}) req = build_request(:update_streaming_distribution, params) req.send_request() end |
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
## Basic Usage
A waiter will call an API operation until:
-
It is successful
-
It enters a terminal state
-
It makes the maximum number of attempts
In between attempts, the waiter will sleep.
# polls in a loop, sleeping between attempts
client.wait_until(waiter_name, params)
## Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.
# poll for ~25 seconds
client.wait_until(waiter_name, params, {
max_attempts: 5,
delay: 5,
})
## Callbacks
You can be notified before each polling attempt and before each delay. If you throw ‘:success` or `:failure` from these callbacks, it will terminate the waiter.
started_at = Time.now
client.wait_until(waiter_name, params, {
# disable max attempts
max_attempts: nil,
# poll for 1 hour, instead of a number of attempts
before_wait: -> (attempts, response) do
throw :failure if Time.now - started_at > 3600
end
})
## Handling Errors
When a waiter is unsuccessful, it will raise an error. All of the failure errors extend from Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
## Valid Waiters
The following table lists the valid waiter names, the operations they call, and the default ‘:delay` and `:max_attempts` values.
| waiter_name | params | :delay | :max_attempts | | ——————————- | —————————– | ——– | ————- | | distribution_deployed | #get_distribution | 60 | 35 | | invalidation_completed | #get_invalidation | 20 | 30 | | streaming_distribution_deployed | #get_streaming_distribution | 60 | 25 |
4229 4230 4231 4232 4233 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 4229 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |
#waiter_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
4237 4238 4239 |
# File 'lib/aws-sdk-cloudfront/client.rb', line 4237 def waiter_names waiters.keys end |