Sha256: 3fa668c303184a61e73fd591a0ae64c17212585dda0624a3d1f18d69b63e7e57

Contents?: true

Size: 1.44 KB

Versions: 15

Compression:

Stored size: 1.44 KB

Contents

class Ey::Core::Client
  class Real
    def get_logical_databases(params={})
      query = Ey::Core.paging_parameters(params)
      url = params.delete("url")

      request(
        :params => params,
        :query  => query,
        :path   => "/logical-databases",
        :url    => url,
      )
    end
  end

  class Mock
    def get_logical_databases(_params={})
      params = Cistern::Hash.stringify_keys(_params)

      extract_url_params!(params)

      params["service"] = params.delete("database_service") if params["database_service"]

      resources = if environment_id = resource_identity(params.delete("environment") || params.delete("environment_id"))
                    self.data[:connectors].
                      select { |_,c| c["_environment"] == url_for("/environments/#{environment_id}") }.
                      select { |_,c| c["source"].match("logical-databases") }.
                      inject({}) { |r, (_, connector)|
                        source_id = resource_identity(connector["source"])
                        r.merge(source_id => self.find(:logical_databases, source_id))
                      }
                  end

      headers, logical_databases_page = search_and_page(params, :logical_databases, resources: resources, search_keys: %w[name username service ])

      response(
        :body    => {"logical_databases" => logical_databases_page},
        :status  => 200,
        :headers => headers
      )
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ey-pro-cli-0.0.17 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.16 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.15 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.14 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.13 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.12 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.11 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.10 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.9 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.8 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.7 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.6 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.5 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.4 lib/vendor/core/ey-core/requests/get_logical_databases.rb
ey-pro-cli-0.0.3 lib/vendor/core/ey-core/requests/get_logical_databases.rb