maple.state.store.add_policy

maple.state.store.add_policy(name: str, image: str, version: str, path: str, repo: str = None) int

Add or update a pulled policy.

Registers a downloaded policy model in the database. If a policy with the same name and version already exists, updates its path, repo, and pulled timestamp.

Parameters:
  • name – Name of the policy model.

  • version – Version identifier of the policy.

  • path – Filesystem path where the policy is stored.

  • repo – Optional repository URL or identifier.

Returns:

Database row ID of the inserted or updated policy.