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
2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 |
# File 'lib/aws-sdk-rds/resource.rb', line 2796 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
2816 2817 2818 2819 2820 2821 |
# File 'lib/aws-sdk-rds/resource.rb', line 2816 def certificate(id) Certificate.new( id: id, client: @client ) end |
#certificates(options = {}) ⇒ Certificate::Collection
2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 |
# File 'lib/aws-sdk-rds/resource.rb', line 2848 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
978 979 980 981 982 983 984 985 986 987 |
# File 'lib/aws-sdk-rds/resource.rb', line 978 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
1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 |
# File 'lib/aws-sdk-rds/resource.rb', line 1069 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
2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 |
# File 'lib/aws-sdk-rds/resource.rb', line 2403 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
2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 |
# File 'lib/aws-sdk-rds/resource.rb', line 2498 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
2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 |
# File 'lib/aws-sdk-rds/resource.rb', line 2542 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
2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 |
# File 'lib/aws-sdk-rds/resource.rb', line 2588 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
2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 |
# File 'lib/aws-sdk-rds/resource.rb', line 2702 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
2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 |
# File 'lib/aws-sdk-rds/resource.rb', line 2778 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
2870 2871 2872 2873 2874 2875 |
# File 'lib/aws-sdk-rds/resource.rb', line 2870 def db_cluster(id) DBCluster.new( id: id, client: @client ) end |
#db_cluster_parameter_group(name) ⇒ DBClusterParameterGroup
2879 2880 2881 2882 2883 2884 |
# File 'lib/aws-sdk-rds/resource.rb', line 2879 def db_cluster_parameter_group(name) DBClusterParameterGroup.new( name: name, client: @client ) end |
#db_cluster_parameter_groups(options = {}) ⇒ DBClusterParameterGroup::Collection
2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 |
# File 'lib/aws-sdk-rds/resource.rb', line 2911 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
2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 |
# File 'lib/aws-sdk-rds/resource.rb', line 2982 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
3004 3005 3006 3007 3008 3009 |
# File 'lib/aws-sdk-rds/resource.rb', line 3004 def db_engine(name) DBEngine.new( name: name, client: @client ) end |
#db_engine_version(engine_name, version) ⇒ DBEngineVersion
3014 3015 3016 3017 3018 3019 3020 |
# File 'lib/aws-sdk-rds/resource.rb', line 3014 def db_engine_version(engine_name, version) DBEngineVersion.new( engine_name: engine_name, version: version, client: @client ) end |
#db_engine_versions(options = {}) ⇒ DBEngineVersion::Collection
3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 |
# File 'lib/aws-sdk-rds/resource.rb', line 3158 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
3181 3182 3183 3184 3185 3186 |
# File 'lib/aws-sdk-rds/resource.rb', line 3181 def db_instance(id) DBInstance.new( id: id, client: @client ) end |
#db_instances(options = {}) ⇒ DBInstance::Collection
3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 |
# File 'lib/aws-sdk-rds/resource.rb', line 3236 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
3258 3259 3260 3261 3262 3263 |
# File 'lib/aws-sdk-rds/resource.rb', line 3258 def db_parameter_group(name) DBParameterGroup.new( name: name, client: @client ) end |
#db_parameter_group_family(name) ⇒ DBParameterGroupFamily
3267 3268 3269 3270 3271 3272 |
# File 'lib/aws-sdk-rds/resource.rb', line 3267 def db_parameter_group_family(name) DBParameterGroupFamily.new( name: name, client: @client ) end |
#db_parameter_groups(options = {}) ⇒ DBParameterGroup::Collection
3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 |
# File 'lib/aws-sdk-rds/resource.rb', line 3298 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
3320 3321 3322 3323 3324 3325 |
# File 'lib/aws-sdk-rds/resource.rb', line 3320 def db_security_group(name) DBSecurityGroup.new( name: name, client: @client ) end |
#db_security_groups(options = {}) ⇒ DBSecurityGroup::Collection
3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 |
# File 'lib/aws-sdk-rds/resource.rb', line 3344 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
3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 |
# File 'lib/aws-sdk-rds/resource.rb', line 3477 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
3500 3501 3502 3503 3504 3505 |
# File 'lib/aws-sdk-rds/resource.rb', line 3500 def db_subnet_group(name) DBSubnetGroup.new( name: name, client: @client ) end |
#db_subnet_groups(options = {}) ⇒ DBSubnetGroup::Collection
3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 |
# File 'lib/aws-sdk-rds/resource.rb', line 3524 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
3546 3547 3548 3549 3550 3551 |
# File 'lib/aws-sdk-rds/resource.rb', line 3546 def event_category_map(source_type) EventCategoryMap.new( source_type: source_type, client: @client ) end |
#event_category_maps(options = {}) ⇒ EventCategoryMap::Collection
3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 |
# File 'lib/aws-sdk-rds/resource.rb', line 3575 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
3595 3596 3597 3598 3599 3600 |
# File 'lib/aws-sdk-rds/resource.rb', line 3595 def event_subscription(name) EventSubscription.new( name: name, client: @client ) end |
#event_subscriptions(options = {}) ⇒ EventSubscription::Collection
3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 |
# File 'lib/aws-sdk-rds/resource.rb', line 3620 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
3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 |
# File 'lib/aws-sdk-rds/resource.rb', line 3721 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
3744 3745 3746 3747 3748 3749 |
# File 'lib/aws-sdk-rds/resource.rb', line 3744 def option_group(name) OptionGroup.new( name: name, client: @client ) end |
#option_groups(options = {}) ⇒ OptionGroup::Collection
3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 |
# File 'lib/aws-sdk-rds/resource.rb', line 3806 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
3829 3830 3831 3832 3833 3834 3835 |
# File 'lib/aws-sdk-rds/resource.rb', line 3829 def pending_maintenance_action(target_arn, name) PendingMaintenanceAction.new( target_arn: target_arn, name: name, client: @client ) end |
#reserved_db_instance(id) ⇒ ReservedDBInstance
3839 3840 3841 3842 3843 3844 |
# File 'lib/aws-sdk-rds/resource.rb', line 3839 def reserved_db_instance(id) ReservedDBInstance.new( id: id, client: @client ) end |
#reserved_db_instances(options = {}) ⇒ ReservedDBInstance::Collection
3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 |
# File 'lib/aws-sdk-rds/resource.rb', line 3903 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
3925 3926 3927 3928 3929 3930 |
# File 'lib/aws-sdk-rds/resource.rb', line 3925 def reserved_db_instances_offering(id) ReservedDBInstancesOffering.new( id: id, client: @client ) end |
#reserved_db_instances_offerings(options = {}) ⇒ ReservedDBInstancesOffering::Collection
3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 |
# File 'lib/aws-sdk-rds/resource.rb', line 3982 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
4004 4005 4006 4007 4008 4009 |
# File 'lib/aws-sdk-rds/resource.rb', line 4004 def resource_with_pending_maintenance_actions(arn) ResourcePendingMaintenanceActionList.new( arn: arn, client: @client ) end |
#resources_with_pending_maintenance_actions(options = {}) ⇒ ResourcePendingMaintenanceActionList::Collection
4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 |
# File 'lib/aws-sdk-rds/resource.rb', line 4039 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 |