-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure documentation for better organization
Reorganized the documentation to segregate configuration objects and security services for improved clarity. Deleted outdated models.md and created new directories for objects and security services each with dedicated overview files. Updated all relevant links and references accordingly.
- Loading branch information
Showing
18 changed files
with
403 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/sdk/configuration_objects.md → docs/sdk/config/objects/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Configuration Objects | ||
# Objects | ||
|
||
This section covers the configuration objects provided by the `pan-scm-sdk`: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
# Anti-Spyware Profile Configuration Object | ||
|
||
The `AntiSpywareProfile` class is used to manage anti-spyware profile objects in the Strata Cloud Manager. It provides | ||
methods to create, retrieve, update, delete, and list anti-spyware profile objects. | ||
|
||
--- | ||
|
||
## Importing the AntiSpywareProfile Class | ||
|
||
```python | ||
from scm.config.security import AntiSpywareProfile | ||
``` | ||
|
||
## Methods | ||
|
||
### `create(data: Dict[str, Any]) -> AntiSpywareProfileResponseModel` | ||
|
||
Creates a new anti-spyware profile object. | ||
|
||
**Parameters:** | ||
|
||
- `data` (Dict[str, Any]): A dictionary containing the anti-spyware profile object data. | ||
|
||
**Example:** | ||
|
||
```python | ||
profile_data = { | ||
"name": "test_profile", | ||
"description": "Test anti-spyware profile", | ||
"folder": "Prisma Access", | ||
"rules": [ | ||
{ | ||
"name": "rule1", | ||
"severity": ["critical", "high"], | ||
"category": "spyware", | ||
"action": {"alert": {}} | ||
} | ||
] | ||
} | ||
|
||
new_profile = anti_spyware_profile.create(profile_data) | ||
print(f"Created anti-spyware profile with ID: {new_profile.id}") | ||
``` | ||
|
||
### `get(object_id: str) -> AntiSpywareProfileResponseModel` | ||
|
||
Retrieves an anti-spyware profile object by its ID. | ||
|
||
**Parameters:** | ||
|
||
- `object_id` (str): The UUID of the anti-spyware profile object. | ||
|
||
**Example:** | ||
|
||
```python | ||
profile_id = "123e4567-e89b-12d3-a456-426655440000" | ||
profile_object = anti_spyware_profile.get(profile_id) | ||
print(f"Anti-Spyware Profile Name: {profile_object.name}") | ||
``` | ||
|
||
### `update(object_id: str, data: Dict[str, Any]) -> AntiSpywareProfileResponseModel` | ||
|
||
Updates an existing anti-spyware profile object. | ||
|
||
**Parameters:** | ||
|
||
- `object_id` (str): The UUID of the anti-spyware profile object. | ||
- `data` (Dict[str, Any]): A dictionary containing the updated anti-spyware profile data. | ||
|
||
**Example:** | ||
|
||
```python | ||
update_data = { | ||
"description": "Updated anti-spyware profile description", | ||
} | ||
|
||
updated_profile = anti_spyware_profile.update(profile_id, update_data) | ||
print(f"Updated anti-spyware profile with ID: {updated_profile.id}") | ||
``` | ||
|
||
### `delete(object_id: str) -> None` | ||
|
||
Deletes an anti-spyware profile object by its ID. | ||
|
||
**Parameters:** | ||
|
||
- `object_id` (str): The UUID of the anti-spyware profile object. | ||
|
||
**Example:** | ||
|
||
```python | ||
anti_spyware_profile.delete(profile_id) | ||
print(f"Deleted anti-spyware profile with ID: {profile_id}") | ||
``` | ||
|
||
### | ||
|
||
`list(folder: Optional[str] = None, snippet: Optional[str] = None, device: Optional[str] = None, offset: Optional[int] = None, limit: Optional[int] = None, name: Optional[str] = None, **filters) -> List[AntiSpywareProfileResponseModel]` | ||
|
||
Lists anti-spyware profile objects, optionally filtered by folder, snippet, device, or other criteria. | ||
|
||
**Parameters:** | ||
|
||
- `folder` (Optional[str]): The folder to list anti-spyware profiles from. | ||
- `snippet` (Optional[str]): The snippet to list anti-spyware profiles from. | ||
- `device` (Optional[str]): The device to list anti-spyware profiles from. | ||
- `offset` (Optional[int]): The offset for pagination. | ||
- `limit` (Optional[int]): The limit for pagination. | ||
- `name` (Optional[str]): Filter profiles by name. | ||
- `**filters`: Additional filters. | ||
|
||
**Example:** | ||
|
||
```python | ||
profiles = anti_spyware_profile.list(folder='Prisma Access', limit=10) | ||
|
||
for profile in profiles: | ||
print(f"Anti-Spyware Profile Name: {profile.name}, ID: {profile.id}") | ||
``` | ||
|
||
--- | ||
|
||
## Usage Example | ||
|
||
```python | ||
from scm.client import Scm | ||
from scm.config.security import AntiSpywareProfile | ||
|
||
# Initialize the SCM client | ||
scm = Scm( | ||
client_id="your_client_id", | ||
client_secret="your_client_secret", | ||
tsg_id="your_tsg_id", | ||
) | ||
|
||
# Create an AntiSpywareProfile instance | ||
anti_spyware_profile = AntiSpywareProfile(scm) | ||
|
||
# Create a new anti-spyware profile | ||
profile_data = { | ||
"name": "test_profile", | ||
"description": "Test anti-spyware profile", | ||
"folder": "Prisma Access", | ||
"rules": [ | ||
{ | ||
"name": "rule1", | ||
"severity": ["critical", "high"], | ||
"category": "spyware", | ||
"action": {"alert": {}} | ||
} | ||
] | ||
} | ||
|
||
new_profile = anti_spyware_profile.create(profile_data) | ||
print(f"Created anti-spyware profile with ID: {new_profile.id}") | ||
|
||
# List anti-spyware profiles | ||
profiles = anti_spyware_profile.list(folder='Prisma Access', limit=10) | ||
for profile in profiles: | ||
print(f"Anti-Spyware Profile Name: {profile.name}, ID: {profile.id}") | ||
``` | ||
|
||
--- | ||
|
||
## Related Models | ||
|
||
- [AntiSpywareProfileRequestModel](../../models/security_services/anti_spyware_profile_models.md#AntiSpywareProfileRequestModel) | ||
- [AntiSpywareProfileResponseModel](../../models/security_services/anti_spyware_profile_models.md#AntiSpywareProfileResponseModel) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Security Services | ||
|
||
This section covers the configuration security services provided by the `pan-scm-sdk`: | ||
|
||
- [Anti Spyware Profile](anti_spyware.md) | ||
|
||
Each configuration object corresponds to a resource in the Strata Cloud Manager and provides methods for CRUD (Create, | ||
Read, Update, Delete) operations. | ||
|
||
--- | ||
|
||
## Available Objects | ||
|
||
### [AntiSpywareProfile](anti_spyware.md) | ||
|
||
Manage individual Anti-Spyware Security Profiles. | ||
|
||
--- | ||
|
||
Select an object above to view detailed documentation, including methods, parameters, and examples. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.