Class: Aws::RDS::Resource
- Inherits:
-
Object
- Object
- Aws::RDS::Resource
- Defined in:
- lib/aws-sdk-rds/resource.rb
Overview
This class provides a resource oriented interface for RDS. To create a resource object:
resource = Aws::RDS::Resource.new(region: 'us-west-2')
You can supply a client object with custom configuration that will be used for all resource operations. If you do not pass ‘:client`, a default client will be constructed.
client = Aws::RDS::Client.new(region: 'us-west-2')
resource = Aws::RDS::Resource.new(client: client)
Actions collapse
- #create_db_cluster(options = {}) ⇒ DBCluster
- #create_db_cluster_parameter_group(options = {}) ⇒ DBClusterParameterGroup
- #create_db_instance(options = {}) ⇒ DBInstance
- #create_db_parameter_group(options = {}) ⇒ DBParameterGroup
- #create_db_security_group(options = {}) ⇒ DBSecurityGroup
- #create_db_subnet_group(options = {}) ⇒ DBSubnetGroup
- #create_event_subscription(options = {}) ⇒ EventSubscription
- #create_option_group(options = {}) ⇒ OptionGroup
Associations collapse
- #account_quotas(options = {}) ⇒ AccountQuota::Collection
- #certificate(id) ⇒ Certificate
- #certificates(options = {}) ⇒ Certificate::Collection
- #db_cluster(id) ⇒ DBCluster
- #db_cluster_parameter_group(name) ⇒ DBClusterParameterGroup
- #db_cluster_parameter_groups(options = {}) ⇒ DBClusterParameterGroup::Collection
- #db_clusters(options = {}) ⇒ DBCluster::Collection
- #db_engine(name) ⇒ DBEngine
- #db_engine_version(engine_name, version) ⇒ DBEngineVersion
- #db_engine_versions(options = {}) ⇒ DBEngineVersion::Collection
- #db_instance(id) ⇒ DBInstance
- #db_instances(options = {}) ⇒ DBInstance::Collection
- #db_parameter_group(name) ⇒ DBParameterGroup
- #db_parameter_group_family(name) ⇒ DBParameterGroupFamily
- #db_parameter_groups(options = {}) ⇒ DBParameterGroup::Collection
- #db_security_group(name) ⇒ DBSecurityGroup
- #db_security_groups(options = {}) ⇒ DBSecurityGroup::Collection
- #db_snapshots(options = {}) ⇒ DBSnapshot::Collection
- #db_subnet_group(name) ⇒ DBSubnetGroup
- #db_subnet_groups(options = {}) ⇒ DBSubnetGroup::Collection
- #event_category_map(source_type) ⇒ EventCategoryMap
- #event_category_maps(options = {}) ⇒ EventCategoryMap::Collection
- #event_subscription(name) ⇒ EventSubscription
- #event_subscriptions(options = {}) ⇒ EventSubscription::Collection
- #events(options = {}) ⇒ Event::Collection
- #option_group(name) ⇒ OptionGroup
- #option_groups(options = {}) ⇒ OptionGroup::Collection
- #pending_maintenance_action(target_arn, name) ⇒ PendingMaintenanceAction
- #reserved_db_instance(id) ⇒ ReservedDBInstance
- #reserved_db_instances(options = {}) ⇒ ReservedDBInstance::Collection
- #reserved_db_instances_offering(id) ⇒ ReservedDBInstancesOffering
- #reserved_db_instances_offerings(options = {}) ⇒ ReservedDBInstancesOffering::Collection
- #resource_with_pending_maintenance_actions(arn) ⇒ ResourcePendingMaintenanceActionList
- #resources_with_pending_maintenance_actions(options = {}) ⇒ ResourcePendingMaintenanceActionList::Collection
Instance Method Summary collapse
- #client ⇒ Client
-
#initialize(options = {}) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
Instance Method Details
#account_quotas(options = {}) ⇒ AccountQuota::Collection
2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 |
# File 'lib/aws-sdk-rds/resource.rb', line 2774 def account_quotas( = {}) batches = Enumerator.new do |y| batch = [] resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_account_attributes() end resp.data.account_quotas.each do |a| batch << AccountQuota.new( name: a.account_quota_name, data: a, client: @client ) end y.yield(batch) end AccountQuota::Collection.new(batches) end |
#certificate(id) ⇒ Certificate
2794 2795 2796 2797 2798 2799 |
# File 'lib/aws-sdk-rds/resource.rb', line 2794 def certificate(id) Certificate.new( id: id, client: @client ) end |
#certificates(options = {}) ⇒ Certificate::Collection
2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 |
# File 'lib/aws-sdk-rds/resource.rb', line 2826 def certificates( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_certificates() end resp.each_page do |page| batch = [] page.data.certificates.each do |c| batch << Certificate.new( id: c.certificate_identifier, data: c, client: @client ) end y.yield(batch) end end Certificate::Collection.new(batches) end |
#create_db_cluster(options = {}) ⇒ DBCluster
967 968 969 970 971 972 973 974 975 976 |
# File 'lib/aws-sdk-rds/resource.rb', line 967 def create_db_cluster( = {}) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.create_db_cluster() end DBCluster.new( id: resp.data.db_cluster.db_cluster_identifier, data: resp.data.db_cluster, client: @client ) end |
#create_db_cluster_parameter_group(options = {}) ⇒ DBClusterParameterGroup
1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 |
# File 'lib/aws-sdk-rds/resource.rb', line 1058 def create_db_cluster_parameter_group( = {}) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.create_db_cluster_parameter_group() end DBClusterParameterGroup.new( name: resp.data.db_cluster_parameter_group.db_cluster_parameter_group_name, data: resp.data.db_cluster_parameter_group, client: @client ) end |
#create_db_instance(options = {}) ⇒ DBInstance
2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 |
# File 'lib/aws-sdk-rds/resource.rb', line 2381 def create_db_instance( = {}) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.create_db_instance() end DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#create_db_parameter_group(options = {}) ⇒ DBParameterGroup
2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 |
# File 'lib/aws-sdk-rds/resource.rb', line 2476 def create_db_parameter_group( = {}) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.create_db_parameter_group() end DBParameterGroup.new( name: resp.data.db_parameter_group.db_parameter_group_name, data: resp.data.db_parameter_group, client: @client ) end |
#create_db_security_group(options = {}) ⇒ DBSecurityGroup
2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 |
# File 'lib/aws-sdk-rds/resource.rb', line 2520 def create_db_security_group( = {}) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.create_db_security_group() end DBSecurityGroup.new( name: resp.data.db_security_group.db_security_group_name, data: resp.data.db_security_group, client: @client ) end |
#create_db_subnet_group(options = {}) ⇒ DBSubnetGroup
2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 |
# File 'lib/aws-sdk-rds/resource.rb', line 2566 def create_db_subnet_group( = {}) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.create_db_subnet_group() end DBSubnetGroup.new( name: resp.data.db_subnet_group.db_subnet_group_name, data: resp.data.db_subnet_group, client: @client ) end |
#create_event_subscription(options = {}) ⇒ EventSubscription
2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 |
# File 'lib/aws-sdk-rds/resource.rb', line 2680 def create_event_subscription( = {}) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.create_event_subscription() end EventSubscription.new( name: resp.data.event_subscription.cust_subscription_id, data: resp.data.event_subscription, client: @client ) end |
#create_option_group(options = {}) ⇒ OptionGroup
2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 |
# File 'lib/aws-sdk-rds/resource.rb', line 2756 def create_option_group( = {}) resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.create_option_group() end OptionGroup.new( name: resp.data.option_group.option_group_name, data: resp.data.option_group, client: @client ) end |
#db_cluster(id) ⇒ DBCluster
2848 2849 2850 2851 2852 2853 |
# File 'lib/aws-sdk-rds/resource.rb', line 2848 def db_cluster(id) DBCluster.new( id: id, client: @client ) end |
#db_cluster_parameter_group(name) ⇒ DBClusterParameterGroup
2857 2858 2859 2860 2861 2862 |
# File 'lib/aws-sdk-rds/resource.rb', line 2857 def db_cluster_parameter_group(name) DBClusterParameterGroup.new( name: name, client: @client ) end |
#db_cluster_parameter_groups(options = {}) ⇒ DBClusterParameterGroup::Collection
2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 |
# File 'lib/aws-sdk-rds/resource.rb', line 2889 def db_cluster_parameter_groups( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_db_cluster_parameter_groups() end resp.each_page do |page| batch = [] page.data.db_cluster_parameter_groups.each do |d| batch << DBClusterParameterGroup.new( name: d.db_cluster_parameter_group_name, data: d, client: @client ) end y.yield(batch) end end DBClusterParameterGroup::Collection.new(batches) end |
#db_clusters(options = {}) ⇒ DBCluster::Collection
2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 |
# File 'lib/aws-sdk-rds/resource.rb', line 2960 def db_clusters( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_db_clusters() end resp.each_page do |page| batch = [] page.data.db_clusters.each do |d| batch << DBCluster.new( id: d.db_cluster_identifier, data: d, client: @client ) end y.yield(batch) end end DBCluster::Collection.new(batches) end |
#db_engine(name) ⇒ DBEngine
2982 2983 2984 2985 2986 2987 |
# File 'lib/aws-sdk-rds/resource.rb', line 2982 def db_engine(name) DBEngine.new( name: name, client: @client ) end |
#db_engine_version(engine_name, version) ⇒ DBEngineVersion
2992 2993 2994 2995 2996 2997 2998 |
# File 'lib/aws-sdk-rds/resource.rb', line 2992 def db_engine_version(engine_name, version) DBEngineVersion.new( engine_name: engine_name, version: version, client: @client ) end |
#db_engine_versions(options = {}) ⇒ DBEngineVersion::Collection
3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 |
# File 'lib/aws-sdk-rds/resource.rb', line 3137 def db_engine_versions( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_db_engine_versions() end resp.each_page do |page| batch = [] page.data.db_engine_versions.each do |d| batch << DBEngineVersion.new( engine_name: d.engine, version: d.engine_version, data: d, client: @client ) end y.yield(batch) end end DBEngineVersion::Collection.new(batches) end |
#db_instance(id) ⇒ DBInstance
3160 3161 3162 3163 3164 3165 |
# File 'lib/aws-sdk-rds/resource.rb', line 3160 def db_instance(id) DBInstance.new( id: id, client: @client ) end |
#db_instances(options = {}) ⇒ DBInstance::Collection
3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 |
# File 'lib/aws-sdk-rds/resource.rb', line 3215 def db_instances( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_db_instances() end resp.each_page do |page| batch = [] page.data.db_instances.each do |d| batch << DBInstance.new( id: d.db_instance_identifier, data: d, client: @client ) end y.yield(batch) end end DBInstance::Collection.new(batches) end |
#db_parameter_group(name) ⇒ DBParameterGroup
3237 3238 3239 3240 3241 3242 |
# File 'lib/aws-sdk-rds/resource.rb', line 3237 def db_parameter_group(name) DBParameterGroup.new( name: name, client: @client ) end |
#db_parameter_group_family(name) ⇒ DBParameterGroupFamily
3246 3247 3248 3249 3250 3251 |
# File 'lib/aws-sdk-rds/resource.rb', line 3246 def db_parameter_group_family(name) DBParameterGroupFamily.new( name: name, client: @client ) end |
#db_parameter_groups(options = {}) ⇒ DBParameterGroup::Collection
3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 |
# File 'lib/aws-sdk-rds/resource.rb', line 3277 def db_parameter_groups( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_db_parameter_groups() end resp.each_page do |page| batch = [] page.data.db_parameter_groups.each do |d| batch << DBParameterGroup.new( name: d.db_parameter_group_name, data: d, client: @client ) end y.yield(batch) end end DBParameterGroup::Collection.new(batches) end |
#db_security_group(name) ⇒ DBSecurityGroup
3299 3300 3301 3302 3303 3304 |
# File 'lib/aws-sdk-rds/resource.rb', line 3299 def db_security_group(name) DBSecurityGroup.new( name: name, client: @client ) end |
#db_security_groups(options = {}) ⇒ DBSecurityGroup::Collection
3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 |
# File 'lib/aws-sdk-rds/resource.rb', line 3323 def db_security_groups( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_db_security_groups() end resp.each_page do |page| batch = [] page.data.db_security_groups.each do |d| batch << DBSecurityGroup.new( name: d.db_security_group_name, data: d, client: @client ) end y.yield(batch) end end DBSecurityGroup::Collection.new(batches) end |
#db_snapshots(options = {}) ⇒ DBSnapshot::Collection
3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 |
# File 'lib/aws-sdk-rds/resource.rb', line 3456 def db_snapshots( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_db_snapshots() end resp.each_page do |page| batch = [] page.data.db_snapshots.each do |d| batch << DBSnapshot.new( instance_id: d.db_instance_identifier, snapshot_id: d.db_snapshot_identifier, data: d, client: @client ) end y.yield(batch) end end DBSnapshot::Collection.new(batches) end |
#db_subnet_group(name) ⇒ DBSubnetGroup
3479 3480 3481 3482 3483 3484 |
# File 'lib/aws-sdk-rds/resource.rb', line 3479 def db_subnet_group(name) DBSubnetGroup.new( name: name, client: @client ) end |
#db_subnet_groups(options = {}) ⇒ DBSubnetGroup::Collection
3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 |
# File 'lib/aws-sdk-rds/resource.rb', line 3503 def db_subnet_groups( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_db_subnet_groups() end resp.each_page do |page| batch = [] page.data.db_subnet_groups.each do |d| batch << DBSubnetGroup.new( name: d.db_subnet_group_name, data: d, client: @client ) end y.yield(batch) end end DBSubnetGroup::Collection.new(batches) end |
#event_category_map(source_type) ⇒ EventCategoryMap
3525 3526 3527 3528 3529 3530 |
# File 'lib/aws-sdk-rds/resource.rb', line 3525 def event_category_map(source_type) EventCategoryMap.new( source_type: source_type, client: @client ) end |
#event_category_maps(options = {}) ⇒ EventCategoryMap::Collection
3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 |
# File 'lib/aws-sdk-rds/resource.rb', line 3554 def event_category_maps( = {}) batches = Enumerator.new do |y| batch = [] resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_event_categories() end resp.data.event_categories_map_list.each do |e| batch << EventCategoryMap.new( source_type: e.source_type, data: e, client: @client ) end y.yield(batch) end EventCategoryMap::Collection.new(batches) end |
#event_subscription(name) ⇒ EventSubscription
3574 3575 3576 3577 3578 3579 |
# File 'lib/aws-sdk-rds/resource.rb', line 3574 def event_subscription(name) EventSubscription.new( name: name, client: @client ) end |
#event_subscriptions(options = {}) ⇒ EventSubscription::Collection
3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 |
# File 'lib/aws-sdk-rds/resource.rb', line 3599 def event_subscriptions( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_event_subscriptions() end resp.each_page do |page| batch = [] page.data.event_subscriptions_list.each do |e| batch << EventSubscription.new( name: e.cust_subscription_id, data: e, client: @client ) end y.yield(batch) end end EventSubscription::Collection.new(batches) end |
#events(options = {}) ⇒ Event::Collection
3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 |
# File 'lib/aws-sdk-rds/resource.rb', line 3700 def events( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_events() end resp.each_page do |page| batch = [] page.data.events.each do |e| batch << Event.new( source_id: e.source_identifier, date: e.date, data: e, client: @client ) end y.yield(batch) end end Event::Collection.new(batches) end |
#option_group(name) ⇒ OptionGroup
3723 3724 3725 3726 3727 3728 |
# File 'lib/aws-sdk-rds/resource.rb', line 3723 def option_group(name) OptionGroup.new( name: name, client: @client ) end |
#option_groups(options = {}) ⇒ OptionGroup::Collection
3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 |
# File 'lib/aws-sdk-rds/resource.rb', line 3785 def option_groups( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_option_groups() end resp.each_page do |page| batch = [] page.data.option_groups_list.each do |o| batch << OptionGroup.new( name: o.option_group_name, data: o, client: @client ) end y.yield(batch) end end OptionGroup::Collection.new(batches) end |
#pending_maintenance_action(target_arn, name) ⇒ PendingMaintenanceAction
3808 3809 3810 3811 3812 3813 3814 |
# File 'lib/aws-sdk-rds/resource.rb', line 3808 def pending_maintenance_action(target_arn, name) PendingMaintenanceAction.new( target_arn: target_arn, name: name, client: @client ) end |
#reserved_db_instance(id) ⇒ ReservedDBInstance
3818 3819 3820 3821 3822 3823 |
# File 'lib/aws-sdk-rds/resource.rb', line 3818 def reserved_db_instance(id) ReservedDBInstance.new( id: id, client: @client ) end |
#reserved_db_instances(options = {}) ⇒ ReservedDBInstance::Collection
3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 |
# File 'lib/aws-sdk-rds/resource.rb', line 3882 def reserved_db_instances( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_reserved_db_instances() end resp.each_page do |page| batch = [] page.data.reserved_db_instances.each do |r| batch << ReservedDBInstance.new( id: r.reserved_db_instance_id, data: r, client: @client ) end y.yield(batch) end end ReservedDBInstance::Collection.new(batches) end |
#reserved_db_instances_offering(id) ⇒ ReservedDBInstancesOffering
3904 3905 3906 3907 3908 3909 |
# File 'lib/aws-sdk-rds/resource.rb', line 3904 def reserved_db_instances_offering(id) ReservedDBInstancesOffering.new( id: id, client: @client ) end |
#reserved_db_instances_offerings(options = {}) ⇒ ReservedDBInstancesOffering::Collection
3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 |
# File 'lib/aws-sdk-rds/resource.rb', line 3961 def reserved_db_instances_offerings( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_reserved_db_instances_offerings() end resp.each_page do |page| batch = [] page.data.reserved_db_instances_offerings.each do |r| batch << ReservedDBInstancesOffering.new( id: r.reserved_db_instances_offering_id, data: r, client: @client ) end y.yield(batch) end end ReservedDBInstancesOffering::Collection.new(batches) end |
#resource_with_pending_maintenance_actions(arn) ⇒ ResourcePendingMaintenanceActionList
3983 3984 3985 3986 3987 3988 |
# File 'lib/aws-sdk-rds/resource.rb', line 3983 def resource_with_pending_maintenance_actions(arn) ResourcePendingMaintenanceActionList.new( arn: arn, client: @client ) end |
#resources_with_pending_maintenance_actions(options = {}) ⇒ ResourcePendingMaintenanceActionList::Collection
4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 |
# File 'lib/aws-sdk-rds/resource.rb', line 4018 def resources_with_pending_maintenance_actions( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do @client.describe_pending_maintenance_actions() end resp.each_page do |page| batch = [] page.data.pending_maintenance_actions.each do |p| batch << ResourcePendingMaintenanceActionList.new( arn: p.resource_identifier, data: p, client: @client ) end y.yield(batch) end end ResourcePendingMaintenanceActionList::Collection.new(batches) end |