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
2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2298 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
2316 2317 2318 2319 2320 2321 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2316 def certificate(id) Certificate.new( id: id, client: @client ) end |
#certificates(options = {}) ⇒ Certificate::Collection
2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2348 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
785 786 787 788 789 790 791 792 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 785 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
877 878 879 880 881 882 883 884 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 877 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
1933 1934 1935 1936 1937 1938 1939 1940 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 1933 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
2027 2028 2029 2030 2031 2032 2033 2034 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2027 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
2069 2070 2071 2072 2073 2074 2075 2076 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2069 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
2113 2114 2115 2116 2117 2118 2119 2120 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2113 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
2211 2212 2213 2214 2215 2216 2217 2218 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2211 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
2282 2283 2284 2285 2286 2287 2288 2289 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2282 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
2368 2369 2370 2371 2372 2373 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2368 def db_cluster(id) DBCluster.new( id: id, client: @client ) end |
#db_cluster_parameter_group(name) ⇒ DBClusterParameterGroup
2377 2378 2379 2380 2381 2382 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2377 def db_cluster_parameter_group(name) DBClusterParameterGroup.new( name: name, client: @client ) end |
#db_cluster_parameter_groups(options = {}) ⇒ DBClusterParameterGroup::Collection
2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2409 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
2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2474 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
2494 2495 2496 2497 2498 2499 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2494 def db_engine(name) DBEngine.new( name: name, client: @client ) end |
#db_engine_version(engine_name, version) ⇒ DBEngineVersion
2504 2505 2506 2507 2508 2509 2510 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2504 def db_engine_version(engine_name, version) DBEngineVersion.new( engine_name: engine_name, version: version, client: @client ) end |
#db_engine_versions(options = {}) ⇒ DBEngineVersion::Collection
2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2643 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
2664 2665 2666 2667 2668 2669 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2664 def db_instance(id) DBInstance.new( id: id, client: @client ) end |
#db_instances(options = {}) ⇒ DBInstance::Collection
2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2718 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
2738 2739 2740 2741 2742 2743 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2738 def db_parameter_group(name) DBParameterGroup.new( name: name, client: @client ) end |
#db_parameter_group_family(name) ⇒ DBParameterGroupFamily
2747 2748 2749 2750 2751 2752 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2747 def db_parameter_group_family(name) DBParameterGroupFamily.new( name: name, client: @client ) end |
#db_parameter_groups(options = {}) ⇒ DBParameterGroup::Collection
2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2778 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
2798 2799 2800 2801 2802 2803 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2798 def db_security_group(name) DBSecurityGroup.new( name: name, client: @client ) end |
#db_security_groups(options = {}) ⇒ DBSecurityGroup::Collection
2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2822 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
2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2955 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
2976 2977 2978 2979 2980 2981 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 2976 def db_subnet_group(name) DBSubnetGroup.new( name: name, client: @client ) end |
#db_subnet_groups(options = {}) ⇒ DBSubnetGroup::Collection
3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3000 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
3020 3021 3022 3023 3024 3025 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3020 def event_category_map(source_type) EventCategoryMap.new( source_type: source_type, client: @client ) end |
#event_category_maps(options = {}) ⇒ EventCategoryMap::Collection
3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3049 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
3067 3068 3069 3070 3071 3072 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3067 def event_subscription(name) EventSubscription.new( name: name, client: @client ) end |
#event_subscriptions(options = {}) ⇒ EventSubscription::Collection
3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3092 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
3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3191 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
3212 3213 3214 3215 3216 3217 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3212 def option_group(name) OptionGroup.new( name: name, client: @client ) end |
#option_groups(options = {}) ⇒ OptionGroup::Collection
3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3270 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
3291 3292 3293 3294 3295 3296 3297 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3291 def pending_maintenance_action(target_arn, name) PendingMaintenanceAction.new( target_arn: target_arn, name: name, client: @client ) end |
#reserved_db_instance(id) ⇒ ReservedDBInstance
3301 3302 3303 3304 3305 3306 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3301 def reserved_db_instance(id) ReservedDBInstance.new( id: id, client: @client ) end |
#reserved_db_instances(options = {}) ⇒ ReservedDBInstance::Collection
3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3365 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
3385 3386 3387 3388 3389 3390 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3385 def reserved_db_instances_offering(id) ReservedDBInstancesOffering.new( id: id, client: @client ) end |
#reserved_db_instances_offerings(options = {}) ⇒ ReservedDBInstancesOffering::Collection
3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3442 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
3462 3463 3464 3465 3466 3467 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3462 def resource_with_pending_maintenance_actions(arn) ResourcePendingMaintenanceActionList.new( arn: arn, client: @client ) end |
#resources_with_pending_maintenance_actions(options = {}) ⇒ ResourcePendingMaintenanceActionList::Collection
3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 |
# File 'gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb', line 3497 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 |