Skip to content

For discussion only: Extracting _VisorClient from CLI for use in user-facing Python client - #214

Closed
LKasianAnsys wants to merge 10 commits into
mainfrom
junk/visor-client-working-branch
Closed

LKasianAnsys wants to merge 10 commits into
mainfrom
junk/visor-client-working-branch

Conversation

@LKasianAnsys

@LKasianAnsys LKasianAnsys commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Addresses #163

Context

We currently have VisorSafClient defined in the SAF repository, which exposes VISOR endpoints to SAF users. It would be ideal to have a Python client defined in the VISOR repo instead (e.g. see comment).

In the VISOR repo we have a CLI tool which wraps most of the VISOR service endpoints. However, the needs of the VISOR CLI tool are different from what we would want to expose to SAF users in a client that would replace the existing VisorSafClient (e.g. the client in the CLI tool prints the response outputs to stdout rather than returning them; also, it defines its own defaults that are passed as required args in the requests).

More generally, it matters because the VisorSafClient is used in production by SAF users, but the CLI tool was designed primarily as a developer tool. Decoupling those two use cases makes sure that changes in the CLI tool don't break VISOR usage in production.

Summary

This is a proof of concept of a refactor we could make to extract Python client logic from the Visor CLI into a private _VisorClient class, which can be used for each of the two separate cases: the CLI client, and the SAF client. In this branch, the CLI is updated to use the new _VisorClient (in a VisorCliClient). The VisorSafClient could be added as a second user of that private shared class (e.g. here).

@LKasianAnsys

Copy link
Copy Markdown
Collaborator Author

Closing as this was shared as a POC for discussion only. For when #163 is picked up.

@LKasianAnsys
LKasianAnsys deleted the junk/visor-client-working-branch branch November 9, 2026 16:57
Comment thread src/ansys/visor/viewer/cli/apis.py Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant