Python SDK for FlashSystem REST API

From release 9.1.3, IBM provides an official Python SDK for the FlashSystem REST API through GitHub. The SDK simplifies integration with FlashSystem storage systems by providing a Python interface built on the OpenAPI specification.

The Python SDK includes the following capabilities:
Automatic token generation
Provides a seamless authentication workflow and eliminates the need for manual token management.
Advanced error handling
  • HTTP 401 (Unauthorized): Automatic retry logic for authentication failures
  • HTTP 429 (Rate limiting): Intelligent throttling to help prevent API rate limit violations
OpenAPI 3.0.2 compliance
Ensures alignment with industry-standard API specifications.
REST API v1 support
Fully compatible with FlashSystem REST API version 1.
To download and implement the Python SDK:
  • Download the SDK from the IBM Public GitHub repository (documentation is included in the package).
  • Create a single instance of the StorageVirtualizeAPI client using system credentials.
  • Use SDK methods to invoke REST API command endpoints.
The following Python example demonstrates how to create a volume using the SDK:

# Create an instance of StorageVirtualizeAPI once and reuse for multiple API calls.
svc = StorageVirtualizeAPI("10.0.0.1", "admin", "password")
print("Successfully authenticated and instantiated StorageVirtualizeAPI client.")
# Call an SVCInfo/SVCTask API.
try:
    # Required parameters for mkvdisk CLI command
    vdisk = {'name': 'vdisk1', 'mdiskgrp': 'Pool0', 'size': 1}
    vdisk_response = svc.svc_task_api.mkvdisk_post(x_auth_token=None, mkvdisk_post_request=vdisk)

    # Inspect returned model (vdisk_response) for command output / status.
    vdisk_id = int(vdisk_response ['id'])
    print(f"\n Created vdisk with ID: {vdisk_id}\n")

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)