Skip to content

Commit

Permalink
Restructure documentation for better organization
Browse files Browse the repository at this point in the history
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
cdot65 committed Oct 17, 2024
1 parent 5c5f1e1 commit 992a85c
Show file tree
Hide file tree
Showing 18 changed files with 403 additions and 41 deletions.
4 changes: 2 additions & 2 deletions docs/sdk/address.md → docs/sdk/config/objects/address.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,5 @@ for addr in addresses:

## Related Models

- [AddressRequestModel](models/address_models.md#addressrequestmodel)
- [AddressResponseModel](models/address_models.md#addressresponsemodel)
- [AddressRequestModel](../../models/objects/address_models.md#addressrequestmodel)
- [AddressResponseModel](../../models/objects/address_models.md#addressresponsemodel)
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,5 @@ for group in groups:

## Related Models

- [AddressGroupRequestModel](models/address_group_models.md#addressgrouprequestmodel)
- [AddressGroupResponseModel](models/address_group_models.md#addressgroupresponsemodel)
- [AddressGroupRequestModel](../../models/objects/address_group_models.md#addressgrouprequestmodel)
- [AddressGroupResponseModel](../../models/objects/address_group_models.md#addressgroupresponsemodel)
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,5 @@ for app in applications:

## Related Models

- [ApplicationRequestModel](models/application_models.md#applicationrequestmodel)
- [ApplicationResponseModel](models/application_models.md#applicationresponsemodel)
- [ApplicationRequestModel](../../models/objects/application_models.md#applicationrequestmodel)
- [ApplicationResponseModel](../../models/objects/application_models.md#applicationresponsemodel)
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,5 @@ print(f"Created application group with ID: {new_group.id}")

## Related Models

- [ApplicationGroupRequestModel](models/application_group_models.md#ApplicationGrouprequestmodel)
- [ApplicationGroupResponseModel](models/application_group_models.md#ApplicationGroupresponsemodel)
- [ApplicationGroupRequestModel](../../models/objects/application_group_models.md#ApplicationGrouprequestmodel)
- [ApplicationGroupResponseModel](../../models/objects/application_group_models.md#ApplicationGroupresponsemodel)
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`:

Expand Down
4 changes: 2 additions & 2 deletions docs/sdk/service.md → docs/sdk/config/objects/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ for svc in services:

## Related Models

- [ServiceRequestModel](models/service_models.md#servicerequestmodel)
- [ServiceResponseModel](models/service_models.md#serviceresponsemodel)
- [ServiceRequestModel](../../models/objects/service_models.md#servicerequestmodel)
- [ServiceResponseModel](../../models/objects/service_models.md#serviceresponsemodel)

---
169 changes: 169 additions & 0 deletions docs/sdk/config/security_services/anti_spyware.md
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)

20 changes: 20 additions & 0 deletions docs/sdk/config/security_services/index.md
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.
33 changes: 20 additions & 13 deletions docs/sdk/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@ configuration objects and data models used to interact with Palo Alto Networks S

## Contents

- [Configuration Objects](configuration_objects.md)
- [Address](address.md)
- [Address Group](address_group.md)
- [Application](application.md)
- [Application Group](application_group.md)
- [Service](service.md)
- [Data Models](models.md)
- [Address Models](models/address_models.md)
- [Address Group Models](models/address_group_models.md)
- [Application Models](models/application_models.md)
- [Application Group Models](models/application_group_models.md)
- [Service Models](models/service_models.md)
- Configuration
- [Objects](config/objects/index)
- [Address](config/objects/address.md)
- [Address Group](config/objects/address_group.md)
- [Application](config/objects/application.md)
- [Application Group](config/objects/application_group.md)
- [Service](config/objects/service.md)
- [Security Services](config/security_services/index)
- [Anti-Spyware](config/security_services/anti_spyware.md)
- Data Models
- [Objects](models/objects/index)
- [Address Models](models/objects/address_models.md)
- [Address Group Models](models/objects/address_group_models.md)
- [Application Models](models/objects/application_models.md)
- [Application Group Models](models/objects/application_group_models.md)
- [Service Models](models/objects/service_models.md)
- [Security Services](models/security_services/index)
- [Anti-Spyware](models/security_services/anti_spyware_profile_models.md)

---

Expand All @@ -25,5 +31,6 @@ configuration objects and data models used to interact with Palo Alto Networks S
The `pan-scm-sdk` provides a set of classes and models to simplify interaction with the Strata Cloud Manager API. By
utilizing this SDK, developers can programmatically manage configurations, ensuring consistency and efficiency.

Proceed to the [Configuration Objects](configuration_objects.md) section to learn more about the objects you can manage
Proceed to the [Configuration Objects](config/objects/index) section to learn more about the objects you can
manage
using the SDK.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions docs/sdk/models.md → docs/sdk/models/objects/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ For each configuration object, there are corresponding request and response mode

## Models by Configuration Object

- [Address Models](models/address_models.md)
- [Address Group Models](models/address_group_models.md)
- [Application Models](models/application_models.md)
- [Application Group Models](models/application_group_models.md)
- [Service Models](models/service_models.md)
- [Address Models](address_models.md)
- [Address Group Models](address_group_models.md)
- [Application Models](application_models.md)
- [Application Group Models](application_group_models.md)
- [Service Models](service_models.md)
File renamed without changes.
Loading

0 comments on commit 992a85c

Please sign in to comment.