Skip to main content

Agent Versions Configuration Object

Provides read-only access to available GlobalProtect agent version information in Palo Alto Networks Strata Cloud Manager.

Class Overview​

The AgentVersions class inherits from BaseObject and offers methods for listing and retrieving available GlobalProtect agent versions. This is a read-only resource supporting only list and fetch operations.

Methods​

MethodDescriptionParametersReturn Type
list()Lists available agent versions**filtersList[str]
fetch()Retrieves a specific versionversion: strstr

Model Attributes​

AttributeTypeRequiredDefaultDescription
agent_versionsList[str]YesNoneList of available GlobalProtect agent versions

Exceptions​

ExceptionHTTP CodeDescription
InvalidObjectError400Invalid configuration or parameters
MissingQueryParameterError400Missing required parameters
ObjectNotPresentError404Requested agent version not found
AuthenticationError401Authentication failed
ServerError500Internal server error

Basic Configuration​

from scm.client import Scm

client = Scm(
client_id="your_client_id",
client_secret="your_client_secret",
tsg_id="your_tsg_id"
)

agent_versions = client.agent_version

Methods​

List Agent Versions​

versions = client.agent_version.list()

print(f"Found {len(versions)} GlobalProtect agent versions:")
for version in versions:
print(f"- {version}")

Filtering responses:

# Filter versions by substring
filtered_versions = client.agent_version.list(version="5.2")

# Filter versions by prefix
prefix_versions = client.agent_version.list(prefix="5.3")

# Combine filters
combined_versions = client.agent_version.list(
version="5.2",
prefix="5.2.8"
)

Controlling pagination with max_limit:

client.agent_version.max_limit = 1000

all_versions = client.agent_version.list()

Fetch an Agent Version​

from scm.exceptions import InvalidObjectError

try:
version = client.agent_version.fetch("5.3.0")
print(f"Found version: {version}")
except InvalidObjectError:
print("Version not found")

Error Handling​

from scm.exceptions import (
InvalidObjectError,
MissingQueryParameterError,
ObjectNotPresentError
)

try:
version = client.agent_version.fetch("5.3.0")
print(f"Found version: {version}")
except MissingQueryParameterError as e:
print(f"Missing parameter: {e.message}")
except InvalidObjectError as e:
print(f"Invalid object error: {e.message}")