![]() |
Opticka 2.18.1
Opticka is an experiment manager for behavioral research.
|
use MinIO mc CLI command from MATLAB (mc alias-based auth) More...
use MinIO mc CLI command from MATLAB (mc alias-based auth)
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.
Install the mc CLI cross-platform:
Or with pixi:
Secrets can be kept locally using setSecret('MINIO_ID') and setSecret('MINIO_KEY'), then passed with getSecret.
Copyright ©2014-2026 Ian Max Andolina — released: LGPL3, see LICENCE.md
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 | |
| function minioManager::minioManager | ( | in | id, |
| in | key, | ||
| in | url, | ||
| in | alias | ||
| ) |
| function minioManager::checkBucket | ( | in | me, |
| in | bucket | ||
| ) |
list buckets (mc ls <alias>)
| none |
| 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> ./).
| bucket | bucket name |
| key | object key (path within the bucket) |
| 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.
| bucket | name of the bucket to check |
| function minioManager::delete | ( | in | me | ) |
minioManager constructor
| id | access key for the S3 store |
| key | secret key for the S3 store |
| url | endpoint URL (e.g. 'http://192.168.1.1:9000') |
| alias | optional alias name (default 'minio') |
| function minioManager::find | ( | in | me, |
| in | pattern, | ||
| in | target | ||
| ) |
create a bucket (mc mb <alias>/<bucket>)
| bucket | name of the bucket to create |
| 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.
| pattern | regex pattern (RE2 syntax) |
| target | optional target path under alias (default: alias root, all buckets) |
| 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.
| function minioManager::setupAlias | ( | in | me | ) |
clean up mc alias on object deletion
| Property minioManager::ACCESS_KEY |
access key for S3-compatible store
| Property minioManager::ALIAS |
alias name for mc commands
| Property minioManager::ENDPOINT |
the S3 endpoint URL
| Property minioManager::LOCAL |
local dir
| Property minioManager::SECRET_KEY |
secret key for S3-compatible store