Skip to content

Commit

Permalink
Added SAP Systems and Databases list operations to controller
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonkopliku committed May 13, 2022
1 parent 9885d68 commit 60fbbd9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/trento_web/controllers/sap_system_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ defmodule TrentoWeb.SapSystemController do

alias Trento.Support.StructHelper

use OpenApiSpex.ControllerSpecs

tags ["Landscape"]

operation :list,
summary: "List SAP Systems",
description: "List all the discovered SAP Systems on the target infrastructure",
responses: [
ok:
{"A collection of the discovered SAP Systems", "application/json",
TrentoWeb.OpenApi.Schema.SAPSystem.SAPSystemsCollection}
]

## TODO Fix sanitization
def list(conn, _) do
sap_systems =
Expand All @@ -15,6 +28,15 @@ defmodule TrentoWeb.SapSystemController do
json(conn, sap_systems)
end

operation :list_databases,
summary: "List HANA Databases",
description: "List all the discovered HANA Databases on the target infrastructure",
responses: [
ok:
{"A collection of the discovered HANA Databases", "application/json",
TrentoWeb.OpenApi.Schema.Database.DatabasesCollection}
]

def list_databases(conn, _) do
databases =
SapSystems.get_all_databases()
Expand Down

0 comments on commit 60fbbd9

Please sign in to comment.