sangfor-scp: A Pythonic Client Library for the Sangfor Cloud Platform (SCP) API
  

Newbie221879 Lv1Posted Mar-06-2026 03:31

Hello Sangfor Community,

I’m excited to announce the release of sangfor-scp, an open-source Python client library designed to make interacting with the Sangfor Cloud Platform (SCP) REST API easier, cleaner, and much more Pythonic.

If you have ever worked with the SCP API, you might have experienced the complexities of handling AWS4-HMAC-SHA256 signatures, managing token lifecycles, or dealing with manual pagination quirks. This library abstracts all of that away so you can focus purely on automation and integration.

Key Features:

    Single Login & Session Reuse: Authenticate just once during initialization. The session is reused for all subsequent requests.

    Auto Token Refresh: 24-hour tokens are renewed transparently in the background.

    Automatic Pagination: No more manual page tracking. Methods like list_all() iterate through every page lazily.

    Async Task Support: A built-in tasks.wait() function polls tasks until completion, handling timeouts, failures, and even progress callbacks automatically.

    Dual Authentication: Supports both EC2 signature (recommended) and Token-based (RSA encrypted) authentication.

    Idempotency: Automatically handles X-Client-Token headers on POST/PUT requests to prevent duplicate executions.

Covered APIs (Highlights):

    Virtual Machines: List, get, create, delete, and power operations.

    Storage: Volume creation, attachment, detachment, and resizing.

    Networking: VPCs, Subnets, and Elastic IP allocation/binding.

    Platform Info: Resource pools (AZ), Tenants, Physical Hosts, and System details.

Quick Installation:
You can easily install the library via pip:

pip install sangfor-scp

Like this topic? Like it or reward the author.

Creating a topic earns you 5 coins. A featured or excellent topic earns you more coins. What is Coin?

Enter your mobile phone number and company name for better service. Go