docs(playbook): note Python SDK v4 requirement and convert examples#218
Merged
Conversation
The Playbook extension's execution environment runs on LimaCharlie Python SDK v4. v5 was just released but is not yet supported in playbooks, so the existing examples (which used v5 imports like limacharlie.sdk.organization.Organization, limacharlie.sdk.hive.Hive, limacharlie.sdk.sensor.Sensor) would not run in the playbook sandbox. - Add a "Python SDK v4 only" warning admonition under the page title, linking to the v4 SDK page and flagging the v5 page as not supported here. - Update the sdk argument description to reference Manager (v4) instead of Organization (v5). - Rewrite the Python invocation example to use limacharlie.Manager() + limacharlie.Extension(man) (singular Extension in v4). - Rewrite the webhook playbook example to use limacharlie.Hive(sdk, "secret") instead of the v5 limacharlie.sdk.hive.Hive import. - Rewrite the missing-sensor playbook and the IaC list-sensors example to use the v4 Manager.sensors() generator and Sensor.getInfo() / .sid, dropping the v5 list_sensors() + Sensor() constructor pattern. Refs: refractionPOINT/tracking#4237 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
limacharlie.Manager()+limacharlie.Extension(man)(singularExtensionin v4) for the Python invocation example.limacharlie.Hive(sdk, "secret").get(name).data[...]for the webhook secret example (instead offrom limacharlie.sdk.hive import Hive).for sensor in sdk.sensors(): info = sensor.getInfo()andsensor.sidfor the missing-sensor and IaC list-sensors examples (instead ofsdk.list_sensors()+Sensor(sdk, sid).get_info()).sdkargument description under Playbook structure to referencelimacharlie.Manager(v4) instead ofOrganization(v5).Why
The Playbook execution environment is pinned to
limacharlie>=4.11.3,<5(see refractionPOINT/ext-playbookext/requirements.txt). The previous examples used v5-only modules (limacharlie.sdk.organization,limacharlie.sdk.hive,limacharlie.sdk.sensor) that wouldImportErrorin the sandbox. Companion PR in ext-playbook adds the same banner to the extension UI: refractionPOINT/ext-playbook#TBD.Refs: https://github.com/refractionPOINT/tracking/issues/4237
Test plan
mkdocs servelocally and confirm the new!!! warning "Python SDK v4 only"admonition renders on the Playbook page.python-sdk.mdandpython-sdk-v4.mdresolve in the rendered site.pip install "limacharlie<5") and confirm imports succeed.🤖 Generated with Claude Code