Add option to override API endpoint

Provide an option to override API endpoint to address multiple
manila deployments on same cloud. Usage as following:
"openstack --os-endpoint-override <endpoint_url> share list"

Closes-bug: #2111331
Co-authored-by: Chuan Miao <chuan.miao@sap.com>
Change-Id: I5e11256473ab88b08e7374fd68f58a0257adab1f
Signed-off-by: Kiran Pawar <kinpaa@gmail.com>
This commit is contained in:
Kiran Pawar
2025-05-20 13:14:50 +00:00
parent 2bf13b1425
commit 0953eff609
3 changed files with 26 additions and 0 deletions

View File

@@ -31,6 +31,13 @@ environment variables::
export OS_AUTH_URL=http://...
export OS_SHARE_API_VERSION=2.51
It is possible to use different Manila endpoint while using Openstack
Client. In this case, you can use configuration option
``--os-endpoint-override`` or set the corresponding environment
variable::
export OS_ENDPOINT_OVERRIDE=http://...
Getting help
============

View File

@@ -113,4 +113,17 @@ def build_option_parser(parser):
'version supported by both the client and the server). '
'(Env: OS_SHARE_API_VERSION)',
)
parser.add_argument(
"--os-endpoint-override",
metavar="<endpoint-override>",
default=utils.env(
"OS_ENDPOINT_OVERRIDE",
"OS_MANILA_BYPASS_URL",
"MANILACLIENT_BYPASS_URL",
),
help=(
"Use this API endpoint instead of the Service Catalog. "
"Defaults to env[OS_ENDPOINT_OVERRIDE]."
),
)
return parser

View File

@@ -0,0 +1,6 @@
---
features:
- Manilaclient is updated to consider API endpoint override option
`--os-endpoint-override`. For example, "openstack share list" command
for different API endpoint will be "openstack --os-endpoint-override
<endpoint_url> share list".