Skip to content

Add FMC 7.6, 7.7, and 10.0 API support - #107

Open
cromanme wants to merge 12 commits into
kaisero:masterfrom
cromanme:Support_up_to_10.0
Open

Add FMC 7.6, 7.7, and 10.0 API support#107
cromanme wants to merge 12 commits into
kaisero:masterfrom
cromanme:Support_up_to_10.0

Conversation

@cromanme

Copy link
Copy Markdown
Collaborator

Summary

  • Adds full endpoint coverage for FMC API versions 7.6, 7.7, and 10.0, verified against the corresponding OAS3 specs (fmc_oas3_7.6.5.json, fmc_oas3_7.7.12.json, fmc_oas3_10.0.1.json).
  • New templates namespace (device templates + 7 children), new updates namespace (content/device upgrade info), new user.externalauth sub-namespace, and ~70 new resource classes/methods across analysis, device, health, integration, object, policy, and troubleshoot.
  • Unlocks previously GET-only write operations (CREATE/UPDATE/DELETE) on several existing resources where FMC added support in 7.6/7.7/10.0 (e.g. policy.healthpolicy, OSPFv2/v3 routing, policy.dnspolicy, policy.identitypolicy).
  • Follow-up audit fixed several issues found in the initial implementation: missing SUPPORTED_FILTERS on analysis.identifieduser, incorrect operationId values in generated docstrings (root-caused to gen_docstrings.py not loading the new spec files — now fixed), and import-ordering regressions in three namespace __init__.py files.
  • README's "Supported operations" tree regenerated to reflect the full namespace structure and bumped from "up to 7.4.0" to "up to 10.0.0".
  • CHANGELOG already documents all additions under # Unreleased.

Test plan

  • python -c "import fireREST" succeeds
  • python -m py_compile on all changed files succeeds
  • python -m pytest -q shows the same baseline before/after (pre-existing network-dependent test failures only, nothing newly broken)
  • Manual smoke test against a live FMC 7.6/7.7/10.0 instance (not available in this environment)

🤖 Generated with Claude Code

cromanme and others added 10 commits June 3, 2026 09:12
Compares all 368 resource implementations against fmc_oas3_7.4.2.json.
Documents 4 critical bugs, 13 wrong-path bugs, 8 unmapped filter/param
keys that cause KeyError at runtime, and 20+ missing implementations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix TID URL builder missing /domain/{domainUUID} (all tid.* calls 404)
- Fix TaxiiConfig collection/discoveryinfo PATH including spurious /{uuid}
- Move IpsecCryptoMap to ravpn container (ftds2svpns has no ipseccryptomaps endpoint)
- Implement Hitcount update() and delete() which were no-ops; fix PATH /{uuid}
- Fix AllowDnsRule/BlockDnsRule: plural path segment + remove /{uuid}
- Fix EbsSnapshot: singular ebssnapshot path segment
- Fix PolicyLock: add /operational/ segment + remove /{uuid}
- Fix Usage: /objects/ -> /object/ typo
- Fix S2sVpnSummary: convert to top-level Resource at /policy/s2svpnsummaries
- Fix PreviewChanges/ValidationResults/DownloadReport/EmailReport/FpInterfaceStatistics/ManagementConvergenceMode: remove /{uuid} from list-only endpoints
- Fix TestUmbrellaConnection: add /operational/ segment
- Fix NatRule: move section from SUPPORTED_FILTERS to SUPPORTED_PARAMS
- Fix ChassisInterface: move operation from SUPPORTED_PARAMS to SUPPORTED_FILTERS
- Fix JobHistory SUPPORTED_FILTERS: device_uuid -> device_uuids
- Add missing FILTERS mapping entries: entity_uuid, parent_entity_types, parent_uuid, query_function, regex_filter, source, step, uuid
- Add search namespace: GlobalSearch, ObjectSearch, PolicySearch, DeviceSearch
- Add object.extendedcommunitylist + override
- Add object.localrealmuser
- Add device.devicerecord.vniinterface and vteppolicy (VXLAN)
- Add device routing: EcmpZone (device + VR level), Ospfv3Route (device level)
- Remove deprecated health.csdac (endpoint removed in FMC 7.4.x)
- Update AUDIT_REPORT.md with new findings and full implementation plan
- Update CHANGELOG.md with all changes, breaking changes, and fixes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds six new exception classes derived from the FMC REST API ResponseStructure
documentation and updates raise_for_status to use them precisely:

New exceptions:
- BadRequestError       — HTTP 400 generic bad request
- MethodNotAllowedError — HTTP 405 method not permitted on this resource
- ServerError           — HTTP 5xx catch-all for server-side failures
- RateLimitError        — HTTP 429 rate limit (canonical rename of RateLimitException)
- ConcurrentRequestError — HTTP 429 when >10 parallel connections from same IP
- RateLimitWriteError   — HTTP 429 when parallel write operation is blocked

