Close an opened pool in Toloka.
Connect the Toloka-Kit library to your script.
import toloka.client as toloka
Replace the sample OAuth token with your own one.
toloka_client = toloka.('AQC2AGAJgyNSA8CtpdO9MWy_QEB6s6kDjHUoElE', 'PRODUCTION');
Find out the ID of the pool you want to close. Then call the close_pool()
method.
closed_pool = toloka_client.('1443858')
The close_pool()
request will return the Pool class object. You can use its attributes to print the information you need.
print(closed_pool.id, closed_pool.status)
You should get an output with the pool ID and the updated status which looks like this.
1443858 Status.CLOSED
import toloka.client as tolokatoloka_client = toloka.TolokaClient('AQC2AGAJgyNSA8CtpdO9MWy_QEB6s6kDjHUoElE', 'PRODUCTION')closed_pool = toloka_client.close_pool('1443858')print(closed_pool.id, closed_pool.status)
[*close_pool]: close_pool() method