-
code:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
and I got this: |
Beta Was this translation helpful? Give feedback.
-
This looks to be a formatting issue in the payload for the second API operation. We're setting the value of BODY = {
"action_parameters": [
{
"name": "filter",
"value": f"product_type:'{os}'"
}
],
"ids": response['body']['resources']
} I'm a little confused as to why we're using the Uber Class to perform the second call. Since we are already working with the Host Group Service Class (the object named # You should check the content of the resources array to confirm results are returned
# Only one ID can be passed to this operation.
respownse = falcon.perform_group_action(ids=response['body']['resources'][0], action_name="add-hosts", filter=f"product_type:'{os}'") This not only reduces code complexity, but reduces the number of calls made to authenticate and retrieve a token. |
Beta Was this translation helpful? Give feedback.
This looks to be a formatting issue in the payload for the second API operation. We're setting the value of
ids
to beresponse['body']
, but this is not a list, it's a dictionary. If we want to pass the return from our first API call to the second, we need to pass theresources
array.I'm a little confused as to why we're using the Uber Class to perform the second call. Since we are already working with the Host Group Service Class (the object named
falcon
), you should be able to execute the followin…