lizg преди 2 седмици
родител
ревизия
440af40154

+ 174 - 0
odbctest/mql/basic/graph_test/14graph_delete_data.mql

@@ -0,0 +1,174 @@
+delete from /m3graph/entity/vmware with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/weblogic with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/websphere with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/windows with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/x86 with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/aix with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/app with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/biz with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/cluster with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/db2 with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/esx with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/ha with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/hmc with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/http with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/linux with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/mal with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/mysql with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/openstack with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/oracle with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/pdu with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/power with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/router with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/sanstorage with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/sanswitch with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/sqlserver with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/switch with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/tomcat with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/ups with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+delete from /m3graph/entity/vlan with version!
+/**
+onerror(continue)
+noerrinfo()
+**/;
+

+ 168 - 0
odbctest/mql/basic/graph_test/15graph_drop_class.mql

@@ -0,0 +1,168 @@
+DROP EDGE TYPE m3graph.connect;
+DROP EDGE TYPE m3graph.contain;
+DROP EDGE TYPE m3graph.runon;
+DROP EDGE TYPE m3graph.depend;
+
+drop class /m3graph/entity/vmware
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/weblogic
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/websphere
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/windows
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/x86
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+
+drop class /m3graph/entity/aix
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/app
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/biz
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+drop class /m3graph/entity/cluster
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/db2
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/esx
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+drop class /m3graph/entity/ha
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/hmc
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/http
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+drop class /m3graph/entity/linux
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/mal
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/mysql
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+drop class /m3graph/entity/openstack
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/oracle
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/pdu
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/power
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+drop class /m3graph/entity/router
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/sanstorage
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/sanswitch
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/sqlserver
+/**
+onerror(continue)
+noerrinfo()
+**/;
+
+drop class /m3graph/entity/switch
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/tomcat
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/ups
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity/vlan
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph/entity
+/**
+onerror(continue)
+noerrinfo()
+**/;
+drop class /m3graph
+/**
+onerror(continue)
+noerrinfo()
+**/;

+ 46 - 0
odbctest/mql/basic/graph_test/16graph_create_class.mql

@@ -0,0 +1,46 @@
+create class if not exists /m3graph() with ttl=366 day, namespace='m3graph';
+create class if not exists /m3graph/entity() with ttl=366 day, nickname='entity';
+create class if not exists /m3graph/entity/vmware() with ttl=366 day, autosearch=true, version=true, nickname='vmware';
+create class if not exists /m3graph/entity/weblogic() with  ttl=366 day, autosearch=true, version=true, nickname='weblogic';
+create class if not exists /m3graph/entity/websphere() with ttl=366 day, autosearch=true, version=true, nickname='websphere';
+create class if not exists /m3graph/entity/windows() with  ttl=366 day, autosearch=true, version=true, nickname='windows';
+create class if not exists /m3graph/entity/x86() with  ttl=366 day, autosearch=true, version=true, nickname='x86';
+
+
+create class if not exists /m3graph/entity/aix() with ttl=366 day, autosearch=true, version=true, nickname='aix';
+create class if not exists /m3graph/entity/app() with ttl=366 day, autosearch=true, version=true,  nickname='app';
+create class if not exists /m3graph/entity/biz() with  ttl=366 day, autosearch=true, version=true,  nickname='biz';
+
+create class if not exists /m3graph/entity/cluster() with  ttl=366 day, autosearch=true, version=true,  nickname='cluster';
+create class if not exists /m3graph/entity/db2() with  ttl=366 day, autosearch=true, version=true,  nickname='db2';
+create class if not exists /m3graph/entity/esx() with  ttl=366 day, autosearch=true, version=true,  nickname='esx';
+
+create class if not exists /m3graph/entity/ha() with  ttl=366 day, autosearch=true, version=true,  nickname='ha';
+create class if not exists /m3graph/entity/hmc() with  ttl=366 day, autosearch=true, version=true,  nickname='hmc';
+create class if not exists /m3graph/entity/http() with  ttl=366 day, autosearch=true, version=true,  nickname='http';
+
+
+create class if not exists /m3graph/entity/linux() with  ttl=366 day, autosearch=true, version=true,  nickname='linux';
+create class if not exists /m3graph/entity/mal() with  ttl=366 day, autosearch=true, version=true,  nickname='mal';
+create class if not exists /m3graph/entity/mysql() with  ttl=366 day, autosearch=true, version=true,  nickname='mysql';
+
+create class if not exists /m3graph/entity/openstack() with  ttl=366 day, autosearch=true, version=true,  nickname='openstack';
+create class if not exists /m3graph/entity/oracle() with  ttl=366 day, autosearch=true, version=true,  nickname='oracle';
+create class if not exists /m3graph/entity/pdu() with  ttl=366 day, autosearch=true, version=true,  nickname='pdu';
+create class if not exists /m3graph/entity/power() with  ttl=366 day, autosearch=true, version=true,  nickname='power';
+
+create class if not exists /m3graph/entity/router() with  ttl=366 day, autosearch=true, version=true,  nickname='router';
+create class if not exists /m3graph/entity/sanstorage() with  ttl=366 day, autosearch=true, version=true,  nickname='sanstorage';
+create class if not exists /m3graph/entity/sanswitch() with  ttl=366 day, autosearch=true, version=true,  nickname='sanswitch';
+create class if not exists /m3graph/entity/sqlserver() with  ttl=366 day, autosearch=true, version=true,  nickname='sqlserver';
+
+create class if not exists /m3graph/entity/switch() with  ttl=366 day, autosearch=true, version=true,  nickname='switch';
+create class if not exists /m3graph/entity/tomcat() with  ttl=366 day, autosearch=true, version=true,  nickname='tomcat';
+create class if not exists /m3graph/entity/ups() with  ttl=366 day, autosearch=true, version=true,  nickname='ups';
+create class if not exists /m3graph/entity/vlan() with  ttl=366 day, autosearch=true, version=true,  nickname='vlan';
+
+/**
+sleep(2s)
+**/
+;
+

