Skip to content

feat: connection over rest#5015

Draft
mayankansys wants to merge 101 commits into
mainfrom
feat/connection_over_rest
Draft

feat: connection over rest#5015
mayankansys wants to merge 101 commits into
mainfrom
feat/connection_over_rest

Conversation

@mayankansys
Copy link
Copy Markdown
Collaborator

@mayankansys mayankansys commented Mar 26, 2026

Context

PyFluent currently supports a gRPC transport. This PR adds a parallel REST(HTTP/HTTPS) transport layer to exercise the same settings API over HTTP/HTTPS against the SimBA web server, keeping the settings tree transport-agnostic.

This PR covers Step 1 and Step 2 of Issue #4959:

  • Step 1 — Introduce a working REST client that can read/write settings and invoke command/query endpoints.
  • Step 2 — Provide a launcher/session so the existing settings tree can run over REST without changing the settings tree implementation.

Change Summary

  • Added a REST client that builds requests, hashes auth tokens into the Authorization header, parses errors, and supports retry on transient failures for safe methods.
  • Added a lightweight REST launcher + connection path.
  • Added integration tests (real-server) and mocked/unit tests to validate request construction and error handling in CI.

Rationale

Keep REST support isolated, simple, and low risk:

  • no changes to the settings tree core logic,
  • REST and gRPC can coexist,
  • CI can catch regressions without requiring a live server.

Impact

What changes for users

  • New public APIs to launch/connect via REST (HTTP/HTTPS).
  • Settings reads/writes and command execution can be performed over HTTP/HTTPS.

What does NOT change

  • The settings tree core remains unchanged.
  • Existing gRPC launch/session APIs remain unchanged.

Limitations (out of scope)

  • Some server behaviors (shutdown timing, confirmation prompts) are server-driven and may vary by version/config.

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Apr 2, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@github-actions github-actions Bot added maintenance General maintenance of the repo (libraries, cicd, etc) dependencies Related to dependencies labels Apr 27, 2026
Copilot AI review requested due to automatic review settings June 1, 2026 05:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 13 comments.

Comments suppressed due to low confidence (2)

pyproject.toml:26

  • cryptography is added as a runtime dependency, but there are no imports/uses of it in the code introduced in this PR. Keeping unused hard dependencies increases install size and dependency surface area unnecessarily.
    "defusedxml>=0.7.1",

pyproject.toml:26

  • cryptography is added as a runtime dependency, but there are no imports/uses of it in the code introduced in this PR. Keeping unused hard dependencies increases install size and dependency surface area unnecessarily.
    "defusedxml>=0.7.1",

Comment thread src/ansys/fluent/core/rest/client.py
Comment thread src/ansys/fluent/core/rest/__init__.py Outdated
Comment thread src/ansys/fluent/core/rest/rest_launcher.py Outdated
Comment thread src/ansys/fluent/core/rest/rest_launcher.py
Comment thread src/ansys/fluent/core/rest/rest_launcher.py Outdated
Comment thread src/ansys/fluent/core/rest/rest_launcher.py Outdated
Comment thread src/ansys/fluent/core/rest/rest_launcher.py
Comment thread src/ansys/fluent/core/rest/rest_launcher.py Outdated
Comment thread tests/conftest.py Outdated
Comment thread doc/changelog.d/5015.added.md
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 1, 2026 06:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.

Comment thread src/ansys/fluent/core/rest/tls.py Outdated
Comment thread tests/test_rest.py
Comment thread src/ansys/fluent/core/rest/rest_launcher.py Outdated
Comment thread src/ansys/fluent/core/rest/rest_launcher.py
Comment thread src/ansys/fluent/core/rest/rest_launcher.py Outdated
Comment thread src/ansys/fluent/core/rest/__init__.py Outdated
Comment thread src/ansys/fluent/core/rest/tls.py Outdated
Comment thread src/ansys/fluent/core/rest/tls.py
Comment thread tests/conftest.py Outdated
Comment thread src/ansys/fluent/core/rest/client.py
Copilot AI review requested due to automatic review settings June 2, 2026 10:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Comment thread src/ansys/fluent/core/rest/client.py Outdated
Comment thread src/ansys/fluent/core/rest/__init__.py Outdated
Comment thread tests/test_rest.py Outdated
Comment thread doc/changelog.d/5015.added.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Related to dependencies maintenance General maintenance of the repo (libraries, cicd, etc) new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Demonstrate that PyFluent can run transparently over REST or gRPC for solver settings

6 participants