File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 11module ThreeScale
22 module API
3+ MAX_BACKENDS_PER_PAGE = 500
4+ MAX_SERVICES_PER_PAGE = 500
5+
36 class Client
47 attr_reader :http_client
58
@@ -19,8 +22,8 @@ def show_service(id)
1922
2023 # @api public
2124 # @return [Array<Hash>]
22- def list_services
23- response = http_client . get ( '/admin/api/services' )
25+ def list_services ( params = nil )
26+ response = http_client . get ( '/admin/api/services' , params : params )
2427 extract ( collection : 'services' , entity : 'service' , from : response )
2528 end
2629
@@ -828,8 +831,8 @@ def show_provider
828831
829832 # @api public
830833 # @return [List]
831- def list_backends
832- response = http_client . get ( '/admin/api/backend_apis' )
834+ def list_backends ( params = nil )
835+ response = http_client . get ( '/admin/api/backend_apis' , params : params )
833836 extract ( collection : 'backend_apis' , entity : 'backend_api' , from : response )
834837 end
835838
Original file line number Diff line number Diff line change 1414
1515 context '#list_services' do
1616 it do
17- expect ( http_client ) . to receive ( :get ) . with ( '/admin/api/services' ) . and_return ( 'services' => [ ] )
17+ expect ( http_client ) . to receive ( :get ) . with ( '/admin/api/services' , params : nil ) . and_return ( 'services' => [ ] )
1818 expect ( client . list_services ) . to eq ( [ ] )
1919 end
2020 end
11241124 let ( :resp_body ) { { 'backend_apis' => backend_apis . map { |b | { 'backend_api' => b } } } }
11251125
11261126 it do
1127- expect ( http_client ) . to receive ( :get ) . with ( '/admin/api/backend_apis' ) . and_return ( resp_body )
1127+ expect ( http_client ) . to receive ( :get ) . with ( '/admin/api/backend_apis' , params : nil ) . and_return ( resp_body )
11281128 expect ( client . list_backends ) . to match_array ( backend_apis )
11291129 end
11301130 end
You can’t perform that action at this time.
0 commit comments