-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CBAPI-3712: guide for Device Actions #494
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall a great guide. A few small changes and it looks good to me
docs/devices.rst
Outdated
# assume "api" is your CBCloudAPI reference | ||
query = api.select(Device) | ||
# add search terms and/or criteria to the query (not shown here) | ||
for d in query: | ||
do_something_with_device(d) # whatever you need for each device | ||
while query.num_remaining > 0: | ||
query.scroll() # default is 10,000 devices at a time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct you can't iterate the query then call scroll. You need to call scroll from the beginning as that also fetches the first 10k devices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm changing this example, so I hope I get it right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scroll function does not act like an internal save within the query object instead it returns the results. See the docs https://carbon-black-cloud-python-sdk.readthedocs.io/en/latest/cbc_sdk.platform/#cbc_sdk.platform.devices.DeviceSearchQuery.scroll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make changes to the guide whether or not you pull content from the user guide
Already done in the last change. Just explaining why things were the way they were. |
Pull request checklist
Please check if your PR fulfills the following requirements:
What is the ticket or issue number?
Pull Request Description
Does this introduce a breaking change?
How Has This Been Tested?