Skip to main content

Network Locations Configuration Object

Provides read-only access to geographic network location objects in Palo Alto Networks Strata Cloud Manager.

Class Overview​

The NetworkLocations class provides access to network location objects representing geographic locations for service connectivity. This is a read-only resource supporting only list and fetch operations.

Methods​

MethodDescriptionParametersReturn Type
list()List locations with optional filters**filtersList[NetworkLocationModel]
fetch()Retrieve a location by its valuevalue: strNetworkLocationModel

Model Attributes​

AttributeTypeRequiredDefaultDescription
valuestrYesNoneUnique identifier for the location (e.g., "us-west-1")
displaystrYesNoneHuman-readable location name
continentstrNoNoneContinent where the location exists
regionstrNoNoneGeographic region of the location
latitudefloatNoNoneLatitude coordinate (-90 to 90)
longitudefloatNoNoneLongitude coordinate (-180 to 180)
aggregate_regionstrNoNoneHigher-level regional grouping

Exceptions​

ExceptionHTTP CodeDescription
MissingQueryParameterError400When value parameter is missing or empty
InvalidObjectError404When requested location is not found

Basic Configuration​

from scm.client import Scm

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

locations = client.network_location

Methods​

List Network Locations​

locations = client.network_location.list()

print(f"Found {len(locations)} network locations:")
for location in locations:
print(f"Value: {location.value}, Display: {location.display}, Region: {location.region}")

Filtering responses:

# Filter by continent
us_locations = client.network_location.list(continent="North America")

# Filter by multiple criteria
west_coast = client.network_location.list(
continent="North America",
aggregate_region="us-southwest"
)

# Filter by region
regions = client.network_location.list(region=["us-west2", "us-east4"])

Controlling pagination with max_limit:

client.network_location.max_limit = 500

locations = client.network_location.list()

Fetch a Network Location​

from scm.exceptions import InvalidObjectError, MissingQueryParameterError

try:
location = client.network_location.fetch("us-west-1")
print(f"Value: {location.value}")
print(f"Display name: {location.display}")
print(f"Continent: {location.continent}")
print(f"Region: {location.region}")
print(f"Coordinates: {location.latitude}, {location.longitude}")
except MissingQueryParameterError:
print("Error: Location value cannot be empty")
except InvalidObjectError:
print("Error: Location not found")

Error Handling​

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

try:
locations = client.network_location.list(continent="North America")
except APIError as e:
print(f"Error retrieving network locations: {e.message}")

try:
location = client.network_location.fetch("nonexistent-location")
except InvalidObjectError:
print("Location not found")
except MissingQueryParameterError:
print("Location value cannot be empty")