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
2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 |
# File 'lib/aws-sdk-rds/resource.rb', line 2524 def account_quotas( = {}) batches = Enumerator.new do |y| batch = [] resp = Aws::Plugins::UserAgent.feature('resource') 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
2544 2545 2546 2547 2548 2549 |
# File 'lib/aws-sdk-rds/resource.rb', line 2544 def certificate(id) Certificate.new( id: id, client: @client ) end |
#certificates(options = {}) ⇒ Certificate::Collection
2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 |
# File 'lib/aws-sdk-rds/resource.rb', line 2576 def certificates( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
868 869 870 871 872 873 874 875 876 877 |
# File 'lib/aws-sdk-rds/resource.rb', line 868 def create_db_cluster( = {}) resp = Aws::Plugins::UserAgent.feature('resource') do @client.create_db_cluster() end DBCluster.new( id: [:db_cluster][:db_cluster_identifier], data: resp.data.db_cluster, client: @client ) end |
#create_db_cluster_parameter_group(options = {}) ⇒ DBClusterParameterGroup
959 960 961 962 963 964 965 966 967 968 |
# File 'lib/aws-sdk-rds/resource.rb', line 959 def create_db_cluster_parameter_group( = {}) resp = Aws::Plugins::UserAgent.feature('resource') 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
2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 |
# File 'lib/aws-sdk-rds/resource.rb', line 2150 def create_db_instance( = {}) resp = Aws::Plugins::UserAgent.feature('resource') 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
2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 |
# File 'lib/aws-sdk-rds/resource.rb', line 2243 def create_db_parameter_group( = {}) resp = Aws::Plugins::UserAgent.feature('resource') 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
2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 |
# File 'lib/aws-sdk-rds/resource.rb', line 2287 def create_db_security_group( = {}) resp = Aws::Plugins::UserAgent.feature('resource') 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
2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 |
# File 'lib/aws-sdk-rds/resource.rb', line 2333 def create_db_subnet_group( = {}) resp = Aws::Plugins::UserAgent.feature('resource') 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
2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 |
# File 'lib/aws-sdk-rds/resource.rb', line 2433 def create_event_subscription( = {}) resp = Aws::Plugins::UserAgent.feature('resource') 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
2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 |
# File 'lib/aws-sdk-rds/resource.rb', line 2506 def create_option_group( = {}) resp = Aws::Plugins::UserAgent.feature('resource') 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
2598 2599 2600 2601 2602 2603 |
# File 'lib/aws-sdk-rds/resource.rb', line 2598 def db_cluster(id) DBCluster.new( id: id, client: @client ) end |
#db_cluster_parameter_group(name) ⇒ DBClusterParameterGroup
2607 2608 2609 2610 2611 2612 |
# File 'lib/aws-sdk-rds/resource.rb', line 2607 def db_cluster_parameter_group(name) DBClusterParameterGroup.new( name: name, client: @client ) end |
#db_cluster_parameter_groups(options = {}) ⇒ DBClusterParameterGroup::Collection
2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 |
# File 'lib/aws-sdk-rds/resource.rb', line 2639 def db_cluster_parameter_groups( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 |
# File 'lib/aws-sdk-rds/resource.rb', line 2711 def db_clusters( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
2733 2734 2735 2736 2737 2738 |
# File 'lib/aws-sdk-rds/resource.rb', line 2733 def db_engine(name) DBEngine.new( name: name, client: @client ) end |
#db_engine_version(engine_name, version) ⇒ DBEngineVersion
2743 2744 2745 2746 2747 2748 2749 |
# File 'lib/aws-sdk-rds/resource.rb', line 2743 def db_engine_version(engine_name, version) DBEngineVersion.new( engine_name: engine_name, version: version, client: @client ) end |
#db_engine_versions(options = {}) ⇒ DBEngineVersion::Collection
2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 |
# File 'lib/aws-sdk-rds/resource.rb', line 2881 def db_engine_versions( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
2904 2905 2906 2907 2908 2909 |
# File 'lib/aws-sdk-rds/resource.rb', line 2904 def db_instance(id) DBInstance.new( id: id, client: @client ) end |
#db_instances(options = {}) ⇒ DBInstance::Collection
2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 |
# File 'lib/aws-sdk-rds/resource.rb', line 2959 def db_instances( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
2981 2982 2983 2984 2985 2986 |
# File 'lib/aws-sdk-rds/resource.rb', line 2981 def db_parameter_group(name) DBParameterGroup.new( name: name, client: @client ) end |
#db_parameter_group_family(name) ⇒ DBParameterGroupFamily
2990 2991 2992 2993 2994 2995 |
# File 'lib/aws-sdk-rds/resource.rb', line 2990 def db_parameter_group_family(name) DBParameterGroupFamily.new( name: name, client: @client ) end |
#db_parameter_groups(options = {}) ⇒ DBParameterGroup::Collection
3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 |
# File 'lib/aws-sdk-rds/resource.rb', line 3021 def db_parameter_groups( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
3043 3044 3045 3046 3047 3048 |
# File 'lib/aws-sdk-rds/resource.rb', line 3043 def db_security_group(name) DBSecurityGroup.new( name: name, client: @client ) end |
#db_security_groups(options = {}) ⇒ DBSecurityGroup::Collection
3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 |
# File 'lib/aws-sdk-rds/resource.rb', line 3067 def db_security_groups( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 |
# File 'lib/aws-sdk-rds/resource.rb', line 3200 def db_snapshots( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
3223 3224 3225 3226 3227 3228 |
# File 'lib/aws-sdk-rds/resource.rb', line 3223 def db_subnet_group(name) DBSubnetGroup.new( name: name, client: @client ) end |
#db_subnet_groups(options = {}) ⇒ DBSubnetGroup::Collection
3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 |
# File 'lib/aws-sdk-rds/resource.rb', line 3247 def db_subnet_groups( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
3269 3270 3271 3272 3273 3274 |
# File 'lib/aws-sdk-rds/resource.rb', line 3269 def event_category_map(source_type) EventCategoryMap.new( source_type: source_type, client: @client ) end |
#event_category_maps(options = {}) ⇒ EventCategoryMap::Collection
3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 |
# File 'lib/aws-sdk-rds/resource.rb', line 3298 def event_category_maps( = {}) batches = Enumerator.new do |y| batch = [] resp = Aws::Plugins::UserAgent.feature('resource') 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
3318 3319 3320 3321 3322 3323 |
# File 'lib/aws-sdk-rds/resource.rb', line 3318 def event_subscription(name) EventSubscription.new( name: name, client: @client ) end |
#event_subscriptions(options = {}) ⇒ EventSubscription::Collection
3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 |
# File 'lib/aws-sdk-rds/resource.rb', line 3343 def event_subscriptions( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 |
# File 'lib/aws-sdk-rds/resource.rb', line 3444 def events( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
3467 3468 3469 3470 3471 3472 |
# File 'lib/aws-sdk-rds/resource.rb', line 3467 def option_group(name) OptionGroup.new( name: name, client: @client ) end |
#option_groups(options = {}) ⇒ OptionGroup::Collection
3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 |
# File 'lib/aws-sdk-rds/resource.rb', line 3525 def option_groups( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
3548 3549 3550 3551 3552 3553 3554 |
# File 'lib/aws-sdk-rds/resource.rb', line 3548 def pending_maintenance_action(target_arn, name) PendingMaintenanceAction.new( target_arn: target_arn, name: name, client: @client ) end |
#reserved_db_instance(id) ⇒ ReservedDBInstance
3558 3559 3560 3561 3562 3563 |
# File 'lib/aws-sdk-rds/resource.rb', line 3558 def reserved_db_instance(id) ReservedDBInstance.new( id: id, client: @client ) end |
#reserved_db_instances(options = {}) ⇒ ReservedDBInstance::Collection
3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 |
# File 'lib/aws-sdk-rds/resource.rb', line 3622 def reserved_db_instances( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
3644 3645 3646 3647 3648 3649 |
# File 'lib/aws-sdk-rds/resource.rb', line 3644 def reserved_db_instances_offering(id) ReservedDBInstancesOffering.new( id: id, client: @client ) end |
#reserved_db_instances_offerings(options = {}) ⇒ ReservedDBInstancesOffering::Collection
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 3701 def reserved_db_instances_offerings( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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
3723 3724 3725 3726 3727 3728 |
# File 'lib/aws-sdk-rds/resource.rb', line 3723 def resource_with_pending_maintenance_actions(arn) ResourcePendingMaintenanceActionList.new( arn: arn, client: @client ) end |
#resources_with_pending_maintenance_actions(options = {}) ⇒ ResourcePendingMaintenanceActionList::Collection
3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 |
# File 'lib/aws-sdk-rds/resource.rb', line 3758 def resources_with_pending_maintenance_actions( = {}) batches = Enumerator.new do |y| resp = Aws::Plugins::UserAgent.feature('resource') 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 |