Overview
Upgrade pan-scm-sdk from ^0.12.2 to ^0.13.0 and integrate the new region parameter. This is the foundation PR that must land before any of the three new command modules (local config, device operations, incidents).
Context
SDK 0.13.0 (April 2026) adds:
- Operations API:
client.local_config, client.device_operations
- Incidents API:
client.incidents
region parameter on Scm client for APIs requiring X-PANW-Region header (default: "americas")
raw_response support in Scm.request() for binary file downloads
JobTimeoutError exception for sync job polling timeouts
- Pydantic models for all new services
This issue covers ONLY the SDK bump and region plumbing. New commands are tracked in separate issues.
Design Decisions (from brainstorming session 2026-04-16)
- Region stored per-context:
scm context create gains --region option (default "americas"), persisted in ~/.scm-cli/contexts/<name>.yaml
- Global
--region flag overrides context: scm --region europe incidents list ... overrides the stored context value for that invocation
- Backward compatible: Existing contexts without a
region field default to "americas"
Scope
- In scope:
- Bump
pan-scm-sdk in pyproject.toml from ^0.12.2 to ^0.13.0
- Run
poetry update pan-scm-sdk and verify lock file
- Add
--region option to scm context create in commands/context.py
- Store
region field in context YAML files (utils/context.py)
- Add global
--region callback/option to main.py app
- Update
client.py to pass region to Scm() constructor (context value → global override → default "americas")
- Handle
JobTimeoutError in sdk_client.py _handle_api_exception
- Update mock mode in
client.py to accept region gracefully
- Tests for region in context create, region override, backward compat with old contexts
- Verify all existing tests still pass (no SDK breaking changes)
- Out of scope:
- New command modules (local, operations, incidents) — see #ISSUE_LOCAL, #ISSUE_OPS, #ISSUE_INCIDENTS
raw_response usage (handled in local config download)
Acceptance Criteria
Implementation Notes
- Region override precedence: global
--region flag > context's stored region > "americas"
- Context YAML schema adds optional
region: str field
- The
Scm client constructor signature in 0.13.0: Scm(client_id=..., client_secret=..., tsg_id=..., region=...)
JobTimeoutError includes job_id and last_state attrs for manual recovery messaging
Overview
Upgrade
pan-scm-sdkfrom^0.12.2to^0.13.0and integrate the newregionparameter. This is the foundation PR that must land before any of the three new command modules (local config, device operations, incidents).Context
SDK 0.13.0 (April 2026) adds:
client.local_config,client.device_operationsclient.incidentsregionparameter onScmclient for APIs requiringX-PANW-Regionheader (default: "americas")raw_responsesupport inScm.request()for binary file downloadsJobTimeoutErrorexception for sync job polling timeoutsThis issue covers ONLY the SDK bump and region plumbing. New commands are tracked in separate issues.
Design Decisions (from brainstorming session 2026-04-16)
scm context creategains--regionoption (default "americas"), persisted in~/.scm-cli/contexts/<name>.yaml--regionflag overrides context:scm --region europe incidents list ...overrides the stored context value for that invocationregionfield default to "americas"Scope
pan-scm-sdkinpyproject.tomlfrom^0.12.2to^0.13.0poetry update pan-scm-sdkand verify lock file--regionoption toscm context createincommands/context.pyregionfield in context YAML files (utils/context.py)--regioncallback/option tomain.pyappclient.pyto passregiontoScm()constructor (context value → global override → default "americas")JobTimeoutErrorinsdk_client.py_handle_api_exceptionclient.pyto accept region gracefullyraw_responseusage (handled in local config download)Acceptance Criteria
pyproject.tomlspecifiespan-scm-sdk = "^0.13.0"poetry locksucceeds and SDK 0.13.x is resolvedscm context create <name> --client-id ... --region europestores region in context YAMLscm --region americas context listworks (global flag parsed)regionfield default to "americas" without errorclient.pypassesregion=toScm()constructorJobTimeoutErroris caught and handled with useful error message including job_idmake qualitypassesImplementation Notes
--regionflag > context's stored region > "americas"region: strfieldScmclient constructor signature in 0.13.0:Scm(client_id=..., client_secret=..., tsg_id=..., region=...)JobTimeoutErrorincludesjob_idandlast_stateattrs for manual recovery messaging