Behavioral fixes in raise_for_status:
- HTTP 403 now always raises AuthorizationError (previously fell through to
  GenericApiError if response text did not contain the expected substring)
- HTTP 405 now always raises MethodNotAllowedError (same issue)
- HTTP 5xx codes beyond 500 now raise ServerError instead of GenericApiError
- HTTP 429 response body parsed to distinguish RateLimitWriteError and
  ConcurrentRequestError from the base RateLimitError

Backward compatibility:
- RateLimitException preserved as an alias for RateLimitError — existing code
  catching RateLimitException continues to work without modification
- The retry decorator now references the canonical RateLimitError name but
  catches all three 429 sub-types via Python's subclass resolution

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds 29 new resource classes and one new method covering all endpoints
introduced in FMC 7.6, verified against OAS3 7.6.5.

New templates/ namespace (templates.devicetemplate and children):
association, defaultmodelmapping, modelmapping, objectoverride,
templateinterface, templatevariable, vpnsetting, supporteddevicemodel,
plus apply() and generate() operational methods on DeviceTemplate.

New resources across existing namespaces:
- analysis.identifieduser (GET, DELETE)
- chassis.switch_mode_readiness_check() method
- device.ltpdevicerecord, device.bulkregistration, device.downloadsamplecsv
- health.event
- object.macaddresspool (+override), object.samlrealmuserandgroup,
  object.variable, object.downloadrealm
- object.operational.realmstatus, object.operational.testrealm
- troubleshoot.cpuprofiler.module, troubleshoot.snortprofiler.rule

Updated policy.healthpolicy to support CREATE, UPDATE, DELETE (7.6+).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New endpoints and write-operation unlocks for FMC 7.7.0:
- OSPFv2/v3 routing write ops (create/update/delete) for device and
  virtual-router routing resources
- Device certificate resources (Certificate, CertificatesExportData,
  ManageCertificate) and devicerecord.operational.outofbandchange
- health.aggregatemetric cross-container list endpoint
- integration.aiops sub-namespace (AiConfiguration, TsdbUpload,
  TsdbUploadStatus) and integration.cloudintegration
- object.certenrollment.override, object.serviceaccessobject (+override)
- policy.ftdplatformsettingspolicy children: bannersetting, eventlist,
  sshaccesssetting
- policy.accesspolicy.securityintelligencepolicy update support
- troubleshoot.radkit sub-namespace with radkit.service

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New endpoints for FMC 10.0.0:
- analysis.filter — full CRUD
- device.bulkcommand — cross-device bulk command (POST)
- device.devicerecord.universalzerotrustsetting — GET/UPDATE
- integration: ftdcloudstatus (GET), metricconfiguration (GET/POST),
  splunkprofile (full CRUD)
- policy.accesspolicy: advancedloggingsetting and evesetting (GET/UPDATE)
- policy.universalzerotrustpolicy (GET/UPDATE) with universalzerotrustrule
  (full CRUD)
- policy.dnspolicy: write ops + new dnsrule child (full CRUD)
- policy.identitypolicy: write ops + identitycategory and identityrule
  children (full CRUD)
- policy.decryptionpolicy.standardmodeconfiguration (GET/UPDATE)
- policy.ftdplatformsettingspolicy.externalauthsetting (GET/UPDATE)
- updates namespace: contentupdate, contentupdateoperation,
  deviceupgradeinfo
- user.externalauth sub-namespace: externalauth, authconfigobject,
  ldapconfigobject, radiusconfigobject, and three operational endpoints
- troubleshoot.packettracer.pcapdetail (GET/POST)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add fmc_oas3_7.6.5/7.7.12/10.0.1 to gen_docstrings.py's spec lookup;
  it was still pinned to 7.2.5/7.3.1/7.4.2, so new resources' docstrings
  were hand-written and had several incorrect operationId values.
  Regenerated docstrings for affected classes (device.certificate,
  device.managecertificate, integration.aiops.*, integration.ftdcloudstatus,
  integration.cloudintegration, policy.identitypolicy.identitycategory/rule,
  troubleshoot.radkit.service, etc.) and picked up several previously
  undocumented classes as a side effect.
- Add missing SUPPORTED_FILTERS/get()/delete() overrides to
  analysis.IdentifiedUser, with matching entries in mapping.FILTERS.
- Restore alphabetical import/attribute order in integration, policy, and
  device.devicerecord namespaces, broken by the 7.7/10.0 additions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Regenerate the namespace tree via gen_tree.py to include all resources
