Getting started with the python SDK part 5: request parameters revisited

Last time out we looked at using request parameters. Stephan Manthey posted a comment on some of the advanced queries with the options parameter he uses and asked how they might be supported in the SDK. We’ll take the use cases one at a time, and show how to build that query.

Removing all management routes by using a globbing wildcard

method: DELETE
query: options=* or options=all

This isn't actually possible via the SDK until version 3.0.17, set to release today or Monday, but you can download the development branch to test it out if you like. I had to add a delete_collection method for this to work. The command to use this method in the SDK is:


x ={'params': 'options=*'}


Removing a set of unused pools by using more specific globbing

method: DELETE
query: options=pool_test_*

Via the SDK:


x ={'params': 'options=pool_test_*'}


Save a specific partition instead of saving all of them

method: POST
query: options=partitions { my_partition }

Via the SDK:


x ='save', requests_params={'params': 'options=partitions { my_partition }'}


Note you can save more than one partition if you like, separated by whitespace within the curly braces.

Retrieve detailed statistics

method: GET
query: options=detail

Via the SDK:


x ={'params': 'options=detail'}


Thanks again to Stephan for sharing the advanced query parameters he uses in his environment, hopefully these quick recipes with how to apply them in the SDK will help to expand your toolbox.

Updated Mar 10, 2023
Version 2.0

Was this article helpful?