+ 11 - 0
odbctest/mql/basic/graph_test/17graph_create_type.mql

@@ -0,0 +1,11 @@
+
+CREATE EDGE TYPE IF NOT EXISTS m3graph.connect '连接';
+CREATE EDGE TYPE IF NOT EXISTS m3graph.contain '包含';
+CREATE EDGE TYPE IF NOT EXISTS m3graph.runon '运行于';
+CREATE EDGE TYPE IF NOT EXISTS m3graph.depend '依赖';
+
+/**
+sleep(2s)
+**/
+;
+

+ 90 - 0
odbctest/mql/basic/graph_test/18graph_insert_data.mql

@@ -0,0 +1,90 @@
+insert into /m3graph/entity/biz id="biz:查账系统",contain=["cluster:查账系统web集群","cluster:查账系统应用服务集群","ha:查账系统数据库HA"],depend=["biz:认证系统"];
+
+insert into /m3graph/entity/cluster id="cluster:查账系统web集群",contain=["http:查账http1","http:查账http2","http:查账http3","http:查账http4"];
+
+insert into /m3graph/entity/cluster id="cluster:查账系统应用服务集群",contain=["weblogic:weblogic1","weblogic:weblogic2","weblogic:weblogic3","app:app1","app:app2","app:app3"];
+
+insert into /m3graph/entity/ha id="ha:查账系统数据库HA",contain=["oracle:oracle1","oracle:oracle2"];
+
+insert into /m3graph/entity/http id="http:查账http1",runon=["linux:linux1"];
+insert into /m3graph/entity/http id="http:查账http2",runon=["linux:linux3"];
+insert into /m3graph/entity/http id="http:查账http3",runon=["linux:linux5"];
+insert into /m3graph/entity/http id="http:查账http4",runon=["linux:linux8"];
+
+insert into /m3graph/entity/oracle id="oracle:oracle1",runon=["linux:linux6"];
+insert into /m3graph/entity/oracle id="oracle:oracle2",runon=["linux:linux9"];
+
+insert into /m3graph/entity/app id="app:app1",depend=["weblogic:weblogic1"],runon=["linux:linux2"];
+insert into /m3graph/entity/app id="app:app2",depend=["weblogic:weblogic2"],runon=["linux:linux4"];
+insert into /m3graph/entity/app id="app:app3",depend=["weblogic:weblogic3"],runon=["linux:linux7"];
+
+insert into /m3graph/entity/weblogic id="weblogic:weblogic1",runon=["linux:linux2"];
+insert into /m3graph/entity/weblogic id="weblogic:weblogic2",runon=["linux:linux4"];
+insert into /m3graph/entity/weblogic id="weblogic:weblogic3",runon=["linux:linux7"];
+
+insert into /m3graph/entity/linux id="linux:linux1",runon=["esx:esx1"];
+insert into /m3graph/entity/linux id="linux:linux2",runon=["esx:esx1"];
+insert into /m3graph/entity/linux id="linux:linux3",runon=["esx:esx1"];
+insert into /m3graph/entity/linux id="linux:linux4",runon=["esx:esx2"];
+insert into /m3graph/entity/linux id="linux:linux5",runon=["esx:esx2"];
+insert into /m3graph/entity/linux id="linux:linux6",runon=["esx:esx2"];
+insert into /m3graph/entity/linux id="linux:linux7",runon=["esx:esx3"];
+insert into /m3graph/entity/linux id="linux:linux8",runon=["esx:esx3"];
+insert into /m3graph/entity/linux id="linux:linux9",runon=["esx:esx3"];
+
+insert into /m3graph/entity/esx id="esx:esx1",connect=["switch:switch1","sanswitch:sanswitch1"];
+insert into /m3graph/entity/esx id="esx:esx2",connect=["switch:switch2","sanswitch:sanswitch1"];
+insert into /m3graph/entity/esx id="esx:esx3",connect=["switch:switch3","sanswitch:sanswitch1"];
+
+insert into /m3graph/entity/switch id="switch:switch1",connect=["esx:esx1","esx:esx4","esx:esx5","switch:switch4","switch:switch5"];
+insert into /m3graph/entity/switch id="switch:switch2",connect=["esx:esx2","switch:switch4","switch:switch5"];
+insert into /m3graph/entity/switch id="switch:switch3",connect=["esx:esx3","switch:switch4","switch:switch5"];
+
+insert into /m3graph/entity/switch id="switch:switch4",connect=["switch:switch1","switch:switch2","switch:switch3","router:router1","router:router2"];
+insert into /m3graph/entity/switch id="switch:switch5",connect=["switch:switch1","switch:switch2","switch:switch3","router:router1","router:router2"];
+
+insert into /m3graph/entity/router id="router:router1",connect=["switch:switch4","switch:switch5","router:router3","router:router4"];
+insert into /m3graph/entity/router id="router:router2",connect=["switch:switch4","switch:switch5","router:router3","router:router4"];
+
+insert into /m3graph/entity/router id="router:router3",connect=["router:router1","router:router2","switch:switch6","switch:switch7"];
+insert into /m3graph/entity/router id="router:router4",connect=["router:router1","router:router2","switch:switch6","switch:switch7"];
+
+insert into /m3graph/entity/switch id="switch:switch6",connect=["router:router3","router:router4"];
+insert into /m3graph/entity/switch id="switch:switch7",connect=["router:router3","router:router4"];
+
+insert into /m3graph/entity/sanswitch id="sanswitch:sanswitch1",connect=["esx:esx1","esx:esx2","esx:esx3","esx:esx4","esx:esx5","sanstorage:sanstorage1"];
+
+insert into /m3graph/entity/sanswitch id="sanswitch:sanswitch2";
+
+insert into /m3graph/entity/sanstorage id="sanstorage:sanstorage1",connect=["sanswitch:sanswitch1"];
+
+insert into /m3graph/entity/biz id="biz:认证系统",contain=["ha:认证系统数据库HA","ha:认证系统应用服务集群"];
+
+insert into /m3graph/entity/ha id="ha:认证系统数据库HA",contain=["db2:db21","db2:db22"];
+
+insert into /m3graph/entity/ha id="ha:认证系统应用服务集群",contain=["weblogic:weblogic4","weblogic:weblogic5","app:app4","app:app5"];
+
+insert into /m3graph/entity/db2 id="db2:db21",runon=["linux:linux10"];
+insert into /m3graph/entity/db2 id="db2:db22",runon=["linux:linux12"];
+
+insert into /m3graph/entity/weblogic id="weblogic:weblogic4",runon=["linux:linux11"];
+insert into /m3graph/entity/weblogic id="weblogic:weblogic5",runon=["linux:linux13"];
+
+insert into /m3graph/entity/app id="app:app4",runon=["linux:linux11"];
+insert into /m3graph/entity/app id="app:app5",runon=["linux:linux13"];
+
+insert into /m3graph/entity/linux id="linux:linux10",runon=["esx:esx4"];
+insert into /m3graph/entity/linux id="linux:linux11",runon=["esx:esx4"];
+insert into /m3graph/entity/linux id="linux:linux12",runon=["esx:esx5"];
+insert into /m3graph/entity/linux id="linux:linux13",runon=["esx:esx5"];
+
+insert into /m3graph/entity/esx id="esx:esx4",connect=["switch:switch1","sanswitch:sanswitch1"];
+insert into /m3graph/entity/esx id="esx:esx5",connect=["switch:switch1","sanswitch:sanswitch1"];
+
+create ("sanstorage:sanstorage1")-[:connect]->("sanswitch:sanswitch2")
+
+/**
+sleep(2s)
+**/
+;
+

+ 17 - 0
odbctest/mql/basic/graph_test/19graph_match.mql

@@ -0,0 +1,17 @@
+match ("biz:查账系统")-[:contain*1]->()-[*]->("esx:*")-[*1]->('switch:*')
+/**
+match("graph.nodes.len",46)
+**/
+;
+
+match (b:"biz:*")-[*]->(e:"esx:*")-[*1]->(s:"switch:*") short path b,e,s
+/**
+match("graph.paths.len",18)
+**/
+;
+
+match ("biz:查账系统")-[:contain]->("cluster:查账系统web集群")-[*]->() until "switch:*"
+/**
+match("graph.nodes.len",18)
+**/
+;

+ 0 - 0
odbctest/mql/build.sh


+ 0 - 0
odbctest/mql/initkeyspace.sh


+ 0 - 0
odbctest/mql/make.sh


+ 0 - 0
odbctest/mql/mqltest.sh


+ 0 - 0
odbctest/mql/oktest.sh


+ 0 - 0
odbctest/mql/pprof.sh


+ 0 - 0
odbctest/mql/syncmql.sh


+ 0 - 0
odbctest/mql/syncto.sh