Skip to content

Commit

Permalink
Merge pull request #332 from abellotti/support_containers
Browse files Browse the repository at this point in the history
Adding support for /api/containers primary collection.
  • Loading branch information
Jillian Tullo committed Mar 2, 2018
2 parents 1b92348 + a993ae1 commit 43def71
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/api/containers_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Api
class ContainersController < BaseController
end
end
18 changes: 18 additions & 0 deletions config/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,24 @@
:get:
- :name: read
:identifier: persistent_volume_show
:containers:
:description: Containers
:identifier: container
:options:
- :collection
:verbs: *gp
:klass: Container
:collection_actions:
:get:
- :name: read
:identifier: container_show_list
:post:
- :name: query
:identifier: container_show_list
:resource_actions:
:get:
- :name: read
:identifier: container_show
:currencies:
:description: Currencies
:identifier: currency
Expand Down
10 changes: 10 additions & 0 deletions spec/requests/collections_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ def test_collection_bulk_query(collection, collection_url, klass, id = nil)
test_collection_query(:chargebacks, api_chargebacks_url, ChargebackRate)
end

it "query Containers" do
FactoryGirl.create(:container)
test_collection_query(:containers, api_containers_url, Container)
end

it "query ContainerGroups" do
FactoryGirl.create(:container_group)
test_collection_query(:container_groups, api_container_groups_url, ContainerGroup)
Expand Down Expand Up @@ -663,6 +668,11 @@ def test_collection_bulk_query(collection, collection_url, klass, id = nil)
test_collection_bulk_query(:cloud_volumes, api_cloud_volumes_url, CloudVolume)
end

it 'bulk query Container' do
FactoryGirl.create(:container)
test_collection_bulk_query(:containers, api_containers_url, Container)
end

it 'bulk query Firmwares' do
FactoryGirl.create(:firmware)
test_collection_bulk_query(:firmwares, api_firmwares_url, Firmware)
Expand Down

0 comments on commit 43def71

Please sign in to comment.