Opticka 2.18.1
Opticka is an experiment manager for behavioral research.
Loading...
Searching...
No Matches
minioManager Class Reference

use MinIO mc CLI command from MATLAB (mc alias-based auth) More...

Detailed Description

use MinIO mc CLI command from MATLAB (mc alias-based auth)

Introduction

minioManager provides an S3-compatible file transfer interface using the MinIO mc CLI tool instead of the AWS CLI. Authentication uses mc alias set to register an endpoint alias, and subsequent commands use the alias name to address buckets and objects.

Installation

Install the mc CLI cross-platform:

curl https://dl.min.io/client/mc/release/linux-amd64/mc -o ~/bin/mc && chmod +x ~/bin/mc

Or with pixi:

pixi global install minio-mc

Usage

Secrets can be kept locally using setSecret('MINIO_ID') and setSecret('MINIO_KEY'), then passed with getSecret.

m = minioManager(getSecret("MINIO_ID"), getSecret("MINIO_KEY"), "http://1.1.1.1:9000")
m.list()
m.checkBucket("mybucket")
m.get("mybucket","path/to/file.mat")
m.copyFiles("localfile.mat","mybucket","remote/path/file.mat")
use MinIO mc CLI command from MATLAB (mc alias-based auth)
Definition minioManager.m:3
function checkBucket(in me, in bucket)
list buckets (mc ls <alias>)
function copyFiles(in me, in file, in bucket, in key)
get/download file from bucket
function get(in me, in bucket, in key)
find objects matching a regex pattern
function list(in me)
set up the mc alias for authentication

Copyright ©2014-2026 Ian Max Andolina — released: LGPL3, see LICENCE.md

Inheritance diagram for minioManager:

Public Member Functions

function minioManager (in id, in key, in url, in alias)
 
function delete (in me)
 minioManager constructor
 
function setupAlias (in me)
 clean up mc alias on object deletion
 
function list (in me)
 set up the mc alias for authentication
 
function checkBucket (in me, in bucket)
 list buckets (mc ls <alias>)
 
function createBucket (in me, in bucket)
 check bucket exists and create it if missing
 
function find (in me, in pattern, in target)
 create a bucket (mc mb <alias>/<bucket>)
 
function get (in me, in bucket, in key)
 find objects matching a regex pattern
 
function copyFiles (in me, in file, in bucket, in key)
 get/download file from bucket
 

Public Attributes

Property ENDPOINT
 the S3 endpoint URL
 
Property ALIAS
 alias name for mc commands
 
Property LOCAL
 local dir
 
Property ACCESS_KEY
 access key for S3-compatible store
 
Property SECRET_KEY
 secret key for S3-compatible store
 

Constructor & Destructor Documentation

◆ minioManager()

function minioManager::minioManager ( in  id,
in  key,
in  url,
in  alias 
)

Member Function Documentation

◆ checkBucket()

function minioManager::checkBucket ( in  me,
in  bucket 
)

list buckets (mc ls <alias>)

Parameters
none
Returns
out character vector of bucket listing

◆ copyFiles()

function minioManager::copyFiles ( in  me,
in  file,
in  bucket,
in  key 
)

get/download file from bucket

Downloads an object from the store to the current working directory (mc cp <alias>/<bucket>/<key> ./).

Parameters
bucketbucket name
keyobject key (path within the bucket)
Returns
success logical true if download succeeded

◆ createBucket()

function minioManager::createBucket ( in  me,
in  bucket 
)

check bucket exists and create it if missing

Lists buckets, and if the named bucket is not found, creates it automatically.

Parameters
bucketname of the bucket to check

◆ delete()

function minioManager::delete ( in  me)

minioManager constructor

Parameters
idaccess key for the S3 store
keysecret key for the S3 store
urlendpoint URL (e.g. 'http://192.168.1.1:9000')
aliasoptional alias name (default 'minio')

◆ find()

function minioManager::find ( in  me,
in  pattern,
in  target 
)

create a bucket (mc mb <alias>/<bucket>)

Parameters
bucketname of the bucket to create
Returns
success logical true if bucket was created

◆ get()

function minioManager::get ( in  me,
in  bucket,
in  key 
)

find objects matching a regex pattern

Uses mc find --regex --json to search the store, then jsondecode to parse the JSON-lines output into a MATLAB struct array.

Parameters
patternregex pattern (RE2 syntax)
targetoptional target path under alias (default: alias root, all buckets)
Returns
out struct array of matching objects
success logical true if search succeeded

◆ list()

function minioManager::list ( in  me)

set up the mc alias for authentication

Registers the endpoint URL, access key and secret key under the configured alias name. Keys are shell-quoted to handle special characters safely. Subsequent mc commands use the alias directly.

◆ setupAlias()

function minioManager::setupAlias ( in  me)

clean up mc alias on object deletion

Member Data Documentation

◆ ACCESS_KEY

Property minioManager::ACCESS_KEY

access key for S3-compatible store

◆ ALIAS

Property minioManager::ALIAS

alias name for mc commands

◆ ENDPOINT

Property minioManager::ENDPOINT

the S3 endpoint URL

◆ LOCAL

Property minioManager::LOCAL

local dir

◆ SECRET_KEY

Property minioManager::SECRET_KEY

secret key for S3-compatible store


The documentation for this class was generated from the following file: