b2sdk.account_info.upload_url_pool
– Upload URL pool¶
-
class
b2sdk.account_info.upload_url_pool.
UploadUrlPool
[source]¶ Bases:
object
For each key (either a bucket id or large file id), holds a pool of (url, auth_token) pairs, with thread-safe methods to add and remove them.
-
clear_for_key
(key)[source]¶ Remove an intem from the pool by key
- Parameters
key – bucket ID or large file ID
-
-
class
b2sdk.account_info.upload_url_pool.
UrlPoolAccountInfo
[source]¶ Bases:
b2sdk.account_info.abstract.AbstractAccountInfo
Holder for all account-related information that needs to be kept between API calls, and between invocations of the command-line tool. This includes: account ID, application key, auth tokens, API URL, download URL, and uploads URLs.
This concrete implementation uses an instance of UploadUrlPool as an underlying storage
-
clear_bucket_upload_data
(bucket_id)[source]¶ Removes all upload URLs for the given bucket.
- Parameters
bucket_id (str) – a bucket ID
-
clear_large_file_upload_urls
(file_id)[source]¶ Clear a pool of URLs for a given file ID
- Parameters
file_id (str) – a file ID
-
put_bucket_upload_url
(bucket_id, upload_url, upload_auth_token)[source]¶ Add an (upload_url, upload_auth_token) pair to the pool available for the bucket.
-
put_large_file_upload_url
(file_id, upload_url, upload_auth_token)[source]¶ Put large file upload URL into a pool
-