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

Metadata API endpoint to display server information #507

Merged
merged 7 commits into from
Dec 30, 2024

Conversation

abhikdps
Copy link
Contributor

@abhikdps abhikdps commented Dec 26, 2024

Description

  • Adds a new API endpoint /metadata which returns server information such as the available tools with their versionsas well as all the available API endpoints.
  • Introduces some CI changes to ensure that the devspaces and ee images are not pushed to the container registry from a pull request as well as the tox/publish-ee check is skipped during a pull request (since the image was not pushed).

API endpoint /metadata Response

{
  "versions": {
    "ansible-builder": "3.1.0",
    "ansible-core": "2.18.0",
    "ansible-creator": "24.12.1.dev5",
    "ansible-dev-environment": "24.9.0",
    "ansible-dev-tools": "0.1.dev367",
    "ansible-lint": "24.10.0",
    "ansible-navigator": "24.10.0",
    "ansible-sign": "0.1.1",
    "molecule": "24.9.0",
    "pytest-ansible": "24.9.0",
    "tox-ansible": "24.10.0"
  },
  "apis": {
    "metadata": [
      "/metadata"
    ],
    "v1": [
      "/v1/creator/playbook",
      "/v1/creator/collection"
    ],
    "v2": [
      "/v2/creator/playbook",
      "/v2/creator/collection"
    ]
  }
}

Test

To test this API endpoint, first start the adt server:

(py312) ➜  ~ adt server
[2024-12-26 16:10:10 +0530] [99123] [INFO] Starting gunicorn 23.0.0
[2024-12-26 16:10:10 +0530] [99123] [INFO] Listening at: http://0.0.0.0:8000 (99123)
[2024-12-26 16:10:10 +0530] [99123] [INFO] Using worker: sync
[2024-12-26 16:10:10 +0530] [99173] [INFO] Booting worker with pid: 99173

Then do a curl with the GET method to get the expected response:

(py312) ➜  ~ curl -X GET --header "Content-Type: application/json" "localhost:8000/metadata"

Related JIRA: AAP-37853

@abhikdps abhikdps requested a review from audgirka December 26, 2024 10:44
@abhikdps abhikdps self-assigned this Dec 26, 2024
@abhikdps abhikdps requested a review from a team as a code owner December 26, 2024 10:44
@abhikdps abhikdps added the enhancement New feature or request label Dec 26, 2024
@abhikdps abhikdps marked this pull request as draft December 26, 2024 11:08
@abhikdps abhikdps requested a review from ssbarnea December 29, 2024 09:34
@abhikdps abhikdps marked this pull request as ready for review December 29, 2024 09:34
@abhikdps abhikdps requested a review from ssbarnea December 30, 2024 08:59
@ssbarnea ssbarnea enabled auto-merge (squash) December 30, 2024 09:02
@ssbarnea ssbarnea merged commit 5f0f220 into ansible:main Dec 30, 2024
28 checks passed
@abhikdps abhikdps deleted the tools_version_ep branch December 30, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants