Skip to main content

IBM Spectrum Virtualize REST API Python Client

Overview

This repo contains a Python SDK for interacting with the IBM Storage Virtualize REST API.

Install

  1. Ensure Python 3.9+
  2. Install dependencies (if any) using pip:
pip install -r requirements.txt
  1. 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 endpoint
  • api_key: authentication token
  • other settings are usually in StorageVirtualizeAPI constructor or config file

Notes

  • Check the wrapper methods in storage_virtualize_api.py for 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

ibm_svc_rest_client-1.0.0.tar.gz (316.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ibm_svc_rest_client-1.0.0-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

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

Hashes for ibm_svc_rest_client-1.0.0.tar.gz
Algorithm Hash digest
SHA256 21d69e2fc93ab4cd4cbc5693b2de4ec84a0d9555a1e738dfd01d55209265973f
MD5 8fab71d92602baace1c52223dfb75651
BLAKE2b-256 ef7e969281273e398bd79733d89799a7dce7a6521cbbb18b5f85be1818b7efa0

See more details on using hashes here.

File details

Details for the file ibm_svc_rest_client-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ibm_svc_rest_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9fd00e9ddc6fd210bd209ab877d49ebf7cca985ed88a5af13a84ce667c089530
MD5 e25ce0b88761074fe10fcb6fb2bf2fd4
BLAKE2b-256 3f472e6d7b1c03b52137a1f142bdd0adf19699307a29b41e998454e125f5e552

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page