SET ROLE dbo;
DROP TABLE IF EXISTS vmreports.vsan_storage CASCADE;
CREATE TABLE vmreports.vsan_storage (
	"Name" varchar(255) NULL,
	"ClusterNew" varchar(255) NULL, 
	
	"Total" float NULL,
	"Usable" float NULL,
	"Used" float NULL,
	"EffectiveFree" float NULL,
	
	"Object_UUID" uuid NOT NULL,
	ts timestamptz NOT NULL
	,CONSTRAINT PK_vsan_storage PRIMARY KEY (ts, "Object_UUID")
);
--ALTER TABLE vmreports.vsan_storage OWNER TO dbo;
GRANT ALL ON vmreports.vsan_storage TO nifi;
--select * from vmreports.vsan_storage;

/*
{
"type": "record",
"name": "vmreports.vsan_storage",
"namespace": "org.apache.nifi",
"fields": [ 
	{"name":"Object_UUID", "type":{"type": "string", "logicalType": "uuid"}},	
	{"name":"ts","type":{"type": "long", "logicalType": "local-timestamp-millis"}},
	
	{"name":"Name", "type":["string" ,"null"]},
	{"name":"ClusterNew", "type":["string" ,"null"]},
	
	{"name":"Total", "type":["float" ,"null"]},
	{"name":"Usable", "type":["float" ,"null"]},
	{"name":"Used", "type":["float" ,"null"]},
	{"name":"EffectiveFree", "type":["float" ,"null"]}
]
}
*/

/*
{    
   "*": {
     "objId":"[&1].Name",
     "1":"[&1].ClusterNew",
     "2":"[&1].Total",
     "3":"[&1].Usable",
     "4":"[&1].Used",
     "5":"[&1].EffectiveFree",
     "objUUID":"[&1].Object_UUID"
   }
 } 
*/ 