Class: Aws::RDS::Resource
- Inherits:
-
Object
- Object
- Aws::RDS::Resource
- Defined in:
- gems/aws-sdk-rds/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
2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2532 def account_quotas( = {}) batches = Enumerator.new do |y| batch = [] resp = @client.describe_account_attributes() 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
2550 2551 2552 2553 2554 2555 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2550 def certificate(id) Certificate.new( id: id, client: @client ) end |
#certificates(options = {}) ⇒ Certificate::Collection
2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2582 def certificates( = {}) batches = Enumerator.new do |y| resp = @client.describe_certificates() 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 |
#client ⇒ Client
32 33 34 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 32 def client @client end |
#create_db_cluster(options = {}) ⇒ DBCluster
885 886 887 888 889 890 891 892 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 885 def create_db_cluster( = {}) resp = @client.create_db_cluster() DBCluster.new( id: [:db_cluster][:db_cluster_identifier], data: resp.data.db_cluster, client: @client ) end |
#create_db_cluster_parameter_group(options = {}) ⇒ DBClusterParameterGroup
977 978 979 980 981 982 983 984 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 977 def create_db_cluster_parameter_group( = {}) resp = @client.create_db_cluster_parameter_group() 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
2167 2168 2169 2170 2171 2172 2173 2174 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2167 def create_db_instance( = {}) resp = @client.create_db_instance() DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end |
#create_db_parameter_group(options = {}) ⇒ DBParameterGroup
2261 2262 2263 2264 2265 2266 2267 2268 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2261 def create_db_parameter_group( = {}) resp = @client.create_db_parameter_group() 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
2303 2304 2305 2306 2307 2308 2309 2310 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2303 def create_db_security_group( = {}) resp = @client.create_db_security_group() 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
2347 2348 2349 2350 2351 2352 2353 2354 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2347 def create_db_subnet_group( = {}) resp = @client.create_db_subnet_group() 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
2445 2446 2447 2448 2449 2450 2451 2452 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2445 def create_event_subscription( = {}) resp = @client.create_event_subscription() EventSubscription.new( name: resp.data.event_subscription.cust_subscription_id, data: resp.data.event_subscription, client: @client ) end |
#create_option_group(options = {}) ⇒ OptionGroup
2516 2517 2518 2519 2520 2521 2522 2523 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2516 def create_option_group( = {}) resp = @client.create_option_group() OptionGroup.new( name: resp.data.option_group.option_group_name, data: resp.data.option_group, client: @client ) end |
#db_cluster(id) ⇒ DBCluster
2602 2603 2604 2605 2606 2607 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2602 def db_cluster(id) DBCluster.new( id: id, client: @client ) end |
#db_cluster_parameter_group(name) ⇒ DBClusterParameterGroup
2611 2612 2613 2614 2615 2616 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2611 def db_cluster_parameter_group(name) DBClusterParameterGroup.new( name: name, client: @client ) end |
#db_cluster_parameter_groups(options = {}) ⇒ DBClusterParameterGroup::Collection
2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2643 def db_cluster_parameter_groups( = {}) batches = Enumerator.new do |y| resp = @client.describe_db_cluster_parameter_groups() 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
2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2709 def db_clusters( = {}) batches = Enumerator.new do |y| resp = @client.describe_db_clusters() 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
2729 2730 2731 2732 2733 2734 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2729 def db_engine(name) DBEngine.new( name: name, client: @client ) end |
#db_engine_version(engine_name, version) ⇒ DBEngineVersion
2739 2740 2741 2742 2743 2744 2745 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2739 def db_engine_version(engine_name, version) DBEngineVersion.new( engine_name: engine_name, version: version, client: @client ) end |
#db_engine_versions(options = {}) ⇒ DBEngineVersion::Collection
2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2878 def db_engine_versions( = {}) batches = Enumerator.new do |y| resp = @client.describe_db_engine_versions() 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
2899 2900 2901 2902 2903 2904 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2899 def db_instance(id) DBInstance.new( id: id, client: @client ) end |
#db_instances(options = {}) ⇒ DBInstance::Collection
2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2954 def db_instances( = {}) batches = Enumerator.new do |y| resp = @client.describe_db_instances() 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
2974 2975 2976 2977 2978 2979 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2974 def db_parameter_group(name) DBParameterGroup.new( name: name, client: @client ) end |
#db_parameter_group_family(name) ⇒ DBParameterGroupFamily
2983 2984 2985 2986 2987 2988 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2983 def db_parameter_group_family(name) DBParameterGroupFamily.new( name: name, client: @client ) end |
#db_parameter_groups(options = {}) ⇒ DBParameterGroup::Collection
3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3014 def db_parameter_groups( = {}) batches = Enumerator.new do |y| resp = @client.describe_db_parameter_groups() 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
3034 3035 3036 3037 3038 3039 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3034 def db_security_group(name) DBSecurityGroup.new( name: name, client: @client ) end |
#db_security_groups(options = {}) ⇒ DBSecurityGroup::Collection
3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3058 def db_security_groups( = {}) batches = Enumerator.new do |y| resp = @client.describe_db_security_groups() 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
3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3189 def db_snapshots( = {}) batches = Enumerator.new do |y| resp = @client.describe_db_snapshots() 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
3210 3211 3212 3213 3214 3215 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3210 def db_subnet_group(name) DBSubnetGroup.new( name: name, client: @client ) end |
#db_subnet_groups(options = {}) ⇒ DBSubnetGroup::Collection
3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3234 def db_subnet_groups( = {}) batches = Enumerator.new do |y| resp = @client.describe_db_subnet_groups() 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
3254 3255 3256 3257 3258 3259 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3254 def event_category_map(source_type) EventCategoryMap.new( source_type: source_type, client: @client ) end |
#event_category_maps(options = {}) ⇒ EventCategoryMap::Collection
3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3283 def event_category_maps( = {}) batches = Enumerator.new do |y| batch = [] resp = @client.describe_event_categories() 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
3301 3302 3303 3304 3305 3306 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3301 def event_subscription(name) EventSubscription.new( name: name, client: @client ) end |
#event_subscriptions(options = {}) ⇒ EventSubscription::Collection
3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3326 def event_subscriptions( = {}) batches = Enumerator.new do |y| resp = @client.describe_event_subscriptions() 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
3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3425 def events( = {}) batches = Enumerator.new do |y| resp = @client.describe_events() 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
3446 3447 3448 3449 3450 3451 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3446 def option_group(name) OptionGroup.new( name: name, client: @client ) end |
#option_groups(options = {}) ⇒ OptionGroup::Collection
3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3504 def option_groups( = {}) batches = Enumerator.new do |y| resp = @client.describe_option_groups() 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
3525 3526 3527 3528 3529 3530 3531 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3525 def pending_maintenance_action(target_arn, name) PendingMaintenanceAction.new( target_arn: target_arn, name: name, client: @client ) end |
#reserved_db_instance(id) ⇒ ReservedDBInstance
3535 3536 3537 3538 3539 3540 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3535 def reserved_db_instance(id) ReservedDBInstance.new( id: id, client: @client ) end |
#reserved_db_instances(options = {}) ⇒ ReservedDBInstance::Collection
3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3599 def reserved_db_instances( = {}) batches = Enumerator.new do |y| resp = @client.describe_reserved_db_instances() 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
3619 3620 3621 3622 3623 3624 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3619 def reserved_db_instances_offering(id) ReservedDBInstancesOffering.new( id: id, client: @client ) end |
#reserved_db_instances_offerings(options = {}) ⇒ ReservedDBInstancesOffering::Collection
3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3676 def reserved_db_instances_offerings( = {}) batches = Enumerator.new do |y| resp = @client.describe_reserved_db_instances_offerings() 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
3696 3697 3698 3699 3700 3701 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3696 def resource_with_pending_maintenance_actions(arn) ResourcePendingMaintenanceActionList.new( arn: arn, client: @client ) end |
#resources_with_pending_maintenance_actions(options = {}) ⇒ ResourcePendingMaintenanceActionList::Collection
3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3731 def resources_with_pending_maintenance_actions( = {}) batches = Enumerator.new do |y| resp = @client.describe_pending_maintenance_actions() 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 |