mirror of
https://github.com/minio/docs.git
synced 2025-07-30 07:03:26 +03:00
General cleanups for driver synchronization (#572)
A few minor cleanups: - Removing the SDK markdown docs from git tracking. They're already tracked in the SDK directories, we don't need to do that twice - Cleaning up the builds, as only Linux needs to build out the SDK docs at this time - Fixing build-docs.sh to build the SDK docs with Linux (so we get proper version numbers). Means we have to build Linux with SYNC_SDK=TRUE on the server to pull in the SDK docs (otherwise they will all be empty). Tested locally and everything seems to work just fine. Will see what happens when it goes live, but I figured I'd ask for @harshavardhana 's thoughts since they know more about the build server script process than I do.
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@ -13,4 +13,10 @@ output.log
|
||||
source/conf.py
|
||||
package-lock.json
|
||||
build.log
|
||||
source/developers/go/*.md
|
||||
source/developers/dotnet/*.md
|
||||
source/developers/haskell/*.md
|
||||
source/developers/java/*.md
|
||||
source/developers/javascript/*.md
|
||||
source/developers/python/*.md
|
||||
*.inv
|
||||
|
28
Makefile
28
Makefile
@ -57,13 +57,6 @@ windows:
|
||||
@cp source/default-conf.py source/conf.py
|
||||
@make sync-minio-version
|
||||
@make sync-kes-version
|
||||
ifeq ($(SYNC_SDK),TRUE)
|
||||
@echo "Synchronizing SDK content. Performing this operation too frequently may result in Github limiting API access"
|
||||
@echo "Omit SYNC_SDK=TRUE to prevent SDK synchronization"
|
||||
@make sync-sdks
|
||||
else
|
||||
@echo "Not synchronizing SDKs, pass SYNC_SDK=TRUE to synchronize SDK content"
|
||||
endif
|
||||
@npm run build
|
||||
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)/$(GITDIR)/$@" $(SPHINXOPTS) $(O) -t $@
|
||||
|
||||
@ -71,13 +64,6 @@ macos:
|
||||
@cp source/default-conf.py source/conf.py
|
||||
@make sync-minio-version
|
||||
@make sync-kes-version
|
||||
ifeq ($(SYNC_SDK),TRUE)
|
||||
@echo "Synchronizing SDK content. Performing this operation too frequently may result in Github limiting API access"
|
||||
@echo "Omit SYNC_SDK=TRUE to prevent SDK synchronization"
|
||||
@make sync-sdks
|
||||
else
|
||||
@echo "Not synchronizing SDKs, pass SYNC_SDK=TRUE to synchronize SDK content"
|
||||
endif
|
||||
@npm run build
|
||||
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)/$(GITDIR)/$@" $(SPHINXOPTS) $(O) -t $@
|
||||
|
||||
@ -86,13 +72,6 @@ k8s:
|
||||
@make sync-operator-version
|
||||
@make sync-minio-version
|
||||
@make sync-kes-version
|
||||
ifeq ($(SYNC_SDK),TRUE)
|
||||
@echo "Synchronizing SDK content. Performing this operation too frequently may result in Github limiting API access"
|
||||
@echo "Omit SYNC_SDK=TRUE to prevent SDK synchronization"
|
||||
@make sync-sdks
|
||||
else
|
||||
@echo "Not synchronizing SDKs, pass SYNC_SDK=TRUE to synchronize SDK content"
|
||||
endif
|
||||
@npm run build
|
||||
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)/$(GITDIR)/$@" $(SPHINXOPTS) $(O) -t $@
|
||||
|
||||
@ -100,13 +79,6 @@ container:
|
||||
@cp source/default-conf.py source/conf.py
|
||||
@make sync-minio-version
|
||||
@make sync-kes-version
|
||||
ifeq ($(SYNC_SDK),TRUE)
|
||||
@echo "Synchronizing SDK content. Performing this operation too frequently may result in Github limiting API access"
|
||||
@echo "Omit SYNC_SDK=TRUE to prevent SDK synchronization"
|
||||
@make sync-sdks
|
||||
else
|
||||
@echo "Not synchronizing SDKs, pass SYNC_SDK=TRUE to synchronize SDK content"
|
||||
endif
|
||||
@npm run build
|
||||
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)/$(GITDIR)/$@" $(SPHINXOPTS) $(O) -t $@
|
||||
|
||||
|
@ -10,7 +10,9 @@ nvm use stable
|
||||
export PATH=${PATH}:${HOME}/.local/bin
|
||||
|
||||
make clean
|
||||
make linux windows macos container k8s
|
||||
make SYNC_SDK=TRUE linux
|
||||
make windows macos container k8s
|
||||
#make linux windows macos container k8s
|
||||
|
||||
sudo rm -rf /var/www/docs/minio/kubernetes/upstream
|
||||
sudo mkdir -p /var/www/docs/minio/kubernetes/upstream
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,212 +0,0 @@
|
||||
# MinIO Client SDK for .NET [](https://slack.min.io)
|
||||
|
||||
MinIO Client SDK provides higher level APIs for MinIO and Amazon S3 compatible cloud storage services.For a complete list of APIs and examples, please take a look at the [Dotnet Client API Reference](https://docs.min.io/docs/dotnet-client-api-reference).This document assumes that you have a working VisualStudio development environment.
|
||||
|
||||
## Minimum Requirements
|
||||
* .NET 5.0
|
||||
* Visual Studio 2017
|
||||
|
||||
## Install from NuGet
|
||||
|
||||
To install [MinIO .NET package](https://www.nuget.org/packages/Minio/), run the following command in Nuget Package Manager Console.
|
||||
```powershell
|
||||
PM> Install-Package Minio
|
||||
```
|
||||
## MinIO Client Example
|
||||
To connect to an Amazon S3 compatible cloud storage service, you will need to specify the following parameters.
|
||||
|
||||
| Parameter | Description|
|
||||
| :--- | :--- |
|
||||
| endpoint | URL to object storage service. |
|
||||
| accessKey | Access key is the user ID that uniquely identifies your account. |
|
||||
| secretKey | Secret key is the password to your account. |
|
||||
| secure | Enable/Disable HTTPS support. |
|
||||
|
||||
The following examples uses a freely hosted public MinIO service 'play.min.io' for development purposes.
|
||||
|
||||
```cs
|
||||
using Minio;
|
||||
|
||||
// Initialize the client with access credentials.
|
||||
private static MinioClient minio = new MinioClient()
|
||||
.WithEndpoint("play.min.io")
|
||||
.WithCredentials("Q3AM3UQ867SPQQA43P2F",
|
||||
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
|
||||
.WithSSL()
|
||||
.Build();
|
||||
|
||||
// Create an async task for listing buckets.
|
||||
var getListBucketsTask = minio.ListBucketsAsync();
|
||||
|
||||
// Iterate over the list of buckets.
|
||||
foreach (Bucket bucket in getListBucketsTask.Result.Buckets)
|
||||
{
|
||||
Console.WriteLine(bucket.Name + " " + bucket.CreationDateDateTime);
|
||||
}
|
||||
|
||||
```
|
||||
## Complete _File Uploader_ Example
|
||||
|
||||
This example program connects to an object storage server, creates a bucket and uploads a file to the bucket.
|
||||
To run the following example, click on [Link] and start the project
|
||||
```cs
|
||||
using System;
|
||||
using Minio;
|
||||
using Minio.Exceptions;
|
||||
using Minio.DataModel;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FileUploader
|
||||
{
|
||||
class FileUpload
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var endpoint = "play.min.io";
|
||||
var accessKey = "Q3AM3UQ867SPQQA43P2F";
|
||||
var secretKey = "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG";
|
||||
try
|
||||
{
|
||||
var minio = new MinioClient()
|
||||
.WithEndpoint(endpoint)
|
||||
.WithCredentials(accessKey,
|
||||
secretKey)
|
||||
.WithSSL()
|
||||
.Build();
|
||||
FileUpload.Run(minio).Wait();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
Console.ReadLine();
|
||||
}
|
||||
|
||||
// File uploader task.
|
||||
private async static Task Run(MinioClient minio)
|
||||
{
|
||||
var bucketName = "mymusic";
|
||||
var location = "us-east-1";
|
||||
var objectName = "golden-oldies.zip";
|
||||
var filePath = "C:\\Users\\username\\Downloads\\golden_oldies.mp3";
|
||||
var contentType = "application/zip";
|
||||
|
||||
try
|
||||
{
|
||||
// Make a bucket on the server, if not already present.
|
||||
bool found = await minio.BucketExistsAsync(bucketName);
|
||||
if (!found)
|
||||
{
|
||||
await minio.MakeBucketAsync(bucketName, location);
|
||||
}
|
||||
// Upload a file to bucket.
|
||||
await minio.PutObjectAsync(bucketName, objectName, filePath, contentType);
|
||||
Console.WriteLine("Successfully uploaded " + objectName );
|
||||
}
|
||||
catch (MinioException e)
|
||||
{
|
||||
Console.WriteLine("File Upload Error: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Running MinIO Client Examples
|
||||
#### On Windows
|
||||
* Clone this repository and open the Minio.Sln in Visual Studio 2017.
|
||||
|
||||
* Enter your credentials and bucket name, object name etc.in Minio.Examples/Program.cs
|
||||
Uncomment the example test cases such as below in Program.cs to run an example.
|
||||
```cs
|
||||
//Cases.MakeBucket.Run(minioClient, bucketName).Wait();
|
||||
```
|
||||
* Run the Minio.Client.Examples project from Visual Studio
|
||||
#### On Linux
|
||||
|
||||
##### Setting .NET SDK on Linux (Ubuntu 21.10)
|
||||
<blockquote> NOTE: minio-dotnet requires .NET 5.x SDK to build on Linux. </blockquote>
|
||||
|
||||
* Install [.Net SDK](https://docs.microsoft.com/en-us/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website)
|
||||
|
||||
```
|
||||
wget https://packages.microsoft.com/config/ubuntu/21.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
|
||||
sudo dpkg -i packages-microsoft-prod.deb
|
||||
rm packages-microsoft-prod.deb
|
||||
```
|
||||
|
||||
```
|
||||
sudo apt-get update; \
|
||||
sudo apt-get install -y apt-transport-https && \
|
||||
sudo apt-get update && \
|
||||
sudo apt-get install -y dotnet-sdk-5.0
|
||||
```
|
||||
|
||||
##### Running Minio.Examples
|
||||
* Clone this project.
|
||||
|
||||
```
|
||||
$ git clone https://github.com/minio/minio-dotnet && cd minio-dotnet
|
||||
```
|
||||
|
||||
* Enter your credentials and bucket name, object name etc. in Minio.Examples/Program.cs
|
||||
Uncomment the example test cases such as below in Program.cs to run an example.
|
||||
```cs
|
||||
//Cases.MakeBucket.Run(minioClient, bucketName).Wait();
|
||||
```
|
||||
|
||||
```
|
||||
dotnet build --configuration Release --no-restore
|
||||
dotnet pack ./Minio/Minio.csproj --no-build --configuration Release --output ./artifacts
|
||||
dotnet test ./Minio.Tests/Minio.Tests.csproj
|
||||
```
|
||||
|
||||
#### Bucket Operations
|
||||
|
||||
* [MakeBucket.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/MakeBucket.cs)
|
||||
* [ListBuckets.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/ListBuckets.cs)
|
||||
* [BucketExists.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/BucketExists.cs)
|
||||
* [RemoveBucket.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/RemoveBucket.cs)
|
||||
* [ListObjects.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/ListObjects.cs)
|
||||
* [ListIncompleteUploads.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/ListIncompleteUploads.cs)
|
||||
* [ListenBucketNotifications.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/ListenBucketNotifications.cs)
|
||||
|
||||
#### Bucket policy Operations
|
||||
* [GetPolicy.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/GetBucketPolicy.cs)
|
||||
* [SetPolicy.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/SetBucketPolicy.cs)
|
||||
|
||||
#### Bucket notification Operations
|
||||
* [GetBucketNotification.cs](/Minio.Examples/Cases/GetBucketNotification.cs)
|
||||
* [SetBucketNotification.cs](/Minio.Examples/Cases/SetBucketNotification.cs)
|
||||
* [RemoveAllBucketNotifications.cs](/Minio.Examples/Cases/RemoveAllBucketNotifications.cs)
|
||||
|
||||
#### File Object Operations
|
||||
* [FGetObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/FGetObject.cs)
|
||||
* [FPutObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/FPutObject.cs)
|
||||
|
||||
#### Object Operations
|
||||
* [GetObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/GetObject.cs)
|
||||
* [GetPartialObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/GetPartialObject.cs)
|
||||
* [SelectObjectContent.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/SelectObjectContent.cs)
|
||||
|
||||
* [PutObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/PutObject.cs)
|
||||
* [StatObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/StatObject.cs)
|
||||
* [RemoveObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/RemoveObject.cs)
|
||||
* [RemoveObjects.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/RemoveObjects.cs)
|
||||
* [CopyObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/CopyObject.cs)
|
||||
* [CopyObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/CopyObjectMetadata.cs)
|
||||
* [RemoveIncompleteUpload.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/RemoveIncompleteUpload.cs)
|
||||
|
||||
#### Presigned Operations
|
||||
* [PresignedGetObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/PresignedGetObject.cs)
|
||||
* [PresignedPutObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/PresignedPutObject.cs)
|
||||
* [PresignedPostPolicy.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/PresignedPostPolicy.cs)
|
||||
|
||||
#### Client Custom Settings
|
||||
* [SetAppInfo](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Program.cs)
|
||||
* [SetTraceOn](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Program.cs)
|
||||
* [SetTraceOff](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Program.cs)
|
||||
|
||||
## Explore Further
|
||||
* [Complete Documentation](https://docs.min.io)
|
||||
* [MinIO .NET SDK API Reference](https://docs.min.io/docs/dotnet-client-api-reference)
|
File diff suppressed because it is too large
Load Diff
@ -1,246 +0,0 @@
|
||||
# MinIO Go Client SDK for Amazon S3 Compatible Cloud Storage [](https://slack.min.io) [](https://sourcegraph.com/github.com/minio/minio-go?badge) [](https://github.com/minio/minio-go/blob/master/LICENSE)
|
||||
|
||||
The MinIO Go Client SDK provides simple APIs to access any Amazon S3 compatible object storage.
|
||||
|
||||
This quickstart guide will show you how to install the MinIO client SDK, connect to MinIO, and provide a walkthrough for a simple file uploader. For a complete list of APIs and examples, please take a look at the [Go Client API Reference](https://docs.min.io/docs/golang-client-api-reference).
|
||||
|
||||
This document assumes that you have a working [Go development environment](https://golang.org/doc/install).
|
||||
|
||||
## Download from Github
|
||||
```sh
|
||||
go get github.com/minio/minio-go/v7
|
||||
```
|
||||
|
||||
## Initialize MinIO Client
|
||||
MinIO client requires the following four parameters specified to connect to an Amazon S3 compatible object storage.
|
||||
|
||||
| Parameter | Description|
|
||||
| :--- | :--- |
|
||||
| endpoint | URL to object storage service. |
|
||||
| _minio.Options_ | All the options such as credentials, custom transport etc. |
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/minio/minio-go/v7"
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
)
|
||||
|
||||
func main() {
|
||||
endpoint := "play.min.io"
|
||||
accessKeyID := "Q3AM3UQ867SPQQA43P2F"
|
||||
secretAccessKey := "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"
|
||||
useSSL := true
|
||||
|
||||
// Initialize minio client object.
|
||||
minioClient, err := minio.New(endpoint, &minio.Options{
|
||||
Creds: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""),
|
||||
Secure: useSSL,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
log.Printf("%#v\n", minioClient) // minioClient is now set up
|
||||
}
|
||||
```
|
||||
|
||||
## Quick Start Example - File Uploader
|
||||
This example program connects to an object storage server, creates a bucket and uploads a file to the bucket.
|
||||
|
||||
We will use the MinIO server running at [https://play.min.io](https://play.min.io) in this example. Feel free to use this service for testing and development. Access credentials shown in this example are open to the public.
|
||||
|
||||
### FileUploader.go
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"github.com/minio/minio-go/v7"
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
endpoint := "play.min.io"
|
||||
accessKeyID := "Q3AM3UQ867SPQQA43P2F"
|
||||
secretAccessKey := "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"
|
||||
useSSL := true
|
||||
|
||||
// Initialize minio client object.
|
||||
minioClient, err := minio.New(endpoint, &minio.Options{
|
||||
Creds: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""),
|
||||
Secure: useSSL,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
// Make a new bucket called mymusic.
|
||||
bucketName := "mymusic"
|
||||
location := "us-east-1"
|
||||
|
||||
err = minioClient.MakeBucket(ctx, bucketName, minio.MakeBucketOptions{Region: location})
|
||||
if err != nil {
|
||||
// Check to see if we already own this bucket (which happens if you run this twice)
|
||||
exists, errBucketExists := minioClient.BucketExists(ctx, bucketName)
|
||||
if errBucketExists == nil && exists {
|
||||
log.Printf("We already own %s\n", bucketName)
|
||||
} else {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
} else {
|
||||
log.Printf("Successfully created %s\n", bucketName)
|
||||
}
|
||||
|
||||
// Upload the zip file
|
||||
objectName := "golden-oldies.zip"
|
||||
filePath := "/tmp/golden-oldies.zip"
|
||||
contentType := "application/zip"
|
||||
|
||||
// Upload the zip file with FPutObject
|
||||
info, err := minioClient.FPutObject(ctx, bucketName, objectName, filePath, minio.PutObjectOptions{ContentType: contentType})
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
log.Printf("Successfully uploaded %s of size %d\n", objectName, info.Size)
|
||||
}
|
||||
```
|
||||
|
||||
### Run FileUploader
|
||||
```sh
|
||||
go run file-uploader.go
|
||||
2016/08/13 17:03:28 Successfully created mymusic
|
||||
2016/08/13 17:03:40 Successfully uploaded golden-oldies.zip of size 16253413
|
||||
|
||||
mc ls play/mymusic/
|
||||
[2016-05-27 16:02:16 PDT] 17MiB golden-oldies.zip
|
||||
```
|
||||
|
||||
## API Reference
|
||||
The full API Reference is available here.
|
||||
|
||||
* [Complete API Reference](https://docs.min.io/docs/golang-client-api-reference)
|
||||
|
||||
### API Reference : Bucket Operations
|
||||
* [`MakeBucket`](https://docs.min.io/docs/golang-client-api-reference#MakeBucket)
|
||||
* [`ListBuckets`](https://docs.min.io/docs/golang-client-api-reference#ListBuckets)
|
||||
* [`BucketExists`](https://docs.min.io/docs/golang-client-api-reference#BucketExists)
|
||||
* [`RemoveBucket`](https://docs.min.io/docs/golang-client-api-reference#RemoveBucket)
|
||||
* [`ListObjects`](https://docs.min.io/docs/golang-client-api-reference#ListObjects)
|
||||
* [`ListIncompleteUploads`](https://docs.min.io/docs/golang-client-api-reference#ListIncompleteUploads)
|
||||
|
||||
### API Reference : Bucket policy Operations
|
||||
* [`SetBucketPolicy`](https://docs.min.io/docs/golang-client-api-reference#SetBucketPolicy)
|
||||
* [`GetBucketPolicy`](https://docs.min.io/docs/golang-client-api-reference#GetBucketPolicy)
|
||||
|
||||
### API Reference : Bucket notification Operations
|
||||
* [`SetBucketNotification`](https://docs.min.io/docs/golang-client-api-reference#SetBucketNotification)
|
||||
* [`GetBucketNotification`](https://docs.min.io/docs/golang-client-api-reference#GetBucketNotification)
|
||||
* [`RemoveAllBucketNotification`](https://docs.min.io/docs/golang-client-api-reference#RemoveAllBucketNotification)
|
||||
* [`ListenBucketNotification`](https://docs.min.io/docs/golang-client-api-reference#ListenBucketNotification) (MinIO Extension)
|
||||
* [`ListenNotification`](https://docs.min.io/docs/golang-client-api-reference#ListenNotification) (MinIO Extension)
|
||||
|
||||
### API Reference : File Object Operations
|
||||
* [`FPutObject`](https://docs.min.io/docs/golang-client-api-reference#FPutObject)
|
||||
* [`FGetObject`](https://docs.min.io/docs/golang-client-api-reference#FGetObject)
|
||||
|
||||
### API Reference : Object Operations
|
||||
* [`GetObject`](https://docs.min.io/docs/golang-client-api-reference#GetObject)
|
||||
* [`PutObject`](https://docs.min.io/docs/golang-client-api-reference#PutObject)
|
||||
* [`PutObjectStreaming`](https://docs.min.io/docs/golang-client-api-reference#PutObjectStreaming)
|
||||
* [`StatObject`](https://docs.min.io/docs/golang-client-api-reference#StatObject)
|
||||
* [`CopyObject`](https://docs.min.io/docs/golang-client-api-reference#CopyObject)
|
||||
* [`RemoveObject`](https://docs.min.io/docs/golang-client-api-reference#RemoveObject)
|
||||
* [`RemoveObjects`](https://docs.min.io/docs/golang-client-api-reference#RemoveObjects)
|
||||
* [`RemoveIncompleteUpload`](https://docs.min.io/docs/golang-client-api-reference#RemoveIncompleteUpload)
|
||||
* [`SelectObjectContent`](https://docs.min.io/docs/golang-client-api-reference#SelectObjectContent)
|
||||
|
||||
|
||||
### API Reference : Presigned Operations
|
||||
* [`PresignedGetObject`](https://docs.min.io/docs/golang-client-api-reference#PresignedGetObject)
|
||||
* [`PresignedPutObject`](https://docs.min.io/docs/golang-client-api-reference#PresignedPutObject)
|
||||
* [`PresignedHeadObject`](https://docs.min.io/docs/golang-client-api-reference#PresignedHeadObject)
|
||||
* [`PresignedPostPolicy`](https://docs.min.io/docs/golang-client-api-reference#PresignedPostPolicy)
|
||||
|
||||
### API Reference : Client custom settings
|
||||
* [`SetAppInfo`](https://docs.min.io/docs/golang-client-api-reference#SetAppInfo)
|
||||
* [`TraceOn`](https://docs.min.io/docs/golang-client-api-reference#TraceOn)
|
||||
* [`TraceOff`](https://docs.min.io/docs/golang-client-api-reference#TraceOff)
|
||||
|
||||
## Full Examples
|
||||
|
||||
### Full Examples : Bucket Operations
|
||||
* [makebucket.go](https://github.com/minio/minio-go/blob/master/examples/s3/makebucket.go)
|
||||
* [listbuckets.go](https://github.com/minio/minio-go/blob/master/examples/s3/listbuckets.go)
|
||||
* [bucketexists.go](https://github.com/minio/minio-go/blob/master/examples/s3/bucketexists.go)
|
||||
* [removebucket.go](https://github.com/minio/minio-go/blob/master/examples/s3/removebucket.go)
|
||||
* [listobjects.go](https://github.com/minio/minio-go/blob/master/examples/s3/listobjects.go)
|
||||
* [listobjectsV2.go](https://github.com/minio/minio-go/blob/master/examples/s3/listobjectsV2.go)
|
||||
* [listincompleteuploads.go](https://github.com/minio/minio-go/blob/master/examples/s3/listincompleteuploads.go)
|
||||
|
||||
### Full Examples : Bucket policy Operations
|
||||
* [setbucketpolicy.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketpolicy.go)
|
||||
* [getbucketpolicy.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketpolicy.go)
|
||||
* [listbucketpolicies.go](https://github.com/minio/minio-go/blob/master/examples/s3/listbucketpolicies.go)
|
||||
|
||||
### Full Examples : Bucket lifecycle Operations
|
||||
* [setbucketlifecycle.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketlifecycle.go)
|
||||
* [getbucketlifecycle.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketlifecycle.go)
|
||||
|
||||
### Full Examples : Bucket encryption Operations
|
||||
* [setbucketencryption.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketencryption.go)
|
||||
* [getbucketencryption.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketencryption.go)
|
||||
* [deletebucketencryption.go](https://github.com/minio/minio-go/blob/master/examples/s3/deletebucketencryption.go)
|
||||
|
||||
### Full Examples : Bucket replication Operations
|
||||
* [setbucketreplication.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketreplication.go)
|
||||
* [getbucketreplication.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketreplication.go)
|
||||
* [removebucketreplication.go](https://github.com/minio/minio-go/blob/master/examples/s3/removebucketreplication.go)
|
||||
|
||||
### Full Examples : Bucket notification Operations
|
||||
* [setbucketnotification.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketnotification.go)
|
||||
* [getbucketnotification.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketnotification.go)
|
||||
* [removeallbucketnotification.go](https://github.com/minio/minio-go/blob/master/examples/s3/removeallbucketnotification.go)
|
||||
* [listenbucketnotification.go](https://github.com/minio/minio-go/blob/master/examples/minio/listenbucketnotification.go) (MinIO Extension)
|
||||
* [listennotification.go](https://github.com/minio/minio-go/blob/master/examples/minio/listen-notification.go) (MinIO Extension)
|
||||
|
||||
### Full Examples : File Object Operations
|
||||
* [fputobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/fputobject.go)
|
||||
* [fgetobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/fgetobject.go)
|
||||
|
||||
### Full Examples : Object Operations
|
||||
* [putobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/putobject.go)
|
||||
* [getobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/getobject.go)
|
||||
* [statobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/statobject.go)
|
||||
* [copyobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/copyobject.go)
|
||||
* [removeobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/removeobject.go)
|
||||
* [removeincompleteupload.go](https://github.com/minio/minio-go/blob/master/examples/s3/removeincompleteupload.go)
|
||||
* [removeobjects.go](https://github.com/minio/minio-go/blob/master/examples/s3/removeobjects.go)
|
||||
|
||||
### Full Examples : Encrypted Object Operations
|
||||
* [put-encrypted-object.go](https://github.com/minio/minio-go/blob/master/examples/s3/put-encrypted-object.go)
|
||||
* [get-encrypted-object.go](https://github.com/minio/minio-go/blob/master/examples/s3/get-encrypted-object.go)
|
||||
* [fput-encrypted-object.go](https://github.com/minio/minio-go/blob/master/examples/s3/fputencrypted-object.go)
|
||||
|
||||
### Full Examples : Presigned Operations
|
||||
* [presignedgetobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/presignedgetobject.go)
|
||||
* [presignedputobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/presignedputobject.go)
|
||||
* [presignedheadobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/presignedheadobject.go)
|
||||
* [presignedpostpolicy.go](https://github.com/minio/minio-go/blob/master/examples/s3/presignedpostpolicy.go)
|
||||
|
||||
## Explore Further
|
||||
* [Complete Documentation](https://docs.min.io)
|
||||
* [MinIO Go Client SDK API Reference](https://docs.min.io/docs/golang-client-api-reference)
|
||||
|
||||
## Contribute
|
||||
[Contributors Guide](https://github.com/minio/minio-go/blob/master/CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
This SDK is distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0), see [LICENSE](https://github.com/minio/minio-go/blob/master/LICENSE) and [NOTICE](https://github.com/minio/minio-go/blob/master/NOTICE) for more information.
|
File diff suppressed because it is too large
Load Diff
@ -1,177 +0,0 @@
|
||||
# MinIO Client SDK for Haskell [](https://travis-ci.org/minio/minio-hs)[](https://hackage.haskell.org/package/minio-hs)[](https://slack.min.io)
|
||||
|
||||
The MinIO Haskell Client SDK provides simple APIs to access [MinIO](https://min.io) and Amazon S3 compatible object storage server.
|
||||
|
||||
## Minimum Requirements
|
||||
|
||||
- The Haskell [stack](https://docs.haskellstack.org/en/stable/README/)
|
||||
|
||||
## Installation
|
||||
|
||||
### Add to your project
|
||||
|
||||
Simply add `minio-hs` to your project's `.cabal` dependencies section or if you are using hpack, to your `package.yaml` file as usual.
|
||||
|
||||
### Try it out directly with `ghci`
|
||||
|
||||
From your home folder or any non-haskell project directory, just run:
|
||||
|
||||
```sh
|
||||
|
||||
stack install minio-hs
|
||||
|
||||
```
|
||||
|
||||
Then start an interpreter session and browse the available APIs with:
|
||||
|
||||
```sh
|
||||
|
||||
$ stack ghci
|
||||
> :browse Network.Minio
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
The [examples](https://github.com/minio/minio-hs/tree/master/examples) folder contains many examples that you can try out and use to learn and to help with developing your own projects.
|
||||
|
||||
### Quick-Start Example - File Uploader
|
||||
|
||||
This example program connects to a MinIO object storage server, makes a bucket on the server and then uploads a file to the bucket.
|
||||
|
||||
We will use the MinIO server running at https://play.min.io in this example. Feel free to use this service for testing and development. Access credentials are present in the library and are open to the public.
|
||||
|
||||
### FileUploader.hs
|
||||
``` haskell
|
||||
#!/usr/bin/env stack
|
||||
-- stack --resolver lts-14.11 runghc --package minio-hs --package optparse-applicative --package filepath
|
||||
|
||||
--
|
||||
-- MinIO Haskell SDK, (C) 2017-2019 MinIO, Inc.
|
||||
--
|
||||
-- Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-- you may not use this file except in compliance with the License.
|
||||
-- You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing, software
|
||||
-- distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
--
|
||||
|
||||
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
import Network.Minio
|
||||
|
||||
import Data.Monoid ((<>))
|
||||
import Data.Text (pack)
|
||||
import Options.Applicative
|
||||
import System.FilePath.Posix
|
||||
import UnliftIO (throwIO, try)
|
||||
|
||||
import Prelude
|
||||
|
||||
-- | The following example uses minio's play server at
|
||||
-- https://play.min.io. The endpoint and associated
|
||||
-- credentials are provided via the libary constant,
|
||||
--
|
||||
-- > minioPlayCI :: ConnectInfo
|
||||
--
|
||||
|
||||
-- optparse-applicative package based command-line parsing.
|
||||
fileNameArgs :: Parser FilePath
|
||||
fileNameArgs = strArgument
|
||||
(metavar "FILENAME"
|
||||
<> help "Name of file to upload to AWS S3 or a MinIO server")
|
||||
|
||||
cmdParser = info
|
||||
(helper <*> fileNameArgs)
|
||||
(fullDesc
|
||||
<> progDesc "FileUploader"
|
||||
<> header
|
||||
"FileUploader - a simple file-uploader program using minio-hs")
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
let bucket = "my-bucket"
|
||||
|
||||
-- Parse command line argument
|
||||
filepath <- execParser cmdParser
|
||||
let object = pack $ takeBaseName filepath
|
||||
|
||||
res <- runMinio minioPlayCI $ do
|
||||
-- Make a bucket; catch bucket already exists exception if thrown.
|
||||
bErr <- try $ makeBucket bucket Nothing
|
||||
|
||||
-- If the bucket already exists, we would get a specific
|
||||
-- `ServiceErr` exception thrown.
|
||||
case bErr of
|
||||
Left BucketAlreadyOwnedByYou -> return ()
|
||||
Left e -> throwIO e
|
||||
Right _ -> return ()
|
||||
|
||||
-- Upload filepath to bucket; object name is derived from filepath.
|
||||
fPutObject bucket object filepath defaultPutObjectOptions
|
||||
|
||||
case res of
|
||||
Left e -> putStrLn $ "file upload failed due to " ++ show e
|
||||
Right () -> putStrLn "file upload succeeded."
|
||||
```
|
||||
|
||||
### Run FileUploader
|
||||
|
||||
``` sh
|
||||
./FileUploader.hs "path/to/my/file"
|
||||
|
||||
```
|
||||
|
||||
## Contribute
|
||||
|
||||
[Contributors Guide](https://github.com/minio/minio-hs/blob/master/CONTRIBUTING.md)
|
||||
|
||||
### Development
|
||||
|
||||
To setup:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/minio/minio-hs.git
|
||||
|
||||
cd minio-hs/
|
||||
|
||||
stack install
|
||||
```
|
||||
|
||||
Tests can be run with:
|
||||
|
||||
```sh
|
||||
|
||||
stack test
|
||||
|
||||
```
|
||||
|
||||
A section of the tests use the remote MinIO Play server at `https://play.min.io` by default. For library development, using this remote server maybe slow. To run the tests against a locally running MinIO live server at `http://localhost:9000`, just set the environment `MINIO_LOCAL` to any value (and unset it to switch back to Play).
|
||||
|
||||
To run the live server tests, set a build flag as shown below:
|
||||
|
||||
```sh
|
||||
|
||||
stack test --flag minio-hs:live-test
|
||||
|
||||
# OR against a local MinIO server with:
|
||||
|
||||
MINIO_LOCAL=1 stack test --flag minio-hs:live-test
|
||||
|
||||
```
|
||||
|
||||
The configured CI system always runs both test-suites for every change.
|
||||
|
||||
Documentation can be locally built with:
|
||||
|
||||
```sh
|
||||
|
||||
stack haddock
|
||||
|
||||
```
|
File diff suppressed because it is too large
Load Diff
@ -1,117 +0,0 @@
|
||||
# MinIO Java SDK for Amazon S3 Compatible Cloud Storage [](https://slack.min.io)
|
||||
|
||||
MinIO Java SDK is Simple Storage Service (aka S3) client to perform bucket and object operations to any Amazon S3 compatible object storage service.
|
||||
|
||||
For a complete list of APIs and examples, please take a look at the [Java Client API Reference](https://docs.min.io/docs/java-client-api-reference) documentation.
|
||||
|
||||
## Minimum Requirements
|
||||
Java 1.8 or above.
|
||||
|
||||
## Maven usage
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>8.4.4</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
## Gradle usage
|
||||
```
|
||||
dependencies {
|
||||
implementation("io.minio:minio:8.4.4")
|
||||
}
|
||||
```
|
||||
|
||||
## JAR download
|
||||
The latest JAR can be downloaded from [here](https://repo1.maven.org/maven2/io/minio/minio/8.4.4/)
|
||||
|
||||
## Quick Start Example - File Uploader
|
||||
This example program connects to an object storage server, makes a bucket on the server and then uploads a file to the bucket.
|
||||
|
||||
You need three items in order to connect to an object storage server.
|
||||
|
||||
| Parameters | Description |
|
||||
|------------|------------------------------------------------------------|
|
||||
| Endpoint | URL to S3 service. |
|
||||
| Access Key | Access key (aka user ID) of an account in the S3 service. |
|
||||
| Secret Key | Secret key (aka password) of an account in the S3 service. |
|
||||
|
||||
This example uses MinIO server playground [https://play.min.io](https://play.min.io). Feel free to use this service for test and development.
|
||||
|
||||
### FileUploader.java
|
||||
```java
|
||||
import io.minio.BucketExistsArgs;
|
||||
import io.minio.MakeBucketArgs;
|
||||
import io.minio.MinioClient;
|
||||
import io.minio.UploadObjectArgs;
|
||||
import io.minio.errors.MinioException;
|
||||
import java.io.IOException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public class FileUploader {
|
||||
public static void main(String[] args)
|
||||
throws IOException, NoSuchAlgorithmException, InvalidKeyException {
|
||||
try {
|
||||
// Create a minioClient with the MinIO server playground, its access key and secret key.
|
||||
MinioClient minioClient =
|
||||
MinioClient.builder()
|
||||
.endpoint("https://play.min.io")
|
||||
.credentials("Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
|
||||
.build();
|
||||
|
||||
// Make 'asiatrip' bucket if not exist.
|
||||
boolean found =
|
||||
minioClient.bucketExists(BucketExistsArgs.builder().bucket("asiatrip").build());
|
||||
if (!found) {
|
||||
// Make a new bucket called 'asiatrip'.
|
||||
minioClient.makeBucket(MakeBucketArgs.builder().bucket("asiatrip").build());
|
||||
} else {
|
||||
System.out.println("Bucket 'asiatrip' already exists.");
|
||||
}
|
||||
|
||||
// Upload '/home/user/Photos/asiaphotos.zip' as object name 'asiaphotos-2015.zip' to bucket
|
||||
// 'asiatrip'.
|
||||
minioClient.uploadObject(
|
||||
UploadObjectArgs.builder()
|
||||
.bucket("asiatrip")
|
||||
.object("asiaphotos-2015.zip")
|
||||
.filename("/home/user/Photos/asiaphotos.zip")
|
||||
.build());
|
||||
System.out.println(
|
||||
"'/home/user/Photos/asiaphotos.zip' is successfully uploaded as "
|
||||
+ "object 'asiaphotos-2015.zip' to bucket 'asiatrip'.");
|
||||
} catch (MinioException e) {
|
||||
System.out.println("Error occurred: " + e);
|
||||
System.out.println("HTTP trace: " + e.httpTrace());
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Compile FileUploader
|
||||
```sh
|
||||
$ javac -cp minio-8.4.4-all.jar FileUploader.java
|
||||
```
|
||||
|
||||
#### Run FileUploader
|
||||
```sh
|
||||
$ java -cp minio-8.4.4-all.jar:. FileUploader
|
||||
'/home/user/Photos/asiaphotos.zip' is successfully uploaded as object 'asiaphotos-2015.zip' to bucket 'asiatrip'.
|
||||
|
||||
$ mc ls play/asiatrip/
|
||||
[2016-06-02 18:10:29 PDT] 82KiB asiaphotos-2015.zip
|
||||
```
|
||||
|
||||
## More References
|
||||
* [Java Client API Reference](https://docs.min.io/docs/java-client-api-reference)
|
||||
* [Javadoc](https://minio-java.min.io/)
|
||||
* [Examples](https://github.com/minio/minio-java/tree/release/examples)
|
||||
|
||||
## Explore Further
|
||||
* [Complete Documentation](https://docs.min.io)
|
||||
* [Build your own Photo API Service - Full Application Example ](https://github.com/minio/minio-java-rest-example)
|
||||
|
||||
## Contribute
|
||||
Please refer [Contributors Guide](https://github.com/minio/minio-java/blob/release/CONTRIBUTING.md)
|
File diff suppressed because it is too large
Load Diff
@ -1,248 +0,0 @@
|
||||
# MinIO JavaScript Library for Amazon S3 Compatible Cloud Storage [](https://slack.min.io)
|
||||
|
||||
[](https://nodei.co/npm/minio/)
|
||||
|
||||
The MinIO JavaScript Client SDK provides simple APIs to access any Amazon S3 compatible object storage server.
|
||||
|
||||
This quickstart guide will show you how to install the client SDK and execute an example JavaScript program. For a complete list of APIs and examples, please take a look at the [JavaScript Client API Reference](https://docs.min.io/docs/javascript-client-api-reference) documentation.
|
||||
|
||||
This document assumes that you have a working [nodejs](http://nodejs.org/) setup in place.
|
||||
|
||||
|
||||
## Download from NPM
|
||||
|
||||
```sh
|
||||
npm install --save minio
|
||||
```
|
||||
|
||||
## Download from Source
|
||||
|
||||
```sh
|
||||
git clone https://github.com/minio/minio-js
|
||||
cd minio-js
|
||||
npm install
|
||||
npm install -g
|
||||
```
|
||||
|
||||
## Using with TypeScript
|
||||
|
||||
```sh
|
||||
npm install --save-dev @types/minio
|
||||
```
|
||||
|
||||
## Initialize MinIO Client
|
||||
|
||||
You need five items in order to connect to MinIO object storage server.
|
||||
|
||||
|
||||
| Params | Description |
|
||||
| :------- | :------------ |
|
||||
| endPoint | URL to object storage service. |
|
||||
|port| TCP/IP port number. This input is optional. Default value set to ``80`` for HTTP and ``443`` for HTTPs.|
|
||||
| accessKey | Access key is like user ID that uniquely identifies your account. |
|
||||
| secretKey | Secret key is the password to your account. |
|
||||
|useSSL |Set this value to 'true' to enable secure (HTTPS) access |
|
||||
|
||||
|
||||
```js
|
||||
var Minio = require('minio')
|
||||
|
||||
var minioClient = new Minio.Client({
|
||||
endPoint: 'play.min.io',
|
||||
port: 9000,
|
||||
useSSL: true,
|
||||
accessKey: 'Q3AM3UQ867SPQQA43P2F',
|
||||
secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG'
|
||||
});
|
||||
```
|
||||
|
||||
## Quick Start Example - File Uploader
|
||||
|
||||
This example program connects to an object storage server, makes a bucket on the server and then uploads a file to the bucket.
|
||||
|
||||
We will use the MinIO server running at [https://play.min.io](https://play.min.io) in this example. Feel free to use this service for testing and development. Access credentials shown in this example are open to the public.
|
||||
|
||||
#### file-uploader.js
|
||||
|
||||
```js
|
||||
var Minio = require('minio')
|
||||
|
||||
// Instantiate the minio client with the endpoint
|
||||
// and access keys as shown below.
|
||||
var minioClient = new Minio.Client({
|
||||
endPoint: 'play.min.io',
|
||||
port: 9000,
|
||||
useSSL: true,
|
||||
accessKey: 'Q3AM3UQ867SPQQA43P2F',
|
||||
secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG'
|
||||
});
|
||||
|
||||
// File that needs to be uploaded.
|
||||
var file = '/tmp/photos-europe.tar'
|
||||
|
||||
// Make a bucket called europetrip.
|
||||
minioClient.makeBucket('europetrip', 'us-east-1', function(err) {
|
||||
if (err) return console.log(err)
|
||||
|
||||
console.log('Bucket created successfully in "us-east-1".')
|
||||
|
||||
var metaData = {
|
||||
'Content-Type': 'application/octet-stream',
|
||||
'X-Amz-Meta-Testing': 1234,
|
||||
'example': 5678
|
||||
}
|
||||
// Using fPutObject API upload your file to the bucket europetrip.
|
||||
minioClient.fPutObject('europetrip', 'photos-europe.tar', file, metaData, function(err, etag) {
|
||||
if (err) return console.log(err)
|
||||
console.log('File uploaded successfully.')
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
#### Run file-uploader
|
||||
|
||||
```sh
|
||||
node file-uploader.js
|
||||
Bucket created successfully in "us-east-1".
|
||||
|
||||
mc ls play/europetrip/
|
||||
[2016-05-25 23:49:50 PDT] 17MiB photos-europe.tar
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
The full API Reference is available here.
|
||||
|
||||
* [Complete API Reference](https://docs.min.io/docs/javascript-client-api-reference)
|
||||
|
||||
### API Reference : Bucket Operations
|
||||
|
||||
* [`makeBucket`](https://docs.min.io/docs/javascript-client-api-reference#makeBucket)
|
||||
* [`listBuckets`](https://docs.min.io/docs/javascript-client-api-reference#listBuckets)
|
||||
* [`bucketExists`](https://docs.min.io/docs/javascript-client-api-reference#bucketExists)
|
||||
* [`removeBucket`](https://docs.min.io/docs/javascript-client-api-reference#removeBucket)
|
||||
* [`listObjects`](https://docs.min.io/docs/javascript-client-api-reference#listObjects)
|
||||
* [`listObjectsV2`](https://docs.min.io/docs/javascript-client-api-reference#listObjectsV2)
|
||||
* [`listObjectsV2WithMetadata`](https://docs.min.io/docs/javascript-client-api-reference#listObjectsV2WithMetadata) (Extension)
|
||||
* [`listIncompleteUploads`](https://docs.min.io/docs/javascript-client-api-reference#listIncompleteUploads)
|
||||
* [`getBucketVersioning`](https://docs.min.io/docs/javascript-client-api-reference#getBucketVersioning)
|
||||
* [`setBucketVersioning`](https://docs.min.io/docs/javascript-client-api-reference#setBucketVersioning)
|
||||
* [`setBucketLifecycle`](https://docs.min.io/docs/javascript-client-api-reference#setBucketLifecycle)
|
||||
* [`getBucketLifecycle`](https://docs.min.io/docs/javascript-client-api-reference#getBucketLifecycle)
|
||||
* [`removeBucketLifecycle`](https://docs.min.io/docs/javascript-client-api-reference#removeBucketLifecycle)
|
||||
* [`getObjectLockConfig`](https://docs.min.io/docs/javascript-client-api-reference#getObjectLockConfig)
|
||||
* [`setObjectLockConfig`](https://docs.min.io/docs/javascript-client-api-reference#setObjectLockConfig)
|
||||
|
||||
### API Reference : File Object Operations
|
||||
|
||||
* [`fPutObject`](https://docs.min.io/docs/javascript-client-api-reference#fPutObject)
|
||||
* [`fGetObject`](https://docs.min.io/docs/javascript-client-api-reference#fGetObject)
|
||||
|
||||
### API Reference : Object Operations
|
||||
|
||||
* [`getObject`](https://docs.min.io/docs/javascript-client-api-reference#getObject)
|
||||
* [`putObject`](https://docs.min.io/docs/javascript-client-api-reference#putObject)
|
||||
* [`copyObject`](https://docs.min.io/docs/javascript-client-api-reference#copyObject)
|
||||
* [`statObject`](https://docs.min.io/docs/javascript-client-api-reference#statObject)
|
||||
* [`removeObject`](https://docs.min.io/docs/javascript-client-api-reference#removeObject)
|
||||
* [`removeObjects`](https://docs.min.io/docs/javascript-client-api-reference#removeObjects)
|
||||
* [`removeIncompleteUpload`](https://docs.min.io/docs/javascript-client-api-reference#removeIncompleteUpload)
|
||||
* [`selectObjectContent`](https://docs.min.io/docs/javascript-client-api-reference#selectObjectContent)
|
||||
|
||||
|
||||
### API Reference : Presigned Operations
|
||||
|
||||
* [`presignedGetObject`](https://docs.min.io/docs/javascript-client-api-reference#presignedGetObject)
|
||||
* [`presignedPutObject`](https://docs.min.io/docs/javascript-client-api-reference#presignedPutObject)
|
||||
* [`presignedPostPolicy`](https://docs.min.io/docs/javascript-client-api-reference#presignedPostPolicy)
|
||||
|
||||
### API Reference : Bucket Notification Operations
|
||||
|
||||
* [`getBucketNotification`](https://docs.min.io/docs/javascript-client-api-reference#getBucketNotification)
|
||||
* [`setBucketNotification`](https://docs.min.io/docs/javascript-client-api-reference#setBucketNotification)
|
||||
* [`removeAllBucketNotification`](https://docs.min.io/docs/javascript-client-api-reference#removeAllBucketNotification)
|
||||
* [`listenBucketNotification`](https://docs.min.io/docs/javascript-client-api-reference#listenBucketNotification) (MinIO Extension)
|
||||
|
||||
### API Reference : Bucket Policy Operations
|
||||
|
||||
* [`getBucketPolicy`](https://docs.min.io/docs/javascript-client-api-reference#getBucketPolicy)
|
||||
* [`setBucketPolicy`](https://docs.min.io/docs/javascript-client-api-reference#setBucketPolicy)
|
||||
|
||||
|
||||
## Full Examples
|
||||
|
||||
#### Full Examples : Bucket Operations
|
||||
|
||||
* [list-buckets.js](https://github.com/minio/minio-js/blob/master/examples/list-buckets.js)
|
||||
* [list-objects.js](https://github.com/minio/minio-js/blob/master/examples/list-objects.js)
|
||||
* [list-objects-v2.js](https://github.com/minio/minio-js/blob/master/examples/list-objects-v2.js)
|
||||
* [list-objects-v2-with-metadata.js](https://github.com/minio/minio-js/blob/master/examples/list-objects-v2-with-metadata.js) (Extension)
|
||||
* [bucket-exists.js](https://github.com/minio/minio-js/blob/master/examples/bucket-exists.js)
|
||||
* [make-bucket.js](https://github.com/minio/minio-js/blob/master/examples/make-bucket.js)
|
||||
* [remove-bucket.js](https://github.com/minio/minio-js/blob/master/examples/remove-bucket.js)
|
||||
* [list-incomplete-uploads.js](https://github.com/minio/minio-js/blob/master/examples/list-incomplete-uploads.js)
|
||||
* [get-bucket-versioning.js](https://github.com/minio/minio-js/blob/master/examples/get-bucket-versioning.js)
|
||||
* [set-bucket-versioning.js](https://github.com/minio/minio-js/blob/master/examples/set-bucket-versioning.js)
|
||||
* [set-bucket-tagging.js](https://github.com/minio/minio-js/blob/master/examples/set-bucket-tagging.js)
|
||||
* [get-bucket-tagging.js](https://github.com/minio/minio-js/blob/master/examples/get-bucket-tagging.js)
|
||||
* [remove-bucket-tagging.js](https://github.com/minio/minio-js/blob/master/examples/remove-bucket-tagging.js)
|
||||
* [set-bucket-lifecycle.js](https://github.com/minio/minio-js/blob/master/examples/set-bucket-lifecycle.js)
|
||||
* [get-bucket-lifecycle.js](https://github.com/minio/minio-js/blob/master/examples/get-bucket-lifecycle.js)
|
||||
* [remove-bucket-lifecycle.js](https://github.com/minio/minio-js/blob/master/examples/remove-bucket-lifecycle.js)
|
||||
* [get-object-lock-config.js](https://github.com/minio/minio-js/blob/master/examples/get-object-lock-config.js)
|
||||
* [set-object-lock-config.js](https://github.com/minio/minio-js/blob/master/examples/set-object-lock-config.js)
|
||||
* [set-bucket-replication.js](https://github.com/minio/minio-js/blob/master/examples/set-bucket-replication.js)
|
||||
* [get-bucket-replication.js](https://github.com/minio/minio-js/blob/master/examples/get-bucket-replication.js)
|
||||
* [remove-bucket-replication.js](https://github.com/minio/minio-js/blob/master/examples/remove-bucket-replication.js)
|
||||
|
||||
#### Full Examples : File Object Operations
|
||||
* [fput-object.js](https://github.com/minio/minio-js/blob/master/examples/fput-object.js)
|
||||
* [fget-object.js](https://github.com/minio/minio-js/blob/master/examples/fget-object.js)
|
||||
|
||||
#### Full Examples : Object Operations
|
||||
* [put-object.js](https://github.com/minio/minio-js/blob/master/examples/put-object.js)
|
||||
* [get-object.js](https://github.com/minio/minio-js/blob/master/examples/get-object.js)
|
||||
* [copy-object.js](https://github.com/minio/minio-js/blob/master/examples/copy-object.js)
|
||||
* [get-partialobject.js](https://github.com/minio/minio-js/blob/master/examples/get-partialobject.js)
|
||||
* [remove-object.js](https://github.com/minio/minio-js/blob/master/examples/remove-object.js)
|
||||
* [remove-incomplete-upload.js](https://github.com/minio/minio-js/blob/master/examples/remove-incomplete-upload.js)
|
||||
* [stat-object.js](https://github.com/minio/minio-js/blob/master/examples/stat-object.js)
|
||||
* [get-object-retention.js](https://github.com/minio/minio-js/blob/master/examples/get-object-retention.js)
|
||||
* [put-object-retention.js](https://github.com/minio/minio-js/blob/master/examples/put-object-retention.js)
|
||||
* [put-object-tagging.js](https://github.com/minio/minio-js/blob/master/examples/put-object-tagging.js)
|
||||
* [get-object-tagging.js](https://github.com/minio/minio-js/blob/master/examples/get-object-tagging.js)
|
||||
* [remove-object-tagging.js](https://github.com/minio/minio-js/blob/master/examples/remove-object-tagging.js)
|
||||
* [set-object-legal-hold.js](https://github.com/minio/minio-js/blob/master/examples/set-object-legalhold.js)
|
||||
* [get-object-legal-hold.js](https://github.com/minio/minio-js/blob/master/examples/get-object-legal-hold.js)
|
||||
* [compose-object.js](https://github.com/minio/minio-js/blob/master/examples/compose-object.js)
|
||||
* [select-object-content.js](https://github.com/minio/minio-js/blob/master/examples/select-object-content.js)
|
||||
|
||||
#### Full Examples : Presigned Operations
|
||||
* [presigned-getobject.js](https://github.com/minio/minio-js/blob/master/examples/presigned-getobject.js)
|
||||
* [presigned-putobject.js](https://github.com/minio/minio-js/blob/master/examples/presigned-putobject.js)
|
||||
* [presigned-postpolicy.js](https://github.com/minio/minio-js/blob/master/examples/presigned-postpolicy.js)
|
||||
|
||||
#### Full Examples: Bucket Notification Operations
|
||||
* [get-bucket-notification.js](https://github.com/minio/minio-js/blob/master/examples/get-bucket-notification.js)
|
||||
* [set-bucket-notification.js](https://github.com/minio/minio-js/blob/master/examples/set-bucket-notification.js)
|
||||
* [remove-all-bucket-notification.js](https://github.com/minio/minio-js/blob/master/examples/remove-all-bucket-notification.js)
|
||||
* [listen-bucket-notification.js](https://github.com/minio/minio-js/blob/master/examples/minio/listen-bucket-notification.js) (MinIO Extension)
|
||||
|
||||
#### Full Examples: Bucket Policy Operations
|
||||
* [get-bucket-policy.js](https://github.com/minio/minio-js/blob/master/examples/get-bucket-policy.js)
|
||||
* [set-bucket-policy.js](https://github.com/minio/minio-js/blob/master/examples/set-bucket-policy.js)
|
||||
|
||||
## Custom Settings
|
||||
* [setAccelerateEndPoint](https://github.com/minio/minio-js/blob/master/examples/set-accelerate-end-point.js)
|
||||
|
||||
## Explore Further
|
||||
* [Complete Documentation](https://docs.min.io)
|
||||
* [MinIO JavaScript Client SDK API Reference](https://docs.min.io/docs/javascript-client-api-reference)
|
||||
* [Build your own Shopping App Example- Full Application Example ](https://github.com/minio/minio-js-store-app)
|
||||
|
||||
## Contribute
|
||||
|
||||
[Contributors Guide](https://github.com/minio/minio-js/blob/master/CONTRIBUTING.md)
|
||||
|
||||
[](https://travis-ci.org/minio/minio-js)
|
||||
[](https://ci.appveyor.com/project/harshavardhana/minio-js)
|
File diff suppressed because it is too large
Load Diff
@ -1,96 +0,0 @@
|
||||
# MinIO Python SDK for Amazon S3 Compatible Cloud Storage [](https://slack.min.io)
|
||||
|
||||
MinIO Python SDK is Simple Storage Service (aka S3) client to perform bucket and object operations to any Amazon S3 compatible object storage service.
|
||||
|
||||
For a complete list of APIs and examples, please take a look at the [Python Client API Reference](https://docs.min.io/docs/python-client-api-reference)
|
||||
|
||||
## Minimum Requirements
|
||||
Python 3.7 or higher.
|
||||
|
||||
## Download using pip
|
||||
|
||||
```sh
|
||||
pip3 install minio
|
||||
```
|
||||
|
||||
## Download source
|
||||
|
||||
```sh
|
||||
git clone https://github.com/minio/minio-py
|
||||
cd minio-py
|
||||
python setup.py install
|
||||
```
|
||||
|
||||
## Quick Start Example - File Uploader
|
||||
This example program connects to an S3-compatible object storage server, make a bucket on that server, and upload a file to the bucket.
|
||||
|
||||
You need the following items to connect to an S3-compatible object storage server:
|
||||
|
||||
| Parameters | Description |
|
||||
|------------|------------------------------------------------------------|
|
||||
| Endpoint | URL to S3 service. |
|
||||
| Access Key | Access key (aka user ID) of an account in the S3 service. |
|
||||
| Secret Key | Secret key (aka password) of an account in the S3 service. |
|
||||
|
||||
This example uses MinIO server playground [https://play.min.io](https://play.min.io). Feel free to use this service for test and development.
|
||||
|
||||
### file_uploader.py
|
||||
```py
|
||||
from minio import Minio
|
||||
from minio.error import S3Error
|
||||
|
||||
|
||||
def main():
|
||||
# Create a client with the MinIO server playground, its access key
|
||||
# and secret key.
|
||||
client = Minio(
|
||||
"play.min.io",
|
||||
access_key="Q3AM3UQ867SPQQA43P2F",
|
||||
secret_key="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
|
||||
)
|
||||
|
||||
# Make 'asiatrip' bucket if not exist.
|
||||
found = client.bucket_exists("asiatrip")
|
||||
if not found:
|
||||
client.make_bucket("asiatrip")
|
||||
else:
|
||||
print("Bucket 'asiatrip' already exists")
|
||||
|
||||
# Upload '/home/user/Photos/asiaphotos.zip' as object name
|
||||
# 'asiaphotos-2015.zip' to bucket 'asiatrip'.
|
||||
client.fput_object(
|
||||
"asiatrip", "asiaphotos-2015.zip", "/home/user/Photos/asiaphotos.zip",
|
||||
)
|
||||
print(
|
||||
"'/home/user/Photos/asiaphotos.zip' is successfully uploaded as "
|
||||
"object 'asiaphotos-2015.zip' to bucket 'asiatrip'."
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main()
|
||||
except S3Error as exc:
|
||||
print("error occurred.", exc)
|
||||
```
|
||||
|
||||
#### Run File Uploader
|
||||
```sh
|
||||
$ python file_uploader.py
|
||||
'/home/user/Photos/asiaphotos.zip' is successfully uploaded as object 'asiaphotos-2015.zip' to bucket 'asiatrip'.
|
||||
|
||||
$ mc ls play/asiatrip/
|
||||
[2016-06-02 18:10:29 PDT] 82KiB asiaphotos-2015.zip
|
||||
```
|
||||
|
||||
## More References
|
||||
* [Python Client API Reference](https://docs.min.io/docs/python-client-api-reference)
|
||||
* [Examples](https://github.com/minio/minio-py/tree/release/examples)
|
||||
|
||||
## Explore Further
|
||||
* [Complete Documentation](https://docs.min.io)
|
||||
|
||||
## Contribute
|
||||
Please refer [Contributors Guide](https://github.com/minio/minio-py/blob/release/CONTRIBUTING.md)
|
||||
|
||||
[](https://pypi.python.org/pypi/minio)
|
Reference in New Issue
Block a user