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

HTTP Endpoint to return Integration Summary (Dashboard) #48994

Merged
merged 4 commits into from
Nov 26, 2024

Conversation

marcoandredinis
Copy link
Contributor

@marcoandredinis marcoandredinis commented Nov 14, 2024

This PR adds a new endpoint which returns the summary of an integration:

  • EC2, RDS and EKS found and enrolled resources

It will be used to let the user know about what's the current state of
the integration.

PS: the number of deployed ECS agents is not yet filled, but will be as
soon as the other PR lands.

Demo:
curl 'https://proxy.example.com/v1/webapi/sites/proxy.example.com/integrations/teleportdev/stats' --silent ... | jq

{
  "name": "teleportdev",
  "subKind": "aws-oidc",
  "awsoidc": {
    "roleArn": "arn:aws:iam::278576220453:role/MarcoLocalClusterIntegration"
  },
  "awsec2": {
    "rulesCount": 1,
    "resourcesFound": 15,
    "resourcesEnrollmentFailed": 2,
    "resourcesEnrollmentSuccess": 13,
    "discoverLastSync": "2024-11-25T12:11:08.879068Z"
  },
  "awsrds": {
    "rulesCount": 1,
    "resourcesFound": 2,
    "resourcesEnrollmentSuccess": 2,
    "discoverLastSync": "2024-11-25T12:11:08.306076Z"
  },
  "awseks": {
    "rulesCount": 1,
    "resourcesFound": 3,
    "resourcesEnrollmentFailed": 2,
    "discoverLastSync": "2024-11-25T12:11:42.83482Z"
  }
}

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-48994.d3pp5qlev8mo18.amplifyapp.com

@marcoandredinis marcoandredinis force-pushed the marco/endpoint_integration-dashboard branch 4 times, most recently from ea1dd29 to 05c6bc5 Compare November 25, 2024 12:28
@marcoandredinis marcoandredinis marked this pull request as ready for review November 25, 2024 12:30
@ryanclark
Copy link
Contributor

ryanclark commented Nov 26, 2024

Should the URL be /webapi/sites/:site/integrationdashboard/:name? I feel something like /webapi/sites/:site/integrations/:name/stats may be better, considering we have /webapi/sites/:site/integrations/:name already (and the endpoint is returning stats not a dashboard)

@marcoandredinis
Copy link
Contributor Author

Should the URL be /webapi/sites/:site/integrationdashboard/:name? I feel something like /webapi/sites/:site/integrations/:name/stats may be better, considering we have /webapi/sites/:site/integrations/:name already (and the endpoint is returning stats not a dashboard)

Changed to /webapi/sites/:site/integrations/:name/stats
Thank you

@marcoandredinis marcoandredinis force-pushed the marco/endpoint_integration-dashboard branch from 05c6bc5 to e70652f Compare November 26, 2024 11:32
lib/web/integrations.go Show resolved Hide resolved
lib/web/integrations.go Outdated Show resolved Hide resolved
@marcoandredinis marcoandredinis force-pushed the marco/endpoint_integration-dashboard branch from e70652f to 647776e Compare November 26, 2024 14:37
lib/web/integrations.go Outdated Show resolved Hide resolved
This PR adds a new endpoint which returns the summary of an integration:
- EC2, RDS and EKS found and enrolled resources

It will be used to let the user know about what's the current state of
the integration.

PS: the number of deployed ECS agents is not yet filled, but will be as
soon as the other PR lands.
@marcoandredinis marcoandredinis force-pushed the marco/endpoint_integration-dashboard branch from 647776e to 1b0025e Compare November 26, 2024 17:17
@marcoandredinis marcoandredinis added this pull request to the merge queue Nov 26, 2024
Merged via the queue into master with commit c574225 Nov 26, 2024
41 checks passed
@marcoandredinis marcoandredinis deleted the marco/endpoint_integration-dashboard branch November 26, 2024 18:27
@public-teleport-github-review-bot

@marcoandredinis See the table below for backport results.

Branch Result
branch/v16 Failed
branch/v17 Create PR

marcoandredinis added a commit that referenced this pull request Nov 27, 2024
* AWS OIDC Dashboard: Auto Discovery summary endpoint

This PR adds a new endpoint which returns the summary of an integration:
- EC2, RDS and EKS found and enrolled resources

It will be used to let the user know about what's the current state of
the integration.

PS: the number of deployed ECS agents is not yet filled, but will be as
soon as the other PR lands.

* fix integration stats path

* improve comment on rule counter

* deduplicate code/
github-merge-queue bot pushed a commit that referenced this pull request Nov 27, 2024
)

* AWS OIDC Dashboard: Auto Discovery summary endpoint

This PR adds a new endpoint which returns the summary of an integration:
- EC2, RDS and EKS found and enrolled resources

It will be used to let the user know about what's the current state of
the integration.

PS: the number of deployed ECS agents is not yet filled, but will be as
soon as the other PR lands.

* fix integration stats path

* improve comment on rule counter

* deduplicate code/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/branch/v16 backport/branch/v17 no-changelog Indicates that a PR does not require a changelog entry size/md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants