Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checks catalog openapi #536

Merged
merged 5 commits into from May 17, 2022
Merged

Checks catalog openapi #536

merged 5 commits into from May 17, 2022

Conversation

nelsonkopliku
Copy link
Member

@nelsonkopliku nelsonkopliku commented May 16, 2022

Added Checks Catalog OpenApi documentation.

vokoscreenNG-2022-05-16_18-28-34.mp4

The flat option fits a bit strangely in the open api spec.
It might be worth considering making that more standard and actually making it a boolean.

  • GET /api/hosts
  • GET /api/clusters
  • GET /api/sap_systems
  • GET /api/databases
  • GET /api/checks/catalog
  • POST /api/clusters/:cluster_id/checks
  • POST /api/clusters/:cluster_id/checks/request_execution
  • POST /api/runner/callback

Follows up #512 #522 #528

@nelsonkopliku nelsonkopliku self-assigned this May 16, 2022
@nelsonkopliku nelsonkopliku added documentation Improvements or additions to documentation enhancement New feature or request labels May 16, 2022
Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!
I have noted some small issues to be corrected, together with other doubts.

lib/trento_web/openapi/schema/checks_catalog.ex Outdated Show resolved Hide resolved
type: :string,
description: "Check Group, available when requiring a Flat Catalog"
},
provider: Provider.SupportedProviders
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this SupportedProviders specified?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's defined in lib/trento_web/openapi/schema/provider.ex:7

defmodule SupportedProviders do
  @moduledoc false

  OpenApiSpex.schema(%{
    title: "SupportedProviders",
    type: :string,
    description: "Detected Provider where the resource is running",
    enum: [:azure, :aws, :gcp, :unknown]
  })
end

And now that I see it I think:

  • should we consider default part of that list?
  • is :unknown actually a SupportedProvider?

I believe we can iterate more on these details.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:unknown is not supported in the checks catalog. We have in the code as an incoming provider in hosts, as we will have hosts that are not running in our known providers, and they will have this value.
So, in this SupportedProviders I see it totally right.
default is not part of this list, as I don't see any provider option as default

lib/trento_web/openapi/schema/provider.ex Outdated Show resolved Hide resolved
@nelsonkopliku
Copy link
Member Author

@arbulu89 Thanks for the review! Another pair of eyes is always beneficial especially with this kind of work 😅

Addressed your comments here f3b1404 and here ed5b4de

Should be good enough for now.

Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready to merge from my side!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

None yet

2 participants