IBM Spectrum Virtualize REST API Python Client
Overview
This repo contains a Python SDK for interacting with the IBM Storage Virtualize REST API.
Install
- Ensure Python 3.9+
- Install dependencies (if any) using pip:
pip install -r requirements.txt
- Install SDK using pip:
pip install ibm-svc-rest-client
or Manual Installation:
git clone https://github.com/IBM/IBMStorageVirtualizeRestAPI.git
cd IBMStorageVirtualizeRestAPI
pip install .
Usage
Detailed usage examples (copy into your application code). Adjust model types and fields to your generated SDK version. These examples are intentionally verbose to show common patterns.
from openapi_client.api.storage_virtualize_api import StorageVirtualizeAPI
from openapi_client.rest import ApiException
from pprint import pprint
import sys
# Instantiate (constructor already fetches an access token and sets config.access_token)
try:
svc = StorageVirtualizeAPI("10.0.0.1", "admin", "password")
print("Successfully authenticated and instantiated StorageVirtualizeAPI client.")
try:
lsarray_result = svc.svc_info_api.lsarray_post(x_auth_token=None, lsarray_post_request=None)
# Inspect returned model (lsarray_result) for command output / status.
pprint(lsarray_result)
except ApiException as ex:
# ApiException contains status code, response headers and response content in many SDKs.
print(f"API error: {ex.reason} (status {ex.status})", file=sys.stderr)
except ApiException as ex:
print(f"API error: {ex.reason} (status {ex.status})", file=sys.stderr)
Documentation
For detailed documentation, refer https://github.com/IBM/IBMStorageVirtualizeRestAPI/blob/main/IBM_REST_SDK_USAGE_GUIDE.md
Configuration
base_url: API endpointapi_key: authentication token- other settings are usually in
StorageVirtualizeAPIconstructor or config file
Notes
- Check the wrapper methods in
storage_virtualize_api.pyfor available API calls. - Handle errors/exceptions as needed.
Best practices
- Reuse HTTP client and session instead of creating many instances in production. The generated constructors that accept configuration make that possible; this utility currently uses the default client per API.
- Protect credentials: do not hard-code plaintext passwords in real apps; use secure storage or environment variables.
- Use context managers (with statements) for API classes when finished to release resources if they support it.
- Check ApiResponse.status_code / ApiException to inspect error details.
These examples are commentary only and intentionally placed here as reference. Move them into your application codebase (for example a small helper class or integration tests) and adapt to your models and runtime requirements.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ibm_svc_rest_client-1.0.0.tar.gz.
File metadata
- Download URL: ibm_svc_rest_client-1.0.0.tar.gz
- Upload date:
- Size: 316.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21d69e2fc93ab4cd4cbc5693b2de4ec84a0d9555a1e738dfd01d55209265973f
|
|
| MD5 |
8fab71d92602baace1c52223dfb75651
|
|
| BLAKE2b-256 |
ef7e969281273e398bd79733d89799a7dce7a6521cbbb18b5f85be1818b7efa0
|
File details
Details for the file ibm_svc_rest_client-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ibm_svc_rest_client-1.0.0-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fd00e9ddc6fd210bd209ab877d49ebf7cca985ed88a5af13a84ce667c089530
|
|
| MD5 |
e25ce0b88761074fe10fcb6fb2bf2fd4
|
|
| BLAKE2b-256 |
3f472e6d7b1c03b52137a1f142bdd0adf19699307a29b41e998454e125f5e552
|