calm-dsl
calm-dsl copied to clipboard
Runbooks HTTP task variable failing
Creating a Runbook variable of HTTP type doesn't work when using RunbookVariable and RunbookTask. The error is:
[2021-05-04 12:55:45] [ERROR] [calm.dsl.builtins.models.runbook:134] http_task_get_on_endpoint() takes 0 positional arguments but 1 was given
Example code:
from calm.dsl.runbooks import runbook, runbook_json
from calm.dsl.runbooks import RunbookTask as Task, RunbookVariable as Variable
@runbook
def DslCommunityRunbook():
ntnx_calm_object = Variable.WithOptions.FromTask(
Task.HTTP.get(
"https://api.github.com/repos/nutanixdev/calm-community/contents/",
content_type="application/json",
verify=True,
status_mapping={200: True},
response_paths={"ntnx_calm_object": "$[?(@.type == 'dir')].name"},
),
is_mandatory=True,
)