Skip to content

Pass the documented ID to the path for RunIntegrationTaskAdmin and RunIntegrationTaskV2 - #1538

Open
qianeric-backup wants to merge 1 commit into
CrowdStrike:devfrom
qianeric-backup:fix/aspm-integration-task-path-id
Open

qianeric-backup wants to merge 1 commit into
CrowdStrike:devfrom
qianeric-backup:fix/aspm-integration-task-path-id

Conversation

@qianeric-backup

Copy link
Copy Markdown

RunIntegrationTaskAdmin and RunIntegrationTaskV2 accept the id keyword their docstrings document and then drop it. Both routes declare ID as a required path parameter, so the call is transmitted with the literal placeholder:

ASPM(access_token="...").run_integration_task_admin(id=42)
POST .../aspm-api-gateway/api/v1/integration_tasks/%7B%7D/run/admin

RunIntegrationTask, UpdateIntegrationTask and DeleteIntegrationTask (same file, same route family, same ID declaration) resolve it, and so does the Uber Class for the same operation IDs:

APIHarnessV2(...).command("RunIntegrationTaskAdmin", id=42)
POST .../aspm-api-gateway/api/v1/integration_tasks/42/run/admin

_util/_uber.py already maps RunIntegrationTaskAdmin and RunIntegrationTaskV2 to ["id"]; the Service Class side was never wired.

Change

Both methods now validate the ID the way run_integration_task does and pass it as path_id.

invocation before after
run_integration_task_admin(id=42) /integration_tasks/%7B%7D/run/admin /integration_tasks/42/run/admin
run_integration_task_v2(id=42) /integration_tasks/%7B%7D/run/v2 /integration_tasks/42/run/v2
run_integration_task_admin() request to %7B%7D 400 result, no request
run_integration_task(id=42) /integration_tasks/42/run unchanged
update_integration_task(id=42) /integration_tasks/42 unchanged
delete_integration_task(id=42) /integration_tasks/42 unchanged

Not a breaking change: no public signature, keyword or return type moves.

Test

tests/test_aspm_path_id.py is fully mocked (no credentials, no network). It asserts the transmitted URL for the keyword and parameters forms of both operations, the 400 refusal when the ID is missing, and the unchanged routes of the three siblings.

3 failed, 1 passed   # without the change
4 passed             # with the change

…nIntegrationTaskV2

Both operations document an id keyword, accept it into **kwargs and then drop it, so the
literal {} path placeholder is transmitted. The other three operations in the same route
family resolve the ID, and the Uber Class maps both operation IDs to ["id"] already -
only the Service Class side was never wired.

Validate the ID the way run_integration_task does and pass it as path_id.
@qianeric-backup
qianeric-backup marked this pull request as ready for review December 1, 2026 06:31

This branch has not been deployed

No deployments
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.

1 participant