Module: Awspec::Helper::Finder::Apigateway
- Included in:
- Awspec::Helper::Finder
- Defined in:
- lib/awspec/helper/finder/apigateway.rb
Instance Method Summary collapse
- #find_api_resources_by_id(api_id) ⇒ Object
- #find_apigateway_by_id(id) ⇒ Object
- #find_apigateway_by_name(name) ⇒ Object
Instance Method Details
#find_api_resources_by_id(api_id) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/awspec/helper/finder/apigateway.rb', line 26 def find_api_resources_by_id(api_id) all_resources = [] apigateway_client.get_resources(rest_api_id: api_id, limit: 500, embed: ['methods']).each do |response| all_resources += response.items end all_resources != [] ? all_resources : nil end |
#find_apigateway_by_id(id) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/awspec/helper/finder/apigateway.rb', line 4 def find_apigateway_by_id(id) apis = [] apigateway_client.get_rest_apis(limit: 500).each do |response| apis += response.items end apis.each do |api| return api if api.id == id end nil end |
#find_apigateway_by_name(name) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/awspec/helper/finder/apigateway.rb', line 15 def find_apigateway_by_name(name) apis = [] apigateway_client.get_rest_apis(limit: 500).each do |response| apis += response.items end apis.each do |api| return api if api.name == name end nil end |