added for FMC 7.6, 7.7, and 10.0, and bump the stated version coverage
from 7.4.0 to 10.0.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Conflicts:
#	fireREST/fmc/policy/accesspolicy/operational/hitcounts/__init__.py
@cromanme
cromanme requested a review from rchrabas June 18, 2026 21:17
@@ -1,26 +0,0 @@
from fireREST.defaults import API_RELEASE_730

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this one is getting removed? If it was supported at some point by API, I'd assume it should stay?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against the OAS3 specs in this repo: /health/csdac (getCSDACStatus/createCSDACStatus) exists in the 7.3.1 spec but is completely absent from 7.4.2, 7.6.5, 7.7.12, and 10.0.1. Cisco genuinely dropped this endpoint starting with FMC 7.4, so the removal is correct — kept as-is.

@@ -1,9 +1,24 @@
from fireREST.defaults import API_RELEASE_720

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this sitting in a wrong place in directory structure? If we mimic the API placement, then this should go direcly under policies?
endpoint: /policy/s2svpnsummaries

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, you're right. The resource was already wired as a top-level attribute on Policy (self.s2svpnsummary), never nested under FtdS2sVpn — only the directory/import path was left under ftds2svpn/. Moved fireREST/fmc/policy/ftds2svpn/s2svpnsummary/ to fireREST/fmc/policy/s2svpnsummary/ and updated the import in policy/__init__.py to match. Also fixed the README supported-operations tree, which had the same stale nesting.

Comment thread fireREST/exceptions.py Outdated


class RateLimitError(GenericApiError):
"""HTTP 429 — API rate limit exceeded (more than 120 GET requests/min from a single IP)"""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rate limit is version specific, so may get higher. Also I believe this will also trigger on maximum connections.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, that number wasn't safe to hardcode. Reworded to "HTTP 429 — API rate limit exceeded (exact threshold varies by FMC version)" and dropped the specific figure. ConcurrentRequestError remains the distinct case for max-connections.

Comment thread fireREST/exceptions.py Outdated


class RateLimitWriteError(RateLimitError):
"""HTTP 429 — parallel write operation blocked (only one PUT/POST/DELETE per user at a time)"""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it per user or this is a general restriction?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't confirm the exact scope (per-IP vs per-user) or the specific numbers against any spec/doc in this repo, so I removed the unverified claims rather than guess. Docstrings now just say "HTTP 429 — too many concurrent connections" and "HTTP 429 — a parallel write operation was blocked".

Comment thread audit_api.py Outdated
@@ -0,0 +1,461 @@
#!/usr/bin/env python3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this file in repo?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, removed it from version control (it's a dev-only audit script, not used by the package). Also added it to .gitignore so it doesn't get re-added.

Comment thread AUDIT_REPORT.md Outdated
@@ -0,0 +1,659 @@
# fireREST API Audit Report

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this file in repo?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, removed it from version control along with audit_api.py (dev-only artifact; still referenced historically in .claude/commands/firerest.md but not needed in the repo). Added it to .gitignore too.

Comment thread CHANGELOG.md

## New

* Added granular HTTP exception types to `fireREST.exceptions` based on the FMC ResponseStructure:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.3.0 is already out. Move this to new Unreleased section.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right — confirmed v1.3.0 is already tagged and released with different content (just the prefilterpolicy rename + hitcount fix). This branch had renamed the "Unreleased" header to "1.3.0 [2026-06-12]" and merged all of this PR's new content into that already-released version. Restored a proper "Unreleased" section on top for this PR's changes, and verified the restored 1.3.0 section below it is now byte-identical to the v1.3.0 tag.

cromanme and others added 2 commits July 10, 2026 07:14
- Move policy.s2svpnsummary out of ftds2svpn/ into its own top-level
  directory to match its API path (/policy/s2svpnsummaries) and how
  it's already wired in Policy.__init__ (never a child of FtdS2sVpn)
- Drop hardcoded/unverified numbers from RateLimitError,
  ConcurrentRequestError, and RateLimitWriteError docstrings since the
  exact thresholds and scope (per-IP vs per-user) vary by FMC version
  and aren't confirmed by any spec in .llm/
- Remove audit_api.py and AUDIT_REPORT.md from version control; they're
  dev-only artifacts not used by the package. Ignore future audit
  artifacts in .gitignore
- Restore a proper "Unreleased" CHANGELOG section for this branch's
  changes; the prior top section had been mislabeled "1.3.0
  [2026-06-12]", but that version was already tagged and released with
  different content (v1.3.0 tag verified byte-identical after this
  fix)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
s2svpnsummary was moved to a top-level policy resource but the README
tree still listed it under ftds2svpn. Verified against gen_tree.py
output that the tree now matches the filesystem exactly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants