Perfigent-Org / BackBlaze_B2Net

This project leverages the power of BackBlaze Cloud Storage to simplify interactions with cloud storage services for .NET applications.

Home Page:https://www.perfigent.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BackBlaze Cloud Storage API And Client for .NET (Standard/Core)

License Version

Description

The BackBlaze Cloud Storage API for .NET (Standard/Core) is a versatile library that simplifies interactions with BackBlaze B2 Cloud Storage services for .NET applications. Whether you're building a web application, a desktop tool, or a backend service, this library provides easy-to-use methods for managing files, buckets, and more within your BackBlaze account.

Table of Contents

  1. Installation
  2. Usage
  3. API Documentation
  4. Configuration
  5. Testing
  6. Contributing
  7. License
  8. Contact Information
  9. About BackBlaze Cloud Storage

Installation

You can quickly add the BackBlaze Cloud Storage API library to your .NET project using NuGet:

dotnet add package BackBlaze.Storage

Usage

Initializing the BackBlaze Client To get started, you need to create an instance of the BackBlazeClient class and provide your BackBlaze account credentials:

using BackBlaze.Storage;

var client = new BackBlazeClient("YourAccountID", "YourApplicationKey");

Using the API Interfaces

Files Interface (IFiles) The IFiles interface provides methods for working with files in BackBlaze storage:

// Example usage of IFiles methods
    var file = await client.Delete("fileId", "fileName");
    var download = await client.DownloadById("fileId");
    var uploadUrl = await client.GetUploadUrl();
// ... and more

Buckets Interface (IBuckets) The IBuckets interface provides methods for managing buckets in BackBlaze storage:

// Example usage of IBuckets methods
    var bucket = await client.Create("bucketName", BucketTypes.Private);
    var bucketsList = await client.GetList();
// ... and more

Keys Interface (IKeys) The IKeys interface provides methods for managing API keys in BackBlaze:

// Example usage of IKeys methods
    var keysList = await client.GetList();
    var apiKey = await client.Create("keyName", new[] { "readFiles" });
// ... and more

Large Files Interface (ILargeFiles) The ILargeFiles interface provides methods for working with large files in BackBlaze storage:

// Example usage of ILargeFiles methods
    var largeFile = await client.StartLargeFile("largeFile.txt");
    var uploadPartUrl = await client.GetUploadPartUrl("fileId");
// ... and more

For more details on these interfaces and their methods, please refer to the API documentation.

API Documentation

For in-depth information about the available API endpoints, request parameters, and response formats, consult the API Documentation.

Configuration

The BackBlaze client can be configured using environment variables or a configuration file.

API Configuration

For API configuration, you need to update the appsettings.json file with the following parameters under the "B2Settings" section:

"B2Settings": {
    "KeyId": "YOUR KEY ID",
    "ApplicationKey": "YOUR APPLICATION KEY"
}

Ensure that you provide your actual BackBlaze API Key ID and Application Key in place of the placeholder values.

Client Configuration

To configure the client, create a new instance of the B2NetClient class with the provided settings:

public B2NetClient(B2Settings options) : base(options.KeyId, options.ApplicationKey)

This constructor takes the BackBlaze API Key ID and Application Key as parameters. Be sure to initialize it with the values from your appsettings.json or from your preferred configuration source.

Testing

You can run the provided test cases to ensure the library functions correctly. Follow the instructions below to configure the testing environment.

Configuration

To set up the testing environment, you'll need to update the TestConstants class parameters. Open the TestConstants.cs file and modify the following values:

public static class TestConstants {
    public static string KeyId
    {
        get { return ""; } // Update with your BackBlaze Key ID
    }

    public static string AccountId {
        get { return ""; } // Update with your BackBlaze Account ID
    }

    public static string ApplicationKey {
        get { return ""; } // Update with your BackBlaze Application Key
    }

    public static string BucketId {
        get { return ""; } // Update with your BackBlaze Bucket ID
}

Ensure that you replace the placeholder values with your actual BackBlaze Account ID and Bucket ID where necessary.

After updating these constants, you can proceed to execute the test cases to verify the functionality of the library.

Contributing

We welcome contributions! If you'd like to contribute to this project.

License

This project is licensed under the MIT License. For detailed licensing information, please refer to the LICENSE.md file.

Contact Information

If you have any questions, feedback, or encounter issues, please don't hesitate to reach out:

About BackBlaze Cloud Storage

BackBlaze offers a comprehensive cloud storage solution known as BackBlaze B2 Cloud Storage. It's designed for developers and businesses seeking reliable, scalable, and cost-effective cloud storage services.

Learn more about BackBlaze Cloud Storage on the BackBlaze website. Discover how BackBlaze can help you store and manage your data efficiently.


LIFE RUNS ON CODE

About

This project leverages the power of BackBlaze Cloud Storage to simplify interactions with cloud storage services for .NET applications.

https://www.perfigent.com

License:Apache License 2.0


Languages

Language:C# 100.0%