From a9a34021bed712f144f680173d7d84c2f5b49450 Mon Sep 17 00:00:00 2001 From: sra Date: Fri, 10 Apr 2026 22:21:30 +0530 Subject: [PATCH 1/8] Adding SDK for mgmt --- .../management/mgmt-python-asynciosdk.md | 11 + .../management/mgmt-python-inlinesdk.md | 11 + .../management/mgmt-python-sdk.md | 414 ++++++++++++++++++ 3 files changed, 436 insertions(+) create mode 100644 products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md create mode 100644 products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md create mode 100644 products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md diff --git a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md new file mode 100644 index 000000000..fac513581 --- /dev/null +++ b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md @@ -0,0 +1,11 @@ +--- +id: pythonsdkasynciousage +title: "Python SDK Asyncio Usage" +sidebar_label: "Python SDK Asyncio Usage" +keywords: + - PythonSDK + - AIRS + - Reference + - Cloud + - API +--- \ No newline at end of file diff --git a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md new file mode 100644 index 000000000..1a3dd8386 --- /dev/null +++ b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md @@ -0,0 +1,11 @@ +--- +id: mgmt-python-inlinesdk +title: "Python Management API SDK Inline Usage" +sidebar_label: "Python Management API SDK Inline Usage" +keywords: + - PythonSDK + - AIRS + - Reference + - Cloud + - API +--- diff --git a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md new file mode 100644 index 000000000..1319ec734 --- /dev/null +++ b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md @@ -0,0 +1,414 @@ +--- +id: mgmt-python-sdk +title: "Prisma AIRS Management API Python SDK" +sidebar_label: "Management API Python SDK Overview" +keywords: + - PythonSDK + - AIRS + - Reference + - Cloud + - API +--- + +This Python SDK provides convenient access to the Palo Alto Networks AI Runtime Security Management API for Python applications. This SDK enables you to programmatically manage AI security profiles, API keys, DLP profiles, customer applications, custom topics, OAuth tokens, and deployment profiles. + +## Key Features: + +- **Synchronous (inline) and Asynchronous (asyncio) support** - Choose the SDK version that fits your application. +- **Type-safe** - Fully typed with Pydantic models for all request/response objects. +- **Automatic OAuth2 token management** - Built-in token caching and refresh. +- **Retry handling** - Configurable exponential backoff for transient failures. +- **Comprehensive error handling** - Granular exception types for precise error handling. + +## API Documentation + +The reference API documentation for Palo Alto Networks AI Runtime Security Management API can be found at https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/ + +## Installation + +```python +# Create and activate a virtual environment +python3 -m venv --prompt ${PWD##*/} .venv && source .venv/bin/activate + +# Install most recent release version of airs-api-mgmt-sdk package +python3 -m pip install "pan-airs-api-mgmt-sdk" +``` + +## Quick Start + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +# Initialize client with credentials +client = MgmtClient( + client_id="your_client_id", + client_secret="your_client_secret" +) + +# Retrieve API keys +api_keys = client.api_keys.get_all_api_keys(limit=10) +print(f"API Keys: {api_keys}") +``` + +**Asynchronous Example:** + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def main(): + async with MgmtClientAsync() as client: # Uses env variables + # Retrieve AI security profiles + profiles = await client.ai_sec_profiles.get_all_ai_profiles(limit=10) + print(f"AI Security Profiles: {profiles}") + +asyncio.run(main()) +``` + +# SDK Configuration + +The SDK provides two client classes: + +- **MgmtClient()** - Synchronous (blocking) client for standard Python applications +- **MgmtClientAsync()** - Asynchronous (non-blocking) client for async/await applications + +Both clients accept the following optional parameters: + + - **client_id:** Your OAuth2 client ID (service account email) + - **client_secret:** Your OAuth2 client secret + - **base_url:** Management API endpoint (default: https://api.sase.paloaltonetworks.com/aisec) + - **token_base_url:** OAuth2 token endpoint (default: https://auth.appsvc.paloaltonetworks.com/auth/v1/oauth2/access_token) + - **num_retries:** Maximum number of retries with exponential backoff (default: 3) + +You must provide OAuth2 client credentials (client_id + client_secret) for authentication. + +# OAuth2 Client Credentials + +There are two ways to specify your OAuth2 client credentials and configuration: + +1. Using environment variables: + +```python +# Required credentials +export PANW_CLIENT_ID="your_client_id" +export PANW_CLIENT_SECRET="your_client_secret" + +# Optional configuration (override defaults) +export PANW_BASE_URL="https://api.sase.paloaltonetworks.com/aisec" +export PANW_TOKEN_BASE_URL="https://auth.appsvc.paloaltonetworks.com/auth/v1/oauth2/access_token" +``` + +2. Specify credentials in MgmtClient() initialization: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient( + client_id="your_client_id", + client_secret="your_client_secret", + base_url="https://api.sase.paloaltonetworks.com/aisec", # Optional + token_base_url="https://auth.appsvc.paloaltonetworks.com/auth/v1/oauth2/access_token" # Optional +) +``` + +# Configuration Parameters + +All configuration parameters: + +| Parameter | Type | Default | Environment Variable | Description | +| :--- | :--- | :--- | :--- | :--- | +| **client_id** | str | None | PANW_CLIENT_ID | OAuth2 service account client ID | +| **client_secret** | str | None | PANW_CLIENT_SECRET | OAuth2 client secret | +| **base_url** | str | https://api.sase.
paloaltonetworks.com/aisec | PANW_BASE_URL | Management API endpoint | +| **token_base_url** | str | https://auth.appsvc.
paloaltonetworks.com/auth/v1/oauth2/access_token | PANW_TOKEN_BASE_URL | OAuth2 token endpoint | +| **num_retries** | int | 3 | - | Max retries with exponential backoff | +| **base_url** | str | https://api.sase.paloaltonetworks.com/aisec | PANW_BASE_URL | Management API endpoint | +| **token_base_url** | str | https://auth.appsvc.paloaltonetworks.com/auth/v1/oauth2/access_token | PANW_TOKEN_BASE_URL | OAuth2 token endpoint | +| **num_retries** | int | 3 | - | Max retries with exponential backoff | + +# Example: SDK Configuration + +**Using Client Credentials** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient( + client_id="your_client_id", + client_secret="your_client_secret", + base_url="https://api.sase.paloaltonetworks.com/aisec", + token_base_url="https://auth.appsvc.paloaltonetworks.com/auth/v1/oauth2/access_token" +) +``` +**Using Environment Variables** + +```python +from airs_api_mgmt import MgmtClient + +# Set environment variables first +# Required: +# export PANW_CLIENT_ID="your_client_id" +# export PANW_CLIENT_SECRET="your_client_secret" + +# Optional (override defaults): +# export PANW_BASE_URL="https://api.sase.paloaltonetworks.com/aisec" +# export PANW_TOKEN_BASE_URL="https://auth.appsvc.paloaltonetworks.com/auth/v1/oauth2/access_token" + +# Initialize with defaults (uses environment variables) +client = MgmtClient() +``` + +**Using Async Client** + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def main(): + # Option 1: Use async context manager (recommended) + async with MgmtClientAsync( + client_id="your_client_id", + client_secret="your_client_secret" + ) as client: + # Client automatically closes when exiting context + api_keys = await client.api_keys.get_all_api_keys() + print(f"API Keys: {api_keys}") + + # Option 2: Manual initialization and cleanup + client = MgmtClientAsync() + try: + profiles = await client.ai_sec_profiles.get_all_ai_profiles() + print(f"AI Profiles: {profiles}") + finally: + await client.close() # Always close when done + +asyncio.run(main()) +``` + +# SDK Features Deep Dive + +## 1. Dual Sync/Async Implementation + +The SDK provides both synchronous and asynchronous implementations: + +- **Synchronous (MgmtClient):** Traditional blocking I/O for standard Python applications. +- **Asynchronous (MgmtClientAsync):** Non-blocking I/O for high-performance async applications. + +Both implementations share the same API surface, making it easy to switch between them. + +## 2. Automatic OAuth2 Token Management + +The SDK handles OAuth2 authentication automatically: + +- **Token Acquisition:** Automatically obtains access tokens using client credentials. +- **Token Caching:** Caches tokens in memory to avoid unnecessary token requests. +- **Token Refresh:** Automatically refreshes tokens before expiration. +- **Thread-Safe:** Token management is thread-safe for concurrent requests. + +```python +# Token is automatically managed - no manual intervention needed +client = MgmtClient(client_id="...", client_secret="...") +# Token acquired on first API call and refreshed as needed +``` +# 3. Exponential Backoff Retry Logic + +Automatic retry with exponential backoff for transient failures: + +- **Default Retries:** 3 attempts (configurable via num_retries parameter). +- **Backoff Strategy:** Exponential backoff (1s → 2s → 4s → 8s → ...). +- **Retryable Errors:** Automatically retries on network errors and 5xx server errors. +- **Non-Retryable Errors:** Fails fast on 4xx client errors (bad requests, auth failures). + +```python +# Configure custom retry behavior +client = MgmtClient( + client_id="...", + client_secret="...", + num_retries=5 # Retry up to 5 times +) +``` + +# 4. Comprehensive Error Handling + +Granular exception hierarchy for precise error handling: + +- **MgmtSdkClientError:** 4xx errors (bad requests, auth failures, not found). +- **MgmtSdkServerError:** 5xx errors (server failures, timeouts). +- **PayloadConfigurationError:** Invalid request payloads. +- **MissingVariableError:** Missing required configuration. +- **MgmtSdkAPIError:** General API errors. +- **MgmtSdkBaseError:** Unexpected errors. + +All HTTP error exceptions include: + + - **status_code:** HTTP status code. + - **response_body:** Raw response body for debugging. + + +# 5. Type Safety with Pydantic Models +All request and response objects are validated using Pydantic v2: + +- **Automatic Validation:** Input/output data is automatically validated. +- **Type Hints:** Full type hint support for IDE autocomplete. +- **Serialization:** Automatic JSON serialization/deserialization. +- **Documentation:** Self-documenting models with field descriptions. + +```python +from airs_api_mgmt.sdk.models import PaginatedAPIKeyObject + +# Type-safe responses +response: PaginatedAPIKeyObject = client.api_keys.get_all_api_keys() +print(f"Response: {response}") +``` + +# 6. Pagination Support + +Built-in pagination for all list endpoints: + + - Offset-based: Use offset and limit parameters. + - Consistent API: Same pagination pattern across all resources. + - Total Count: Responses include total count for progress tracking. + +```python +# Retrieve first 50 items +page1 = client.api_keys.get_all_api_keys(offset=0, limit=50) + +# Retrieve next 50 items +page2 = client.api_keys.get_all_api_keys(offset=50, limit=50) + +print(f"Page 1: {page1}") +print(f"Page 2: {page2}") +``` + +# 7. Structured Logging + +Built-in logging for debugging and monitoring: + +- **Contextual Logs:** Each operation logs with event context. +- **Configurable:** Uses standard Python logging (configure via logging module). +- **Request/Response:** Logs important API interactions. +- **Error Details:** Detailed error logging with stack traces. + + +```python +import logging + +# Enable debug logging +logging.basicConfig(level=logging.DEBUG) +logger = logging.getLogger("airs_api_mgmt") +logger.setLevel(logging.DEBUG) + +client = MgmtClient() # Now see detailed logs +``` + +# 8. Environment Variable Support + +Flexible configuration via environment variables: + + - PANW_CLIENT_ID: OAuth2 client ID + - PANW_CLIENT_SECRET: OAuth2 client secret + - PANW_BASE_URL: Custom API endpoint URL + - PANW_TOKEN_BASE_URL: Custom OAuth2 token endpoint URL + +```python +export PANW_CLIENT_ID="your_client_id" +export PANW_CLIENT_SECRET="your_client_secret" +``` + +```python +# Automatically uses environment variables +client = MgmtClient() +``` + +# 9. OpenAPI-Generated Models + +All models are auto-generated from OpenAPI 3.0 specification: + +- **Always Current:** Models stay in sync with API specification. +- **Comprehensive:** Complete coverage of all API endpoints. +- **Validated:** OpenAPI contract ensures correctness. + +# 10. Context Manager Support + +Async client supports Python context managers for automatic cleanup: + +```python +async with MgmtClientAsync() as client: + # Client automatically closes connections on exit + profiles = await client.ai_sec_profiles.get_all_ai_profiles() + # Cleanup happens automatically +``` + +## Available Resources + +The SDK provides access to the following resources through the `MgmtClient`: + +| Resource | Access Method | Description | +| :--- | :--- | :--- | +| **API Keys** | `client.api_keys` | Create, retrieve, regenerate, and delete API keys | +| **AI Security Profiles** | `client.ai_sec_profiles` | Manage AI security profiles and policies | +| **Custom Topics** | `client.custom_topics` | Create and manage custom security topics | +| **Customer Applications** | `client.customer_apps` | Manage customer applications | +| **DLP Profiles** | `client.dlp_profiles` | Retrieve DLP (Data Loss Prevention) profiles | +| **Deployment Profiles** | `client.deployment_profiles` | Retrieve deployment configurations | +| **OAuth Tokens** | `client.oauth` | Generate OAuth2 tokens for applications | + +### All resources provide: +* **Automatic OAuth2 token management** with refresh +* **Exponential backoff retry logic** (1s, 2s, 4s, 8s...) +* **Type-safe** request/response models +* **Comprehensive** error handling + +--- + +## API Coverage + +### API Keys Management +| Operation | Method | API Endpoint | +| :--- | :--- | :--- | +| Create API Key | `create_new_api_key()` | `POST /v1/mgmt/api-key` | +| Retrieve API Keys | `get_all_api_keys()` | `GET /v1/mgmt/api-key` | +| Regenerate API Key | `regenerate_api_key()` | `POST /v1/mgmt/api-key/{apiKeyId}/regenerate` | +| Delete API Key | `delete_api_key()` | `DELETE /v1/mgmt/api-key` | + +### AI Security Profiles Management +| Operation | Method | API Endpoint | +| :--- | :--- | :--- | +| Create AI Profile | `create_new_ai_profile()` | `POST /v1/mgmt/ai-sec-profile` | +| Retrieve AI Profiles | `get_all_ai_profiles()` | `GET /v1/mgmt/ai-sec-profile` | +| Update AI Profile | `update_ai_profile()` | `PUT /v1/mgmt/ai-sec-profile/{profileId}` | +| Delete AI Profile | `delete_ai_profile()` | `DELETE /v1/mgmt/ai-sec-profile/{profileId}` | +| Force Delete AI Profile | `force_delete_ai_profile()` | `DELETE /v1/mgmt/ai-sec-profile/{profileId}/force` | + +### Custom Topics Management +| Operation | Method | API Endpoint | +| :--- | :--- | :--- | +| Create Custom Topic | `create_new_custom_topic()` | `POST /v1/mgmt/custom-topic` | +| Retrieve Custom Topics | `get_all_custom_topics()` | `GET /v1/mgmt/custom-topic` | +| Modify Custom Topic | `modify_custom_topic_details()` | `PUT /v1/mgmt/custom-topic/{topicId}` | +| Delete Custom Topic | `delete_custom_topic()` | `DELETE /v1/mgmt/custom-topic/{topicId}` | +| Force Delete Custom Topic | `force_delete_custom_topic()` | `DELETE /v1/mgmt/custom-topic/{topicId}/force` | + +### Customer Applications Management +| Operation | Method | API Endpoint | +| :--- | :--- | :--- | +| Retrieve Customer Apps | `get_all_customer_apps()` | `GET /v1/mgmt/customer-app` | +| Update Customer App | `update_customer_app()` | `PUT /v1/mgmt/customer-app/{customerAppId}` | +| Delete Customer App | `delete_customer_app()` | `DELETE /v1/mgmt/customer-app` | + +### DLP Profiles Management +| Operation | Method | API Endpoint | +| :--- | :--- | :--- | +| Retrieve DLP Profiles | `get_all_dlp_profiles()` | `GET /v1/mgmt/dlp-profile` | + +### Deployment Profiles Management +| Operation | Method | API Endpoint | +| :--- | :--- | :--- | +| Retrieve Deployment Profiles | `get_all_deployment_profiles()` | `GET /v1/mgmt/deployment-profile` | + +### OAuth Token Management +| Operation | Method | API Endpoint | +| :--- | :--- | :--- | +| Generate OAuth Token | `get_oauth_token()` | `POST /v1/oauth/token` | \ No newline at end of file From 6ef28ae7e8c4495ebd83034fb02e54f079a3b1f3 Mon Sep 17 00:00:00 2001 From: sra Date: Mon, 13 Apr 2026 22:21:51 +0530 Subject: [PATCH 2/8] Added python sdks for Management APIs --- .../management/mgmt-python-asynciosdk.md | 239 +++++- .../management/mgmt-python-inlinesdk.md | 719 ++++++++++++++++++ products/prisma-airs/sidebars.ts | 23 +- 3 files changed, 976 insertions(+), 5 deletions(-) diff --git a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md index fac513581..693496c6e 100644 --- a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md +++ b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md @@ -1,11 +1,242 @@ --- -id: pythonsdkasynciousage -title: "Python SDK Asyncio Usage" -sidebar_label: "Python SDK Asyncio Usage" +id: mgmt-python-asynciosdk +title: "Python Management API SDK Asyncio Usage" +sidebar_label: "Python Management API SDK Asyncio Usage" keywords: - PythonSDK - AIRS - Reference - Cloud - API ---- \ No newline at end of file +--- + +# Python Management API SDK Asyncio Usage + +This page covers the key use cases of the Prisma AIRS Management API Python SDK with asynchronous (asyncio) methods. It enables you to programmatically manage AI security profiles, API keys, DLP profiles, customer applications, custom topics, OAuth tokens, and deployment profiles with non-blocking I/O for high-performance applications. + +## API Keys Management + +API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/ + +### Create New API Key + +Create a new API key for your customer application with specified rotation settings. + +**Asynchronous Example:** + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def create_api_key(): + async with MgmtClientAsync() as client: + response = await client.api_keys.create_new_api_key( + api_key_name="my-application-key", + cust_app="my-customer-app", + auth_code="your_auth_code", + created_by="user@example.com", + cust_env="production", + cust_cloud_provider="AWS", + rotation_time_interval=3, + rotation_time_unit="months", + revoked=False, + dp_name="my-deployment-profile", + cust_ai_agent_framework="langchain" + ) + + print(f"API Key ID: {response}") + +asyncio.run(create_api_key()) +``` + +**Parameters:** +- `api_key_name` (str, required): Name of the API key +- `cust_app` (str, required): Customer application identifier +- `auth_code` (str, required): Authorization code +- `created_by` (str, required): Email of user creating the key +- `cust_env` (str, required): Environment (e.g., "production", "staging") +- `cust_cloud_provider` (str, required): Cloud provider (e.g., "AWS", "Azure", "GCP") +- `rotation_time_interval` (int, required): Rotation interval value +- `rotation_time_unit` (str, required): Rotation unit ("days", "months", "years") +- `revoked` (bool, optional): Revocation status (default: False) +- `dp_name` (str, optional): Deployment profile name +- `cust_ai_agent_framework` (str, optional): AI agent framework name + +### Retrieve API Keys (with pagination) + +Retrieve all API keys. + +**Asynchronous Example:** + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def get_all_api_keys(): + async with MgmtClientAsync() as client: + api_keys_response = await client.api_keys.get_all_api_keys(offset=0, limit=25) + + print(f"API Keys Response: {api_keys_response}") + +asyncio.run(get_all_api_keys()) +``` + +**Parameters:** +- `offset` (int, optional): Starting position for pagination (default: 0) +- `limit` (int, optional): Maximum number of keys to retrieve (default: 100) + +### Regenerate API Key + +Regenerate an existing API key with new rotation settings. + +**Asynchronous Example:** + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def regenerate_api_key(): + async with MgmtClientAsync() as client: + regenerate_response = await client.api_keys.regenerate_api_key( + api_key_id="your_api_key_uuid", + rotation_time_interval=6, + rotation_time_unit="months", + updated_by="user@example.com" + ) + + print(f"New API Key Secret: {regenerate_response}") + +asyncio.run(regenerate_api_key()) +``` + +**Parameters:** +- `api_key_id` (str, required): UUID of the API key to regenerate +- `rotation_time_interval` (int, required): New rotation interval value +- `rotation_time_unit` (str, required): New rotation unit ("days", "months", "years") +- `updated_by` (str, optional): Email of user performing the regeneration + +### Delete API Key + +Delete an API key by its name. + +**Asynchronous Example:** + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def delete_api_key(): + async with MgmtClientAsync() as client: + delete_response = await client.api_keys.delete_api_key( + api_key_name="my-application-key", + updated_by="user@example.com" + ) + + print(f"Deletion response: {delete_response}") + +asyncio.run(delete_api_key()) +``` + +**Parameters:** +- `api_key_name` (str, required): Name of the API key to delete +- `updated_by` (str, required): Email of user performing the deletion + +## Retrieve Multiple Resources in Parallel + +Fetch multiple resources concurrently using `asyncio.gather()`: + +**Asynchronous Example:** + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def fetch_all_resources(): + async with MgmtClientAsync() as client: + # Fetch multiple resources concurrently + results = await asyncio.gather( + client.api_keys.get_all_api_keys(), + client.ai_sec_profiles.get_all_ai_profiles(), + client.custom_topics.get_all_custom_topics(), + client.dlp_profiles.get_all_dlp_profiles() + ) + + api_keys, ai_profiles, topics, dlp_profiles = results + + print(f"API Keys: {api_keys}") + print(f"AI Profiles: {ai_profiles}") + print(f"Custom Topics: {topics}") + print(f"DLP Profiles: {dlp_profiles}") + +asyncio.run(fetch_all_resources()) +``` + +## Available Resources + +The SDK provides access to the following resources through the `MgmtClientAsync`: + +| Resource | Access Method | Description | +|----------|---------------|-------------| +| **API Keys** | `client.api_keys` | Create, retrieve, regenerate, and delete API keys | +| **AI Security Profiles** | `client.ai_sec_profiles` | Manage AI security profiles and policies | +| **Custom Topics** | `client.custom_topics` | Create and manage custom security topics | +| **Customer Applications** | `client.customer_apps` | Manage customer applications | +| **DLP Profiles** | `client.dlp_profiles` | Retrieve DLP (Data Loss Prevention) profiles | +| **Deployment Profiles** | `client.deployment_profiles` | Retrieve deployment configurations | +| **OAuth Tokens** | `client.oauth` | Generate OAuth2 tokens for applications | + +All resources provide: +- Automatic OAuth2 token management with refresh +- Exponential backoff retry logic (1s, 2s, 4s, 8s...) +- Type-safe request/response models +- Comprehensive error handling + +## API Coverage + +### API Keys Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Create API Key | `create_new_api_key()` | `POST /v1/mgmt/api-key` | +| Retrieve API Keys | `get_all_api_keys()` | `GET /v1/mgmt/api-key` | +| Regenerate API Key | `regenerate_api_key()` | `POST /v1/mgmt/api-key/{apiKeyId}/regenerate` | +| Delete API Key | `delete_api_key()` | `DELETE /v1/mgmt/api-key` | + +### AI Security Profiles Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Create AI Profile | `create_new_ai_profile()` | `POST /v1/mgmt/ai-sec-profile` | +| Retrieve AI Profiles | `get_all_ai_profiles()` | `GET /v1/mgmt/ai-sec-profile` | +| Update AI Profile | `update_ai_profile()` | `PUT /v1/mgmt/ai-sec-profile/{profileId}` | +| Delete AI Profile | `delete_ai_profile()` | `DELETE /v1/mgmt/ai-sec-profile/{profileId}` | +| Force Delete AI Profile | `force_delete_ai_profile()` | `DELETE /v1/mgmt/ai-sec-profile/{profileId}/force` | + +### Custom Topics Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Create Custom Topic | `create_new_custom_topic()` | `POST /v1/mgmt/custom-topic` | +| Retrieve Custom Topics | `get_all_custom_topics()` | `GET /v1/mgmt/custom-topic` | +| Modify Custom Topic | `modify_custom_topic_details()` | `PUT /v1/mgmt/custom-topic/{topicId}` | +| Delete Custom Topic | `delete_custom_topic()` | `DELETE /v1/mgmt/custom-topic/{topicId}` | +| Force Delete Custom Topic | `force_delete_custom_topic()` | `DELETE /v1/mgmt/custom-topic/{topicId}/force` | + +### Customer Applications Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Retrieve Customer Apps | `get_all_customer_apps()` | `GET /v1/mgmt/customer-app` | +| Update Customer App | `update_customer_app()` | `PUT /v1/mgmt/customer-app/{customerAppId}` | +| Delete Customer App | `delete_customer_app()` | `DELETE /v1/mgmt/customer-app` | + +### DLP Profiles Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Retrieve DLP Profiles | `get_all_dlp_profiles()` | `GET /v1/mgmt/dlp-profile` | + +### Deployment Profiles Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Retrieve Deployment Profiles | `get_all_deployment_profiles()` | `GET /v1/mgmt/deployment-profile` | + +### OAuth Token Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Generate OAuth Token | `get_oauth_token()` | `POST /v1/oauth/token` | diff --git a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md index 1a3dd8386..a3240edfa 100644 --- a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md +++ b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md @@ -9,3 +9,722 @@ keywords: - Cloud - API --- + +# Python Management API SDK Inline Usage + +This page covers the key use cases of the Prisma AIRS Management API Python SDK with synchronous (inline) methods. It enables you to programmatically manage AI security profiles, API keys, DLP profiles, customer applications, custom topics, OAuth tokens, and deployment profiles. + +## API Keys Management + +API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/ + +### Create New API Key + +Create a new API key for your customer application with specified rotation settings. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +# Initialize client +client = MgmtClient() + +# Create new API key +response = client.api_keys.create_new_api_key( + api_key_name="my-application-key", + cust_app="my-customer-app", + auth_code="your_auth_code", + created_by="user@example.com", + cust_env="production", + cust_cloud_provider="AWS", + rotation_time_interval=3, + rotation_time_unit="months", + revoked=False, + dp_name="my-deployment-profile", # Optional + cust_ai_agent_framework="langchain" # Optional +) + +print(f"API Key ID: {response}") +``` + +**Parameters:** +- `api_key_name` (str, required): Name of the API key +- `cust_app` (str, required): Customer application identifier +- `auth_code` (str, required): Authorization code +- `created_by` (str, required): Email of user creating the key +- `cust_env` (str, required): Environment (e.g., "production", "staging") +- `cust_cloud_provider` (str, required): Cloud provider (e.g., "AWS", "Azure", "GCP") +- `rotation_time_interval` (int, required): Rotation interval value +- `rotation_time_unit` (str, required): Rotation unit ("days", "months", "years") +- `revoked` (bool, optional): Revocation status (default: False) +- `dp_name` (str, optional): Deployment profile name +- `cust_ai_agent_framework` (str, optional): AI agent framework name + +### Retrieve API Keys (with pagination) + +Retrieve all API keys. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Retrieve API keys with pagination +api_keys_response = client.api_keys.get_all_api_keys(offset=0, limit=25) + +print(f"API Keys Response: {api_keys_response}") +``` + +**Parameters:** +- `offset` (int, optional): Starting position for pagination (default: 0) +- `limit` (int, optional): Maximum number of keys to retrieve (default: 100) + +### Regenerate API Key + +Regenerate an existing API key with new rotation settings. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Regenerate API key +regenerate_response = client.api_keys.regenerate_api_key( + api_key_id="your_api_key_uuid", + rotation_time_interval=6, + rotation_time_unit="months", + updated_by="user@example.com" +) + +print(f"New API Key Secret: {regenerate_response}") +``` + +**Parameters:** +- `api_key_id` (str, required): UUID of the API key to regenerate +- `rotation_time_interval` (int, required): New rotation interval value +- `rotation_time_unit` (str, required): New rotation unit ("days", "months", "years") +- `updated_by` (str, optional): Email of user performing the regeneration + +### Delete API Key + +Delete an API key by its name. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Delete API key +delete_response = client.api_keys.delete_api_key( + api_key_name="my-application-key", + updated_by="user@example.com" +) + +print(f"Deletion response: {delete_response}") +``` + +**Parameters:** +- `api_key_name` (str, required): Name of the API key to delete +- `updated_by` (str, required): Email of user performing the deletion + +## AI Security Profiles Management + +API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/ + +### Create New AI Security Profile + +Create a new AI security profile with comprehensive policy configuration. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Define AI security profile policy +policy = { + "dlp-data-profiles": [], + "ai-security-profiles": [ + { + "model-type": "default", + "model-configuration": { + "latency": { + "inline-timeout-action": "block", + "max-inline-latency": 20 + }, + "data-protection": { + "data-leak-detection": { + "member": [ + {"text": "Sensitive Content", "id": "", "version": "2"} + ], + "action": "block" + } + }, + "app-protection": { + "default-url-category": {"member": ["malicious"]}, + "url-detected-action": "allow" + }, + "model-protection": [ + {"name": "prompt-injection", "action": "allow"}, + {"name": "jailbreak", "action": "block"} + ] + } + } + ] +} + +# Create new AI security profile +create_response = client.ai_sec_profiles.create_new_ai_profile( + profile_name="production-security-profile", + revision=1, + policy=policy, + created_by="user@example.com" +) + +print(f"Profile ID: {create_response}") +``` + +**Parameters:** +- `profile_name` (str, required): Name of the AI security profile +- `revision` (int, required): Revision number +- `policy` (dict, required): Policy configuration object +- `profile_id` (str, optional): Custom profile UUID +- `created_by` (str, optional): Email of user creating the profile +- `updated_by` (str, optional): Email of user updating the profile +- `last_modified_ts` (datetime, optional): Last modification timestamp + +### Retrieve AI Security Profiles (with pagination) + +Retrieve all AI security profiles with pagination support. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Retrieve AI security profiles +profiles_response = client.ai_sec_profiles.get_all_ai_profiles(offset=0, limit=25) + +print(f"AI Security Profiles Response: {profiles_response}") +``` + +**Parameters:** +- `offset` (int, optional): Starting position for pagination (default: 0) +- `limit` (int, optional): Maximum number of profiles to retrieve (default: 100) + +### Update AI Security Profile + +Update an existing AI security profile by its ID. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Updated policy +updated_policy = { + "dlp-data-profiles": [], + "ai-security-profiles": [ + { + "model-type": "default", + "model-configuration": { + "latency": { + "inline-timeout-action": "allow", + "max-inline-latency": 30 + } + } + } + ] +} + +# Update AI security profile +update_response = client.ai_sec_profiles.update_ai_profile( + profile_id="your_profile_uuid", + profile_name="production-security-profile-v2", + revision=2, + policy=updated_policy, + updated_by="user@example.com" +) + +print(f"Updated Profile: {update_response}") +``` + +**Parameters:** +- `profile_id` (str, required): UUID of the profile to update +- `profile_name` (str, required): Updated profile name +- `revision` (int, required): New revision number +- `policy` (dict, required): Updated policy configuration +- `created_by` (str, optional): Original creator email +- `updated_by` (str, optional): Email of user updating the profile +- `last_modified_ts` (datetime, optional): Last modification timestamp + +### Delete AI Security Profile + +Delete an AI security profile by its ID. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Delete AI security profile +delete_response = client.ai_sec_profiles.delete_ai_profile( + profile_id="your_profile_uuid" +) + +print(f"Deletion response: {delete_response}") +``` + +**Parameters:** +- `profile_id` (str, required): UUID of the profile to delete + +### Force Delete AI Security Profile + +Force delete an AI security profile, bypassing validation checks. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Force delete AI security profile +force_delete_response = client.ai_sec_profiles.force_delete_ai_profile( + profile_id="your_profile_uuid", + updated_by="user@example.com" +) + +print(f"Force deletion response: {force_delete_response}") +``` + +**Parameters:** +- `profile_id` (str, required): UUID of the profile to force delete +- `updated_by` (str, required): Email of user performing the deletion + +## Custom Topics Management + +API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/ + +### Create New Custom Topic + +Create a new custom topic for data classification. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Create custom topic +create_response = client.custom_topics.create_new_custom_topic( + topic_name="financial-data", + description="Detection of financial and banking information", + examples=[ + "Credit card numbers", + "Bank account details", + "Social security numbers", + "Tax identification numbers" + ], + revision=1, + created_by="user@example.com" +) + +print(f"Topic ID: {create_response}") +``` + +**Parameters:** +- `topic_name` (str, required): Name of the custom topic +- `description` (str, required): Detailed explanation of the topic +- `examples` (list[str], required): List of example usages +- `revision` (int, required): Revision number +- `topic_id` (str, optional): Custom topic UUID +- `created_by` (str, optional): Email of user creating the topic +- `updated_by` (str, optional): Email of user updating the topic +- `last_modified_ts` (datetime, optional): Last modification timestamp +- `created_ts` (datetime, optional): Creation timestamp + +### Retrieve All Custom Topics (with pagination) + +Retrieve all custom topics with pagination support. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Retrieve all custom topics +topics_response = client.custom_topics.get_all_custom_topics( + offset=0, + limit=50 +) + +print(f"Custom Topics Response: {topics_response}") +``` + +**Parameters:** +- `offset` (int, optional): Starting position for pagination (default: 0) +- `limit` (int, optional): Maximum number of topics to retrieve (default: 100) + +### Modify Custom Topic Details + +Modify an existing custom topic with updated details. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Modify custom topic +modify_response = client.custom_topics.modify_custom_topic_details( + topic_id="your_topic_uuid", + topic_name="financial-data-updated", + description="Updated detection of financial and personal information", + examples=[ + "Credit card numbers", + "Bank account details", + "Social security numbers", + "Tax identification numbers", + "IBAN numbers" + ], + revision=2, + updated_by="user@example.com" +) + +print(f"Modified Topic: {modify_response}") +``` + +**Parameters:** +- `topic_id` (str, required): UUID of the topic to modify +- `topic_name` (str, required): Updated topic name +- `description` (str, required): Updated description +- `examples` (list[str], required): Updated list of examples +- `revision` (int, required): New revision number +- `created_by` (str, optional): Original creator email +- `updated_by` (str, optional): Email of user modifying the topic +- `last_modified_ts` (datetime, optional): Last modification timestamp +- `created_ts` (datetime, optional): Creation timestamp + +### Delete Custom Topic + +Delete a custom topic by its ID. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Delete custom topic +delete_response = client.custom_topics.delete_custom_topic( + topic_id="your_topic_uuid" +) + +print(f"Deletion response: {delete_response}") +``` + +**Parameters:** +- `topic_id` (str, required): UUID of the topic to delete + +### Force Delete Custom Topic + +Force delete a custom topic, bypassing validation checks. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Force delete custom topic +force_delete_response = client.custom_topics.force_delete_custom_topic( + topic_id="your_topic_uuid", + updated_by="user@example.com" +) + +print(f"Force deletion response: {force_delete_response}") +``` + +**Parameters:** +- `topic_id` (str, required): UUID of the topic to force delete +- `updated_by` (str, required): Email of user performing the deletion + +## Customer Applications Management + +API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/ + +### Retrieve All Customer Applications (with pagination) + +Retrieve all customer applications with pagination support. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Retrieve all customer applications +apps_response = client.customer_apps.get_all_customer_apps( + offset=0, + limit=25 +) + +print(f"Customer Applications Response: {apps_response}") +``` + +**Parameters:** +- `offset` (int, optional): Starting position for pagination (default: 0) +- `limit` (int, optional): Maximum number of apps to retrieve (default: 100) + +### Update Customer Application + +Update a customer application with new settings. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Update customer application +update_response = client.customer_apps.update_customer_app( + customer_app_id="your_app_uuid", + app_name="my-updated-application", + cloud_provider="AWS", + environment="production", + model_name="gpt-4", # Optional + status="completed", # Optional + updated_by="user@example.com", # Optional + ai_agent_framework="langchain" # Optional +) + +print(f"Updated App: {update_response}") +``` + +**Parameters:** +- `customer_app_id` (str, required): UUID of the customer application +- `app_name` (str, required): Updated application name +- `cloud_provider` (str, required): Cloud provider ("AWS", "Azure", "GCP") +- `environment` (str, required): Environment ("production", "staging", "development") +- `model_name` (str, optional): AI model name +- `status` (str, optional): Application status ("completed", "pending") +- `updated_by` (str, optional): Email of user updating the app +- `ai_agent_framework` (str, optional): AI agent framework name + +### Delete Customer Application + +Delete a customer application by its name. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Delete customer application +delete_response = client.customer_apps.delete_customer_app( + app_name="my-application", + updated_by="user@example.com" +) + +print(f"Deletion response: {delete_response}") +``` + +**Parameters:** +- `app_name` (str, required): Name of the application to delete +- `updated_by` (str, required): Email of user performing the deletion + +## DLP Profiles Management + +API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/ + +### Retrieve All DLP Profiles + +Retrieve all DLP (Data Loss Prevention) profiles. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Retrieve all DLP profiles +dlp_profiles = client.dlp_profiles.get_all_dlp_profiles() + +print(f"DLP Profiles: {dlp_profiles}") +``` + +**Parameters:** None + +## Deployment Profiles Management + +API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/ + +### Retrieve All Deployment Profiles + +Retrieve all deployment profiles. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Retrieve all deployment profiles +deployment_profiles = client.deployment_profiles.get_all_deployment_profiles() + +print(f"Deployment Profiles: {deployment_profiles}") +``` + +**Parameters:** +- `unactivated` (bool, optional): Get only unactivated deployment profiles (default: None) + +### Retrieve Unactivated Deployment Profiles + +Retrieve only unactivated deployment profiles (includes available and previously activated profiles without associated apps or API keys). + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Retrieve only unactivated deployment profiles +unactivated_profiles = client.deployment_profiles.get_all_deployment_profiles( + unactivated=True +) + +print(f"Unactivated Deployment Profiles: {unactivated_profiles}") +``` + +**Parameters:** +- `unactivated` (bool, required): Set to True to retrieve only unactivated profiles + +## OAuth Token Management + +API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/ + +### Generate OAuth2 Token + +Generate an OAuth2 access token for an Apigee application. + +**Synchronous Example:** + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Generate OAuth2 token for an Apigee application +oauth_response = client.oauth.get_oauth_token( + client_id="your_apigee_client_id", + customer_app="my-customer-app", + token_ttl_interval=24, + token_ttl_unit="hours" +) + +print(f"OAuth Token: {oauth_response}") +``` + +**Parameters:** +- `client_id` (str, required): Client ID for the OAuth application +- `customer_app` (str, required): Customer application name +- `token_ttl_interval` (int, required): Time-to-live interval for the token +- `token_ttl_unit` (str, required): Time unit ("seconds", "minutes", "hours", "days") + +## Available Resources + +The SDK provides access to the following resources through the `MgmtClient`: + +| Resource | Access Method | Description | +|----------|---------------|-------------| +| **API Keys** | `client.api_keys` | Create, retrieve, regenerate, and delete API keys | +| **AI Security Profiles** | `client.ai_sec_profiles` | Manage AI security profiles and policies | +| **Custom Topics** | `client.custom_topics` | Create and manage custom security topics | +| **Customer Applications** | `client.customer_apps` | Manage customer applications | +| **DLP Profiles** | `client.dlp_profiles` | Retrieve DLP (Data Loss Prevention) profiles | +| **Deployment Profiles** | `client.deployment_profiles` | Retrieve deployment configurations | +| **OAuth Tokens** | `client.oauth` | Generate OAuth2 tokens for applications | + +All resources provide: +- Automatic OAuth2 token management with refresh +- Exponential backoff retry logic (1s, 2s, 4s, 8s...) +- Type-safe request/response models +- Comprehensive error handling + +## API Coverage + +### API Keys Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Create API Key | `create_new_api_key()` | `POST /v1/mgmt/api-key` | +| Retrieve API Keys | `get_all_api_keys()` | `GET /v1/mgmt/api-key` | +| Regenerate API Key | `regenerate_api_key()` | `POST /v1/mgmt/api-key/{apiKeyId}/regenerate` | +| Delete API Key | `delete_api_key()` | `DELETE /v1/mgmt/api-key` | + +### AI Security Profiles Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Create AI Profile | `create_new_ai_profile()` | `POST /v1/mgmt/ai-sec-profile` | +| Retrieve AI Profiles | `get_all_ai_profiles()` | `GET /v1/mgmt/ai-sec-profile` | +| Update AI Profile | `update_ai_profile()` | `PUT /v1/mgmt/ai-sec-profile/{profileId}` | +| Delete AI Profile | `delete_ai_profile()` | `DELETE /v1/mgmt/ai-sec-profile/{profileId}` | +| Force Delete AI Profile | `force_delete_ai_profile()` | `DELETE /v1/mgmt/ai-sec-profile/{profileId}/force` | + +### Custom Topics Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Create Custom Topic | `create_new_custom_topic()` | `POST /v1/mgmt/custom-topic` | +| Retrieve Custom Topics | `get_all_custom_topics()` | `GET /v1/mgmt/custom-topic` | +| Modify Custom Topic | `modify_custom_topic_details()` | `PUT /v1/mgmt/custom-topic/{topicId}` | +| Delete Custom Topic | `delete_custom_topic()` | `DELETE /v1/mgmt/custom-topic/{topicId}` | +| Force Delete Custom Topic | `force_delete_custom_topic()` | `DELETE /v1/mgmt/custom-topic/{topicId}/force` | + +### Customer Applications Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Retrieve Customer Apps | `get_all_customer_apps()` | `GET /v1/mgmt/customer-app` | +| Update Customer App | `update_customer_app()` | `PUT /v1/mgmt/customer-app/{customerAppId}` | +| Delete Customer App | `delete_customer_app()` | `DELETE /v1/mgmt/customer-app` | + +### DLP Profiles Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Retrieve DLP Profiles | `get_all_dlp_profiles()` | `GET /v1/mgmt/dlp-profile` | + +### Deployment Profiles Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Retrieve Deployment Profiles | `get_all_deployment_profiles()` | `GET /v1/mgmt/deployment-profile` | + +### OAuth Token Management +| Operation | Method | API Endpoint | +|-----------|--------|--------------| +| Generate OAuth Token | `get_oauth_token()` | `POST /v1/oauth/token` | diff --git a/products/prisma-airs/sidebars.ts b/products/prisma-airs/sidebars.ts index a514023af..ffb5146a9 100644 --- a/products/prisma-airs/sidebars.ts +++ b/products/prisma-airs/sidebars.ts @@ -41,7 +41,7 @@ module.exports = { // SDKs (implementation details) { - label: "Python SDK", + label: "AI Runtime Security Python SDK", type: "category", collapsed: false, items: [ @@ -59,5 +59,26 @@ module.exports = { }, ], }, + + // SDKs (implementation details) + { + label: "Management API Python SDK", + type: "category", + collapsed: false, + items: [ + { + type: "doc", + id: "prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk", + }, + { + type: "doc", + id: "prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk", + }, + { + type: "doc", + id: "prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk", + }, + ], + }, ], }; From f4d78f4c82b5356613547684b6212cbe94ee9552 Mon Sep 17 00:00:00 2001 From: sra Date: Wed, 15 Apr 2026 12:26:24 +0530 Subject: [PATCH 3/8] Added Async and Sync AI Security Management --- .../management/mgmt-python-asynciosdk.md | 660 +++++++++++++++++- .../management/mgmt-python-inlinesdk.md | 621 +++++++++++++++- 2 files changed, 1241 insertions(+), 40 deletions(-) diff --git a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md index 693496c6e..bca752671 100644 --- a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md +++ b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md @@ -171,26 +171,6 @@ async def fetch_all_resources(): asyncio.run(fetch_all_resources()) ``` -## Available Resources - -The SDK provides access to the following resources through the `MgmtClientAsync`: - -| Resource | Access Method | Description | -|----------|---------------|-------------| -| **API Keys** | `client.api_keys` | Create, retrieve, regenerate, and delete API keys | -| **AI Security Profiles** | `client.ai_sec_profiles` | Manage AI security profiles and policies | -| **Custom Topics** | `client.custom_topics` | Create and manage custom security topics | -| **Customer Applications** | `client.customer_apps` | Manage customer applications | -| **DLP Profiles** | `client.dlp_profiles` | Retrieve DLP (Data Loss Prevention) profiles | -| **Deployment Profiles** | `client.deployment_profiles` | Retrieve deployment configurations | -| **OAuth Tokens** | `client.oauth` | Generate OAuth2 tokens for applications | - -All resources provide: -- Automatic OAuth2 token management with refresh -- Exponential backoff retry logic (1s, 2s, 4s, 8s...) -- Type-safe request/response models -- Comprehensive error handling - ## API Coverage ### API Keys Management @@ -240,3 +220,643 @@ All resources provide: | Operation | Method | API Endpoint | |-----------|--------|--------------| | Generate OAuth Token | `get_oauth_token()` | `POST /v1/oauth/token` | + +## AI Security Profiles Management + +API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) + +### Create New AI Security Profile + +Create a new AI security profile with comprehensive policy configuration. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def create_ai_profile(): + async with MgmtClientAsync() as client: + # Define AI security profile policy (using dictionary format) + policy = { + "dlp-data-profiles": [], + "ai-security-profiles": [ + { + "model-type": "default", + "model-configuration": { + "latency": { + "inline-timeout-action": "block", + "max-inline-latency": 20 + }, + "data-protection": { + "data-leak-detection": { + "member": [ + {"text": "Sensitive Content", "id": "", "version": "2"} + ], + "action": "block" + } + }, + "app-protection": { + "default-url-category": {"member": ["malicious"]}, + "url-detected-action": "allow" + }, + "model-protection": [ + {"name": "prompt-injection", "action": "allow"}, + {"name": "jailbreak", "action": "block"} + ] + } + } + ] + } + + # Alternatively, create policy using SDK model objects (typed approach) + from airs_api_mgmt.sdk.models import ( + AIProfileObjectPolicy, + AiSecurityProfileObject, + AiSecurityProfileObjectModelConfiguration, + LatencyObject, + DataProtectionObject, + DataProtectionObjectDataLeakDetection, + DataProtectionObjectDataLeakDetectionMemberInner, + AppProtectionObject, + AppProtectionObjectDefaultUrlCategory, + ModelProtectionObjectInner + ) + + policy_typed = AIProfileObjectPolicy( + dlp_data_profiles=[], + ai_security_profiles=[ + AiSecurityProfileObject( + model_type="default", + content_type="text", + model_configuration=AiSecurityProfileObjectModelConfiguration( + latency=LatencyObject( + inline_timeout_action="block", + max_inline_latency=20 + ), + data_protection=DataProtectionObject( + data_leak_detection=DataProtectionObjectDataLeakDetection( + member=[ + DataProtectionObjectDataLeakDetectionMemberInner( + text="Sensitive Content", + id="", + version="2" + ) + ], + action="block" + ) + ), + app_protection=AppProtectionObject( + default_url_category=AppProtectionObjectDefaultUrlCategory( + member=["malicious"] + ), + url_detected_action="allow" + ), + model_protection=[ + ModelProtectionObjectInner(name="prompt-injection", action="allow"), + ModelProtectionObjectInner(name="jailbreak", action="block") + ] + ) + ) + ] + ) + + # Create new AI security profile (works with both dictionary or typed policy) + create_response = await client.ai_sec_profiles.create_new_ai_profile( + profile_name="production-security-profile", + revision=1, + policy=policy, # or use policy_typed for typed approach + created_by="user@example.com" + ) + + print(f"Profile ID: {create_response}") + +asyncio.run(create_ai_profile()) +``` + +Parameters: + +* `profile_name` (str, required): Name of the AI security profile +* `revision` (int, required): Revision number +* `policy` (dict | AIProfileObjectPolicy, required): Policy configuration object (can be dict or typed model object) +* `profile_id` (str, optional): Custom profile UUID +* `created_by` (str, optional): Email of user creating the profile +* `updated_by` (str, optional): Email of user updating the profile +* `last_modified_ts` (datetime, optional): Last modification timestamp + +### Retrieve AI Security Profiles (with pagination) + +Retrieve all AI security profiles with pagination support. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def get_all_ai_profiles(): + async with MgmtClientAsync() as client: + profiles_response = await client.ai_sec_profiles.get_all_ai_profiles(offset=0, limit=25) + + print(f"AI Security Profiles Response: {profiles_response}") + +asyncio.run(get_all_ai_profiles()) +``` + +Parameters: + +* `offset` (int, optional): Starting position for pagination (default: 0) +* `limit` (int, optional): Maximum number of profiles to retrieve (default: 100) + +### Update AI Security Profile + +Update an existing AI security profile by its ID. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def update_ai_profile(): + async with MgmtClientAsync() as client: + updated_policy = { + "dlp-data-profiles": [], + "ai-security-profiles": [ + { + "model-type": "default", + "model-configuration": { + "latency": { + "inline-timeout-action": "allow", + "max-inline-latency": 30 + }, + "data-protection": { + "data-leak-detection": { + "member": [ + {"text": "PII Data", "id": "", "version": "2"} + ], + "action": "block" + } + } + } + } + ] + } + + update_response = await client.ai_sec_profiles.update_ai_profile( + profile_id="your_profile_uuid", + profile_name="production-security-profile-v2", + revision=2, + policy=updated_policy, + updated_by="user@example.com" + ) + + print(f"Updated Profile: {update_response.profile_name}") + print(f"New Revision: {update_response.revision}") + +asyncio.run(update_ai_profile()) +``` + +Parameters: + +* `profile_id` (str, required): UUID of the profile to update +* `profile_name` (str, required): Updated profile name +* `revision` (int, required): New revision number +* `policy` (dict, required): Updated policy configuration +* `created_by` (str, optional): Original creator email +* `updated_by` (str, optional): Email of user updating the profile +* `last_modified_ts` (datetime, optional): Last modification timestamp + +### Delete AI Security Profile + +Delete an AI security profile by its ID. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def delete_ai_profile(): + async with MgmtClientAsync() as client: + delete_response = await client.ai_sec_profiles.delete_ai_profile( + profile_id="your_profile_uuid" + ) + + print(f"Deletion response: {delete_response}") + +asyncio.run(delete_ai_profile()) +``` + +Parameters: + +* `profile_id` (str, required): UUID of the profile to delete + +### Force Delete AI Security Profile + +Force delete an AI security profile, bypassing validation checks. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def force_delete_ai_profile(): + async with MgmtClientAsync() as client: + force_delete_response = await client.ai_sec_profiles.force_delete_ai_profile( + profile_id="your_profile_uuid", + updated_by="user@example.com" + ) + + print(f"Force deletion response: {force_delete_response}") + +asyncio.run(force_delete_ai_profile()) +``` + +Parameters: + +* `profile_id` (str, required): UUID of the profile to force delete +* `updated_by` (str, required): Email of user performing the deletion + +## Custom Topics Management + +API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) + +### Create New Custom Topic + +Create a new custom topic for data classification. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def create_custom_topic(): + async with MgmtClientAsync() as client: + create_response = await client.custom_topics.create_new_custom_topic( + topic_name="financial-data", + description="Detection of financial and banking information", + examples=[ + "Credit card numbers", + "Bank account details", + "Social security numbers", + "Tax identification numbers" + ], + revision=1, + created_by="user@example.com" + ) + + print(f"Topic ID: {create_response}") + +asyncio.run(create_custom_topic()) +``` + +Parameters: + +* `topic_name` (str, required): Name of the custom topic +* `description` (str, required): Detailed explanation of the topic +* `examples` (list[str], required): List of example usages +* `revision` (int, required): Revision number +* `topic_id` (str, optional): Custom topic UUID +* `created_by` (str, optional): Email of user creating the topic +* `updated_by` (str, optional): Email of user updating the topic +* `last_modified_ts` (datetime, optional): Last modification timestamp +* `created_ts` (datetime, optional): Creation timestamp + +### Retrieve All Custom Topics (with pagination) + +Retrieve all custom topics with pagination support. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def retrieve_custom_topics(): + async with MgmtClientAsync() as client: + topics_response = await client.custom_topics.get_all_custom_topics( + offset=0, + limit=50 + ) + + print(f"Custom Topics Response: {topics_response}") + +asyncio.run(retrieve_custom_topics()) +``` + +Parameters: + +* `offset` (int, optional): Starting position for pagination (default: 0) +* `limit` (int, optional): Maximum number of topics to retrieve (default: 100) + +### Modify Custom Topic Details + +Modify an existing custom topic with updated details. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def modify_custom_topic(): + async with MgmtClientAsync() as client: + modify_response = await client.custom_topics.modify_custom_topic_details( + topic_id="your_topic_uuid", + topic_name="financial-data-updated", + description="Updated detection of financial and personal information", + examples=[ + "Credit card numbers", + "Bank account details", + "Social security numbers", + "Tax identification numbers", + "IBAN numbers" + ], + revision=2, + updated_by="user@example.com" + ) + + print(f"Modified Topic: {modify_response}") + +asyncio.run(modify_custom_topic()) +``` + +Parameters: + +* `topic_id` (str, required): UUID of the topic to modify +* `topic_name` (str, required): Updated topic name +* `description` (str, required): Updated description +* `examples` (list[str], required): Updated list of examples +* `revision` (int, required): New revision number +* `created_by` (str, optional): Original creator email +* `updated_by` (str, optional): Email of user modifying the topic +* `last_modified_ts` (datetime, optional): Last modification timestamp +* `created_ts` (datetime, optional): Creation timestamp + +### Delete Custom Topic + +Delete a custom topic by its ID. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def delete_custom_topic(): + async with MgmtClientAsync() as client: + delete_response = await client.custom_topics.delete_custom_topic( + topic_id="your_topic_uuid" + ) + + print(f"Deletion response: {delete_response}") + +asyncio.run(delete_custom_topic()) +``` + +Parameters: + +* `topic_id` (str, required): UUID of the topic to delete + +### Force Delete Custom Topic + +Force delete a custom topic, bypassing validation checks. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def force_delete_custom_topic(): + async with MgmtClientAsync() as client: + force_delete_response = await client.custom_topics.force_delete_custom_topic( + topic_id="your_topic_uuid", + updated_by="user@example.com" + ) + + print(f"Force deletion response: {force_delete_response}") + +asyncio.run(force_delete_custom_topic()) +``` + +Parameters: + +* `topic_id` (str, required): UUID of the topic to force delete +* `updated_by` (str, required): Email of user performing the deletion + +## Customer Applications Management + +API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) + +### Retrieve All Customer Applications (with pagination) + +Retrieve all customer applications with pagination support. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def retrieve_customer_apps(): + async with MgmtClientAsync() as client: + apps_response = await client.customer_apps.get_all_customer_apps( + offset=0, + limit=25 + ) + + print(f"Customer Applications Response: {apps_response}") + +asyncio.run(retrieve_customer_apps()) +``` + +Parameters: + +* `offset` (int, optional): Starting position for pagination (default: 0) +* `limit` (int, optional): Maximum number of apps to retrieve (default: 100) + +### Update Customer Application + +Update a customer application with new settings. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def update_customer_app(): + async with MgmtClientAsync() as client: + update_response = await client.customer_apps.update_customer_app( + customer_app_id="your_app_uuid", + app_name="my-updated-application", + cloud_provider="AWS", + environment="production", + model_name="gpt-4", + status="completed", + updated_by="user@example.com", + ai_agent_framework="langchain" + ) + + print(f"Updated App: {update_response}") + +asyncio.run(update_customer_app()) +``` + +Parameters: + +* `customer_app_id` (str, required): UUID of the customer application +* `app_name` (str, required): Updated application name +* `cloud_provider` (str, required): Cloud provider ("AWS", "Azure", "GCP") +* `environment` (str, required): Environment ("production", "staging", "development") +* `model_name` (str, optional): AI model name +* `status` (str, optional): Application status ("completed", "pending") +* `updated_by` (str, optional): Email of user updating the app +* `ai_agent_framework` (str, optional): AI agent framework name + +### Delete Customer Application + +Delete a customer application by its name. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def delete_customer_app(): + async with MgmtClientAsync() as client: + delete_response = await client.customer_apps.delete_customer_app( + app_name="my-application", + updated_by="user@example.com" + ) + + print(f"Deletion response: {delete_response}") + +asyncio.run(delete_customer_app()) +``` + +Parameters: + +* `app_name` (str, required): Name of the application to delete +* `updated_by` (str, required): Email of user performing the deletion + +## DLP Profiles Management + +API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) + +### Retrieve All DLP Profiles + +Retrieve all DLP (Data Loss Prevention) profiles. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def retrieve_dlp_profiles(): + async with MgmtClientAsync() as client: + # Retrieve all DLP profiles + dlp_profiles = await client.dlp_profiles.get_all_dlp_profiles() + + print(f"DLP Profiles: {dlp_profiles}") + +asyncio.run(retrieve_dlp_profiles()) +``` + +Parameters: None + +## Deployment Profiles Management + +API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) + +### Retrieve All Deployment Profiles + +Retrieve all deployment profiles. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def retrieve_deployment_profiles(): + async with MgmtClientAsync() as client: + # Retrieve all deployment profiles + deployment_profiles = await client.deployment_profiles.get_all_deployment_profiles() + + print(f"Deployment Profiles: {deployment_profiles}") + +asyncio.run(retrieve_deployment_profiles()) +``` + +Parameters: + +* `unactivated` (bool, optional): Get only unactivated deployment profiles (default: None) + +### Retrieve Unactivated Deployment Profiles + +Retrieve only unactivated deployment profiles (includes available and previously activated profiles without associated apps or API keys). + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def retrieve_unactivated_profiles(): + async with MgmtClientAsync() as client: + # Retrieve only unactivated deployment profiles + unactivated_profiles = await client.deployment_profiles.get_all_deployment_profiles( + unactivated=True + ) + + print(f"Unactivated Deployment Profiles: {unactivated_profiles}") + +asyncio.run(retrieve_unactivated_profiles()) +``` + +Parameters: + +* `unactivated` (bool, required): Set to True to retrieve only unactivated profiles + +## OAuth Token Management + +API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) + +### Generate OAuth2 Token + +Generate an OAuth2 access token for an Apigee application. + +Asynchronous Example: + +```python +import asyncio +from airs_api_mgmt import MgmtClientAsync + +async def generate_oauth_token(): + async with MgmtClientAsync() as client: + # Generate OAuth2 token for an Apigee application + oauth_response = await client.oauth.get_oauth_token( + client_id="your_apigee_client_id", + customer_app="my-customer-app", + token_ttl_interval=24, + token_ttl_unit="hours" + ) + + print(f"OAuth Token: {oauth_response}") + +asyncio.run(generate_oauth_token()) +``` + +Parameters: + +* `client_id` (str, required): Client ID for the OAuth application +* `customer_app` (str, required): Customer application name +* `token_ttl_interval` (int, required): Time-to-live interval for the token +* `token_ttl_unit` (str, required): Time unit ("seconds", "minutes", "hours", "days") diff --git a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md index a3240edfa..b11317b50 100644 --- a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md +++ b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md @@ -659,26 +659,6 @@ print(f"OAuth Token: {oauth_response}") - `token_ttl_interval` (int, required): Time-to-live interval for the token - `token_ttl_unit` (str, required): Time unit ("seconds", "minutes", "hours", "days") -## Available Resources - -The SDK provides access to the following resources through the `MgmtClient`: - -| Resource | Access Method | Description | -|----------|---------------|-------------| -| **API Keys** | `client.api_keys` | Create, retrieve, regenerate, and delete API keys | -| **AI Security Profiles** | `client.ai_sec_profiles` | Manage AI security profiles and policies | -| **Custom Topics** | `client.custom_topics` | Create and manage custom security topics | -| **Customer Applications** | `client.customer_apps` | Manage customer applications | -| **DLP Profiles** | `client.dlp_profiles` | Retrieve DLP (Data Loss Prevention) profiles | -| **Deployment Profiles** | `client.deployment_profiles` | Retrieve deployment configurations | -| **OAuth Tokens** | `client.oauth` | Generate OAuth2 tokens for applications | - -All resources provide: -- Automatic OAuth2 token management with refresh -- Exponential backoff retry logic (1s, 2s, 4s, 8s...) -- Type-safe request/response models -- Comprehensive error handling - ## API Coverage ### API Keys Management @@ -728,3 +708,604 @@ All resources provide: | Operation | Method | API Endpoint | |-----------|--------|--------------| | Generate OAuth Token | `get_oauth_token()` | `POST /v1/oauth/token` | + +## AI Security Profiles Management + +API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) + +### Create New AI Security Profile + +Create a new AI security profile with comprehensive policy configuration. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Define AI security profile policy (using dictionary format) +policy = { + "dlp-data-profiles": [], + "ai-security-profiles": [ + { + "model-type": "default", + "model-configuration": { + "latency": { + "inline-timeout-action": "block", + "max-inline-latency": 20 + }, + "data-protection": { + "data-leak-detection": { + "member": [ + {"text": "Sensitive Content", "id": "", "version": "2"} + ], + "action": "block" + } + }, + "app-protection": { + "default-url-category": {"member": ["malicious"]}, + "url-detected-action": "allow" + }, + "model-protection": [ + {"name": "prompt-injection", "action": "allow"}, + {"name": "jailbreak", "action": "block"} + ] + } + } + ] +} + +# Alternatively, create policy using SDK model objects (typed approach) +from airs_api_mgmt.sdk.models import ( + AIProfileObjectPolicy, + AiSecurityProfileObject, + AiSecurityProfileObjectModelConfiguration, + LatencyObject, + DataProtectionObject, + DataProtectionObjectDataLeakDetection, + DataProtectionObjectDataLeakDetectionMemberInner, + AppProtectionObject, + AppProtectionObjectDefaultUrlCategory, + ModelProtectionObjectInner +) + +policy_typed = AIProfileObjectPolicy( + dlp_data_profiles=[], + ai_security_profiles=[ + AiSecurityProfileObject( + model_type="default", + content_type="text", + model_configuration=AiSecurityProfileObjectModelConfiguration( + latency=LatencyObject( + inline_timeout_action="block", + max_inline_latency=20 + ), + data_protection=DataProtectionObject( + data_leak_detection=DataProtectionObjectDataLeakDetection( + member=[ + DataProtectionObjectDataLeakDetectionMemberInner( + text="Sensitive Content", + id="", + version="2" + ) + ], + action="block" + ) + ), + app_protection=AppProtectionObject( + default_url_category=AppProtectionObjectDefaultUrlCategory( + member=["malicious"] + ), + url_detected_action="allow" + ), + model_protection=[ + ModelProtectionObjectInner(name="prompt-injection", action="allow"), + ModelProtectionObjectInner(name="jailbreak", action="block") + ] + ) + ) + ] +) + +# Create new AI security profile (works with both dictionary or typed policy) +create_response = client.ai_sec_profiles.create_new_ai_profile( + profile_name="production-security-profile", + revision=1, + policy=policy, # or use policy_typed for typed approach + created_by="user@example.com" +) + +print(f"Profile ID: {create_response}") +``` + +Parameters: + +* `profile_name` (str, required): Name of the AI security profile +* `revision` (int, required): Revision number +* `policy` (dict | AIProfileObjectPolicy, required): Policy configuration object (can be dict or typed model object) +* `profile_id` (str, optional): Custom profile UUID +* `created_by` (str, optional): Email of user creating the profile +* `updated_by` (str, optional): Email of user updating the profile +* `last_modified_ts` (datetime, optional): Last modification timestamp + +### Retrieve AI Security Profiles (with pagination) + +Retrieve all AI security profiles with pagination support. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Retrieve AI security profiles +profiles_response = client.ai_sec_profiles.get_all_ai_profiles(offset=0, limit=25) + +print(f"AI Security Profiles Response: {profiles_response}") +``` + +Parameters: + +* `offset` (int, optional): Starting position for pagination (default: 0) +* `limit` (int, optional): Maximum number of profiles to retrieve (default: 100) + +### Update AI Security Profile + +Update an existing AI security profile by its ID. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Updated policy +updated_policy = { + "dlp-data-profiles": [], + "ai-security-profiles": [ + { + "model-type": "default", + "model-configuration": { + "latency": { + "inline-timeout-action": "allow", + "max-inline-latency": 30 + }, + "data-protection": { + "data-leak-detection": { + "member": [ + {"text": "PII Data", "id": "", "version": "2"} + ], + "action": "block" + } + } + } + } + ] +} + +# Update AI security profile +update_response = client.ai_sec_profiles.update_ai_profile( + profile_id="your_profile_uuid", + profile_name="production-security-profile-v2", + revision=2, + policy=updated_policy, + updated_by="user@example.com" +) + +print(f"Updated Profile: {update_response}") +``` + +Parameters: + +* `profile_id` (str, required): UUID of the profile to update +* `profile_name` (str, required): Updated profile name +* `revision` (int, required): New revision number +* `policy` (dict, required): Updated policy configuration +* `created_by` (str, optional): Original creator email +* `updated_by` (str, optional): Email of user updating the profile +* `last_modified_ts` (datetime, optional): Last modification timestamp + +### Delete AI Security Profile + +Delete an AI security profile by its ID. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Delete AI security profile +delete_response = client.ai_sec_profiles.delete_ai_profile( + profile_id="your_profile_uuid" +) + +print(f"Deletion response: {delete_response}") +``` + +Parameters: + +* `profile_id` (str, required): UUID of the profile to delete + +### Force Delete AI Security Profile + +Force delete an AI security profile, bypassing validation checks. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Force delete AI security profile +force_delete_response = client.ai_sec_profiles.force_delete_ai_profile( + profile_id="your_profile_uuid", + updated_by="user@example.com" +) + +print(f"Force deletion response: {force_delete_response}") +``` + +Parameters: + +* `profile_id` (str, required): UUID of the profile to force delete +* `updated_by` (str, required): Email of user performing the deletion + +## Custom Topics Management + +API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) + +### Create New Custom Topic + +Create a new custom topic for data classification. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Create custom topic +create_response = client.custom_topics.create_new_custom_topic( + topic_name="financial-data", + description="Detection of financial and banking information", + examples=[ + "Credit card numbers", + "Bank account details", + "Social security numbers", + "Tax identification numbers" + ], + revision=1, + created_by="user@example.com" +) + +print(f"Topic ID: {create_response}") +``` + +Parameters: + +* `topic_name` (str, required): Name of the custom topic +* `description` (str, required): Detailed explanation of the topic +* `examples` (list[str], required): List of example usages +* `revision` (int, required): Revision number +* `topic_id` (str, optional): Custom topic UUID +* `created_by` (str, optional): Email of user creating the topic +* `updated_by` (str, optional): Email of user updating the topic +* `last_modified_ts` (datetime, optional): Last modification timestamp +* `created_ts` (datetime, optional): Creation timestamp + +### Retrieve All Custom Topics (with pagination) + +Retrieve all custom topics with pagination support. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Retrieve all custom topics +topics_response = client.custom_topics.get_all_custom_topics( + offset=0, + limit=50 +) + +print(f"Custom Topics Response: {topics_response}") +``` + +Parameters: + +* `offset` (int, optional): Starting position for pagination (default: 0) +* `limit` (int, optional): Maximum number of topics to retrieve (default: 100) + +### Modify Custom Topic Details + +Modify an existing custom topic with updated details. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Modify custom topic +modify_response = client.custom_topics.modify_custom_topic_details( + topic_id="your_topic_uuid", + topic_name="financial-data-updated", + description="Updated detection of financial and personal information", + examples=[ + "Credit card numbers", + "Bank account details", + "Social security numbers", + "Tax identification numbers", + "IBAN numbers" + ], + revision=2, + updated_by="user@example.com" +) + +print(f"Modified Topic: {modify_response}") +``` + +Parameters: + +* `topic_id` (str, required): UUID of the topic to modify +* `topic_name` (str, required): Updated topic name +* `description` (str, required): Updated description +* `examples` (list[str], required): Updated list of examples +* `revision` (int, required): New revision number +* `created_by` (str, optional): Original creator email +* `updated_by` (str, optional): Email of user modifying the topic +* `last_modified_ts` (datetime, optional): Last modification timestamp +* `created_ts` (datetime, optional): Creation timestamp + +### Delete Custom Topic + +Delete a custom topic by its ID. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Delete custom topic +delete_response = client.custom_topics.delete_custom_topic( + topic_id="your_topic_uuid" +) + +print(f"Deletion response: {delete_response}") +``` + +Parameters: + +* `topic_id` (str, required): UUID of the topic to delete + +### Force Delete Custom Topic + +Force delete a custom topic, bypassing validation checks. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Force delete custom topic +force_delete_response = client.custom_topics.force_delete_custom_topic( + topic_id="your_topic_uuid", + updated_by="user@example.com" +) + +print(f"Force deletion response: {force_delete_response}") +``` + +Parameters: + +* `topic_id` (str, required): UUID of the topic to force delete +* `updated_by` (str, required): Email of user performing the deletion + +## Customer Applications Management + +API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) + +### Retrieve All Customer Applications (with pagination) + +Retrieve all customer applications with pagination support. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Retrieve all customer applications +apps_response = client.customer_apps.get_all_customer_apps( + offset=0, + limit=25 +) + +print(f"Customer Applications Response: {apps_response}") +``` + +Parameters: + +* `offset` (int, optional): Starting position for pagination (default: 0) +* `limit` (int, optional): Maximum number of apps to retrieve (default: 100) + +### Update Customer Application + +Update a customer application with new settings. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Update customer application +update_response = client.customer_apps.update_customer_app( + customer_app_id="your_app_uuid", + app_name="my-updated-application", + cloud_provider="AWS", + environment="production", + model_name="gpt-4", # Optional + status="completed", # Optional + updated_by="user@example.com", # Optional + ai_agent_framework="langchain" # Optional +) + +print(f"Updated App: {update_response}") +``` + +Parameters: + +* `customer_app_id` (str, required): UUID of the customer application +* `app_name` (str, required): Updated application name +* `cloud_provider` (str, required): Cloud provider ("AWS", "Azure", "GCP") +* `environment` (str, required): Environment ("production", "staging", "development") +* `model_name` (str, optional): AI model name +* `status` (str, optional): Application status ("completed", "pending") +* `updated_by` (str, optional): Email of user updating the app +* `ai_agent_framework` (str, optional): AI agent framework name + +### Delete Customer Application + +Delete a customer application by its name. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Delete customer application +delete_response = client.customer_apps.delete_customer_app( + app_name="my-application", + updated_by="user@example.com" +) + +print(f"Deletion response: {delete_response}") +``` + +Parameters: + +* `app_name` (str, required): Name of the application to delete +* `updated_by` (str, required): Email of user performing the deletion + +## DLP Profiles Management + +API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) + +### Retrieve All DLP Profiles + +Retrieve all DLP (Data Loss Prevention) profiles. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Retrieve all DLP profiles +dlp_profiles = client.dlp_profiles.get_all_dlp_profiles() + +print(f"DLP Profiles: {dlp_profiles}") +``` + +Parameters: None + +## Deployment Profiles Management + +API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) + +### Retrieve All Deployment Profiles + +Retrieve all deployment profiles. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Retrieve all deployment profiles +deployment_profiles = client.deployment_profiles.get_all_deployment_profiles() + +print(f"Deployment Profiles: {deployment_profiles}") +``` + +Parameters: + +* `unactivated` (bool, optional): Get only unactivated deployment profiles (default: None) + +### Retrieve Unactivated Deployment Profiles + +Retrieve only unactivated deployment profiles (includes available and previously activated profiles without associated apps or API keys). + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Retrieve only unactivated deployment profiles +unactivated_profiles = client.deployment_profiles.get_all_deployment_profiles( + unactivated=True +) + +print(f"Unactivated Deployment Profiles: {unactivated_profiles}") +``` + +Parameters: + +* `unactivated` (bool, required): Set to True to retrieve only unactivated profiles + +## OAuth Token Management + +API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) + +### Generate OAuth2 Token + +Generate an OAuth2 access token for an Apigee application. + +Synchronous Example: + +```python +from airs_api_mgmt import MgmtClient + +client = MgmtClient() + +# Generate OAuth2 token for an Apigee application +oauth_response = client.oauth.get_oauth_token( + client_id="your_apigee_client_id", + customer_app="my-customer-app", + token_ttl_interval=24, + token_ttl_unit="hours" +) + +print(f"OAuth Token: {oauth_response}") +``` + +Parameters: + +* `client_id` (str, required): Client ID for the OAuth application +* `customer_app` (str, required): Customer application name +* `token_ttl_interval` (int, required): Time-to-live interval for the token +* `token_ttl_unit` (str, required): Time unit ("seconds", "minutes", "hours", "days") From 31ccb14ba67ea2d4620dbe84850af518bcb37391 Mon Sep 17 00:00:00 2001 From: sra Date: Thu, 16 Apr 2026 22:14:27 +0530 Subject: [PATCH 4/8] Added all the respective endpoints links to the SDK files --- .../management/mgmt-python-asynciosdk.md | 92 ++++--------------- .../management/mgmt-python-inlinesdk.md | 90 ++++-------------- 2 files changed, 40 insertions(+), 142 deletions(-) diff --git a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md index bca752671..ae02f0b5a 100644 --- a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md +++ b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-asynciosdk.md @@ -16,11 +16,9 @@ This page covers the key use cases of the Prisma AIRS Management API Python SDK ## API Keys Management -API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/ - ### Create New API Key -Create a new API key for your customer application with specified rotation settings. + [Create a new API key](https://pan.dev/prisma-airs/api/airuntimesecurity/management/create-new-api-key/) for your customer application with specified rotation settings. **Asynchronous Example:** @@ -64,7 +62,7 @@ asyncio.run(create_api_key()) ### Retrieve API Keys (with pagination) -Retrieve all API keys. +[Retrieve all API keys.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-all-api-keys-for-tsg-id/) **Asynchronous Example:** @@ -87,7 +85,7 @@ asyncio.run(get_all_api_keys()) ### Regenerate API Key -Regenerate an existing API key with new rotation settings. +[Regenerate an existing API key with new rotation settings.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/regenerate-api-key-by-id/) **Asynchronous Example:** @@ -117,7 +115,7 @@ asyncio.run(regenerate_api_key()) ### Delete API Key -Delete an API key by its name. +[Delete an API key by its name.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/delete-api-key/) **Asynchronous Example:** @@ -171,63 +169,13 @@ async def fetch_all_resources(): asyncio.run(fetch_all_resources()) ``` -## API Coverage - -### API Keys Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Create API Key | `create_new_api_key()` | `POST /v1/mgmt/api-key` | -| Retrieve API Keys | `get_all_api_keys()` | `GET /v1/mgmt/api-key` | -| Regenerate API Key | `regenerate_api_key()` | `POST /v1/mgmt/api-key/{apiKeyId}/regenerate` | -| Delete API Key | `delete_api_key()` | `DELETE /v1/mgmt/api-key` | - -### AI Security Profiles Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Create AI Profile | `create_new_ai_profile()` | `POST /v1/mgmt/ai-sec-profile` | -| Retrieve AI Profiles | `get_all_ai_profiles()` | `GET /v1/mgmt/ai-sec-profile` | -| Update AI Profile | `update_ai_profile()` | `PUT /v1/mgmt/ai-sec-profile/{profileId}` | -| Delete AI Profile | `delete_ai_profile()` | `DELETE /v1/mgmt/ai-sec-profile/{profileId}` | -| Force Delete AI Profile | `force_delete_ai_profile()` | `DELETE /v1/mgmt/ai-sec-profile/{profileId}/force` | - -### Custom Topics Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Create Custom Topic | `create_new_custom_topic()` | `POST /v1/mgmt/custom-topic` | -| Retrieve Custom Topics | `get_all_custom_topics()` | `GET /v1/mgmt/custom-topic` | -| Modify Custom Topic | `modify_custom_topic_details()` | `PUT /v1/mgmt/custom-topic/{topicId}` | -| Delete Custom Topic | `delete_custom_topic()` | `DELETE /v1/mgmt/custom-topic/{topicId}` | -| Force Delete Custom Topic | `force_delete_custom_topic()` | `DELETE /v1/mgmt/custom-topic/{topicId}/force` | - -### Customer Applications Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Retrieve Customer Apps | `get_all_customer_apps()` | `GET /v1/mgmt/customer-app` | -| Update Customer App | `update_customer_app()` | `PUT /v1/mgmt/customer-app/{customerAppId}` | -| Delete Customer App | `delete_customer_app()` | `DELETE /v1/mgmt/customer-app` | - -### DLP Profiles Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Retrieve DLP Profiles | `get_all_dlp_profiles()` | `GET /v1/mgmt/dlp-profile` | - -### Deployment Profiles Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Retrieve Deployment Profiles | `get_all_deployment_profiles()` | `GET /v1/mgmt/deployment-profile` | - -### OAuth Token Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Generate OAuth Token | `get_oauth_token()` | `POST /v1/oauth/token` | - ## AI Security Profiles Management API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) ### Create New AI Security Profile -Create a new AI security profile with comprehensive policy configuration. +[Create a new AI security profile with comprehensive policy configuration.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/create-new-ai-profile/) Asynchronous Example: @@ -346,7 +294,7 @@ Parameters: ### Retrieve AI Security Profiles (with pagination) -Retrieve all AI security profiles with pagination support. +[Retrieve all AI security profiles with pagination support.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-all-ai-profiles-for-tsg-id/) Asynchronous Example: @@ -370,7 +318,7 @@ Parameters: ### Update AI Security Profile -Update an existing AI security profile by its ID. +[Update an existing AI security profile by its ID.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/update-profile-by-profile-id/) Asynchronous Example: @@ -429,7 +377,7 @@ Parameters: ### Delete AI Security Profile -Delete an AI security profile by its ID. +[Delete an AI security profile by its ID.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/delete-ai-profile/) Asynchronous Example: @@ -454,7 +402,7 @@ Parameters: ### Force Delete AI Security Profile -Force delete an AI security profile, bypassing validation checks. +[Force delete an AI security profile, bypassing validation checks.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/force-delete-ai-profile/) Asynchronous Example: @@ -485,7 +433,7 @@ API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmana ### Create New Custom Topic -Create a new custom topic for data classification. +[Create a new custom topic for data classification.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/create-new-custom-topic/) Asynchronous Example: @@ -527,7 +475,7 @@ Parameters: ### Retrieve All Custom Topics (with pagination) -Retrieve all custom topics with pagination support. +[Retrieve all custom topics with pagination support.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-all-custom-topics-for-tsg-id/) Asynchronous Example: @@ -554,7 +502,7 @@ Parameters: ### Modify Custom Topic Details -Modify an existing custom topic with updated details. +[Modify an existing custom topic with updated details.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/update-topic-by-topic-id/) Asynchronous Example: @@ -598,7 +546,7 @@ Parameters: ### Delete Custom Topic -Delete a custom topic by its ID. +[Delete a custom topic by its ID.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/delete-custom-topic/) Asynchronous Example: @@ -623,7 +571,7 @@ Parameters: ### Force Delete Custom Topic -Force delete a custom topic, bypassing validation checks. +[Force delete a custom topic, bypassing validation checks.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/force-delete-custom-topic/) Asynchronous Example: @@ -654,7 +602,7 @@ API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmana ### Retrieve All Customer Applications (with pagination) -Retrieve all customer applications with pagination support. +[Retrieve all customer applications with pagination support.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-all-customer-apps-for-tsg-id/) Asynchronous Example: @@ -681,7 +629,7 @@ Parameters: ### Update Customer Application -Update a customer application with new settings. +[Update a customer application with new settings.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/update-customer-app-by-id/) Asynchronous Example: @@ -720,7 +668,7 @@ Parameters: ### Delete Customer Application -Delete a customer application by its name. +[Delete a customer application by its name.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/delete-customer-app/) Asynchronous Example: @@ -751,7 +699,7 @@ API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmana ### Retrieve All DLP Profiles -Retrieve all DLP (Data Loss Prevention) profiles. +[Retrieve all DLP (Data Loss Prevention) profiles.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-all-dlp-profiles-by-tsg-id/) Asynchronous Example: @@ -777,7 +725,7 @@ API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmana ### Retrieve All Deployment Profiles -Retrieve all deployment profiles. +[Retrieve all deployment profiles.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-deployment-profiles-by-tsg-id/) Asynchronous Example: @@ -831,7 +779,7 @@ API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmana ### Generate OAuth2 Token -Generate an OAuth2 access token for an Apigee application. +[Generate an OAuth2 access token for an Apigee application.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-apigee-oauth-token/) Asynchronous Example: diff --git a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md index b11317b50..aac0ee5d3 100644 --- a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md +++ b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md @@ -20,7 +20,7 @@ API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanag ### Create New API Key -Create a new API key for your customer application with specified rotation settings. +[Create a new API key](https://pan.dev/prisma-airs/api/airuntimesecurity/management/create-new-api-key/) for your customer application with specified rotation settings. **Synchronous Example:** @@ -63,7 +63,7 @@ print(f"API Key ID: {response}") ### Retrieve API Keys (with pagination) -Retrieve all API keys. +[Retrieve all API keys.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-all-api-keys-for-tsg-id/) **Synchronous Example:** @@ -84,7 +84,7 @@ print(f"API Keys Response: {api_keys_response}") ### Regenerate API Key -Regenerate an existing API key with new rotation settings. +[Regenerate an existing API key with new rotation settings.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/regenerate-api-key-by-id/) **Synchronous Example:** @@ -112,7 +112,7 @@ print(f"New API Key Secret: {regenerate_response}") ### Delete API Key -Delete an API key by its name. +[Delete an API key by its name.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/delete-api-key/) **Synchronous Example:** @@ -140,7 +140,7 @@ API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanag ### Create New AI Security Profile -Create a new AI security profile with comprehensive policy configuration. +[Create a new AI security profile with comprehensive policy configuration.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/create-new-ai-profile/) **Synchronous Example:** @@ -203,7 +203,7 @@ print(f"Profile ID: {create_response}") ### Retrieve AI Security Profiles (with pagination) -Retrieve all AI security profiles with pagination support. +[Retrieve all AI security profiles with pagination support.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-all-ai-profiles-for-tsg-id/) **Synchronous Example:** @@ -224,7 +224,7 @@ print(f"AI Security Profiles Response: {profiles_response}") ### Update AI Security Profile -Update an existing AI security profile by its ID. +[Update an existing AI security profile by its ID.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/update-profile-by-profile-id/) **Synchronous Example:** @@ -272,7 +272,7 @@ print(f"Updated Profile: {update_response}") ### Delete AI Security Profile -Delete an AI security profile by its ID. +[Delete an AI security profile by its ID.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/delete-ai-profile/) **Synchronous Example:** @@ -294,7 +294,7 @@ print(f"Deletion response: {delete_response}") ### Force Delete AI Security Profile -Force delete an AI security profile, bypassing validation checks. +[Force delete an AI security profile, bypassing validation checks.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/force-delete-ai-profile/) **Synchronous Example:** @@ -322,7 +322,7 @@ API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanag ### Create New Custom Topic -Create a new custom topic for data classification. +[Create a new custom topic for data classification.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/create-new-custom-topic/) **Synchronous Example:** @@ -361,7 +361,7 @@ print(f"Topic ID: {create_response}") ### Retrieve All Custom Topics (with pagination) -Retrieve all custom topics with pagination support. +[Retrieve all custom topics with pagination support.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-all-custom-topics-for-tsg-id/) **Synchronous Example:** @@ -385,7 +385,7 @@ print(f"Custom Topics Response: {topics_response}") ### Modify Custom Topic Details -Modify an existing custom topic with updated details. +[Modify an existing custom topic with updated details.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/update-topic-by-topic-id/) **Synchronous Example:** @@ -426,7 +426,7 @@ print(f"Modified Topic: {modify_response}") ### Delete Custom Topic -Delete a custom topic by its ID. +[Delete a custom topic by its ID.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/delete-custom-topic/) **Synchronous Example:** @@ -448,7 +448,7 @@ print(f"Deletion response: {delete_response}") ### Force Delete Custom Topic -Force delete a custom topic, bypassing validation checks. +[Force delete a custom topic, bypassing validation checks.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/force-delete-custom-topic/) **Synchronous Example:** @@ -476,7 +476,7 @@ API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanag ### Retrieve All Customer Applications (with pagination) -Retrieve all customer applications with pagination support. +[Retrieve all customer applications with pagination support.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-all-customer-apps-for-tsg-id/) **Synchronous Example:** @@ -500,7 +500,7 @@ print(f"Customer Applications Response: {apps_response}") ### Update Customer Application -Update a customer application with new settings. +[Update a customer application with new settings.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/update-customer-app-by-id/) **Synchronous Example:** @@ -536,7 +536,7 @@ print(f"Updated App: {update_response}") ### Delete Customer Application -Delete a customer application by its name. +[Delete a customer application by its name.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/delete-customer-app/) **Synchronous Example:** @@ -564,7 +564,7 @@ API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanag ### Retrieve All DLP Profiles -Retrieve all DLP (Data Loss Prevention) profiles. +[Retrieve all DLP (Data Loss Prevention) profiles.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-all-dlp-profiles-by-tsg-id/) **Synchronous Example:** @@ -587,7 +587,7 @@ API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanag ### Retrieve All Deployment Profiles -Retrieve all deployment profiles. +[Retrieve all deployment profiles.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-deployment-profiles-by-tsg-id/) **Synchronous Example:** @@ -633,7 +633,7 @@ API Reference: https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanag ### Generate OAuth2 Token -Generate an OAuth2 access token for an Apigee application. +[Generate an OAuth2 access token for an Apigee application.](https://pan.dev/prisma-airs/api/airuntimesecurity/management/get-apigee-oauth-token/) **Synchronous Example:** @@ -659,56 +659,6 @@ print(f"OAuth Token: {oauth_response}") - `token_ttl_interval` (int, required): Time-to-live interval for the token - `token_ttl_unit` (str, required): Time unit ("seconds", "minutes", "hours", "days") -## API Coverage - -### API Keys Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Create API Key | `create_new_api_key()` | `POST /v1/mgmt/api-key` | -| Retrieve API Keys | `get_all_api_keys()` | `GET /v1/mgmt/api-key` | -| Regenerate API Key | `regenerate_api_key()` | `POST /v1/mgmt/api-key/{apiKeyId}/regenerate` | -| Delete API Key | `delete_api_key()` | `DELETE /v1/mgmt/api-key` | - -### AI Security Profiles Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Create AI Profile | `create_new_ai_profile()` | `POST /v1/mgmt/ai-sec-profile` | -| Retrieve AI Profiles | `get_all_ai_profiles()` | `GET /v1/mgmt/ai-sec-profile` | -| Update AI Profile | `update_ai_profile()` | `PUT /v1/mgmt/ai-sec-profile/{profileId}` | -| Delete AI Profile | `delete_ai_profile()` | `DELETE /v1/mgmt/ai-sec-profile/{profileId}` | -| Force Delete AI Profile | `force_delete_ai_profile()` | `DELETE /v1/mgmt/ai-sec-profile/{profileId}/force` | - -### Custom Topics Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Create Custom Topic | `create_new_custom_topic()` | `POST /v1/mgmt/custom-topic` | -| Retrieve Custom Topics | `get_all_custom_topics()` | `GET /v1/mgmt/custom-topic` | -| Modify Custom Topic | `modify_custom_topic_details()` | `PUT /v1/mgmt/custom-topic/{topicId}` | -| Delete Custom Topic | `delete_custom_topic()` | `DELETE /v1/mgmt/custom-topic/{topicId}` | -| Force Delete Custom Topic | `force_delete_custom_topic()` | `DELETE /v1/mgmt/custom-topic/{topicId}/force` | - -### Customer Applications Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Retrieve Customer Apps | `get_all_customer_apps()` | `GET /v1/mgmt/customer-app` | -| Update Customer App | `update_customer_app()` | `PUT /v1/mgmt/customer-app/{customerAppId}` | -| Delete Customer App | `delete_customer_app()` | `DELETE /v1/mgmt/customer-app` | - -### DLP Profiles Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Retrieve DLP Profiles | `get_all_dlp_profiles()` | `GET /v1/mgmt/dlp-profile` | - -### Deployment Profiles Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Retrieve Deployment Profiles | `get_all_deployment_profiles()` | `GET /v1/mgmt/deployment-profile` | - -### OAuth Token Management -| Operation | Method | API Endpoint | -|-----------|--------|--------------| -| Generate OAuth Token | `get_oauth_token()` | `POST /v1/oauth/token` | - ## AI Security Profiles Management API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) From 4b2d3d6cd6ca99bd3dabd91bb21412470882e3d9 Mon Sep 17 00:00:00 2001 From: sra Date: Fri, 17 Apr 2026 11:57:24 +0530 Subject: [PATCH 5/8] Updated Configuration parameters table in the overview section --- .../management/mgmt-python-sdk.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md index 1319ec734..4971a997d 100644 --- a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md +++ b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md @@ -117,16 +117,16 @@ client = MgmtClient( All configuration parameters: -| Parameter | Type | Default | Environment Variable | Description | -| :--- | :--- | :--- | :--- | :--- | -| **client_id** | str | None | PANW_CLIENT_ID | OAuth2 service account client ID | -| **client_secret** | str | None | PANW_CLIENT_SECRET | OAuth2 client secret | -| **base_url** | str | https://api.sase.
paloaltonetworks.com/aisec | PANW_BASE_URL | Management API endpoint | -| **token_base_url** | str | https://auth.appsvc.
paloaltonetworks.com/auth/v1/oauth2/access_token | PANW_TOKEN_BASE_URL | OAuth2 token endpoint | -| **num_retries** | int | 3 | - | Max retries with exponential backoff | -| **base_url** | str | https://api.sase.paloaltonetworks.com/aisec | PANW_BASE_URL | Management API endpoint | -| **token_base_url** | str | https://auth.appsvc.paloaltonetworks.com/auth/v1/oauth2/access_token | PANW_TOKEN_BASE_URL | OAuth2 token endpoint | -| **num_retries** | int | 3 | - | Max retries with exponential backoff | +| Environment Variable | Type | Default | Description | +| :---- | :---- | :---- | :---- | +| PANW\_CLIENT\_ID | str | None | OAuth2 service account client ID | +| PANW\_CLIENT\_SECRET | str | None | OAuth2 client secret | +| PANW\_BASE\_URL | str | [https://api.sase](https://api.sase/). paloaltonetworks.com/aisec | Management API endpoint | +| PANW\_TOKEN\_BASE\_URL | str | [https://auth.appsvc](https://auth.appsvc/). paloaltonetworks.com/auth/v1/oauth2/access\_token | OAuth2 token endpoint | +| \- | int | 3 | Max retries with exponential backoff | +| PANW\_BASE\_URL | str | [https://api.sase.paloaltonetworks.com/aisec](https://api.sase.paloaltonetworks.com/aisec) | Management API endpoint | +| PANW\_TOKEN\_BASE\_URL | str | [https://auth.apps.paloaltonetworks.com/am/oauth2/access_token](https://auth.apps.paloaltonetworks.com/am/oauth2/access_token) | OAuth2 token endpoint | +| \- | int | 3 | Max retries with exponential backoff | # Example: SDK Configuration From 21a280afa88ea5d862b7bc04259334279f1436c1 Mon Sep 17 00:00:00 2001 From: sra Date: Fri, 17 Apr 2026 22:20:11 +0530 Subject: [PATCH 6/8] Updated the configuration table in the overview section --- .../airuntimesecurity/management/mgmt-python-sdk.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md index 4971a997d..f4e25b06d 100644 --- a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md +++ b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md @@ -79,7 +79,7 @@ Both clients accept the following optional parameters: - **client_id:** Your OAuth2 client ID (service account email) - **client_secret:** Your OAuth2 client secret - **base_url:** Management API endpoint (default: https://api.sase.paloaltonetworks.com/aisec) - - **token_base_url:** OAuth2 token endpoint (default: https://auth.appsvc.paloaltonetworks.com/auth/v1/oauth2/access_token) + - **token_base_url:** OAuth2 token endpoint (default: https://auth.apps.paloaltonetworks.com/am/oauth2/access_token) - **num_retries:** Maximum number of retries with exponential backoff (default: 3) You must provide OAuth2 client credentials (client_id + client_secret) for authentication. @@ -97,7 +97,7 @@ export PANW_CLIENT_SECRET="your_client_secret" # Optional configuration (override defaults) export PANW_BASE_URL="https://api.sase.paloaltonetworks.com/aisec" -export PANW_TOKEN_BASE_URL="https://auth.appsvc.paloaltonetworks.com/auth/v1/oauth2/access_token" +export PANW_TOKEN_BASE_URL="https://auth.apps.paloaltonetworks.com/am/oauth2/access_token" ``` 2. Specify credentials in MgmtClient() initialization: @@ -109,7 +109,7 @@ client = MgmtClient( client_id="your_client_id", client_secret="your_client_secret", base_url="https://api.sase.paloaltonetworks.com/aisec", # Optional - token_base_url="https://auth.appsvc.paloaltonetworks.com/auth/v1/oauth2/access_token" # Optional + token_base_url="https://auth.apps.paloaltonetworks.com/am/oauth2/access_token" # Optional ) ``` @@ -121,9 +121,6 @@ All configuration parameters: | :---- | :---- | :---- | :---- | | PANW\_CLIENT\_ID | str | None | OAuth2 service account client ID | | PANW\_CLIENT\_SECRET | str | None | OAuth2 client secret | -| PANW\_BASE\_URL | str | [https://api.sase](https://api.sase/). paloaltonetworks.com/aisec | Management API endpoint | -| PANW\_TOKEN\_BASE\_URL | str | [https://auth.appsvc](https://auth.appsvc/). paloaltonetworks.com/auth/v1/oauth2/access\_token | OAuth2 token endpoint | -| \- | int | 3 | Max retries with exponential backoff | | PANW\_BASE\_URL | str | [https://api.sase.paloaltonetworks.com/aisec](https://api.sase.paloaltonetworks.com/aisec) | Management API endpoint | | PANW\_TOKEN\_BASE\_URL | str | [https://auth.apps.paloaltonetworks.com/am/oauth2/access_token](https://auth.apps.paloaltonetworks.com/am/oauth2/access_token) | OAuth2 token endpoint | | \- | int | 3 | Max retries with exponential backoff | @@ -139,7 +136,7 @@ client = MgmtClient( client_id="your_client_id", client_secret="your_client_secret", base_url="https://api.sase.paloaltonetworks.com/aisec", - token_base_url="https://auth.appsvc.paloaltonetworks.com/auth/v1/oauth2/access_token" + token_base_url="https://auth.apps.paloaltonetworks.com/am/oauth2/access_token" ) ``` **Using Environment Variables** @@ -154,7 +151,7 @@ from airs_api_mgmt import MgmtClient # Optional (override defaults): # export PANW_BASE_URL="https://api.sase.paloaltonetworks.com/aisec" -# export PANW_TOKEN_BASE_URL="https://auth.appsvc.paloaltonetworks.com/auth/v1/oauth2/access_token" +# export PANW_TOKEN_BASE_URL="https://auth.apps.paloaltonetworks.com/am/oauth2/access_token" # Initialize with defaults (uses environment variables) client = MgmtClient() From 1f4f4e1597b5ee6aeb547c9893214b32c15ac522 Mon Sep 17 00:00:00 2001 From: sra Date: Fri, 17 Apr 2026 22:25:49 +0530 Subject: [PATCH 7/8] updated the configuration table in mgmt overview sdk --- .../api/airuntimesecurity/management/mgmt-python-sdk.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md index f4e25b06d..e6d14b9c2 100644 --- a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md +++ b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-sdk.md @@ -123,7 +123,7 @@ All configuration parameters: | PANW\_CLIENT\_SECRET | str | None | OAuth2 client secret | | PANW\_BASE\_URL | str | [https://api.sase.paloaltonetworks.com/aisec](https://api.sase.paloaltonetworks.com/aisec) | Management API endpoint | | PANW\_TOKEN\_BASE\_URL | str | [https://auth.apps.paloaltonetworks.com/am/oauth2/access_token](https://auth.apps.paloaltonetworks.com/am/oauth2/access_token) | OAuth2 token endpoint | -| \- | int | 3 | Max retries with exponential backoff | +| `num_retries`\- | int | 3 | Max retries with exponential backoff | # Example: SDK Configuration From 53120aad3353c2f2891e0aa6ab39a3a03a82569d Mon Sep 17 00:00:00 2001 From: sra Date: Fri, 17 Apr 2026 23:44:26 +0530 Subject: [PATCH 8/8] Removed duplicate section from mgmt-inlinesdk --- .../management/mgmt-python-inlinesdk.md | 600 ------------------ 1 file changed, 600 deletions(-) diff --git a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md index aac0ee5d3..3b8948e7c 100644 --- a/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md +++ b/products/prisma-airs/api/airuntimesecurity/management/mgmt-python-inlinesdk.md @@ -659,603 +659,3 @@ print(f"OAuth Token: {oauth_response}") - `token_ttl_interval` (int, required): Time-to-live interval for the token - `token_ttl_unit` (str, required): Time unit ("seconds", "minutes", "hours", "days") -## AI Security Profiles Management - -API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) - -### Create New AI Security Profile - -Create a new AI security profile with comprehensive policy configuration. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Define AI security profile policy (using dictionary format) -policy = { - "dlp-data-profiles": [], - "ai-security-profiles": [ - { - "model-type": "default", - "model-configuration": { - "latency": { - "inline-timeout-action": "block", - "max-inline-latency": 20 - }, - "data-protection": { - "data-leak-detection": { - "member": [ - {"text": "Sensitive Content", "id": "", "version": "2"} - ], - "action": "block" - } - }, - "app-protection": { - "default-url-category": {"member": ["malicious"]}, - "url-detected-action": "allow" - }, - "model-protection": [ - {"name": "prompt-injection", "action": "allow"}, - {"name": "jailbreak", "action": "block"} - ] - } - } - ] -} - -# Alternatively, create policy using SDK model objects (typed approach) -from airs_api_mgmt.sdk.models import ( - AIProfileObjectPolicy, - AiSecurityProfileObject, - AiSecurityProfileObjectModelConfiguration, - LatencyObject, - DataProtectionObject, - DataProtectionObjectDataLeakDetection, - DataProtectionObjectDataLeakDetectionMemberInner, - AppProtectionObject, - AppProtectionObjectDefaultUrlCategory, - ModelProtectionObjectInner -) - -policy_typed = AIProfileObjectPolicy( - dlp_data_profiles=[], - ai_security_profiles=[ - AiSecurityProfileObject( - model_type="default", - content_type="text", - model_configuration=AiSecurityProfileObjectModelConfiguration( - latency=LatencyObject( - inline_timeout_action="block", - max_inline_latency=20 - ), - data_protection=DataProtectionObject( - data_leak_detection=DataProtectionObjectDataLeakDetection( - member=[ - DataProtectionObjectDataLeakDetectionMemberInner( - text="Sensitive Content", - id="", - version="2" - ) - ], - action="block" - ) - ), - app_protection=AppProtectionObject( - default_url_category=AppProtectionObjectDefaultUrlCategory( - member=["malicious"] - ), - url_detected_action="allow" - ), - model_protection=[ - ModelProtectionObjectInner(name="prompt-injection", action="allow"), - ModelProtectionObjectInner(name="jailbreak", action="block") - ] - ) - ) - ] -) - -# Create new AI security profile (works with both dictionary or typed policy) -create_response = client.ai_sec_profiles.create_new_ai_profile( - profile_name="production-security-profile", - revision=1, - policy=policy, # or use policy_typed for typed approach - created_by="user@example.com" -) - -print(f"Profile ID: {create_response}") -``` - -Parameters: - -* `profile_name` (str, required): Name of the AI security profile -* `revision` (int, required): Revision number -* `policy` (dict | AIProfileObjectPolicy, required): Policy configuration object (can be dict or typed model object) -* `profile_id` (str, optional): Custom profile UUID -* `created_by` (str, optional): Email of user creating the profile -* `updated_by` (str, optional): Email of user updating the profile -* `last_modified_ts` (datetime, optional): Last modification timestamp - -### Retrieve AI Security Profiles (with pagination) - -Retrieve all AI security profiles with pagination support. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Retrieve AI security profiles -profiles_response = client.ai_sec_profiles.get_all_ai_profiles(offset=0, limit=25) - -print(f"AI Security Profiles Response: {profiles_response}") -``` - -Parameters: - -* `offset` (int, optional): Starting position for pagination (default: 0) -* `limit` (int, optional): Maximum number of profiles to retrieve (default: 100) - -### Update AI Security Profile - -Update an existing AI security profile by its ID. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Updated policy -updated_policy = { - "dlp-data-profiles": [], - "ai-security-profiles": [ - { - "model-type": "default", - "model-configuration": { - "latency": { - "inline-timeout-action": "allow", - "max-inline-latency": 30 - }, - "data-protection": { - "data-leak-detection": { - "member": [ - {"text": "PII Data", "id": "", "version": "2"} - ], - "action": "block" - } - } - } - } - ] -} - -# Update AI security profile -update_response = client.ai_sec_profiles.update_ai_profile( - profile_id="your_profile_uuid", - profile_name="production-security-profile-v2", - revision=2, - policy=updated_policy, - updated_by="user@example.com" -) - -print(f"Updated Profile: {update_response}") -``` - -Parameters: - -* `profile_id` (str, required): UUID of the profile to update -* `profile_name` (str, required): Updated profile name -* `revision` (int, required): New revision number -* `policy` (dict, required): Updated policy configuration -* `created_by` (str, optional): Original creator email -* `updated_by` (str, optional): Email of user updating the profile -* `last_modified_ts` (datetime, optional): Last modification timestamp - -### Delete AI Security Profile - -Delete an AI security profile by its ID. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Delete AI security profile -delete_response = client.ai_sec_profiles.delete_ai_profile( - profile_id="your_profile_uuid" -) - -print(f"Deletion response: {delete_response}") -``` - -Parameters: - -* `profile_id` (str, required): UUID of the profile to delete - -### Force Delete AI Security Profile - -Force delete an AI security profile, bypassing validation checks. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Force delete AI security profile -force_delete_response = client.ai_sec_profiles.force_delete_ai_profile( - profile_id="your_profile_uuid", - updated_by="user@example.com" -) - -print(f"Force deletion response: {force_delete_response}") -``` - -Parameters: - -* `profile_id` (str, required): UUID of the profile to force delete -* `updated_by` (str, required): Email of user performing the deletion - -## Custom Topics Management - -API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) - -### Create New Custom Topic - -Create a new custom topic for data classification. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Create custom topic -create_response = client.custom_topics.create_new_custom_topic( - topic_name="financial-data", - description="Detection of financial and banking information", - examples=[ - "Credit card numbers", - "Bank account details", - "Social security numbers", - "Tax identification numbers" - ], - revision=1, - created_by="user@example.com" -) - -print(f"Topic ID: {create_response}") -``` - -Parameters: - -* `topic_name` (str, required): Name of the custom topic -* `description` (str, required): Detailed explanation of the topic -* `examples` (list[str], required): List of example usages -* `revision` (int, required): Revision number -* `topic_id` (str, optional): Custom topic UUID -* `created_by` (str, optional): Email of user creating the topic -* `updated_by` (str, optional): Email of user updating the topic -* `last_modified_ts` (datetime, optional): Last modification timestamp -* `created_ts` (datetime, optional): Creation timestamp - -### Retrieve All Custom Topics (with pagination) - -Retrieve all custom topics with pagination support. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Retrieve all custom topics -topics_response = client.custom_topics.get_all_custom_topics( - offset=0, - limit=50 -) - -print(f"Custom Topics Response: {topics_response}") -``` - -Parameters: - -* `offset` (int, optional): Starting position for pagination (default: 0) -* `limit` (int, optional): Maximum number of topics to retrieve (default: 100) - -### Modify Custom Topic Details - -Modify an existing custom topic with updated details. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Modify custom topic -modify_response = client.custom_topics.modify_custom_topic_details( - topic_id="your_topic_uuid", - topic_name="financial-data-updated", - description="Updated detection of financial and personal information", - examples=[ - "Credit card numbers", - "Bank account details", - "Social security numbers", - "Tax identification numbers", - "IBAN numbers" - ], - revision=2, - updated_by="user@example.com" -) - -print(f"Modified Topic: {modify_response}") -``` - -Parameters: - -* `topic_id` (str, required): UUID of the topic to modify -* `topic_name` (str, required): Updated topic name -* `description` (str, required): Updated description -* `examples` (list[str], required): Updated list of examples -* `revision` (int, required): New revision number -* `created_by` (str, optional): Original creator email -* `updated_by` (str, optional): Email of user modifying the topic -* `last_modified_ts` (datetime, optional): Last modification timestamp -* `created_ts` (datetime, optional): Creation timestamp - -### Delete Custom Topic - -Delete a custom topic by its ID. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Delete custom topic -delete_response = client.custom_topics.delete_custom_topic( - topic_id="your_topic_uuid" -) - -print(f"Deletion response: {delete_response}") -``` - -Parameters: - -* `topic_id` (str, required): UUID of the topic to delete - -### Force Delete Custom Topic - -Force delete a custom topic, bypassing validation checks. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Force delete custom topic -force_delete_response = client.custom_topics.force_delete_custom_topic( - topic_id="your_topic_uuid", - updated_by="user@example.com" -) - -print(f"Force deletion response: {force_delete_response}") -``` - -Parameters: - -* `topic_id` (str, required): UUID of the topic to force delete -* `updated_by` (str, required): Email of user performing the deletion - -## Customer Applications Management - -API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) - -### Retrieve All Customer Applications (with pagination) - -Retrieve all customer applications with pagination support. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Retrieve all customer applications -apps_response = client.customer_apps.get_all_customer_apps( - offset=0, - limit=25 -) - -print(f"Customer Applications Response: {apps_response}") -``` - -Parameters: - -* `offset` (int, optional): Starting position for pagination (default: 0) -* `limit` (int, optional): Maximum number of apps to retrieve (default: 100) - -### Update Customer Application - -Update a customer application with new settings. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Update customer application -update_response = client.customer_apps.update_customer_app( - customer_app_id="your_app_uuid", - app_name="my-updated-application", - cloud_provider="AWS", - environment="production", - model_name="gpt-4", # Optional - status="completed", # Optional - updated_by="user@example.com", # Optional - ai_agent_framework="langchain" # Optional -) - -print(f"Updated App: {update_response}") -``` - -Parameters: - -* `customer_app_id` (str, required): UUID of the customer application -* `app_name` (str, required): Updated application name -* `cloud_provider` (str, required): Cloud provider ("AWS", "Azure", "GCP") -* `environment` (str, required): Environment ("production", "staging", "development") -* `model_name` (str, optional): AI model name -* `status` (str, optional): Application status ("completed", "pending") -* `updated_by` (str, optional): Email of user updating the app -* `ai_agent_framework` (str, optional): AI agent framework name - -### Delete Customer Application - -Delete a customer application by its name. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Delete customer application -delete_response = client.customer_apps.delete_customer_app( - app_name="my-application", - updated_by="user@example.com" -) - -print(f"Deletion response: {delete_response}") -``` - -Parameters: - -* `app_name` (str, required): Name of the application to delete -* `updated_by` (str, required): Email of user performing the deletion - -## DLP Profiles Management - -API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) - -### Retrieve All DLP Profiles - -Retrieve all DLP (Data Loss Prevention) profiles. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Retrieve all DLP profiles -dlp_profiles = client.dlp_profiles.get_all_dlp_profiles() - -print(f"DLP Profiles: {dlp_profiles}") -``` - -Parameters: None - -## Deployment Profiles Management - -API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) - -### Retrieve All Deployment Profiles - -Retrieve all deployment profiles. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Retrieve all deployment profiles -deployment_profiles = client.deployment_profiles.get_all_deployment_profiles() - -print(f"Deployment Profiles: {deployment_profiles}") -``` - -Parameters: - -* `unactivated` (bool, optional): Get only unactivated deployment profiles (default: None) - -### Retrieve Unactivated Deployment Profiles - -Retrieve only unactivated deployment profiles (includes available and previously activated profiles without associated apps or API keys). - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Retrieve only unactivated deployment profiles -unactivated_profiles = client.deployment_profiles.get_all_deployment_profiles( - unactivated=True -) - -print(f"Unactivated Deployment Profiles: {unactivated_profiles}") -``` - -Parameters: - -* `unactivated` (bool, required): Set to True to retrieve only unactivated profiles - -## OAuth Token Management - -API Reference: [https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/](https://pan.dev/prisma-airs/api/airuntimesecurity/prismaairsmanagementapi/) - -### Generate OAuth2 Token - -Generate an OAuth2 access token for an Apigee application. - -Synchronous Example: - -```python -from airs_api_mgmt import MgmtClient - -client = MgmtClient() - -# Generate OAuth2 token for an Apigee application -oauth_response = client.oauth.get_oauth_token( - client_id="your_apigee_client_id", - customer_app="my-customer-app", - token_ttl_interval=24, - token_ttl_unit="hours" -) - -print(f"OAuth Token: {oauth_response}") -``` - -Parameters: - -* `client_id` (str, required): Client ID for the OAuth application -* `customer_app` (str, required): Customer application name -* `token_ttl_interval` (int, required): Time-to-live interval for the token -* `token_ttl_unit` (str, required): Time unit ("seconds", "minutes", "hours", "days")