Skip to main content

signaloid-cli drives create

Create a new virtual drive.

Synopsis

signaloid-cli drives create --name <str> [options]

Description

Creates a new virtual drive with one or more data sources. Data sources can be specified inline using --ds or loaded from a file using --ds-file.

Options

OptionDescription
--name <str>Drive name (required)
--ds <json>Data source JSON (can be repeated for multiple sources)
--ds-file <path>Path to JSON array of data sources

Data Source Format

Each data source must be a JSON object with:

{
"ResourceID": "resource-id",
"ResourceType": "Gateway|Bucket|SignaloidCloudStorage",
"Location": "/path/"
}

Output

Returns the created drive object:

{
"DriveID": "drive-abc123",
"Name": "My Drive",
"DataSources": [...],
"CreatedAt": "2025-01-20T10:30:00Z"
}

Examples

Create with Single Data Source

signaloid-cli drives create \
--name "Bucket Drive" \
--ds '{
"ResourceID": "bucket-xyz",
"ResourceType": "Bucket",
"Location": "/"
}'

Create with Multiple Data Sources (Inline)

signaloid-cli drives create \
--name "Multi-Source Drive" \
--ds '{
"ResourceID": "bucket-data",
"ResourceType": "Bucket",
"Location": "/inputs/"
}' \
--ds '{
"ResourceID": "gateway-sensors",
"ResourceType": "Gateway",
"Location": "/sensors/"
}'

Create with Data Sources File

# Create datasources.json
cat > datasources.json <<EOF
[
{
"ResourceID": "bucket-raw-data",
"ResourceType": "Bucket",
"Location": "/raw/"
},
{
"ResourceID": "bucket-processed",
"ResourceType": "Bucket",
"Location": "/processed/"
},
{
"ResourceID": "storage-signaloid",
"ResourceType": "SignaloidCloudStorage",
"Location": "/archive/"
}
]
EOF

# Create drive
signaloid-cli drives create \
--name "Data Pipeline Drive" \
--ds-file datasources.json

Exit Codes

CodeDescription
0Success
1Failed to create drive (invalid data source, API error)

Notes

  • At least one data source is recommended (though technically optional)
  • Data sources can be added later using the update command
  • ResourceType must be exactly: Gateway, Bucket, or SignaloidCloudStorage
  • Location paths should start with /

Data Source Validation

The command will fail if:

  • ResourceID is missing or empty
  • ResourceType is not one of the valid types
  • Location is missing or empty
  • JSON is malformed

See Also