class Barite::B2
- Barite::B2
- Reference
- Object
Overview
The B2 class is the main API interface.
This object is lazy, in that it will only access Backblaze whien it needs to. If you just create the object then destroy it, no connections will be made to Backblaze.
This also means that you wont know that your authentication is correct until you make an access.
Defined in:
barite.crConstructors
-
.new(key_id : String, key : String)
Initialise with authentication keys.
Instance Method Summary
-
#account_id : String
Retrieve the account_id.
-
#api_token : String
Retrieve the API token.
-
#api_url : String
Retrieve the API URL.
-
#authorize_account
Access backblaze to authenticate.
-
#file(bucket_name : String, file_name : String) : Barite::B2File
Return a B2File object referencing the selected file in the named bucket.
-
#get_bucket_id(bucket_name)
Retrieve the bucket ID for a bucket name.
-
#get_upload_url(bucket_id)
Retrieve an upload URL for a specific bucket.
Constructor Detail
Initialise with authentication keys. The key_id and key are created from your Backblaze login. Ensure that this key has the capabilities that you will need. For example the ability to read and/or write files is the buckets that you'll be using.
Instance Method Detail
Access backblaze to authenticate. Initialises @account_id, @api_url and @api_token on success.
Return a B2File object referencing the selected file in the named bucket.
Retrieve an upload URL for a specific bucket. Raises a Barite::NotFoundException on error.