Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions plugins/WasabiWACM/v1/configValidation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"steps": [
{
"displayName": "Authenticate",
"dataStream": { "name": "wacmConfigValidation" },
"required": true,
"error": "Could not authenticate. Check your username and API key are correct and have not been regenerated.",
"success": "Connected successfully."
}
]
}
37 changes: 37 additions & 0 deletions plugins/WasabiWACM/v1/custom_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[
{
"name": "Wasabi Standalone Account",
"sourceType": "Wasabi Standalone Account",
"icon": "id-card",
"singular": "Standalone Account",
"plural": "Standalone Accounts"
},
{
"name": "Wasabi Control Account",
"sourceType": "Wasabi Control Account",
"icon": "building-columns",
"singular": "Control Account",
"plural": "Control Accounts"
},
{
"name": "Wasabi Channel Account",
"sourceType": "Wasabi Channel Account",
"icon": "handshake",
"singular": "Channel Account",
"plural": "Channel Accounts"
},
{
"name": "Wasabi Sub-Account",
"sourceType": "Wasabi Sub-Account",
"icon": "building",
"singular": "Sub-Account",
"plural": "Sub-Accounts"
},
{
"name": "Wasabi Member",
"sourceType": "Wasabi Member",
"icon": "user",
"singular": "Member",
"plural": "Members"
}
]
40 changes: 40 additions & 0 deletions plugins/WasabiWACM/v1/dataStreams/accounts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "accounts",
"displayName": "Standalone Accounts",
"description": "All Wasabi Standalone Accounts, one row per account",
"tags": ["Accounts"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "/api/v1/accounts",
"pathToData": "data.items",
"paging": {
"mode": "offset",
"pageSize": { "realm": "queryArg", "path": "size", "value": "100" },
"offset": {
"mode": "page",
"rowCountIn": { "realm": "payloadArraySize", "path": "data.items" },
"base": 0
},
"out": { "realm": "queryArg", "path": "page" }
}
},
"matches": "none",
"visibility": { "type": "hidden" },
"metadata": [
{ "name": "id", "displayName": "ID", "shape": "string", "role": "id" },
{
"name": "name",
"displayName": "Name",
"computed": true,
"valueExpression": "{{ $['companyName'] || (($['firstName'] || '') + ' ' + ($['lastName'] || '')).trim() }}",
"role": "label"
},
{ "name": "firstName", "visible": false },
{ "name": "lastName", "visible": false },
{ "name": "email", "visible": false },
{ "name": "phoneNumber", "visible": false },
{ "pattern": ".*" }
],
"timeframes": false
}
32 changes: 32 additions & 0 deletions plugins/WasabiWACM/v1/dataStreams/channelAccounts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "channelAccounts",
"displayName": "Channel Accounts",
"description": "All Wasabi Channel Accounts, one row per account",
"tags": ["Accounts"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "/api/v1/channel-accounts",
"pathToData": "data.items",
"paging": {
"mode": "offset",
"pageSize": { "realm": "queryArg", "path": "size", "value": "100" },
"offset": {
"mode": "page",
"rowCountIn": { "realm": "payloadArraySize", "path": "data.items" },
"base": 0
},
"out": { "realm": "queryArg", "path": "page" }
}
},
"matches": "none",
"visibility": { "type": "hidden" },
"metadata": [
{ "name": "id", "displayName": "ID", "shape": "string", "role": "id" },
{ "name": "name", "displayName": "Name", "shape": "string", "role": "label" },
{ "name": "contactEmail", "visible": false },
{ "name": "billingEmail", "visible": false },
{ "pattern": ".*" }
],
"timeframes": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "controlAccountBucketUtilization",
"displayName": "Control Account Bucket Utilization",
"description": "Per-bucket storage utilization for a control account",
"tags": ["Accounts", "Usage"],
"baseDataSourceName": "httpRequestScopedSingle",
"config": {
"httpMethod": "get",
"endpointPath": "/api/v1/control-accounts/{{object.rawId}}/buckets",
"getArgs": [
{ "key": "from", "value": "{{timeframe.start.split('T')[0]}}" },
{ "key": "to", "value": "{{timeframe.end.split('T')[0]}}" }
],
"pathToData": "data.items",
"paging": {
"mode": "offset",
"pageSize": { "realm": "queryArg", "path": "size", "value": "100" },
"offset": {
"mode": "page",
"rowCountIn": { "realm": "payloadArraySize", "path": "data.items" },
"base": 0
},
"out": { "realm": "queryArg", "path": "page" }
}
},
"matches": { "sourceType": { "type": "oneOf", "values": ["Wasabi Control Account"] } },
"metadata": [
{ "name": "name", "displayName": "Bucket Name", "shape": "string", "role": "label" },
{ "name": "region", "displayName": "Region", "shape": "string" },
{ "name": "bucketNumber", "displayName": "Bucket Number", "shape": "string" },
{ "name": "startTime", "displayName": "Start Time", "shape": "date", "role": "timestamp" },
{ "name": "endTime", "displayName": "End Time", "shape": "date" },
{ "name": "activeStorage", "displayName": "Active Storage (TB)", "shape": "number" },
{ "name": "deletedStorage", "displayName": "Deleted Storage (TB)", "shape": "number" },
{ "name": "activeObjects", "displayName": "Active Objects", "shape": "number" },
{ "name": "deletedObjects", "displayName": "Deleted Objects", "shape": "number" },
{ "name": "apiCalls", "displayName": "API Calls", "shape": "number" },
{ "name": "egress", "displayName": "Egress (GB)", "shape": "number" },
{ "name": "ingress", "displayName": "Ingress (GB)", "shape": "number" },
{ "pattern": ".*" }
],
"timeframes": [
"last7days",
"last30days",
"thisMonth",
"lastMonth",
"thisQuarter",
"lastQuarter",
"thisYear",
"lastYear"
]
}
43 changes: 43 additions & 0 deletions plugins/WasabiWACM/v1/dataStreams/controlAccountSummary.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "controlAccountSummary",
"displayName": "Control Account Summary",
"description": "Current state and storage of a control account",
"tags": ["Accounts"],
"baseDataSourceName": "httpRequestScopedSingle",
"config": {
"httpMethod": "get",
"endpointPath": "/api/v1/control-accounts/{{object.rawId}}",
"getArgs": [{ "key": "includeApiKey", "value": "false" }],
"pathToData": "data",
"postRequestScript": "controlAccountSummary.js"
},
"matches": { "sourceType": { "type": "oneOf", "values": ["Wasabi Control Account"] } },
"metadata": [
{ "name": "id", "displayName": "ID", "shape": "string", "role": "id", "visible": false },
{ "name": "name", "displayName": "Name", "shape": "string", "role": "label" },
{
"name": "status",
"displayName": "Status",
"shape": [
"state",
{
"map": {
"success": ["Active"],
"error": ["Deactivated"]
}
}
]
},
{ "name": "subAccountStorage", "displayName": "Sub-Account Storage", "shape": "bytes" },
{ "name": "controlAccountStorage", "displayName": "Control Account Storage", "shape": "bytes" },
{ "name": "totalStorage", "displayName": "Total Storage", "shape": "bytes" },
{ "name": "defaultPurchasedStorageTB", "displayName": "Default Purchased Storage (TB)", "shape": "number" },
{ "name": "subAccountsCount", "displayName": "Sub-Accounts Count", "shape": "number" },
{ "name": "channelAccountsCount", "displayName": "Channel Accounts Count", "shape": "number" },
{ "name": "storageQuotaType", "displayName": "Storage Quota Type", "shape": "string" },
{ "name": "primaryApiKey", "visible": false },
{ "name": "secondaryApiKey", "visible": false },
{ "pattern": ".*" }
],
"timeframes": false
}
52 changes: 52 additions & 0 deletions plugins/WasabiWACM/v1/dataStreams/controlAccountUsageHistory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "controlAccountUsageHistory",
"displayName": "Control Account Usage History",
"description": "Periodic storage and traffic usage records for a control account",
"tags": ["Accounts", "Usage"],
"baseDataSourceName": "httpRequestScopedSingle",
"config": {
"httpMethod": "get",
"endpointPath": "/api/v1/control-accounts/usages",
"getArgs": [
{ "key": "controlAccountId", "value": "{{object.rawId}}" },
{ "key": "from", "value": "{{timeframe.start.split('T')[0]}}" },
{ "key": "to", "value": "{{timeframe.end.split('T')[0]}}" }
],
"pathToData": "data.items",
"paging": {
"mode": "offset",
"pageSize": { "realm": "queryArg", "path": "size", "value": "100" },
"offset": {
"mode": "page",
"rowCountIn": { "realm": "payloadArraySize", "path": "data.items" },
"base": 0
},
"out": { "realm": "queryArg", "path": "page" }
}
},
"matches": { "sourceType": { "type": "oneOf", "values": ["Wasabi Control Account"] } },
"metadata": [
{ "name": "startTime", "displayName": "Start Time", "shape": "date", "role": "timestamp" },
{ "name": "endTime", "displayName": "End Time", "shape": "date" },
{ "name": "activeStorage", "displayName": "Active Storage (TB)", "shape": ["number", { "decimalPlaces": 4 }] },
{ "name": "deletedStorage", "displayName": "Deleted Storage (TB)", "shape": ["number", { "decimalPlaces": 4 }] },
{ "name": "storageWrote", "displayName": "Storage Written (TB)", "shape": ["number", { "decimalPlaces": 4 }] },
{ "name": "storageRead", "displayName": "Storage Read (TB)", "shape": ["number", { "decimalPlaces": 4 }] },
{ "name": "activeObjects", "displayName": "Active Objects", "shape": "number" },
{ "name": "deletedObjects", "displayName": "Deleted Objects", "shape": "number" },
{ "name": "apiCalls", "displayName": "API Calls", "shape": "number" },
{ "name": "egress", "displayName": "Egress (GB)", "shape": "number" },
{ "name": "ingress", "displayName": "Ingress (GB)", "shape": "number" },
{ "pattern": ".*" }
],
"timeframes": [
"last7days",
"last30days",
"thisMonth",
"lastMonth",
"thisQuarter",
"lastQuarter",
"thisYear",
"lastYear"
]
}
36 changes: 36 additions & 0 deletions plugins/WasabiWACM/v1/dataStreams/controlAccounts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "controlAccounts",
"displayName": "Control Accounts",
"description": "All Wasabi Control Accounts, one row per account",
"tags": ["Accounts"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "/api/v1/control-accounts",
"getArgs": [{ "key": "includeApiKey", "value": "false" }],
"pathToData": "data.items",
"paging": {
"mode": "offset",
"pageSize": { "realm": "queryArg", "path": "size", "value": "100" },
"offset": {
"mode": "page",
"rowCountIn": { "realm": "payloadArraySize", "path": "data.items" },
"base": 0
},
"out": { "realm": "queryArg", "path": "page" }
}
},
"matches": "none",
"visibility": { "type": "hidden" },
"metadata": [
{ "name": "id", "displayName": "ID", "shape": "string", "role": "id" },
{ "name": "name", "displayName": "Name", "shape": "string", "role": "label" },
{ "name": "primaryApiKey", "visible": false },
{ "name": "secondaryApiKey", "visible": false },
{ "name": "contactEmail", "visible": false },
{ "name": "billingEmail", "visible": false },
{ "name": "controlAccountEmail", "visible": false },
{ "pattern": ".*" }
],
"timeframes": false
}
41 changes: 41 additions & 0 deletions plugins/WasabiWACM/v1/dataStreams/members.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "members",
"displayName": "Members",
"description": "All Wasabi Sub-Account users, one row per member",
"tags": ["Accounts", "Users"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "/api/v1/members",
"pathToData": "data.items",
"paging": {
"mode": "offset",
"pageSize": { "realm": "queryArg", "path": "size", "value": "100" },
"offset": {
"mode": "page",
"rowCountIn": { "realm": "payloadArraySize", "path": "data.items" },
"base": 0
},
"out": { "realm": "queryArg", "path": "page" }
}
},
"matches": "none",
"visibility": { "type": "hidden" },
"metadata": [
{ "name": "id", "displayName": "ID", "shape": "string", "role": "id" },
{
"name": "name",
"displayName": "Name",
"computed": true,
"valueExpression": "{{ ((($['firstName'] || '') + ' ' + ($['lastName'] || '')).trim()) || $['username'] }}",
"role": "label"
},
{ "name": "firstName", "visible": false },
{ "name": "lastName", "visible": false },
{ "name": "username", "visible": false },
{ "name": "email", "visible": false },
{ "name": "phone", "visible": false },
{ "pattern": ".*" }
],
"timeframes": false
}
19 changes: 19 additions & 0 deletions plugins/WasabiWACM/v1/dataStreams/scripts/controlAccountSummary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Wasabi reports subAccountStorage/controlAccountStorage/totalStorage in TB;
// convert to bytes to match the "bytes" shape used for these fields. Wasabi
// defines 1 TB as 1024 GB for storage billing/utilization, not decimal 10^12.
const TB_TO_BYTES = 1024 ** 4;

function toBytes(value) {
return typeof value === "number" ? value * TB_TO_BYTES : value;
}

const account = (data && data.data) || {};

result = [
{
...account,
subAccountStorage: toBytes(account.subAccountStorage),
controlAccountStorage: toBytes(account.controlAccountStorage),
totalStorage: toBytes(account.totalStorage),
},
];
17 changes: 17 additions & 0 deletions plugins/WasabiWACM/v1/dataStreams/scripts/subAccountInvoices.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Wasabi reports totalStorage/activeStorage/deletedStorage in TB; convert to
// bytes to match the "bytes" shape used for these fields. Wasabi defines
// 1 TB as 1024 GB for storage billing/utilization, not the decimal 10^12.
const TB_TO_BYTES = 1024 ** 4;

function toBytes(value) {
return typeof value === "number" ? value * TB_TO_BYTES : value;
}

const items = (data && data.data && data.data.items) || [];

result = items.map((item) => ({
...item,
totalStorage: toBytes(item.totalStorage),
activeStorage: toBytes(item.activeStorage),
deletedStorage: toBytes(item.deletedStorage),
}));
Loading