// Copyright (c) 1999-2001 Microsoft Corporation, All Rights Reserved //JoinView1.Name1="Class1Name1",Name2="Class2Name1" #pragma namespace("\\\\.\\root") instance of __Namespace { Name = "Namespace1" ; } ; instance of __Namespace { Name = "Namespace2" ; } ; instance of __Namespace { Name = "ViewNamespace" ; } ; #pragma namespace("\\\\.\\root\\snmp") [AgentAddress("nadir1")] instance of __Namespace { Name = "remotehost" ; }; #pragma namespace("\\\\.\\root\\snmp\\remotehost") instance of __Win32Provider as $PClass { Name = "MS_SNMP_CLASS_PROVIDER"; Clsid = "{70426720-F78F-11cf-9151-00AA00A4086C}"; }; instance of __ClassProviderRegistration { Provider = $PClass; SupportsGet = TRUE; SupportsPut = FALSE; SupportsDelete = FALSE; SupportsEnumeration = TRUE; QuerySupportLevels = NULL ; ResultSetQueries = { "Select * From meta_class Where __this isa SnmpMacro" } ; } ; instance of __Win32Provider as $EventProv { Name = "MS_SNMP_REFERENT_EVENT_PROVIDER"; ClsId = "{9D5BED16-0765-11d1-AB2C-00C04FD9159E}"; }; instance of __EventProviderRegistration { Provider = $EventProv; EventQueryList = {"select * from SnmpExtendedNotification"} ; }; instance of __Win32Provider as $EncapEventProv { Name = "MS_SNMP_ENCAPSULATED_EVENT_PROVIDER"; ClsId = "{19C813AC-FEE7-11D0-AB22-00C04FD9159E}"; }; instance of __EventProviderRegistration { Provider = $EncapEventProv; EventQueryList = {"select * from SnmpNotification"}; }; instance of __Win32Provider as $PInst { Name = "MS_SNMP_INSTANCE_PROVIDER"; Clsid = "{1F517A23-B29C-11cf-8C8D-00AA00A4086C}"; }; instance of __InstanceProviderRegistration { Provider = $PInst; SupportsGet = TRUE; SupportsPut = TRUE; SupportsDelete = TRUE; SupportsEnumeration = TRUE; QuerySupportLevels = { "WQL:UnarySelect" } ; }; #pragma namespace("\\\\.\\root\\Namespace1") class Class1 { [key] string Class1Name; string Class1StringProperty; uint32 Class1UINTProperty; sint32 Class1SINTProperty; boolean Class1BOOLProperty; datetime Class1DateTimeProperty; }; [association] class Class1Assoc { [key] Class1 REF parent; [key] Class1 REF child; }; instance of Class1 { Class1Name = "Class1Name1"; Class1StringProperty = "Class1StringProperty1"; Class1UINTProperty = 1; Class1SINTProperty = -1; Class1BOOLProperty = true; Class1DateTimeProperty = "20000101000001.000000+000"; }; instance of Class1 { Class1Name = "Class1Name2"; Class1StringProperty = "Class1StringProperty2"; Class1UINTProperty = 2; Class1SINTProperty = -2; Class1BOOLProperty = FALSE; Class1DateTimeProperty = "20000101000002.000000+000"; }; instance of Class1 { Class1Name = "Class1Name3"; Class1StringProperty = "Class1StringProperty3"; Class1UINTProperty = 3; Class1SINTProperty = -3; Class1BOOLProperty = TRUE; Class1DateTimeProperty = "20000101000003.000000+000"; }; instance of Class1 { Class1Name = "Class1Name4"; Class1StringProperty = "Class1StringProperty4"; Class1UINTProperty = 4; Class1SINTProperty = -4; Class1BOOLProperty = FALSE; Class1DateTimeProperty = "20000101000004.000000+000"; }; instance of Class1 { Class1Name = "Class1Name5"; Class1StringProperty = "Class1StringProperty5"; Class1UINTProperty = 5; Class1SINTProperty = -5; Class1BOOLProperty = TRUE; Class1DateTimeProperty = "20000101000005.000000+000"; }; instance of Class1Assoc { Parent = "\\\\.\\root\\Namespace1:Class1.Class1Name=\"Class1Name1\""; Child = "\\\\.\\root\\Namespace1:Class1.Class1Name=\"Class1Name5\""; }; #pragma namespace("\\\\.\\root\\Namespace2") class Class2 { [key] string Class2Name; string Class2StringProperty; uint32 Class2UINTProperty; sint32 Class2SINTProperty; boolean Class2BOOLProperty; datetime Class2DateTimeProperty; }; instance of Class2 { Class2Name = "Class2Name1"; Class2StringProperty = "Class2StringProperty1"; Class2UINTProperty = 1; Class2SINTProperty = -1; Class2BOOLProperty = TRUE; Class2DateTimeProperty = "20000202000001.000000+000"; }; instance of Class2 { Class2Name = "Class2Name2"; Class2StringProperty = "Class2StringProperty2"; Class2UINTProperty = 2; Class2SINTProperty = -2; Class2BOOLProperty = FALSE; Class2DateTimeProperty = "20000202000002.000000+000"; }; instance of Class2 { Class2Name = "Class2Name3"; Class2StringProperty = "Class2StringProperty3"; Class2UINTProperty = 3; Class2SINTProperty = -3; Class2BOOLProperty = TRUE; Class2DateTimeProperty = "20000202000003.000000+000"; }; instance of Class2 { Class2Name = "Class2Name4"; Class2StringProperty = "Class2StringProperty4"; Class2UINTProperty = 4; Class2SINTProperty = -4; Class2BOOLProperty = FALSE; Class2DateTimeProperty = "20000202000004.000000+000"; }; instance of Class2 { Class2Name = "Class2Name5"; Class2StringProperty = "Class2StringProperty5"; Class2UINTProperty = 5; Class2SINTProperty = -5; Class2BOOLProperty = TRUE; Class2DateTimeProperty = "20000202000005.000000+000"; }; #pragma namespace("\\\\.\\root\\ViewNamespace") instance of __Win32Provider as $DataProv { Name = "MS_VIEW_INSTANCE_PROVIDER"; ClsId = "{AA70DDF4-E11C-11d1-ABB0-00C04FD9159E}"; }; instance of __InstanceProviderRegistration { Provider = $DataProv; SupportsPut = TRUE; SupportsGet = TRUE; SupportsDelete = TRUE; SupportsEnumeration = TRUE; QuerySupportLevels = {"WQL:UnarySelect"}; }; instance of __MethodProviderRegistration { Provider = $DataProv; }; [Union, ViewSources {"Select Class1Name, Class1StringProperty, Class1UINTProperty From Class1 where Class1UINTProperty != 3", \ "Select Class2Name, Class2StringProperty, Class2UINTProperty From Class2 where Class2UINTProperty != 2"}, ViewSpaces {"\\\\.\\root\\Namespace1", "\\\\.\\root\\Namespace2"}, dynamic, provider("MS_VIEW_INSTANCE_PROVIDER") ] class UnionView1 { [ PropertySources{"Class1Name", "Class2Name"}, key ] string Name; [ PropertySources{"Class1StringProperty", "Class2StringProperty"} ] string StringProperty; [ PropertySources{"Class1UINTProperty", ""} ] uint32 UINT1Property; [ PropertySources{"", "Class2UINTProperty"} ] uint32 UINT2Property; }; [Association, ViewSources {"Select * From Class1Assoc"}, ViewSpaces {"\\\\.\\root\\Namespace1"}, dynamic, provider("MS_VIEW_INSTANCE_PROVIDER") ] class AssocView1 { [ PropertySources{"Parent"}, key ] UnionView1 REF Parent; [ PropertySources{"Child"}, key ] UnionView1 REF Child; }; [ JoinOn("Class1.Class1UINTProperty = Class2.Class2UINTProperty"), ViewSources { "Select Class1Name, Class1StringProperty, Class1UINTProperty From Class1 where Class1UINTProperty != 3", "Select Class2Name, Class2StringProperty, Class2UINTProperty From Class2 where Class2UINTProperty != 2" }, ViewSpaces {"\\\\.\\root\\Namespace1", "\\\\.\\root\\Namespace2"}, dynamic, provider("MS_VIEW_INSTANCE_PROVIDER") ] class JoinView1 { [ PropertySources{"Class1Name", ""}, key ] string Name1; [ PropertySources{"", "Class2Name"}, key ] string Name2; [ PropertySources{"Class1StringProperty", ""} ] string String1; [ PropertySources{"", "Class2StringProperty"} ] string String2; [ PropertySources{"Class1UINTProperty", "Class2UINTProperty"} ] uint32 UINTVal; }; [Union, ViewSources ("Select * From SNMP_RFC1213_MIB_system where __CLASS = \"SNMP_RFC1213_MIB_system\""), ViewSpaces ("\\\\.\\root\\snmp\\localhost::\\\\.\\root\\snmp\\remotehost"), dynamic, provider("MS_VIEW_INSTANCE_PROVIDER") ] class ViewSnmpSystem { [ PropertySources("__PATH"), key ] string Path; [ PropertySources("sysContact") ] string Contact; [ PropertySources("sysLocation") ] string Location; [ PropertySources("sysName") ] string Name; [ PropertySources("sysDescr") ] string Description; }; [ JoinOn("Win32_NetworkAdapterConfiguration.MACAddress = SNMP_RFC1213_MIB_ifTable.ifPhysAddress"), ViewSources {"Select * From SNMP_RFC1213_MIB_ifTable", \ "Select * From Win32_NetworkAdapterConfiguration" \ }, ViewSpaces {"\\\\.\\root\\snmp\\localhost", \ "\\\\.\\root\\cimv2" \ }, dynamic, provider("MS_VIEW_INSTANCE_PROVIDER") ] class ViewSnmpCimv2Join { [ PropertySources{"ifSpeed", ""} ] uint32 Speed; [ PropertySources{"ifType", ""} ] string Type; [ PropertySources{"ifOperStatus", ""} ] string OpStatus; [ PropertySources{"ifAdminStatus", ""} ] string AdminStatus; [ PropertySources{"ifDescr", ""} ] string Description; [ PropertySources{"ifIndex", ""}, key ] sint32 snmpIndex; [ PropertySources{"ifPhysAddress", "MACAddress"} ] string MacAddress; [ PropertySources{"", "Index"}, key ] uint32 win32Index; [ PropertySources{"", "DHCPEnabled"} ] boolean DHCPEnabled; [ PropertySources{"", "DHCPLeaseExpires"} ] datetime DHCPLeaseExpires; }; [Union, ViewSources {"Select * From Win32_NTEventlogFile"}, ViewSpaces ("\\\\.\\root\\cimv2"), dynamic, provider("MS_VIEW_INSTANCE_PROVIDER") ] class View_NTEventlogFile { [ key, PropertySources{"Name"} ] string VName; //Methods [implemented, MethodSource{"ClearEventlog"}] uint32 VClearEventlog([in] string ArchiveFileName); [implemented, MethodSource{"BackupEventlog"}] uint32 VBackupEventlog([in] string ArchiveFileName); };