Backblaze-B2V4
view release on metacpan or search on metacpan
They are continuing to support their native B2 API, so I will continue
to use and support this module. I have not tested the S3 modules with
Backblaze, but if you already have an S3 integration, it is worth
checking out how Paws::S3 or Awes::S3 works with Backblaze.
## Testing Your Credentials
During install, this module will attempt to connect to B2 and download
a 16KB file into memory. To test using your B2 account
credentials, set these environmental varables prior to attempting
to install:
B2_APP_KEY_ID - The application key ID for the key you wish to test.
B2_APP_KEY - The application key -- is never displayed in the B2 UI.
B2_ACCT_ID - Your account ID; will be the ID of your master key
B2_TEST_FILE_ID: The long (75+ char) GUID for your target file.
The GUID for a file is displayed when you click on that file's name
in the 'Browse Files' section of the B2 UI.
lib/Backblaze/B2V4.pm view on Meta::CPAN
They are continuing to support their native B2 API, so I will continue
to use and support this module. I have not tested the S3 modules with
Backblaze, but if you already have an S3 integration, it is worth
checking out how Paws::S3 or Awes::S3 works with Backblaze.
=head2 Testing Your Credentials
During install, this module will attempt to connect to B2 and download
a 16KB file into memory. To test using your B2 account
credentials, set these environmental varables prior to attempting
to install:
B2_APP_KEY_ID - The application key ID for the key you wish to test.
B2_APP_KEY - The application key -- is never displayed in the B2 UI.
B2_ACCT_ID - Your account ID; will be the ID of your master key
B2_TEST_FILE_ID: The long (75+ char) GUID for your target file.
The GUID for a file is displayed when you click on that file's name
in the 'Browse Files' section of the B2 UI.
t/00_compile.t view on Meta::CPAN
my $test_file_id = $ENV{B2_TEST_FILE_ID} || '4_z1dbcfe6ccb7cb959793f0311_f111f065d1a8a36cf_d20200803_m192431_c002_v0001142_t0011';
my $test_bucket_name = $ENV{B2_TEST_BUCKET_NAME} || 'ClientTester';
my $test_file_name = $ENV{B2_TEST_FILE_NAME} || 'ginger.jpeg';
# test logging in
my $b2 = Backblaze::B2V4->new(
application_key => $application_key,
application_key_id => $application_key_id,
);
my $connection_words = 'Could not connect or authenticate to Backblaze. If you set your account ID and application keys, please check those and/or test with the included keys. Please contact me if the supplied credentials are not working.';
ok($b2->api_info->{account_id} eq $account_id, $connection_words );
like($b2->api_info->{account_authorization_token}, qr/4\_$application_key_id/, $connection_words );
# test file download
my $b2_response = $b2->b2_download_file_by_id(file_id => $test_file_id);
ok( ref($b2_response) eq 'HASH', 'Test file could not be downloaded; B2 Msg: ' . $b2->latest_error() );
ok( length($b2_response->{file_contents}) > 15000, 'Test file did not download properly; B2 Msg: ' . $b2->latest_error() );
my $b2_response = $b2->b2_download_file_by_name(
( run in 2.483 seconds using v1.01-cache-2.11-cpan-140bd7fdf52 )