A Python SDK for interacting with the Cisco Security Cloud Control Platform Management APIs.
pip3 install cisco-scc-sdk
Or install from source:
pip3 install .Using a virtual environment (recommended):
python3 -m venv venv source venv/bin/activate && pip install -e .
from scc_sdk import Client # Initialize the client with your access token client = Client(access_token="your_bearer_token_here") # Work with organizations organizations = client.organizations.list() org = client.organizations.get(org_id="550e8400-e29b-41d4-a716-446655440000") new_org = client.organizations.create(name="New Org", region_code="NAM") # Work with subscriptions subscriptions = client.subscriptions.list(org_id="org-uuid") subscription = client.subscriptions.get(org_id="org-uuid", subscription_id="sub-uuid") # Work with groups groups = client.groups.list(org_id="org-uuid") group = client.groups.get(org_id="org-uuid", group_id="group-uuid")
with statement for automatic cleanupThe SDK uses a configurable base URL. By default, it points to https://api.security.cisco.com/v1.
To use a different URL:
client = Client( access_token="your_token", base_url="https://api.security.cisco.com", base_path="v1" )
We've created a workshop template designed for hands-on learning of the Cisco SCC SDK. This template is perfect for:
Workshop File: examples/workshop_template.py
The template includes:
Workshop Exercises:
client.organizations.get()To complete the workshop:
examples/workshop_template.pyTODO: comments and implement the missing codeFor a fully implemented reference, see examples/setup_org_flow.py.
To run the complete example:
Get your API Access Token: Generate an API key access token from the Security Cloud Control console
Create or identify your Organization: Note the Organization ID you want to configure
Update the configuration in setup_org_flow.py:
ACCESS_TOKEN to your API key access tokenORG_ID to your organization IDUSERS_TO_INVITE with the users you want to inviteCLAIM_CODE with your subscription claim codeRun the script:
python3 examples/setup_org_flow.py
This example demonstrates a complete workflow including:
The Organizations resource provides methods to manage Security Cloud Control organizations.
list()List organizations with optional filtering and pagination.
Method Signature:
client.organizations.list( name: Optional[str] = None, type: Optional[str] = None, region_code: Optional[str] = None, country_code: Optional[str] = None, manager_org_id: Optional[str] = None, max: int = 100, cursor: Optional[str] = None, sort_by: Optional[str] = None, order: Optional[str] = None ) -> Dict[str, Any]
Parameters:
name (str, optional): Filter by organization name (partial match)type (str, optional): Filter by organization type (STANDALONE, MANAGER, MANAGED)region_code (str, optional): Filter by region code (NAM, EMEA, APJC, GLOBAL)country_code (str, optional): Filter by country codemanager_org_id (str, optional): Filter by manager organization IDmax (int, optional): Maximum number of items to return (default: 100, max: 500)cursor (str, optional): Cursor for paginationsort_by (str, optional): Field to sort by (e.g., "name")order (str, optional): Sort order (ASC or DESC)Returns: Dictionary containing list of organizations and pagination info
Example:
# List all organizations orgs = client.organizations.list() # List with filtering and pagination orgs = client.organizations.list( name="Acme", type="STANDALONE", region_code="NAM", max=50, sort_by="name", order="ASC" )
Common Use Cases:
get(org_id)Get a specific organization by ID.
Method Signature:
client.organizations.get(org_id: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDReturns: Organization dictionary with details including name, type, region, and creation date
Example:
org = client.organizations.get(org_id="550e8400-e29b-41d4-a716-446655440000") print(f"Organization: {org['name']}") print(f"Type: {org['type']}") print(f"Region: {org['regionCode']}")
Common Use Cases:
create(name, region_code, type)Create a new organization.
Method Signature:
client.organizations.create( name: str, region_code: str, type: str = "STANDALONE" ) -> Dict[str, Any]
Parameters:
name (str, required): Organization nameregion_code (str, required): Region code (NAM, EMEA, APJC)type (str, optional): Organization type (STANDALONE, MANAGER, MANAGED). Default: "STANDALONE"Returns: Created organization dictionary
Example:
new_org = client.organizations.create( name="New Organization", region_code="NAM", type="STANDALONE" ) print(f"Created organization with ID: {new_org['id']}")
Common Use Cases:
update(org_id, name)Update an organization's name.
Method Signature:
client.organizations.update(org_id: str, name: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDname (str, required): New organization nameReturns: Updated organization dictionary
Example:
updated_org = client.organizations.update( org_id="550e8400-e29b-41d4-a716-446655440000", name="Updated Name" )
Common Use Cases:
The Subscriptions resource provides methods to manage product subscriptions within organizations.
list(org_id, name)List all subscriptions for an organization.
Method Signature:
client.subscriptions.list( org_id: str, name: Optional[str] = None ) -> List[Dict[str, Any]]
Parameters:
org_id (str, required): The organization UUIDname (str, optional): Optional subscription name filterReturns: List of subscription dictionaries
Example:
subscriptions = client.subscriptions.list(org_id="org-uuid") for sub in subscriptions: print(f"Subscription: {sub['name']}")
Common Use Cases:
get(org_id, subscription_id)Get a specific subscription by ID.
Method Signature:
client.subscriptions.get(org_id: str, subscription_id: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDsubscription_id (str, required): The subscription UUIDReturns: Subscription dictionary with full details
Example:
subscription = client.subscriptions.get( org_id="org-uuid", subscription_id="3742d652-6740-489c-b628-143f00690fea" )
Common Use Cases:
create(org_id, claim_code, products)Create a new subscription using a claim code.
Method Signature:
client.subscriptions.create( org_id: str, claim_code: str, products: Optional[List[Dict[str, Any]]] = None ) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDclaim_code (str, required): Claim code for subscription creationproducts (List[Dict], optional): List of products to provision with configurationReturns: Dictionary with success status
Example:
# First, read claim code details claim_info = client.subscriptions.read_claim_code( org_id="org-uuid", claim_code="PHJZ-DWMF-ZBYH-FYMB" ) # Build products list from claim info products = client.subscriptions.build_products_from_claim_info(claim_info) # Create subscription new_subscription = client.subscriptions.create( org_id="org-uuid", claim_code="PHJZ-DWMF-ZBYH-FYMB", products=products )
Common Use Cases:
update(org_id, subscription_id, product_id, status, ...)Update a subscription (activate/deactivate product).
Method Signature:
client.subscriptions.update( org_id: str, subscription_id: str, product_id: str, status: bool, source_instance_id: Optional[str] = None, region_code: Optional[str] = None, initial_admin: Optional[str] = None ) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDsubscription_id (str, required): The subscription UUIDproduct_id (str, required): The product UUIDstatus (bool, required): True to activate, False to deactivatesource_instance_id (str, optional): Source instance ID for using existing tenantregion_code (str, optional): Product region code (NAM, EMEA, APJC, US, GLOBAL)initial_admin (str, optional): Initial admin email for new tenant provisioningReturns: Updated subscription dictionary
Example:
# Activate a product updated_sub = client.subscriptions.update( org_id="org-uuid", subscription_id="sub-uuid", product_id="product-uuid", status=True, region_code="NAM", initial_admin="admin@example.com" ) # Deactivate a product deactivated = client.subscriptions.update( org_id="org-uuid", subscription_id="sub-uuid", product_id="product-uuid", status=False )
Common Use Cases:
patch(org_id, subscription_id, entitlements, use_existing_tenants)Patch a subscription (update entitlement quantities for managed organizations).
Method Signature:
client.subscriptions.patch( org_id: str, subscription_id: str, entitlements: List[Dict[str, Any]], use_existing_tenants: Optional[List[str]] = None ) -> Dict[str, Any]
Parameters:
org_id (str, required): The managed organization UUIDsubscription_id (str, required): The subscription UUIDentitlements (List[Dict], required): List of entitlements with id and quantityuse_existing_tenants (List[str], optional): List of existing tenant UUIDsReturns: Updated subscription dictionary
Example:
patched_sub = client.subscriptions.patch( org_id="org-uuid", subscription_id="sub-uuid", entitlements=[ {"id": "E3S-AIDEF-ADV", "quantity": 10}, {"id": "CPT-SEC-ADV", "quantity": 50} ], use_existing_tenants=["8a9f43fa-f8f5-4aac-8d0b-380cf6656255"] )
Common Use Cases:
read_claim_code(org_id, claim_code)Read and validate claim code details before creating a subscription.
Method Signature:
client.subscriptions.read_claim_code(org_id: str, claim_code: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDclaim_code (str, required): Claim code to validateReturns: Claim code information dictionary with products, entitlements, and allowed regions
Example:
claim_info = client.subscriptions.read_claim_code( org_id="org-uuid", claim_code="PHJZ-DWMF-ZBYH-FYMB" ) print(f"Claim code name: {claim_info['name']}") for product in claim_info['products']: print(f"Product: {product['name']}")
Common Use Cases:
build_products_from_claim_info(claim_info, preferred_region)Build products list from claim info with region selection.
Method Signature:
client.subscriptions.build_products_from_claim_info( claim_info: Dict[str, Any], preferred_region: str = "NAM" ) -> List[Dict[str, Any]]
Parameters:
claim_info (Dict, required): Claim code information dictionary (from read_claim_code())preferred_region (str, optional): Preferred region code (default: "NAM")Returns: List of products ready for subscription creation
Example:
claim_info = client.subscriptions.read_claim_code(org_id="org-uuid", claim_code="XXXX") products = client.subscriptions.build_products_from_claim_info( claim_info, preferred_region="EMEA" ) client.subscriptions.create(org_id="org-uuid", claim_code="XXXX", products=products)
Common Use Cases:
The Users resource provides methods to manage user accounts within organizations.
list(org_id, group_id, status)List all users for an organization.
Method Signature:
client.users.list( org_id: str, group_id: Optional[str] = None, status: Optional[str] = None ) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDgroup_id (str, optional): Filter users by group membershipstatus (str, optional): Filter by status (ACTIVE, DISABLE, PENDING, SHARED)Returns: Dictionary containing list of users
Example:
# List all users users = client.users.list(org_id="org-uuid") # Filter by group group_users = client.users.list(org_id="org-uuid", group_id="group-uuid") # Filter by status active_users = client.users.list(org_id="org-uuid", status="ACTIVE")
Common Use Cases:
get(org_id, user_id)Get a specific user by ID.
Method Signature:
client.users.get(org_id: str, user_id: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDuser_id (str, required): The user UUIDReturns: User dictionary with full details
Example:
user = client.users.get(org_id="org-uuid", user_id="user-uuid") print(f"User: {user['firstName']} {user['lastName']}") print(f"Email: {user['email']}")
Common Use Cases:
invite(org_id, email, first_name, last_name)Invite a new user to the organization.
Method Signature:
client.users.invite( org_id: str, email: str, first_name: str, last_name: str ) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDemail (str, required): User's email addressfirst_name (str, required): User's first namelast_name (str, required): User's last nameReturns: User operation response dictionary
Example:
result = client.users.invite( org_id="org-uuid", email="user@example.com", first_name="John", last_name="Doe" )
Common Use Cases:
disable(org_id, email)Disable a user account.
Method Signature:
client.users.disable(org_id: str, email: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDemail (str, required): User's email addressReturns: User operation response dictionary
Example:
client.users.disable(org_id="org-uuid", email="user@example.com")
Common Use Cases:
enable(org_id, email)Enable a user account.
Method Signature:
client.users.enable(org_id: str, email: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDemail (str, required): User's email addressReturns: User operation response dictionary
Example:
client.users.enable(org_id="org-uuid", email="user@example.com")
Common Use Cases:
remove(org_id, email)Remove a user from the organization.
Method Signature:
client.users.remove(org_id: str, email: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDemail (str, required): User's email addressReturns: User operation response dictionary
Example:
client.users.remove(org_id="org-uuid", email="user@example.com")
Common Use Cases:
resend_email_invite(org_id, email)Resend email invitation to a user.
Method Signature:
client.users.resend_email_invite(org_id: str, email: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDemail (str, required): User's email addressReturns: User operation response dictionary
Example:
client.users.resend_email_invite(org_id="org-uuid", email="user@example.com")
Common Use Cases:
update(org_id, user_id, first_name, last_name)Update a user's first and last name.
Method Signature:
client.users.update( org_id: str, user_id: str, first_name: Optional[str] = None, last_name: Optional[str] = None ) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDuser_id (str, required): The user UUIDfirst_name (str, optional): User's first namelast_name (str, optional): User's last nameReturns: Updated user dictionary
Example:
updated_user = client.users.update( org_id="org-uuid", user_id="user-uuid", first_name="Jane", last_name="Smith" )
Common Use Cases:
patch(org_id, users)Perform bulk operations on users (invite, disable, enable, remove, resend_email_invite).
Method Signature:
client.users.patch( org_id: str, users: List[Dict[str, Any]] ) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDusers (List[Dict], required): List of user operations with email, operation, and optional firstName/lastNameReturns: Operation result dictionary with results array
Example:
# Bulk invite multiple users result = client.users.patch( org_id="org-uuid", users=[ { "email": "user1@example.com", "operation": "invite", "firstName": "John", "lastName": "Doe" }, { "email": "user2@example.com", "operation": "invite", "firstName": "Jane", "lastName": "Smith" } ] ) # Bulk disable users client.users.patch( org_id="org-uuid", users=[ {"email": "user1@example.com", "operation": "disable"}, {"email": "user2@example.com", "operation": "disable"} ] )
Common Use Cases:
get_groups(org_id, user_id)List all groups to which a user is assigned.
Method Signature:
client.users.get_groups(org_id: str, user_id: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDuser_id (str, required): The user UUIDReturns: Dictionary containing list of groups
Example:
groups = client.users.get_groups(org_id="org-uuid", user_id="user-uuid") for group in groups.get("groups", []): print(f"Group: {group['name']}")
Common Use Cases:
The Groups resource provides methods to manage admin groups for role-based access control.
list(org_id)List all admin groups for an organization.
Method Signature:
client.groups.list(org_id: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDReturns: Dictionary containing list of groups
Example:
groups = client.groups.list(org_id="org-uuid") for group in groups.get("groups", []): print(f"Group: {group['name']}")
Common Use Cases:
get(org_id, group_id)Get a specific admin group by ID.
Method Signature:
client.groups.get(org_id: str, group_id: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDgroup_id (str, required): The group UUIDReturns: Group dictionary with full details
Example:
group = client.groups.get(org_id="org-uuid", group_id="group-uuid") print(f"Group: {group['name']}") print(f"Description: {group['description']}")
Common Use Cases:
create(org_id, name, description, applies_to)Create a new admin group.
Method Signature:
client.groups.create( org_id: str, name: str, description: Optional[str] = None, applies_to: Optional[str] = None ) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDname (str, required): Group namedescription (str, optional): Group descriptionapplies_to (str, optional): Scope (all, manager, selected_managed)Returns: Created group dictionary
Example:
new_group = client.groups.create( org_id="org-uuid", name="Engineering Team", description="Engineering department group", applies_to="all" ) print(f"Created group with ID: {new_group['id']}")
Common Use Cases:
update(org_id, group_id, name, description)Update an existing admin group.
Method Signature:
client.groups.update( org_id: str, group_id: str, name: Optional[str] = None, description: Optional[str] = None ) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDgroup_id (str, required): The group UUIDname (str, optional): New group namedescription (str, optional): New group descriptionReturns: Updated group dictionary
Example:
updated_group = client.groups.update( org_id="org-uuid", group_id="group-uuid", name="Updated Team Name", description="Updated description" )
Common Use Cases:
delete(org_id, group_id)Delete an admin group.
Method Signature:
client.groups.delete(org_id: str, group_id: str) -> bool
Parameters:
org_id (str, required): The organization UUIDgroup_id (str, required): The group UUIDReturns: True if deletion was successful
Example:
success = client.groups.delete(org_id="org-uuid", group_id="group-uuid") if success: print("Group deleted successfully")
Common Use Cases:
patch(org_id, group_id, users, managed_orgs)Patch admin group membership (add/remove users and managed organizations).
Method Signature:
client.groups.patch( org_id: str, group_id: str, users: Optional[List[Dict[str, str]]] = None, managed_orgs: Optional[List[Dict[str, str]]] = None ) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDgroup_id (str, required): The group UUIDusers (List[Dict], optional): User operations with 'operation' (add/remove) and 'id' (email)managed_orgs (List[Dict], optional): Managed org operations with 'operation' (add/remove) and 'id'Returns: Patch operation results
Example:
# Add users to group result = client.groups.patch( org_id="org-uuid", group_id="group-uuid", users=[ {"operation": "add", "id": "user@example.com"}, {"operation": "add", "id": "admin@example.com"} ] ) # Remove user and managed org result = client.groups.patch( org_id="org-uuid", group_id="group-uuid", users=[{"operation": "remove", "id": "user@example.com"}], managed_orgs=[{"operation": "remove", "id": "managed-org-id"}] )
Common Use Cases:
get_managed_organizations(org_id, group_id)Get managed organizations for a shared admin group.
Method Signature:
client.groups.get_managed_organizations(org_id: str, group_id: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDgroup_id (str, required): The group UUIDReturns: Dictionary containing list of managed organizations
Example:
managed_orgs = client.groups.get_managed_organizations( org_id="org-uuid", group_id="group-uuid" )
Common Use Cases:
get_assigned_roles(org_id, group_id)Get assigned roles for a specific admin group.
Method Signature:
client.groups.get_assigned_roles(org_id: str, group_id: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDgroup_id (str, required): The group UUIDReturns: Dictionary containing list of roles
Example:
roles = client.groups.get_assigned_roles(org_id="org-uuid", group_id="group-uuid") for role in roles.get("roles", []): print(f"Role: {role['displayName']}")
Common Use Cases:
get_users(org_id, group_id)Get all users that belong to a specific admin group.
Method Signature:
client.groups.get_users(org_id: str, group_id: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDgroup_id (str, required): The group UUIDReturns: Dictionary containing list of users
Example:
users = client.groups.get_users(org_id="org-uuid", group_id="group-uuid") for user in users.get("users", []): print(f"User: {user['email']}")
Common Use Cases:
The Roles resource provides methods to manage role assignments for users and groups.
list(org_id, type)List all roles for an organization.
Method Signature:
client.roles.list( org_id: str, type: Optional[str] = None ) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDtype (str, optional): Filter by role type (CUSTOM, BUNDLED, STATIC)Returns: Dictionary containing list of roles
Example:
# List all roles roles = client.roles.list(org_id="org-uuid") # List only static roles static_roles = client.roles.list(org_id="org-uuid", type="STATIC")
Common Use Cases:
get(org_id, role_id)Get a specific role by ID.
Method Signature:
client.roles.get(org_id: str, role_id: str) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDrole_id (str, required): The role UUIDReturns: Role dictionary with full details
Example:
role = client.roles.get(org_id="org-uuid", role_id="role-uuid") print(f"Role: {role['displayName']}") for product in role.get('products', []): print(f"Product: {product['name']}")
Common Use Cases:
patch(org_id, role_id, users, groups)Update role assignments by adding or removing users and groups.
Method Signature:
client.roles.patch( org_id: str, role_id: str, users: Optional[List[Dict[str, str]]] = None, groups: Optional[List[Dict[str, str]]] = None ) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDrole_id (str, required): The role UUIDusers (List[Dict], optional): User operations with 'operation' (add/remove) and 'id' (user UUID)groups (List[Dict], optional): Group operations with 'operation' (add/remove) and 'id' (group UUID)Returns: Dictionary with 'results' array and 'summary' containing success/failure counts
Example:
# Assign role to users and groups result = client.roles.patch( org_id="org-uuid", role_id="role-uuid", users=[{"operation": "add", "id": "user-uuid"}], groups=[{"operation": "add", "id": "group-uuid"}] ) # Check results if result["summary"]["all_successful"]: print("All role assignments successful") else: print(f"Failed: {result['summary']['failed']} operations")
Common Use Cases:
find_role_id(org_id, product_name, role_display_name)Find a role ID by product name and role display name.
Method Signature:
client.roles.find_role_id( org_id: str, product_name: str, role_display_name: str ) -> Optional[str]
Parameters:
org_id (str, required): The organization UUIDproduct_name (str, required): Product name (e.g., "Security Cloud Control")role_display_name (str, required): Role display name (e.g., "Organization Administrator")Returns: Role ID if found, None otherwise
Example:
role_id = client.roles.find_role_id( org_id="org-uuid", product_name="Security Cloud Control", role_display_name="Organization Administrator" ) if role_id: print(f"Found role ID: {role_id}")
Common Use Cases:
The Tokens resource provides methods to manage API token refresh operations.
refresh(org_id, api_key_id, refresh_token)Refresh access token using a refresh token.
Method Signature:
client.tokens.refresh( org_id: str, api_key_id: str, refresh_token: str ) -> Dict[str, Any]
Parameters:
org_id (str, required): The organization UUIDapi_key_id (str, required): The API key UUIDrefresh_token (str, required): The refresh token valueReturns: Dictionary containing new access_token, refresh_token, and expires_in
Example:
new_tokens = client.tokens.refresh( org_id="org-uuid", api_key_id="key-uuid", refresh_token="your_refresh_token" ) access_token = new_tokens["access_token"] refresh_token = new_tokens["refresh_token"] expires_in = new_tokens["expires_in"] # Use new access token for subsequent requests client = Client(access_token=access_token)
Common Use Cases:
with Client(access_token="your_token") as client: orgs = client.organizations.list() # Session is automatically closed when exiting the context
# List organizations with filtering and pagination orgs = client.organizations.list( name="Acme", type="STANDALONE", region_code="NAM", max=50, sort_by="name", order="ASC" ) # Get a specific organization org = client.organizations.get(org_id="550e8400-e29b-41d4-a716-446655440000") # Create a new organization new_org = client.organizations.create( name="New Organization", region_code="NAM", type="STANDALONE" ) # Update an organization updated_org = client.organizations.update( org_id="550e8400-e29b-41d4-a716-446655440000", name="Updated Name" )
org_id = "550e8400-e29b-41d4-a716-446655440000" # List subscriptions subscriptions = client.subscriptions.list(org_id=org_id) # Get a specific subscription subscription = client.subscriptions.get( org_id=org_id, subscription_id="3742d652-6740-489c-b628-143f00690fea" ) # Create a subscription with claim code new_subscription = client.subscriptions.create( org_id=org_id, claim_code="PHJZ-DWMF-ZBYH-FYMB", type="STANDALONE" ) # Read claim code details before creating claim_info = client.subscriptions.read_claim_code( org_id=org_id, claim_code="PHJZ-DWMF-ZBYH-FYMB" ) # Update subscription (activate/deactivate product) updated_sub = client.subscriptions.update( org_id=org_id, subscription_id="sub-uuid", product_id="product-uuid", status=True, region_code="NAM", initial_admin="admin@example.com" ) # Patch subscription (update SKU quantities for managed orgs) patched_sub = client.subscriptions.patch( org_id=org_id, subscription_id="sub-uuid", skus=[ {"name": "E3S-AIDEF-ADV", "quantity": 10}, {"name": "CPT-SEC-ADV", "quantity": 50} ] )
org_id = "550e8400-e29b-41d4-a716-446655440000" # List groups groups = client.groups.list(org_id=org_id) # Get a specific group group = client.groups.get( org_id=org_id, group_id="e980e881-b61f-11f0-a9b4-06fbd2118f4e" ) # Create a new group new_group = client.groups.create( org_id=org_id, name="Engineering Team", description="Engineering department group", applies_to="SOME_MANAGED" ) # Update a group updated_group = client.groups.update( org_id=org_id, group_id="group-uuid", name="Updated Team Name", description="Updated description" ) # Delete a group client.groups.delete(org_id=org_id, group_id="group-uuid") # Remove shared group from managed organization client.groups.remove_shared_group(org_id=org_id, group_id="group-uuid")
# Refresh access token using refresh token new_tokens = client.tokens.refresh( org_id="org-uuid", api_key_id="key-uuid", refresh_token="your_refresh_token" ) access_token = new_tokens["access_token"] refresh_token = new_tokens["refresh_token"] expires_in = new_tokens["expires_in"]
The SDK provides custom exceptions for different error scenarios:
from scc_sdk import ( Client, SCCError, AuthenticationError, NotFoundError, ValidationError, ForbiddenError, ServerError ) try: client = Client(access_token="your_token") org = client.organizations.get(org_id="invalid-uuid") except AuthenticationError: print("Invalid access token") except NotFoundError: print("Organization not found") except ValidationError: print("Invalid request data") except ForbiddenError: print("Access forbidden") except ServerError: print("Server error occurred") except SCCError as e: print(f"API error occurred: {e}")
All SCCError exceptions include detailed error information from the API:
try: claim_info = client.subscriptions.read_claim_code( org_id="org-uuid", claim_code="INVALID-CODE" ) except SCCError as e: # Access error details print(f"Error: {e.message}") print(f"Status Code: {e.status_code}") print(f"Tracking ID: {e.tracking_id}") print(f"Timestamp: {e.timestamp}") print(f"Path: {e.path}") # Get full error response print(f"Full Response: {e.response}") # Or convert to dictionary error_dict = e.to_dict()
Available error attributes:
message - Error messagestatus_code - HTTP status code (e.g., 400, 404)tracking_id - API tracking ID for support requeststimestamp - Error timestamppath - API path that generated the errorresponse - Full response dictionary from the APIExample error response:
{
"trackingId": "bb7d315e-502c-4427-9683-cc6fc824495f",
"message": "invalid claim code provided",
"timestamp": "2026-02-05T22:53:38.923039436Z",
"statusCode": 400,
"path": "/v1/organizations/94ff7d60-aebb-41d0-82cf-e06c74b63d81/subscriptions/claimInfo"
}list() - List organizations with filteringget(org_id) - Get organization by IDcreate(name, region_code, type) - Create new organizationupdate(org_id, name) - Update organization namelist(org_id, name) - List subscriptionsget(org_id, subscription_id) - Get subscription by IDcreate(org_id, claim_code, type, products) - Create subscriptionupdate(org_id, subscription_id, ...) - Update subscriptionpatch(org_id, subscription_id, skus, ...) - Patch subscription SKUsread_claim_code(org_id, claim_code) - Validate claim codelist(org_id) - List groupsget(org_id, group_id) - Get group by IDcreate(org_id, name, description, applies_to) - Create groupupdate(org_id, group_id, name, description) - Update groupdelete(org_id, group_id) - Delete groupremove_shared_group(org_id, group_id) - Remove shared grouprefresh(org_id, api_key_id, refresh_token) - Refresh access tokenpip3 install -e ".[dev]"
pytestblack scc_sdk/ flake8 scc_sdk/ mypy scc_sdk/
For full API documentation, refer to the Cisco Security Cloud Control API Documentation.
Thanks for your interest in contributing! There are many ways to contribute to this project. Get started here.
For questions, issues, or feedback regarding this SDK, please contact the Cisco SCC SDK Team:
📧 Email: cisco-scc-sdk-team@cisco.com
This library is distributed under the Apache 2.0 license found in the LICENSE file.
Owner
Contributors
Categories
SecurityProducts
Cisco Security Cloud Control (SCC)License
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community