From 0d9b0b550610b9b3406c32c705414d207fd83a9a Mon Sep 17 00:00:00 2001 From: Zhongcheng Lao Date: Wed, 12 Mar 2025 17:06:35 +0800 Subject: [PATCH] Use WMI to implement Volume API to reduce PowerShell overhead --- go.mod | 2 + go.sum | 5 + pkg/cim/disk.go | 36 + pkg/cim/volume.go | 300 ++ pkg/cim/wmi.go | 367 +++ pkg/os/volume/api.go | 401 +-- pkg/os/volume/api_test.go | 7 +- vendor/github.com/go-ole/go-ole/.travis.yml | 8 + vendor/github.com/go-ole/go-ole/ChangeLog.md | 49 + vendor/github.com/go-ole/go-ole/LICENSE | 21 + vendor/github.com/go-ole/go-ole/README.md | 46 + vendor/github.com/go-ole/go-ole/SECURITY.md | 13 + vendor/github.com/go-ole/go-ole/appveyor.yml | 68 + vendor/github.com/go-ole/go-ole/com.go | 386 +++ vendor/github.com/go-ole/go-ole/com_func.go | 174 ++ vendor/github.com/go-ole/go-ole/connect.go | 192 ++ vendor/github.com/go-ole/go-ole/constants.go | 153 + vendor/github.com/go-ole/go-ole/error.go | 51 + vendor/github.com/go-ole/go-ole/error_func.go | 8 + .../github.com/go-ole/go-ole/error_windows.go | 24 + vendor/github.com/go-ole/go-ole/guid.go | 284 ++ .../go-ole/go-ole/iconnectionpoint.go | 20 + .../go-ole/go-ole/iconnectionpoint_func.go | 21 + .../go-ole/go-ole/iconnectionpoint_windows.go | 43 + .../go-ole/iconnectionpointcontainer.go | 17 + .../go-ole/iconnectionpointcontainer_func.go | 11 + .../iconnectionpointcontainer_windows.go | 25 + vendor/github.com/go-ole/go-ole/idispatch.go | 94 + .../go-ole/go-ole/idispatch_func.go | 19 + .../go-ole/go-ole/idispatch_windows.go | 203 ++ .../github.com/go-ole/go-ole/ienumvariant.go | 19 + .../go-ole/go-ole/ienumvariant_func.go | 19 + .../go-ole/go-ole/ienumvariant_windows.go | 63 + .../github.com/go-ole/go-ole/iinspectable.go | 18 + .../go-ole/go-ole/iinspectable_func.go | 15 + .../go-ole/go-ole/iinspectable_windows.go | 72 + .../go-ole/go-ole/iprovideclassinfo.go | 21 + .../go-ole/go-ole/iprovideclassinfo_func.go | 7 + .../go-ole/iprovideclassinfo_windows.go | 21 + vendor/github.com/go-ole/go-ole/itypeinfo.go | 34 + .../go-ole/go-ole/itypeinfo_func.go | 7 + .../go-ole/go-ole/itypeinfo_windows.go | 21 + vendor/github.com/go-ole/go-ole/iunknown.go | 57 + .../github.com/go-ole/go-ole/iunknown_func.go | 19 + .../go-ole/go-ole/iunknown_windows.go | 58 + vendor/github.com/go-ole/go-ole/ole.go | 190 ++ .../go-ole/go-ole/oleutil/connection.go | 100 + .../go-ole/go-ole/oleutil/connection_func.go | 10 + .../go-ole/oleutil/connection_windows.go | 58 + .../go-ole/go-ole/oleutil/go-get.go | 6 + .../go-ole/go-ole/oleutil/oleutil.go | 127 + vendor/github.com/go-ole/go-ole/safearray.go | 27 + .../go-ole/go-ole/safearray_func.go | 211 ++ .../go-ole/go-ole/safearray_windows.go | 337 +++ .../go-ole/go-ole/safearrayconversion.go | 140 + .../go-ole/go-ole/safearrayslices.go | 33 + vendor/github.com/go-ole/go-ole/utility.go | 101 + vendor/github.com/go-ole/go-ole/variables.go | 15 + vendor/github.com/go-ole/go-ole/variant.go | 105 + .../github.com/go-ole/go-ole/variant_386.go | 11 + .../github.com/go-ole/go-ole/variant_amd64.go | 12 + .../github.com/go-ole/go-ole/variant_arm.go | 11 + .../github.com/go-ole/go-ole/variant_arm64.go | 13 + .../go-ole/go-ole/variant_date_386.go | 22 + .../go-ole/go-ole/variant_date_amd64.go | 20 + .../go-ole/go-ole/variant_date_arm.go | 22 + .../go-ole/go-ole/variant_date_arm64.go | 23 + .../go-ole/go-ole/variant_ppc64le.go | 12 + .../github.com/go-ole/go-ole/variant_s390x.go | 12 + vendor/github.com/go-ole/go-ole/vt_string.go | 58 + vendor/github.com/go-ole/go-ole/winrt.go | 99 + vendor/github.com/go-ole/go-ole/winrt_doc.go | 36 + vendor/github.com/microsoft/wmi/LICENSE | 21 + .../github.com/microsoft/wmi/go/wmi/Class.go | 16 + .../microsoft/wmi/go/wmi/Credentials.go | 13 + .../microsoft/wmi/go/wmi/Instance.go | 24 + .../microsoft/wmi/go/wmi/InstanceManager.go | 17 + .../microsoft/wmi/go/wmi/MethodDeclaration.go | 7 + .../microsoft/wmi/go/wmi/MethodParameter.go | 66 + .../microsoft/wmi/go/wmi/MethodResult.go | 7 + .../microsoft/wmi/go/wmi/Property.go | 91 + .../microsoft/wmi/go/wmi/Qualifier.go | 6 + .../github.com/microsoft/wmi/go/wmi/Query.go | 51 + .../microsoft/wmi/go/wmi/Session.go | 26 + .../wmi/pkg/base/credential/credential.go | 14 + .../microsoft/wmi/pkg/base/host/host.go | 31 + .../wmi/pkg/base/instance/instancemanager.go | 192 ++ .../microsoft/wmi/pkg/base/query/query.go | 127 + .../microsoft/wmi/pkg/base/session/session.go | 95 + .../microsoft/wmi/pkg/errors/errors.go | 105 + .../microsoft/wmi/pkg/wmiinstance/WmiClass.go | 314 ++ .../wmi/pkg/wmiinstance/WmiEventSink.go | 248 ++ .../wmi/pkg/wmiinstance/WmiHelper.go | 198 ++ .../wmi/pkg/wmiinstance/WmiInstance.go | 527 ++++ .../microsoft/wmi/pkg/wmiinstance/WmiJob.go | 220 ++ .../wmi/pkg/wmiinstance/WmiMethod.go | 143 + .../wmi/pkg/wmiinstance/WmiMethodParam.go | 45 + .../wmi/pkg/wmiinstance/WmiProperty.go | 84 + .../wmi/pkg/wmiinstance/WmiQualifier.go | 19 + .../wmi/pkg/wmiinstance/WmiSession.go | 307 ++ .../wmi/pkg/wmiinstance/WmiSessionManager.go | 108 + .../pkg/wmiinstance/WmiSynchronousEvents.go | 50 + .../root/microsoft/windows/storage/ACE.go | 260 ++ .../storage/AbsoluteTimerInstruction.go | 80 + .../windows/storage/AggregateEvent.go | 110 + .../windows/storage/CIM_ClassCreation.go | 48 + .../windows/storage/CIM_ClassDeletion.go | 48 + .../windows/storage/CIM_ClassIndication.go | 80 + .../windows/storage/CIM_ClassModification.go | 80 + .../microsoft/windows/storage/CIM_Error.go | 503 ++++ .../windows/storage/CIM_Indication.go | 315 ++ .../windows/storage/CIM_InstCreation.go | 48 + .../windows/storage/CIM_InstDeletion.go | 48 + .../windows/storage/CIM_InstIndication.go | 142 + .../windows/storage/CIM_InstModification.go | 80 + .../windows/storage/ClassCreationEvent.go | 48 + .../windows/storage/ClassDeletionEvent.go | 48 + .../windows/storage/ClassModificationEvent.go | 80 + .../windows/storage/ClassOperationEvent.go | 80 + .../storage/ClassProviderRegistration.go | 263 ++ .../windows/storage/ConsumerFailureEvent.go | 140 + .../root/microsoft/windows/storage/Event.go | 111 + .../windows/storage/EventConsumer.go | 141 + .../EventConsumerProviderRegistration.go | 81 + .../windows/storage/EventDroppedEvent.go | 110 + .../microsoft/windows/storage/EventFilter.go | 231 ++ .../windows/storage/EventGenerator.go | 48 + .../storage/EventProviderRegistration.go | 81 + .../storage/EventQueueOverflowEvent.go | 80 + .../windows/storage/ExtendedStatus.go | 170 ++ .../windows/storage/ExtrinsicEvent.go | 48 + .../storage/FilterToConsumerBinding.go | 261 ++ .../windows/storage/IndicationRelated.go | 48 + .../storage/Indication_PerceivedSeverity.go | 33 + .../windows/storage/InstanceCreationEvent.go | 48 + .../windows/storage/InstanceDeletionEvent.go | 48 + .../storage/InstanceModificationEvent.go | 80 + .../windows/storage/InstanceOperationEvent.go | 80 + .../storage/InstanceProviderRegistration.go | 48 + .../storage/IntervalTimerInstruction.go | 80 + .../windows/storage/MSFT_DedupProperties.go | 291 ++ .../microsoft/windows/storage/MSFT_Disk.go | 1252 ++++++++ .../windows/storage/MSFT_DiskImage.go | 356 +++ .../windows/storage/MSFT_DiskImageToVolume.go | 111 + .../windows/storage/MSFT_DiskToPartition.go | 111 + .../MSFT_DiskToStorageReliabilityCounter.go | 111 + .../windows/storage/MSFT_ExtendedStatus.go | 48 + .../windows/storage/MSFT_FileIntegrity.go | 201 ++ .../windows/storage/MSFT_FileServer.go | 398 +++ .../storage/MSFT_FileServerToFileShare.go | 111 + .../storage/MSFT_FileServerToVolume.go | 111 + .../windows/storage/MSFT_FileShare.go | 502 ++++ .../MSFT_FileShareAccessControlEntry.go | 141 + .../windows/storage/MSFT_FileStorageTier.go | 353 +++ .../windows/storage/MSFT_HealthAction.go | 441 +++ .../windows/storage/MSFT_HealthActionEvent.go | 320 +++ .../windows/storage/MSFT_HealthRecord.go | 111 + .../storage/MSFT_HealthRecordReal64.go | 80 + .../storage/MSFT_HealthRecordUInt64.go | 80 + .../windows/storage/MSFT_InitiatorId.go | 187 ++ .../storage/MSFT_InitiatorIdToVirtualDisk.go | 111 + .../windows/storage/MSFT_InitiatorPort.go | 372 +++ .../MSFT_InitiatorPortToiSCSIConnection.go | 111 + .../MSFT_InitiatorPortToiSCSISession.go | 111 + .../MSFT_InitiatorPortToiSCSITarget.go | 111 + .../windows/storage/MSFT_MaskingSet.go | 351 +++ .../storage/MSFT_MaskingSetToInitiatorId.go | 111 + .../storage/MSFT_MaskingSetToTargetPort.go | 111 + .../storage/MSFT_MaskingSetToVirtualDisk.go | 111 + .../MSFT_OffloadDataTransferSetting.go | 170 ++ .../windows/storage/MSFT_Partition.go | 850 ++++++ .../storage/MSFT_PartitionToReplicaPeer.go | 110 + .../windows/storage/MSFT_PartitionToVolume.go | 111 + .../windows/storage/MSFT_PhysicalDisk.go | 985 +++++++ ...PhysicalDiskToStorageReliabilityCounter.go | 111 + .../windows/storage/MSFT_PhysicalExtent.go | 413 +++ .../windows/storage/MSFT_ReplicaPeer.go | 290 ++ .../storage/MSFT_ReplicationCapabilities.go | 590 ++++ .../windows/storage/MSFT_ReplicationGroup.go | 341 +++ .../MSFT_ReplicationGroupToPartition.go | 111 + .../MSFT_ReplicationGroupToReplicaPeer.go | 170 ++ .../MSFT_ReplicationGroupToVirtualDisk.go | 111 + .../storage/MSFT_ReplicationSettings.go | 232 ++ .../windows/storage/MSFT_ResiliencySetting.go | 648 +++++ .../MSFT_SBLTargetCacheConfiguration.go | 752 +++++ .../windows/storage/MSFT_SBLTargetDisk.go | 471 +++ .../windows/storage/MSFT_SoftError.go | 48 + .../storage/MSFT_SoftError_EmptyCache.go | 48 + .../MSFT_SoftError_NotAuthenticated.go | 48 + .../storage/MSFT_SoftError_NotInCache.go | 48 + .../storage/MSFT_SoftError_RelativePath.go | 48 + .../windows/storage/MSFT_StorageAlertEvent.go | 80 + .../storage/MSFT_StorageArrivalEvent.go | 48 + .../windows/storage/MSFT_StorageChassis.go | 48 + .../storage/MSFT_StorageDepartureEvent.go | 48 + .../storage/MSFT_StorageDiagnoseResult.go | 352 +++ .../windows/storage/MSFT_StorageEnclosure.go | 520 ++++ .../MSFT_StorageEnclosureToPhysicalDisk.go | 111 + .../windows/storage/MSFT_StorageEvent.go | 321 +++ .../storage/MSFT_StorageExtendedStatus.go | 48 + .../storage/MSFT_StorageFaultDomain.go | 322 +++ ..._StorageFaultDomainToStorageFaultDomain.go | 111 + .../windows/storage/MSFT_StorageFaultEvent.go | 381 +++ .../windows/storage/MSFT_StorageHealth.go | 176 ++ .../storage/MSFT_StorageHealthReport.go | 142 + .../storage/MSFT_StorageHealthSetting.go | 111 + .../MSFT_StorageHealthStatusChangeEvent.go | 170 ++ .../windows/storage/MSFT_StorageJob.go | 747 +++++ .../storage/MSFT_StorageJobOutParams.go | 49 + .../MSFT_StorageJobToAffectedStorageObject.go | 111 + .../storage/MSFT_StorageModificationEvent.go | 48 + .../windows/storage/MSFT_StorageNode.go | 322 +++ .../windows/storage/MSFT_StorageNodeToDisk.go | 292 ++ .../storage/MSFT_StorageNodeToPhysicalDisk.go | 354 +++ .../MSFT_StorageNodeToStorageEnclosure.go | 418 +++ .../storage/MSFT_StorageNodeToStoragePool.go | 111 + .../storage/MSFT_StorageNodeToVirtualDisk.go | 111 + .../storage/MSFT_StorageNodeToVolume.go | 111 + .../windows/storage/MSFT_StorageObject.go | 231 ++ .../windows/storage/MSFT_StoragePool.go | 1415 +++++++++ .../storage/MSFT_StoragePoolToPhysicalDisk.go | 111 + .../MSFT_StoragePoolToResiliencySetting.go | 111 + .../storage/MSFT_StoragePoolToStorageTier.go | 111 + .../storage/MSFT_StoragePoolToVirtualDisk.go | 111 + .../storage/MSFT_StoragePoolToVolume.go | 111 + .../windows/storage/MSFT_StorageProvider.go | 472 +++ .../MSFT_StorageProviderToStorageSubSystem.go | 111 + .../windows/storage/MSFT_StorageQoSFlow.go | 651 +++++ .../windows/storage/MSFT_StorageQoSPolicy.go | 325 +++ .../storage/MSFT_StorageQoSPolicyStore.go | 143 + .../MSFT_StorageQoSPolicyToChildPolicy.go | 111 + .../storage/MSFT_StorageQoSPolicyToFlow.go | 111 + .../windows/storage/MSFT_StorageQoSVolume.go | 381 +++ .../windows/storage/MSFT_StorageRack.go | 48 + .../storage/MSFT_StorageReliabilityCounter.go | 633 +++++ .../windows/storage/MSFT_StorageScaleUnit.go | 74 + .../windows/storage/MSFT_StorageSetting.go | 156 + .../windows/storage/MSFT_StorageSite.go | 48 + .../windows/storage/MSFT_StorageSubSystem.go | 2530 +++++++++++++++++ .../storage/MSFT_StorageSubSystemToDisk.go | 111 + .../MSFT_StorageSubSystemToFileServer.go | 111 + .../MSFT_StorageSubSystemToFileShare.go | 111 + .../MSFT_StorageSubSystemToInitiatorId.go | 111 + .../MSFT_StorageSubSystemToMaskingSet.go | 111 + ...geSubSystemToOffloadDataTransferSetting.go | 111 + .../MSFT_StorageSubSystemToPartition.go | 111 + .../MSFT_StorageSubSystemToPhysicalDisk.go | 111 + .../MSFT_StorageSubSystemToReplicaPeer.go | 111 + ...orageSubSystemToReplicationCapabilities.go | 111 + ...MSFT_StorageSubSystemToReplicationGroup.go | 111 + ...MSFT_StorageSubSystemToStorageEnclosure.go | 111 + ...FT_StorageSubSystemToStorageFaultDomain.go | 111 + .../MSFT_StorageSubSystemToStorageHealth.go | 111 + .../MSFT_StorageSubSystemToStorageNode.go | 111 + .../MSFT_StorageSubSystemToStoragePool.go | 111 + .../MSFT_StorageSubSystemToTargetPort.go | 111 + .../MSFT_StorageSubSystemToTargetPortal.go | 111 + .../MSFT_StorageSubSystemToVirtualDisk.go | 111 + .../storage/MSFT_StorageSubSystemToVolume.go | 111 + .../windows/storage/MSFT_StorageTier.go | 826 ++++++ .../windows/storage/MSFT_Synchronized.go | 471 +++ .../windows/storage/MSFT_TargetPort.go | 593 ++++ .../storage/MSFT_TargetPortToTargetPortal.go | 111 + .../storage/MSFT_TargetPortToVirtualDisk.go | 111 + .../windows/storage/MSFT_TargetPortal.go | 170 ++ .../windows/storage/MSFT_VirtualDisk.go | 1692 +++++++++++ .../windows/storage/MSFT_VirtualDiskToDisk.go | 111 + .../storage/MSFT_VirtualDiskToPhysicalDisk.go | 111 + .../storage/MSFT_VirtualDiskToReplicaPeer.go | 110 + .../MSFT_VirtualDiskToStorageFaultDomain.go | 111 + .../storage/MSFT_VirtualDiskToStorageTier.go | 111 + .../storage/MSFT_VirtualDiskToVirtualDisk.go | 110 + .../microsoft/windows/storage/MSFT_Volume.go | 744 +++++ .../windows/storage/MSFT_VolumeToFileShare.go | 111 + .../storage/MSFT_Volume_Repair_AsyncOutput.go | 80 + .../windows/storage/MSFT_WmiError.go | 170 ++ .../windows/storage/MSFT_iSCSIConnection.go | 201 ++ .../storage/MSFT_iSCSIConnectionToDisk.go | 111 + ...MSFT_iSCSIConnectionToiSCSITargetPortal.go | 111 + .../windows/storage/MSFT_iSCSISession.go | 518 ++++ .../storage/MSFT_iSCSISessionToDisk.go | 111 + .../MSFT_iSCSISessionToiSCSIConnection.go | 111 + .../MSFT_iSCSISessionToiSCSITargetPortal.go | 111 + .../windows/storage/MSFT_iSCSITarget.go | 181 ++ .../windows/storage/MSFT_iSCSITargetPortal.go | 307 ++ .../MSFT_iSCSITargetToiSCSIConnection.go | 111 + .../storage/MSFT_iSCSITargetToiSCSISession.go | 111 + .../MSFT_iSCSITargetToiSCSITargetPortal.go | 111 + .../windows/storage/MethodInvocationEvent.go | 140 + .../storage/MethodProviderRegistration.go | 48 + .../microsoft/windows/storage/NTLMUser9X.go | 200 ++ .../microsoft/windows/storage/Namespace.go | 80 + .../windows/storage/NamespaceCreationEvent.go | 48 + .../windows/storage/NamespaceDeletionEvent.go | 48 + .../storage/NamespaceModificationEvent.go | 80 + .../storage/NamespaceOperationEvent.go | 80 + .../microsoft/windows/storage/NotifyStatus.go | 81 + .../storage/ObjectProviderRegistration.go | 291 ++ ...ectProviderRegistration_InteractionType.go | 21 + .../microsoft/windows/storage/PARAMETERS.go | 49 + .../windows/storage/PS_StorageCmdlets.go | 551 ++++ .../storage/PropertyProviderRegistration.go | 110 + .../microsoft/windows/storage/Provider.go | 80 + .../windows/storage/ProviderRegistration.go | 80 + .../windows/storage/QOSFailureEvent.go | 110 + .../windows/storage/SecurityDescriptor.go | 232 ++ .../windows/storage/SecurityRelatedClass.go | 49 + .../microsoft/windows/storage/SystemClass.go | 49 + .../microsoft/windows/storage/SystemEvent.go | 48 + .../windows/storage/SystemSecurity.go | 154 + .../microsoft/windows/storage/TimerEvent.go | 110 + .../windows/storage/TimerInstruction.go | 110 + .../windows/storage/TimerNextFiring.go | 110 + .../root/microsoft/windows/storage/Trustee.go | 231 ++ .../windows/storage/Win32Provider.go | 740 +++++ .../Win32Provider_ImpersonationLevel.go | 17 + .../Win32Provider_InitializationReentrancy.go | 21 + .../windows/storage/thisNAMESPACE.go | 81 + vendor/modules.txt | 15 + 319 files changed, 53944 insertions(+), 168 deletions(-) create mode 100644 pkg/cim/disk.go create mode 100644 pkg/cim/volume.go create mode 100644 pkg/cim/wmi.go create mode 100644 vendor/github.com/go-ole/go-ole/.travis.yml create mode 100644 vendor/github.com/go-ole/go-ole/ChangeLog.md create mode 100644 vendor/github.com/go-ole/go-ole/LICENSE create mode 100644 vendor/github.com/go-ole/go-ole/README.md create mode 100644 vendor/github.com/go-ole/go-ole/SECURITY.md create mode 100644 vendor/github.com/go-ole/go-ole/appveyor.yml create mode 100644 vendor/github.com/go-ole/go-ole/com.go create mode 100644 vendor/github.com/go-ole/go-ole/com_func.go create mode 100644 vendor/github.com/go-ole/go-ole/connect.go create mode 100644 vendor/github.com/go-ole/go-ole/constants.go create mode 100644 vendor/github.com/go-ole/go-ole/error.go create mode 100644 vendor/github.com/go-ole/go-ole/error_func.go create mode 100644 vendor/github.com/go-ole/go-ole/error_windows.go create mode 100644 vendor/github.com/go-ole/go-ole/guid.go create mode 100644 vendor/github.com/go-ole/go-ole/iconnectionpoint.go create mode 100644 vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go create mode 100644 vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go create mode 100644 vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go create mode 100644 vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go create mode 100644 vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go create mode 100644 vendor/github.com/go-ole/go-ole/idispatch.go create mode 100644 vendor/github.com/go-ole/go-ole/idispatch_func.go create mode 100644 vendor/github.com/go-ole/go-ole/idispatch_windows.go create mode 100644 vendor/github.com/go-ole/go-ole/ienumvariant.go create mode 100644 vendor/github.com/go-ole/go-ole/ienumvariant_func.go create mode 100644 vendor/github.com/go-ole/go-ole/ienumvariant_windows.go create mode 100644 vendor/github.com/go-ole/go-ole/iinspectable.go create mode 100644 vendor/github.com/go-ole/go-ole/iinspectable_func.go create mode 100644 vendor/github.com/go-ole/go-ole/iinspectable_windows.go create mode 100644 vendor/github.com/go-ole/go-ole/iprovideclassinfo.go create mode 100644 vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go create mode 100644 vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go create mode 100644 vendor/github.com/go-ole/go-ole/itypeinfo.go create mode 100644 vendor/github.com/go-ole/go-ole/itypeinfo_func.go create mode 100644 vendor/github.com/go-ole/go-ole/itypeinfo_windows.go create mode 100644 vendor/github.com/go-ole/go-ole/iunknown.go create mode 100644 vendor/github.com/go-ole/go-ole/iunknown_func.go create mode 100644 vendor/github.com/go-ole/go-ole/iunknown_windows.go create mode 100644 vendor/github.com/go-ole/go-ole/ole.go create mode 100644 vendor/github.com/go-ole/go-ole/oleutil/connection.go create mode 100644 vendor/github.com/go-ole/go-ole/oleutil/connection_func.go create mode 100644 vendor/github.com/go-ole/go-ole/oleutil/connection_windows.go create mode 100644 vendor/github.com/go-ole/go-ole/oleutil/go-get.go create mode 100644 vendor/github.com/go-ole/go-ole/oleutil/oleutil.go create mode 100644 vendor/github.com/go-ole/go-ole/safearray.go create mode 100644 vendor/github.com/go-ole/go-ole/safearray_func.go create mode 100644 vendor/github.com/go-ole/go-ole/safearray_windows.go create mode 100644 vendor/github.com/go-ole/go-ole/safearrayconversion.go create mode 100644 vendor/github.com/go-ole/go-ole/safearrayslices.go create mode 100644 vendor/github.com/go-ole/go-ole/utility.go create mode 100644 vendor/github.com/go-ole/go-ole/variables.go create mode 100644 vendor/github.com/go-ole/go-ole/variant.go create mode 100644 vendor/github.com/go-ole/go-ole/variant_386.go create mode 100644 vendor/github.com/go-ole/go-ole/variant_amd64.go create mode 100644 vendor/github.com/go-ole/go-ole/variant_arm.go create mode 100644 vendor/github.com/go-ole/go-ole/variant_arm64.go create mode 100644 vendor/github.com/go-ole/go-ole/variant_date_386.go create mode 100644 vendor/github.com/go-ole/go-ole/variant_date_amd64.go create mode 100644 vendor/github.com/go-ole/go-ole/variant_date_arm.go create mode 100644 vendor/github.com/go-ole/go-ole/variant_date_arm64.go create mode 100644 vendor/github.com/go-ole/go-ole/variant_ppc64le.go create mode 100644 vendor/github.com/go-ole/go-ole/variant_s390x.go create mode 100644 vendor/github.com/go-ole/go-ole/vt_string.go create mode 100644 vendor/github.com/go-ole/go-ole/winrt.go create mode 100644 vendor/github.com/go-ole/go-ole/winrt_doc.go create mode 100644 vendor/github.com/microsoft/wmi/LICENSE create mode 100644 vendor/github.com/microsoft/wmi/go/wmi/Class.go create mode 100644 vendor/github.com/microsoft/wmi/go/wmi/Credentials.go create mode 100644 vendor/github.com/microsoft/wmi/go/wmi/Instance.go create mode 100644 vendor/github.com/microsoft/wmi/go/wmi/InstanceManager.go create mode 100644 vendor/github.com/microsoft/wmi/go/wmi/MethodDeclaration.go create mode 100644 vendor/github.com/microsoft/wmi/go/wmi/MethodParameter.go create mode 100644 vendor/github.com/microsoft/wmi/go/wmi/MethodResult.go create mode 100644 vendor/github.com/microsoft/wmi/go/wmi/Property.go create mode 100644 vendor/github.com/microsoft/wmi/go/wmi/Qualifier.go create mode 100644 vendor/github.com/microsoft/wmi/go/wmi/Query.go create mode 100644 vendor/github.com/microsoft/wmi/go/wmi/Session.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/base/credential/credential.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/base/host/host.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/base/instance/instancemanager.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/base/query/query.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/base/session/session.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/errors/errors.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiClass.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiEventSink.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiHelper.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiInstance.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiJob.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiMethod.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiMethodParam.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiProperty.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiQualifier.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiSession.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiSessionManager.go create mode 100644 vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiSynchronousEvents.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ACE.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/AbsoluteTimerInstruction.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/AggregateEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassCreation.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassDeletion.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassIndication.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassModification.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_Error.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_Indication.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstCreation.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstDeletion.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstIndication.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstModification.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassCreationEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassDeletionEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassModificationEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassOperationEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassProviderRegistration.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ConsumerFailureEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Event.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventConsumer.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventConsumerProviderRegistration.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventDroppedEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventFilter.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventGenerator.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventProviderRegistration.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventQueueOverflowEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ExtendedStatus.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ExtrinsicEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/FilterToConsumerBinding.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/IndicationRelated.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Indication_PerceivedSeverity.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceCreationEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceDeletionEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceModificationEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceOperationEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceProviderRegistration.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/IntervalTimerInstruction.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DedupProperties.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Disk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskImage.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskImageToVolume.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskToPartition.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskToStorageReliabilityCounter.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ExtendedStatus.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileIntegrity.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileServer.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileServerToFileShare.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileServerToVolume.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileShare.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileShareAccessControlEntry.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileStorageTier.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthAction.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthActionEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthRecord.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthRecordReal64.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthRecordUInt64.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorId.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorIdToVirtualDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPort.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPortToiSCSIConnection.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPortToiSCSISession.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPortToiSCSITarget.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSet.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSetToInitiatorId.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSetToTargetPort.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSetToVirtualDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_OffloadDataTransferSetting.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Partition.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PartitionToReplicaPeer.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PartitionToVolume.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PhysicalDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PhysicalDiskToStorageReliabilityCounter.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PhysicalExtent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicaPeer.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationCapabilities.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroup.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroupToPartition.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroupToReplicaPeer.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroupToVirtualDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationSettings.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ResiliencySetting.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SBLTargetCacheConfiguration.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SBLTargetDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_EmptyCache.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_NotAuthenticated.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_NotInCache.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_RelativePath.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageAlertEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageArrivalEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageChassis.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageDepartureEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageDiagnoseResult.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageEnclosure.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageEnclosureToPhysicalDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageExtendedStatus.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageFaultDomain.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageFaultDomainToStorageFaultDomain.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageFaultEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealth.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealthReport.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealthSetting.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealthStatusChangeEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageJob.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageJobOutParams.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageJobToAffectedStorageObject.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageModificationEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNode.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToPhysicalDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToStorageEnclosure.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToStoragePool.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToVirtualDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToVolume.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageObject.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePool.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToPhysicalDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToResiliencySetting.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToStorageTier.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToVirtualDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToVolume.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageProvider.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageProviderToStorageSubSystem.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSFlow.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicy.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicyStore.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicyToChildPolicy.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicyToFlow.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSVolume.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageRack.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageReliabilityCounter.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageScaleUnit.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSetting.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSite.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystem.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToFileServer.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToFileShare.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToInitiatorId.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToMaskingSet.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToOffloadDataTransferSetting.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToPartition.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToPhysicalDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToReplicaPeer.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToReplicationCapabilities.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToReplicationGroup.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageEnclosure.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageFaultDomain.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageHealth.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageNode.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStoragePool.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToTargetPort.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToTargetPortal.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToVirtualDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToVolume.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageTier.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Synchronized.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPort.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPortToTargetPortal.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPortToVirtualDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPortal.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToPhysicalDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToReplicaPeer.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToStorageFaultDomain.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToStorageTier.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToVirtualDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Volume.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VolumeToFileShare.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Volume_Repair_AsyncOutput.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_WmiError.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSIConnection.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSIConnectionToDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSIConnectionToiSCSITargetPortal.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISession.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISessionToDisk.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISessionToiSCSIConnection.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISessionToiSCSITargetPortal.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITarget.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetPortal.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetToiSCSIConnection.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetToiSCSISession.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetToiSCSITargetPortal.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MethodInvocationEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MethodProviderRegistration.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NTLMUser9X.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Namespace.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceCreationEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceDeletionEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceModificationEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceOperationEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NotifyStatus.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ObjectProviderRegistration.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ObjectProviderRegistration_InteractionType.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/PARAMETERS.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/PS_StorageCmdlets.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/PropertyProviderRegistration.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Provider.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ProviderRegistration.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/QOSFailureEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SecurityDescriptor.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SecurityRelatedClass.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SystemClass.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SystemEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SystemSecurity.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/TimerEvent.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/TimerInstruction.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/TimerNextFiring.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Trustee.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Win32Provider.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Win32Provider_ImpersonationLevel.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Win32Provider_InitializationReentrancy.go create mode 100644 vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/thisNAMESPACE.go diff --git a/go.mod b/go.mod index e43a4c593..c35fe375d 100644 --- a/go.mod +++ b/go.mod @@ -9,10 +9,12 @@ toolchain go1.22.3 require ( github.com/Microsoft/go-winio v0.6.2 + github.com/go-ole/go-ole v1.3.0 github.com/google/go-cmp v0.6.0 github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.0.1 github.com/iancoleman/strcase v0.3.0 github.com/kubernetes-csi/csi-proxy/client v1.1.3 + github.com/microsoft/wmi v0.25.1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.20.5 github.com/sergi/go-diff v1.3.1 diff --git a/go.sum b/go.sum index 919f85173..4167e64c7 100644 --- a/go.sum +++ b/go.sum @@ -25,6 +25,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -69,6 +71,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/mauriciopoppe/gengo v0.0.0-20210525224835-9c78f58f3486 h1:+l047vEi0SyAzdVToIaAcfoY5DwwGW+OyqTdH/P3TTg= github.com/mauriciopoppe/gengo v0.0.0-20210525224835-9c78f58f3486/go.mod h1:xXv3T4UXTLta31wMhVezwVkc26OLei4hMbLeBJbPmxc= +github.com/microsoft/wmi v0.25.1 h1:sQv9hCEHtW5K6yEVL78T6XGRMGxk4aTpcJwCiB5rLN0= +github.com/microsoft/wmi v0.25.1/go.mod h1:1zbdSF0A+5OwTUII5p3hN7/K6KF2m3o27pSG6Y51VU8= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -134,6 +138,7 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/pkg/cim/disk.go b/pkg/cim/disk.go new file mode 100644 index 000000000..cc3170f9c --- /dev/null +++ b/pkg/cim/disk.go @@ -0,0 +1,36 @@ +//go:build windows +// +build windows + +package cim + +import ( + "fmt" + "strconv" + + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/server2019/root/microsoft/windows/storage" +) + +// QueryDiskByNumber retrieves disk information for a specific disk identified by its number. +// +// The equivalent WMI query is: +// +// SELECT [selectors] FROM MSFT_Disk +// WHERE DiskNumber = '' +// +// Refer to https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-disk +// for the WMI class definition. +func QueryDiskByNumber(diskNumber uint32, selectorList []string) (*storage.MSFT_Disk, error) { + diskQuery := query.NewWmiQueryWithSelectList("MSFT_Disk", selectorList, "Number", strconv.Itoa(int(diskNumber))) + instances, err := QueryInstances(WMINamespaceStorage, diskQuery) + if err != nil { + return nil, err + } + + disk, err := storage.NewMSFT_DiskEx1(instances[0]) + if err != nil { + return nil, fmt.Errorf("failed to query disk %d. error: %v", diskNumber, err) + } + + return disk, nil +} diff --git a/pkg/cim/volume.go b/pkg/cim/volume.go new file mode 100644 index 000000000..085289ba1 --- /dev/null +++ b/pkg/cim/volume.go @@ -0,0 +1,300 @@ +//go:build windows +// +build windows + +package cim + +import ( + "fmt" + "strconv" + + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "github.com/microsoft/wmi/server2019/root/microsoft/windows/storage" +) + +// QueryVolumeByUniqueID retrieves a specific volume by its unique identifier, +// returning the first volume that matches the given volume ID. +// +// The equivalent WMI query is: +// +// SELECT [selectors] FROM MSFT_Volume +// +// Refer to https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-volume +// for the WMI class definition. +func QueryVolumeByUniqueID(volumeID string, selectorList []string) (*storage.MSFT_Volume, error) { + var selectors []string + selectors = append(selectors, selectorList...) + selectors = append(selectors, "UniqueId") + volumeQuery := query.NewWmiQueryWithSelectList("MSFT_Volume", selectors) + instances, err := QueryInstances(WMINamespaceStorage, volumeQuery) + if err != nil { + return nil, err + } + + for _, instance := range instances { + volume, err := storage.NewMSFT_VolumeEx1(instance) + if err != nil { + return nil, fmt.Errorf("failed to query volume (%s). error: %w", volumeID, err) + } + + uniqueID, err := volume.GetPropertyUniqueId() + if err != nil { + return nil, fmt.Errorf("failed to query volume unique ID (%s). error: %w", volumeID, err) + } + + if uniqueID == volumeID { + return volume, nil + } + } + + return nil, errors.NotFound +} + +// ListVolumes retrieves all available volumes on the system. +// +// The equivalent WMI query is: +// +// SELECT [selectors] FROM MSFT_Volume +// +// Refer to https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-volume +// for the WMI class definition. +func ListVolumes(selectorList []string) ([]*storage.MSFT_Volume, error) { + diskQuery := query.NewWmiQueryWithSelectList("MSFT_Volume", selectorList) + instances, err := QueryInstances(WMINamespaceStorage, diskQuery) + if IgnoreNotFound(err) != nil { + return nil, err + } + + var volumes []*storage.MSFT_Volume + for _, instance := range instances { + volume, err := storage.NewMSFT_VolumeEx1(instance) + if err != nil { + return nil, fmt.Errorf("failed to query volume %v. error: %v", instance, err) + } + + volumes = append(volumes, volume) + } + + return volumes, nil +} + +// ListPartitionsOnDisk retrieves all partitions or a partition with the specified number on a disk. +// +// The equivalent WMI query is: +// +// SELECT [selectors] FROM MSFT_Partition +// WHERE DiskNumber = '' +// AND PartitionNumber = '' +// +// Refer to https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-partition +// for the WMI class definition. +func ListPartitionsOnDisk(diskNumber, partitionNumber uint32, selectorList []string) ([]*storage.MSFT_Partition, error) { + filters := []*query.WmiQueryFilter{ + query.NewWmiQueryFilter("DiskNumber", strconv.Itoa(int(diskNumber)), query.Equals), + } + if partitionNumber > 0 { + filters = append(filters, query.NewWmiQueryFilter("PartitionNumber", strconv.Itoa(int(partitionNumber)), query.Equals)) + } + return ListPartitionsWithFilters(selectorList, filters...) +} + +// ListPartitionsWithFilters retrieves all partitions matching with the conditions specified by query filters. +// +// The equivalent WMI query is: +// +// SELECT [selectors] FROM MSFT_Partition +// WHERE ... +// +// Refer to https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-partition +// for the WMI class definition. +func ListPartitionsWithFilters(selectorList []string, filters ...*query.WmiQueryFilter) ([]*storage.MSFT_Partition, error) { + partitionQuery := query.NewWmiQueryWithSelectList("MSFT_Partition", selectorList) + partitionQuery.Filters = append(partitionQuery.Filters, filters...) + instances, err := QueryInstances(WMINamespaceStorage, partitionQuery) + if IgnoreNotFound(err) != nil { + return nil, err + } + + var partitions []*storage.MSFT_Partition + for _, instance := range instances { + part, err := storage.NewMSFT_PartitionEx1(instance) + if err != nil { + return nil, fmt.Errorf("failed to query partition %v. error: %v", instance, err) + } + + partitions = append(partitions, part) + } + + return partitions, nil +} + +// ListPartitionToVolumeMappings builds a mapping between partition and volume with partition Object ID as the key. +// +// The equivalent WMI query is: +// +// SELECT [selectors] FROM MSFT_PartitionToVolume +// +// Partition | Volume +// --------- | ------ +// MSFT_Partition (ObjectId = "{1}\\WIN-8E2EVAQ9QSB\ROOT/Microsoft/Win...) | MSFT_Volume (ObjectId = "{1}\\WIN-8E2EVAQ9QS... +// +// Refer to https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-partitiontovolume +// for the WMI class definition. +func ListPartitionToVolumeMappings() (map[string]string, error) { + return ListWMIInstanceMappings(WMINamespaceStorage, "MSFT_PartitionToVolume", nil, + mappingObjectRefIndexer("Partition", "MSFT_Partition", "ObjectId"), + mappingObjectRefIndexer("Volume", "MSFT_Volume", "ObjectId"), + ) +} + +// ListVolumeToPartitionMappings builds a mapping between volume and partition with volume Object ID as the key. +// +// The equivalent WMI query is: +// +// SELECT [selectors] FROM MSFT_PartitionToVolume +// +// Partition | Volume +// --------- | ------ +// MSFT_Partition (ObjectId = "{1}\\WIN-8E2EVAQ9QSB\ROOT/Microsoft/Win...) | MSFT_Volume (ObjectId = "{1}\\WIN-8E2EVAQ9QS... +// +// Refer to https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-partitiontovolume +// for the WMI class definition. +func ListVolumeToPartitionMappings() (map[string]string, error) { + return ListWMIInstanceMappings(WMINamespaceStorage, "MSFT_PartitionToVolume", nil, + mappingObjectRefIndexer("Volume", "MSFT_Volume", "ObjectId"), + mappingObjectRefIndexer("Partition", "MSFT_Partition", "ObjectId"), + ) +} + +// FindPartitionsByVolume finds all partitions associated with the given volumes +// using partition-to-volume mapping. +func FindPartitionsByVolume(partitions []*storage.MSFT_Partition, volumes []*storage.MSFT_Volume) ([]*storage.MSFT_Partition, error) { + var partitionInstances []*cim.WmiInstance + for _, part := range partitions { + partitionInstances = append(partitionInstances, part.WmiInstance) + } + + var volumeInstances []*cim.WmiInstance + for _, volume := range volumes { + volumeInstances = append(volumeInstances, volume.WmiInstance) + } + + partitionToVolumeMappings, err := ListPartitionToVolumeMappings() + if err != nil { + return nil, err + } + + filtered, err := FindInstancesByObjectIDMapping(partitionInstances, volumeInstances, partitionToVolumeMappings) + if err != nil { + return nil, err + } + + var result []*storage.MSFT_Partition + for _, instance := range filtered { + part, err := storage.NewMSFT_PartitionEx1(instance) + if err != nil { + return nil, fmt.Errorf("failed to query partition %v. error: %v", instance, err) + } + + result = append(result, part) + } + + return result, nil +} + +// FindVolumesByPartition finds all volumes associated with the given partitions +// using volume-to-partition mapping. +func FindVolumesByPartition(volumes []*storage.MSFT_Volume, partitions []*storage.MSFT_Partition) ([]*storage.MSFT_Volume, error) { + var volumeInstances []*cim.WmiInstance + for _, volume := range volumes { + volumeInstances = append(volumeInstances, volume.WmiInstance) + } + + var partitionInstances []*cim.WmiInstance + for _, part := range partitions { + partitionInstances = append(partitionInstances, part.WmiInstance) + } + + volumeToPartitionMappings, err := ListVolumeToPartitionMappings() + if err != nil { + return nil, err + } + + filtered, err := FindInstancesByObjectIDMapping(volumeInstances, partitionInstances, volumeToPartitionMappings) + if err != nil { + return nil, err + } + + var result []*storage.MSFT_Volume + for _, instance := range filtered { + volume, err := storage.NewMSFT_VolumeEx1(instance) + if err != nil { + return nil, fmt.Errorf("failed to query volume %v. error: %v", instance, err) + } + + result = append(result, volume) + } + + return result, nil +} + +// GetPartitionByVolumeUniqueID retrieves a specific partition from a volume identified by its unique ID. +func GetPartitionByVolumeUniqueID(volumeID string, partitionSelectorList []string) (*storage.MSFT_Partition, error) { + volume, err := QueryVolumeByUniqueID(volumeID, []string{"ObjectId"}) + if err != nil { + return nil, err + } + + partitions, err := ListPartitionsWithFilters(partitionSelectorList) + if err != nil { + return nil, err + } + + result, err := FindPartitionsByVolume(partitions, []*storage.MSFT_Volume{volume}) + if err != nil { + return nil, err + } + + return result[0], nil +} + +// GetVolumeByDriveLetter retrieves a volume associated with a specific drive letter. +func GetVolumeByDriveLetter(driveLetter string, partitionSelectorList []string) (*storage.MSFT_Volume, error) { + var selectorsForPart []string + selectorsForPart = append(selectorsForPart, partitionSelectorList...) + selectorsForPart = append(selectorsForPart, "ObjectId") + partitions, err := ListPartitionsWithFilters(selectorsForPart, query.NewWmiQueryFilter("DriveLetter", driveLetter, query.Equals)) + if err != nil { + return nil, err + } + + volumes, err := ListVolumes(partitionSelectorList) + if err != nil { + return nil, err + } + + result, err := FindVolumesByPartition(volumes, partitions) + if err != nil { + return nil, err + } + + if len(result) == 0 { + return nil, errors.NotFound + } + + return result[0], nil +} + +// GetPartitionDiskNumber retrieves the disk number associated with a given partition. +// +// Refer to https://learn.microsoft.com/en-us/windows-hardware/drivers/storage/msft-partition +// for the WMI class definitions. +func GetPartitionDiskNumber(part *storage.MSFT_Partition) (uint32, error) { + diskNumber, err := part.GetProperty("DiskNumber") + if err != nil { + return 0, err + } + + return uint32(diskNumber.(int32)), nil +} diff --git a/pkg/cim/wmi.go b/pkg/cim/wmi.go new file mode 100644 index 000000000..3e0375ba4 --- /dev/null +++ b/pkg/cim/wmi.go @@ -0,0 +1,367 @@ +//go:build windows +// +build windows + +package cim + +import ( + "fmt" + "strings" + + "github.com/go-ole/go-ole" + "github.com/go-ole/go-ole/oleutil" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "k8s.io/klog/v2" +) + +const ( + WMINamespaceRoot = "Root\\CimV2" + WMINamespaceStorage = "Root\\Microsoft\\Windows\\Storage" +) + +type InstanceHandler func(instance *cim.WmiInstance) (bool, error) + +// An InstanceIndexer provides index key to a WMI Instance in a map +type InstanceIndexer func(instance *cim.WmiInstance) (string, error) + +// NewWMISession creates a new local WMI session for the given namespace, defaulting +// to root namespace if none specified. +func NewWMISession(namespace string) (*cim.WmiSession, error) { + if namespace == "" { + namespace = WMINamespaceRoot + } + + sessionManager := cim.NewWmiSessionManager() + defer sessionManager.Dispose() + + session, err := sessionManager.GetLocalSession(namespace) + if err != nil { + return nil, fmt.Errorf("failed to get local WMI session for namespace %s. error: %w", namespace, err) + } + + connected, err := session.Connect() + if !connected || err != nil { + return nil, fmt.Errorf("failed to connect to WMI. error: %w", err) + } + + return session, nil +} + +// QueryFromWMI executes a WMI query in the specified namespace and processes each result +// through the provided handler function. Stops processing if handler returns false or encounters an error. +func QueryFromWMI(namespace string, query *query.WmiQuery, handler InstanceHandler) error { + session, err := NewWMISession(namespace) + if err != nil { + return err + } + + defer session.Close() + + instances, err := session.QueryInstances(query.String()) + if err != nil { + return fmt.Errorf("failed to query WMI class %s. error: %w", query.ClassName, err) + } + + if len(instances) == 0 { + return errors.NotFound + } + + var cont bool + for _, instance := range instances { + cont, err = handler(instance) + if err != nil { + err = fmt.Errorf("failed to query WMI class %s instance (%s). error: %w", query.ClassName, instance.String(), err) + } + if !cont { + break + } + } + + return err +} + +// QueryInstances retrieves all WMI instances matching the given query in the specified namespace. +func QueryInstances(namespace string, query *query.WmiQuery) ([]*cim.WmiInstance, error) { + var instances []*cim.WmiInstance + err := QueryFromWMI(namespace, query, func(instance *cim.WmiInstance) (bool, error) { + instances = append(instances, instance) + return true, nil + }) + return instances, err +} + +// TODO: fix the panic in microsoft/wmi library and remove this workaround +// Refer to https://github.com/microsoft/wmi/issues/167 +func executeClassMethodParam(classInst *cim.WmiInstance, method *cim.WmiMethod, inParam, outParam cim.WmiMethodParamCollection) (result *cim.WmiMethodResult, err error) { + klog.V(6).Infof("[WMI] - Executing Method [%s]\n", method.Name) + + iDispatchInstance := classInst.GetIDispatch() + if iDispatchInstance == nil { + return nil, errors.Wrapf(errors.InvalidInput, "InvalidInstance") + } + rawResult, err := iDispatchInstance.GetProperty("Methods_") + if err != nil { + return nil, err + } + defer rawResult.Clear() + // Retrieve the method + rawMethod, err := rawResult.ToIDispatch().CallMethod("Item", method.Name) + if err != nil { + return nil, err + } + defer rawMethod.Clear() + + addInParam := func(inparamVariant *ole.VARIANT, paramName string, paramValue interface{}) error { + rawProperties, err := inparamVariant.ToIDispatch().GetProperty("Properties_") + if err != nil { + return err + } + defer rawProperties.Clear() + rawProperty, err := rawProperties.ToIDispatch().CallMethod("Item", paramName) + if err != nil { + return err + } + defer rawProperty.Clear() + + p, err := rawProperty.ToIDispatch().PutProperty("Value", paramValue) + if err != nil { + return err + } + defer p.Clear() + return nil + } + + params := []interface{}{method.Name} + if len(inParam) > 0 { + inparamsRaw, err := rawMethod.ToIDispatch().GetProperty("InParameters") + if err != nil { + return nil, err + } + defer inparamsRaw.Clear() + + inparams, err := oleutil.CallMethod(inparamsRaw.ToIDispatch(), "SpawnInstance_") + if err != nil { + return nil, err + } + defer inparams.Clear() + + for _, inp := range inParam { + addInParam(inparams, inp.Name, inp.Value) + } + + params = append(params, inparams) + } + + result = &cim.WmiMethodResult{ + OutMethodParams: map[string]*cim.WmiMethodParam{}, + } + outparams, err := classInst.GetIDispatch().CallMethod("ExecMethod_", params...) + if err != nil { + return + } + defer outparams.Clear() + returnRaw, err := outparams.ToIDispatch().GetProperty("ReturnValue") + if err != nil { + return + } + defer returnRaw.Clear() + if returnRaw.Value() != nil { + result.ReturnValue = returnRaw.Value().(int32) + klog.V(6).Infof("[WMI] - Return [%d] ", result.ReturnValue) + } + + for _, outp := range outParam { + returnRawIn, err1 := outparams.ToIDispatch().GetProperty(outp.Name) + if err1 != nil { + err = err1 + return + } + defer returnRawIn.Clear() + + value, err1 := cim.GetVariantValue(returnRawIn) + if err1 != nil { + err = err1 + return + } + + result.OutMethodParams[outp.Name] = cim.NewWmiMethodParam(outp.Name, value) + } + return +} + +// InvokeCimMethod calls a static method on a specific WMI class with given input parameters, +// returning the method's return value, output parameters, and any error encountered. +func InvokeCimMethod(namespace, class, methodName string, inputParameters map[string]interface{}) (int, map[string]interface{}, error) { + session, err := NewWMISession(namespace) + if err != nil { + return -1, nil, err + } + + defer session.Close() + + rawResult, err := session.Session.CallMethod("Get", class) + if err != nil { + return -1, nil, err + } + + classInst, err := cim.CreateWmiInstance(rawResult, session) + if err != nil { + return -1, nil, err + } + + method, err := cim.NewWmiMethod(methodName, classInst) + if err != nil { + return -1, nil, err + } + + var inParam cim.WmiMethodParamCollection + for k, v := range inputParameters { + inParam = append(inParam, &cim.WmiMethodParam{ + Name: k, + Value: v, + }) + } + + var outParam cim.WmiMethodParamCollection + var result *cim.WmiMethodResult + result, err = executeClassMethodParam(classInst, method, inParam, outParam) + if err != nil { + return -1, nil, err + } + + outputParameters := make(map[string]interface{}) + for _, v := range result.OutMethodParams { + outputParameters[v.Name] = v.Value + } + + return int(result.ReturnValue), outputParameters, nil +} + +// IgnoreNotFound returns nil if the error is nil or a "not found" error, +// otherwise returns the original error. +func IgnoreNotFound(err error) error { + if err == nil || errors.IsNotFound(err) { + return nil + } + return err +} + +// parseObjectRef extracts the object ID from a WMI object reference string. +// The result string is in this format +// {1}\\WIN-8E2EVAQ9QSB\ROOT/Microsoft/Windows/Storage/Providers_v2\WSP_Partition.ObjectId="{b65bb3cd-da86-11ee-854b-806e6f6e6963}:PR:{00000000-0000-0000-0000-100000000000}\\?\scsi#disk&ven_vmware&prod_virtual_disk#4&2c28f6c4&0&000000#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}" +// from an escape string +func parseObjectRef(input, objectClass, refName string) (string, error) { + tokens := strings.Split(input, fmt.Sprintf("%s.%s=", objectClass, refName)) + if len(tokens) < 2 { + return "", fmt.Errorf("invalid object ID value: %s", input) + } + + objectID := tokens[1] + objectID = strings.ReplaceAll(objectID, "\\\"", "\"") + objectID = strings.ReplaceAll(objectID, "\\\\", "\\") + objectID = objectID[1 : len(objectID)-1] + return objectID, nil +} + +// ListWMIInstanceMappings queries WMI instances and creates a map using custom indexing functions +// to extract keys and values from each instance. +func ListWMIInstanceMappings(namespace, mappingClassName string, selectorList []string, keyIndexer InstanceIndexer, valueIndexer InstanceIndexer) (map[string]string, error) { + q := query.NewWmiQueryWithSelectList(mappingClassName, selectorList) + mappingInstances, err := QueryInstances(namespace, q) + if err != nil { + return nil, err + } + + result := make(map[string]string) + for _, mapping := range mappingInstances { + key, err := keyIndexer(mapping) + if err != nil { + return nil, err + } + + value, err := valueIndexer(mapping) + if err != nil { + return nil, err + } + + result[key] = value + } + + return result, nil +} + +// FindInstancesByMapping filters instances based on a mapping relationship, +// matching instances through custom indexing and mapping functions. +func FindInstancesByMapping(instanceToFind []*cim.WmiInstance, instanceToFindIndex InstanceIndexer, associatedInstances []*cim.WmiInstance, associatedInstanceIndexer InstanceIndexer, instanceMappings map[string]string) ([]*cim.WmiInstance, error) { + associatedInstanceObjectIDMapping := map[string]*cim.WmiInstance{} + for _, inst := range associatedInstances { + key, err := associatedInstanceIndexer(inst) + if err != nil { + return nil, err + } + + associatedInstanceObjectIDMapping[key] = inst + } + + var filtered []*cim.WmiInstance + for _, inst := range instanceToFind { + key, err := instanceToFindIndex(inst) + if err != nil { + return nil, err + } + + valueObjectID, ok := instanceMappings[key] + if !ok { + continue + } + + _, ok = associatedInstanceObjectIDMapping[strings.ToUpper(valueObjectID)] + if !ok { + continue + } + filtered = append(filtered, inst) + } + + if len(filtered) == 0 { + return nil, errors.NotFound + } + + return filtered, nil +} + +// mappingObjectRefIndexer indexes an WMI object by the Object ID reference from a specified property. +func mappingObjectRefIndexer(propertyName, className, refName string) InstanceIndexer { + return func(instance *cim.WmiInstance) (string, error) { + valueVal, err := instance.GetProperty(propertyName) + if err != nil { + return "", err + } + + refValue, err := parseObjectRef(valueVal.(string), className, refName) + return strings.ToUpper(refValue), err + } +} + +// stringPropertyIndexer indexes a WMI object from a string property. +func stringPropertyIndexer(propertyName string) InstanceIndexer { + return func(instance *cim.WmiInstance) (string, error) { + valueVal, err := instance.GetProperty(propertyName) + if err != nil { + return "", err + } + + return strings.ToUpper(valueVal.(string)), err + } +} + +var ( + // objectIDPropertyIndexer indexes a WMI object from its ObjectId property. + objectIDPropertyIndexer = stringPropertyIndexer("ObjectId") +) + +// FindInstancesByObjectIDMapping filters instances based on ObjectId mapping +// between two sets of WMI instances. +func FindInstancesByObjectIDMapping(instanceToFind []*cim.WmiInstance, associatedInstances []*cim.WmiInstance, instanceMappings map[string]string) ([]*cim.WmiInstance, error) { + return FindInstancesByMapping(instanceToFind, objectIDPropertyIndexer, associatedInstances, objectIDPropertyIndexer, instanceMappings) +} diff --git a/pkg/os/volume/api.go b/pkg/os/volume/api.go index 2acc76b32..e8f419603 100644 --- a/pkg/os/volume/api.go +++ b/pkg/os/volume/api.go @@ -1,7 +1,6 @@ package volume import ( - "encoding/json" "fmt" "os" "path/filepath" @@ -9,7 +8,11 @@ import ( "strconv" "strings" - "github.com/kubernetes-csi/csi-proxy/pkg/utils" + "github.com/go-ole/go-ole" + "github.com/kubernetes-csi/csi-proxy/pkg/cim" + wmierrors "github.com/microsoft/wmi/pkg/errors" + "github.com/pkg/errors" + "golang.org/x/sys/windows" "k8s.io/klog/v2" ) @@ -35,7 +38,7 @@ type API interface { GetVolumeIDFromTargetPath(targetPath string) (string, error) // WriteVolumeCache writes the volume `volumeID`'s cache to disk. WriteVolumeCache(volumeID string) error - // GetVolumeIDFromTargetPath returns the volume id of a given target path. + // GetClosestVolumeIDFromTargetPath returns the volume id of a given target path. GetClosestVolumeIDFromTargetPath(targetPath string) (string, error) } @@ -54,6 +57,10 @@ var ( // PS C:\disks> (Get-Disk -Number 1 | Get-Partition | Get-Volume).UniqueId // \\?\Volume{452e318a-5cde-421e-9831-b9853c521012}\ VolumeRegexp = regexp.MustCompile(`Volume\{[\w-]*\}`) + // longPathPrefix is the prefix of Windows long path + longPathPrefix = "\\\\?\\" + + notMountedFolder = errors.New("not a mounted folder") ) // New - Construct a new Volume API Implementation. @@ -61,49 +68,56 @@ func New() VolumeAPI { return VolumeAPI{} } -func getVolumeSize(volumeID string) (int64, error) { - cmd := `(Get-Volume -UniqueId "$Env:volumeID" | Get-partition).Size` - cmdEnv := fmt.Sprintf("volumeID=%s", volumeID) - out, err := utils.RunPowershellCmd(cmd, cmdEnv) - - if err != nil || len(out) == 0 { - return -1, fmt.Errorf("error getting size of the partition from mount. cmd %s, output: %s, error: %v", cmd, string(out), err) +// ListVolumesOnDisk - returns back list of volumes(volumeIDs) in a disk and a partition. +func (VolumeAPI) ListVolumesOnDisk(diskNumber uint32, partitionNumber uint32) (volumeIDs []string, err error) { + partitions, err := cim.ListPartitionsOnDisk(diskNumber, partitionNumber, []string{"ObjectId"}) + if err != nil { + return nil, errors.Wrapf(err, "failed to list partition on disk %d", diskNumber) } - outString := strings.TrimSpace(string(out)) - volumeSize, err := strconv.ParseInt(outString, 10, 64) + volumes, err := cim.ListVolumes([]string{"ObjectId", "UniqueId"}) if err != nil { - return -1, fmt.Errorf("error parsing size of volume %s received %v trimmed to %v err %v", volumeID, out, outString, err) + return nil, errors.Wrapf(err, "failed to list volumes") } - return volumeSize, nil -} - -// ListVolumesOnDisk - returns back list of volumes(volumeIDs) in a disk and a partition. -func (VolumeAPI) ListVolumesOnDisk(diskNumber uint32, partitionNumber uint32) (volumeIDs []string, err error) { - var cmd string - if partitionNumber == 0 { - // 0 means that the partitionNumber wasn't set so we list all the partitions - cmd = fmt.Sprintf("(Get-Disk -Number %d | Get-Partition | Get-Volume).UniqueId", diskNumber) - } else { - cmd = fmt.Sprintf("(Get-Disk -Number %d | Get-Partition -PartitionNumber %d | Get-Volume).UniqueId", diskNumber, partitionNumber) + filtered, err := cim.FindVolumesByPartition(volumes, partitions) + if cim.IgnoreNotFound(err) != nil { + return nil, errors.Wrapf(err, "failed to list volumes on disk %d", diskNumber) } - out, err := utils.RunPowershellCmd(cmd) - if err != nil { - return []string{}, fmt.Errorf("error list volumes on disk. cmd: %s, output: %s, error: %v", cmd, string(out), err) + + for _, volume := range filtered { + uniqueID, err := volume.GetPropertyUniqueId() + if err != nil { + return nil, errors.Wrapf(err, "failed to list volumes") + } + volumeIDs = append(volumeIDs, uniqueID) } - volumeIds := strings.Split(strings.TrimSpace(string(out)), "\r\n") - return volumeIds, nil + return volumeIDs, nil } // FormatVolume - Formats a volume with the NTFS format. func (VolumeAPI) FormatVolume(volumeID string) (err error) { - cmd := `Get-Volume -UniqueId "$Env:volumeID" | Format-Volume -FileSystem ntfs -Confirm:$false` - cmdEnv := fmt.Sprintf("volumeID=%s", volumeID) - out, err := utils.RunPowershellCmd(cmd, cmdEnv) + volume, err := cim.QueryVolumeByUniqueID(volumeID, nil) if err != nil { - return fmt.Errorf("error formatting volume. cmd: %s, output: %s, error: %v", cmd, string(out), err) + return fmt.Errorf("error formatting volume (%s). error: %v", volumeID, err) + } + + result, err := volume.InvokeMethodWithReturn( + "Format", + "NTFS", // Format, + "", // FileSystemLabel, + nil, // AllocationUnitSize, + false, // Full, + true, // Force + nil, // Compress, + nil, // ShortFileNameSupport, + nil, // SetIntegrityStreams, + nil, // UseLargeFRS, + nil, // DisableHeatGathering, + ) + if result != 0 || err != nil { + return fmt.Errorf("error formatting volume (%s). result: %d, error: %v", volumeID, result, err) } // TODO: Do we need to handle anything for len(out) == 0 return nil @@ -116,30 +130,44 @@ func (VolumeAPI) WriteVolumeCache(volumeID string) (err error) { // IsVolumeFormatted - Check if the volume is formatted with the pre specified filesystem(typically ntfs). func (VolumeAPI) IsVolumeFormatted(volumeID string) (bool, error) { - cmd := `(Get-Volume -UniqueId "$Env:volumeID" -ErrorAction Stop).FileSystemType` - cmdEnv := fmt.Sprintf("volumeID=%s", volumeID) - out, err := utils.RunPowershellCmd(cmd, cmdEnv) + volume, err := cim.QueryVolumeByUniqueID(volumeID, []string{"FileSystemType"}) if err != nil { - return false, fmt.Errorf("error checking if volume is formatted. cmd: %s, output: %s, error: %v", cmd, string(out), err) + return false, fmt.Errorf("error checking if volume (%s) is formatted. error: %v", volumeID, err) } - stringOut := strings.TrimSpace(string(out)) - if len(stringOut) == 0 || strings.EqualFold(stringOut, "Unknown") { - return false, nil + + fsType, err := volume.GetProperty("FileSystemType") + if err != nil { + return false, fmt.Errorf("failed to query volume file system type (%s): %w", volumeID, err) } - return true, nil + + const FileSystemUnknown = 0 + return fsType.(int32) != FileSystemUnknown, nil } -// MountVolume - mounts a volume to a path. This is done using the Add-PartitionAccessPath for presenting the volume via a path. +// MountVolume - mounts a volume to a path. This is done using Win32 API SetVolumeMountPoint for presenting the volume via a path. func (VolumeAPI) MountVolume(volumeID, path string) error { - cmd := `Get-Volume -UniqueId "$Env:volumeID" | Get-Partition | Add-PartitionAccessPath -AccessPath $Env:mountpath` - cmdEnv := []string{} - cmdEnv = append(cmdEnv, fmt.Sprintf("volumeID=%s", volumeID)) - cmdEnv = append(cmdEnv, fmt.Sprintf("mountpath=%s", path)) - out, err := utils.RunPowershellCmd(cmd, cmdEnv...) - + mountPoint := path + if !strings.HasSuffix(mountPoint, "\\") { + mountPoint += "\\" + } + utf16MountPath, _ := windows.UTF16PtrFromString(mountPoint) + utf16VolumeID, _ := windows.UTF16PtrFromString(volumeID) + err := windows.SetVolumeMountPoint(utf16MountPath, utf16VolumeID) if err != nil { - return fmt.Errorf("error mount volume to path. cmd: %s, output: %s, error: %v", cmd, string(out), err) + if errors.Is(windows.GetLastError(), windows.ERROR_DIR_NOT_EMPTY) { + targetVolumeID, err := getTarget(path) + if err != nil { + return fmt.Errorf("error get target volume (%s) to path %s. error: %v", volumeID, path, err) + } + + if volumeID == targetVolumeID { + return nil + } + } + + return fmt.Errorf("error mount volume (%s) to path %s. error: %v", volumeID, path, err) } + return nil } @@ -149,92 +177,118 @@ func (VolumeAPI) UnmountVolume(volumeID, path string) error { return err } - cmd := `Get-Volume -UniqueId "$Env:volumeID" | Get-Partition | Remove-PartitionAccessPath -AccessPath $Env:mountpath` - cmdEnv := []string{} - cmdEnv = append(cmdEnv, fmt.Sprintf("volumeID=%s", volumeID)) - cmdEnv = append(cmdEnv, fmt.Sprintf("mountpath=%s", path)) - out, err := utils.RunPowershellCmd(cmd, cmdEnv...) - + mountPoint := path + if !strings.HasSuffix(mountPoint, "\\") { + mountPoint += "\\" + } + utf16MountPath, _ := windows.UTF16PtrFromString(mountPoint) + err := windows.DeleteVolumeMountPoint(utf16MountPath) if err != nil { - return fmt.Errorf("error getting driver letter to mount volume. cmd: %s, output: %s,error: %v", cmd, string(out), err) + return fmt.Errorf("error umount volume (%s) from path %s. error: %v", volumeID, path, err) } return nil } // ResizeVolume - resizes a volume with the given size, if size == 0 then max supported size is used func (VolumeAPI) ResizeVolume(volumeID string, size int64) error { - // If size is 0 then we will resize to the maximum size possible, otherwise just resize to size - var cmd string - var out []byte var err error var finalSize int64 - var outString string - if size == 0 { - cmd = `Get-Volume -UniqueId "$Env:volumeID" | Get-partition | Get-PartitionSupportedSize | Select SizeMax | ConvertTo-Json` - cmdEnv := fmt.Sprintf("volumeID=%s", volumeID) - out, err := utils.RunPowershellCmd(cmd, cmdEnv) + part, err := cim.GetPartitionByVolumeUniqueID(volumeID, nil) + if err != nil { + return err + } - if err != nil || len(out) == 0 { - return fmt.Errorf("error getting sizemin,sizemax from mount. cmd: %s, output: %s, error: %v", cmd, string(out), err) + // If size is 0 then we will resize to the maximum size possible, otherwise just resize to size + if size == 0 { + var sizeMin, sizeMax ole.VARIANT + var status string + result, err := part.InvokeMethodWithReturn("GetSupportedSize", &sizeMin, &sizeMax, &status) + if result != 0 || err != nil { + return fmt.Errorf("error getting sizemin, sizemax from volume (%s). result: %d, error: %v", volumeID, result, err) } - var getVolumeSizing map[string]int64 - outString = string(out) - err = json.Unmarshal([]byte(outString), &getVolumeSizing) + finalSizeStr := sizeMax.ToString() + finalSize, err = strconv.ParseInt(finalSizeStr, 10, 64) if err != nil { - return fmt.Errorf("out %v outstring %v err %v", out, outString, err) + return fmt.Errorf("error parsing the sizeMax of volume (%s) with error (%v)", volumeID, err) } - - sizeMax := getVolumeSizing["SizeMax"] - - finalSize = sizeMax } else { finalSize = size } - currentSize, err := getVolumeSize(volumeID) + currentSizeVal, err := part.GetProperty("Size") if err != nil { return fmt.Errorf("error getting the current size of volume (%s) with error (%v)", volumeID, err) } + currentSize, err := strconv.ParseInt(currentSizeVal.(string), 10, 64) + if err != nil { + return fmt.Errorf("error parsing the current size of volume (%s) with error (%v)", volumeID, err) + } + // only resize if finalSize - currentSize is greater than 100MB if finalSize-currentSize < 100*1024*1024 { klog.V(2).Infof("minimum resize difference(1GB) not met, skipping resize. volumeID=%s currentSize=%d finalSize=%d", volumeID, currentSize, finalSize) return nil } - cmd = fmt.Sprintf(`Get-Volume -UniqueId "$Env:volumeID" | Get-Partition | Resize-Partition -Size %d`, finalSize) - cmdEnv := []string{} - cmdEnv = append(cmdEnv, fmt.Sprintf("volumeID=%s", volumeID)) - out, err = utils.RunPowershellCmd(cmd, cmdEnv...) + //if the partition's size is already the size we want this is a noop, just return + if currentSize >= finalSize { + klog.V(2).Infof("Attempted to resize volume (%s) to a lower size, from currentBytes=%d wantedBytes=%d", volumeID, currentSize, finalSize) + return nil + } + + var status string + result, err := part.InvokeMethodWithReturn("Resize", strconv.Itoa(int(finalSize)), &status) + + if result != 0 || err != nil { + return fmt.Errorf("error resizing volume (%s). size:%v, finalSize %v, error: %v", volumeID, size, finalSize, err) + } + + diskNumber, err := cim.GetPartitionDiskNumber(part) + if err != nil { + return fmt.Errorf("error parsing disk number of volume (%s). error: %v", volumeID, err) + } + + disk, err := cim.QueryDiskByNumber(diskNumber, nil) if err != nil { - return fmt.Errorf("error resizing volume. cmd: %s, output: %s size:%v, finalSize %v, error: %v", cmd, string(out), size, finalSize, err) + return fmt.Errorf("error parsing disk number of volume (%s). error: %v", volumeID, err) + } + + result, err = disk.InvokeMethodWithReturn("Refresh", &status) + if result != 0 || err != nil { + return fmt.Errorf("error rescan disk (%d). result %d, error: %v", diskNumber, result, err) } + return nil } // GetVolumeStats - retrieves the volume stats for a given volume func (VolumeAPI) GetVolumeStats(volumeID string) (int64, int64, error) { - // get the size and sizeRemaining for the volume - cmd := `(Get-Volume -UniqueId "$Env:volumeID" | Select SizeRemaining,Size) | ConvertTo-Json` - cmdEnv := fmt.Sprintf("volumeID=%s", volumeID) - out, err := utils.RunPowershellCmd(cmd, cmdEnv) + volume, err := cim.QueryVolumeByUniqueID(volumeID, []string{"UniqueId", "SizeRemaining", "Size"}) + if err != nil { + return -1, -1, fmt.Errorf("error getting capacity and used size of volume (%s). error: %v", volumeID, err) + } + + volumeSizeVal, err := volume.GetProperty("Size") + if err != nil { + return -1, -1, fmt.Errorf("failed to query volume size (%s): %w", volumeID, err) + } + volumeSize, err := strconv.ParseInt(volumeSizeVal.(string), 10, 64) if err != nil { - return -1, -1, fmt.Errorf("error getting capacity and used size of volume. cmd: %s, output: %s, error: %v", cmd, string(out), err) + return -1, -1, fmt.Errorf("failed to parse volume size (%s): %w", volumeID, err) } - var getVolume map[string]int64 - outString := string(out) - err = json.Unmarshal([]byte(outString), &getVolume) + volumeSizeRemainingVal, err := volume.GetProperty("SizeRemaining") if err != nil { - return -1, -1, fmt.Errorf("out %v outstring %v err %v", out, outString, err) + return -1, -1, fmt.Errorf("failed to query volume remaining size (%s): %w", volumeID, err) } - var volumeSizeRemaining int64 - var volumeSize int64 - volumeSize = getVolume["Size"] - volumeSizeRemaining = getVolume["SizeRemaining"] + volumeSizeRemaining, err := strconv.ParseInt(volumeSizeRemainingVal.(string), 10, 64) + if err != nil { + return -1, -1, fmt.Errorf("failed to parse volume remaining size (%s): %w", volumeID, err) + } volumeUsedSize := volumeSize - volumeSizeRemaining return volumeSize, volumeUsedSize, nil @@ -243,59 +297,56 @@ func (VolumeAPI) GetVolumeStats(volumeID string) (int64, int64, error) { // GetDiskNumberFromVolumeID - gets the disk number where the volume is. func (VolumeAPI) GetDiskNumberFromVolumeID(volumeID string) (uint32, error) { // get the size and sizeRemaining for the volume - cmd := `(Get-Volume -UniqueId "$Env:volumeID" | Get-Partition).DiskNumber` - cmdEnv := fmt.Sprintf("volumeID=%s", volumeID) - out, err := utils.RunPowershellCmd(cmd, cmdEnv) - - if err != nil || len(out) == 0 { - return 0, fmt.Errorf("error getting disk number. cmd: %s, output: %s, error: %v", cmd, string(out), err) - } - - reg, err := regexp.Compile("[^0-9]+") + part, err := cim.GetPartitionByVolumeUniqueID(volumeID, []string{"DiskNumber"}) if err != nil { - return 0, fmt.Errorf("error compiling regex. err: %v", err) + return 0, err } - diskNumberOutput := reg.ReplaceAllString(string(out), "") - - diskNumber, err := strconv.ParseUint(diskNumberOutput, 10, 32) + diskNumber, err := part.GetProperty("DiskNumber") if err != nil { - return 0, fmt.Errorf("error parsing disk number. cmd: %s, output: %s, error: %v", cmd, diskNumberOutput, err) + return 0, fmt.Errorf("error query disk number of volume (%s). error: %v", volumeID, err) } - return uint32(diskNumber), nil + return uint32(diskNumber.(int32)), nil } // GetVolumeIDFromTargetPath - gets the volume ID given a mount point, the function is recursive until it find a volume or errors out func (VolumeAPI) GetVolumeIDFromTargetPath(mount string) (string, error) { - volumeString, err := getTarget(mount, 0) - + volumeString, err := getTarget(mount) if err != nil { - return "", fmt.Errorf("error getting the volume for the mount %s, internal error %v", mount, err) + return "", err } return volumeString, nil } -func getTarget(mount string, retry int) (string, error) { - cmd := `(Get-Item -Path $Env:mountpath).Target` - cmdEnv := fmt.Sprintf("mountpath=%s", mount) - out, err := utils.RunPowershellCmd(cmd, cmdEnv) - if err != nil || len(out) == 0 { - return "", fmt.Errorf("error getting volume from mount. cmd: %s, output: %s, error: %v", cmd, string(out), err) - } - if retry >= 256 { - return "", fmt.Errorf("maximum recursion reached, cmd: %s, output: %s, :retry %d", cmd, string(out), retry) +func getTarget(mount string) (string, error) { + mountedFolder, err := isMountedFolder(mount) + if err != nil { + return "", err } - volumeString := strings.TrimSpace(string(out)) - klog.V(8).Infof("retry: %d, volumeString: %s", retry, volumeString) - - if !strings.HasPrefix(volumeString, "Volume") { - return getTarget(volumeString, retry+1) + if !mountedFolder { + return "", notMountedFolder } - return ensureVolumePrefix(volumeString), nil + utf16FullMountPath, _ := windows.UTF16PtrFromString(mount) + outPathBuffer := make([]uint16, windows.MAX_LONG_PATH) + err = windows.GetVolumePathName(utf16FullMountPath, &outPathBuffer[0], uint32(len(outPathBuffer))) + if err != nil { + return "", err + } + targetPath := longPathPrefix + windows.UTF16PtrToString(&outPathBuffer[0]) + if !strings.HasSuffix(targetPath, "\\") { + targetPath += "\\" + } + utf16TargetPath, _ := windows.UTF16PtrFromString(targetPath) + outPathBuffer = make([]uint16, windows.MAX_LONG_PATH) + err = windows.GetVolumeNameForVolumeMountPoint(utf16TargetPath, &outPathBuffer[0], uint32(len(outPathBuffer))) + if err != nil { + return "", err + } + return windows.UTF16PtrToString(&outPathBuffer[0]), nil } // GetClosestVolumeIDFromTargetPath returns the volume id of a given target path. @@ -330,17 +381,24 @@ func findClosestVolume(path string) (string, error) { if err != nil { return "", err } - isSymlink := fi.Mode()&os.ModeSymlink != 0 + // for windows NTFS, check if the path is symlink instead of directory. + isSymlink := fi.Mode()&os.ModeSymlink != 0 || fi.Mode()&os.ModeIrregular != 0 - if isSymlink { - target, err := dereferenceSymlink(candidatePath) - if err != nil { + // mounted folder created by SetVolumeMountPoint may still report ModeSymlink == 0 + mountedFolder, err := isMountedFolder(candidatePath) + if err != nil { + return "", err + } + + if isSymlink && mountedFolder { + target, err := getTarget(candidatePath) + if err != nil && !errors.Is(err, notMountedFolder) { return "", err } // if it has the form Volume{volumeid} then it's a volume - if VolumeRegexp.Match([]byte(target)) { + if target != "" && VolumeRegexp.Match([]byte(target)) { // symlinks that are pointing to Volumes don't have this prefix - return ensureVolumePrefix(target), nil + return target, nil } // otherwise follow the symlink candidatePath = target @@ -359,57 +417,72 @@ func findClosestVolume(path string) (string, error) { return target, nil } } - } - return "", fmt.Errorf("Failed to find the closest volume for path=%s", path) + return "", fmt.Errorf("failed to find the closest volume for path=%s", path) } -// ensureVolumePrefix makes sure that the volume has the Volume prefix -func ensureVolumePrefix(volume string) string { - prefix := "\\\\?\\" - if !strings.HasPrefix(volume, prefix) { - volume = prefix + volume +// isMountedFolder checks whether the `path` is a mounted folder. +func isMountedFolder(path string) (bool, error) { + // https://learn.microsoft.com/en-us/windows/win32/fileio/determining-whether-a-directory-is-a-volume-mount-point + utf16Path, _ := windows.UTF16PtrFromString(path) + attrs, err := windows.GetFileAttributes(utf16Path) + if err != nil { + return false, err + } + + if (attrs & windows.FILE_ATTRIBUTE_REPARSE_POINT) == 0 { + return false, nil } - return volume -} -// dereferenceSymlink dereferences the symlink `path` and returns the stdout. -func dereferenceSymlink(path string) (string, error) { - cmd := `(Get-Item -Path $Env:linkpath).Target` - cmdEnv := fmt.Sprintf("linkpath=%s", path) - out, err := utils.RunPowershellCmd(cmd, cmdEnv) - if err != nil { - return "", err + var findData windows.Win32finddata + findHandle, err := windows.FindFirstFile(utf16Path, &findData) + if err != nil && !errors.Is(err, windows.ERROR_NO_MORE_FILES) { + return false, err } - output := strings.TrimSpace(string(out)) - klog.V(8).Infof("Stdout: %s", output) - return output, nil + + for err == nil { + if findData.Reserved0&windows.IO_REPARSE_TAG_MOUNT_POINT != 0 { + return true, nil + } + + err = windows.FindNextFile(findHandle, &findData) + if err != nil && !errors.Is(err, windows.ERROR_NO_MORE_FILES) { + return false, err + } + } + + return false, nil } // getVolumeForDriveLetter gets a volume from a drive letter (e.g. C:/). func getVolumeForDriveLetter(path string) (string, error) { if len(path) != 1 { - return "", fmt.Errorf("The path=%s is not a valid DriverLetter", path) + return "", fmt.Errorf("the path %s is not a valid drive letter", path) } - cmd := `(Get-Partition -DriveLetter $Env:drivepath | Get-Volume).UniqueId` - cmdEnv := fmt.Sprintf("drivepath=%s", path) - out, err := utils.RunPowershellCmd(cmd, cmdEnv) + volume, err := cim.GetVolumeByDriveLetter(path, []string{"UniqueId"}) if err != nil { - return "", err + return "", nil } - output := strings.TrimSpace(string(out)) - klog.V(8).Infof("Stdout: %s", output) - return output, nil + + uniqueID, err := volume.GetPropertyUniqueId() + if err != nil { + return "", fmt.Errorf("error query unique ID of volume (%v). error: %v", volume, err) + } + + return uniqueID, nil } func writeCache(volumeID string) error { - cmd := `Get-Volume -UniqueId "$Env:volumeID" | Write-Volumecache` - cmdEnv := fmt.Sprintf("volumeID=%s", volumeID) - out, err := utils.RunPowershellCmd(cmd, cmdEnv) - if err != nil { - return fmt.Errorf("error writing volume cache. cmd: %s, output: %s, error: %v", cmd, string(out), err) + volume, err := cim.QueryVolumeByUniqueID(volumeID, []string{}) + if err != nil && !wmierrors.IsNotFound(err) { + return fmt.Errorf("error writing volume (%s) cache. error: %v", volumeID, err) + } + + result, err := volume.Flush() + if result != 0 || err != nil { + return fmt.Errorf("error writing volume (%s) cache. result: %d, error: %v", volumeID, result, err) } return nil } diff --git a/pkg/os/volume/api_test.go b/pkg/os/volume/api_test.go index 23b427786..de04c7b49 100644 --- a/pkg/os/volume/api_test.go +++ b/pkg/os/volume/api_test.go @@ -1,8 +1,9 @@ package volume import ( - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestGetTarget(t *testing.T) { @@ -10,17 +11,15 @@ func TestGetTarget(t *testing.T) { mountpath string expectedResult string expectError bool - counter int }{ { "c:\\", "", true, - 1, }, } for _, test := range tests { - target, err := getTarget(test.mountpath, test.counter) + target, err := getTarget(test.mountpath) if test.expectError { assert.NotNil(t, err, "Expect error during getTarget(%s)", test.mountpath) } else { diff --git a/vendor/github.com/go-ole/go-ole/.travis.yml b/vendor/github.com/go-ole/go-ole/.travis.yml new file mode 100644 index 000000000..28f740cd5 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/.travis.yml @@ -0,0 +1,8 @@ +language: go +sudo: false + +go: + - 1.9.x + - 1.10.x + - 1.11.x + - tip diff --git a/vendor/github.com/go-ole/go-ole/ChangeLog.md b/vendor/github.com/go-ole/go-ole/ChangeLog.md new file mode 100644 index 000000000..4ba6a8c64 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/ChangeLog.md @@ -0,0 +1,49 @@ +# Version 1.x.x + +* **Add more test cases and reference new test COM server project.** (Placeholder for future additions) + +# Version 1.2.0-alphaX + +**Minimum supported version is now Go 1.4. Go 1.1 support is deprecated, but should still build.** + + * Added CI configuration for Travis-CI and AppVeyor. + * Added test InterfaceID and ClassID for the COM Test Server project. + * Added more inline documentation (#83). + * Added IEnumVARIANT implementation (#88). + * Added IEnumVARIANT test cases (#99, #100, #101). + * Added support for retrieving `time.Time` from VARIANT (#92). + * Added test case for IUnknown (#64). + * Added test case for IDispatch (#64). + * Added test cases for scalar variants (#64, #76). + +# Version 1.1.1 + + * Fixes for Linux build. + * Fixes for Windows build. + +# Version 1.1.0 + +The change to provide building on all platforms is a new feature. The increase in minor version reflects that and allows those who wish to stay on 1.0.x to continue to do so. Support for 1.0.x will be limited to bug fixes. + + * Move GUID out of variables.go into its own file to make new documentation available. + * Move OleError out of ole.go into its own file to make new documentation available. + * Add documentation to utility functions. + * Add documentation to variant receiver functions. + * Add documentation to ole structures. + * Make variant available to other systems outside of Windows. + * Make OLE structures available to other systems outside of Windows. + +## New Features + + * Library should now be built on all platforms supported by Go. Library will NOOP on any platform that is not Windows. + * More functions are now documented and available on godoc.org. + +# Version 1.0.1 + + 1. Fix package references from repository location change. + +# Version 1.0.0 + +This version is stable enough for use. The COM API is still incomplete, but provides enough functionality for accessing COM servers using IDispatch interface. + +There is no changelog for this version. Check commits for history. diff --git a/vendor/github.com/go-ole/go-ole/LICENSE b/vendor/github.com/go-ole/go-ole/LICENSE new file mode 100644 index 000000000..623ec06f9 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright © 2013-2017 Yasuhiro Matsumoto, + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/go-ole/go-ole/README.md b/vendor/github.com/go-ole/go-ole/README.md new file mode 100644 index 000000000..7b577558d --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/README.md @@ -0,0 +1,46 @@ +# Go OLE + +[![Build status](https://ci.appveyor.com/api/projects/status/qr0u2sf7q43us9fj?svg=true)](https://ci.appveyor.com/project/jacobsantos/go-ole-jgs28) +[![Build Status](https://travis-ci.org/go-ole/go-ole.svg?branch=master)](https://travis-ci.org/go-ole/go-ole) +[![GoDoc](https://godoc.org/github.com/go-ole/go-ole?status.svg)](https://godoc.org/github.com/go-ole/go-ole) + +Go bindings for Windows COM using shared libraries instead of cgo. + +By Yasuhiro Matsumoto. + +## Install + +To experiment with go-ole, you can just compile and run the example program: + +``` +go get github.com/go-ole/go-ole +cd /path/to/go-ole/ +go test + +cd /path/to/go-ole/example/excel +go run excel.go +``` + +## Continuous Integration + +Continuous integration configuration has been added for both Travis-CI and AppVeyor. You will have to add these to your own account for your fork in order for it to run. + +**Travis-CI** + +Travis-CI was added to check builds on Linux to ensure that `go get` works when cross building. Currently, Travis-CI is not used to test cross-building, but this may be changed in the future. It is also not currently possible to test the library on Linux, since COM API is specific to Windows and it is not currently possible to run a COM server on Linux or even connect to a remote COM server. + +**AppVeyor** + +AppVeyor is used to build on Windows using the (in-development) test COM server. It is currently only used to test the build and ensure that the code works on Windows. It will be used to register a COM server and then run the test cases based on the test COM server. + +The tests currently do run and do pass and this should be maintained with commits. + +## Versioning + +Go OLE uses [semantic versioning](http://semver.org) for version numbers, which is similar to the version contract of the Go language. Which means that the major version will always maintain backwards compatibility with minor versions. Minor versions will only add new additions and changes. Fixes will always be in patch. + +This contract should allow you to upgrade to new minor and patch versions without breakage or modifications to your existing code. Leave a ticket, if there is breakage, so that it could be fixed. + +## LICENSE + +Under the MIT License: http://mattn.mit-license.org/2013 diff --git a/vendor/github.com/go-ole/go-ole/SECURITY.md b/vendor/github.com/go-ole/go-ole/SECURITY.md new file mode 100644 index 000000000..dac281523 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/SECURITY.md @@ -0,0 +1,13 @@ +# Security Policy + +## Supported Versions + +Security updates are applied only to the latest release. + +## Reporting a Vulnerability + +If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released. + +Please disclose it at [security advisory](https://github.com/go-ole/go-ole/security/advisories/new). + +This project is maintained by a team of volunteers on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure. diff --git a/vendor/github.com/go-ole/go-ole/appveyor.yml b/vendor/github.com/go-ole/go-ole/appveyor.yml new file mode 100644 index 000000000..8df7fa26e --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/appveyor.yml @@ -0,0 +1,68 @@ +# Notes: +# - Minimal appveyor.yml file is an empty file. All sections are optional. +# - Indent each level of configuration with 2 spaces. Do not use tabs! +# - All section names are case-sensitive. +# - Section names should be unique on each level. + +version: "1.3.0.{build}-alpha-{branch}" + +os: Visual Studio 2019 + +build: off + +skip_tags: true + +clone_folder: c:\gopath\src\github.com\go-ole\go-ole + +environment: + GOPATH: c:\gopath + GOROOT: c:\go + DOWNLOADPLATFORM: "x64" + +before_test: + # - Download COM Server + - ps: Start-FileDownload "https://github.com/go-ole/test-com-server/releases/download/v1.0.2/test-com-server-${env:DOWNLOADPLATFORM}.zip" + - 7z e test-com-server-%DOWNLOADPLATFORM%.zip -oc:\gopath\src\github.com\go-ole\go-ole > NUL + - c:\gopath\src\github.com\go-ole\go-ole\build\register-assembly.bat + +test_script: + - go test -v -cover ./... + # go vet has false positives on unsafe.Pointer with windows/sys. Disabling since it is recommended to use go test instead. + # - go vet ./... + +branches: + only: + - master + - v1.2 + - v1.1 + - v1.0 + +matrix: + allow_failures: + - environment: + GOROOT: C:\go-x86 + DOWNLOADPLATFORM: "x86" + - environment: + GOROOT: C:\go118 + DOWNLOADPLATFORM: "x64" + - environment: + GOROOT: C:\go118-x86 + DOWNLOADPLATFORM: "x86" + +install: + - go version + - go env + - go get -u golang.org/x/tools/cmd/cover + - go get -u golang.org/x/tools/cmd/godoc + - go get -u golang.org/x/tools/cmd/stringer + +build_script: + - cd c:\gopath\src\github.com\go-ole\go-ole + - go get -v -t ./... + - go build + +# disable automatic tests +test: on + +# disable deployment +deploy: off diff --git a/vendor/github.com/go-ole/go-ole/com.go b/vendor/github.com/go-ole/go-ole/com.go new file mode 100644 index 000000000..cabbac012 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/com.go @@ -0,0 +1,386 @@ +// +build windows + +package ole + +import ( + "syscall" + "unicode/utf16" + "unsafe" +) + +var ( + procCoInitialize = modole32.NewProc("CoInitialize") + procCoInitializeEx = modole32.NewProc("CoInitializeEx") + procCoInitializeSecurity = modole32.NewProc("CoInitializeSecurity") + procCoUninitialize = modole32.NewProc("CoUninitialize") + procCoCreateInstance = modole32.NewProc("CoCreateInstance") + procCoTaskMemFree = modole32.NewProc("CoTaskMemFree") + procCLSIDFromProgID = modole32.NewProc("CLSIDFromProgID") + procCLSIDFromString = modole32.NewProc("CLSIDFromString") + procStringFromCLSID = modole32.NewProc("StringFromCLSID") + procStringFromIID = modole32.NewProc("StringFromIID") + procIIDFromString = modole32.NewProc("IIDFromString") + procCoGetObject = modole32.NewProc("CoGetObject") + procGetUserDefaultLCID = modkernel32.NewProc("GetUserDefaultLCID") + procCopyMemory = modkernel32.NewProc("RtlMoveMemory") + procVariantInit = modoleaut32.NewProc("VariantInit") + procVariantClear = modoleaut32.NewProc("VariantClear") + procVariantTimeToSystemTime = modoleaut32.NewProc("VariantTimeToSystemTime") + procSysAllocString = modoleaut32.NewProc("SysAllocString") + procSysAllocStringLen = modoleaut32.NewProc("SysAllocStringLen") + procSysFreeString = modoleaut32.NewProc("SysFreeString") + procSysStringLen = modoleaut32.NewProc("SysStringLen") + procCreateDispTypeInfo = modoleaut32.NewProc("CreateDispTypeInfo") + procCreateStdDispatch = modoleaut32.NewProc("CreateStdDispatch") + procGetActiveObject = modoleaut32.NewProc("GetActiveObject") + + procGetMessageW = moduser32.NewProc("GetMessageW") + procDispatchMessageW = moduser32.NewProc("DispatchMessageW") +) + +// This is to enable calling COM Security initialization multiple times +var bSecurityInit bool = false + +// coInitialize initializes COM library on current thread. +// +// MSDN documentation suggests that this function should not be called. Call +// CoInitializeEx() instead. The reason has to do with threading and this +// function is only for single-threaded apartments. +// +// That said, most users of the library have gotten away with just this +// function. If you are experiencing threading issues, then use +// CoInitializeEx(). +func coInitialize() (err error) { + // http://msdn.microsoft.com/en-us/library/windows/desktop/ms678543(v=vs.85).aspx + // Suggests that no value should be passed to CoInitialized. + // Could just be Call() since the parameter is optional. <-- Needs testing to be sure. + hr, _, _ := procCoInitialize.Call(uintptr(0)) + if hr != 0 { + err = NewError(hr) + } + return +} + +// coInitializeEx initializes COM library with concurrency model. +func coInitializeEx(coinit uint32) (err error) { + // http://msdn.microsoft.com/en-us/library/windows/desktop/ms695279(v=vs.85).aspx + // Suggests that the first parameter is not only optional but should always be NULL. + hr, _, _ := procCoInitializeEx.Call(uintptr(0), uintptr(coinit)) + if hr != 0 { + err = NewError(hr) + } + return +} + +// coInitializeSecurity: Registers security and sets the default security values +// for the process. +func coInitializeSecurity(cAuthSvc int32, + dwAuthnLevel uint32, + dwImpLevel uint32, + dwCapabilities uint32) (err error) { + // Check COM Security initialization has done previously + if !bSecurityInit { + // https://learn.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-coinitializesecurity + hr, _, _ := procCoInitializeSecurity.Call( + uintptr(0), // Allow *all* VSS writers to communicate back! + uintptr(cAuthSvc), // Default COM authentication service + uintptr(0), // Default COM authorization service + uintptr(0), // Reserved parameter + uintptr(dwAuthnLevel), // Strongest COM authentication level + uintptr(dwImpLevel), // Minimal impersonation abilities + uintptr(0), // Default COM authentication settings + uintptr(dwCapabilities), // Cloaking + uintptr(0)) // eserved parameter + if hr != 0 { + err = NewError(hr) + } else { + // COM Security initialization done make global flag true. + bSecurityInit = true + } + } + return +} + +// CoInitialize initializes COM library on current thread. +// +// MSDN documentation suggests that this function should not be called. Call +// CoInitializeEx() instead. The reason has to do with threading and this +// function is only for single-threaded apartments. +// +// That said, most users of the library have gotten away with just this +// function. If you are experiencing threading issues, then use +// CoInitializeEx(). +func CoInitialize(p uintptr) (err error) { + // p is ignored and won't be used. + // Avoid any variable not used errors. + p = uintptr(0) + return coInitialize() +} + +// CoInitializeEx initializes COM library with concurrency model. +func CoInitializeEx(p uintptr, coinit uint32) (err error) { + // Avoid any variable not used errors. + p = uintptr(0) + return coInitializeEx(coinit) +} + +// CoUninitialize uninitializes COM Library. +func CoUninitialize() { + procCoUninitialize.Call() +} + +// CoInitializeSecurity: Registers security and sets the default security values +// for the process. +func CoInitializeSecurity(cAuthSvc int32, + dwAuthnLevel uint32, + dwImpLevel uint32, + dwCapabilities uint32) (err error) { + return coInitializeSecurity(cAuthSvc, dwAuthnLevel, dwImpLevel, dwCapabilities) +} + +// CoTaskMemFree frees memory pointer. +func CoTaskMemFree(memptr uintptr) { + procCoTaskMemFree.Call(memptr) +} + +// CLSIDFromProgID retrieves Class Identifier with the given Program Identifier. +// +// The Programmatic Identifier must be registered, because it will be looked up +// in the Windows Registry. The registry entry has the following keys: CLSID, +// Insertable, Protocol and Shell +// (https://msdn.microsoft.com/en-us/library/dd542719(v=vs.85).aspx). +// +// programID identifies the class id with less precision and is not guaranteed +// to be unique. These are usually found in the registry under +// HKEY_LOCAL_MACHINE\SOFTWARE\Classes, usually with the format of +// "Program.Component.Version" with version being optional. +// +// CLSIDFromProgID in Windows API. +func CLSIDFromProgID(progId string) (clsid *GUID, err error) { + var guid GUID + lpszProgID := uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(progId))) + hr, _, _ := procCLSIDFromProgID.Call(lpszProgID, uintptr(unsafe.Pointer(&guid))) + if hr != 0 { + err = NewError(hr) + } + clsid = &guid + return +} + +// CLSIDFromString retrieves Class ID from string representation. +// +// This is technically the string version of the GUID and will convert the +// string to object. +// +// CLSIDFromString in Windows API. +func CLSIDFromString(str string) (clsid *GUID, err error) { + var guid GUID + lpsz := uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(str))) + hr, _, _ := procCLSIDFromString.Call(lpsz, uintptr(unsafe.Pointer(&guid))) + if hr != 0 { + err = NewError(hr) + } + clsid = &guid + return +} + +// StringFromCLSID returns GUID formated string from GUID object. +func StringFromCLSID(clsid *GUID) (str string, err error) { + var p *uint16 + hr, _, _ := procStringFromCLSID.Call(uintptr(unsafe.Pointer(clsid)), uintptr(unsafe.Pointer(&p))) + if hr != 0 { + err = NewError(hr) + } + str = LpOleStrToString(p) + return +} + +// IIDFromString returns GUID from program ID. +func IIDFromString(progId string) (clsid *GUID, err error) { + var guid GUID + lpsz := uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(progId))) + hr, _, _ := procIIDFromString.Call(lpsz, uintptr(unsafe.Pointer(&guid))) + if hr != 0 { + err = NewError(hr) + } + clsid = &guid + return +} + +// StringFromIID returns GUID formatted string from GUID object. +func StringFromIID(iid *GUID) (str string, err error) { + var p *uint16 + hr, _, _ := procStringFromIID.Call(uintptr(unsafe.Pointer(iid)), uintptr(unsafe.Pointer(&p))) + if hr != 0 { + err = NewError(hr) + } + str = LpOleStrToString(p) + return +} + +// CreateInstance of single uninitialized object with GUID. +func CreateInstance(clsid *GUID, iid *GUID) (unk *IUnknown, err error) { + if iid == nil { + iid = IID_IUnknown + } + hr, _, _ := procCoCreateInstance.Call( + uintptr(unsafe.Pointer(clsid)), + 0, + CLSCTX_SERVER, + uintptr(unsafe.Pointer(iid)), + uintptr(unsafe.Pointer(&unk))) + if hr != 0 { + err = NewError(hr) + } + return +} + +// GetActiveObject retrieves pointer to active object. +func GetActiveObject(clsid *GUID, iid *GUID) (unk *IUnknown, err error) { + if iid == nil { + iid = IID_IUnknown + } + hr, _, _ := procGetActiveObject.Call( + uintptr(unsafe.Pointer(clsid)), + uintptr(unsafe.Pointer(iid)), + uintptr(unsafe.Pointer(&unk))) + if hr != 0 { + err = NewError(hr) + } + return +} + +type BindOpts struct { + CbStruct uint32 + GrfFlags uint32 + GrfMode uint32 + TickCountDeadline uint32 +} + +// GetObject retrieves pointer to active object. +func GetObject(programID string, bindOpts *BindOpts, iid *GUID) (unk *IUnknown, err error) { + if bindOpts != nil { + bindOpts.CbStruct = uint32(unsafe.Sizeof(BindOpts{})) + } + if iid == nil { + iid = IID_IUnknown + } + hr, _, _ := procCoGetObject.Call( + uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(programID))), + uintptr(unsafe.Pointer(bindOpts)), + uintptr(unsafe.Pointer(iid)), + uintptr(unsafe.Pointer(&unk))) + if hr != 0 { + err = NewError(hr) + } + return +} + +// VariantInit initializes variant. +func VariantInit(v *VARIANT) (err error) { + hr, _, _ := procVariantInit.Call(uintptr(unsafe.Pointer(v))) + if hr != 0 { + err = NewError(hr) + } + return +} + +// VariantClear clears value in Variant settings to VT_EMPTY. +func VariantClear(v *VARIANT) (err error) { + hr, _, _ := procVariantClear.Call(uintptr(unsafe.Pointer(v))) + if hr != 0 { + err = NewError(hr) + } + return +} + +// SysAllocString allocates memory for string and copies string into memory. +func SysAllocString(v string) (ss *int16) { + pss, _, _ := procSysAllocString.Call(uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(v)))) + ss = (*int16)(unsafe.Pointer(pss)) + return +} + +// SysAllocStringLen copies up to length of given string returning pointer. +func SysAllocStringLen(v string) (ss *int16) { + utf16 := utf16.Encode([]rune(v + "\x00")) + ptr := &utf16[0] + + pss, _, _ := procSysAllocStringLen.Call(uintptr(unsafe.Pointer(ptr)), uintptr(len(utf16)-1)) + ss = (*int16)(unsafe.Pointer(pss)) + return +} + +// SysFreeString frees string system memory. This must be called with SysAllocString. +func SysFreeString(v *int16) (err error) { + hr, _, _ := procSysFreeString.Call(uintptr(unsafe.Pointer(v))) + if hr != 0 { + err = NewError(hr) + } + return +} + +// SysStringLen is the length of the system allocated string. +func SysStringLen(v *int16) uint32 { + l, _, _ := procSysStringLen.Call(uintptr(unsafe.Pointer(v))) + return uint32(l) +} + +// CreateStdDispatch provides default IDispatch implementation for IUnknown. +// +// This handles default IDispatch implementation for objects. It haves a few +// limitations with only supporting one language. It will also only return +// default exception codes. +func CreateStdDispatch(unk *IUnknown, v uintptr, ptinfo *IUnknown) (disp *IDispatch, err error) { + hr, _, _ := procCreateStdDispatch.Call( + uintptr(unsafe.Pointer(unk)), + v, + uintptr(unsafe.Pointer(ptinfo)), + uintptr(unsafe.Pointer(&disp))) + if hr != 0 { + err = NewError(hr) + } + return +} + +// CreateDispTypeInfo provides default ITypeInfo implementation for IDispatch. +// +// This will not handle the full implementation of the interface. +func CreateDispTypeInfo(idata *INTERFACEDATA) (pptinfo *IUnknown, err error) { + hr, _, _ := procCreateDispTypeInfo.Call( + uintptr(unsafe.Pointer(idata)), + uintptr(GetUserDefaultLCID()), + uintptr(unsafe.Pointer(&pptinfo))) + if hr != 0 { + err = NewError(hr) + } + return +} + +// copyMemory moves location of a block of memory. +func copyMemory(dest unsafe.Pointer, src unsafe.Pointer, length uint32) { + procCopyMemory.Call(uintptr(dest), uintptr(src), uintptr(length)) +} + +// GetUserDefaultLCID retrieves current user default locale. +func GetUserDefaultLCID() (lcid uint32) { + ret, _, _ := procGetUserDefaultLCID.Call() + lcid = uint32(ret) + return +} + +// GetMessage in message queue from runtime. +// +// This function appears to block. PeekMessage does not block. +func GetMessage(msg *Msg, hwnd uint32, MsgFilterMin uint32, MsgFilterMax uint32) (ret int32, err error) { + r0, _, err := procGetMessageW.Call(uintptr(unsafe.Pointer(msg)), uintptr(hwnd), uintptr(MsgFilterMin), uintptr(MsgFilterMax)) + ret = int32(r0) + return +} + +// DispatchMessage to window procedure. +func DispatchMessage(msg *Msg) (ret int32) { + r0, _, _ := procDispatchMessageW.Call(uintptr(unsafe.Pointer(msg))) + ret = int32(r0) + return +} diff --git a/vendor/github.com/go-ole/go-ole/com_func.go b/vendor/github.com/go-ole/go-ole/com_func.go new file mode 100644 index 000000000..cef539d9d --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/com_func.go @@ -0,0 +1,174 @@ +// +build !windows + +package ole + +import ( + "time" + "unsafe" +) + +// coInitialize initializes COM library on current thread. +// +// MSDN documentation suggests that this function should not be called. Call +// CoInitializeEx() instead. The reason has to do with threading and this +// function is only for single-threaded apartments. +// +// That said, most users of the library have gotten away with just this +// function. If you are experiencing threading issues, then use +// CoInitializeEx(). +func coInitialize() error { + return NewError(E_NOTIMPL) +} + +// coInitializeEx initializes COM library with concurrency model. +func coInitializeEx(coinit uint32) error { + return NewError(E_NOTIMPL) +} + +// CoInitialize initializes COM library on current thread. +// +// MSDN documentation suggests that this function should not be called. Call +// CoInitializeEx() instead. The reason has to do with threading and this +// function is only for single-threaded apartments. +// +// That said, most users of the library have gotten away with just this +// function. If you are experiencing threading issues, then use +// CoInitializeEx(). +func CoInitialize(p uintptr) error { + return NewError(E_NOTIMPL) +} + +// CoInitializeEx initializes COM library with concurrency model. +func CoInitializeEx(p uintptr, coinit uint32) error { + return NewError(E_NOTIMPL) +} + +// CoUninitialize uninitializes COM Library. +func CoUninitialize() {} + +// CoTaskMemFree frees memory pointer. +func CoTaskMemFree(memptr uintptr) {} + +// CLSIDFromProgID retrieves Class Identifier with the given Program Identifier. +// +// The Programmatic Identifier must be registered, because it will be looked up +// in the Windows Registry. The registry entry has the following keys: CLSID, +// Insertable, Protocol and Shell +// (https://msdn.microsoft.com/en-us/library/dd542719(v=vs.85).aspx). +// +// programID identifies the class id with less precision and is not guaranteed +// to be unique. These are usually found in the registry under +// HKEY_LOCAL_MACHINE\SOFTWARE\Classes, usually with the format of +// "Program.Component.Version" with version being optional. +// +// CLSIDFromProgID in Windows API. +func CLSIDFromProgID(progId string) (*GUID, error) { + return nil, NewError(E_NOTIMPL) +} + +// CLSIDFromString retrieves Class ID from string representation. +// +// This is technically the string version of the GUID and will convert the +// string to object. +// +// CLSIDFromString in Windows API. +func CLSIDFromString(str string) (*GUID, error) { + return nil, NewError(E_NOTIMPL) +} + +// StringFromCLSID returns GUID formated string from GUID object. +func StringFromCLSID(clsid *GUID) (string, error) { + return "", NewError(E_NOTIMPL) +} + +// IIDFromString returns GUID from program ID. +func IIDFromString(progId string) (*GUID, error) { + return nil, NewError(E_NOTIMPL) +} + +// StringFromIID returns GUID formatted string from GUID object. +func StringFromIID(iid *GUID) (string, error) { + return "", NewError(E_NOTIMPL) +} + +// CreateInstance of single uninitialized object with GUID. +func CreateInstance(clsid *GUID, iid *GUID) (*IUnknown, error) { + return nil, NewError(E_NOTIMPL) +} + +// GetActiveObject retrieves pointer to active object. +func GetActiveObject(clsid *GUID, iid *GUID) (*IUnknown, error) { + return nil, NewError(E_NOTIMPL) +} + +// VariantInit initializes variant. +func VariantInit(v *VARIANT) error { + return NewError(E_NOTIMPL) +} + +// VariantClear clears value in Variant settings to VT_EMPTY. +func VariantClear(v *VARIANT) error { + return NewError(E_NOTIMPL) +} + +// SysAllocString allocates memory for string and copies string into memory. +func SysAllocString(v string) *int16 { + u := int16(0) + return &u +} + +// SysAllocStringLen copies up to length of given string returning pointer. +func SysAllocStringLen(v string) *int16 { + u := int16(0) + return &u +} + +// SysFreeString frees string system memory. This must be called with SysAllocString. +func SysFreeString(v *int16) error { + return NewError(E_NOTIMPL) +} + +// SysStringLen is the length of the system allocated string. +func SysStringLen(v *int16) uint32 { + return uint32(0) +} + +// CreateStdDispatch provides default IDispatch implementation for IUnknown. +// +// This handles default IDispatch implementation for objects. It haves a few +// limitations with only supporting one language. It will also only return +// default exception codes. +func CreateStdDispatch(unk *IUnknown, v uintptr, ptinfo *IUnknown) (*IDispatch, error) { + return nil, NewError(E_NOTIMPL) +} + +// CreateDispTypeInfo provides default ITypeInfo implementation for IDispatch. +// +// This will not handle the full implementation of the interface. +func CreateDispTypeInfo(idata *INTERFACEDATA) (*IUnknown, error) { + return nil, NewError(E_NOTIMPL) +} + +// copyMemory moves location of a block of memory. +func copyMemory(dest unsafe.Pointer, src unsafe.Pointer, length uint32) {} + +// GetUserDefaultLCID retrieves current user default locale. +func GetUserDefaultLCID() uint32 { + return uint32(0) +} + +// GetMessage in message queue from runtime. +// +// This function appears to block. PeekMessage does not block. +func GetMessage(msg *Msg, hwnd uint32, MsgFilterMin uint32, MsgFilterMax uint32) (int32, error) { + return int32(0), NewError(E_NOTIMPL) +} + +// DispatchMessage to window procedure. +func DispatchMessage(msg *Msg) int32 { + return int32(0) +} + +func GetVariantDate(value uint64) (time.Time, error) { + return time.Now(), NewError(E_NOTIMPL) +} diff --git a/vendor/github.com/go-ole/go-ole/connect.go b/vendor/github.com/go-ole/go-ole/connect.go new file mode 100644 index 000000000..b2ac2ec67 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/connect.go @@ -0,0 +1,192 @@ +package ole + +// Connection contains IUnknown for fluent interface interaction. +// +// Deprecated. Use oleutil package instead. +type Connection struct { + Object *IUnknown // Access COM +} + +// Initialize COM. +func (*Connection) Initialize() (err error) { + return coInitialize() +} + +// Uninitialize COM. +func (*Connection) Uninitialize() { + CoUninitialize() +} + +// Create IUnknown object based first on ProgId and then from String. +func (c *Connection) Create(progId string) (err error) { + var clsid *GUID + clsid, err = CLSIDFromProgID(progId) + if err != nil { + clsid, err = CLSIDFromString(progId) + if err != nil { + return + } + } + + unknown, err := CreateInstance(clsid, IID_IUnknown) + if err != nil { + return + } + c.Object = unknown + + return +} + +// Release IUnknown object. +func (c *Connection) Release() { + c.Object.Release() +} + +// Load COM object from list of programIDs or strings. +func (c *Connection) Load(names ...string) (errors []error) { + var tempErrors []error = make([]error, len(names)) + var numErrors int = 0 + for _, name := range names { + err := c.Create(name) + if err != nil { + tempErrors = append(tempErrors, err) + numErrors += 1 + continue + } + break + } + + copy(errors, tempErrors[0:numErrors]) + return +} + +// Dispatch returns Dispatch object. +func (c *Connection) Dispatch() (object *Dispatch, err error) { + dispatch, err := c.Object.QueryInterface(IID_IDispatch) + if err != nil { + return + } + object = &Dispatch{dispatch} + return +} + +// Dispatch stores IDispatch object. +type Dispatch struct { + Object *IDispatch // Dispatch object. +} + +// Call method on IDispatch with parameters. +func (d *Dispatch) Call(method string, params ...interface{}) (result *VARIANT, err error) { + id, err := d.GetId(method) + if err != nil { + return + } + + result, err = d.Invoke(id, DISPATCH_METHOD, params) + return +} + +// MustCall method on IDispatch with parameters. +func (d *Dispatch) MustCall(method string, params ...interface{}) (result *VARIANT) { + id, err := d.GetId(method) + if err != nil { + panic(err) + } + + result, err = d.Invoke(id, DISPATCH_METHOD, params) + if err != nil { + panic(err) + } + + return +} + +// Get property on IDispatch with parameters. +func (d *Dispatch) Get(name string, params ...interface{}) (result *VARIANT, err error) { + id, err := d.GetId(name) + if err != nil { + return + } + result, err = d.Invoke(id, DISPATCH_PROPERTYGET, params) + return +} + +// MustGet property on IDispatch with parameters. +func (d *Dispatch) MustGet(name string, params ...interface{}) (result *VARIANT) { + id, err := d.GetId(name) + if err != nil { + panic(err) + } + + result, err = d.Invoke(id, DISPATCH_PROPERTYGET, params) + if err != nil { + panic(err) + } + return +} + +// Set property on IDispatch with parameters. +func (d *Dispatch) Set(name string, params ...interface{}) (result *VARIANT, err error) { + id, err := d.GetId(name) + if err != nil { + return + } + result, err = d.Invoke(id, DISPATCH_PROPERTYPUT, params) + return +} + +// MustSet property on IDispatch with parameters. +func (d *Dispatch) MustSet(name string, params ...interface{}) (result *VARIANT) { + id, err := d.GetId(name) + if err != nil { + panic(err) + } + + result, err = d.Invoke(id, DISPATCH_PROPERTYPUT, params) + if err != nil { + panic(err) + } + return +} + +// GetId retrieves ID of name on IDispatch. +func (d *Dispatch) GetId(name string) (id int32, err error) { + var dispid []int32 + dispid, err = d.Object.GetIDsOfName([]string{name}) + if err != nil { + return + } + id = dispid[0] + return +} + +// GetIds retrieves all IDs of names on IDispatch. +func (d *Dispatch) GetIds(names ...string) (dispid []int32, err error) { + dispid, err = d.Object.GetIDsOfName(names) + return +} + +// Invoke IDispatch on DisplayID of dispatch type with parameters. +// +// There have been problems where if send cascading params..., it would error +// out because the parameters would be empty. +func (d *Dispatch) Invoke(id int32, dispatch int16, params []interface{}) (result *VARIANT, err error) { + if len(params) < 1 { + result, err = d.Object.Invoke(id, dispatch) + } else { + result, err = d.Object.Invoke(id, dispatch, params...) + } + return +} + +// Release IDispatch object. +func (d *Dispatch) Release() { + d.Object.Release() +} + +// Connect initializes COM and attempts to load IUnknown based on given names. +func Connect(names ...string) (connection *Connection) { + connection.Initialize() + connection.Load(names...) + return +} diff --git a/vendor/github.com/go-ole/go-ole/constants.go b/vendor/github.com/go-ole/go-ole/constants.go new file mode 100644 index 000000000..fd0c6d74b --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/constants.go @@ -0,0 +1,153 @@ +package ole + +const ( + CLSCTX_INPROC_SERVER = 1 + CLSCTX_INPROC_HANDLER = 2 + CLSCTX_LOCAL_SERVER = 4 + CLSCTX_INPROC_SERVER16 = 8 + CLSCTX_REMOTE_SERVER = 16 + CLSCTX_ALL = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER + CLSCTX_INPROC = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER + CLSCTX_SERVER = CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER +) + +const ( + COINIT_APARTMENTTHREADED = 0x2 + COINIT_MULTITHREADED = 0x0 + COINIT_DISABLE_OLE1DDE = 0x4 + COINIT_SPEED_OVER_MEMORY = 0x8 +) + +const ( + DISPATCH_METHOD = 1 + DISPATCH_PROPERTYGET = 2 + DISPATCH_PROPERTYPUT = 4 + DISPATCH_PROPERTYPUTREF = 8 +) + +const ( + S_OK = 0x00000000 + E_UNEXPECTED = 0x8000FFFF + E_NOTIMPL = 0x80004001 + E_OUTOFMEMORY = 0x8007000E + E_INVALIDARG = 0x80070057 + E_NOINTERFACE = 0x80004002 + E_POINTER = 0x80004003 + E_HANDLE = 0x80070006 + E_ABORT = 0x80004004 + E_FAIL = 0x80004005 + E_ACCESSDENIED = 0x80070005 + E_PENDING = 0x8000000A + + CO_E_CLASSSTRING = 0x800401F3 +) + +const ( + CC_FASTCALL = iota + CC_CDECL + CC_MSCPASCAL + CC_PASCAL = CC_MSCPASCAL + CC_MACPASCAL + CC_STDCALL + CC_FPFASTCALL + CC_SYSCALL + CC_MPWCDECL + CC_MPWPASCAL + CC_MAX = CC_MPWPASCAL +) + +type VT uint16 + +const ( + VT_EMPTY VT = 0x0 + VT_NULL VT = 0x1 + VT_I2 VT = 0x2 + VT_I4 VT = 0x3 + VT_R4 VT = 0x4 + VT_R8 VT = 0x5 + VT_CY VT = 0x6 + VT_DATE VT = 0x7 + VT_BSTR VT = 0x8 + VT_DISPATCH VT = 0x9 + VT_ERROR VT = 0xa + VT_BOOL VT = 0xb + VT_VARIANT VT = 0xc + VT_UNKNOWN VT = 0xd + VT_DECIMAL VT = 0xe + VT_I1 VT = 0x10 + VT_UI1 VT = 0x11 + VT_UI2 VT = 0x12 + VT_UI4 VT = 0x13 + VT_I8 VT = 0x14 + VT_UI8 VT = 0x15 + VT_INT VT = 0x16 + VT_UINT VT = 0x17 + VT_VOID VT = 0x18 + VT_HRESULT VT = 0x19 + VT_PTR VT = 0x1a + VT_SAFEARRAY VT = 0x1b + VT_CARRAY VT = 0x1c + VT_USERDEFINED VT = 0x1d + VT_LPSTR VT = 0x1e + VT_LPWSTR VT = 0x1f + VT_RECORD VT = 0x24 + VT_INT_PTR VT = 0x25 + VT_UINT_PTR VT = 0x26 + VT_FILETIME VT = 0x40 + VT_BLOB VT = 0x41 + VT_STREAM VT = 0x42 + VT_STORAGE VT = 0x43 + VT_STREAMED_OBJECT VT = 0x44 + VT_STORED_OBJECT VT = 0x45 + VT_BLOB_OBJECT VT = 0x46 + VT_CF VT = 0x47 + VT_CLSID VT = 0x48 + VT_BSTR_BLOB VT = 0xfff + VT_VECTOR VT = 0x1000 + VT_ARRAY VT = 0x2000 + VT_BYREF VT = 0x4000 + VT_RESERVED VT = 0x8000 + VT_ILLEGAL VT = 0xffff + VT_ILLEGALMASKED VT = 0xfff + VT_TYPEMASK VT = 0xfff +) + +const ( + DISPID_UNKNOWN = -1 + DISPID_VALUE = 0 + DISPID_PROPERTYPUT = -3 + DISPID_NEWENUM = -4 + DISPID_EVALUATE = -5 + DISPID_CONSTRUCTOR = -6 + DISPID_DESTRUCTOR = -7 + DISPID_COLLECT = -8 +) + +const ( + TKIND_ENUM = 1 + TKIND_RECORD = 2 + TKIND_MODULE = 3 + TKIND_INTERFACE = 4 + TKIND_DISPATCH = 5 + TKIND_COCLASS = 6 + TKIND_ALIAS = 7 + TKIND_UNION = 8 + TKIND_MAX = 9 +) + +// Safe Array Feature Flags + +const ( + FADF_AUTO = 0x0001 + FADF_STATIC = 0x0002 + FADF_EMBEDDED = 0x0004 + FADF_FIXEDSIZE = 0x0010 + FADF_RECORD = 0x0020 + FADF_HAVEIID = 0x0040 + FADF_HAVEVARTYPE = 0x0080 + FADF_BSTR = 0x0100 + FADF_UNKNOWN = 0x0200 + FADF_DISPATCH = 0x0400 + FADF_VARIANT = 0x0800 + FADF_RESERVED = 0xF008 +) diff --git a/vendor/github.com/go-ole/go-ole/error.go b/vendor/github.com/go-ole/go-ole/error.go new file mode 100644 index 000000000..096b456d3 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/error.go @@ -0,0 +1,51 @@ +package ole + +// OleError stores COM errors. +type OleError struct { + hr uintptr + description string + subError error +} + +// NewError creates new error with HResult. +func NewError(hr uintptr) *OleError { + return &OleError{hr: hr} +} + +// NewErrorWithDescription creates new COM error with HResult and description. +func NewErrorWithDescription(hr uintptr, description string) *OleError { + return &OleError{hr: hr, description: description} +} + +// NewErrorWithSubError creates new COM error with parent error. +func NewErrorWithSubError(hr uintptr, description string, err error) *OleError { + return &OleError{hr: hr, description: description, subError: err} +} + +// Code is the HResult. +func (v *OleError) Code() uintptr { + return uintptr(v.hr) +} + +// String description, either manually set or format message with error code. +func (v *OleError) String() string { + if v.description != "" { + return errstr(int(v.hr)) + " (" + v.description + ")" + } + return errstr(int(v.hr)) +} + +// Error implements error interface. +func (v *OleError) Error() string { + return v.String() +} + +// Description retrieves error summary, if there is one. +func (v *OleError) Description() string { + return v.description +} + +// SubError returns parent error, if there is one. +func (v *OleError) SubError() error { + return v.subError +} diff --git a/vendor/github.com/go-ole/go-ole/error_func.go b/vendor/github.com/go-ole/go-ole/error_func.go new file mode 100644 index 000000000..8a2ffaa27 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/error_func.go @@ -0,0 +1,8 @@ +// +build !windows + +package ole + +// errstr converts error code to string. +func errstr(errno int) string { + return "" +} diff --git a/vendor/github.com/go-ole/go-ole/error_windows.go b/vendor/github.com/go-ole/go-ole/error_windows.go new file mode 100644 index 000000000..d0e8e6859 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/error_windows.go @@ -0,0 +1,24 @@ +// +build windows + +package ole + +import ( + "fmt" + "syscall" + "unicode/utf16" +) + +// errstr converts error code to string. +func errstr(errno int) string { + // ask windows for the remaining errors + var flags uint32 = syscall.FORMAT_MESSAGE_FROM_SYSTEM | syscall.FORMAT_MESSAGE_ARGUMENT_ARRAY | syscall.FORMAT_MESSAGE_IGNORE_INSERTS + b := make([]uint16, 300) + n, err := syscall.FormatMessage(flags, 0, uint32(errno), 0, b, nil) + if err != nil { + return fmt.Sprintf("error %d (FormatMessage failed with: %v)", errno, err) + } + // trim terminating \r and \n + for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- { + } + return string(utf16.Decode(b[:n])) +} diff --git a/vendor/github.com/go-ole/go-ole/guid.go b/vendor/github.com/go-ole/go-ole/guid.go new file mode 100644 index 000000000..8d20f68fb --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/guid.go @@ -0,0 +1,284 @@ +package ole + +var ( + // IID_NULL is null Interface ID, used when no other Interface ID is known. + IID_NULL = NewGUID("{00000000-0000-0000-0000-000000000000}") + + // IID_IUnknown is for IUnknown interfaces. + IID_IUnknown = NewGUID("{00000000-0000-0000-C000-000000000046}") + + // IID_IDispatch is for IDispatch interfaces. + IID_IDispatch = NewGUID("{00020400-0000-0000-C000-000000000046}") + + // IID_IEnumVariant is for IEnumVariant interfaces + IID_IEnumVariant = NewGUID("{00020404-0000-0000-C000-000000000046}") + + // IID_IConnectionPointContainer is for IConnectionPointContainer interfaces. + IID_IConnectionPointContainer = NewGUID("{B196B284-BAB4-101A-B69C-00AA00341D07}") + + // IID_IConnectionPoint is for IConnectionPoint interfaces. + IID_IConnectionPoint = NewGUID("{B196B286-BAB4-101A-B69C-00AA00341D07}") + + // IID_IInspectable is for IInspectable interfaces. + IID_IInspectable = NewGUID("{AF86E2E0-B12D-4C6A-9C5A-D7AA65101E90}") + + // IID_IProvideClassInfo is for IProvideClassInfo interfaces. + IID_IProvideClassInfo = NewGUID("{B196B283-BAB4-101A-B69C-00AA00341D07}") +) + +// These are for testing and not part of any library. +var ( + // IID_ICOMTestString is for ICOMTestString interfaces. + // + // {E0133EB4-C36F-469A-9D3D-C66B84BE19ED} + IID_ICOMTestString = NewGUID("{E0133EB4-C36F-469A-9D3D-C66B84BE19ED}") + + // IID_ICOMTestInt8 is for ICOMTestInt8 interfaces. + // + // {BEB06610-EB84-4155-AF58-E2BFF53680B4} + IID_ICOMTestInt8 = NewGUID("{BEB06610-EB84-4155-AF58-E2BFF53680B4}") + + // IID_ICOMTestInt16 is for ICOMTestInt16 interfaces. + // + // {DAA3F9FA-761E-4976-A860-8364CE55F6FC} + IID_ICOMTestInt16 = NewGUID("{DAA3F9FA-761E-4976-A860-8364CE55F6FC}") + + // IID_ICOMTestInt32 is for ICOMTestInt32 interfaces. + // + // {E3DEDEE7-38A2-4540-91D1-2EEF1D8891B0} + IID_ICOMTestInt32 = NewGUID("{E3DEDEE7-38A2-4540-91D1-2EEF1D8891B0}") + + // IID_ICOMTestInt64 is for ICOMTestInt64 interfaces. + // + // {8D437CBC-B3ED-485C-BC32-C336432A1623} + IID_ICOMTestInt64 = NewGUID("{8D437CBC-B3ED-485C-BC32-C336432A1623}") + + // IID_ICOMTestFloat is for ICOMTestFloat interfaces. + // + // {BF1ED004-EA02-456A-AA55-2AC8AC6B054C} + IID_ICOMTestFloat = NewGUID("{BF1ED004-EA02-456A-AA55-2AC8AC6B054C}") + + // IID_ICOMTestDouble is for ICOMTestDouble interfaces. + // + // {BF908A81-8687-4E93-999F-D86FAB284BA0} + IID_ICOMTestDouble = NewGUID("{BF908A81-8687-4E93-999F-D86FAB284BA0}") + + // IID_ICOMTestBoolean is for ICOMTestBoolean interfaces. + // + // {D530E7A6-4EE8-40D1-8931-3D63B8605010} + IID_ICOMTestBoolean = NewGUID("{D530E7A6-4EE8-40D1-8931-3D63B8605010}") + + // IID_ICOMEchoTestObject is for ICOMEchoTestObject interfaces. + // + // {6485B1EF-D780-4834-A4FE-1EBB51746CA3} + IID_ICOMEchoTestObject = NewGUID("{6485B1EF-D780-4834-A4FE-1EBB51746CA3}") + + // IID_ICOMTestTypes is for ICOMTestTypes interfaces. + // + // {CCA8D7AE-91C0-4277-A8B3-FF4EDF28D3C0} + IID_ICOMTestTypes = NewGUID("{CCA8D7AE-91C0-4277-A8B3-FF4EDF28D3C0}") + + // CLSID_COMEchoTestObject is for COMEchoTestObject class. + // + // {3C24506A-AE9E-4D50-9157-EF317281F1B0} + CLSID_COMEchoTestObject = NewGUID("{3C24506A-AE9E-4D50-9157-EF317281F1B0}") + + // CLSID_COMTestScalarClass is for COMTestScalarClass class. + // + // {865B85C5-0334-4AC6-9EF6-AACEC8FC5E86} + CLSID_COMTestScalarClass = NewGUID("{865B85C5-0334-4AC6-9EF6-AACEC8FC5E86}") +) + +const hextable = "0123456789ABCDEF" +const emptyGUID = "{00000000-0000-0000-0000-000000000000}" + +// GUID is Windows API specific GUID type. +// +// This exists to match Windows GUID type for direct passing for COM. +// Format is in xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx. +type GUID struct { + Data1 uint32 + Data2 uint16 + Data3 uint16 + Data4 [8]byte +} + +// NewGUID converts the given string into a globally unique identifier that is +// compliant with the Windows API. +// +// The supplied string may be in any of these formats: +// +// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +// XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX +// {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} +// +// The conversion of the supplied string is not case-sensitive. +func NewGUID(guid string) *GUID { + d := []byte(guid) + var d1, d2, d3, d4a, d4b []byte + + switch len(d) { + case 38: + if d[0] != '{' || d[37] != '}' { + return nil + } + d = d[1:37] + fallthrough + case 36: + if d[8] != '-' || d[13] != '-' || d[18] != '-' || d[23] != '-' { + return nil + } + d1 = d[0:8] + d2 = d[9:13] + d3 = d[14:18] + d4a = d[19:23] + d4b = d[24:36] + case 32: + d1 = d[0:8] + d2 = d[8:12] + d3 = d[12:16] + d4a = d[16:20] + d4b = d[20:32] + default: + return nil + } + + var g GUID + var ok1, ok2, ok3, ok4 bool + g.Data1, ok1 = decodeHexUint32(d1) + g.Data2, ok2 = decodeHexUint16(d2) + g.Data3, ok3 = decodeHexUint16(d3) + g.Data4, ok4 = decodeHexByte64(d4a, d4b) + if ok1 && ok2 && ok3 && ok4 { + return &g + } + return nil +} + +func decodeHexUint32(src []byte) (value uint32, ok bool) { + var b1, b2, b3, b4 byte + var ok1, ok2, ok3, ok4 bool + b1, ok1 = decodeHexByte(src[0], src[1]) + b2, ok2 = decodeHexByte(src[2], src[3]) + b3, ok3 = decodeHexByte(src[4], src[5]) + b4, ok4 = decodeHexByte(src[6], src[7]) + value = (uint32(b1) << 24) | (uint32(b2) << 16) | (uint32(b3) << 8) | uint32(b4) + ok = ok1 && ok2 && ok3 && ok4 + return +} + +func decodeHexUint16(src []byte) (value uint16, ok bool) { + var b1, b2 byte + var ok1, ok2 bool + b1, ok1 = decodeHexByte(src[0], src[1]) + b2, ok2 = decodeHexByte(src[2], src[3]) + value = (uint16(b1) << 8) | uint16(b2) + ok = ok1 && ok2 + return +} + +func decodeHexByte64(s1 []byte, s2 []byte) (value [8]byte, ok bool) { + var ok1, ok2, ok3, ok4, ok5, ok6, ok7, ok8 bool + value[0], ok1 = decodeHexByte(s1[0], s1[1]) + value[1], ok2 = decodeHexByte(s1[2], s1[3]) + value[2], ok3 = decodeHexByte(s2[0], s2[1]) + value[3], ok4 = decodeHexByte(s2[2], s2[3]) + value[4], ok5 = decodeHexByte(s2[4], s2[5]) + value[5], ok6 = decodeHexByte(s2[6], s2[7]) + value[6], ok7 = decodeHexByte(s2[8], s2[9]) + value[7], ok8 = decodeHexByte(s2[10], s2[11]) + ok = ok1 && ok2 && ok3 && ok4 && ok5 && ok6 && ok7 && ok8 + return +} + +func decodeHexByte(c1, c2 byte) (value byte, ok bool) { + var n1, n2 byte + var ok1, ok2 bool + n1, ok1 = decodeHexChar(c1) + n2, ok2 = decodeHexChar(c2) + value = (n1 << 4) | n2 + ok = ok1 && ok2 + return +} + +func decodeHexChar(c byte) (byte, bool) { + switch { + case '0' <= c && c <= '9': + return c - '0', true + case 'a' <= c && c <= 'f': + return c - 'a' + 10, true + case 'A' <= c && c <= 'F': + return c - 'A' + 10, true + } + + return 0, false +} + +// String converts the GUID to string form. It will adhere to this pattern: +// +// {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} +// +// If the GUID is nil, the string representation of an empty GUID is returned: +// +// {00000000-0000-0000-0000-000000000000} +func (guid *GUID) String() string { + if guid == nil { + return emptyGUID + } + + var c [38]byte + c[0] = '{' + putUint32Hex(c[1:9], guid.Data1) + c[9] = '-' + putUint16Hex(c[10:14], guid.Data2) + c[14] = '-' + putUint16Hex(c[15:19], guid.Data3) + c[19] = '-' + putByteHex(c[20:24], guid.Data4[0:2]) + c[24] = '-' + putByteHex(c[25:37], guid.Data4[2:8]) + c[37] = '}' + return string(c[:]) +} + +func putUint32Hex(b []byte, v uint32) { + b[0] = hextable[byte(v>>24)>>4] + b[1] = hextable[byte(v>>24)&0x0f] + b[2] = hextable[byte(v>>16)>>4] + b[3] = hextable[byte(v>>16)&0x0f] + b[4] = hextable[byte(v>>8)>>4] + b[5] = hextable[byte(v>>8)&0x0f] + b[6] = hextable[byte(v)>>4] + b[7] = hextable[byte(v)&0x0f] +} + +func putUint16Hex(b []byte, v uint16) { + b[0] = hextable[byte(v>>8)>>4] + b[1] = hextable[byte(v>>8)&0x0f] + b[2] = hextable[byte(v)>>4] + b[3] = hextable[byte(v)&0x0f] +} + +func putByteHex(dst, src []byte) { + for i := 0; i < len(src); i++ { + dst[i*2] = hextable[src[i]>>4] + dst[i*2+1] = hextable[src[i]&0x0f] + } +} + +// IsEqualGUID compares two GUID. +// +// Not constant time comparison. +func IsEqualGUID(guid1 *GUID, guid2 *GUID) bool { + return guid1.Data1 == guid2.Data1 && + guid1.Data2 == guid2.Data2 && + guid1.Data3 == guid2.Data3 && + guid1.Data4[0] == guid2.Data4[0] && + guid1.Data4[1] == guid2.Data4[1] && + guid1.Data4[2] == guid2.Data4[2] && + guid1.Data4[3] == guid2.Data4[3] && + guid1.Data4[4] == guid2.Data4[4] && + guid1.Data4[5] == guid2.Data4[5] && + guid1.Data4[6] == guid2.Data4[6] && + guid1.Data4[7] == guid2.Data4[7] +} diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpoint.go b/vendor/github.com/go-ole/go-ole/iconnectionpoint.go new file mode 100644 index 000000000..9e6c49f41 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iconnectionpoint.go @@ -0,0 +1,20 @@ +package ole + +import "unsafe" + +type IConnectionPoint struct { + IUnknown +} + +type IConnectionPointVtbl struct { + IUnknownVtbl + GetConnectionInterface uintptr + GetConnectionPointContainer uintptr + Advise uintptr + Unadvise uintptr + EnumConnections uintptr +} + +func (v *IConnectionPoint) VTable() *IConnectionPointVtbl { + return (*IConnectionPointVtbl)(unsafe.Pointer(v.RawVTable)) +} diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go b/vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go new file mode 100644 index 000000000..5414dc3cd --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go @@ -0,0 +1,21 @@ +// +build !windows + +package ole + +import "unsafe" + +func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 { + return int32(0) +} + +func (v *IConnectionPoint) Advise(unknown *IUnknown) (uint32, error) { + return uint32(0), NewError(E_NOTIMPL) +} + +func (v *IConnectionPoint) Unadvise(cookie uint32) error { + return NewError(E_NOTIMPL) +} + +func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) (err error) { + return NewError(E_NOTIMPL) +} diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go b/vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go new file mode 100644 index 000000000..32bc18324 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go @@ -0,0 +1,43 @@ +// +build windows + +package ole + +import ( + "syscall" + "unsafe" +) + +func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 { + // XXX: This doesn't look like it does what it's supposed to + return release((*IUnknown)(unsafe.Pointer(v))) +} + +func (v *IConnectionPoint) Advise(unknown *IUnknown) (cookie uint32, err error) { + hr, _, _ := syscall.Syscall( + v.VTable().Advise, + 3, + uintptr(unsafe.Pointer(v)), + uintptr(unsafe.Pointer(unknown)), + uintptr(unsafe.Pointer(&cookie))) + if hr != 0 { + err = NewError(hr) + } + return +} + +func (v *IConnectionPoint) Unadvise(cookie uint32) (err error) { + hr, _, _ := syscall.Syscall( + v.VTable().Unadvise, + 2, + uintptr(unsafe.Pointer(v)), + uintptr(cookie), + 0) + if hr != 0 { + err = NewError(hr) + } + return +} + +func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) error { + return NewError(E_NOTIMPL) +} diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go b/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go new file mode 100644 index 000000000..165860d19 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go @@ -0,0 +1,17 @@ +package ole + +import "unsafe" + +type IConnectionPointContainer struct { + IUnknown +} + +type IConnectionPointContainerVtbl struct { + IUnknownVtbl + EnumConnectionPoints uintptr + FindConnectionPoint uintptr +} + +func (v *IConnectionPointContainer) VTable() *IConnectionPointContainerVtbl { + return (*IConnectionPointContainerVtbl)(unsafe.Pointer(v.RawVTable)) +} diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go b/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go new file mode 100644 index 000000000..5dfa42aae --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go @@ -0,0 +1,11 @@ +// +build !windows + +package ole + +func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { + return NewError(E_NOTIMPL) +} + +func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) error { + return NewError(E_NOTIMPL) +} diff --git a/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go b/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go new file mode 100644 index 000000000..ad30d79ef --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go @@ -0,0 +1,25 @@ +// +build windows + +package ole + +import ( + "syscall" + "unsafe" +) + +func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { + return NewError(E_NOTIMPL) +} + +func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) (err error) { + hr, _, _ := syscall.Syscall( + v.VTable().FindConnectionPoint, + 3, + uintptr(unsafe.Pointer(v)), + uintptr(unsafe.Pointer(iid)), + uintptr(unsafe.Pointer(point))) + if hr != 0 { + err = NewError(hr) + } + return +} diff --git a/vendor/github.com/go-ole/go-ole/idispatch.go b/vendor/github.com/go-ole/go-ole/idispatch.go new file mode 100644 index 000000000..d4af12409 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/idispatch.go @@ -0,0 +1,94 @@ +package ole + +import "unsafe" + +type IDispatch struct { + IUnknown +} + +type IDispatchVtbl struct { + IUnknownVtbl + GetTypeInfoCount uintptr + GetTypeInfo uintptr + GetIDsOfNames uintptr + Invoke uintptr +} + +func (v *IDispatch) VTable() *IDispatchVtbl { + return (*IDispatchVtbl)(unsafe.Pointer(v.RawVTable)) +} + +func (v *IDispatch) GetIDsOfName(names []string) (dispid []int32, err error) { + dispid, err = getIDsOfName(v, names) + return +} + +func (v *IDispatch) Invoke(dispid int32, dispatch int16, params ...interface{}) (result *VARIANT, err error) { + result, err = invoke(v, dispid, dispatch, params...) + return +} + +func (v *IDispatch) GetTypeInfoCount() (c uint32, err error) { + c, err = getTypeInfoCount(v) + return +} + +func (v *IDispatch) GetTypeInfo() (tinfo *ITypeInfo, err error) { + tinfo, err = getTypeInfo(v) + return +} + +// GetSingleIDOfName is a helper that returns single display ID for IDispatch name. +// +// This replaces the common pattern of attempting to get a single name from the list of available +// IDs. It gives the first ID, if it is available. +func (v *IDispatch) GetSingleIDOfName(name string) (displayID int32, err error) { + var displayIDs []int32 + displayIDs, err = v.GetIDsOfName([]string{name}) + if err != nil { + return + } + displayID = displayIDs[0] + return +} + +// InvokeWithOptionalArgs accepts arguments as an array, works like Invoke. +// +// Accepts name and will attempt to retrieve Display ID to pass to Invoke. +// +// Passing params as an array is a workaround that could be fixed in later versions of Go that +// prevent passing empty params. During testing it was discovered that this is an acceptable way of +// getting around not being able to pass params normally. +func (v *IDispatch) InvokeWithOptionalArgs(name string, dispatch int16, params []interface{}) (result *VARIANT, err error) { + displayID, err := v.GetSingleIDOfName(name) + if err != nil { + return + } + + if len(params) < 1 { + result, err = v.Invoke(displayID, dispatch) + } else { + result, err = v.Invoke(displayID, dispatch, params...) + } + + return +} + +// CallMethod invokes named function with arguments on object. +func (v *IDispatch) CallMethod(name string, params ...interface{}) (*VARIANT, error) { + return v.InvokeWithOptionalArgs(name, DISPATCH_METHOD, params) +} + +// GetProperty retrieves the property with the name with the ability to pass arguments. +// +// Most of the time you will not need to pass arguments as most objects do not allow for this +// feature. Or at least, should not allow for this feature. Some servers don't follow best practices +// and this is provided for those edge cases. +func (v *IDispatch) GetProperty(name string, params ...interface{}) (*VARIANT, error) { + return v.InvokeWithOptionalArgs(name, DISPATCH_PROPERTYGET, params) +} + +// PutProperty attempts to mutate a property in the object. +func (v *IDispatch) PutProperty(name string, params ...interface{}) (*VARIANT, error) { + return v.InvokeWithOptionalArgs(name, DISPATCH_PROPERTYPUT, params) +} diff --git a/vendor/github.com/go-ole/go-ole/idispatch_func.go b/vendor/github.com/go-ole/go-ole/idispatch_func.go new file mode 100644 index 000000000..b8fbbe319 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/idispatch_func.go @@ -0,0 +1,19 @@ +// +build !windows + +package ole + +func getIDsOfName(disp *IDispatch, names []string) ([]int32, error) { + return []int32{}, NewError(E_NOTIMPL) +} + +func getTypeInfoCount(disp *IDispatch) (uint32, error) { + return uint32(0), NewError(E_NOTIMPL) +} + +func getTypeInfo(disp *IDispatch) (*ITypeInfo, error) { + return nil, NewError(E_NOTIMPL) +} + +func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...interface{}) (*VARIANT, error) { + return nil, NewError(E_NOTIMPL) +} diff --git a/vendor/github.com/go-ole/go-ole/idispatch_windows.go b/vendor/github.com/go-ole/go-ole/idispatch_windows.go new file mode 100644 index 000000000..649c0734f --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/idispatch_windows.go @@ -0,0 +1,203 @@ +//go:build windows +// +build windows + +package ole + +import ( + "math/big" + "syscall" + "time" + "unsafe" +) + +func getIDsOfName(disp *IDispatch, names []string) (dispid []int32, err error) { + wnames := make([]*uint16, len(names)) + for i := 0; i < len(names); i++ { + wnames[i] = syscall.StringToUTF16Ptr(names[i]) + } + dispid = make([]int32, len(names)) + namelen := uint32(len(names)) + hr, _, _ := syscall.Syscall6( + disp.VTable().GetIDsOfNames, + 6, + uintptr(unsafe.Pointer(disp)), + uintptr(unsafe.Pointer(IID_NULL)), + uintptr(unsafe.Pointer(&wnames[0])), + uintptr(namelen), + uintptr(GetUserDefaultLCID()), + uintptr(unsafe.Pointer(&dispid[0]))) + if hr != 0 { + err = NewError(hr) + } + return +} + +func getTypeInfoCount(disp *IDispatch) (c uint32, err error) { + hr, _, _ := syscall.Syscall( + disp.VTable().GetTypeInfoCount, + 2, + uintptr(unsafe.Pointer(disp)), + uintptr(unsafe.Pointer(&c)), + 0) + if hr != 0 { + err = NewError(hr) + } + return +} + +func getTypeInfo(disp *IDispatch) (tinfo *ITypeInfo, err error) { + hr, _, _ := syscall.Syscall( + disp.VTable().GetTypeInfo, + 3, + uintptr(unsafe.Pointer(disp)), + uintptr(GetUserDefaultLCID()), + uintptr(unsafe.Pointer(&tinfo))) + if hr != 0 { + err = NewError(hr) + } + return +} + +func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...interface{}) (result *VARIANT, err error) { + var dispparams DISPPARAMS + + if dispatch&DISPATCH_PROPERTYPUT != 0 { + dispnames := [1]int32{DISPID_PROPERTYPUT} + dispparams.rgdispidNamedArgs = uintptr(unsafe.Pointer(&dispnames[0])) + dispparams.cNamedArgs = 1 + } else if dispatch&DISPATCH_PROPERTYPUTREF != 0 { + dispnames := [1]int32{DISPID_PROPERTYPUT} + dispparams.rgdispidNamedArgs = uintptr(unsafe.Pointer(&dispnames[0])) + dispparams.cNamedArgs = 1 + } + var vargs []VARIANT + if len(params) > 0 { + vargs = make([]VARIANT, len(params)) + for i, v := range params { + //n := len(params)-i-1 + n := len(params) - i - 1 + VariantInit(&vargs[n]) + switch vv := v.(type) { + case bool: + if vv { + vargs[n] = NewVariant(VT_BOOL, 0xffff) + } else { + vargs[n] = NewVariant(VT_BOOL, 0) + } + case *bool: + vargs[n] = NewVariant(VT_BOOL|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*bool))))) + case uint8: + vargs[n] = NewVariant(VT_I1, int64(v.(uint8))) + case *uint8: + vargs[n] = NewVariant(VT_I1|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint8))))) + case int8: + vargs[n] = NewVariant(VT_I1, int64(v.(int8))) + case *int8: + vargs[n] = NewVariant(VT_I1|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*int8))))) + case int16: + vargs[n] = NewVariant(VT_I2, int64(v.(int16))) + case *int16: + vargs[n] = NewVariant(VT_I2|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*int16))))) + case uint16: + vargs[n] = NewVariant(VT_UI2, int64(v.(uint16))) + case *uint16: + vargs[n] = NewVariant(VT_UI2|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint16))))) + case int32: + vargs[n] = NewVariant(VT_I4, int64(v.(int32))) + case *int32: + vargs[n] = NewVariant(VT_I4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*int32))))) + case uint32: + vargs[n] = NewVariant(VT_UI4, int64(v.(uint32))) + case *uint32: + vargs[n] = NewVariant(VT_UI4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint32))))) + case int64: + vargs[n] = NewVariant(VT_I8, int64(v.(int64))) + case *int64: + vargs[n] = NewVariant(VT_I8|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*int64))))) + case uint64: + vargs[n] = NewVariant(VT_UI8, int64(uintptr(v.(uint64)))) + case *uint64: + vargs[n] = NewVariant(VT_UI8|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint64))))) + case int: + vargs[n] = NewVariant(VT_I4, int64(v.(int))) + case *int: + vargs[n] = NewVariant(VT_I4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*int))))) + case uint: + vargs[n] = NewVariant(VT_UI4, int64(v.(uint))) + case *uint: + vargs[n] = NewVariant(VT_UI4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*uint))))) + case float32: + vargs[n] = NewVariant(VT_R4, *(*int64)(unsafe.Pointer(&vv))) + case *float32: + vargs[n] = NewVariant(VT_R4|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*float32))))) + case float64: + vargs[n] = NewVariant(VT_R8, *(*int64)(unsafe.Pointer(&vv))) + case *float64: + vargs[n] = NewVariant(VT_R8|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*float64))))) + case *big.Int: + vargs[n] = NewVariant(VT_DECIMAL, v.(*big.Int).Int64()) + case string: + vargs[n] = NewVariant(VT_BSTR, int64(uintptr(unsafe.Pointer(SysAllocStringLen(v.(string)))))) + case *string: + vargs[n] = NewVariant(VT_BSTR|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*string))))) + case time.Time: + s := vv.Format("2006-01-02 15:04:05") + vargs[n] = NewVariant(VT_BSTR, int64(uintptr(unsafe.Pointer(SysAllocStringLen(s))))) + case *time.Time: + s := vv.Format("2006-01-02 15:04:05") + vargs[n] = NewVariant(VT_BSTR|VT_BYREF, int64(uintptr(unsafe.Pointer(&s)))) + case *IDispatch: + vargs[n] = NewVariant(VT_DISPATCH, int64(uintptr(unsafe.Pointer(v.(*IDispatch))))) + case **IDispatch: + vargs[n] = NewVariant(VT_DISPATCH|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(**IDispatch))))) + case nil: + vargs[n] = NewVariant(VT_NULL, 0) + case *VARIANT: + vargs[n] = NewVariant(VT_VARIANT|VT_BYREF, int64(uintptr(unsafe.Pointer(v.(*VARIANT))))) + case []byte: + safeByteArray := safeArrayFromByteSlice(v.([]byte)) + vargs[n] = NewVariant(VT_ARRAY|VT_UI1, int64(uintptr(unsafe.Pointer(safeByteArray)))) + defer VariantClear(&vargs[n]) + case []string: + safeByteArray := safeArrayFromStringSlice(v.([]string)) + vargs[n] = NewVariant(VT_ARRAY|VT_BSTR, int64(uintptr(unsafe.Pointer(safeByteArray)))) + defer VariantClear(&vargs[n]) + default: + panic("unknown type") + } + } + dispparams.rgvarg = uintptr(unsafe.Pointer(&vargs[0])) + dispparams.cArgs = uint32(len(params)) + } + + result = new(VARIANT) + var excepInfo EXCEPINFO + VariantInit(result) + hr, _, _ := syscall.Syscall9( + disp.VTable().Invoke, + 9, + uintptr(unsafe.Pointer(disp)), + uintptr(dispid), + uintptr(unsafe.Pointer(IID_NULL)), + uintptr(GetUserDefaultLCID()), + uintptr(dispatch), + uintptr(unsafe.Pointer(&dispparams)), + uintptr(unsafe.Pointer(result)), + uintptr(unsafe.Pointer(&excepInfo)), + 0) + if hr != 0 { + excepInfo.renderStrings() + excepInfo.Clear() + err = NewErrorWithSubError(hr, excepInfo.description, excepInfo) + } + for i, varg := range vargs { + n := len(params) - i - 1 + if varg.VT == VT_BSTR && varg.Val != 0 { + SysFreeString(((*int16)(unsafe.Pointer(uintptr(varg.Val))))) + } + if varg.VT == (VT_BSTR|VT_BYREF) && varg.Val != 0 { + *(params[n].(*string)) = LpOleStrToString(*(**uint16)(unsafe.Pointer(uintptr(varg.Val)))) + } + } + return +} diff --git a/vendor/github.com/go-ole/go-ole/ienumvariant.go b/vendor/github.com/go-ole/go-ole/ienumvariant.go new file mode 100644 index 000000000..243389754 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/ienumvariant.go @@ -0,0 +1,19 @@ +package ole + +import "unsafe" + +type IEnumVARIANT struct { + IUnknown +} + +type IEnumVARIANTVtbl struct { + IUnknownVtbl + Next uintptr + Skip uintptr + Reset uintptr + Clone uintptr +} + +func (v *IEnumVARIANT) VTable() *IEnumVARIANTVtbl { + return (*IEnumVARIANTVtbl)(unsafe.Pointer(v.RawVTable)) +} diff --git a/vendor/github.com/go-ole/go-ole/ienumvariant_func.go b/vendor/github.com/go-ole/go-ole/ienumvariant_func.go new file mode 100644 index 000000000..c14848199 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/ienumvariant_func.go @@ -0,0 +1,19 @@ +// +build !windows + +package ole + +func (enum *IEnumVARIANT) Clone() (*IEnumVARIANT, error) { + return nil, NewError(E_NOTIMPL) +} + +func (enum *IEnumVARIANT) Reset() error { + return NewError(E_NOTIMPL) +} + +func (enum *IEnumVARIANT) Skip(celt uint) error { + return NewError(E_NOTIMPL) +} + +func (enum *IEnumVARIANT) Next(celt uint) (VARIANT, uint, error) { + return NewVariant(VT_NULL, int64(0)), 0, NewError(E_NOTIMPL) +} diff --git a/vendor/github.com/go-ole/go-ole/ienumvariant_windows.go b/vendor/github.com/go-ole/go-ole/ienumvariant_windows.go new file mode 100644 index 000000000..4781f3b8b --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/ienumvariant_windows.go @@ -0,0 +1,63 @@ +// +build windows + +package ole + +import ( + "syscall" + "unsafe" +) + +func (enum *IEnumVARIANT) Clone() (cloned *IEnumVARIANT, err error) { + hr, _, _ := syscall.Syscall( + enum.VTable().Clone, + 2, + uintptr(unsafe.Pointer(enum)), + uintptr(unsafe.Pointer(&cloned)), + 0) + if hr != 0 { + err = NewError(hr) + } + return +} + +func (enum *IEnumVARIANT) Reset() (err error) { + hr, _, _ := syscall.Syscall( + enum.VTable().Reset, + 1, + uintptr(unsafe.Pointer(enum)), + 0, + 0) + if hr != 0 { + err = NewError(hr) + } + return +} + +func (enum *IEnumVARIANT) Skip(celt uint) (err error) { + hr, _, _ := syscall.Syscall( + enum.VTable().Skip, + 2, + uintptr(unsafe.Pointer(enum)), + uintptr(celt), + 0) + if hr != 0 { + err = NewError(hr) + } + return +} + +func (enum *IEnumVARIANT) Next(celt uint) (array VARIANT, length uint, err error) { + hr, _, _ := syscall.Syscall6( + enum.VTable().Next, + 4, + uintptr(unsafe.Pointer(enum)), + uintptr(celt), + uintptr(unsafe.Pointer(&array)), + uintptr(unsafe.Pointer(&length)), + 0, + 0) + if hr != 0 { + err = NewError(hr) + } + return +} diff --git a/vendor/github.com/go-ole/go-ole/iinspectable.go b/vendor/github.com/go-ole/go-ole/iinspectable.go new file mode 100644 index 000000000..f4a19e253 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iinspectable.go @@ -0,0 +1,18 @@ +package ole + +import "unsafe" + +type IInspectable struct { + IUnknown +} + +type IInspectableVtbl struct { + IUnknownVtbl + GetIIds uintptr + GetRuntimeClassName uintptr + GetTrustLevel uintptr +} + +func (v *IInspectable) VTable() *IInspectableVtbl { + return (*IInspectableVtbl)(unsafe.Pointer(v.RawVTable)) +} diff --git a/vendor/github.com/go-ole/go-ole/iinspectable_func.go b/vendor/github.com/go-ole/go-ole/iinspectable_func.go new file mode 100644 index 000000000..348829bf0 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iinspectable_func.go @@ -0,0 +1,15 @@ +// +build !windows + +package ole + +func (v *IInspectable) GetIids() ([]*GUID, error) { + return []*GUID{}, NewError(E_NOTIMPL) +} + +func (v *IInspectable) GetRuntimeClassName() (string, error) { + return "", NewError(E_NOTIMPL) +} + +func (v *IInspectable) GetTrustLevel() (uint32, error) { + return uint32(0), NewError(E_NOTIMPL) +} diff --git a/vendor/github.com/go-ole/go-ole/iinspectable_windows.go b/vendor/github.com/go-ole/go-ole/iinspectable_windows.go new file mode 100644 index 000000000..4519a4aa4 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iinspectable_windows.go @@ -0,0 +1,72 @@ +// +build windows + +package ole + +import ( + "bytes" + "encoding/binary" + "reflect" + "syscall" + "unsafe" +) + +func (v *IInspectable) GetIids() (iids []*GUID, err error) { + var count uint32 + var array uintptr + hr, _, _ := syscall.Syscall( + v.VTable().GetIIds, + 3, + uintptr(unsafe.Pointer(v)), + uintptr(unsafe.Pointer(&count)), + uintptr(unsafe.Pointer(&array))) + if hr != 0 { + err = NewError(hr) + return + } + defer CoTaskMemFree(array) + + iids = make([]*GUID, count) + byteCount := count * uint32(unsafe.Sizeof(GUID{})) + slicehdr := reflect.SliceHeader{Data: array, Len: int(byteCount), Cap: int(byteCount)} + byteSlice := *(*[]byte)(unsafe.Pointer(&slicehdr)) + reader := bytes.NewReader(byteSlice) + for i := range iids { + guid := GUID{} + err = binary.Read(reader, binary.LittleEndian, &guid) + if err != nil { + return + } + iids[i] = &guid + } + return +} + +func (v *IInspectable) GetRuntimeClassName() (s string, err error) { + var hstring HString + hr, _, _ := syscall.Syscall( + v.VTable().GetRuntimeClassName, + 2, + uintptr(unsafe.Pointer(v)), + uintptr(unsafe.Pointer(&hstring)), + 0) + if hr != 0 { + err = NewError(hr) + return + } + s = hstring.String() + DeleteHString(hstring) + return +} + +func (v *IInspectable) GetTrustLevel() (level uint32, err error) { + hr, _, _ := syscall.Syscall( + v.VTable().GetTrustLevel, + 2, + uintptr(unsafe.Pointer(v)), + uintptr(unsafe.Pointer(&level)), + 0) + if hr != 0 { + err = NewError(hr) + } + return +} diff --git a/vendor/github.com/go-ole/go-ole/iprovideclassinfo.go b/vendor/github.com/go-ole/go-ole/iprovideclassinfo.go new file mode 100644 index 000000000..25f3a6f24 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iprovideclassinfo.go @@ -0,0 +1,21 @@ +package ole + +import "unsafe" + +type IProvideClassInfo struct { + IUnknown +} + +type IProvideClassInfoVtbl struct { + IUnknownVtbl + GetClassInfo uintptr +} + +func (v *IProvideClassInfo) VTable() *IProvideClassInfoVtbl { + return (*IProvideClassInfoVtbl)(unsafe.Pointer(v.RawVTable)) +} + +func (v *IProvideClassInfo) GetClassInfo() (cinfo *ITypeInfo, err error) { + cinfo, err = getClassInfo(v) + return +} diff --git a/vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go b/vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go new file mode 100644 index 000000000..7e3cb63ea --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go @@ -0,0 +1,7 @@ +// +build !windows + +package ole + +func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { + return nil, NewError(E_NOTIMPL) +} diff --git a/vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go b/vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go new file mode 100644 index 000000000..2ad016394 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go @@ -0,0 +1,21 @@ +// +build windows + +package ole + +import ( + "syscall" + "unsafe" +) + +func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { + hr, _, _ := syscall.Syscall( + disp.VTable().GetClassInfo, + 2, + uintptr(unsafe.Pointer(disp)), + uintptr(unsafe.Pointer(&tinfo)), + 0) + if hr != 0 { + err = NewError(hr) + } + return +} diff --git a/vendor/github.com/go-ole/go-ole/itypeinfo.go b/vendor/github.com/go-ole/go-ole/itypeinfo.go new file mode 100644 index 000000000..dd3c5e21b --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/itypeinfo.go @@ -0,0 +1,34 @@ +package ole + +import "unsafe" + +type ITypeInfo struct { + IUnknown +} + +type ITypeInfoVtbl struct { + IUnknownVtbl + GetTypeAttr uintptr + GetTypeComp uintptr + GetFuncDesc uintptr + GetVarDesc uintptr + GetNames uintptr + GetRefTypeOfImplType uintptr + GetImplTypeFlags uintptr + GetIDsOfNames uintptr + Invoke uintptr + GetDocumentation uintptr + GetDllEntry uintptr + GetRefTypeInfo uintptr + AddressOfMember uintptr + CreateInstance uintptr + GetMops uintptr + GetContainingTypeLib uintptr + ReleaseTypeAttr uintptr + ReleaseFuncDesc uintptr + ReleaseVarDesc uintptr +} + +func (v *ITypeInfo) VTable() *ITypeInfoVtbl { + return (*ITypeInfoVtbl)(unsafe.Pointer(v.RawVTable)) +} diff --git a/vendor/github.com/go-ole/go-ole/itypeinfo_func.go b/vendor/github.com/go-ole/go-ole/itypeinfo_func.go new file mode 100644 index 000000000..8364a659b --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/itypeinfo_func.go @@ -0,0 +1,7 @@ +// +build !windows + +package ole + +func (v *ITypeInfo) GetTypeAttr() (*TYPEATTR, error) { + return nil, NewError(E_NOTIMPL) +} diff --git a/vendor/github.com/go-ole/go-ole/itypeinfo_windows.go b/vendor/github.com/go-ole/go-ole/itypeinfo_windows.go new file mode 100644 index 000000000..54782b3da --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/itypeinfo_windows.go @@ -0,0 +1,21 @@ +// +build windows + +package ole + +import ( + "syscall" + "unsafe" +) + +func (v *ITypeInfo) GetTypeAttr() (tattr *TYPEATTR, err error) { + hr, _, _ := syscall.Syscall( + uintptr(v.VTable().GetTypeAttr), + 2, + uintptr(unsafe.Pointer(v)), + uintptr(unsafe.Pointer(&tattr)), + 0) + if hr != 0 { + err = NewError(hr) + } + return +} diff --git a/vendor/github.com/go-ole/go-ole/iunknown.go b/vendor/github.com/go-ole/go-ole/iunknown.go new file mode 100644 index 000000000..108f28ea6 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iunknown.go @@ -0,0 +1,57 @@ +package ole + +import "unsafe" + +type IUnknown struct { + RawVTable *interface{} +} + +type IUnknownVtbl struct { + QueryInterface uintptr + AddRef uintptr + Release uintptr +} + +type UnknownLike interface { + QueryInterface(iid *GUID) (disp *IDispatch, err error) + AddRef() int32 + Release() int32 +} + +func (v *IUnknown) VTable() *IUnknownVtbl { + return (*IUnknownVtbl)(unsafe.Pointer(v.RawVTable)) +} + +func (v *IUnknown) PutQueryInterface(interfaceID *GUID, obj interface{}) error { + return reflectQueryInterface(v, v.VTable().QueryInterface, interfaceID, obj) +} + +func (v *IUnknown) IDispatch(interfaceID *GUID) (dispatch *IDispatch, err error) { + err = v.PutQueryInterface(interfaceID, &dispatch) + return +} + +func (v *IUnknown) IEnumVARIANT(interfaceID *GUID) (enum *IEnumVARIANT, err error) { + err = v.PutQueryInterface(interfaceID, &enum) + return +} + +func (v *IUnknown) QueryInterface(iid *GUID) (*IDispatch, error) { + return queryInterface(v, iid) +} + +func (v *IUnknown) MustQueryInterface(iid *GUID) (disp *IDispatch) { + unk, err := queryInterface(v, iid) + if err != nil { + panic(err) + } + return unk +} + +func (v *IUnknown) AddRef() int32 { + return addRef(v) +} + +func (v *IUnknown) Release() int32 { + return release(v) +} diff --git a/vendor/github.com/go-ole/go-ole/iunknown_func.go b/vendor/github.com/go-ole/go-ole/iunknown_func.go new file mode 100644 index 000000000..d0a62cfd7 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iunknown_func.go @@ -0,0 +1,19 @@ +// +build !windows + +package ole + +func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) { + return NewError(E_NOTIMPL) +} + +func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) { + return nil, NewError(E_NOTIMPL) +} + +func addRef(unk *IUnknown) int32 { + return 0 +} + +func release(unk *IUnknown) int32 { + return 0 +} diff --git a/vendor/github.com/go-ole/go-ole/iunknown_windows.go b/vendor/github.com/go-ole/go-ole/iunknown_windows.go new file mode 100644 index 000000000..ede5bb8c1 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/iunknown_windows.go @@ -0,0 +1,58 @@ +// +build windows + +package ole + +import ( + "reflect" + "syscall" + "unsafe" +) + +func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) { + selfValue := reflect.ValueOf(self).Elem() + objValue := reflect.ValueOf(obj).Elem() + + hr, _, _ := syscall.Syscall( + method, + 3, + selfValue.UnsafeAddr(), + uintptr(unsafe.Pointer(interfaceID)), + objValue.Addr().Pointer()) + if hr != 0 { + err = NewError(hr) + } + return +} + +func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) { + hr, _, _ := syscall.Syscall( + unk.VTable().QueryInterface, + 3, + uintptr(unsafe.Pointer(unk)), + uintptr(unsafe.Pointer(iid)), + uintptr(unsafe.Pointer(&disp))) + if hr != 0 { + err = NewError(hr) + } + return +} + +func addRef(unk *IUnknown) int32 { + ret, _, _ := syscall.Syscall( + unk.VTable().AddRef, + 1, + uintptr(unsafe.Pointer(unk)), + 0, + 0) + return int32(ret) +} + +func release(unk *IUnknown) int32 { + ret, _, _ := syscall.Syscall( + unk.VTable().Release, + 1, + uintptr(unsafe.Pointer(unk)), + 0, + 0) + return int32(ret) +} diff --git a/vendor/github.com/go-ole/go-ole/ole.go b/vendor/github.com/go-ole/go-ole/ole.go new file mode 100644 index 000000000..dbd132bbd --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/ole.go @@ -0,0 +1,190 @@ +package ole + +import ( + "fmt" + "strings" + "unsafe" +) + +// DISPPARAMS are the arguments that passed to methods or property. +type DISPPARAMS struct { + rgvarg uintptr + rgdispidNamedArgs uintptr + cArgs uint32 + cNamedArgs uint32 +} + +// EXCEPINFO defines exception info. +type EXCEPINFO struct { + wCode uint16 + wReserved uint16 + bstrSource *uint16 + bstrDescription *uint16 + bstrHelpFile *uint16 + dwHelpContext uint32 + pvReserved uintptr + pfnDeferredFillIn uintptr + scode uint32 + + // Go-specific part. Don't move upper cos it'll break structure layout for native code. + rendered bool + source string + description string + helpFile string +} + +// renderStrings translates BSTR strings to Go ones so `.Error` and `.String` +// could be safely called after `.Clear`. We need this when we can't rely on +// a caller to call `.Clear`. +func (e *EXCEPINFO) renderStrings() { + e.rendered = true + if e.bstrSource == nil { + e.source = "" + } else { + e.source = BstrToString(e.bstrSource) + } + if e.bstrDescription == nil { + e.description = "" + } else { + e.description = BstrToString(e.bstrDescription) + } + if e.bstrHelpFile == nil { + e.helpFile = "" + } else { + e.helpFile = BstrToString(e.bstrHelpFile) + } +} + +// Clear frees BSTR strings inside an EXCEPINFO and set it to NULL. +func (e *EXCEPINFO) Clear() { + freeBSTR := func(s *uint16) { + // SysFreeString don't return errors and is safe for call's on NULL. + // https://docs.microsoft.com/en-us/windows/win32/api/oleauto/nf-oleauto-sysfreestring + _ = SysFreeString((*int16)(unsafe.Pointer(s))) + } + + if e.bstrSource != nil { + freeBSTR(e.bstrSource) + e.bstrSource = nil + } + if e.bstrDescription != nil { + freeBSTR(e.bstrDescription) + e.bstrDescription = nil + } + if e.bstrHelpFile != nil { + freeBSTR(e.bstrHelpFile) + e.bstrHelpFile = nil + } +} + +// WCode return wCode in EXCEPINFO. +func (e EXCEPINFO) WCode() uint16 { + return e.wCode +} + +// SCODE return scode in EXCEPINFO. +func (e EXCEPINFO) SCODE() uint32 { + return e.scode +} + +// String convert EXCEPINFO to string. +func (e EXCEPINFO) String() string { + if !e.rendered { + e.renderStrings() + } + return fmt.Sprintf( + "wCode: %#x, bstrSource: %v, bstrDescription: %v, bstrHelpFile: %v, dwHelpContext: %#x, scode: %#x", + e.wCode, e.source, e.description, e.helpFile, e.dwHelpContext, e.scode, + ) +} + +// Error implements error interface and returns error string. +func (e EXCEPINFO) Error() string { + if !e.rendered { + e.renderStrings() + } + + if e.description != "" { + return strings.TrimSpace(e.description) + } + + code := e.scode + if e.wCode != 0 { + code = uint32(e.wCode) + } + return fmt.Sprintf("%v: %#x", e.source, code) +} + +// PARAMDATA defines parameter data type. +type PARAMDATA struct { + Name *int16 + Vt uint16 +} + +// METHODDATA defines method info. +type METHODDATA struct { + Name *uint16 + Data *PARAMDATA + Dispid int32 + Meth uint32 + CC int32 + CArgs uint32 + Flags uint16 + VtReturn uint32 +} + +// INTERFACEDATA defines interface info. +type INTERFACEDATA struct { + MethodData *METHODDATA + CMembers uint32 +} + +// Point is 2D vector type. +type Point struct { + X int32 + Y int32 +} + +// Msg is message between processes. +type Msg struct { + Hwnd uint32 + Message uint32 + Wparam int32 + Lparam int32 + Time uint32 + Pt Point +} + +// TYPEDESC defines data type. +type TYPEDESC struct { + Hreftype uint32 + VT uint16 +} + +// IDLDESC defines IDL info. +type IDLDESC struct { + DwReserved uint32 + WIDLFlags uint16 +} + +// TYPEATTR defines type info. +type TYPEATTR struct { + Guid GUID + Lcid uint32 + dwReserved uint32 + MemidConstructor int32 + MemidDestructor int32 + LpstrSchema *uint16 + CbSizeInstance uint32 + Typekind int32 + CFuncs uint16 + CVars uint16 + CImplTypes uint16 + CbSizeVft uint16 + CbAlignment uint16 + WTypeFlags uint16 + WMajorVerNum uint16 + WMinorVerNum uint16 + TdescAlias TYPEDESC + IdldescType IDLDESC +} diff --git a/vendor/github.com/go-ole/go-ole/oleutil/connection.go b/vendor/github.com/go-ole/go-ole/oleutil/connection.go new file mode 100644 index 000000000..60df73cda --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/oleutil/connection.go @@ -0,0 +1,100 @@ +// +build windows + +package oleutil + +import ( + "reflect" + "unsafe" + + ole "github.com/go-ole/go-ole" +) + +type stdDispatch struct { + lpVtbl *stdDispatchVtbl + ref int32 + iid *ole.GUID + iface interface{} + funcMap map[string]int32 +} + +type stdDispatchVtbl struct { + pQueryInterface uintptr + pAddRef uintptr + pRelease uintptr + pGetTypeInfoCount uintptr + pGetTypeInfo uintptr + pGetIDsOfNames uintptr + pInvoke uintptr +} + +func dispQueryInterface(this *ole.IUnknown, iid *ole.GUID, punk **ole.IUnknown) uint32 { + pthis := (*stdDispatch)(unsafe.Pointer(this)) + *punk = nil + if ole.IsEqualGUID(iid, ole.IID_IUnknown) || + ole.IsEqualGUID(iid, ole.IID_IDispatch) { + dispAddRef(this) + *punk = this + return ole.S_OK + } + if ole.IsEqualGUID(iid, pthis.iid) { + dispAddRef(this) + *punk = this + return ole.S_OK + } + return ole.E_NOINTERFACE +} + +func dispAddRef(this *ole.IUnknown) int32 { + pthis := (*stdDispatch)(unsafe.Pointer(this)) + pthis.ref++ + return pthis.ref +} + +func dispRelease(this *ole.IUnknown) int32 { + pthis := (*stdDispatch)(unsafe.Pointer(this)) + pthis.ref-- + return pthis.ref +} + +func dispGetIDsOfNames(this *ole.IUnknown, iid *ole.GUID, wnames []*uint16, namelen int, lcid int, pdisp []int32) uintptr { + pthis := (*stdDispatch)(unsafe.Pointer(this)) + names := make([]string, len(wnames)) + for i := 0; i < len(names); i++ { + names[i] = ole.LpOleStrToString(wnames[i]) + } + for n := 0; n < namelen; n++ { + if id, ok := pthis.funcMap[names[n]]; ok { + pdisp[n] = id + } + } + return ole.S_OK +} + +func dispGetTypeInfoCount(pcount *int) uintptr { + if pcount != nil { + *pcount = 0 + } + return ole.S_OK +} + +func dispGetTypeInfo(ptypeif *uintptr) uintptr { + return ole.E_NOTIMPL +} + +func dispInvoke(this *ole.IDispatch, dispid int32, riid *ole.GUID, lcid int, flags int16, dispparams *ole.DISPPARAMS, result *ole.VARIANT, pexcepinfo *ole.EXCEPINFO, nerr *uint) uintptr { + pthis := (*stdDispatch)(unsafe.Pointer(this)) + found := "" + for name, id := range pthis.funcMap { + if id == dispid { + found = name + } + } + if found != "" { + rv := reflect.ValueOf(pthis.iface).Elem() + rm := rv.MethodByName(found) + rr := rm.Call([]reflect.Value{}) + println(len(rr)) + return ole.S_OK + } + return ole.E_NOTIMPL +} diff --git a/vendor/github.com/go-ole/go-ole/oleutil/connection_func.go b/vendor/github.com/go-ole/go-ole/oleutil/connection_func.go new file mode 100644 index 000000000..8818fb827 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/oleutil/connection_func.go @@ -0,0 +1,10 @@ +// +build !windows + +package oleutil + +import ole "github.com/go-ole/go-ole" + +// ConnectObject creates a connection point between two services for communication. +func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (uint32, error) { + return 0, ole.NewError(ole.E_NOTIMPL) +} diff --git a/vendor/github.com/go-ole/go-ole/oleutil/connection_windows.go b/vendor/github.com/go-ole/go-ole/oleutil/connection_windows.go new file mode 100644 index 000000000..ab9c0d8dc --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/oleutil/connection_windows.go @@ -0,0 +1,58 @@ +// +build windows + +package oleutil + +import ( + "reflect" + "syscall" + "unsafe" + + ole "github.com/go-ole/go-ole" +) + +// ConnectObject creates a connection point between two services for communication. +func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (cookie uint32, err error) { + unknown, err := disp.QueryInterface(ole.IID_IConnectionPointContainer) + if err != nil { + return + } + + container := (*ole.IConnectionPointContainer)(unsafe.Pointer(unknown)) + var point *ole.IConnectionPoint + err = container.FindConnectionPoint(iid, &point) + if err != nil { + return + } + if edisp, ok := idisp.(*ole.IUnknown); ok { + cookie, err = point.Advise(edisp) + container.Release() + if err != nil { + return + } + } + rv := reflect.ValueOf(disp).Elem() + if rv.Type().Kind() == reflect.Struct { + dest := &stdDispatch{} + dest.lpVtbl = &stdDispatchVtbl{} + dest.lpVtbl.pQueryInterface = syscall.NewCallback(dispQueryInterface) + dest.lpVtbl.pAddRef = syscall.NewCallback(dispAddRef) + dest.lpVtbl.pRelease = syscall.NewCallback(dispRelease) + dest.lpVtbl.pGetTypeInfoCount = syscall.NewCallback(dispGetTypeInfoCount) + dest.lpVtbl.pGetTypeInfo = syscall.NewCallback(dispGetTypeInfo) + dest.lpVtbl.pGetIDsOfNames = syscall.NewCallback(dispGetIDsOfNames) + dest.lpVtbl.pInvoke = syscall.NewCallback(dispInvoke) + dest.iface = disp + dest.iid = iid + cookie, err = point.Advise((*ole.IUnknown)(unsafe.Pointer(dest))) + container.Release() + if err != nil { + point.Release() + return + } + return + } + + container.Release() + + return 0, ole.NewError(ole.E_INVALIDARG) +} diff --git a/vendor/github.com/go-ole/go-ole/oleutil/go-get.go b/vendor/github.com/go-ole/go-ole/oleutil/go-get.go new file mode 100644 index 000000000..58347628f --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/oleutil/go-get.go @@ -0,0 +1,6 @@ +// This file is here so go get succeeds as without it errors with: +// no buildable Go source files in ... +// +// +build !windows + +package oleutil diff --git a/vendor/github.com/go-ole/go-ole/oleutil/oleutil.go b/vendor/github.com/go-ole/go-ole/oleutil/oleutil.go new file mode 100644 index 000000000..f7803c1e3 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/oleutil/oleutil.go @@ -0,0 +1,127 @@ +package oleutil + +import ole "github.com/go-ole/go-ole" + +// ClassIDFrom retrieves class ID whether given is program ID or application string. +func ClassIDFrom(programID string) (classID *ole.GUID, err error) { + return ole.ClassIDFrom(programID) +} + +// CreateObject creates object from programID based on interface type. +// +// Only supports IUnknown. +// +// Program ID can be either program ID or application string. +func CreateObject(programID string) (unknown *ole.IUnknown, err error) { + classID, err := ole.ClassIDFrom(programID) + if err != nil { + return + } + + unknown, err = ole.CreateInstance(classID, ole.IID_IUnknown) + if err != nil { + return + } + + return +} + +// GetActiveObject retrieves active object for program ID and interface ID based +// on interface type. +// +// Only supports IUnknown. +// +// Program ID can be either program ID or application string. +func GetActiveObject(programID string) (unknown *ole.IUnknown, err error) { + classID, err := ole.ClassIDFrom(programID) + if err != nil { + return + } + + unknown, err = ole.GetActiveObject(classID, ole.IID_IUnknown) + if err != nil { + return + } + + return +} + +// CallMethod calls method on IDispatch with parameters. +func CallMethod(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) { + return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_METHOD, params) +} + +// MustCallMethod calls method on IDispatch with parameters or panics. +func MustCallMethod(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT) { + r, err := CallMethod(disp, name, params...) + if err != nil { + panic(err.Error()) + } + return r +} + +// GetProperty retrieves property from IDispatch. +func GetProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) { + return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_PROPERTYGET, params) +} + +// MustGetProperty retrieves property from IDispatch or panics. +func MustGetProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT) { + r, err := GetProperty(disp, name, params...) + if err != nil { + panic(err.Error()) + } + return r +} + +// PutProperty mutates property. +func PutProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) { + return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_PROPERTYPUT, params) +} + +// MustPutProperty mutates property or panics. +func MustPutProperty(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT) { + r, err := PutProperty(disp, name, params...) + if err != nil { + panic(err.Error()) + } + return r +} + +// PutPropertyRef mutates property reference. +func PutPropertyRef(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT, err error) { + return disp.InvokeWithOptionalArgs(name, ole.DISPATCH_PROPERTYPUTREF, params) +} + +// MustPutPropertyRef mutates property reference or panics. +func MustPutPropertyRef(disp *ole.IDispatch, name string, params ...interface{}) (result *ole.VARIANT) { + r, err := PutPropertyRef(disp, name, params...) + if err != nil { + panic(err.Error()) + } + return r +} + +func ForEach(disp *ole.IDispatch, f func(v *ole.VARIANT) error) error { + newEnum, err := disp.GetProperty("_NewEnum") + if err != nil { + return err + } + defer newEnum.Clear() + + enum, err := newEnum.ToIUnknown().IEnumVARIANT(ole.IID_IEnumVariant) + if err != nil { + return err + } + defer enum.Release() + + for item, length, err := enum.Next(1); length > 0; item, length, err = enum.Next(1) { + if err != nil { + return err + } + if ferr := f(&item); ferr != nil { + return ferr + } + } + return nil +} diff --git a/vendor/github.com/go-ole/go-ole/safearray.go b/vendor/github.com/go-ole/go-ole/safearray.go new file mode 100644 index 000000000..a5201b56c --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/safearray.go @@ -0,0 +1,27 @@ +// Package is meant to retrieve and process safe array data returned from COM. + +package ole + +// SafeArrayBound defines the SafeArray boundaries. +type SafeArrayBound struct { + Elements uint32 + LowerBound int32 +} + +// SafeArray is how COM handles arrays. +type SafeArray struct { + Dimensions uint16 + FeaturesFlag uint16 + ElementsSize uint32 + LocksAmount uint32 + Data uint32 + Bounds [16]byte +} + +// SAFEARRAY is obsolete, exists for backwards compatibility. +// Use SafeArray +type SAFEARRAY SafeArray + +// SAFEARRAYBOUND is obsolete, exists for backwards compatibility. +// Use SafeArrayBound +type SAFEARRAYBOUND SafeArrayBound diff --git a/vendor/github.com/go-ole/go-ole/safearray_func.go b/vendor/github.com/go-ole/go-ole/safearray_func.go new file mode 100644 index 000000000..0dee670ce --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/safearray_func.go @@ -0,0 +1,211 @@ +// +build !windows + +package ole + +import ( + "unsafe" +) + +// safeArrayAccessData returns raw array pointer. +// +// AKA: SafeArrayAccessData in Windows API. +func safeArrayAccessData(safearray *SafeArray) (uintptr, error) { + return uintptr(0), NewError(E_NOTIMPL) +} + +// safeArrayUnaccessData releases raw array. +// +// AKA: SafeArrayUnaccessData in Windows API. +func safeArrayUnaccessData(safearray *SafeArray) error { + return NewError(E_NOTIMPL) +} + +// safeArrayAllocData allocates SafeArray. +// +// AKA: SafeArrayAllocData in Windows API. +func safeArrayAllocData(safearray *SafeArray) error { + return NewError(E_NOTIMPL) +} + +// safeArrayAllocDescriptor allocates SafeArray. +// +// AKA: SafeArrayAllocDescriptor in Windows API. +func safeArrayAllocDescriptor(dimensions uint32) (*SafeArray, error) { + return nil, NewError(E_NOTIMPL) +} + +// safeArrayAllocDescriptorEx allocates SafeArray. +// +// AKA: SafeArrayAllocDescriptorEx in Windows API. +func safeArrayAllocDescriptorEx(variantType VT, dimensions uint32) (*SafeArray, error) { + return nil, NewError(E_NOTIMPL) +} + +// safeArrayCopy returns copy of SafeArray. +// +// AKA: SafeArrayCopy in Windows API. +func safeArrayCopy(original *SafeArray) (*SafeArray, error) { + return nil, NewError(E_NOTIMPL) +} + +// safeArrayCopyData duplicates SafeArray into another SafeArray object. +// +// AKA: SafeArrayCopyData in Windows API. +func safeArrayCopyData(original *SafeArray, duplicate *SafeArray) error { + return NewError(E_NOTIMPL) +} + +// safeArrayCreate creates SafeArray. +// +// AKA: SafeArrayCreate in Windows API. +func safeArrayCreate(variantType VT, dimensions uint32, bounds *SafeArrayBound) (*SafeArray, error) { + return nil, NewError(E_NOTIMPL) +} + +// safeArrayCreateEx creates SafeArray. +// +// AKA: SafeArrayCreateEx in Windows API. +func safeArrayCreateEx(variantType VT, dimensions uint32, bounds *SafeArrayBound, extra uintptr) (*SafeArray, error) { + return nil, NewError(E_NOTIMPL) +} + +// safeArrayCreateVector creates SafeArray. +// +// AKA: SafeArrayCreateVector in Windows API. +func safeArrayCreateVector(variantType VT, lowerBound int32, length uint32) (*SafeArray, error) { + return nil, NewError(E_NOTIMPL) +} + +// safeArrayCreateVectorEx creates SafeArray. +// +// AKA: SafeArrayCreateVectorEx in Windows API. +func safeArrayCreateVectorEx(variantType VT, lowerBound int32, length uint32, extra uintptr) (*SafeArray, error) { + return nil, NewError(E_NOTIMPL) +} + +// safeArrayDestroy destroys SafeArray object. +// +// AKA: SafeArrayDestroy in Windows API. +func safeArrayDestroy(safearray *SafeArray) error { + return NewError(E_NOTIMPL) +} + +// safeArrayDestroyData destroys SafeArray object. +// +// AKA: SafeArrayDestroyData in Windows API. +func safeArrayDestroyData(safearray *SafeArray) error { + return NewError(E_NOTIMPL) +} + +// safeArrayDestroyDescriptor destroys SafeArray object. +// +// AKA: SafeArrayDestroyDescriptor in Windows API. +func safeArrayDestroyDescriptor(safearray *SafeArray) error { + return NewError(E_NOTIMPL) +} + +// safeArrayGetDim is the amount of dimensions in the SafeArray. +// +// SafeArrays may have multiple dimensions. Meaning, it could be +// multidimensional array. +// +// AKA: SafeArrayGetDim in Windows API. +func safeArrayGetDim(safearray *SafeArray) (*uint32, error) { + u := uint32(0) + return &u, NewError(E_NOTIMPL) +} + +// safeArrayGetElementSize is the element size in bytes. +// +// AKA: SafeArrayGetElemsize in Windows API. +func safeArrayGetElementSize(safearray *SafeArray) (*uint32, error) { + u := uint32(0) + return &u, NewError(E_NOTIMPL) +} + +// safeArrayGetElement retrieves element at given index. +func safeArrayGetElement(safearray *SafeArray, index int32, pv unsafe.Pointer) error { + return NewError(E_NOTIMPL) +} + +// safeArrayGetElement retrieves element at given index and converts to string. +func safeArrayGetElementString(safearray *SafeArray, index int32) (string, error) { + return "", NewError(E_NOTIMPL) +} + +// safeArrayGetIID is the InterfaceID of the elements in the SafeArray. +// +// AKA: SafeArrayGetIID in Windows API. +func safeArrayGetIID(safearray *SafeArray) (*GUID, error) { + return nil, NewError(E_NOTIMPL) +} + +// safeArrayGetLBound returns lower bounds of SafeArray. +// +// SafeArrays may have multiple dimensions. Meaning, it could be +// multidimensional array. +// +// AKA: SafeArrayGetLBound in Windows API. +func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (int32, error) { + return int32(0), NewError(E_NOTIMPL) +} + +// safeArrayGetUBound returns upper bounds of SafeArray. +// +// SafeArrays may have multiple dimensions. Meaning, it could be +// multidimensional array. +// +// AKA: SafeArrayGetUBound in Windows API. +func safeArrayGetUBound(safearray *SafeArray, dimension uint32) (int32, error) { + return int32(0), NewError(E_NOTIMPL) +} + +// safeArrayGetVartype returns data type of SafeArray. +// +// AKA: SafeArrayGetVartype in Windows API. +func safeArrayGetVartype(safearray *SafeArray) (uint16, error) { + return uint16(0), NewError(E_NOTIMPL) +} + +// safeArrayLock locks SafeArray for reading to modify SafeArray. +// +// This must be called during some calls to ensure that another process does not +// read or write to the SafeArray during editing. +// +// AKA: SafeArrayLock in Windows API. +func safeArrayLock(safearray *SafeArray) error { + return NewError(E_NOTIMPL) +} + +// safeArrayUnlock unlocks SafeArray for reading. +// +// AKA: SafeArrayUnlock in Windows API. +func safeArrayUnlock(safearray *SafeArray) error { + return NewError(E_NOTIMPL) +} + +// safeArrayPutElement stores the data element at the specified location in the +// array. +// +// AKA: SafeArrayPutElement in Windows API. +func safeArrayPutElement(safearray *SafeArray, index int64, element uintptr) error { + return NewError(E_NOTIMPL) +} + +// safeArrayGetRecordInfo accesses IRecordInfo info for custom types. +// +// AKA: SafeArrayGetRecordInfo in Windows API. +// +// XXX: Must implement IRecordInfo interface for this to return. +func safeArrayGetRecordInfo(safearray *SafeArray) (interface{}, error) { + return nil, NewError(E_NOTIMPL) +} + +// safeArraySetRecordInfo mutates IRecordInfo info for custom types. +// +// AKA: SafeArraySetRecordInfo in Windows API. +// +// XXX: Must implement IRecordInfo interface for this to return. +func safeArraySetRecordInfo(safearray *SafeArray, recordInfo interface{}) error { + return NewError(E_NOTIMPL) +} diff --git a/vendor/github.com/go-ole/go-ole/safearray_windows.go b/vendor/github.com/go-ole/go-ole/safearray_windows.go new file mode 100644 index 000000000..0c1b3a10f --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/safearray_windows.go @@ -0,0 +1,337 @@ +// +build windows + +package ole + +import ( + "unsafe" +) + +var ( + procSafeArrayAccessData = modoleaut32.NewProc("SafeArrayAccessData") + procSafeArrayAllocData = modoleaut32.NewProc("SafeArrayAllocData") + procSafeArrayAllocDescriptor = modoleaut32.NewProc("SafeArrayAllocDescriptor") + procSafeArrayAllocDescriptorEx = modoleaut32.NewProc("SafeArrayAllocDescriptorEx") + procSafeArrayCopy = modoleaut32.NewProc("SafeArrayCopy") + procSafeArrayCopyData = modoleaut32.NewProc("SafeArrayCopyData") + procSafeArrayCreate = modoleaut32.NewProc("SafeArrayCreate") + procSafeArrayCreateEx = modoleaut32.NewProc("SafeArrayCreateEx") + procSafeArrayCreateVector = modoleaut32.NewProc("SafeArrayCreateVector") + procSafeArrayCreateVectorEx = modoleaut32.NewProc("SafeArrayCreateVectorEx") + procSafeArrayDestroy = modoleaut32.NewProc("SafeArrayDestroy") + procSafeArrayDestroyData = modoleaut32.NewProc("SafeArrayDestroyData") + procSafeArrayDestroyDescriptor = modoleaut32.NewProc("SafeArrayDestroyDescriptor") + procSafeArrayGetDim = modoleaut32.NewProc("SafeArrayGetDim") + procSafeArrayGetElement = modoleaut32.NewProc("SafeArrayGetElement") + procSafeArrayGetElemsize = modoleaut32.NewProc("SafeArrayGetElemsize") + procSafeArrayGetIID = modoleaut32.NewProc("SafeArrayGetIID") + procSafeArrayGetLBound = modoleaut32.NewProc("SafeArrayGetLBound") + procSafeArrayGetUBound = modoleaut32.NewProc("SafeArrayGetUBound") + procSafeArrayGetVartype = modoleaut32.NewProc("SafeArrayGetVartype") + procSafeArrayLock = modoleaut32.NewProc("SafeArrayLock") + procSafeArrayPtrOfIndex = modoleaut32.NewProc("SafeArrayPtrOfIndex") + procSafeArrayUnaccessData = modoleaut32.NewProc("SafeArrayUnaccessData") + procSafeArrayUnlock = modoleaut32.NewProc("SafeArrayUnlock") + procSafeArrayPutElement = modoleaut32.NewProc("SafeArrayPutElement") + //procSafeArrayRedim = modoleaut32.NewProc("SafeArrayRedim") // TODO + //procSafeArraySetIID = modoleaut32.NewProc("SafeArraySetIID") // TODO + procSafeArrayGetRecordInfo = modoleaut32.NewProc("SafeArrayGetRecordInfo") + procSafeArraySetRecordInfo = modoleaut32.NewProc("SafeArraySetRecordInfo") +) + +// safeArrayAccessData returns raw array pointer. +// +// AKA: SafeArrayAccessData in Windows API. +// Todo: Test +func safeArrayAccessData(safearray *SafeArray) (element uintptr, err error) { + err = convertHresultToError( + procSafeArrayAccessData.Call( + uintptr(unsafe.Pointer(safearray)), + uintptr(unsafe.Pointer(&element)))) + return +} + +// safeArrayUnaccessData releases raw array. +// +// AKA: SafeArrayUnaccessData in Windows API. +func safeArrayUnaccessData(safearray *SafeArray) (err error) { + err = convertHresultToError(procSafeArrayUnaccessData.Call(uintptr(unsafe.Pointer(safearray)))) + return +} + +// safeArrayAllocData allocates SafeArray. +// +// AKA: SafeArrayAllocData in Windows API. +func safeArrayAllocData(safearray *SafeArray) (err error) { + err = convertHresultToError(procSafeArrayAllocData.Call(uintptr(unsafe.Pointer(safearray)))) + return +} + +// safeArrayAllocDescriptor allocates SafeArray. +// +// AKA: SafeArrayAllocDescriptor in Windows API. +func safeArrayAllocDescriptor(dimensions uint32) (safearray *SafeArray, err error) { + err = convertHresultToError( + procSafeArrayAllocDescriptor.Call(uintptr(dimensions), uintptr(unsafe.Pointer(&safearray)))) + return +} + +// safeArrayAllocDescriptorEx allocates SafeArray. +// +// AKA: SafeArrayAllocDescriptorEx in Windows API. +func safeArrayAllocDescriptorEx(variantType VT, dimensions uint32) (safearray *SafeArray, err error) { + err = convertHresultToError( + procSafeArrayAllocDescriptorEx.Call( + uintptr(variantType), + uintptr(dimensions), + uintptr(unsafe.Pointer(&safearray)))) + return +} + +// safeArrayCopy returns copy of SafeArray. +// +// AKA: SafeArrayCopy in Windows API. +func safeArrayCopy(original *SafeArray) (safearray *SafeArray, err error) { + err = convertHresultToError( + procSafeArrayCopy.Call( + uintptr(unsafe.Pointer(original)), + uintptr(unsafe.Pointer(&safearray)))) + return +} + +// safeArrayCopyData duplicates SafeArray into another SafeArray object. +// +// AKA: SafeArrayCopyData in Windows API. +func safeArrayCopyData(original *SafeArray, duplicate *SafeArray) (err error) { + err = convertHresultToError( + procSafeArrayCopyData.Call( + uintptr(unsafe.Pointer(original)), + uintptr(unsafe.Pointer(duplicate)))) + return +} + +// safeArrayCreate creates SafeArray. +// +// AKA: SafeArrayCreate in Windows API. +func safeArrayCreate(variantType VT, dimensions uint32, bounds *SafeArrayBound) (safearray *SafeArray, err error) { + sa, _, err := procSafeArrayCreate.Call( + uintptr(variantType), + uintptr(dimensions), + uintptr(unsafe.Pointer(bounds))) + safearray = (*SafeArray)(unsafe.Pointer(&sa)) + return +} + +// safeArrayCreateEx creates SafeArray. +// +// AKA: SafeArrayCreateEx in Windows API. +func safeArrayCreateEx(variantType VT, dimensions uint32, bounds *SafeArrayBound, extra uintptr) (safearray *SafeArray, err error) { + sa, _, err := procSafeArrayCreateEx.Call( + uintptr(variantType), + uintptr(dimensions), + uintptr(unsafe.Pointer(bounds)), + extra) + safearray = (*SafeArray)(unsafe.Pointer(sa)) + return +} + +// safeArrayCreateVector creates SafeArray. +// +// AKA: SafeArrayCreateVector in Windows API. +func safeArrayCreateVector(variantType VT, lowerBound int32, length uint32) (safearray *SafeArray, err error) { + sa, _, err := procSafeArrayCreateVector.Call( + uintptr(variantType), + uintptr(lowerBound), + uintptr(length)) + safearray = (*SafeArray)(unsafe.Pointer(sa)) + return +} + +// safeArrayCreateVectorEx creates SafeArray. +// +// AKA: SafeArrayCreateVectorEx in Windows API. +func safeArrayCreateVectorEx(variantType VT, lowerBound int32, length uint32, extra uintptr) (safearray *SafeArray, err error) { + sa, _, err := procSafeArrayCreateVectorEx.Call( + uintptr(variantType), + uintptr(lowerBound), + uintptr(length), + extra) + safearray = (*SafeArray)(unsafe.Pointer(sa)) + return +} + +// safeArrayDestroy destroys SafeArray object. +// +// AKA: SafeArrayDestroy in Windows API. +func safeArrayDestroy(safearray *SafeArray) (err error) { + err = convertHresultToError(procSafeArrayDestroy.Call(uintptr(unsafe.Pointer(safearray)))) + return +} + +// safeArrayDestroyData destroys SafeArray object. +// +// AKA: SafeArrayDestroyData in Windows API. +func safeArrayDestroyData(safearray *SafeArray) (err error) { + err = convertHresultToError(procSafeArrayDestroyData.Call(uintptr(unsafe.Pointer(safearray)))) + return +} + +// safeArrayDestroyDescriptor destroys SafeArray object. +// +// AKA: SafeArrayDestroyDescriptor in Windows API. +func safeArrayDestroyDescriptor(safearray *SafeArray) (err error) { + err = convertHresultToError(procSafeArrayDestroyDescriptor.Call(uintptr(unsafe.Pointer(safearray)))) + return +} + +// safeArrayGetDim is the amount of dimensions in the SafeArray. +// +// SafeArrays may have multiple dimensions. Meaning, it could be +// multidimensional array. +// +// AKA: SafeArrayGetDim in Windows API. +func safeArrayGetDim(safearray *SafeArray) (dimensions *uint32, err error) { + l, _, err := procSafeArrayGetDim.Call(uintptr(unsafe.Pointer(safearray))) + dimensions = (*uint32)(unsafe.Pointer(l)) + return +} + +// safeArrayGetElementSize is the element size in bytes. +// +// AKA: SafeArrayGetElemsize in Windows API. +func safeArrayGetElementSize(safearray *SafeArray) (length *uint32, err error) { + l, _, err := procSafeArrayGetElemsize.Call(uintptr(unsafe.Pointer(safearray))) + length = (*uint32)(unsafe.Pointer(l)) + return +} + +// safeArrayGetElement retrieves element at given index. +func safeArrayGetElement(safearray *SafeArray, index int32, pv unsafe.Pointer) error { + return convertHresultToError( + procSafeArrayGetElement.Call( + uintptr(unsafe.Pointer(safearray)), + uintptr(unsafe.Pointer(&index)), + uintptr(pv))) +} + +// safeArrayGetElementString retrieves element at given index and converts to string. +func safeArrayGetElementString(safearray *SafeArray, index int32) (str string, err error) { + var element *int16 + err = convertHresultToError( + procSafeArrayGetElement.Call( + uintptr(unsafe.Pointer(safearray)), + uintptr(unsafe.Pointer(&index)), + uintptr(unsafe.Pointer(&element)))) + str = BstrToString(*(**uint16)(unsafe.Pointer(&element))) + SysFreeString(element) + return +} + +// safeArrayGetIID is the InterfaceID of the elements in the SafeArray. +// +// AKA: SafeArrayGetIID in Windows API. +func safeArrayGetIID(safearray *SafeArray) (guid *GUID, err error) { + err = convertHresultToError( + procSafeArrayGetIID.Call( + uintptr(unsafe.Pointer(safearray)), + uintptr(unsafe.Pointer(&guid)))) + return +} + +// safeArrayGetLBound returns lower bounds of SafeArray. +// +// SafeArrays may have multiple dimensions. Meaning, it could be +// multidimensional array. +// +// AKA: SafeArrayGetLBound in Windows API. +func safeArrayGetLBound(safearray *SafeArray, dimension uint32) (lowerBound int32, err error) { + err = convertHresultToError( + procSafeArrayGetLBound.Call( + uintptr(unsafe.Pointer(safearray)), + uintptr(dimension), + uintptr(unsafe.Pointer(&lowerBound)))) + return +} + +// safeArrayGetUBound returns upper bounds of SafeArray. +// +// SafeArrays may have multiple dimensions. Meaning, it could be +// multidimensional array. +// +// AKA: SafeArrayGetUBound in Windows API. +func safeArrayGetUBound(safearray *SafeArray, dimension uint32) (upperBound int32, err error) { + err = convertHresultToError( + procSafeArrayGetUBound.Call( + uintptr(unsafe.Pointer(safearray)), + uintptr(dimension), + uintptr(unsafe.Pointer(&upperBound)))) + return +} + +// safeArrayGetVartype returns data type of SafeArray. +// +// AKA: SafeArrayGetVartype in Windows API. +func safeArrayGetVartype(safearray *SafeArray) (varType uint16, err error) { + err = convertHresultToError( + procSafeArrayGetVartype.Call( + uintptr(unsafe.Pointer(safearray)), + uintptr(unsafe.Pointer(&varType)))) + return +} + +// safeArrayLock locks SafeArray for reading to modify SafeArray. +// +// This must be called during some calls to ensure that another process does not +// read or write to the SafeArray during editing. +// +// AKA: SafeArrayLock in Windows API. +func safeArrayLock(safearray *SafeArray) (err error) { + err = convertHresultToError(procSafeArrayLock.Call(uintptr(unsafe.Pointer(safearray)))) + return +} + +// safeArrayUnlock unlocks SafeArray for reading. +// +// AKA: SafeArrayUnlock in Windows API. +func safeArrayUnlock(safearray *SafeArray) (err error) { + err = convertHresultToError(procSafeArrayUnlock.Call(uintptr(unsafe.Pointer(safearray)))) + return +} + +// safeArrayPutElement stores the data element at the specified location in the +// array. +// +// AKA: SafeArrayPutElement in Windows API. +func safeArrayPutElement(safearray *SafeArray, index int64, element uintptr) (err error) { + err = convertHresultToError( + procSafeArrayPutElement.Call( + uintptr(unsafe.Pointer(safearray)), + uintptr(unsafe.Pointer(&index)), + uintptr(unsafe.Pointer(element)))) + return +} + +// safeArrayGetRecordInfo accesses IRecordInfo info for custom types. +// +// AKA: SafeArrayGetRecordInfo in Windows API. +// +// XXX: Must implement IRecordInfo interface for this to return. +func safeArrayGetRecordInfo(safearray *SafeArray) (recordInfo interface{}, err error) { + err = convertHresultToError( + procSafeArrayGetRecordInfo.Call( + uintptr(unsafe.Pointer(safearray)), + uintptr(unsafe.Pointer(&recordInfo)))) + return +} + +// safeArraySetRecordInfo mutates IRecordInfo info for custom types. +// +// AKA: SafeArraySetRecordInfo in Windows API. +// +// XXX: Must implement IRecordInfo interface for this to return. +func safeArraySetRecordInfo(safearray *SafeArray, recordInfo interface{}) (err error) { + err = convertHresultToError( + procSafeArraySetRecordInfo.Call( + uintptr(unsafe.Pointer(safearray)), + uintptr(unsafe.Pointer(&recordInfo)))) + return +} diff --git a/vendor/github.com/go-ole/go-ole/safearrayconversion.go b/vendor/github.com/go-ole/go-ole/safearrayconversion.go new file mode 100644 index 000000000..da737293d --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/safearrayconversion.go @@ -0,0 +1,140 @@ +// Helper for converting SafeArray to array of objects. + +package ole + +import ( + "unsafe" +) + +type SafeArrayConversion struct { + Array *SafeArray +} + +func (sac *SafeArrayConversion) ToStringArray() (strings []string) { + totalElements, _ := sac.TotalElements(0) + strings = make([]string, totalElements) + + for i := int32(0); i < totalElements; i++ { + strings[int32(i)], _ = safeArrayGetElementString(sac.Array, i) + } + + return +} + +func (sac *SafeArrayConversion) ToByteArray() (bytes []byte) { + totalElements, _ := sac.TotalElements(0) + bytes = make([]byte, totalElements) + + for i := int32(0); i < totalElements; i++ { + safeArrayGetElement(sac.Array, i, unsafe.Pointer(&bytes[int32(i)])) + } + + return +} + +func (sac *SafeArrayConversion) ToValueArray() (values []interface{}) { + totalElements, _ := sac.TotalElements(0) + values = make([]interface{}, totalElements) + vt, _ := safeArrayGetVartype(sac.Array) + + for i := int32(0); i < totalElements; i++ { + switch VT(vt) { + case VT_BOOL: + var v bool + safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) + values[i] = v + case VT_I1: + var v int8 + safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) + values[i] = v + case VT_I2: + var v int16 + safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) + values[i] = v + case VT_I4: + var v int32 + safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) + values[i] = v + case VT_I8: + var v int64 + safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) + values[i] = v + case VT_UI1: + var v uint8 + safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) + values[i] = v + case VT_UI2: + var v uint16 + safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) + values[i] = v + case VT_UI4: + var v uint32 + safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) + values[i] = v + case VT_UI8: + var v uint64 + safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) + values[i] = v + case VT_R4: + var v float32 + safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) + values[i] = v + case VT_R8: + var v float64 + safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) + values[i] = v + case VT_BSTR: + v , _ := safeArrayGetElementString(sac.Array, i) + values[i] = v + case VT_VARIANT: + var v VARIANT + safeArrayGetElement(sac.Array, i, unsafe.Pointer(&v)) + values[i] = v.Value() + v.Clear() + default: + // TODO + } + } + + return +} + +func (sac *SafeArrayConversion) GetType() (varType uint16, err error) { + return safeArrayGetVartype(sac.Array) +} + +func (sac *SafeArrayConversion) GetDimensions() (dimensions *uint32, err error) { + return safeArrayGetDim(sac.Array) +} + +func (sac *SafeArrayConversion) GetSize() (length *uint32, err error) { + return safeArrayGetElementSize(sac.Array) +} + +func (sac *SafeArrayConversion) TotalElements(index uint32) (totalElements int32, err error) { + if index < 1 { + index = 1 + } + + // Get array bounds + var LowerBounds int32 + var UpperBounds int32 + + LowerBounds, err = safeArrayGetLBound(sac.Array, index) + if err != nil { + return + } + + UpperBounds, err = safeArrayGetUBound(sac.Array, index) + if err != nil { + return + } + + totalElements = UpperBounds - LowerBounds + 1 + return +} + +// Release Safe Array memory +func (sac *SafeArrayConversion) Release() { + safeArrayDestroy(sac.Array) +} diff --git a/vendor/github.com/go-ole/go-ole/safearrayslices.go b/vendor/github.com/go-ole/go-ole/safearrayslices.go new file mode 100644 index 000000000..a9fa885f1 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/safearrayslices.go @@ -0,0 +1,33 @@ +// +build windows + +package ole + +import ( + "unsafe" +) + +func safeArrayFromByteSlice(slice []byte) *SafeArray { + array, _ := safeArrayCreateVector(VT_UI1, 0, uint32(len(slice))) + + if array == nil { + panic("Could not convert []byte to SAFEARRAY") + } + + for i, v := range slice { + safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(&v))) + } + return array +} + +func safeArrayFromStringSlice(slice []string) *SafeArray { + array, _ := safeArrayCreateVector(VT_BSTR, 0, uint32(len(slice))) + + if array == nil { + panic("Could not convert []string to SAFEARRAY") + } + // SysAllocStringLen(s) + for i, v := range slice { + safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(SysAllocStringLen(v)))) + } + return array +} diff --git a/vendor/github.com/go-ole/go-ole/utility.go b/vendor/github.com/go-ole/go-ole/utility.go new file mode 100644 index 000000000..99ee82dc3 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/utility.go @@ -0,0 +1,101 @@ +package ole + +import ( + "unicode/utf16" + "unsafe" +) + +// ClassIDFrom retrieves class ID whether given is program ID or application string. +// +// Helper that provides check against both Class ID from Program ID and Class ID from string. It is +// faster, if you know which you are using, to use the individual functions, but this will check +// against available functions for you. +func ClassIDFrom(programID string) (classID *GUID, err error) { + classID, err = CLSIDFromProgID(programID) + if err != nil { + classID, err = CLSIDFromString(programID) + if err != nil { + return + } + } + return +} + +// BytePtrToString converts byte pointer to a Go string. +func BytePtrToString(p *byte) string { + a := (*[10000]uint8)(unsafe.Pointer(p)) + i := 0 + for a[i] != 0 { + i++ + } + return string(a[:i]) +} + +// UTF16PtrToString is alias for LpOleStrToString. +// +// Kept for compatibility reasons. +func UTF16PtrToString(p *uint16) string { + return LpOleStrToString(p) +} + +// LpOleStrToString converts COM Unicode to Go string. +func LpOleStrToString(p *uint16) string { + if p == nil { + return "" + } + + length := lpOleStrLen(p) + a := make([]uint16, length) + + ptr := unsafe.Pointer(p) + + for i := 0; i < int(length); i++ { + a[i] = *(*uint16)(ptr) + ptr = unsafe.Pointer(uintptr(ptr) + 2) + } + + return string(utf16.Decode(a)) +} + +// BstrToString converts COM binary string to Go string. +func BstrToString(p *uint16) string { + if p == nil { + return "" + } + length := SysStringLen((*int16)(unsafe.Pointer(p))) + a := make([]uint16, length) + + ptr := unsafe.Pointer(p) + + for i := 0; i < int(length); i++ { + a[i] = *(*uint16)(ptr) + ptr = unsafe.Pointer(uintptr(ptr) + 2) + } + return string(utf16.Decode(a)) +} + +// lpOleStrLen returns the length of Unicode string. +func lpOleStrLen(p *uint16) (length int64) { + if p == nil { + return 0 + } + + ptr := unsafe.Pointer(p) + + for i := 0; ; i++ { + if 0 == *(*uint16)(ptr) { + length = int64(i) + break + } + ptr = unsafe.Pointer(uintptr(ptr) + 2) + } + return +} + +// convertHresultToError converts syscall to error, if call is unsuccessful. +func convertHresultToError(hr uintptr, r2 uintptr, ignore error) (err error) { + if hr != 0 { + err = NewError(hr) + } + return +} diff --git a/vendor/github.com/go-ole/go-ole/variables.go b/vendor/github.com/go-ole/go-ole/variables.go new file mode 100644 index 000000000..a6add1b00 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/variables.go @@ -0,0 +1,15 @@ +// +build windows + +package ole + +import ( + "golang.org/x/sys/windows" +) + +var ( + modcombase = windows.NewLazySystemDLL("combase.dll") + modkernel32 = windows.NewLazySystemDLL("kernel32.dll") + modole32 = windows.NewLazySystemDLL("ole32.dll") + modoleaut32 = windows.NewLazySystemDLL("oleaut32.dll") + moduser32 = windows.NewLazySystemDLL("user32.dll") +) diff --git a/vendor/github.com/go-ole/go-ole/variant.go b/vendor/github.com/go-ole/go-ole/variant.go new file mode 100644 index 000000000..a2c8402f7 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/variant.go @@ -0,0 +1,105 @@ +package ole + +import "unsafe" + +// NewVariant returns new variant based on type and value. +func NewVariant(vt VT, val int64) VARIANT { + return VARIANT{VT: vt, Val: val} +} + +// ToIUnknown converts Variant to Unknown object. +func (v *VARIANT) ToIUnknown() *IUnknown { + if v.VT != VT_UNKNOWN { + return nil + } + return (*IUnknown)(unsafe.Pointer(uintptr(v.Val))) +} + +// ToIDispatch converts variant to dispatch object. +func (v *VARIANT) ToIDispatch() *IDispatch { + if v.VT != VT_DISPATCH { + return nil + } + return (*IDispatch)(unsafe.Pointer(uintptr(v.Val))) +} + +// ToArray converts variant to SafeArray helper. +func (v *VARIANT) ToArray() *SafeArrayConversion { + if v.VT != VT_SAFEARRAY { + if v.VT&VT_ARRAY == 0 { + return nil + } + } + var safeArray *SafeArray = (*SafeArray)(unsafe.Pointer(uintptr(v.Val))) + return &SafeArrayConversion{safeArray} +} + +// ToString converts variant to Go string. +func (v *VARIANT) ToString() string { + if v.VT != VT_BSTR { + return "" + } + return BstrToString(*(**uint16)(unsafe.Pointer(&v.Val))) +} + +// Clear the memory of variant object. +func (v *VARIANT) Clear() error { + return VariantClear(v) +} + +// Value returns variant value based on its type. +// +// Currently supported types: 2- and 4-byte integers, strings, bools. +// Note that 64-bit integers, datetimes, and other types are stored as strings +// and will be returned as strings. +// +// Needs to be further converted, because this returns an interface{}. +func (v *VARIANT) Value() interface{} { + switch v.VT { + case VT_I1: + return int8(v.Val) + case VT_UI1: + return uint8(v.Val) + case VT_I2: + return int16(v.Val) + case VT_UI2: + return uint16(v.Val) + case VT_I4: + return int32(v.Val) + case VT_UI4: + return uint32(v.Val) + case VT_I8: + return int64(v.Val) + case VT_UI8: + return uint64(v.Val) + case VT_INT: + return int(v.Val) + case VT_UINT: + return uint(v.Val) + case VT_INT_PTR: + return uintptr(v.Val) // TODO + case VT_UINT_PTR: + return uintptr(v.Val) + case VT_R4: + return *(*float32)(unsafe.Pointer(&v.Val)) + case VT_R8: + return *(*float64)(unsafe.Pointer(&v.Val)) + case VT_BSTR: + return v.ToString() + case VT_DATE: + // VT_DATE type will either return float64 or time.Time. + d := uint64(v.Val) + date, err := GetVariantDate(d) + if err != nil { + return float64(v.Val) + } + return date + case VT_UNKNOWN: + return v.ToIUnknown() + case VT_DISPATCH: + return v.ToIDispatch() + case VT_BOOL: + return (v.Val & 0xffff) != 0 + } + return nil +} diff --git a/vendor/github.com/go-ole/go-ole/variant_386.go b/vendor/github.com/go-ole/go-ole/variant_386.go new file mode 100644 index 000000000..e73736bf3 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/variant_386.go @@ -0,0 +1,11 @@ +// +build 386 + +package ole + +type VARIANT struct { + VT VT // 2 + wReserved1 uint16 // 4 + wReserved2 uint16 // 6 + wReserved3 uint16 // 8 + Val int64 // 16 +} diff --git a/vendor/github.com/go-ole/go-ole/variant_amd64.go b/vendor/github.com/go-ole/go-ole/variant_amd64.go new file mode 100644 index 000000000..dccdde132 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/variant_amd64.go @@ -0,0 +1,12 @@ +// +build amd64 + +package ole + +type VARIANT struct { + VT VT // 2 + wReserved1 uint16 // 4 + wReserved2 uint16 // 6 + wReserved3 uint16 // 8 + Val int64 // 16 + _ [8]byte // 24 +} diff --git a/vendor/github.com/go-ole/go-ole/variant_arm.go b/vendor/github.com/go-ole/go-ole/variant_arm.go new file mode 100644 index 000000000..d47245444 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/variant_arm.go @@ -0,0 +1,11 @@ +// +build arm + +package ole + +type VARIANT struct { + VT VT // 2 + wReserved1 uint16 // 4 + wReserved2 uint16 // 6 + wReserved3 uint16 // 8 + Val int64 // 16 +} diff --git a/vendor/github.com/go-ole/go-ole/variant_arm64.go b/vendor/github.com/go-ole/go-ole/variant_arm64.go new file mode 100644 index 000000000..78473cec4 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/variant_arm64.go @@ -0,0 +1,13 @@ +//go:build arm64 +// +build arm64 + +package ole + +type VARIANT struct { + VT VT // 2 + wReserved1 uint16 // 4 + wReserved2 uint16 // 6 + wReserved3 uint16 // 8 + Val int64 // 16 + _ [8]byte // 24 +} diff --git a/vendor/github.com/go-ole/go-ole/variant_date_386.go b/vendor/github.com/go-ole/go-ole/variant_date_386.go new file mode 100644 index 000000000..1b970f63f --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/variant_date_386.go @@ -0,0 +1,22 @@ +// +build windows,386 + +package ole + +import ( + "errors" + "syscall" + "time" + "unsafe" +) + +// GetVariantDate converts COM Variant Time value to Go time.Time. +func GetVariantDate(value uint64) (time.Time, error) { + var st syscall.Systemtime + v1 := uint32(value) + v2 := uint32(value >> 32) + r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st))) + if r != 0 { + return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil + } + return time.Now(), errors.New("Could not convert to time, passing current time.") +} diff --git a/vendor/github.com/go-ole/go-ole/variant_date_amd64.go b/vendor/github.com/go-ole/go-ole/variant_date_amd64.go new file mode 100644 index 000000000..6952f1f0d --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/variant_date_amd64.go @@ -0,0 +1,20 @@ +// +build windows,amd64 + +package ole + +import ( + "errors" + "syscall" + "time" + "unsafe" +) + +// GetVariantDate converts COM Variant Time value to Go time.Time. +func GetVariantDate(value uint64) (time.Time, error) { + var st syscall.Systemtime + r, _, _ := procVariantTimeToSystemTime.Call(uintptr(value), uintptr(unsafe.Pointer(&st))) + if r != 0 { + return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil + } + return time.Now(), errors.New("Could not convert to time, passing current time.") +} diff --git a/vendor/github.com/go-ole/go-ole/variant_date_arm.go b/vendor/github.com/go-ole/go-ole/variant_date_arm.go new file mode 100644 index 000000000..09ec7b5cf --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/variant_date_arm.go @@ -0,0 +1,22 @@ +// +build windows,arm + +package ole + +import ( + "errors" + "syscall" + "time" + "unsafe" +) + +// GetVariantDate converts COM Variant Time value to Go time.Time. +func GetVariantDate(value uint64) (time.Time, error) { + var st syscall.Systemtime + v1 := uint32(value) + v2 := uint32(value >> 32) + r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st))) + if r != 0 { + return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil + } + return time.Now(), errors.New("Could not convert to time, passing current time.") +} diff --git a/vendor/github.com/go-ole/go-ole/variant_date_arm64.go b/vendor/github.com/go-ole/go-ole/variant_date_arm64.go new file mode 100644 index 000000000..02b04a0d4 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/variant_date_arm64.go @@ -0,0 +1,23 @@ +//go:build windows && arm64 +// +build windows,arm64 + +package ole + +import ( + "errors" + "syscall" + "time" + "unsafe" +) + +// GetVariantDate converts COM Variant Time value to Go time.Time. +func GetVariantDate(value uint64) (time.Time, error) { + var st syscall.Systemtime + v1 := uint32(value) + v2 := uint32(value >> 32) + r, _, _ := procVariantTimeToSystemTime.Call(uintptr(v1), uintptr(v2), uintptr(unsafe.Pointer(&st))) + if r != 0 { + return time.Date(int(st.Year), time.Month(st.Month), int(st.Day), int(st.Hour), int(st.Minute), int(st.Second), int(st.Milliseconds/1000), time.UTC), nil + } + return time.Now(), errors.New("Could not convert to time, passing current time.") +} diff --git a/vendor/github.com/go-ole/go-ole/variant_ppc64le.go b/vendor/github.com/go-ole/go-ole/variant_ppc64le.go new file mode 100644 index 000000000..326427a7d --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/variant_ppc64le.go @@ -0,0 +1,12 @@ +// +build ppc64le + +package ole + +type VARIANT struct { + VT VT // 2 + wReserved1 uint16 // 4 + wReserved2 uint16 // 6 + wReserved3 uint16 // 8 + Val int64 // 16 + _ [8]byte // 24 +} diff --git a/vendor/github.com/go-ole/go-ole/variant_s390x.go b/vendor/github.com/go-ole/go-ole/variant_s390x.go new file mode 100644 index 000000000..9874ca66b --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/variant_s390x.go @@ -0,0 +1,12 @@ +// +build s390x + +package ole + +type VARIANT struct { + VT VT // 2 + wReserved1 uint16 // 4 + wReserved2 uint16 // 6 + wReserved3 uint16 // 8 + Val int64 // 16 + _ [8]byte // 24 +} diff --git a/vendor/github.com/go-ole/go-ole/vt_string.go b/vendor/github.com/go-ole/go-ole/vt_string.go new file mode 100644 index 000000000..729b4a04d --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/vt_string.go @@ -0,0 +1,58 @@ +// generated by stringer -output vt_string.go -type VT; DO NOT EDIT + +package ole + +import "fmt" + +const ( + _VT_name_0 = "VT_EMPTYVT_NULLVT_I2VT_I4VT_R4VT_R8VT_CYVT_DATEVT_BSTRVT_DISPATCHVT_ERRORVT_BOOLVT_VARIANTVT_UNKNOWNVT_DECIMAL" + _VT_name_1 = "VT_I1VT_UI1VT_UI2VT_UI4VT_I8VT_UI8VT_INTVT_UINTVT_VOIDVT_HRESULTVT_PTRVT_SAFEARRAYVT_CARRAYVT_USERDEFINEDVT_LPSTRVT_LPWSTR" + _VT_name_2 = "VT_RECORDVT_INT_PTRVT_UINT_PTR" + _VT_name_3 = "VT_FILETIMEVT_BLOBVT_STREAMVT_STORAGEVT_STREAMED_OBJECTVT_STORED_OBJECTVT_BLOB_OBJECTVT_CFVT_CLSID" + _VT_name_4 = "VT_BSTR_BLOBVT_VECTOR" + _VT_name_5 = "VT_ARRAY" + _VT_name_6 = "VT_BYREF" + _VT_name_7 = "VT_RESERVED" + _VT_name_8 = "VT_ILLEGAL" +) + +var ( + _VT_index_0 = [...]uint8{0, 8, 15, 20, 25, 30, 35, 40, 47, 54, 65, 73, 80, 90, 100, 110} + _VT_index_1 = [...]uint8{0, 5, 11, 17, 23, 28, 34, 40, 47, 54, 64, 70, 82, 91, 105, 113, 122} + _VT_index_2 = [...]uint8{0, 9, 19, 30} + _VT_index_3 = [...]uint8{0, 11, 18, 27, 37, 55, 71, 85, 90, 98} + _VT_index_4 = [...]uint8{0, 12, 21} + _VT_index_5 = [...]uint8{0, 8} + _VT_index_6 = [...]uint8{0, 8} + _VT_index_7 = [...]uint8{0, 11} + _VT_index_8 = [...]uint8{0, 10} +) + +func (i VT) String() string { + switch { + case 0 <= i && i <= 14: + return _VT_name_0[_VT_index_0[i]:_VT_index_0[i+1]] + case 16 <= i && i <= 31: + i -= 16 + return _VT_name_1[_VT_index_1[i]:_VT_index_1[i+1]] + case 36 <= i && i <= 38: + i -= 36 + return _VT_name_2[_VT_index_2[i]:_VT_index_2[i+1]] + case 64 <= i && i <= 72: + i -= 64 + return _VT_name_3[_VT_index_3[i]:_VT_index_3[i+1]] + case 4095 <= i && i <= 4096: + i -= 4095 + return _VT_name_4[_VT_index_4[i]:_VT_index_4[i+1]] + case i == 8192: + return _VT_name_5 + case i == 16384: + return _VT_name_6 + case i == 32768: + return _VT_name_7 + case i == 65535: + return _VT_name_8 + default: + return fmt.Sprintf("VT(%d)", i) + } +} diff --git a/vendor/github.com/go-ole/go-ole/winrt.go b/vendor/github.com/go-ole/go-ole/winrt.go new file mode 100644 index 000000000..4e9eca732 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/winrt.go @@ -0,0 +1,99 @@ +// +build windows + +package ole + +import ( + "reflect" + "syscall" + "unicode/utf8" + "unsafe" +) + +var ( + procRoInitialize = modcombase.NewProc("RoInitialize") + procRoActivateInstance = modcombase.NewProc("RoActivateInstance") + procRoGetActivationFactory = modcombase.NewProc("RoGetActivationFactory") + procWindowsCreateString = modcombase.NewProc("WindowsCreateString") + procWindowsDeleteString = modcombase.NewProc("WindowsDeleteString") + procWindowsGetStringRawBuffer = modcombase.NewProc("WindowsGetStringRawBuffer") +) + +func RoInitialize(thread_type uint32) (err error) { + hr, _, _ := procRoInitialize.Call(uintptr(thread_type)) + if hr != 0 { + err = NewError(hr) + } + return +} + +func RoActivateInstance(clsid string) (ins *IInspectable, err error) { + hClsid, err := NewHString(clsid) + if err != nil { + return nil, err + } + defer DeleteHString(hClsid) + + hr, _, _ := procRoActivateInstance.Call( + uintptr(unsafe.Pointer(hClsid)), + uintptr(unsafe.Pointer(&ins))) + if hr != 0 { + err = NewError(hr) + } + return +} + +func RoGetActivationFactory(clsid string, iid *GUID) (ins *IInspectable, err error) { + hClsid, err := NewHString(clsid) + if err != nil { + return nil, err + } + defer DeleteHString(hClsid) + + hr, _, _ := procRoGetActivationFactory.Call( + uintptr(unsafe.Pointer(hClsid)), + uintptr(unsafe.Pointer(iid)), + uintptr(unsafe.Pointer(&ins))) + if hr != 0 { + err = NewError(hr) + } + return +} + +// HString is handle string for pointers. +type HString uintptr + +// NewHString returns a new HString for Go string. +func NewHString(s string) (hstring HString, err error) { + u16 := syscall.StringToUTF16Ptr(s) + len := uint32(utf8.RuneCountInString(s)) + hr, _, _ := procWindowsCreateString.Call( + uintptr(unsafe.Pointer(u16)), + uintptr(len), + uintptr(unsafe.Pointer(&hstring))) + if hr != 0 { + err = NewError(hr) + } + return +} + +// DeleteHString deletes HString. +func DeleteHString(hstring HString) (err error) { + hr, _, _ := procWindowsDeleteString.Call(uintptr(hstring)) + if hr != 0 { + err = NewError(hr) + } + return +} + +// String returns Go string value of HString. +func (h HString) String() string { + var u16buf uintptr + var u16len uint32 + u16buf, _, _ = procWindowsGetStringRawBuffer.Call( + uintptr(h), + uintptr(unsafe.Pointer(&u16len))) + + u16hdr := reflect.SliceHeader{Data: u16buf, Len: int(u16len), Cap: int(u16len)} + u16 := *(*[]uint16)(unsafe.Pointer(&u16hdr)) + return syscall.UTF16ToString(u16) +} diff --git a/vendor/github.com/go-ole/go-ole/winrt_doc.go b/vendor/github.com/go-ole/go-ole/winrt_doc.go new file mode 100644 index 000000000..52e6d74c9 --- /dev/null +++ b/vendor/github.com/go-ole/go-ole/winrt_doc.go @@ -0,0 +1,36 @@ +// +build !windows + +package ole + +// RoInitialize +func RoInitialize(thread_type uint32) (err error) { + return NewError(E_NOTIMPL) +} + +// RoActivateInstance +func RoActivateInstance(clsid string) (ins *IInspectable, err error) { + return nil, NewError(E_NOTIMPL) +} + +// RoGetActivationFactory +func RoGetActivationFactory(clsid string, iid *GUID) (ins *IInspectable, err error) { + return nil, NewError(E_NOTIMPL) +} + +// HString is handle string for pointers. +type HString uintptr + +// NewHString returns a new HString for Go string. +func NewHString(s string) (hstring HString, err error) { + return HString(uintptr(0)), NewError(E_NOTIMPL) +} + +// DeleteHString deletes HString. +func DeleteHString(hstring HString) (err error) { + return NewError(E_NOTIMPL) +} + +// String returns Go string value of HString. +func (h HString) String() string { + return "" +} diff --git a/vendor/github.com/microsoft/wmi/LICENSE b/vendor/github.com/microsoft/wmi/LICENSE new file mode 100644 index 000000000..4b1ad51b2 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE diff --git a/vendor/github.com/microsoft/wmi/go/wmi/Class.go b/vendor/github.com/microsoft/wmi/go/wmi/Class.go new file mode 100644 index 000000000..e19f03327 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/go/wmi/Class.go @@ -0,0 +1,16 @@ +package wmi + +// Class +type Class interface { + ClassName() string + SuperClassName() string + ServerName() string + Namespace() string + SuperClass() *Class + Properties() []string + Qualifiers() []string + Methods() []string + MethodParameters(string) []string + InvokeMethod(string, []string, string) (error, string) + Dispose() +} diff --git a/vendor/github.com/microsoft/wmi/go/wmi/Credentials.go b/vendor/github.com/microsoft/wmi/go/wmi/Credentials.go new file mode 100644 index 000000000..1a7752884 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/go/wmi/Credentials.go @@ -0,0 +1,13 @@ +package wmi + +// Credentials +type Credentials struct { + UserName string + Password string + Domain string +} + +// GetSecureString +func (cred Credentials) GetSecureString() (string, error) { + panic("not implemented") +} diff --git a/vendor/github.com/microsoft/wmi/go/wmi/Instance.go b/vendor/github.com/microsoft/wmi/go/wmi/Instance.go new file mode 100644 index 000000000..7392038d3 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/go/wmi/Instance.go @@ -0,0 +1,24 @@ +package wmi + +// Instance represents an interface for the wmi instance +type Instance interface { + GetInstance() (*Instance, error) + GetProperty(name string) (string, error) + SetProperty(name, value string) (string, error) + ResetProperty(name string) (string, error) + Class() *Class + EmbeddedInstance() (string, error) + InstanceManager() *InstanceManager + Equals(*Instance) bool + Refresh() error + Commit() error + Modify() error + Delete() error + InstancePath() (string, error) + InvokeMethod(namespaceName string, methodName string, methodParameters *[]MethodParameter) (MethodResult, error) + GetRelated(resultClassName string) (*[]Instance, error) + GetRelatedEx(resultClassName, associatedClassName, resultRole, sourceRole string) (*[]Instance, error) + GetAssociated(resultClassName, associatedClassName, resultRole, sourceRole string) (*[]Instance, error) + EnumerateReferencingInstances(associatedClassName, sourceRole string) (*[]Instance, error) + Dispose() +} diff --git a/vendor/github.com/microsoft/wmi/go/wmi/InstanceManager.go b/vendor/github.com/microsoft/wmi/go/wmi/InstanceManager.go new file mode 100644 index 000000000..9e2d45800 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/go/wmi/InstanceManager.go @@ -0,0 +1,17 @@ +package wmi + +// InstanceManager interface +type InstanceManager interface { + ServerName() string + Namespace() string + Credentials() *Credentials + EnumerateInstances(className string) (*[]Instance, error) + QueryInstances(query string) (*[]Instance, error) + QueryInstancesEx(query Query) (*[]Instance, error) + + CreateInstance(className string, propertyValues map[string]string) (*Instance, error) + GetInstance(className string, propertyValues map[string]string) (*Instance, error) + GetClass(className string) (*Class, error) + EnumerateClasses() (*[]Class, error) + GetInstancesFromPaths(pathArray []string) (*[]Instance, error) +} diff --git a/vendor/github.com/microsoft/wmi/go/wmi/MethodDeclaration.go b/vendor/github.com/microsoft/wmi/go/wmi/MethodDeclaration.go new file mode 100644 index 000000000..16b084446 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/go/wmi/MethodDeclaration.go @@ -0,0 +1,7 @@ +package wmi + +type MethodDeclaration struct { + Name string + Parameters *[]MethodParameter + Qualifiers *[]Qualifier +} diff --git a/vendor/github.com/microsoft/wmi/go/wmi/MethodParameter.go b/vendor/github.com/microsoft/wmi/go/wmi/MethodParameter.go new file mode 100644 index 000000000..897f50f6c --- /dev/null +++ b/vendor/github.com/microsoft/wmi/go/wmi/MethodParameter.go @@ -0,0 +1,66 @@ +package wmi + +import ( + "errors" + "reflect" +) + +// MethodParameter +type MethodParameter struct { + Name string + Value interface{} + Type WmiType +} + +// MethodParameterCollection +type MethodParameterCollection []MethodParameter + +// GetValue +func (c MethodParameterCollection) GetValue(paramName string, value interface{}) error { + mval, err := c.Get(paramName) + if err != nil { + return errors.New("Not Found") + } + value = mval.Value + return nil +} + +// GetValueArray +func (c MethodParameterCollection) GetValueArray(paramName string, value interface{}) error { + mval, err := c.Get(paramName) + if err != nil { + return errors.New("Not Found") + } + if mval.Value != nil { + v := reflect.ValueOf(mval.Value) + + tmpValue := make([]interface{}, v.Len()) + for i := 0; i < v.Len(); i++ { + tmpValue[i] = v.Index(i).Interface() + value = tmpValue + } + } else { + value = make([]interface{}, 0) + } + return nil +} + +// Contains +func (c MethodParameterCollection) Contains(paramName string) bool { + for _, a := range c { + if a.Name == paramName { + return true + } + } + return false +} + +// Contains +func (c MethodParameterCollection) Get(paramName string) (val *MethodParameter, err error) { + for _, a := range c { + if a.Name == paramName { + return &a, nil + } + } + return nil, errors.New("Not Found") +} diff --git a/vendor/github.com/microsoft/wmi/go/wmi/MethodResult.go b/vendor/github.com/microsoft/wmi/go/wmi/MethodResult.go new file mode 100644 index 000000000..654cc0061 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/go/wmi/MethodResult.go @@ -0,0 +1,7 @@ +package wmi + +// MethodResult +type MethodResult struct { + ReturnValue *MethodParameter + OutParameters *MethodParameterCollection +} diff --git a/vendor/github.com/microsoft/wmi/go/wmi/Property.go b/vendor/github.com/microsoft/wmi/go/wmi/Property.go new file mode 100644 index 000000000..1047d08a7 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/go/wmi/Property.go @@ -0,0 +1,91 @@ +package wmi + +type PropertyFlags int + +const ( + // None + None PropertyFlags = 0 + // Class + WClass PropertyFlags = 1 + // Method + Method PropertyFlags = 2 + // Property + WProperty PropertyFlags = 4 + // Parameter + Parameter PropertyFlags = 8 + // Association + Association PropertyFlags = 16 + // Indication + Indication PropertyFlags = 32 + // Reference + Reference PropertyFlags = 64 + // Any + Any PropertyFlags = 127 + // EnableOverride + EnableOverride PropertyFlags = 128 + // DisableOverride + DisableOverride PropertyFlags = 256 + // Restricted + Restricted PropertyFlags = 512 + // ToSubClass + ToSubclass PropertyFlags = 1024 + // Translatable + Translatable PropertyFlags = 2048 + // Key + Key PropertyFlags = 4096 + // In + In PropertyFlags = 8192 + // Out + Out PropertyFlags = 16384 + // Required + Required PropertyFlags = 32768 + // Static + Static PropertyFlags = 65536 + // Abstract + Abstract PropertyFlags = 131072 + // Terminal + Terminal PropertyFlags = 262144 + // Expensive + Expensive PropertyFlags = 524288 + // Stream + Stream PropertyFlags = 1048576 + // ReadOnly + ReadOnly PropertyFlags = 2097152 + // NotModified + NotModified PropertyFlags = 33554432 + // NullValue + NullValue PropertyFlags = 536870912 + // Borrow + Borrow PropertyFlags = 1073741824 + // Adopt + //Adopt PropertyFlags = 2147483648; +) + +type WmiType int + +const ( + WbemCimtypeSint8 WmiType = 16 + WbemCimtypeUint8 WmiType = 17 + WbemCimtypeSint16 WmiType = 2 + WbemCimtypeUint16 WmiType = 18 + WbemCimtypeSint32 WmiType = 3 + WbemCimtypeUint32 WmiType = 19 + WbemCimtypeSint64 WmiType = 20 + WbemCimtypeUint64 WmiType = 21 + WbemCimtypeReal32 WmiType = 4 + WbemCimtypeReal64 WmiType = 5 + WbemCimtypeBoolean WmiType = 11 + WbemCimtypeString WmiType = 8 + WbemCimtypeDatetime WmiType = 101 + WbemCimtypeReference WmiType = 102 + WbemCimtypeChar16 WmiType = 103 + WbemCimtypeObject WmiType = 13 +) + +// Property +type Property interface { + Name() string + Value() string + Type() WmiType + Flags() PropertyFlags +} diff --git a/vendor/github.com/microsoft/wmi/go/wmi/Qualifier.go b/vendor/github.com/microsoft/wmi/go/wmi/Qualifier.go new file mode 100644 index 000000000..1b8215c44 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/go/wmi/Qualifier.go @@ -0,0 +1,6 @@ +package wmi + +type Qualifier interface { + Name() string + Value() string +} diff --git a/vendor/github.com/microsoft/wmi/go/wmi/Query.go b/vendor/github.com/microsoft/wmi/go/wmi/Query.go new file mode 100644 index 000000000..03d38ba5a --- /dev/null +++ b/vendor/github.com/microsoft/wmi/go/wmi/Query.go @@ -0,0 +1,51 @@ +package wmi + +import "fmt" + +type WhereOperation int + +const ( + Equals WhereOperation = 0 + LessThan WhereOperation = 1 + GreaterThan WhereOperation = 2 + LessThanEquals WhereOperation = 3 + GreaterThenEquals WhereOperation = 4 + NotEqual WhereOperation = 5 + Like WhereOperation = 6 +) + +type QueryFilter struct { + Name string + Value string + Operation WhereOperation +} + +// GetFilter +func (q QueryFilter) GetFilter() string { + operator := "=" + switch q.Operation { + case Equals: + operator = "=" + case LessThan: + operator = "<" + case GreaterThan: + operator = ">" + case LessThanEquals: + operator = "<=" + case GreaterThenEquals: + operator = ">=" + case NotEqual: + operator = "!=" + case Like: + operator = "LIKE" + return fmt.Sprintf(" %s %s '%%%s%%'", q.Name, q.Value, operator) + default: + } + return fmt.Sprintf(" %s%s'%s'", q.Name, q.Value, operator) +} + +// Query +type Query interface { + ClassName() string + QueryString() string +} diff --git a/vendor/github.com/microsoft/wmi/go/wmi/Session.go b/vendor/github.com/microsoft/wmi/go/wmi/Session.go new file mode 100644 index 000000000..7f489c60b --- /dev/null +++ b/vendor/github.com/microsoft/wmi/go/wmi/Session.go @@ -0,0 +1,26 @@ +package wmi + +type SessionStatus int + +const ( + Created SessionStatus = 0 + Connected SessionStatus = 1 + Disconnected SessionStatus = 2 + Disposed SessionStatus = 3 +) + +// Session +type Session interface { + Connect() (bool, error) + Dispose() + TestConnection() bool + GetProperty(name string) string + SetProperty(name, value string) string + ResetProperty(name string) string + GetClass(namespaceName, className string) (*Class, error) + GetInstance(namespaceName string, instance *Instance) (*Instance, error) + EnumerateClasses(namespaceName, className string) (*[]Class, error) + EnumerateInstances(namespaceName, className string) (*[]Instance, error) + QueryInstances(namespaceName, queryDislect, queryExpression string) (*[]Instance, error) + EnumerateReferencingInstances(namespaceName string, sourceInstance Instance, associationClassName, sourceRole string) (*[]Instance, error) +} diff --git a/vendor/github.com/microsoft/wmi/pkg/base/credential/credential.go b/vendor/github.com/microsoft/wmi/pkg/base/credential/credential.go new file mode 100644 index 000000000..150a297a8 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/base/credential/credential.go @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package credential + +type WmiCredential struct { + UserName string + Password string + Domain string +} + +// NewWmiCredential +func NewWmiCredential(username, password, domain string) *WmiCredential { + return &WmiCredential{UserName: username, Password: password, Domain: domain} +} diff --git a/vendor/github.com/microsoft/wmi/pkg/base/host/host.go b/vendor/github.com/microsoft/wmi/pkg/base/host/host.go new file mode 100644 index 000000000..71944e488 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/base/host/host.go @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package host + +import ( + "github.com/microsoft/wmi/pkg/base/credential" +) + +type WmiHost struct { + HostName string + credential *credential.WmiCredential +} + +func NewWmiLocalHost() *WmiHost { + return NewWmiHost("localhost") +} + +// NewWmiHost +func NewWmiHost(hostname string) *WmiHost { + return NewWmiHostWithCredential(hostname, "", "", "") +} + +// NewWmiHostWithCredential +func NewWmiHostWithCredential(hostname, username, password, domain string) *WmiHost { + return &WmiHost{HostName: hostname, credential: credential.NewWmiCredential(username, password, domain)} +} + +// GetCredential +func (host *WmiHost) GetCredential() *credential.WmiCredential { + return host.credential +} diff --git a/vendor/github.com/microsoft/wmi/pkg/base/instance/instancemanager.go b/vendor/github.com/microsoft/wmi/pkg/base/instance/instancemanager.go new file mode 100644 index 000000000..ecb68b45f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/base/instance/instancemanager.go @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +package instance + +import ( + "log" + "strings" + "sync" + + "github.com/microsoft/wmi/pkg/base/credential" + "github.com/microsoft/wmi/pkg/base/host" + "github.com/microsoft/wmi/pkg/base/query" + wmisession "github.com/microsoft/wmi/pkg/base/session" + "github.com/microsoft/wmi/pkg/errors" + wmi "github.com/microsoft/wmi/pkg/wmiinstance" +) + +var ( + instanceManagerMap map[string]*WmiInstanceManager + mutex sync.Mutex +) + +type WmiInstanceManager struct { + Host *host.WmiHost + session *wmi.WmiSession + Namespace string +} + +func init() { + instanceManagerMap = map[string]*WmiInstanceManager{} +} + +func newWmiInstanceManager(hostname, namespaceName, userName, password, domainName string) (*WmiInstanceManager, error) { + im := &WmiInstanceManager{ + Host: host.NewWmiHostWithCredential(hostname, userName, password, domainName), + Namespace: namespaceName, + } + + wsession, err := wmisession.GetHostSession(namespaceName, im.Host) + if err != nil { + return nil, err + } + im.session = wsession + + return im, nil + +} + +func GetWmiInstanceManagerFromWHost(whost *host.WmiHost, namespaceName string) (*WmiInstanceManager, error) { + return GetWmiInstanceManagerFromCred(whost.HostName, namespaceName, whost.GetCredential()) +} +func GetWmiInstanceManagerFromCred(hostname, namespaceName string, cred *credential.WmiCredential) (*WmiInstanceManager, error) { + return GetWmiInstanceManager(hostname, namespaceName, cred.UserName, cred.Password, cred.Domain) +} +func GetWmiInstanceManager(hostname, namespaceName, userName, password, domainName string) (*WmiInstanceManager, error) { + mapId := strings.Join([]string{hostname, namespaceName, domainName}, "_") + if val, ok := instanceManagerMap[mapId]; ok { + return val, nil + } + + mutex.Lock() + defer mutex.Unlock() + var err error + instanceManagerMap[mapId], err = newWmiInstanceManager(hostname, namespaceName, userName, password, domainName) + if err != nil { + return nil, err + } + return instanceManagerMap[mapId], nil + +} + +func (im *WmiInstanceManager) CreateInstance(className string) (*wmi.WmiInstance, error) { + cls, err := im.session.GetClass(className) + if err != nil { + return nil, err + } + return cls.MakeInstance() +} + +func (im *WmiInstanceManager) GetInstance(instancePath string) (*wmi.WmiInstance, error) { + return im.session.GetInstance(instancePath) +} + +func (im *WmiInstanceManager) QueryInstances(queryString string) ([]*wmi.WmiInstance, error) { + return im.session.QueryInstances(queryString) +} + +func (im *WmiInstanceManager) QueryClasses(queryString string) ([]*wmi.WmiClass, error) { + return im.session.QueryClasses(queryString) +} + +func (im *WmiInstanceManager) QueryInstanceEx(queryString string) (*wmi.WmiInstance, error) { + instances, err := im.QueryInstances(queryString) + if err != nil { + return nil, err + } + if len(instances) == 0 { + return nil, errors.Wrapf(errors.NotFound, "Query [%s] failed with no instance", queryString) + } + + log.Printf("[WMI] QueryInstanceEx [%s]=>[%d]instances\n", queryString, len(instances)) + + // LEAK - return a clone and close the collection + return instances[0], nil +} + +func (im *WmiInstanceManager) QueryInstance(inquery *query.WmiQuery) (*wmi.WmiInstance, error) { + return im.QueryInstanceEx(inquery.String()) +} + +func GetWmiInstanceByName(whost *host.WmiHost, namespaceName, className, instanceName string) (*wmi.WmiInstance, error) { + return GetWmiInstanceEx(whost, namespaceName, query.NewWmiQuery(className, "Name", instanceName)) +} + +func GetWmiInstanceEx2(hostName string, cred credential.WmiCredential, namespaceName string, inquery *query.WmiQuery) (*wmi.WmiInstance, error) { + return GetWmiInstance(hostName, namespaceName, cred.UserName, cred.Password, cred.Domain, inquery) +} + +func GetWmiInstanceEx(whost *host.WmiHost, namespaceName string, inquery *query.WmiQuery) (*wmi.WmiInstance, error) { + cred := whost.GetCredential() + return GetWmiInstance(whost.HostName, namespaceName, cred.UserName, cred.Password, cred.Domain, inquery) +} + +func GetWmiInstance(hostname, namespaceName, userName, password, domainName string, inquery *query.WmiQuery) (*wmi.WmiInstance, error) { + im, err := GetWmiInstanceManager(hostname, namespaceName, userName, password, domainName) + if err != nil { + return nil, err + } + return im.QueryInstance(inquery) +} + +func CreateWmiInstance(host *host.WmiHost, namespaceName, class string) (*wmi.WmiInstance, error) { + im, err := GetWmiInstanceManagerFromWHost(host, namespaceName) + if err != nil { + return nil, err + } + return im.CreateInstance(class) +} +func GetWmiInstancesFromHostRawQuery(host *host.WmiHost, namespaceName string, query string) (wmi.WmiInstanceCollection, error) { + im, err := GetWmiInstanceManagerFromWHost(host, namespaceName) + if err != nil { + return nil, err + } + instances, err := im.QueryInstances(query) + if err != nil { + return nil, err + } + winstances := wmi.WmiInstanceCollection{} + winstances = append(winstances, instances...) + return winstances, nil + +} + +func GetWmiInstancesFromHost(host *host.WmiHost, namespaceName string, inquery *query.WmiQuery) (wmi.WmiInstanceCollection, error) { + return GetWmiInstancesFromHostRawQuery(host, namespaceName, inquery.String()) +} + +func GetWmiInstanceFromPath(host *host.WmiHost, namespaceName, instancePath string) (*wmi.WmiInstance, error) { + log.Printf("[WMI] Get Instance from path [%s]\n", instancePath) + im, err := GetWmiInstanceManagerFromWHost(host, namespaceName) + if err != nil { + return nil, err + } + return im.GetInstance(instancePath) +} + +func GetWmiJob(host *host.WmiHost, namespaceName, instancePath string) (*wmi.WmiJob, error) { + im, err := GetWmiInstanceManagerFromWHost(host, namespaceName) + if err != nil { + return nil, err + } + instance, err := im.GetInstance(instancePath) + if err != nil { + return nil, err + } + return wmi.NewWmiJob(instance) +} + +func GetWmiClasssesFromHostRawQuery(host *host.WmiHost, namespaceName string, query string) (wmi.WmiClassCollection, error) { + im, err := GetWmiInstanceManagerFromWHost(host, namespaceName) + if err != nil { + return nil, err + } + classes, err := im.QueryClasses(query) + if err != nil { + return nil, err + } + cinstances := wmi.WmiClassCollection{} + cinstances = append(cinstances, classes...) + return cinstances, nil +} diff --git a/vendor/github.com/microsoft/wmi/pkg/base/query/query.go b/vendor/github.com/microsoft/wmi/pkg/base/query/query.go new file mode 100644 index 000000000..e7293c241 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/base/query/query.go @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package query + +import ( + "fmt" + "log" + "strings" +) + +// https://docs.microsoft.com/en-us/windows/win32/wmisdk/wql-sql-for-wmi + +type CompareOperator string + +const ( + Equals CompareOperator = "=" + LessThan CompareOperator = "<" + GreaterThan CompareOperator = ">" + LessThanEquals CompareOperator = "<=" + GreaterThanEquals CompareOperator = ">=" + NotEquals CompareOperator = "<>" + Like CompareOperator = "LIKE" + Isa CompareOperator = "ISA" +) + +type WmiQueryFilter struct { + Name string + Value string + Operator CompareOperator +} + +type WmiQuery struct { + ClassName string + Filters []*WmiQueryFilter + SelectList []string +} + +func NewWmiQuery(className string, filters ...string) (wquery *WmiQuery) { + wquery = &WmiQuery{ClassName: className, Filters: []*WmiQueryFilter{}} + if len(filters) == 0 { + return + } + + wquery.BuildQueryFilter(filters) + return +} + +func NewWmiQueryWithSelectList(className string, selectList []string, filters ...string) (wquery *WmiQuery) { + wquery = &WmiQuery{ClassName: className, SelectList: selectList, Filters: []*WmiQueryFilter{}} + if len(filters) == 0 { + return + } + + wquery.BuildQueryFilter(filters) + return +} + +func (q *WmiQuery) BuildQueryFilter(filters []string) { + if len(filters)%2 == 1 { + log.Fatalf("Even number of strings is required to build key=value set of filters: [%+v]\n", filters) + } + + for i := 0; i < len(filters); i = i + 2 { + qfilter := NewWmiQueryFilter(filters[i], filters[i+1], Equals) + q.Filters = append(q.Filters, qfilter) + } + + return +} + +// NewWmiQueryFilter +func NewWmiQueryFilter(name, value string, oper CompareOperator) *WmiQueryFilter { + return &WmiQueryFilter{Name: name, Value: value, Operator: oper} +} + +func (q *WmiQueryFilter) String() string { + if q.Operator == Like { + return fmt.Sprintf("%s %s '%%%s%%'", q.Name, q.Operator, q.Value) + } else { + return fmt.Sprintf("%s %s '%s'", q.Name, q.Operator, q.Value) + } +} +func (q *WmiQuery) AddFilterWithComparer(propertyName, value string, oper CompareOperator) { + q.Filters = append(q.Filters, NewWmiQueryFilter(propertyName, value, oper)) + return +} +func (q *WmiQuery) AddFilter(propertyName, value string) { + q.Filters = append(q.Filters, NewWmiQueryFilter(propertyName, value, Equals)) + return +} + +// HasFilter +func (q *WmiQuery) HasFilter() bool { + return len(q.Filters) > 0 +} + +// String +func (q *WmiQuery) String() (queryString string) { + paramStr := "*" + if len(q.SelectList) > 0 { + paramStr = strings.Join(q.SelectList, ",") + } + queryString = fmt.Sprintf("SELECT %s FROM %s", paramStr, q.ClassName) + + if len(q.Filters) == 0 { + return + } + + queryString = fmt.Sprintf("%s WHERE ", queryString) + + for _, val := range q.Filters[:len(q.Filters)-1] { + queryString = queryString + fmt.Sprintf(" %s AND", val.String()) + } + + queryString = queryString + fmt.Sprintf(" %s ", q.Filters[len(q.Filters)-1].String()) + return +} + +type WmiQueryFilterCollection []*WmiQueryFilter + +func (c *WmiQueryFilterCollection) String() string { + queryString := "" + for _, query := range *c { + queryString = fmt.Sprintf("%s AND %s", queryString, query.String()) + } + return queryString +} diff --git a/vendor/github.com/microsoft/wmi/pkg/base/session/session.go b/vendor/github.com/microsoft/wmi/pkg/base/session/session.go new file mode 100644 index 000000000..8838df778 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/base/session/session.go @@ -0,0 +1,95 @@ +//go:build windows +// +build windows + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +package session + +import ( + "github.com/pkg/errors" + "os" + "strings" + + "github.com/microsoft/wmi/pkg/base/credential" + "github.com/microsoft/wmi/pkg/base/host" + wmi "github.com/microsoft/wmi/pkg/wmiinstance" +) + +var ( + sessionManager *wmi.WmiSessionManager + sessionsMap map[string]*wmi.WmiSession + localHostName string +) + +func init() { + localHostName, _ = os.Hostname() + sessionsMap = make(map[string]*wmi.WmiSession) + sessionManager = wmi.NewWmiSessionManager() +} + +// StopWMI +func StopWMI() { + for key := range sessionsMap { + if sessionsMap[key] != nil { + sessionsMap[key].Dispose() + } + sessionsMap[key] = nil + } + + if sessionManager != nil { + sessionManager.Dispose() + sessionManager = nil + } +} + +// GetHostSession +func GetHostSession(namespaceName string, whost *host.WmiHost) (*wmi.WmiSession, error) { + cred := whost.GetCredential() + return GetSession(namespaceName, whost.HostName, cred.Domain, cred.UserName, cred.Password) +} + +func GetHostSessionWithCredentials(namespaceName string, whost *host.WmiHost, cred *credential.WmiCredential) (*wmi.WmiSession, error) { + return GetSession(namespaceName, whost.HostName, cred.Domain, cred.UserName, cred.Password) +} + +// GetSession +func GetSession(namespaceName string, serverName string, domain string, userName string, password string) (*wmi.WmiSession, error) { + sessionsMapId := strings.Join([]string{namespaceName, serverName, domain}, "_") + if sessionsMap[sessionsMapId] == nil { + var err error + sessionsMap[sessionsMapId], err = createSession(namespaceName, serverName, domain, userName, password) + if err != nil { + return nil, err + } + } + + return sessionsMap[sessionsMapId], nil +} + +// //////////// Private functions //////////////////////////// +func createSession(sessionName string, serverName string, domain string, username string, password string) (*wmi.WmiSession, error) { + // TODO: ideally, we should also compare the domain here. + // that said, this is low priority as cross-domain WMI calls are rare + if strings.EqualFold(localHostName, serverName) { + // Optimization for local clusters: connecting to the local cluster through remote WMI results in a much longer + // response than connecting directly. When providing the cluster name, the cluster has to go through a + // long sequence of connection/authentication. Not providing the name allows the cluster to skip that + // expensive sequence. + serverName = "" + domain = "" + } + + session, err := sessionManager.GetSession(sessionName, serverName, domain, username, password) + if err != nil { + return nil, errors.Wrapf(err, "Failed getting the WMI session for "+sessionName) + } + + connected, err := session.Connect() + + if !connected || err != nil { + return nil, errors.Wrapf(err, "Failed connecting to the WMI session for "+sessionName) + } + + return session, nil +} diff --git a/vendor/github.com/microsoft/wmi/pkg/errors/errors.go b/vendor/github.com/microsoft/wmi/pkg/errors/errors.go new file mode 100644 index 000000000..ffad9b5d9 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/errors/errors.go @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +package errors + +import ( + "errors" + "fmt" + "strings" + + perrors "github.com/pkg/errors" +) + +const ( + wmiError = "WMI Error 0x" +) + +var ( + NotFound error = errors.New("Not Found") + Timedout error = errors.New("Timedout") + InvalidInput error = errors.New("Invalid Input") + InvalidType error = errors.New("Invalid Type") + NotSupported error = errors.New("Not Supported") + AlreadyExists error = errors.New("Already Exists") + InvalidFilter error = errors.New("Invalid Filter") + Failed error = errors.New("Failed") + NotImplemented error = errors.New("Not Implemented") + Unknown error = errors.New("Unknown Reason") +) + +func Wrap(cause error, message string) error { + return perrors.Wrap(cause, message) +} + +func Wrapf(err error, format string, args ...interface{}) error { + return perrors.Wrapf(err, format, args...) +} + +func IsNotFound(err error) bool { + return checkError(err, NotFound) +} +func IsAlreadyExists(err error) bool { + return checkError(err, AlreadyExists) +} +func IsTimedout(err error) bool { + return checkError(err, Timedout) +} +func IsInvalidInput(err error) bool { + return checkError(err, InvalidInput) +} +func IsInvalidType(err error) bool { + return checkError(err, InvalidType) +} +func IsNotSupported(err error) bool { + return checkError(err, NotSupported) +} +func IsInvalidFilter(err error) bool { + return checkError(err, InvalidFilter) +} +func IsFailed(err error) bool { + return checkError(err, Failed) +} +func IsNotImplemented(err error) bool { + return checkError(err, NotImplemented) +} +func IsUnknown(err error) bool { + return checkError(err, Unknown) +} +func IsWMIError(err error) bool { + if err == nil { + return false + } + if strings.HasPrefix(err.Error(), wmiError) { + return true + } + cerr := perrors.Cause(err) + if strings.HasPrefix(cerr.Error(), wmiError) { + return true + } + + return false +} + +func checkError(wrappedError, err error) bool { + if wrappedError == nil { + return false + } + if wrappedError == err { + return true + } + cerr := perrors.Cause(wrappedError) + if cerr != nil && cerr == err { + return true + } + + return false + +} + +func New(errString string) error { + return errors.New(errString) +} + +func NewWMIError(errorCode uint16) error { + return fmt.Errorf(wmiError+"%08x", errorCode) +} diff --git a/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiClass.go b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiClass.go new file mode 100644 index 000000000..3a5d730a7 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiClass.go @@ -0,0 +1,314 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +// This class implement a wrapper of the SWbemObject class (from an instance perspective). +// Documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemobject + +package cim + +import ( + "github.com/go-ole/go-ole" + "github.com/go-ole/go-ole/oleutil" +) + +type WmiClass struct { + session *WmiSession + class *ole.IDispatch + classVar *ole.VARIANT +} + +// WmiInstanceCollection is a slice of WmiClass +type WmiClassCollection []*WmiClass + +// Close all class in a collection +func (wmic *WmiClassCollection) Close() { + for _, i := range *wmic { + i.Close() + } +} + +func CreateWmiClass(classVar *ole.VARIANT, session *WmiSession) (*WmiClass, error) { + return &WmiClass{ + classVar: classVar, + class: classVar.ToIDispatch(), + session: session, + }, nil +} + +// Makes a new instance of the class +func (c *WmiClass) MakeInstance() (*WmiInstance, error) { + rawResult, err := oleutil.CallMethod(c.class, "SpawnInstance_") + if err != nil { + return nil, err + } + + return CreateWmiInstance(rawResult, c.session) +} + +func (c *WmiClass) mustGetSystemProperty(name string) *WmiProperty { + wmiProperty, err := c.GetSystemProperty(name) + if err != nil { + panic("Couldn't retreive a system property. GetSystemProperty failed") + } + + return wmiProperty +} + +func (c *WmiClass) GetSystemProperty(name string) (*WmiProperty, error) { + // Documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemobjectex-systemproperties- + rawResult, err := oleutil.GetProperty(c.class, "SystemProperties_") + if err != nil { + return nil, err + } + + // SWbemObjectEx.SystemProperties_ returns + // an SWbemPropertySet object that contains the collection + // of sytem properties for the c class + sWbemObjectExAsIDispatch := rawResult.ToIDispatch() + defer rawResult.Clear() + + // Get the system property + sWbemProperty, err := oleutil.CallMethod(sWbemObjectExAsIDispatch, "Item", name) + if err != nil { + return nil, err + } + + return CreateWmiProperty(sWbemProperty, c.session) +} + +// ClassName +func (c *WmiClass) GetClassName() string { + class := c.mustGetSystemProperty("__CLASS") + defer class.Close() + + return class.Value().(string) +} + +// SetClassName +func (c *WmiClass) SetClassName(name string) error { + rawResult, err := oleutil.GetProperty(c.class, "Path_") + if err != nil { + return err + } + + pathIDispatch := rawResult.ToIDispatch() + defer rawResult.Clear() + + classRawResult, err := oleutil.PutProperty(pathIDispatch, "Class", name) + if err != nil { + return err + } + defer classRawResult.Clear() + + return nil +} + +// SuperClassName +func (c *WmiClass) GetSuperClassName() string { + superclass := c.mustGetSystemProperty("__SUPERCLASS") + defer superclass.Close() + + return superclass.Value().(string) +} + +// ServerName +func (c *WmiClass) GetServerName() string { + server := c.mustGetSystemProperty("__SERVER") + defer server.Close() + + return server.Value().(string) +} + +// Namespace +func (c *WmiClass) GetNamespace() string { + namespace := c.mustGetSystemProperty("__NAMESPACE") + defer namespace.Close() + + return namespace.Value().(string) +} + +// SuperClass +func (c *WmiClass) GetSuperClass() *WmiClass { + class, err := c.session.GetClass(c.GetSuperClassName()) + if err != nil { + panic("The class for this instance doesn't exist") + } + + return class +} + +// Derivation +func (c *WmiClass) GetDerivation() []string { + valueNameProperty, err := oleutil.GetProperty(c.class, "Derivation_") + if err != nil { + panic("GetDerivation() failed to get the Derivation_ name property") + } + defer valueNameProperty.Clear() + + derivations, err := GetVariantValues(valueNameProperty) + if len(derivations) < 1 { + panic("GetDerivation() failed to get the Derivation_ values") + } + + values := []string{} + for _, derivation := range derivations { + values = append(values, derivation.(string)) + } + + return values +} + +// Properties +func (c *WmiClass) GetPropertiesNames() []string { + values := c.getValueList("Properties_") + + valueNames := []string{} + for _, value := range values { + valueNames = append(valueNames, value.Name()) + } + CloseAllProperties(values) + + return valueNames +} + +// Qualifiers +func (c *WmiClass) GetQualifiersNames() []string { + values := c.getValueList("Qualifiers_") + + valueNames := []string{} + for _, value := range values { + valueNames = append(valueNames, value.Name()) + } + CloseAllProperties(values) + + return valueNames +} + +// Methods +func (c *WmiClass) GetMethodsNames() []string { + values := c.getValueList("Methods_") + + valueNames := []string{} + for _, value := range values { + valueNames = append(valueNames, value.Name()) + } + CloseAllProperties(values) + + return valueNames +} + +// GetProperty gets the property of the instance specified by name and returns in value +func (c *WmiClass) GetProperty(name string) (interface{}, error) { + rawResult, err := oleutil.GetProperty(c.class, name) + if err != nil { + return nil, err + } + + defer rawResult.Clear() + + if rawResult.VT == 0x1 { + return nil, err + } + + return GetVariantValue(rawResult) +} + +// SetProperty sets a value of property representation by name with value +func (c *WmiClass) SetProperty(name string, value interface{}) error { + rawResult, err := oleutil.PutProperty(c.class, name, value) + if err != nil { + return err + } + + defer rawResult.Clear() + return nil +} + +// Commit +func (c *WmiClass) Commit() error { + rawResult, err := oleutil.CallMethod(c.class, "Put_") + if err != nil { + return err + } + defer rawResult.Clear() + return nil + +} + +// Modify +func (c *WmiClass) Modify() error { + return c.Commit() +} + +func (c *WmiClass) getValueList(valuePropertyName string) []*WmiProperty { + valuesProperty, err := oleutil.GetProperty(c.class, valuePropertyName) + if err != nil { + panic("getValueList failed getting valuePropertyName") + } + defer valuesProperty.Clear() + + result := valuesProperty.ToIDispatch() + // Doc: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/automat/dispid-constants + enum_property, err := result.GetProperty("_NewEnum") + if err != nil { + panic("getValueList() failed getting _NewEnum") + } + defer enum_property.Clear() + + // https://docs.microsoft.com/en-us/windows/win32/api/oaidl/nn-oaidl-ienumvariant + enum, err := enum_property.ToIUnknown().IEnumVARIANT(ole.IID_IEnumVariant) + if err != nil { + panic("getValueList() failed getting IID_IEnumVariant") + } + if enum == nil { + return []*WmiProperty{} + } + defer enum.Release() + + properties := []*WmiProperty{} + for valueVariant, length, err := enum.Next(1); length > 0; valueVariant, length, err = enum.Next(1) { + if err != nil { + panic("getValueList() failed to browse the value list") + } + + property, err := CreateWmiProperty(&valueVariant, c.session) + if err != nil { + panic("getValueList() failed to create the WMI property") + } + + properties = append(properties, property) + } + + return properties +} + +// MethodParameters +func (c *WmiClass) MethodParameters(methodName string) []string { + panic("not implemented") + // TODO. Relevant docs: + // https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemmethodset + // https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemmethod +} + +// Invoke static method on a wmi class +func (c *WmiClass) InvokeMethod(methodName string, params ...interface{}) ([]interface{}, error) { + rawResult, err := oleutil.CallMethod(c.class, methodName, params...) + if err != nil { + return nil, err + } + defer rawResult.Clear() + values, err := GetVariantValues(rawResult) + return values, err +} + +// CloseAllClasses +func CloseAllClasses(classes []*WmiClass) { + for _, class := range classes { + class.Close() + } +} + +// Dispose +func (c *WmiClass) Close() error { + return c.classVar.Clear() +} diff --git a/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiEventSink.go b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiEventSink.go new file mode 100644 index 000000000..2d6c83e3f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiEventSink.go @@ -0,0 +1,248 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +// This class wraps a typicaly SWbemSink object. Its implementation is based on the +// SWbemSink documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/receiving-asynchronous-event-notifications +// as well as the winsock example: https://github.com/go-ole/go-ole/blob/master/_example/winsock/winsock.go + +// Note: Please consider the security implications of makig asynchronous calls. +// Documentation: +// https://docs.microsoft.com/en-us/windows/win32/wmisdk/making-an-asynchronous-call-with-vbscript +// https://docs.microsoft.com/en-us/windows/win32/wmisdk/setting-security-on-an-asynchronous-call + +package cim + +import ( + "reflect" + "syscall" + "unsafe" + + ole "github.com/go-ole/go-ole" + "github.com/go-ole/go-ole/oleutil" +) + +var IID_ISWbemObjectPath = &ole.GUID{0x5791BC27, 0xCE9C, 0x11d1, [8]byte{0x97, 0xBF, 0x00, 0x00, 0xF8, 0x1E, 0x84, 0x9C}} +var IID_ISWbemSinkEvents = &ole.GUID{0x75718CA0, 0xF029, 0x11d1, [8]byte{0xA1, 0xAC, 0x00, 0xC0, 0x4F, 0xB6, 0xC2, 0x23}} + +const ( + eventSinkObjectName = "WbemScripting.SWbemSink" + iSWbemSinkEventsGuid = "{75718CA0-F029-11D1-A1AC-00C04FB6C223}" +) + +type WmiEventSink struct { + lpVtbl *WmiEventSinkVtbl + ref int32 + instance *ole.IDispatch + unknown *ole.IUnknown + closed bool + session *WmiSession + onObjectReady func(interface{}, []*WmiInstance) + onCompleted func(interface{}, []*WmiInstance) + onProgress func(interface{}, []*WmiInstance) + onObjectPut func(interface{}, []*WmiInstance) + callbackContext interface{} +} + +type WmiEventSinkVtbl struct { + pQueryInterface uintptr + pAddRef uintptr + pRelease uintptr + pGetTypeInfoCount uintptr + pGetTypeInfo uintptr + pGetIDsOfNames uintptr + pInvoke uintptr +} + +// DISPPARAMS are the arguments that passed to methods or property. +type DISPPARAMS struct { + rgvarg uintptr + rgdispidNamedArgs uintptr + cArgs uint32 + cNamedArgs uint32 +} + +func CreateWmiEventSink(session *WmiSession, callbackContext interface{}, onObjectReady func(interface{}, []*WmiInstance), onCompleted func(interface{}, []*WmiInstance), onProgress func(interface{}, []*WmiInstance), onObjectPut func(interface{}, []*WmiInstance)) (*WmiEventSink, error) { + eventSinkObject, err := oleutil.CreateObject(eventSinkObjectName) + if err != nil { + return nil, err + } + + eventSinkInstance, err := eventSinkObject.QueryInterface(ole.IID_IDispatch) + if err != nil { + return nil, err + } + + wmiEventSink := &WmiEventSink{} + wmiEventSink.lpVtbl = &WmiEventSinkVtbl{} + wmiEventSink.lpVtbl.pQueryInterface = syscall.NewCallback(queryInterface) + wmiEventSink.lpVtbl.pAddRef = syscall.NewCallback(addRef) + wmiEventSink.lpVtbl.pRelease = syscall.NewCallback(release) + wmiEventSink.lpVtbl.pGetTypeInfoCount = syscall.NewCallback(getTypeInfoCount) + wmiEventSink.lpVtbl.pGetTypeInfo = syscall.NewCallback(getTypeInfo) + wmiEventSink.lpVtbl.pGetIDsOfNames = syscall.NewCallback(getIDsOfNames) + wmiEventSink.lpVtbl.pInvoke = syscall.NewCallback(invoke) + wmiEventSink.onObjectReady = onObjectReady + wmiEventSink.onCompleted = onCompleted + wmiEventSink.onProgress = onProgress + wmiEventSink.onObjectPut = onObjectPut + wmiEventSink.callbackContext = callbackContext + wmiEventSink.instance = eventSinkInstance + wmiEventSink.unknown = eventSinkObject + wmiEventSink.session = session + + return wmiEventSink, nil +} + +func (c *WmiEventSink) Connect() (cookie uint32, err error) { + cookie = 0 + err = nil + + connectionPointContainer, err := c.instance.QueryInterface(ole.IID_IConnectionPointContainer) + if err != nil { + return + } + defer connectionPointContainer.Release() + + container := (*ole.IConnectionPointContainer)(unsafe.Pointer(connectionPointContainer)) + + var point *ole.IConnectionPoint + err = container.FindConnectionPoint(IID_ISWbemSinkEvents, &point) + if err != nil { + return + } + + return point.Advise((*ole.IUnknown)(unsafe.Pointer(c))) +} + +func (c *WmiEventSink) GetAndDispatchMessages() { + for c.ref != 0 { + var m ole.Msg + ole.GetMessage(&m, 0, 0, 0) + ole.DispatchMessage(&m) + } +} + +func (c *WmiEventSink) IsReadyToClose() bool { + return (c.ref == 0) +} + +func (c *WmiEventSink) PeekAndDispatchMessages() bool { + var m ole.Msg + msgAvailable, err := PeekMessage(&m, 0, 0, 0, PM_REMOVE) + if err != nil { + return false + } + + if msgAvailable { + ole.DispatchMessage(&m) + } + + return msgAvailable +} + +func (c *WmiEventSink) IsClosed() bool { + return c.closed +} +func (c *WmiEventSink) Close() { + if c.instance != nil { + c.instance.Release() + c.instance = nil + } + if c.unknown != nil { + c.unknown.Release() + c.unknown = nil + } + c.closed = true +} + +/////////////////////////////// Private methods and callbacks ///////////////////////////////////////////////////// + +func queryInterface(this *ole.IUnknown, iid *ole.GUID, punk **ole.IUnknown) uintptr { + s, _ := ole.StringFromCLSID(iid) + + *punk = nil + if ole.IsEqualGUID(iid, ole.IID_IUnknown) || + ole.IsEqualGUID(iid, ole.IID_IDispatch) { + addRef(this) + *punk = this + return ole.S_OK + } + if s == iSWbemSinkEventsGuid { + addRef(this) + *punk = this + return ole.S_OK + } + + return ole.E_NOINTERFACE +} + +func addRef(this *ole.IUnknown) uintptr { + pthis := (*WmiEventSink)(unsafe.Pointer(this)) + pthis.ref++ + return uintptr(pthis.ref) +} + +func release(this *ole.IUnknown) uintptr { + pthis := (*WmiEventSink)(unsafe.Pointer(this)) + pthis.ref-- + return uintptr(pthis.ref) +} + +func getIDsOfNames(this *ole.IUnknown, iid *ole.GUID, wnames **uint16, namelen int, lcid int, pdisp *int32) uintptr { + var pdispSlice []int32 + sliceHeader := (*reflect.SliceHeader)((unsafe.Pointer(&pdispSlice))) + sliceHeader.Cap = namelen + sliceHeader.Len = namelen + sliceHeader.Data = uintptr(unsafe.Pointer(pdisp)) + + var pwnamesSlice []*uint16 + sliceHeader2 := (*reflect.SliceHeader)((unsafe.Pointer(&pwnamesSlice))) + sliceHeader2.Cap = namelen + sliceHeader2.Len = namelen + sliceHeader2.Data = uintptr(unsafe.Pointer(wnames)) + + for n := 0; n < namelen; n++ { + pdispSlice[n] = int32(n) + } + return uintptr(ole.S_OK) +} + +func getTypeInfoCount(pcount *int) uintptr { + if pcount != nil { + *pcount = 0 + } + return uintptr(ole.S_OK) +} + +func getTypeInfo(ptypeif *uintptr) uintptr { + return uintptr(ole.E_NOTIMPL) +} + +func invoke(this *ole.IDispatch, dispid int, riid *ole.GUID, lcid int, flags int16, rawdispparams *DISPPARAMS, result *ole.VARIANT, pexcepinfo *ole.EXCEPINFO, nerr *uint) uintptr { + pthis := (*WmiEventSink)(unsafe.Pointer(this)) + if pthis.IsClosed() { + return ole.S_OK + } + + dispparams := GetDispParamsFromRaw(rawdispparams) + wmiEventInstances, err := GetVariantArrayAsWmiInstances(dispparams.rgvarg, pthis.session) + if err != nil { + return ole.S_OK + } + switch dispid { + case 1: + pthis.onObjectReady(pthis.callbackContext, wmiEventInstances) + return ole.S_OK + case 2: + pthis.onCompleted(pthis.callbackContext, wmiEventInstances) + return ole.S_OK + case 3: + pthis.onProgress(pthis.callbackContext, wmiEventInstances) + return ole.S_OK + case 4: + pthis.onObjectPut(pthis.callbackContext, wmiEventInstances) + return ole.S_OK + default: + } + return ole.E_NOTIMPL +} diff --git a/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiHelper.go b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiHelper.go new file mode 100644 index 000000000..322fe9156 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiHelper.go @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +package cim + +import ( + "reflect" + "syscall" + "unsafe" + + "github.com/go-ole/go-ole" + "golang.org/x/sys/windows" + "strings" +) + +// Additional calls +var ( + modole32 = windows.NewLazySystemDLL("ole32.dll") + moduser32 = windows.NewLazySystemDLL("user32.dll") + + procCoInitializeSecurity = modole32.NewProc("CoInitializeSecurity") + procPeekMessageW = moduser32.NewProc("PeekMessageW") +) + +type RemoveMessageFlags uint32 + +const ( + PM_NOREMOVE RemoveMessageFlags = 0 + PM_REMOVE RemoveMessageFlags = 1 + PM_NOYIELD RemoveMessageFlags = 2 +) + +type RpcAuthenticationLevel uint32 + +const ( + RPC_C_AUTHN_LEVEL_DEFAULT RpcAuthenticationLevel = 0 + RPC_C_AUTHN_LEVEL_NONE RpcAuthenticationLevel = 1 + RPC_C_AUTHN_LEVEL_CONNECT RpcAuthenticationLevel = 2 + RPC_C_AUTHN_LEVEL_CALL RpcAuthenticationLevel = 3 + RPC_C_AUTHN_LEVEL_PKT RpcAuthenticationLevel = 4 + RPC_C_AUTHN_LEVEL_PKT_INTEGRITY RpcAuthenticationLevel = 5 + RPC_C_AUTHN_LEVEL_PKT_PRIVACY RpcAuthenticationLevel = 6 +) + +type RpcImpersonationLevel uint32 + +const ( + RPC_C_IMP_LEVEL_DEFAULT RpcImpersonationLevel = 0 + RPC_C_IMP_LEVEL_ANONYMOUS RpcImpersonationLevel = 1 + RPC_C_IMP_LEVEL_IDENTIFY RpcImpersonationLevel = 2 + RPC_C_IMP_LEVEL_IMPERSONATE RpcImpersonationLevel = 3 + RPC_C_IMP_LEVEL_DELEGATE RpcImpersonationLevel = 4 +) + +type tagEOLE_AUTHENTICATION_CAPABILITIES uint32 + +const ( + EOAC_NONE tagEOLE_AUTHENTICATION_CAPABILITIES = 0 + EOAC_MUTUAL_AUTH tagEOLE_AUTHENTICATION_CAPABILITIES = 0x1 + EOAC_STATIC_CLOAKING tagEOLE_AUTHENTICATION_CAPABILITIES = 0x20 + EOAC_DYNAMIC_CLOAKING tagEOLE_AUTHENTICATION_CAPABILITIES = 0x40 + EOAC_ANY_AUTHORITY tagEOLE_AUTHENTICATION_CAPABILITIES = 0x80 + EOAC_MAKE_FULLSIC tagEOLE_AUTHENTICATION_CAPABILITIES = 0x100 + EOAC_DEFAULT tagEOLE_AUTHENTICATION_CAPABILITIES = 0x800 + EOAC_SECURE_REFS tagEOLE_AUTHENTICATION_CAPABILITIES = 0x2 + EOAC_ACCESS_CONTROL tagEOLE_AUTHENTICATION_CAPABILITIES = 0x4 + EOAC_APPID tagEOLE_AUTHENTICATION_CAPABILITIES = 0x8 + EOAC_DYNAMIC tagEOLE_AUTHENTICATION_CAPABILITIES = 0x10 + EOAC_REQUIRE_FULLSIC tagEOLE_AUTHENTICATION_CAPABILITIES = 0x200 + EOAC_AUTO_IMPERSONATE tagEOLE_AUTHENTICATION_CAPABILITIES = 0x400 + EOAC_NO_CUSTOM_MARSHAL tagEOLE_AUTHENTICATION_CAPABILITIES = 0x2000 + EOAC_DISABLE_AAA tagEOLE_AUTHENTICATION_CAPABILITIES = 0x1000 +) + +const ( + RPC_E_TOO_LATE uint32 = 0x80010119 +) + +func GetVariantValue(rawValue *ole.VARIANT) (interface{}, error) { + array := rawValue.ToArray() + if array == nil { + return rawValue.Value(), nil + } + return array.ToValueArray(), nil +} + +func GetVariantValues(rawValue *ole.VARIANT) ([]interface{}, error) { + + var values []interface{} + array := rawValue.ToArray() + + if array == nil { + // Not an array + values = append(values, rawValue.Value()) + } else { + values = array.ToValueArray() + } + + return values, nil +} + +type DispParams struct { + rgvarg []ole.VARIANT + rgdispidNamedArgs []int32 +} + +func GetDispParamsFromRaw(dispparams *DISPPARAMS) *DispParams { + + // convert the DISPPARAMS to a slice header + params := DispParams{} + + var slice1 []ole.VARIANT + sliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&slice1)) + sliceHeader.Data = dispparams.rgvarg + sliceHeader.Len = int(dispparams.cArgs) + sliceHeader.Cap = int(dispparams.cArgs) + params.rgvarg = make([]ole.VARIANT, dispparams.cArgs) + copy(params.rgvarg, slice1) + + var slice2 []int32 + sliceHeader = (*reflect.SliceHeader)(unsafe.Pointer(&slice2)) + sliceHeader.Data = dispparams.rgdispidNamedArgs + sliceHeader.Len = int(dispparams.cNamedArgs) + sliceHeader.Cap = int(dispparams.cNamedArgs) + params.rgdispidNamedArgs = make([]int32, dispparams.cNamedArgs) + copy(params.rgdispidNamedArgs, slice2) + + return ¶ms +} + +func GetVariantArrayAsWmiInstances(rawValues []ole.VARIANT, session *WmiSession) (WmiInstanceCollection, error) { + wcol := WmiInstanceCollection{} + for _, rawValue := range rawValues { + // skip wrong types and empty objects + if rawValue.VT != ole.VT_DISPATCH || rawValue.Val == 0 { + continue + } + + instance, err := CreateWmiInstance(&rawValue, session) + if err != nil { + return nil, err + } + wcol = append(wcol, instance) + } + + return wcol, nil +} + +func GetVariantArrayValues(rawValues []ole.VARIANT) ([]interface{}, error) { + var values []interface{} + + for _, rawValue := range rawValues { + array := rawValue.ToArray() + + if array == nil { + // Not an array + values = append(values, rawValue.Value()) + } else { + values = append(values, array.ToValueArray()) + } + } + + return values, nil +} + +func EscapeQueryValue(rawString string) string { + // Double the backslash character as per required by the "WHERE" WMI clause + // Documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/where-clause + // Interestingly, double quotes don't seem to need escaping. + return strings.ReplaceAll(strings.ReplaceAll(rawString, "\\", "\\\\"), "'", "\\'") +} + +func FindStringInSlice(stringList []string, value string) (int, bool) { + for i, item := range stringList { + if item == value { + return i, true + } + } + return -1, false +} + +// PeekMessage in message queue from runtime. +// +// This function appears to block. PeekMessage does not block. +func PeekMessage(msg *ole.Msg, hwnd uint32, MsgFilterMin uint32, MsgFilterMax uint32, RemoveMsg RemoveMessageFlags) (ret bool, err error) { + r0, _, err := syscall.Syscall6(procPeekMessageW.Addr(), 5, uintptr(unsafe.Pointer(msg)), uintptr(hwnd), uintptr(MsgFilterMin), uintptr(MsgFilterMax), uintptr(RemoveMsg), 0) + ret = bool(r0 > 0) + return +} + +func CoInitializeSecurity(authLevel RpcAuthenticationLevel, impLevel RpcImpersonationLevel) (err error) { + // https://docs.microsoft.com/en-us/windows/win32/wmisdk/setting-the-default-process-security-level-using-c- + hr, _, _ := syscall.Syscall9(procCoInitializeSecurity.Addr(), 9, uintptr(0), ^uintptr(0), uintptr(0), uintptr(0), uintptr(authLevel), uintptr(impLevel), uintptr(0), uintptr(EOAC_NONE), uintptr(0)) + if hr != 0 { + err = ole.NewError(hr) + } + return +} diff --git a/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiInstance.go b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiInstance.go new file mode 100644 index 000000000..4583fab56 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiInstance.go @@ -0,0 +1,527 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +// This class implement a wrapper of the SWbemObject class (from an instance perspective). +// Documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemobject + +package cim + +import ( + "fmt" + "log" + + "github.com/microsoft/wmi/pkg/base/host" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + + "github.com/go-ole/go-ole" + "github.com/go-ole/go-ole/oleutil" +) + +type UserAction uint32 + +const ( + None UserAction = 0 + Async UserAction = 1 + Wait UserAction = 2 + Cancel UserAction = 3 + Default UserAction = 4 +) + +// WmiInstance is a representation of a WMI instance +type WmiInstance struct { + class *WmiClass + session *WmiSession + instance *ole.IDispatch + instanceVar *ole.VARIANT +} + +// WmiInstanceCollection is a slice of WmiInstance +type WmiInstanceCollection []*WmiInstance + +func (wmic *WmiInstanceCollection) EmbeddedXMLInstances() (xmls []string, err error) { + for _, inst := range *wmic { + xml, err1 := inst.EmbeddedXMLInstance() + if err1 != nil { + err = err1 + return + } + xmls = append(xmls, xml) + } + return +} + +// Close all instances in a collection +func (wmic *WmiInstanceCollection) Close() { + for _, i := range *wmic { + i.Close() + } +} + +func CreateWmiInstance(instanceVar *ole.VARIANT, session *WmiSession) (*WmiInstance, error) { + return &WmiInstance{ + instanceVar: instanceVar, + instance: instanceVar.ToIDispatch(), + session: session, + }, nil +} + +// GetInstance returns the latest Instance +func (c *WmiInstance) GetInstance() (*WmiInstance, error) { + return c.session.GetInstance(c.InstancePath()) +} +func (c *WmiInstance) GetSession() *WmiSession { + return c.session +} +func (c *WmiInstance) GetWmiHost() *host.WmiHost { + return c.session.WMIHost +} + +func (c *WmiInstance) GetIDispatch() *ole.IDispatch { + return c.instance +} +func (c *WmiInstance) GetRawInstance() *ole.VARIANT { + return c.instanceVar +} + +func (c *WmiInstance) GetSystemProperty(name string) (*WmiProperty, error) { + // Documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemobjectex-systemproperties- + rawResult, err := oleutil.GetProperty(c.instance, "SystemProperties_") + if err != nil { + return nil, err + } + + // SWbemObjectEx.SystemProperties_ returns + // an SWbemPropertySet object that contains the collection + // of sytem properties for the c class + sWbemObjectExAsIDispatch := rawResult.ToIDispatch() + defer rawResult.Clear() + + // Get the system property + sWbemProperty, err := oleutil.CallMethod(sWbemObjectExAsIDispatch, "Item", name) + if err != nil { + return nil, err + } + + property, err := CreateWmiProperty(sWbemProperty, c.session) + if err != nil { + return nil, err + } + + return property, nil +} + +// GetProperty gets the property of the instance specified by name and returns in value +func (c *WmiInstance) GetProperty(name string) (interface{}, error) { + rawResult, err := oleutil.GetProperty(c.instance, name) + if err != nil { + return nil, err + } + + defer rawResult.Clear() + + if rawResult.VT == 0x1 { + return nil, err + } + + return GetVariantValue(rawResult) +} + +// SetProperty sets a value of property representation by name with value +func (c *WmiInstance) SetProperty(name string, value interface{}) error { + rawResult, err := oleutil.PutProperty(c.instance, name, value) + if err != nil { + log.Printf("[WMI] SetProperty Name[%s] Value[%+v] Err[%+v]\n", name, value, err) + return err + } + + defer rawResult.Clear() + return nil +} + +// ResetProperty resets a property +func (c *WmiInstance) ResetProperty(name string) error { + return c.SetProperty(name, nil) +} + +// GetClassName +func (c *WmiInstance) GetClassName() string { + className, err := c.GetSystemProperty("__CLASS") + if err != nil { + panic("The class doesn't have a __CLASS member " + err.Error()) + } + if className == nil { + panic("The __CLASS member doesn't contain one element, while it was expected to be") + } + defer className.Close() + + return className.Value().(string) +} + +// Class +func (c *WmiInstance) GetClass() *WmiClass { + class, err := c.session.GetClass(c.GetClassName()) + if err != nil { + panic("The class for this instance doesn't exist" + err.Error()) + } + + return class +} + +// EmbeddedXMLInstance +func (c *WmiInstance) EmbeddedXMLInstance() (string, error) { + rawResult, err := oleutil.CallMethod(c.instance, "GetText_", 1) + if err != nil { + return "", err + } + defer rawResult.Clear() + return rawResult.ToString(), err +} + +func (c *WmiInstance) String() string { + return c.InstancePath() +} + +// EmbeddedInstance +func (c *WmiInstance) EmbeddedInstance() (string, error) { + rawResult, err := oleutil.CallMethod(c.instance, "GetObjectText_") + if err != nil { + return "", err + } + defer rawResult.Clear() + return rawResult.ToString(), err +} + +// Equals +func (c *WmiInstance) Equals(instance *WmiInstance) bool { + rawResult, err := oleutil.CallMethod(c.instance, "CompareTo_", instance.instance) + if err != nil { + return false + } + defer rawResult.Clear() + value, err := GetVariantValue(rawResult) + if err != nil { + return false + } + + return value.(bool) +} + +// Clone +func (c *WmiInstance) Clone() (*WmiInstance, error) { + rawResult, err := oleutil.CallMethod(c.instance, "Clone_") + winstance, err := CreateWmiInstance(rawResult, c.session) + return winstance, err +} + +// Refresh +func (c *WmiInstance) Refresh() error { + rawResult, err := oleutil.CallMethod(c.instance, "Refresh_") + if err != nil { + return err + } + defer rawResult.Clear() + return nil +} + +// Commit +func (c *WmiInstance) Commit() error { + rawResult, err := oleutil.CallMethod(c.instance, "Put_") + if err != nil { + return err + } + defer rawResult.Clear() + return nil + +} + +// Modify +func (c *WmiInstance) Modify() error { + return c.Commit() +} + +// Delete +func (c *WmiInstance) Delete() error { + rawResult, err := oleutil.CallMethod(c.instance, "Delete_") + if err != nil { + return err + } + defer rawResult.Clear() + return nil +} + +// InstancePath +func (c *WmiInstance) InstancePath() string { + path, err := c.GetSystemProperty("__PATH") + if err != nil { + panic("The instance doesn't have a path " + err.Error()) + } + defer path.Close() + + return path.Value().(string) +} + +// RelativePath +func (c *WmiInstance) RelativePath() string { + path, err := c.GetSystemProperty("__RELPATH") + if err != nil { + panic("The instance doesn't have a path" + err.Error()) + } + defer path.Close() + + return path.Value().(string) +} + +// InvokeMethod +func (c *WmiInstance) InvokeMethod(methodName string, params ...interface{}) ([]interface{}, error) { + rawResult, err := oleutil.CallMethod(c.instance, methodName, params...) + if err != nil { + return nil, err + } + defer rawResult.Clear() + values, err := GetVariantValues(rawResult) + return values, err +} + +func (c *WmiInstance) GetWmiMethod(methodName string) (*WmiMethod, error) { + return NewWmiMethod(methodName, c) +} + +// InvokeMethodAsync +func (c *WmiInstance) InvokeMethodAsync(methodName string, action UserAction, percentComplete, timeoutSeconds uint32, params ...interface{}) ([]interface{}, error) { + rawResult, err := oleutil.CallMethod(c.instance, methodName, params...) + if err != nil { + return nil, err + } + defer rawResult.Clear() + return GetVariantValues(rawResult) +} + +// InvokeMethodWithReturn invokes a method with return +func (c *WmiInstance) InvokeMethodWithReturn(methodName string, params ...interface{}) (int32, error) { + results, err := c.InvokeMethod(methodName, params...) + if err != nil { + return 0, err + } + + // Does not have any results + if results == nil || len(results) == 0 || results[0] == nil { + return 0, nil + } + + return results[0].(int32), nil +} + +// GetAllRelatedWithQuery returns all related instances matching the query +func (c *WmiInstance) GetAllRelatedWithQuery(q *query.WmiQuery) (WmiInstanceCollection, error) { + winstances, err := c.GetAllRelated(q.ClassName) + if err != nil { + return nil, err + } + + if !q.HasFilter() { + return winstances, nil + } + + defer winstances.Close() + // For now, only Equals is implemented + filter := q.Filters[0] + filteredCollection := WmiInstanceCollection{} + for _, inst := range winstances { + propVal, err := inst.GetProperty(filter.Name) + if err != nil { + continue + } + propString := fmt.Sprintf("%v", propVal) + if propString == filter.Value { + clins, err := inst.Clone() + if err != nil { + return nil, err + } + filteredCollection = append(filteredCollection, clins) + continue + } + } + return filteredCollection, nil +} + +// GetAllRelated +func (c *WmiInstance) GetAllRelated(resultClassName string) (WmiInstanceCollection, error) { + return c.GetAssociated("", resultClassName, "", "") +} + +// GetRelated +func (c *WmiInstance) GetRelated(resultClassName string) (*WmiInstance, error) { + result, err := c.GetAllRelated(resultClassName) + if err != nil { + return nil, err + } + + if len(result) == 0 { + return nil, errors.Wrapf(errors.NotFound, "No Related Items were received for [%s]", resultClassName) + } + return result[0], nil +} + +// GetRelatedEx +func (c *WmiInstance) GetRelatedEx(associatedClassName, resultClassName, resultRole, sourceRole string) (WmiInstanceCollection, error) { + return c.GetAssociated(associatedClassName, resultClassName, resultRole, sourceRole) +} + +// GetFirstRelatedEx +func (c *WmiInstance) GetFirstRelatedEx(associatedClassName, resultClassName, resultRole, sourceRole string) (*WmiInstance, error) { + col, err := c.GetAssociated(associatedClassName, resultClassName, resultRole, sourceRole) + if err != nil { + return nil, err + } + defer col.Close() + + if len(col) == 0 { + return nil, errors.Wrapf(errors.NotFound, "No Related Items were received for [%s]", resultClassName) + } + + return col[0].Clone() +} + +func (c *WmiInstance) GetAssociatedEx(associatedClassName string) (WmiInstanceCollection, error) { + return c.GetAssociated(associatedClassName, "", "", "") +} + +// GetAssociated +func (c *WmiInstance) GetAssociated(associatedClassName, resultClassName, resultRole, sourceRole string) (WmiInstanceCollection, error) { + // Documentation here: https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemobject-associators- + rawResult, err := oleutil.CallMethod(c.instance, "Associators_", + associatedClassName, + resultClassName, + resultRole, + sourceRole, + ) + if err != nil { + return nil, err + } + + result := rawResult.ToIDispatch() + defer rawResult.Clear() + + // Doc: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/automat/dispid-constants + enum_property, err := result.GetProperty("_NewEnum") + if err != nil { + return nil, err + } + defer enum_property.Clear() + + // https://docs.microsoft.com/en-us/windows/win32/api/oaidl/nn-oaidl-ienumvariant + enum, err := enum_property.ToIUnknown().IEnumVARIANT(ole.IID_IEnumVariant) + if err != nil { + return nil, err + } + if enum == nil { + return nil, fmt.Errorf("Enum is nil") + } + + defer enum.Release() + + wmiInstances := WmiInstanceCollection{} + for tmp, length, err := enum.Next(1); length > 0; tmp, length, err = enum.Next(1) { + //defer func() { + // if err != nil { + // wmiInstances.Close() + // } + //}() + if err != nil { + return nil, err + } + + wmiInstance, err := CreateWmiInstance(&tmp, c.session) + if err != nil { + // tmp.Clear() + return nil, err + } + + wmiInstances = append(wmiInstances, wmiInstance) + } + + //if len(wmiInstances) == 0 { + // return nil, errors.Wrapf(errors.NotFound, "GetAssociated [%s] [%s]", associatedClassName, resultClassName) + //} + + return wmiInstances, nil +} + +// GetReferences +func (c *WmiInstance) GetReferences(associatedClassName string) (WmiInstanceCollection, error) { + return c.EnumerateReferencingInstances(associatedClassName, "") +} + +// EnumerateReferencingInstances +func (c *WmiInstance) EnumerateReferencingInstances(resultClassName, sourceRole string) (WmiInstanceCollection, error) { + //Documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemobject-references- + rawResult, err := oleutil.CallMethod(c.instance, "References_", resultClassName, sourceRole) + if err != nil { + return nil, err + } + + result := rawResult.ToIDispatch() + defer rawResult.Clear() + + // Doc: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/automat/dispid-constants + enum_property, err := result.GetProperty("_NewEnum") + if err != nil { + return nil, err + } + defer enum_property.Clear() + + // https://docs.microsoft.com/en-us/windows/win32/api/oaidl/nn-oaidl-ienumvariant + enum, err := enum_property.ToIUnknown().IEnumVARIANT(ole.IID_IEnumVariant) + if err != nil { + return nil, err + } + if enum == nil { + return nil, fmt.Errorf("Enum is nil") + } + + defer enum.Release() + + wmiInstances := WmiInstanceCollection{} + for tmp, length, err := enum.Next(1); length > 0; tmp, length, err = enum.Next(1) { + //defer func() { + // if err != nil { + // wmiInstances.Close() + // } + //}() + + if err != nil { + return nil, err + } + + wmiInstance, err := CreateWmiInstance(&tmp, c.session) + if err != nil { + //tmp.Clear() + return nil, err + } + + wmiInstances = append(wmiInstances, wmiInstance) + } + + return wmiInstances, nil +} + +// CloseAllInstances +func CloseAllInstances(instances []*WmiInstance) { + for _, instance := range instances { + instance.Close() + } +} + +// Close +func (c *WmiInstance) Close() (err error) { + if c.instanceVar != nil { + // https://docs.microsoft.com/en-us/windows/win32/api/oleauto/nf-oleauto-variantclear + // VariantClear would release the reference if its VT_DISPATCH. + // In our case, WmiInstance holds only VT_DISPATCH + c.instanceVar.Clear() + c.instanceVar = nil + } + + return +} diff --git a/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiJob.go b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiJob.go new file mode 100644 index 000000000..941e6a5e9 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiJob.go @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +// This class implements the swbemproperty class +// Documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemmethod + +package cim + +import ( + "fmt" + "time" + + "github.com/microsoft/wmi/pkg/errors" +) + +// JobState +type JobState int + +const ( + // New enum + JobState_Unknown JobState = 0 + // New enum + JobState_New JobState = 2 + // Starting enum + JobState_Starting JobState = 3 + // Running enum + JobState_Running JobState = 4 + // Suspended enum + JobState_Suspended JobState = 5 + // Shutting_Down enum + JobState_Shutting_Down JobState = 6 + // Completed enum + JobState_Completed JobState = 7 + // Terminated enum + JobState_Terminated JobState = 8 + // Killed enum + JobState_Killed JobState = 9 + // Exception enum + JobState_Exception JobState = 10 + // Service enum + JobState_Service JobState = 11 + // Query_Pending enum + JobState_Query_Pending JobState = 12 + // DMTF_Reserved enum + JobState_DMTF_Reserved JobState = 13 + // Vendor_Reserved enum + JobState_Vendor_Reserved JobState = 14 +) + +type WmiJob struct { + *WmiInstance +} + +func NewWmiJob(instance *WmiInstance) (*WmiJob, error) { + return &WmiJob{instance}, nil +} + +func (job *WmiJob) String() string { + jtype, err := job.JobType() + if err != nil { + return "" + } + return fmt.Sprintf("Type[%s] State[%s]", jtype, job.GetJobState()) +} + +// GetJobType gets the value of JobType for the instance +func (job *WmiJob) JobType() (value int32, err error) { + retValue, err := job.GetProperty("JobType") + if err != nil { + return + } + value, ok := retValue.(int32) + if !ok { + // TODO: Set an error + } + return +} + +// WaitForPercentComplete waits for the percentComplete or timeout +func (job *WmiJob) WaitForPercentComplete(percentComplete uint16, timeoutSeconds int16) error { + start := time.Now() + + // Run the loop, only if the job is actually running + for !job.IsComplete() { + pComplete, err := job.PercentComplete() + if err != nil { + return err + } + // Break if have achieved the target + if pComplete >= percentComplete { + break + } + time.Sleep(100 * time.Millisecond) + + // Infinite Loop + if timeoutSeconds < 0 { + continue + } + + // If we have waited enough time, return with a timeout error + if time.Since(start) > (time.Duration(timeoutSeconds) * time.Second) { + state := job.GetJobState() + exception := job.GetException() + return errors.Wrapf(errors.Timedout, "WaitForPercentComplete timeout. Current state: [%v], Exception: [%v]", state, exception) + } + } + + return job.GetException() +} + +// WaitForAction waits for the task based on the action type, percent complete and timeoutSeconds +func (job *WmiJob) WaitForAction(action UserAction, percentComplete uint16, timeoutSeconds int16) error { + switch action { + case Wait: + return job.WaitForPercentComplete(percentComplete, timeoutSeconds) + case Cancel: + return job.WaitForPercentComplete(percentComplete, timeoutSeconds) + case None: + fallthrough + case Default: + fallthrough + case Async: + break + } + return nil +} + +// PercentComplete +func (job *WmiJob) PercentComplete() (uint16, error) { + err := job.Refresh() + if err != nil { + return 0, err + } + retValue, err := job.GetProperty("PercentComplete") + if err != nil { + return 0, err + } + return uint16(retValue.(int32)), nil +} + +func (job *WmiJob) GetJobState() (js JobState) { + state, err := job.GetProperty("JobState") + if err != nil { + return + } + js = JobState(state.(int32)) + return +} + +func (job *WmiJob) IsComplete() bool { + err := job.Refresh() + if err != nil { + + } + state := job.GetJobState() + switch state { + case JobState_New: + fallthrough + case JobState_Starting: + fallthrough + case JobState_Running: + fallthrough + case JobState_Suspended: + fallthrough + case JobState_Shutting_Down: + return false + case JobState_Completed: + fallthrough + case JobState_Terminated: + fallthrough + case JobState_Killed: + fallthrough + case JobState_Exception: + return true + } + return false +} + +func (job *WmiJob) GetException() error { + job.Refresh() + state := job.GetJobState() + switch state { + case JobState_Terminated: + fallthrough + case JobState_Killed: + fallthrough + case JobState_Exception: + errorCodeVal, _ := job.GetProperty("ErrorCode") + errorCode := uint16(errorCodeVal.(int32)) + errorDescriptionVal, _ := job.GetProperty("ErrorDescription") + errorDescription, _ := errorDescriptionVal.(string) + errorSummaryDescriptionVal, _ := job.GetProperty("ErrorSummaryDescription") + errorSummaryDescription, _ := errorSummaryDescriptionVal.(string) + return errors.Wrapf(errors.NewWMIError(errorCode), + "ErrorCode[%d] ErrorDescription[%s] ErrorSummaryDescription [%s]", + errorCode, errorDescription, errorSummaryDescription) + } + return nil +} + +func (job *WmiJob) WaitForJobCompletion(result int32, timeoutSeconds int16) error { + if result == 0 { + return nil + } else if result == 4096 { + return job.WaitForAction(Wait, 100, timeoutSeconds) + } else { + return errors.Wrapf(errors.Failed, "Unable to Wait for Job on Result[%d] ", result) + } + +} + +type WmiJobCollection []*WmiJob + +func (c *WmiJobCollection) Close() error { + var err error + for _, p := range *c { + err = p.Close() + } + return err +} diff --git a/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiMethod.go b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiMethod.go new file mode 100644 index 000000000..b1be6e8a9 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiMethod.go @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +// This class implements the swbemproperty class +// Documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemmethod + +package cim + +import ( + "log" + + "github.com/go-ole/go-ole" + "github.com/go-ole/go-ole/oleutil" + "github.com/microsoft/wmi/pkg/errors" +) + +type WmiMethod struct { + Name string + // Reference + session *WmiSession + // Reference + classInstance *WmiInstance +} + +type WmiMethodResult struct { + ReturnValue int32 + OutMethodParams map[string]*WmiMethodParam +} + +// NewWmiMethod +func NewWmiMethod(methodName string, instance *WmiInstance) (*WmiMethod, error) { + return &WmiMethod{ + Name: methodName, + classInstance: instance, + session: instance.GetSession(), + }, nil +} + +func (c *WmiMethod) addInParam(inparamVariant *ole.VARIANT, paramName string, paramValue interface{}) error { + rawProperties, err := inparamVariant.ToIDispatch().GetProperty("Properties_") + if err != nil { + return err + } + defer rawProperties.Clear() + rawProperty, err := rawProperties.ToIDispatch().CallMethod("Item", paramName) + if err != nil { + return err + } + defer rawProperty.Clear() + + p, err := rawProperty.ToIDispatch().PutProperty("Value", paramValue) + if err != nil { + return err + } + defer p.Clear() + return nil +} + +func (c *WmiMethod) Execute(inParam, outParam WmiMethodParamCollection) (result *WmiMethodResult, err error) { + log.Printf("[WMI] - Executing Method [%s]\n", c.Name) + + iDispatchInstance := c.classInstance.GetIDispatch() + if iDispatchInstance == nil { + return nil, errors.Wrapf(errors.InvalidInput, "InvalidInstance") + } + rawResult, err := iDispatchInstance.GetProperty("Methods_") + if err != nil { + return nil, err + } + defer rawResult.Clear() + // Retrive the method + rawMethod, err := rawResult.ToIDispatch().CallMethod("Item", c.Name) + if err != nil { + return nil, err + } + defer rawMethod.Clear() + + inparamsRaw, err := rawMethod.ToIDispatch().GetProperty("InParameters") + if err != nil { + return nil, err + } + defer inparamsRaw.Clear() + + inparams, err := oleutil.CallMethod(inparamsRaw.ToIDispatch(), "SpawnInstance_") + if err != nil { + return nil, err + } + defer inparams.Clear() + + for _, inp := range inParam { + // log.Printf("InParam [%s]=>[%+v]\n", inp.Name, inp.Value) + c.addInParam(inparams, inp.Name, inp.Value) + } + + result = &WmiMethodResult{ + OutMethodParams: map[string]*WmiMethodParam{}, + } + outparams, err := c.classInstance.GetIDispatch().CallMethod("ExecMethod_", c.Name, inparams) + if err != nil { + return + } + defer outparams.Clear() + returnRaw, err := outparams.ToIDispatch().GetProperty("ReturnValue") + if err != nil { + return + } + defer returnRaw.Clear() + result.ReturnValue = returnRaw.Value().(int32) + log.Printf("[WMI] - Return [%d] ", result.ReturnValue) + + for _, outp := range outParam { + returnRawIn, err1 := outparams.ToIDispatch().GetProperty(outp.Name) + if err1 != nil { + err = err1 + return + } + defer returnRawIn.Clear() + + value, err1 := GetVariantValue(returnRawIn) + if err1 != nil { + err = err1 + return + } + // log.Printf("OutParam [%s]=> [%+v]\n", outp.Name, value) + + result.OutMethodParams[outp.Name] = NewWmiMethodParam(outp.Name, value) + } + return +} + +func (c *WmiMethod) Close() error { + return nil +} + +type WmiMethodCollection []*WmiMethod + +func (c *WmiMethodCollection) Close() error { + var err error + for _, p := range *c { + err = p.Close() + } + return err +} diff --git a/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiMethodParam.go b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiMethodParam.go new file mode 100644 index 000000000..b6a5b91f7 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiMethodParam.go @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +// This class implements the swbemproperty class +// Documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemproperty + +package cim + +import ( +// "github.com/go-ole/go-ole" +) + +type WmiMethodParam struct { + Name string + Value interface{} + //session *WmiSession + //property *ole.IDispatch + //propertyVar *ole.VARIANT +} + +// func NewWmiMethodParam(name string, val interface{}, propertyVariant *ole.VARIANT, session *WmiSession) (*WmiMethodParam, error) { +func NewWmiMethodParam(name string, val interface{}) *WmiMethodParam { + return &WmiMethodParam{ + Name: name, + //propertyVar: propertyVariant, + //property: propertyVariant.ToIDispatch(), + //session: session, + Value: val, + } +} + +// Dispose +func (c *WmiMethodParam) Close() error { + return nil //c.propertyVar.Clear() +} + +type WmiMethodParamCollection []*WmiMethodParam + +func (c *WmiMethodParamCollection) Close() error { + var err error + for _, p := range *c { + err = p.Close() + } + return err +} diff --git a/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiProperty.go b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiProperty.go new file mode 100644 index 000000000..09dff7907 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiProperty.go @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +// This class implements the swbemproperty class +// Documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemproperty + +package cim + +import ( + "github.com/go-ole/go-ole" + "github.com/go-ole/go-ole/oleutil" + + "github.com/microsoft/wmi/go/wmi" +) + +type WmiProperty struct { + session *WmiSession + property *ole.IDispatch + propertyVar *ole.VARIANT +} + +func CreateWmiProperty(propertyVariant *ole.VARIANT, session *WmiSession) (*WmiProperty, error) { + return &WmiProperty{ + propertyVar: propertyVariant, + property: propertyVariant.ToIDispatch(), + session: session, + }, nil +} + +// Name +func (c *WmiProperty) Name() string { + name, err := oleutil.GetProperty(c.property, "Name") + if err != nil { + panic("Error retrieving the property Name") + } + + value, err := GetVariantValue(name) + if err != nil { + panic("Error retrieving the property Name") + } + + return value.(string) +} + +// Value +func (c *WmiProperty) Value() interface{} { + rawSystemProperty, err := oleutil.GetProperty(c.property, "Value") + if err != nil { + panic("Error retrieving the property value") + } + + value, err := GetVariantValue(rawSystemProperty) + if err != nil { + panic("Error retrieving the property value") + } + + return value +} + +// Type +func (c *WmiProperty) Type() wmi.WmiType { + rawSystemProperty, err := oleutil.GetProperty(c.property, "CIMType") + if err != nil { + panic("Error retrieving the property type") + } + + value, err := GetVariantValue(rawSystemProperty) + if err != nil { + panic("Error retrieving the property type") + } + + return wmi.WmiType(value.(int)) +} + +func CloseAllProperties(properties []*WmiProperty) { + for _, property := range properties { + property.Close() + } +} + +// Dispose +func (c *WmiProperty) Close() error { + return c.propertyVar.Clear() +} diff --git a/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiQualifier.go b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiQualifier.go new file mode 100644 index 000000000..242bfee1b --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiQualifier.go @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +package cim + +type WmiQualifier struct { +} + +// Name +func (c WmiQualifier) Name() string { + panic("not implemented") + +} + +// Value +func (c WmiQualifier) Value() string { + panic("not implemented") + +} diff --git a/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiSession.go b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiSession.go new file mode 100644 index 000000000..35498e01b --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiSession.go @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +// This class implements the SWbemServices object +// Documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemservices + +package cim + +import ( + "fmt" + "log" + "runtime/debug" + "strings" + + ole "github.com/go-ole/go-ole" + "github.com/go-ole/go-ole/oleutil" + "github.com/microsoft/wmi/go/wmi" + "github.com/microsoft/wmi/pkg/base/host" +) + +// WmiSession struct to hold the current session information +type WmiSession struct { + ServerName string + Namespace string + Username string + Password string + Domain string + WMIHost *host.WmiHost + Status wmi.SessionStatus + RawSession *ole.VARIANT + Session *ole.IDispatch + CimwmiService *ole.IDispatch +} + +// CreateSessionEx creates a session based on credentials +func CreateSessionEx(CimwmiService *ole.IDispatch, serverName, wmiNamespace string, credentials wmi.Credentials) (*WmiSession, error) { + return CreateSession(CimwmiService, wmiNamespace, serverName, credentials.Domain, credentials.UserName, credentials.Password) +} + +// CreateSession creates a new session with the server and namespace +func CreateSession(CimwmiService *ole.IDispatch, wmiNamespace, serverName, domain, userName, password string) (*WmiSession, error) { + return &WmiSession{ + CimwmiService: CimwmiService, + ServerName: serverName, + Namespace: wmiNamespace, + Username: userName, + Password: password, + Domain: domain, + Status: wmi.Created, + WMIHost: host.NewWmiHostWithCredential(serverName, userName, password, domain), + }, nil +} + +type WbemAuthenticationLevelEnum uint32 + +const ( + wbemAuthenticationLevelDefault WbemAuthenticationLevelEnum = 0 + wbemAuthenticationLevelNone WbemAuthenticationLevelEnum = 1 + wbemAuthenticationLevelConnect WbemAuthenticationLevelEnum = 2 + wbemAuthenticationLevelCall WbemAuthenticationLevelEnum = 3 + wbemAuthenticationLevelPkt WbemAuthenticationLevelEnum = 4 + wbemAuthenticationLevelPktIntegrity WbemAuthenticationLevelEnum = 5 + wbemAuthenticationLevelPktPrivacy WbemAuthenticationLevelEnum = 6 +) + +type WbemImpersonationLevel uint32 + +const ( + wbemImpersonationLevelAnonymous WbemImpersonationLevel = 1 + wbemImpersonationLevelIdentify WbemImpersonationLevel = 2 + wbemImpersonationLevelImpersonate WbemImpersonationLevel = 3 + wbemImpersonationLevelDelegate WbemImpersonationLevel = 4 +) + +// Connect the wmi session +func (c *WmiSession) Connect() (bool, error) { + var err error + // Node that we are connected through SWbemLocator, which uses the scripting language syntax for ConnectServer + // This means the first parameter of the call is the name of the server, and the second parameter is the name of the namespace + // (as opposed to C++ where these two are exposed as one parameter) + // See here for an example illustrating the scripting syntax: https://docs.microsoft.com/en-us/windows/win32/wmisdk/connecting-to-wmi-with-vbscript + c.RawSession, err = oleutil.CallMethod( + c.CimwmiService, "ConnectServer", strings.Join([]string{c.ServerName, c.Domain}, "."), c.Namespace, c.Username, c.Password, "MS_409") + if err != nil { + return false, err + } + c.Session = c.RawSession.ToIDispatch() + c.Status = wmi.Connected + + if c.Session == nil { + panic("Returned session is null") + } + + // Set the authentication level to packet privacy and impersonation to impersonate + // Relevant documentations: + // https://docs.microsoft.com/en-us/windows/win32/wmisdk/setting-security-on-an-asynchronous-call + // https://docs.microsoft.com/en-us/windows/win32/wmisdk/setting-the-default-process-security-level-using-vbscript + // https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemsecurity + // https://docs.microsoft.com/en-us/windows/win32/wmisdk/maintaining-wmi-security + // https://docs.microsoft.com/en-us/windows/win32/wmisdk/securing-scripting-clients + // https://docs.microsoft.com/en-us/windows/win32/wmisdk/providing-events-securely + rawSecurityObject, err := oleutil.GetProperty(c.Session, "Security_") + if err != nil { + debug.PrintStack() + return false, err + } + securityObject := rawSecurityObject.ToIDispatch() + defer rawSecurityObject.Clear() + + rawImpersonationLevel, err := oleutil.PutProperty(securityObject, "ImpersonationLevel", uint32(wbemImpersonationLevelImpersonate)) + if err != nil { + debug.PrintStack() + return false, err + } + defer rawImpersonationLevel.Clear() + + rawAuthenticationLevel, err := oleutil.PutProperty(securityObject, "AuthenticationLevel", uint32(wbemAuthenticationLevelPktPrivacy)) + if err != nil { + debug.PrintStack() + return false, err + } + defer rawAuthenticationLevel.Clear() + + return true, nil +} + +// Close the wmi session +func (c *WmiSession) Close() { + c.RawSession.Clear() + c.Status = wmi.Disconnected +} + +// Dispose the wmi session +func (c *WmiSession) Dispose() { + if c.Status != wmi.Disposed { + c.Close() + c.Status = wmi.Disposed + } +} + +// TestConnection +func (c *WmiSession) TestConnection() bool { + panic("not implemented") +} + +// Tells WMI to create a new class for us +func (c *WmiSession) CreateNewClass() (*WmiClass, error) { + rawResult, err := c.Session.CallMethod("Get") + if err != nil { + return nil, err + } + + return CreateWmiClass(rawResult, c) +} + +func (c *WmiSession) GetClass(classDefinition string) (*WmiClass, error) { + rawResult, err := c.Session.CallMethod("Get", classDefinition) + if err != nil { + return nil, err + } + + return CreateWmiClass(rawResult, c) +} + +// EnumerateClasses +func (c *WmiSession) EnumerateClasses(className string) ([]*WmiClass, error) { + return c.QueryClasses("SELECT * FROM meta_class") +} + +// QueryClasses +func (c *WmiSession) QueryClasses(queryString string) ([]*WmiClass, error) { + enum, err := c.PerformRawQuery(queryString) + if err != nil { + return nil, err + } + defer enum.Release() + + wmiClasses := []*WmiClass{} + for tmp, length, err := enum.Next(1); length > 0; tmp, length, err = enum.Next(1) { + if err != nil { + return nil, err + } + + wmiClass, err := CreateWmiClass(&tmp, c) + if err != nil { + return nil, err + } + + wmiClasses = append(wmiClasses, wmiClass) + } + + return wmiClasses, nil +} + +// GetInstance +func (c *WmiSession) GetInstance(path string) (*WmiInstance, error) { + rawResult, err := c.Session.CallMethod("Get", path) + if err != nil { + return nil, err + } + + return CreateWmiInstance(rawResult, c) +} + +// EnumerateInstances +func (c *WmiSession) EnumerateInstances(className string) ([]*WmiInstance, error) { + return c.QueryInstances("SELECT * FROM " + className) +} + +// QueryInstances +func (c *WmiSession) QueryInstances(queryExpression string) ([]*WmiInstance, error) { + enum, err := c.PerformRawQuery(queryExpression) + if err != nil { + return nil, err + } + defer enum.Release() + + wmiInstances := []*WmiInstance{} + for tmp, length, err := enum.Next(1); length > 0; tmp, length, err = enum.Next(1) { + if err != nil { + return nil, err + } + + wmiInstance, err := CreateWmiInstance(&tmp, c) + if err != nil { + return nil, err + } + + wmiInstances = append(wmiInstances, wmiInstance) + } + + log.Printf("[WMI] QueryInstances [%s]=> [%d]\n", queryExpression, len(wmiInstances)) + return wmiInstances, nil +} + +// QueryInstancesEx +func (c *WmiSession) QueryInstancesEx(query wmi.Query) (*[]wmi.Instance, error) { + panic("not implemented") +} + +// EnumerateReferencingInstances +func (c *WmiSession) EnumerateReferencingInstances(namespaceName string, sourceInstance WmiInstance, associationClassName, sourceRole string) (*[]WmiInstance, error) { + panic("not implemented") +} + +func (c *WmiSession) PerformRawQuery(queryExpression string) (*ole.IEnumVARIANT, error) { + rawResult, err := c.Session.CallMethod("ExecQuery", queryExpression) + if err != nil { + return nil, err + } + + result := rawResult.ToIDispatch() + defer rawResult.Clear() + + // Doc: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/automat/dispid-constants + enum_property, err := result.GetProperty("_NewEnum") + if err != nil { + return nil, err + } + defer enum_property.Clear() + + // https://docs.microsoft.com/en-us/windows/win32/api/oaidl/nn-oaidl-ienumvariant + enum, err := enum_property.ToIUnknown().IEnumVARIANT(ole.IID_IEnumVariant) + if err != nil { + return nil, err + } + if enum == nil { + return nil, fmt.Errorf("Enum is nil") + } + + return enum, err +} + +// Credentials +func (c *WmiSession) Credentials() *wmi.Credentials { + credentials := wmi.Credentials{ + UserName: c.Username, + Password: c.Password, + Domain: c.Domain, + } + + return &credentials +} + +// Asynchronous approach to handling events +// Documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/receiving-synchronous-and-semisynchronous-event-notifications +// Security considerations with Asynchronous calls: https://docs.microsoft.com/en-us/windows/win32/wmisdk/making-an-asynchronous-call-with-vbscript +func (c *WmiSession) ExecNotificationQueryAsync(eventSink *WmiEventSink, query string) (interface{}, error) { + rawResult, err := oleutil.CallMethod(c.Session, "ExecNotificationQueryAsync", eventSink.instance, query) + if err != nil { + return nil, err + } + defer rawResult.Clear() + + return GetVariantValue(rawResult) +} + +// Synchronous approach to handling events +// Documentation: https://docs.microsoft.com/en-us/windows/win32/wmisdk/receiving-synchronous-and-semisynchronous-event-notifications +func (c *WmiSession) ExecNotificationQuery(query string) (*WmiSynchronousEventsList, error) { + rawResult, err := oleutil.CallMethod(c.Session, "ExecNotificationQuery", query) + if err != nil { + return nil, err + } + + return CreateWmiSynchronousEventsList(rawResult, c), nil +} diff --git a/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiSessionManager.go b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiSessionManager.go new file mode 100644 index 000000000..927f74549 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiSessionManager.go @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +package cim + +import ( + "errors" + "fmt" + + ole "github.com/go-ole/go-ole" + "github.com/go-ole/go-ole/oleutil" +) + +const S_FALSE = 0x00000001 + +var IID_ISWbemLocator = &ole.GUID{0x76a6415b, 0xcb41, 0x11d1, [8]byte{0x8b, 0x02, 0x00, 0x60, 0x08, 0x06, 0xd9, 0xb6}} + +// Reference https://github.com/StackExchange/wmi +// Reference https://docs.microsoft.com/en-us/windows/desktop/WmiSdk/swbemlocator-connectserver + +type WmiSessionManager struct { + unknown *ole.IUnknown + wmi *ole.IDispatch + sessions map[string]*WmiSession +} + +func NewWmiSessionManager() *WmiSessionManager { + wsm := &WmiSessionManager{} + + err := wsm.init() + if err != nil { + panic("couldn't initialize the WmiSessionManager") + } + + return wsm +} + +func (c *WmiSessionManager) init() error { + err := ole.CoInitializeEx(0, ole.COINIT_MULTITHREADED) + if err != nil { + oleCode := err.(*ole.OleError).Code() + if oleCode != ole.S_OK && oleCode != S_FALSE { + return err + } + } + + // Initialize COM security for the whole process + err = CoInitializeSecurity(RPC_C_AUTHN_LEVEL_PKT_PRIVACY, RPC_C_IMP_LEVEL_IMPERSONATE) + if err != nil { + oleCode := err.(*ole.OleError).Code() + + // Note: RPC_E_TOO_LATE means we have already initialized security. + if oleCode != ole.S_OK && oleCode != S_FALSE && oleCode != uintptr(RPC_E_TOO_LATE) { + panic(fmt.Sprintf("Couldn't initialize COM/DCOM security. Error: [%v]", err)) + } + } + + c.unknown, err = oleutil.CreateObject("WbemScripting.SWbemLocator") + if err != nil { + c.Dispose() + return err + } + if c.unknown == nil { + c.Dispose() + return errors.New("CreateObject failed") + } + + c.wmi, err = c.unknown.QueryInterface(IID_ISWbemLocator) + if err != nil { + c.Dispose() + return err + } + + return nil +} + +// Dispose clears the WmiSessionManager +func (c *WmiSessionManager) Dispose() { + c.Close() +} + +// Close +func (c *WmiSessionManager) Close() error { + // clear the Sessions + + if c.wmi != nil { + c.wmi.Release() + } + // clear ole object + if c.unknown != nil { + c.unknown.Release() + } + + // clear com + ole.CoUninitialize() + + return nil +} + +// GetSession +func (c *WmiSessionManager) GetSession(wmiNamespace, serverName, domain, userName, password string) (*WmiSession, error) { + return CreateSession(c.wmi, wmiNamespace, serverName, domain, userName, password) +} + +// GetLocalSession +func (c *WmiSessionManager) GetLocalSession(wmiNamespace string) (*WmiSession, error) { + return CreateSession(c.wmi, wmiNamespace, "", "", "", "") +} diff --git a/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiSynchronousEvents.go b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiSynchronousEvents.go new file mode 100644 index 000000000..4017f2aa1 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/pkg/wmiinstance/WmiSynchronousEvents.go @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +// This class wraps a typicaly SWbemEventSource object as returned by SWbemServices.ExecNotificationQuery. Its implementation is based on the +// Documentations: +// https://docs.microsoft.com/en-us/windows/win32/wmisdk/receiving-synchronous-and-semisynchronous-event-notifications +// https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemservices-execnotificationquery +// https://docs.microsoft.com/en-us/windows/win32/wmisdk/swbemeventsource + +package cim + +import ( + ole "github.com/go-ole/go-ole" + "github.com/go-ole/go-ole/oleutil" +) + +const ( + wbemTimeoutInfinite int32 = -1 +) + +type WmiSynchronousEventsList struct { + session *WmiSession + instance *ole.IDispatch + instanceVar *ole.VARIANT +} + +func CreateWmiSynchronousEventsList(instanceVar *ole.VARIANT, session *WmiSession) *WmiSynchronousEventsList { + return &WmiSynchronousEventsList{ + session: session, + instance: instanceVar.ToIDispatch(), + instanceVar: instanceVar, + } +} + +func (c *WmiSynchronousEventsList) Close() { + c.instanceVar.Clear() +} + +func (c *WmiSynchronousEventsList) WaitForNextEventUntil(timeout int32) (*WmiInstance, error) { + eventInstance, err := oleutil.CallMethod(c.instance, "NextEvent", timeout) + if err != nil { + return nil, err + } + + return CreateWmiInstance(eventInstance, c.session) +} + +func (c *WmiSynchronousEventsList) WaitForNextEvent() (*WmiInstance, error) { + return c.WaitForNextEventUntil(wbemTimeoutInfinite) +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ACE.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ACE.go new file mode 100644 index 000000000..55abedefb --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ACE.go @@ -0,0 +1,260 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __ACE struct +type __ACE struct { + *__SecurityRelatedClass + + // + AccessMask uint32 + + // + AceFlags uint32 + + // + AceType uint32 + + // + GuidInheritedObjectType string + + // + GuidObjectType string + + // + TIME_CREATED uint64 + + // + Trustee __Trustee +} + +func New__ACEEx1(instance *cim.WmiInstance) (newInstance *__ACE, err error) { + tmp, err := New__SecurityRelatedClassEx1(instance) + + if err != nil { + return + } + newInstance = &__ACE{ + __SecurityRelatedClass: tmp, + } + return +} + +func New__ACEEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__ACE, err error) { + tmp, err := New__SecurityRelatedClassEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__ACE{ + __SecurityRelatedClass: tmp, + } + return +} + +// SetAccessMask sets the value of AccessMask for the instance +func (instance *__ACE) SetPropertyAccessMask(value uint32) (err error) { + return instance.SetProperty("AccessMask", (value)) +} + +// GetAccessMask gets the value of AccessMask for the instance +func (instance *__ACE) GetPropertyAccessMask() (value uint32, err error) { + retValue, err := instance.GetProperty("AccessMask") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetAceFlags sets the value of AceFlags for the instance +func (instance *__ACE) SetPropertyAceFlags(value uint32) (err error) { + return instance.SetProperty("AceFlags", (value)) +} + +// GetAceFlags gets the value of AceFlags for the instance +func (instance *__ACE) GetPropertyAceFlags() (value uint32, err error) { + retValue, err := instance.GetProperty("AceFlags") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetAceType sets the value of AceType for the instance +func (instance *__ACE) SetPropertyAceType(value uint32) (err error) { + return instance.SetProperty("AceType", (value)) +} + +// GetAceType gets the value of AceType for the instance +func (instance *__ACE) GetPropertyAceType() (value uint32, err error) { + retValue, err := instance.GetProperty("AceType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetGuidInheritedObjectType sets the value of GuidInheritedObjectType for the instance +func (instance *__ACE) SetPropertyGuidInheritedObjectType(value string) (err error) { + return instance.SetProperty("GuidInheritedObjectType", (value)) +} + +// GetGuidInheritedObjectType gets the value of GuidInheritedObjectType for the instance +func (instance *__ACE) GetPropertyGuidInheritedObjectType() (value string, err error) { + retValue, err := instance.GetProperty("GuidInheritedObjectType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetGuidObjectType sets the value of GuidObjectType for the instance +func (instance *__ACE) SetPropertyGuidObjectType(value string) (err error) { + return instance.SetProperty("GuidObjectType", (value)) +} + +// GetGuidObjectType gets the value of GuidObjectType for the instance +func (instance *__ACE) GetPropertyGuidObjectType() (value string, err error) { + retValue, err := instance.GetProperty("GuidObjectType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetTIME_CREATED sets the value of TIME_CREATED for the instance +func (instance *__ACE) SetPropertyTIME_CREATED(value uint64) (err error) { + return instance.SetProperty("TIME_CREATED", (value)) +} + +// GetTIME_CREATED gets the value of TIME_CREATED for the instance +func (instance *__ACE) GetPropertyTIME_CREATED() (value uint64, err error) { + retValue, err := instance.GetProperty("TIME_CREATED") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetTrustee sets the value of Trustee for the instance +func (instance *__ACE) SetPropertyTrustee(value __Trustee) (err error) { + return instance.SetProperty("Trustee", (value)) +} + +// GetTrustee gets the value of Trustee for the instance +func (instance *__ACE) GetPropertyTrustee() (value __Trustee, err error) { + retValue, err := instance.GetProperty("Trustee") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(__Trustee) + if !ok { + err = errors.Wrapf(errors.InvalidType, " __Trustee is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = __Trustee(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/AbsoluteTimerInstruction.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/AbsoluteTimerInstruction.go new file mode 100644 index 000000000..a0aefee81 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/AbsoluteTimerInstruction.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __AbsoluteTimerInstruction struct +type __AbsoluteTimerInstruction struct { + *__TimerInstruction + + // + EventDateTime string +} + +func New__AbsoluteTimerInstructionEx1(instance *cim.WmiInstance) (newInstance *__AbsoluteTimerInstruction, err error) { + tmp, err := New__TimerInstructionEx1(instance) + + if err != nil { + return + } + newInstance = &__AbsoluteTimerInstruction{ + __TimerInstruction: tmp, + } + return +} + +func New__AbsoluteTimerInstructionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__AbsoluteTimerInstruction, err error) { + tmp, err := New__TimerInstructionEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__AbsoluteTimerInstruction{ + __TimerInstruction: tmp, + } + return +} + +// SetEventDateTime sets the value of EventDateTime for the instance +func (instance *__AbsoluteTimerInstruction) SetPropertyEventDateTime(value string) (err error) { + return instance.SetProperty("EventDateTime", (value)) +} + +// GetEventDateTime gets the value of EventDateTime for the instance +func (instance *__AbsoluteTimerInstruction) GetPropertyEventDateTime() (value string, err error) { + retValue, err := instance.GetProperty("EventDateTime") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/AggregateEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/AggregateEvent.go new file mode 100644 index 000000000..6722c717b --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/AggregateEvent.go @@ -0,0 +1,110 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __AggregateEvent struct +type __AggregateEvent struct { + *__IndicationRelated + + // + NumberOfEvents uint32 + + // + Representative interface{} +} + +func New__AggregateEventEx1(instance *cim.WmiInstance) (newInstance *__AggregateEvent, err error) { + tmp, err := New__IndicationRelatedEx1(instance) + + if err != nil { + return + } + newInstance = &__AggregateEvent{ + __IndicationRelated: tmp, + } + return +} + +func New__AggregateEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__AggregateEvent, err error) { + tmp, err := New__IndicationRelatedEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__AggregateEvent{ + __IndicationRelated: tmp, + } + return +} + +// SetNumberOfEvents sets the value of NumberOfEvents for the instance +func (instance *__AggregateEvent) SetPropertyNumberOfEvents(value uint32) (err error) { + return instance.SetProperty("NumberOfEvents", (value)) +} + +// GetNumberOfEvents gets the value of NumberOfEvents for the instance +func (instance *__AggregateEvent) GetPropertyNumberOfEvents() (value uint32, err error) { + retValue, err := instance.GetProperty("NumberOfEvents") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetRepresentative sets the value of Representative for the instance +func (instance *__AggregateEvent) SetPropertyRepresentative(value interface{}) (err error) { + return instance.SetProperty("Representative", (value)) +} + +// GetRepresentative gets the value of Representative for the instance +func (instance *__AggregateEvent) GetPropertyRepresentative() (value interface{}, err error) { + retValue, err := instance.GetProperty("Representative") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(interface{}) + if !ok { + err = errors.Wrapf(errors.InvalidType, " interface{} is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = interface{}(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassCreation.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassCreation.go new file mode 100644 index 000000000..356e5a7f3 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassCreation.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// CIM_ClassCreation struct +type CIM_ClassCreation struct { + *CIM_ClassIndication +} + +func NewCIM_ClassCreationEx1(instance *cim.WmiInstance) (newInstance *CIM_ClassCreation, err error) { + tmp, err := NewCIM_ClassIndicationEx1(instance) + + if err != nil { + return + } + newInstance = &CIM_ClassCreation{ + CIM_ClassIndication: tmp, + } + return +} + +func NewCIM_ClassCreationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *CIM_ClassCreation, err error) { + tmp, err := NewCIM_ClassIndicationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &CIM_ClassCreation{ + CIM_ClassIndication: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassDeletion.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassDeletion.go new file mode 100644 index 000000000..fece2ac3f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassDeletion.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// CIM_ClassDeletion struct +type CIM_ClassDeletion struct { + *CIM_ClassIndication +} + +func NewCIM_ClassDeletionEx1(instance *cim.WmiInstance) (newInstance *CIM_ClassDeletion, err error) { + tmp, err := NewCIM_ClassIndicationEx1(instance) + + if err != nil { + return + } + newInstance = &CIM_ClassDeletion{ + CIM_ClassIndication: tmp, + } + return +} + +func NewCIM_ClassDeletionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *CIM_ClassDeletion, err error) { + tmp, err := NewCIM_ClassIndicationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &CIM_ClassDeletion{ + CIM_ClassIndication: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassIndication.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassIndication.go new file mode 100644 index 000000000..a771335e7 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassIndication.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// CIM_ClassIndication struct +type CIM_ClassIndication struct { + *CIM_Indication + + // The current definition of the class that is created, changed or deleted in the schema. In the case of a CIM_ClassDeletion Indication, the definition for the class just prior to deletion should be placed in this property. + ClassDefinition interface{} +} + +func NewCIM_ClassIndicationEx1(instance *cim.WmiInstance) (newInstance *CIM_ClassIndication, err error) { + tmp, err := NewCIM_IndicationEx1(instance) + + if err != nil { + return + } + newInstance = &CIM_ClassIndication{ + CIM_Indication: tmp, + } + return +} + +func NewCIM_ClassIndicationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *CIM_ClassIndication, err error) { + tmp, err := NewCIM_IndicationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &CIM_ClassIndication{ + CIM_Indication: tmp, + } + return +} + +// SetClassDefinition sets the value of ClassDefinition for the instance +func (instance *CIM_ClassIndication) SetPropertyClassDefinition(value interface{}) (err error) { + return instance.SetProperty("ClassDefinition", (value)) +} + +// GetClassDefinition gets the value of ClassDefinition for the instance +func (instance *CIM_ClassIndication) GetPropertyClassDefinition() (value interface{}, err error) { + retValue, err := instance.GetProperty("ClassDefinition") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(interface{}) + if !ok { + err = errors.Wrapf(errors.InvalidType, " interface{} is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = interface{}(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassModification.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassModification.go new file mode 100644 index 000000000..d900839ee --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_ClassModification.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// CIM_ClassModification struct +type CIM_ClassModification struct { + *CIM_ClassIndication + + // A copy of the 'previous' class definition whose change generated the Indication. PreviousClassDefinition contains an 'older' copy of the class' information, as compared to what is found in the ClassDefinition property (inherited from ClassIndication). + PreviousClassDefinition interface{} +} + +func NewCIM_ClassModificationEx1(instance *cim.WmiInstance) (newInstance *CIM_ClassModification, err error) { + tmp, err := NewCIM_ClassIndicationEx1(instance) + + if err != nil { + return + } + newInstance = &CIM_ClassModification{ + CIM_ClassIndication: tmp, + } + return +} + +func NewCIM_ClassModificationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *CIM_ClassModification, err error) { + tmp, err := NewCIM_ClassIndicationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &CIM_ClassModification{ + CIM_ClassIndication: tmp, + } + return +} + +// SetPreviousClassDefinition sets the value of PreviousClassDefinition for the instance +func (instance *CIM_ClassModification) SetPropertyPreviousClassDefinition(value interface{}) (err error) { + return instance.SetProperty("PreviousClassDefinition", (value)) +} + +// GetPreviousClassDefinition gets the value of PreviousClassDefinition for the instance +func (instance *CIM_ClassModification) GetPropertyPreviousClassDefinition() (value interface{}, err error) { + retValue, err := instance.GetProperty("PreviousClassDefinition") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(interface{}) + if !ok { + err = errors.Wrapf(errors.InvalidType, " interface{} is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = interface{}(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_Error.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_Error.go new file mode 100644 index 000000000..67222f41f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_Error.go @@ -0,0 +1,503 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// CIM_Error struct +type CIM_Error struct { + *cim.WmiInstance + + // + CIMStatusCode uint32 + + // + CIMStatusCodeDescription string + + // + ErrorSource string + + // + ErrorSourceFormat uint16 + + // + ErrorType uint16 + + // + Message string + + // + MessageArguments []string + + // + MessageID string + + // + OtherErrorSourceFormat string + + // + OtherErrorType string + + // + OwningEntity string + + // + PerceivedSeverity uint16 + + // + ProbableCause uint16 + + // + ProbableCauseDescription string + + // + RecommendedActions []string +} + +func NewCIM_ErrorEx1(instance *cim.WmiInstance) (newInstance *CIM_Error, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &CIM_Error{ + WmiInstance: tmp, + } + return +} + +func NewCIM_ErrorEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *CIM_Error, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &CIM_Error{ + WmiInstance: tmp, + } + return +} + +// SetCIMStatusCode sets the value of CIMStatusCode for the instance +func (instance *CIM_Error) SetPropertyCIMStatusCode(value uint32) (err error) { + return instance.SetProperty("CIMStatusCode", (value)) +} + +// GetCIMStatusCode gets the value of CIMStatusCode for the instance +func (instance *CIM_Error) GetPropertyCIMStatusCode() (value uint32, err error) { + retValue, err := instance.GetProperty("CIMStatusCode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetCIMStatusCodeDescription sets the value of CIMStatusCodeDescription for the instance +func (instance *CIM_Error) SetPropertyCIMStatusCodeDescription(value string) (err error) { + return instance.SetProperty("CIMStatusCodeDescription", (value)) +} + +// GetCIMStatusCodeDescription gets the value of CIMStatusCodeDescription for the instance +func (instance *CIM_Error) GetPropertyCIMStatusCodeDescription() (value string, err error) { + retValue, err := instance.GetProperty("CIMStatusCodeDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetErrorSource sets the value of ErrorSource for the instance +func (instance *CIM_Error) SetPropertyErrorSource(value string) (err error) { + return instance.SetProperty("ErrorSource", (value)) +} + +// GetErrorSource gets the value of ErrorSource for the instance +func (instance *CIM_Error) GetPropertyErrorSource() (value string, err error) { + retValue, err := instance.GetProperty("ErrorSource") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetErrorSourceFormat sets the value of ErrorSourceFormat for the instance +func (instance *CIM_Error) SetPropertyErrorSourceFormat(value uint16) (err error) { + return instance.SetProperty("ErrorSourceFormat", (value)) +} + +// GetErrorSourceFormat gets the value of ErrorSourceFormat for the instance +func (instance *CIM_Error) GetPropertyErrorSourceFormat() (value uint16, err error) { + retValue, err := instance.GetProperty("ErrorSourceFormat") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetErrorType sets the value of ErrorType for the instance +func (instance *CIM_Error) SetPropertyErrorType(value uint16) (err error) { + return instance.SetProperty("ErrorType", (value)) +} + +// GetErrorType gets the value of ErrorType for the instance +func (instance *CIM_Error) GetPropertyErrorType() (value uint16, err error) { + retValue, err := instance.GetProperty("ErrorType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetMessage sets the value of Message for the instance +func (instance *CIM_Error) SetPropertyMessage(value string) (err error) { + return instance.SetProperty("Message", (value)) +} + +// GetMessage gets the value of Message for the instance +func (instance *CIM_Error) GetPropertyMessage() (value string, err error) { + retValue, err := instance.GetProperty("Message") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetMessageArguments sets the value of MessageArguments for the instance +func (instance *CIM_Error) SetPropertyMessageArguments(value []string) (err error) { + return instance.SetProperty("MessageArguments", (value)) +} + +// GetMessageArguments gets the value of MessageArguments for the instance +func (instance *CIM_Error) GetPropertyMessageArguments() (value []string, err error) { + retValue, err := instance.GetProperty("MessageArguments") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetMessageID sets the value of MessageID for the instance +func (instance *CIM_Error) SetPropertyMessageID(value string) (err error) { + return instance.SetProperty("MessageID", (value)) +} + +// GetMessageID gets the value of MessageID for the instance +func (instance *CIM_Error) GetPropertyMessageID() (value string, err error) { + retValue, err := instance.GetProperty("MessageID") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOtherErrorSourceFormat sets the value of OtherErrorSourceFormat for the instance +func (instance *CIM_Error) SetPropertyOtherErrorSourceFormat(value string) (err error) { + return instance.SetProperty("OtherErrorSourceFormat", (value)) +} + +// GetOtherErrorSourceFormat gets the value of OtherErrorSourceFormat for the instance +func (instance *CIM_Error) GetPropertyOtherErrorSourceFormat() (value string, err error) { + retValue, err := instance.GetProperty("OtherErrorSourceFormat") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOtherErrorType sets the value of OtherErrorType for the instance +func (instance *CIM_Error) SetPropertyOtherErrorType(value string) (err error) { + return instance.SetProperty("OtherErrorType", (value)) +} + +// GetOtherErrorType gets the value of OtherErrorType for the instance +func (instance *CIM_Error) GetPropertyOtherErrorType() (value string, err error) { + retValue, err := instance.GetProperty("OtherErrorType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOwningEntity sets the value of OwningEntity for the instance +func (instance *CIM_Error) SetPropertyOwningEntity(value string) (err error) { + return instance.SetProperty("OwningEntity", (value)) +} + +// GetOwningEntity gets the value of OwningEntity for the instance +func (instance *CIM_Error) GetPropertyOwningEntity() (value string, err error) { + retValue, err := instance.GetProperty("OwningEntity") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPerceivedSeverity sets the value of PerceivedSeverity for the instance +func (instance *CIM_Error) SetPropertyPerceivedSeverity(value uint16) (err error) { + return instance.SetProperty("PerceivedSeverity", (value)) +} + +// GetPerceivedSeverity gets the value of PerceivedSeverity for the instance +func (instance *CIM_Error) GetPropertyPerceivedSeverity() (value uint16, err error) { + retValue, err := instance.GetProperty("PerceivedSeverity") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetProbableCause sets the value of ProbableCause for the instance +func (instance *CIM_Error) SetPropertyProbableCause(value uint16) (err error) { + return instance.SetProperty("ProbableCause", (value)) +} + +// GetProbableCause gets the value of ProbableCause for the instance +func (instance *CIM_Error) GetPropertyProbableCause() (value uint16, err error) { + retValue, err := instance.GetProperty("ProbableCause") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetProbableCauseDescription sets the value of ProbableCauseDescription for the instance +func (instance *CIM_Error) SetPropertyProbableCauseDescription(value string) (err error) { + return instance.SetProperty("ProbableCauseDescription", (value)) +} + +// GetProbableCauseDescription gets the value of ProbableCauseDescription for the instance +func (instance *CIM_Error) GetPropertyProbableCauseDescription() (value string, err error) { + retValue, err := instance.GetProperty("ProbableCauseDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetRecommendedActions sets the value of RecommendedActions for the instance +func (instance *CIM_Error) SetPropertyRecommendedActions(value []string) (err error) { + return instance.SetProperty("RecommendedActions", (value)) +} + +// GetRecommendedActions gets the value of RecommendedActions for the instance +func (instance *CIM_Error) GetPropertyRecommendedActions() (value []string, err error) { + retValue, err := instance.GetProperty("RecommendedActions") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_Indication.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_Indication.go new file mode 100644 index 000000000..abf22be1b --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_Indication.go @@ -0,0 +1,315 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// CIM_Indication struct +type CIM_Indication struct { + *cim.WmiInstance + + // A list of IndicationIdentifiers whose notifications are correlated with (related to) this one. + CorrelatedIndications []string + + // An identifier for the indication filter that selects this indication and causes it to be sent. This property is to be filled out by the indication sending service. The value shall be correlatable with the Name property of the instance of CIM_IndicationFilter describing the criteria of the indication. The value of the IndicationFilterName should be formatted using the following algorithm: < OrgID > : < LocalID >, where < OrgID > and < LocalID > are separated by a colon (:) and < OrgID > shall include a copyrighted, trademarked, or otherwise unique name that is owned by the business entity that is creating or defining the value or that is a registered ID assigned to the business entity by a recognized global authority. In addition, to ensure uniqueness, < OrgID > shall not contain a colon (:).When using this algorithm, the first colon to appear in the value shall appear between < OrgID > and < LocalID >. < LocalID > is chosen by the business entity and shall be used uniquely. + IndicationFilterName string + + // An identifier for the Indication. This property is similar to a key value in that it can be used for identification, when correlating Indications (see the CorrelatedIndications array). Its value SHOULD be unique as long as correlations are reported, but MAY be reused or left NULL if no future Indications will reference it in their CorrelatedIndications array.To ensure uniqueness, the value of IndicationIdentifier should be constructed using the following "preferred" algorithm: + ///: + ///Where and are separated by a colon (:), and where must include a copyrighted, trademarked, or otherwise unique name that is owned by the business entity that is creating or defining the IndicationIdentifier or that is a recognized ID that is assigned to the business entity by a recognized global authority. (This requirement is similar to the _ structure of Schema class names.) In addition, to ensure uniqueness must not contain a colon (:). When using this algorithm, the first colon to appear in IndicationIdentifier must appear between and . + /// is chosen by the business entity and should not be re-used to identify different underlying (real-world) elements. + ///If the above "preferred" algorithm is not used, the defining entity should assure that the resulting IndicationIdentifier is not re-used across any IndicationIdentifiers that are produced by this or other providers for the NameSpace of this instance. + ///For DMTF-defined instances, the "preferred" algorithm should be used with the set to CIM. + IndicationIdentifier string + + // The time and date of creation of the Indication. The property may be set to NULL if the entity creating the Indication is not capable of determining this information. Note that IndicationTime may be the same for two Indications that are generated in rapid succession. + IndicationTime string + + // Holds the value of the user defined severity value when 'PerceivedSeverity' is 1 ("Other"). + OtherSeverity string + + // An enumerated value that describes the severity of the Indication from the notifier's point of view: + ///1 - Other, by CIM convention, is used to indicate that the Severity's value can be found in the OtherSeverity property. + ///3 - Degraded/Warning should be used when its appropriate to let the user decide if action is needed. + ///4 - Minor should be used to indicate action is needed, but the situation is not serious at this time. + ///5 - Major should be used to indicate action is needed NOW. + ///6 - Critical should be used to indicate action is needed NOW and the scope is broad (perhaps an imminent outage to a critical resource will result). + ///7 - Fatal/NonRecoverable should be used to indicate an error occurred, but it's too late to take remedial action. + ///2 and 0 - Information and Unknown (respectively) follow common usage. Literally, the Indication is purely informational or its severity is simply unknown. + PerceivedSeverity Indication_PerceivedSeverity + + // The sequence context portion of a sequence identifier for the indication. The sequence number portion of the sequence identifier is provided by the SequenceNumber property. The combination of both property values represents the sequence identifier for the indication. + ///The sequence identifier for the indication enables a CIM listener to identify duplicate indications when the CIM service attempts the delivery retry of indications, to reorder indications that arrive out-of-order, and to detect lost indications. + ///If a CIM service does not support sequence identifiers for indications, this property shall be NULL. + ///If a CIM service supports sequence identifiers for indications, this property shall be maintained by the CIM service for each registered listener destination, and its value shall uniquely identify the CIM service and the indication service within the CIM service such that restarts of the CIM service and deregistration of listener destinations to the CIM service cause the value to change, without reusing earlier values for a sufficiently long time. + ///When retrying the delivery of an indication, this property shall have the same value as in the original delivery. + ///To guarantee this uniqueness, the property value should be constructed using the following format (defined in ABNF): sequence-context = indication-service-name "#" cim-service-start-id "#" listener-destination-creation-time + ///Where: indication-service-name is the value of the Name property of the CIM_IndicationService instance responsible for delivering the indication. cim-service-start-id is an identifier that uniquely identifies the CIM service start, for example via a timestamp of the start time, or via a counter that increases for each start or restart. listener-destination-creation-time is a timestamp of the creation time of the CIM_ListenerDestination instance representing the listener destination. + ///Since this format is only a recommendation, CIM clients shall treat the value as an opaque identifier for the sequence context and shall not rely on this format. + SequenceContext string + + // The sequence number portion of a sequence identifier for the indication. The sequence context portion of the sequence identifier is provided by the SequenceContext property. The combination of both property values represents the sequence identifier for the indication. + ///The sequence identifier for the indication enables a CIM listener to identify duplicate indications when the CIM service attempts the delivery retry of indications, to reorder indications that arrive out-of-order, and to detect lost indications. + ///If a CIM service does not support sequence identifiers for indications, this property shall be NULL. + ///If a CIM service supports sequence identifiers for indications, this property shall be maintained by the CIM service for each registered listener destination, and its value shall uniquely identify the indication within the sequence context provided by SequenceContext. It shall start at 0 whenever the sequence context string changes. Otherwise, it shall be increased by 1 for every new indication to that listener destination, and it shall wrap to 0 when the value range is exceeded. + ///When retrying the delivery of an indication, this property shall have the same value as in the original delivery. + SequenceNumber int64 +} + +func NewCIM_IndicationEx1(instance *cim.WmiInstance) (newInstance *CIM_Indication, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &CIM_Indication{ + WmiInstance: tmp, + } + return +} + +func NewCIM_IndicationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *CIM_Indication, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &CIM_Indication{ + WmiInstance: tmp, + } + return +} + +// SetCorrelatedIndications sets the value of CorrelatedIndications for the instance +func (instance *CIM_Indication) SetPropertyCorrelatedIndications(value []string) (err error) { + return instance.SetProperty("CorrelatedIndications", (value)) +} + +// GetCorrelatedIndications gets the value of CorrelatedIndications for the instance +func (instance *CIM_Indication) GetPropertyCorrelatedIndications() (value []string, err error) { + retValue, err := instance.GetProperty("CorrelatedIndications") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetIndicationFilterName sets the value of IndicationFilterName for the instance +func (instance *CIM_Indication) SetPropertyIndicationFilterName(value string) (err error) { + return instance.SetProperty("IndicationFilterName", (value)) +} + +// GetIndicationFilterName gets the value of IndicationFilterName for the instance +func (instance *CIM_Indication) GetPropertyIndicationFilterName() (value string, err error) { + retValue, err := instance.GetProperty("IndicationFilterName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetIndicationIdentifier sets the value of IndicationIdentifier for the instance +func (instance *CIM_Indication) SetPropertyIndicationIdentifier(value string) (err error) { + return instance.SetProperty("IndicationIdentifier", (value)) +} + +// GetIndicationIdentifier gets the value of IndicationIdentifier for the instance +func (instance *CIM_Indication) GetPropertyIndicationIdentifier() (value string, err error) { + retValue, err := instance.GetProperty("IndicationIdentifier") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetIndicationTime sets the value of IndicationTime for the instance +func (instance *CIM_Indication) SetPropertyIndicationTime(value string) (err error) { + return instance.SetProperty("IndicationTime", (value)) +} + +// GetIndicationTime gets the value of IndicationTime for the instance +func (instance *CIM_Indication) GetPropertyIndicationTime() (value string, err error) { + retValue, err := instance.GetProperty("IndicationTime") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOtherSeverity sets the value of OtherSeverity for the instance +func (instance *CIM_Indication) SetPropertyOtherSeverity(value string) (err error) { + return instance.SetProperty("OtherSeverity", (value)) +} + +// GetOtherSeverity gets the value of OtherSeverity for the instance +func (instance *CIM_Indication) GetPropertyOtherSeverity() (value string, err error) { + retValue, err := instance.GetProperty("OtherSeverity") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPerceivedSeverity sets the value of PerceivedSeverity for the instance +func (instance *CIM_Indication) SetPropertyPerceivedSeverity(value Indication_PerceivedSeverity) (err error) { + return instance.SetProperty("PerceivedSeverity", (value)) +} + +// GetPerceivedSeverity gets the value of PerceivedSeverity for the instance +func (instance *CIM_Indication) GetPropertyPerceivedSeverity() (value Indication_PerceivedSeverity, err error) { + retValue, err := instance.GetProperty("PerceivedSeverity") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(int32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " int32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = Indication_PerceivedSeverity(valuetmp) + + return +} + +// SetSequenceContext sets the value of SequenceContext for the instance +func (instance *CIM_Indication) SetPropertySequenceContext(value string) (err error) { + return instance.SetProperty("SequenceContext", (value)) +} + +// GetSequenceContext gets the value of SequenceContext for the instance +func (instance *CIM_Indication) GetPropertySequenceContext() (value string, err error) { + retValue, err := instance.GetProperty("SequenceContext") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSequenceNumber sets the value of SequenceNumber for the instance +func (instance *CIM_Indication) SetPropertySequenceNumber(value int64) (err error) { + return instance.SetProperty("SequenceNumber", (value)) +} + +// GetSequenceNumber gets the value of SequenceNumber for the instance +func (instance *CIM_Indication) GetPropertySequenceNumber() (value int64, err error) { + retValue, err := instance.GetProperty("SequenceNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(int64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " int64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = int64(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstCreation.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstCreation.go new file mode 100644 index 000000000..a743dc98d --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstCreation.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// CIM_InstCreation struct +type CIM_InstCreation struct { + *CIM_InstIndication +} + +func NewCIM_InstCreationEx1(instance *cim.WmiInstance) (newInstance *CIM_InstCreation, err error) { + tmp, err := NewCIM_InstIndicationEx1(instance) + + if err != nil { + return + } + newInstance = &CIM_InstCreation{ + CIM_InstIndication: tmp, + } + return +} + +func NewCIM_InstCreationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *CIM_InstCreation, err error) { + tmp, err := NewCIM_InstIndicationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &CIM_InstCreation{ + CIM_InstIndication: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstDeletion.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstDeletion.go new file mode 100644 index 000000000..6e999b169 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstDeletion.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// CIM_InstDeletion struct +type CIM_InstDeletion struct { + *CIM_InstIndication +} + +func NewCIM_InstDeletionEx1(instance *cim.WmiInstance) (newInstance *CIM_InstDeletion, err error) { + tmp, err := NewCIM_InstIndicationEx1(instance) + + if err != nil { + return + } + newInstance = &CIM_InstDeletion{ + CIM_InstIndication: tmp, + } + return +} + +func NewCIM_InstDeletionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *CIM_InstDeletion, err error) { + tmp, err := NewCIM_InstIndicationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &CIM_InstDeletion{ + CIM_InstIndication: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstIndication.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstIndication.go new file mode 100644 index 000000000..d1f270bc1 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstIndication.go @@ -0,0 +1,142 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// CIM_InstIndication struct +type CIM_InstIndication struct { + *CIM_Indication + + // A copy of the instance that changed to generate the Indication. SourceInstance contains the current values of the properties selected by the Indication Filter's Query. In the case of CIM_InstDeletion, the property values are copied before the instance is deleted. + SourceInstance interface{} + + // The host name or IP address of the SourceInstance. + SourceInstanceHost string + + // The Model Path of the SourceInstance. The following format MUST be used to encode the Model Path: + ///:.="", + ///="", ... + SourceInstanceModelPath string +} + +func NewCIM_InstIndicationEx1(instance *cim.WmiInstance) (newInstance *CIM_InstIndication, err error) { + tmp, err := NewCIM_IndicationEx1(instance) + + if err != nil { + return + } + newInstance = &CIM_InstIndication{ + CIM_Indication: tmp, + } + return +} + +func NewCIM_InstIndicationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *CIM_InstIndication, err error) { + tmp, err := NewCIM_IndicationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &CIM_InstIndication{ + CIM_Indication: tmp, + } + return +} + +// SetSourceInstance sets the value of SourceInstance for the instance +func (instance *CIM_InstIndication) SetPropertySourceInstance(value interface{}) (err error) { + return instance.SetProperty("SourceInstance", (value)) +} + +// GetSourceInstance gets the value of SourceInstance for the instance +func (instance *CIM_InstIndication) GetPropertySourceInstance() (value interface{}, err error) { + retValue, err := instance.GetProperty("SourceInstance") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(interface{}) + if !ok { + err = errors.Wrapf(errors.InvalidType, " interface{} is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = interface{}(valuetmp) + + return +} + +// SetSourceInstanceHost sets the value of SourceInstanceHost for the instance +func (instance *CIM_InstIndication) SetPropertySourceInstanceHost(value string) (err error) { + return instance.SetProperty("SourceInstanceHost", (value)) +} + +// GetSourceInstanceHost gets the value of SourceInstanceHost for the instance +func (instance *CIM_InstIndication) GetPropertySourceInstanceHost() (value string, err error) { + retValue, err := instance.GetProperty("SourceInstanceHost") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSourceInstanceModelPath sets the value of SourceInstanceModelPath for the instance +func (instance *CIM_InstIndication) SetPropertySourceInstanceModelPath(value string) (err error) { + return instance.SetProperty("SourceInstanceModelPath", (value)) +} + +// GetSourceInstanceModelPath gets the value of SourceInstanceModelPath for the instance +func (instance *CIM_InstIndication) GetPropertySourceInstanceModelPath() (value string, err error) { + retValue, err := instance.GetProperty("SourceInstanceModelPath") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstModification.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstModification.go new file mode 100644 index 000000000..c07317191 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/CIM_InstModification.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// CIM_InstModification struct +type CIM_InstModification struct { + *CIM_InstIndication + + // A copy of the 'previous' instance whose change generated the Indication. PreviousInstance contains 'older' values of an instance's properties (as compared to SourceInstance), selected by the IndicationFilter's Query. + PreviousInstance interface{} +} + +func NewCIM_InstModificationEx1(instance *cim.WmiInstance) (newInstance *CIM_InstModification, err error) { + tmp, err := NewCIM_InstIndicationEx1(instance) + + if err != nil { + return + } + newInstance = &CIM_InstModification{ + CIM_InstIndication: tmp, + } + return +} + +func NewCIM_InstModificationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *CIM_InstModification, err error) { + tmp, err := NewCIM_InstIndicationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &CIM_InstModification{ + CIM_InstIndication: tmp, + } + return +} + +// SetPreviousInstance sets the value of PreviousInstance for the instance +func (instance *CIM_InstModification) SetPropertyPreviousInstance(value interface{}) (err error) { + return instance.SetProperty("PreviousInstance", (value)) +} + +// GetPreviousInstance gets the value of PreviousInstance for the instance +func (instance *CIM_InstModification) GetPropertyPreviousInstance() (value interface{}, err error) { + retValue, err := instance.GetProperty("PreviousInstance") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(interface{}) + if !ok { + err = errors.Wrapf(errors.InvalidType, " interface{} is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = interface{}(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassCreationEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassCreationEvent.go new file mode 100644 index 000000000..3a3336531 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassCreationEvent.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __ClassCreationEvent struct +type __ClassCreationEvent struct { + *__ClassOperationEvent +} + +func New__ClassCreationEventEx1(instance *cim.WmiInstance) (newInstance *__ClassCreationEvent, err error) { + tmp, err := New__ClassOperationEventEx1(instance) + + if err != nil { + return + } + newInstance = &__ClassCreationEvent{ + __ClassOperationEvent: tmp, + } + return +} + +func New__ClassCreationEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__ClassCreationEvent, err error) { + tmp, err := New__ClassOperationEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__ClassCreationEvent{ + __ClassOperationEvent: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassDeletionEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassDeletionEvent.go new file mode 100644 index 000000000..72b392d3d --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassDeletionEvent.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __ClassDeletionEvent struct +type __ClassDeletionEvent struct { + *__ClassOperationEvent +} + +func New__ClassDeletionEventEx1(instance *cim.WmiInstance) (newInstance *__ClassDeletionEvent, err error) { + tmp, err := New__ClassOperationEventEx1(instance) + + if err != nil { + return + } + newInstance = &__ClassDeletionEvent{ + __ClassOperationEvent: tmp, + } + return +} + +func New__ClassDeletionEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__ClassDeletionEvent, err error) { + tmp, err := New__ClassOperationEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__ClassDeletionEvent{ + __ClassOperationEvent: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassModificationEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassModificationEvent.go new file mode 100644 index 000000000..e1abd57a1 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassModificationEvent.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __ClassModificationEvent struct +type __ClassModificationEvent struct { + *__ClassOperationEvent + + // + PreviousClass interface{} +} + +func New__ClassModificationEventEx1(instance *cim.WmiInstance) (newInstance *__ClassModificationEvent, err error) { + tmp, err := New__ClassOperationEventEx1(instance) + + if err != nil { + return + } + newInstance = &__ClassModificationEvent{ + __ClassOperationEvent: tmp, + } + return +} + +func New__ClassModificationEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__ClassModificationEvent, err error) { + tmp, err := New__ClassOperationEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__ClassModificationEvent{ + __ClassOperationEvent: tmp, + } + return +} + +// SetPreviousClass sets the value of PreviousClass for the instance +func (instance *__ClassModificationEvent) SetPropertyPreviousClass(value interface{}) (err error) { + return instance.SetProperty("PreviousClass", (value)) +} + +// GetPreviousClass gets the value of PreviousClass for the instance +func (instance *__ClassModificationEvent) GetPropertyPreviousClass() (value interface{}, err error) { + retValue, err := instance.GetProperty("PreviousClass") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(interface{}) + if !ok { + err = errors.Wrapf(errors.InvalidType, " interface{} is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = interface{}(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassOperationEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassOperationEvent.go new file mode 100644 index 000000000..75f94a4c9 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassOperationEvent.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __ClassOperationEvent struct +type __ClassOperationEvent struct { + *__Event + + // + TargetClass interface{} +} + +func New__ClassOperationEventEx1(instance *cim.WmiInstance) (newInstance *__ClassOperationEvent, err error) { + tmp, err := New__EventEx1(instance) + + if err != nil { + return + } + newInstance = &__ClassOperationEvent{ + __Event: tmp, + } + return +} + +func New__ClassOperationEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__ClassOperationEvent, err error) { + tmp, err := New__EventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__ClassOperationEvent{ + __Event: tmp, + } + return +} + +// SetTargetClass sets the value of TargetClass for the instance +func (instance *__ClassOperationEvent) SetPropertyTargetClass(value interface{}) (err error) { + return instance.SetProperty("TargetClass", (value)) +} + +// GetTargetClass gets the value of TargetClass for the instance +func (instance *__ClassOperationEvent) GetPropertyTargetClass() (value interface{}, err error) { + retValue, err := instance.GetProperty("TargetClass") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(interface{}) + if !ok { + err = errors.Wrapf(errors.InvalidType, " interface{} is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = interface{}(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassProviderRegistration.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassProviderRegistration.go new file mode 100644 index 000000000..7ec301562 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ClassProviderRegistration.go @@ -0,0 +1,263 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __ClassProviderRegistration struct +type __ClassProviderRegistration struct { + *__ObjectProviderRegistration + + // + CacheRefreshInterval string + + // + PerUserSchema bool + + // + ReferencedSetQueries []string + + // + ResultSetQueries []string + + // + ReSynchroniseOnNamespaceOpen bool + + // + UnsupportedQueries []string + + // + Version uint32 +} + +func New__ClassProviderRegistrationEx1(instance *cim.WmiInstance) (newInstance *__ClassProviderRegistration, err error) { + tmp, err := New__ObjectProviderRegistrationEx1(instance) + + if err != nil { + return + } + newInstance = &__ClassProviderRegistration{ + __ObjectProviderRegistration: tmp, + } + return +} + +func New__ClassProviderRegistrationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__ClassProviderRegistration, err error) { + tmp, err := New__ObjectProviderRegistrationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__ClassProviderRegistration{ + __ObjectProviderRegistration: tmp, + } + return +} + +// SetCacheRefreshInterval sets the value of CacheRefreshInterval for the instance +func (instance *__ClassProviderRegistration) SetPropertyCacheRefreshInterval(value string) (err error) { + return instance.SetProperty("CacheRefreshInterval", (value)) +} + +// GetCacheRefreshInterval gets the value of CacheRefreshInterval for the instance +func (instance *__ClassProviderRegistration) GetPropertyCacheRefreshInterval() (value string, err error) { + retValue, err := instance.GetProperty("CacheRefreshInterval") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPerUserSchema sets the value of PerUserSchema for the instance +func (instance *__ClassProviderRegistration) SetPropertyPerUserSchema(value bool) (err error) { + return instance.SetProperty("PerUserSchema", (value)) +} + +// GetPerUserSchema gets the value of PerUserSchema for the instance +func (instance *__ClassProviderRegistration) GetPropertyPerUserSchema() (value bool, err error) { + retValue, err := instance.GetProperty("PerUserSchema") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetReferencedSetQueries sets the value of ReferencedSetQueries for the instance +func (instance *__ClassProviderRegistration) SetPropertyReferencedSetQueries(value []string) (err error) { + return instance.SetProperty("ReferencedSetQueries", (value)) +} + +// GetReferencedSetQueries gets the value of ReferencedSetQueries for the instance +func (instance *__ClassProviderRegistration) GetPropertyReferencedSetQueries() (value []string, err error) { + retValue, err := instance.GetProperty("ReferencedSetQueries") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetResultSetQueries sets the value of ResultSetQueries for the instance +func (instance *__ClassProviderRegistration) SetPropertyResultSetQueries(value []string) (err error) { + return instance.SetProperty("ResultSetQueries", (value)) +} + +// GetResultSetQueries gets the value of ResultSetQueries for the instance +func (instance *__ClassProviderRegistration) GetPropertyResultSetQueries() (value []string, err error) { + retValue, err := instance.GetProperty("ResultSetQueries") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetReSynchroniseOnNamespaceOpen sets the value of ReSynchroniseOnNamespaceOpen for the instance +func (instance *__ClassProviderRegistration) SetPropertyReSynchroniseOnNamespaceOpen(value bool) (err error) { + return instance.SetProperty("ReSynchroniseOnNamespaceOpen", (value)) +} + +// GetReSynchroniseOnNamespaceOpen gets the value of ReSynchroniseOnNamespaceOpen for the instance +func (instance *__ClassProviderRegistration) GetPropertyReSynchroniseOnNamespaceOpen() (value bool, err error) { + retValue, err := instance.GetProperty("ReSynchroniseOnNamespaceOpen") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetUnsupportedQueries sets the value of UnsupportedQueries for the instance +func (instance *__ClassProviderRegistration) SetPropertyUnsupportedQueries(value []string) (err error) { + return instance.SetProperty("UnsupportedQueries", (value)) +} + +// GetUnsupportedQueries gets the value of UnsupportedQueries for the instance +func (instance *__ClassProviderRegistration) GetPropertyUnsupportedQueries() (value []string, err error) { + retValue, err := instance.GetProperty("UnsupportedQueries") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetVersion sets the value of Version for the instance +func (instance *__ClassProviderRegistration) SetPropertyVersion(value uint32) (err error) { + return instance.SetProperty("Version", (value)) +} + +// GetVersion gets the value of Version for the instance +func (instance *__ClassProviderRegistration) GetPropertyVersion() (value uint32, err error) { + retValue, err := instance.GetProperty("Version") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ConsumerFailureEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ConsumerFailureEvent.go new file mode 100644 index 000000000..73cde9d35 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ConsumerFailureEvent.go @@ -0,0 +1,140 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __ConsumerFailureEvent struct +type __ConsumerFailureEvent struct { + *__EventDroppedEvent + + // + ErrorCode uint32 + + // + ErrorDescription string + + // + ErrorObject __ExtendedStatus +} + +func New__ConsumerFailureEventEx1(instance *cim.WmiInstance) (newInstance *__ConsumerFailureEvent, err error) { + tmp, err := New__EventDroppedEventEx1(instance) + + if err != nil { + return + } + newInstance = &__ConsumerFailureEvent{ + __EventDroppedEvent: tmp, + } + return +} + +func New__ConsumerFailureEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__ConsumerFailureEvent, err error) { + tmp, err := New__EventDroppedEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__ConsumerFailureEvent{ + __EventDroppedEvent: tmp, + } + return +} + +// SetErrorCode sets the value of ErrorCode for the instance +func (instance *__ConsumerFailureEvent) SetPropertyErrorCode(value uint32) (err error) { + return instance.SetProperty("ErrorCode", (value)) +} + +// GetErrorCode gets the value of ErrorCode for the instance +func (instance *__ConsumerFailureEvent) GetPropertyErrorCode() (value uint32, err error) { + retValue, err := instance.GetProperty("ErrorCode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetErrorDescription sets the value of ErrorDescription for the instance +func (instance *__ConsumerFailureEvent) SetPropertyErrorDescription(value string) (err error) { + return instance.SetProperty("ErrorDescription", (value)) +} + +// GetErrorDescription gets the value of ErrorDescription for the instance +func (instance *__ConsumerFailureEvent) GetPropertyErrorDescription() (value string, err error) { + retValue, err := instance.GetProperty("ErrorDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetErrorObject sets the value of ErrorObject for the instance +func (instance *__ConsumerFailureEvent) SetPropertyErrorObject(value __ExtendedStatus) (err error) { + return instance.SetProperty("ErrorObject", (value)) +} + +// GetErrorObject gets the value of ErrorObject for the instance +func (instance *__ConsumerFailureEvent) GetPropertyErrorObject() (value __ExtendedStatus, err error) { + retValue, err := instance.GetProperty("ErrorObject") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(__ExtendedStatus) + if !ok { + err = errors.Wrapf(errors.InvalidType, " __ExtendedStatus is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = __ExtendedStatus(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Event.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Event.go new file mode 100644 index 000000000..aa87931d3 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Event.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __Event struct +type __Event struct { + *__IndicationRelated + + // + SECURITY_DESCRIPTOR []uint8 + + // + TIME_CREATED uint64 +} + +func New__EventEx1(instance *cim.WmiInstance) (newInstance *__Event, err error) { + tmp, err := New__IndicationRelatedEx1(instance) + + if err != nil { + return + } + newInstance = &__Event{ + __IndicationRelated: tmp, + } + return +} + +func New__EventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__Event, err error) { + tmp, err := New__IndicationRelatedEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__Event{ + __IndicationRelated: tmp, + } + return +} + +// SetSECURITY_DESCRIPTOR sets the value of SECURITY_DESCRIPTOR for the instance +func (instance *__Event) SetPropertySECURITY_DESCRIPTOR(value []uint8) (err error) { + return instance.SetProperty("SECURITY_DESCRIPTOR", (value)) +} + +// GetSECURITY_DESCRIPTOR gets the value of SECURITY_DESCRIPTOR for the instance +func (instance *__Event) GetPropertySECURITY_DESCRIPTOR() (value []uint8, err error) { + retValue, err := instance.GetProperty("SECURITY_DESCRIPTOR") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint8) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint8 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint8(valuetmp)) + } + + return +} + +// SetTIME_CREATED sets the value of TIME_CREATED for the instance +func (instance *__Event) SetPropertyTIME_CREATED(value uint64) (err error) { + return instance.SetProperty("TIME_CREATED", (value)) +} + +// GetTIME_CREATED gets the value of TIME_CREATED for the instance +func (instance *__Event) GetPropertyTIME_CREATED() (value uint64, err error) { + retValue, err := instance.GetProperty("TIME_CREATED") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventConsumer.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventConsumer.go new file mode 100644 index 000000000..9e7172a96 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventConsumer.go @@ -0,0 +1,141 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __EventConsumer struct +type __EventConsumer struct { + *__IndicationRelated + + // + CreatorSID []uint8 + + // + MachineName string + + // + MaximumQueueSize uint32 +} + +func New__EventConsumerEx1(instance *cim.WmiInstance) (newInstance *__EventConsumer, err error) { + tmp, err := New__IndicationRelatedEx1(instance) + + if err != nil { + return + } + newInstance = &__EventConsumer{ + __IndicationRelated: tmp, + } + return +} + +func New__EventConsumerEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__EventConsumer, err error) { + tmp, err := New__IndicationRelatedEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__EventConsumer{ + __IndicationRelated: tmp, + } + return +} + +// SetCreatorSID sets the value of CreatorSID for the instance +func (instance *__EventConsumer) SetPropertyCreatorSID(value []uint8) (err error) { + return instance.SetProperty("CreatorSID", (value)) +} + +// GetCreatorSID gets the value of CreatorSID for the instance +func (instance *__EventConsumer) GetPropertyCreatorSID() (value []uint8, err error) { + retValue, err := instance.GetProperty("CreatorSID") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint8) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint8 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint8(valuetmp)) + } + + return +} + +// SetMachineName sets the value of MachineName for the instance +func (instance *__EventConsumer) SetPropertyMachineName(value string) (err error) { + return instance.SetProperty("MachineName", (value)) +} + +// GetMachineName gets the value of MachineName for the instance +func (instance *__EventConsumer) GetPropertyMachineName() (value string, err error) { + retValue, err := instance.GetProperty("MachineName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetMaximumQueueSize sets the value of MaximumQueueSize for the instance +func (instance *__EventConsumer) SetPropertyMaximumQueueSize(value uint32) (err error) { + return instance.SetProperty("MaximumQueueSize", (value)) +} + +// GetMaximumQueueSize gets the value of MaximumQueueSize for the instance +func (instance *__EventConsumer) GetPropertyMaximumQueueSize() (value uint32, err error) { + retValue, err := instance.GetProperty("MaximumQueueSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventConsumerProviderRegistration.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventConsumerProviderRegistration.go new file mode 100644 index 000000000..fce897520 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventConsumerProviderRegistration.go @@ -0,0 +1,81 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __EventConsumerProviderRegistration struct +type __EventConsumerProviderRegistration struct { + *__ProviderRegistration + + // + ConsumerClassNames []string +} + +func New__EventConsumerProviderRegistrationEx1(instance *cim.WmiInstance) (newInstance *__EventConsumerProviderRegistration, err error) { + tmp, err := New__ProviderRegistrationEx1(instance) + + if err != nil { + return + } + newInstance = &__EventConsumerProviderRegistration{ + __ProviderRegistration: tmp, + } + return +} + +func New__EventConsumerProviderRegistrationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__EventConsumerProviderRegistration, err error) { + tmp, err := New__ProviderRegistrationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__EventConsumerProviderRegistration{ + __ProviderRegistration: tmp, + } + return +} + +// SetConsumerClassNames sets the value of ConsumerClassNames for the instance +func (instance *__EventConsumerProviderRegistration) SetPropertyConsumerClassNames(value []string) (err error) { + return instance.SetProperty("ConsumerClassNames", (value)) +} + +// GetConsumerClassNames gets the value of ConsumerClassNames for the instance +func (instance *__EventConsumerProviderRegistration) GetPropertyConsumerClassNames() (value []string, err error) { + retValue, err := instance.GetProperty("ConsumerClassNames") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventDroppedEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventDroppedEvent.go new file mode 100644 index 000000000..9f8145585 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventDroppedEvent.go @@ -0,0 +1,110 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __EventDroppedEvent struct +type __EventDroppedEvent struct { + *__SystemEvent + + // + Event __Event + + // + IntendedConsumer __EventConsumer +} + +func New__EventDroppedEventEx1(instance *cim.WmiInstance) (newInstance *__EventDroppedEvent, err error) { + tmp, err := New__SystemEventEx1(instance) + + if err != nil { + return + } + newInstance = &__EventDroppedEvent{ + __SystemEvent: tmp, + } + return +} + +func New__EventDroppedEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__EventDroppedEvent, err error) { + tmp, err := New__SystemEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__EventDroppedEvent{ + __SystemEvent: tmp, + } + return +} + +// SetEvent sets the value of Event for the instance +func (instance *__EventDroppedEvent) SetPropertyEvent(value __Event) (err error) { + return instance.SetProperty("Event", (value)) +} + +// GetEvent gets the value of Event for the instance +func (instance *__EventDroppedEvent) GetPropertyEvent() (value __Event, err error) { + retValue, err := instance.GetProperty("Event") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(__Event) + if !ok { + err = errors.Wrapf(errors.InvalidType, " __Event is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = __Event(valuetmp) + + return +} + +// SetIntendedConsumer sets the value of IntendedConsumer for the instance +func (instance *__EventDroppedEvent) SetPropertyIntendedConsumer(value __EventConsumer) (err error) { + return instance.SetProperty("IntendedConsumer", (value)) +} + +// GetIntendedConsumer gets the value of IntendedConsumer for the instance +func (instance *__EventDroppedEvent) GetPropertyIntendedConsumer() (value __EventConsumer, err error) { + retValue, err := instance.GetProperty("IntendedConsumer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(__EventConsumer) + if !ok { + err = errors.Wrapf(errors.InvalidType, " __EventConsumer is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = __EventConsumer(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventFilter.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventFilter.go new file mode 100644 index 000000000..9913d731b --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventFilter.go @@ -0,0 +1,231 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __EventFilter struct +type __EventFilter struct { + *__IndicationRelated + + // + CreatorSID []uint8 + + // + EventAccess string + + // + EventNamespace string + + // + Name string + + // + Query string + + // + QueryLanguage string +} + +func New__EventFilterEx1(instance *cim.WmiInstance) (newInstance *__EventFilter, err error) { + tmp, err := New__IndicationRelatedEx1(instance) + + if err != nil { + return + } + newInstance = &__EventFilter{ + __IndicationRelated: tmp, + } + return +} + +func New__EventFilterEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__EventFilter, err error) { + tmp, err := New__IndicationRelatedEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__EventFilter{ + __IndicationRelated: tmp, + } + return +} + +// SetCreatorSID sets the value of CreatorSID for the instance +func (instance *__EventFilter) SetPropertyCreatorSID(value []uint8) (err error) { + return instance.SetProperty("CreatorSID", (value)) +} + +// GetCreatorSID gets the value of CreatorSID for the instance +func (instance *__EventFilter) GetPropertyCreatorSID() (value []uint8, err error) { + retValue, err := instance.GetProperty("CreatorSID") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint8) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint8 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint8(valuetmp)) + } + + return +} + +// SetEventAccess sets the value of EventAccess for the instance +func (instance *__EventFilter) SetPropertyEventAccess(value string) (err error) { + return instance.SetProperty("EventAccess", (value)) +} + +// GetEventAccess gets the value of EventAccess for the instance +func (instance *__EventFilter) GetPropertyEventAccess() (value string, err error) { + retValue, err := instance.GetProperty("EventAccess") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetEventNamespace sets the value of EventNamespace for the instance +func (instance *__EventFilter) SetPropertyEventNamespace(value string) (err error) { + return instance.SetProperty("EventNamespace", (value)) +} + +// GetEventNamespace gets the value of EventNamespace for the instance +func (instance *__EventFilter) GetPropertyEventNamespace() (value string, err error) { + retValue, err := instance.GetProperty("EventNamespace") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetName sets the value of Name for the instance +func (instance *__EventFilter) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *__EventFilter) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetQuery sets the value of Query for the instance +func (instance *__EventFilter) SetPropertyQuery(value string) (err error) { + return instance.SetProperty("Query", (value)) +} + +// GetQuery gets the value of Query for the instance +func (instance *__EventFilter) GetPropertyQuery() (value string, err error) { + retValue, err := instance.GetProperty("Query") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetQueryLanguage sets the value of QueryLanguage for the instance +func (instance *__EventFilter) SetPropertyQueryLanguage(value string) (err error) { + return instance.SetProperty("QueryLanguage", (value)) +} + +// GetQueryLanguage gets the value of QueryLanguage for the instance +func (instance *__EventFilter) GetPropertyQueryLanguage() (value string, err error) { + retValue, err := instance.GetProperty("QueryLanguage") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventGenerator.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventGenerator.go new file mode 100644 index 000000000..b28e38bbe --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventGenerator.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __EventGenerator struct +type __EventGenerator struct { + *__IndicationRelated +} + +func New__EventGeneratorEx1(instance *cim.WmiInstance) (newInstance *__EventGenerator, err error) { + tmp, err := New__IndicationRelatedEx1(instance) + + if err != nil { + return + } + newInstance = &__EventGenerator{ + __IndicationRelated: tmp, + } + return +} + +func New__EventGeneratorEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__EventGenerator, err error) { + tmp, err := New__IndicationRelatedEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__EventGenerator{ + __IndicationRelated: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventProviderRegistration.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventProviderRegistration.go new file mode 100644 index 000000000..4fb73b383 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventProviderRegistration.go @@ -0,0 +1,81 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __EventProviderRegistration struct +type __EventProviderRegistration struct { + *__ProviderRegistration + + // + EventQueryList []string +} + +func New__EventProviderRegistrationEx1(instance *cim.WmiInstance) (newInstance *__EventProviderRegistration, err error) { + tmp, err := New__ProviderRegistrationEx1(instance) + + if err != nil { + return + } + newInstance = &__EventProviderRegistration{ + __ProviderRegistration: tmp, + } + return +} + +func New__EventProviderRegistrationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__EventProviderRegistration, err error) { + tmp, err := New__ProviderRegistrationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__EventProviderRegistration{ + __ProviderRegistration: tmp, + } + return +} + +// SetEventQueryList sets the value of EventQueryList for the instance +func (instance *__EventProviderRegistration) SetPropertyEventQueryList(value []string) (err error) { + return instance.SetProperty("EventQueryList", (value)) +} + +// GetEventQueryList gets the value of EventQueryList for the instance +func (instance *__EventProviderRegistration) GetPropertyEventQueryList() (value []string, err error) { + retValue, err := instance.GetProperty("EventQueryList") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventQueueOverflowEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventQueueOverflowEvent.go new file mode 100644 index 000000000..a1c110cf0 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/EventQueueOverflowEvent.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __EventQueueOverflowEvent struct +type __EventQueueOverflowEvent struct { + *__EventDroppedEvent + + // + CurrentQueueSize uint32 +} + +func New__EventQueueOverflowEventEx1(instance *cim.WmiInstance) (newInstance *__EventQueueOverflowEvent, err error) { + tmp, err := New__EventDroppedEventEx1(instance) + + if err != nil { + return + } + newInstance = &__EventQueueOverflowEvent{ + __EventDroppedEvent: tmp, + } + return +} + +func New__EventQueueOverflowEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__EventQueueOverflowEvent, err error) { + tmp, err := New__EventDroppedEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__EventQueueOverflowEvent{ + __EventDroppedEvent: tmp, + } + return +} + +// SetCurrentQueueSize sets the value of CurrentQueueSize for the instance +func (instance *__EventQueueOverflowEvent) SetPropertyCurrentQueueSize(value uint32) (err error) { + return instance.SetProperty("CurrentQueueSize", (value)) +} + +// GetCurrentQueueSize gets the value of CurrentQueueSize for the instance +func (instance *__EventQueueOverflowEvent) GetPropertyCurrentQueueSize() (value uint32, err error) { + retValue, err := instance.GetProperty("CurrentQueueSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ExtendedStatus.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ExtendedStatus.go new file mode 100644 index 000000000..be13c78eb --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ExtendedStatus.go @@ -0,0 +1,170 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __ExtendedStatus struct +type __ExtendedStatus struct { + *__NotifyStatus + + // + Description string + + // + Operation string + + // + ParameterInfo string + + // + ProviderName string +} + +func New__ExtendedStatusEx1(instance *cim.WmiInstance) (newInstance *__ExtendedStatus, err error) { + tmp, err := New__NotifyStatusEx1(instance) + + if err != nil { + return + } + newInstance = &__ExtendedStatus{ + __NotifyStatus: tmp, + } + return +} + +func New__ExtendedStatusEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__ExtendedStatus, err error) { + tmp, err := New__NotifyStatusEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__ExtendedStatus{ + __NotifyStatus: tmp, + } + return +} + +// SetDescription sets the value of Description for the instance +func (instance *__ExtendedStatus) SetPropertyDescription(value string) (err error) { + return instance.SetProperty("Description", (value)) +} + +// GetDescription gets the value of Description for the instance +func (instance *__ExtendedStatus) GetPropertyDescription() (value string, err error) { + retValue, err := instance.GetProperty("Description") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOperation sets the value of Operation for the instance +func (instance *__ExtendedStatus) SetPropertyOperation(value string) (err error) { + return instance.SetProperty("Operation", (value)) +} + +// GetOperation gets the value of Operation for the instance +func (instance *__ExtendedStatus) GetPropertyOperation() (value string, err error) { + retValue, err := instance.GetProperty("Operation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetParameterInfo sets the value of ParameterInfo for the instance +func (instance *__ExtendedStatus) SetPropertyParameterInfo(value string) (err error) { + return instance.SetProperty("ParameterInfo", (value)) +} + +// GetParameterInfo gets the value of ParameterInfo for the instance +func (instance *__ExtendedStatus) GetPropertyParameterInfo() (value string, err error) { + retValue, err := instance.GetProperty("ParameterInfo") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetProviderName sets the value of ProviderName for the instance +func (instance *__ExtendedStatus) SetPropertyProviderName(value string) (err error) { + return instance.SetProperty("ProviderName", (value)) +} + +// GetProviderName gets the value of ProviderName for the instance +func (instance *__ExtendedStatus) GetPropertyProviderName() (value string, err error) { + retValue, err := instance.GetProperty("ProviderName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ExtrinsicEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ExtrinsicEvent.go new file mode 100644 index 000000000..e71d3b367 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ExtrinsicEvent.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __ExtrinsicEvent struct +type __ExtrinsicEvent struct { + *__Event +} + +func New__ExtrinsicEventEx1(instance *cim.WmiInstance) (newInstance *__ExtrinsicEvent, err error) { + tmp, err := New__EventEx1(instance) + + if err != nil { + return + } + newInstance = &__ExtrinsicEvent{ + __Event: tmp, + } + return +} + +func New__ExtrinsicEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__ExtrinsicEvent, err error) { + tmp, err := New__EventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__ExtrinsicEvent{ + __Event: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/FilterToConsumerBinding.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/FilterToConsumerBinding.go new file mode 100644 index 000000000..a0f87be64 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/FilterToConsumerBinding.go @@ -0,0 +1,261 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __FilterToConsumerBinding struct +type __FilterToConsumerBinding struct { + *__IndicationRelated + + // + Consumer __EventConsumer + + // + CreatorSID []uint8 + + // + DeliverSynchronously bool + + // + DeliveryQoS uint32 + + // + Filter __EventFilter + + // + MaintainSecurityContext bool + + // + SlowDownProviders bool +} + +func New__FilterToConsumerBindingEx1(instance *cim.WmiInstance) (newInstance *__FilterToConsumerBinding, err error) { + tmp, err := New__IndicationRelatedEx1(instance) + + if err != nil { + return + } + newInstance = &__FilterToConsumerBinding{ + __IndicationRelated: tmp, + } + return +} + +func New__FilterToConsumerBindingEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__FilterToConsumerBinding, err error) { + tmp, err := New__IndicationRelatedEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__FilterToConsumerBinding{ + __IndicationRelated: tmp, + } + return +} + +// SetConsumer sets the value of Consumer for the instance +func (instance *__FilterToConsumerBinding) SetPropertyConsumer(value __EventConsumer) (err error) { + return instance.SetProperty("Consumer", (value)) +} + +// GetConsumer gets the value of Consumer for the instance +func (instance *__FilterToConsumerBinding) GetPropertyConsumer() (value __EventConsumer, err error) { + retValue, err := instance.GetProperty("Consumer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(__EventConsumer) + if !ok { + err = errors.Wrapf(errors.InvalidType, " __EventConsumer is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = __EventConsumer(valuetmp) + + return +} + +// SetCreatorSID sets the value of CreatorSID for the instance +func (instance *__FilterToConsumerBinding) SetPropertyCreatorSID(value []uint8) (err error) { + return instance.SetProperty("CreatorSID", (value)) +} + +// GetCreatorSID gets the value of CreatorSID for the instance +func (instance *__FilterToConsumerBinding) GetPropertyCreatorSID() (value []uint8, err error) { + retValue, err := instance.GetProperty("CreatorSID") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint8) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint8 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint8(valuetmp)) + } + + return +} + +// SetDeliverSynchronously sets the value of DeliverSynchronously for the instance +func (instance *__FilterToConsumerBinding) SetPropertyDeliverSynchronously(value bool) (err error) { + return instance.SetProperty("DeliverSynchronously", (value)) +} + +// GetDeliverSynchronously gets the value of DeliverSynchronously for the instance +func (instance *__FilterToConsumerBinding) GetPropertyDeliverSynchronously() (value bool, err error) { + retValue, err := instance.GetProperty("DeliverSynchronously") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetDeliveryQoS sets the value of DeliveryQoS for the instance +func (instance *__FilterToConsumerBinding) SetPropertyDeliveryQoS(value uint32) (err error) { + return instance.SetProperty("DeliveryQoS", (value)) +} + +// GetDeliveryQoS gets the value of DeliveryQoS for the instance +func (instance *__FilterToConsumerBinding) GetPropertyDeliveryQoS() (value uint32, err error) { + retValue, err := instance.GetProperty("DeliveryQoS") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetFilter sets the value of Filter for the instance +func (instance *__FilterToConsumerBinding) SetPropertyFilter(value __EventFilter) (err error) { + return instance.SetProperty("Filter", (value)) +} + +// GetFilter gets the value of Filter for the instance +func (instance *__FilterToConsumerBinding) GetPropertyFilter() (value __EventFilter, err error) { + retValue, err := instance.GetProperty("Filter") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(__EventFilter) + if !ok { + err = errors.Wrapf(errors.InvalidType, " __EventFilter is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = __EventFilter(valuetmp) + + return +} + +// SetMaintainSecurityContext sets the value of MaintainSecurityContext for the instance +func (instance *__FilterToConsumerBinding) SetPropertyMaintainSecurityContext(value bool) (err error) { + return instance.SetProperty("MaintainSecurityContext", (value)) +} + +// GetMaintainSecurityContext gets the value of MaintainSecurityContext for the instance +func (instance *__FilterToConsumerBinding) GetPropertyMaintainSecurityContext() (value bool, err error) { + retValue, err := instance.GetProperty("MaintainSecurityContext") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSlowDownProviders sets the value of SlowDownProviders for the instance +func (instance *__FilterToConsumerBinding) SetPropertySlowDownProviders(value bool) (err error) { + return instance.SetProperty("SlowDownProviders", (value)) +} + +// GetSlowDownProviders gets the value of SlowDownProviders for the instance +func (instance *__FilterToConsumerBinding) GetPropertySlowDownProviders() (value bool, err error) { + retValue, err := instance.GetProperty("SlowDownProviders") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/IndicationRelated.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/IndicationRelated.go new file mode 100644 index 000000000..9bb16b1b5 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/IndicationRelated.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __IndicationRelated struct +type __IndicationRelated struct { + *__SystemClass +} + +func New__IndicationRelatedEx1(instance *cim.WmiInstance) (newInstance *__IndicationRelated, err error) { + tmp, err := New__SystemClassEx1(instance) + + if err != nil { + return + } + newInstance = &__IndicationRelated{ + __SystemClass: tmp, + } + return +} + +func New__IndicationRelatedEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__IndicationRelated, err error) { + tmp, err := New__SystemClassEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__IndicationRelated{ + __SystemClass: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Indication_PerceivedSeverity.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Indication_PerceivedSeverity.go new file mode 100644 index 000000000..9a06b6107 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Indication_PerceivedSeverity.go @@ -0,0 +1,33 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source Indication_PerceivedSeverity +////////////////////////////////////////////// +package storage + +// Indication_PerceivedSeverity +type Indication_PerceivedSeverity int + +const ( + // Unknown enum + Indication_PerceivedSeverity_Unknown Indication_PerceivedSeverity = 0 + // Other enum + Indication_PerceivedSeverity_Other Indication_PerceivedSeverity = 1 + // Information enum + Indication_PerceivedSeverity_Information Indication_PerceivedSeverity = 2 + // Degraded_Warning enum + Indication_PerceivedSeverity_Degraded_Warning Indication_PerceivedSeverity = 3 + // Minor enum + Indication_PerceivedSeverity_Minor Indication_PerceivedSeverity = 4 + // Major enum + Indication_PerceivedSeverity_Major Indication_PerceivedSeverity = 5 + // Critical enum + Indication_PerceivedSeverity_Critical Indication_PerceivedSeverity = 6 + // Fatal_NonRecoverable enum + Indication_PerceivedSeverity_Fatal_NonRecoverable Indication_PerceivedSeverity = 7 + // DMTF_Reserved enum + Indication_PerceivedSeverity_DMTF_Reserved Indication_PerceivedSeverity = 8 +) diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceCreationEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceCreationEvent.go new file mode 100644 index 000000000..fac8cdf13 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceCreationEvent.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __InstanceCreationEvent struct +type __InstanceCreationEvent struct { + *__InstanceOperationEvent +} + +func New__InstanceCreationEventEx1(instance *cim.WmiInstance) (newInstance *__InstanceCreationEvent, err error) { + tmp, err := New__InstanceOperationEventEx1(instance) + + if err != nil { + return + } + newInstance = &__InstanceCreationEvent{ + __InstanceOperationEvent: tmp, + } + return +} + +func New__InstanceCreationEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__InstanceCreationEvent, err error) { + tmp, err := New__InstanceOperationEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__InstanceCreationEvent{ + __InstanceOperationEvent: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceDeletionEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceDeletionEvent.go new file mode 100644 index 000000000..1680878d6 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceDeletionEvent.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __InstanceDeletionEvent struct +type __InstanceDeletionEvent struct { + *__InstanceOperationEvent +} + +func New__InstanceDeletionEventEx1(instance *cim.WmiInstance) (newInstance *__InstanceDeletionEvent, err error) { + tmp, err := New__InstanceOperationEventEx1(instance) + + if err != nil { + return + } + newInstance = &__InstanceDeletionEvent{ + __InstanceOperationEvent: tmp, + } + return +} + +func New__InstanceDeletionEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__InstanceDeletionEvent, err error) { + tmp, err := New__InstanceOperationEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__InstanceDeletionEvent{ + __InstanceOperationEvent: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceModificationEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceModificationEvent.go new file mode 100644 index 000000000..1d529801f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceModificationEvent.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __InstanceModificationEvent struct +type __InstanceModificationEvent struct { + *__InstanceOperationEvent + + // + PreviousInstance interface{} +} + +func New__InstanceModificationEventEx1(instance *cim.WmiInstance) (newInstance *__InstanceModificationEvent, err error) { + tmp, err := New__InstanceOperationEventEx1(instance) + + if err != nil { + return + } + newInstance = &__InstanceModificationEvent{ + __InstanceOperationEvent: tmp, + } + return +} + +func New__InstanceModificationEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__InstanceModificationEvent, err error) { + tmp, err := New__InstanceOperationEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__InstanceModificationEvent{ + __InstanceOperationEvent: tmp, + } + return +} + +// SetPreviousInstance sets the value of PreviousInstance for the instance +func (instance *__InstanceModificationEvent) SetPropertyPreviousInstance(value interface{}) (err error) { + return instance.SetProperty("PreviousInstance", (value)) +} + +// GetPreviousInstance gets the value of PreviousInstance for the instance +func (instance *__InstanceModificationEvent) GetPropertyPreviousInstance() (value interface{}, err error) { + retValue, err := instance.GetProperty("PreviousInstance") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(interface{}) + if !ok { + err = errors.Wrapf(errors.InvalidType, " interface{} is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = interface{}(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceOperationEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceOperationEvent.go new file mode 100644 index 000000000..e5c9dbc95 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceOperationEvent.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __InstanceOperationEvent struct +type __InstanceOperationEvent struct { + *__Event + + // + TargetInstance interface{} +} + +func New__InstanceOperationEventEx1(instance *cim.WmiInstance) (newInstance *__InstanceOperationEvent, err error) { + tmp, err := New__EventEx1(instance) + + if err != nil { + return + } + newInstance = &__InstanceOperationEvent{ + __Event: tmp, + } + return +} + +func New__InstanceOperationEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__InstanceOperationEvent, err error) { + tmp, err := New__EventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__InstanceOperationEvent{ + __Event: tmp, + } + return +} + +// SetTargetInstance sets the value of TargetInstance for the instance +func (instance *__InstanceOperationEvent) SetPropertyTargetInstance(value interface{}) (err error) { + return instance.SetProperty("TargetInstance", (value)) +} + +// GetTargetInstance gets the value of TargetInstance for the instance +func (instance *__InstanceOperationEvent) GetPropertyTargetInstance() (value interface{}, err error) { + retValue, err := instance.GetProperty("TargetInstance") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(interface{}) + if !ok { + err = errors.Wrapf(errors.InvalidType, " interface{} is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = interface{}(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceProviderRegistration.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceProviderRegistration.go new file mode 100644 index 000000000..6a32c9e95 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/InstanceProviderRegistration.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __InstanceProviderRegistration struct +type __InstanceProviderRegistration struct { + *__ObjectProviderRegistration +} + +func New__InstanceProviderRegistrationEx1(instance *cim.WmiInstance) (newInstance *__InstanceProviderRegistration, err error) { + tmp, err := New__ObjectProviderRegistrationEx1(instance) + + if err != nil { + return + } + newInstance = &__InstanceProviderRegistration{ + __ObjectProviderRegistration: tmp, + } + return +} + +func New__InstanceProviderRegistrationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__InstanceProviderRegistration, err error) { + tmp, err := New__ObjectProviderRegistrationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__InstanceProviderRegistration{ + __ObjectProviderRegistration: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/IntervalTimerInstruction.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/IntervalTimerInstruction.go new file mode 100644 index 000000000..6d27e3196 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/IntervalTimerInstruction.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __IntervalTimerInstruction struct +type __IntervalTimerInstruction struct { + *__TimerInstruction + + // + IntervalBetweenEvents uint32 +} + +func New__IntervalTimerInstructionEx1(instance *cim.WmiInstance) (newInstance *__IntervalTimerInstruction, err error) { + tmp, err := New__TimerInstructionEx1(instance) + + if err != nil { + return + } + newInstance = &__IntervalTimerInstruction{ + __TimerInstruction: tmp, + } + return +} + +func New__IntervalTimerInstructionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__IntervalTimerInstruction, err error) { + tmp, err := New__TimerInstructionEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__IntervalTimerInstruction{ + __TimerInstruction: tmp, + } + return +} + +// SetIntervalBetweenEvents sets the value of IntervalBetweenEvents for the instance +func (instance *__IntervalTimerInstruction) SetPropertyIntervalBetweenEvents(value uint32) (err error) { + return instance.SetProperty("IntervalBetweenEvents", (value)) +} + +// GetIntervalBetweenEvents gets the value of IntervalBetweenEvents for the instance +func (instance *__IntervalTimerInstruction) GetPropertyIntervalBetweenEvents() (value uint32, err error) { + retValue, err := instance.GetProperty("IntervalBetweenEvents") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DedupProperties.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DedupProperties.go new file mode 100644 index 000000000..367ad1ef5 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DedupProperties.go @@ -0,0 +1,291 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_DedupProperties struct +type MSFT_DedupProperties struct { + *cim.WmiInstance + + // + InPolicyFilesCount uint64 + + // + InPolicyFilesSize uint64 + + // + OptimizedFilesCount uint64 + + // + OptimizedFilesSavingsRate uint32 + + // + OptimizedFilesSize uint64 + + // + SavingsRate uint32 + + // + SavingsSize uint64 + + // + UnoptimizedSize uint64 +} + +func NewMSFT_DedupPropertiesEx1(instance *cim.WmiInstance) (newInstance *MSFT_DedupProperties, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_DedupProperties{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_DedupPropertiesEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_DedupProperties, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_DedupProperties{ + WmiInstance: tmp, + } + return +} + +// SetInPolicyFilesCount sets the value of InPolicyFilesCount for the instance +func (instance *MSFT_DedupProperties) SetPropertyInPolicyFilesCount(value uint64) (err error) { + return instance.SetProperty("InPolicyFilesCount", (value)) +} + +// GetInPolicyFilesCount gets the value of InPolicyFilesCount for the instance +func (instance *MSFT_DedupProperties) GetPropertyInPolicyFilesCount() (value uint64, err error) { + retValue, err := instance.GetProperty("InPolicyFilesCount") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetInPolicyFilesSize sets the value of InPolicyFilesSize for the instance +func (instance *MSFT_DedupProperties) SetPropertyInPolicyFilesSize(value uint64) (err error) { + return instance.SetProperty("InPolicyFilesSize", (value)) +} + +// GetInPolicyFilesSize gets the value of InPolicyFilesSize for the instance +func (instance *MSFT_DedupProperties) GetPropertyInPolicyFilesSize() (value uint64, err error) { + retValue, err := instance.GetProperty("InPolicyFilesSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetOptimizedFilesCount sets the value of OptimizedFilesCount for the instance +func (instance *MSFT_DedupProperties) SetPropertyOptimizedFilesCount(value uint64) (err error) { + return instance.SetProperty("OptimizedFilesCount", (value)) +} + +// GetOptimizedFilesCount gets the value of OptimizedFilesCount for the instance +func (instance *MSFT_DedupProperties) GetPropertyOptimizedFilesCount() (value uint64, err error) { + retValue, err := instance.GetProperty("OptimizedFilesCount") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetOptimizedFilesSavingsRate sets the value of OptimizedFilesSavingsRate for the instance +func (instance *MSFT_DedupProperties) SetPropertyOptimizedFilesSavingsRate(value uint32) (err error) { + return instance.SetProperty("OptimizedFilesSavingsRate", (value)) +} + +// GetOptimizedFilesSavingsRate gets the value of OptimizedFilesSavingsRate for the instance +func (instance *MSFT_DedupProperties) GetPropertyOptimizedFilesSavingsRate() (value uint32, err error) { + retValue, err := instance.GetProperty("OptimizedFilesSavingsRate") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetOptimizedFilesSize sets the value of OptimizedFilesSize for the instance +func (instance *MSFT_DedupProperties) SetPropertyOptimizedFilesSize(value uint64) (err error) { + return instance.SetProperty("OptimizedFilesSize", (value)) +} + +// GetOptimizedFilesSize gets the value of OptimizedFilesSize for the instance +func (instance *MSFT_DedupProperties) GetPropertyOptimizedFilesSize() (value uint64, err error) { + retValue, err := instance.GetProperty("OptimizedFilesSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetSavingsRate sets the value of SavingsRate for the instance +func (instance *MSFT_DedupProperties) SetPropertySavingsRate(value uint32) (err error) { + return instance.SetProperty("SavingsRate", (value)) +} + +// GetSavingsRate gets the value of SavingsRate for the instance +func (instance *MSFT_DedupProperties) GetPropertySavingsRate() (value uint32, err error) { + retValue, err := instance.GetProperty("SavingsRate") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetSavingsSize sets the value of SavingsSize for the instance +func (instance *MSFT_DedupProperties) SetPropertySavingsSize(value uint64) (err error) { + return instance.SetProperty("SavingsSize", (value)) +} + +// GetSavingsSize gets the value of SavingsSize for the instance +func (instance *MSFT_DedupProperties) GetPropertySavingsSize() (value uint64, err error) { + retValue, err := instance.GetProperty("SavingsSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetUnoptimizedSize sets the value of UnoptimizedSize for the instance +func (instance *MSFT_DedupProperties) SetPropertyUnoptimizedSize(value uint64) (err error) { + return instance.SetProperty("UnoptimizedSize", (value)) +} + +// GetUnoptimizedSize gets the value of UnoptimizedSize for the instance +func (instance *MSFT_DedupProperties) GetPropertyUnoptimizedSize() (value uint64, err error) { + retValue, err := instance.GetProperty("UnoptimizedSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Disk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Disk.go new file mode 100644 index 000000000..95c39e3e5 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Disk.go @@ -0,0 +1,1252 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_Disk struct +type MSFT_Disk struct { + *MSFT_StorageObject + + // + AdapterSerialNumber string + + // + AllocatedSize uint64 + + // + BootFromDisk bool + + // + BusType uint16 + + // + FirmwareVersion string + + // + FriendlyName string + + // + Guid string + + // + HealthStatus uint16 + + // + IsBoot bool + + // + IsClustered bool + + // + IsHighlyAvailable bool + + // + IsOffline bool + + // + IsReadOnly bool + + // + IsScaleOut bool + + // + IsSystem bool + + // + LargestFreeExtent uint64 + + // + Location string + + // + LogicalSectorSize uint32 + + // + Manufacturer string + + // + Model string + + // + Number uint32 + + // + NumberOfPartitions uint32 + + // + OfflineReason uint16 + + // + OperationalStatus []uint16 + + // + PartitionStyle uint16 + + // + Path string + + // + PhysicalSectorSize uint32 + + // + ProvisioningType uint16 + + // + SerialNumber string + + // + Signature uint32 + + // + Size uint64 + + // + UniqueIdFormat uint16 +} + +func NewMSFT_DiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_Disk, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_Disk{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_DiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_Disk, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_Disk{ + MSFT_StorageObject: tmp, + } + return +} + +// SetAdapterSerialNumber sets the value of AdapterSerialNumber for the instance +func (instance *MSFT_Disk) SetPropertyAdapterSerialNumber(value string) (err error) { + return instance.SetProperty("AdapterSerialNumber", (value)) +} + +// GetAdapterSerialNumber gets the value of AdapterSerialNumber for the instance +func (instance *MSFT_Disk) GetPropertyAdapterSerialNumber() (value string, err error) { + retValue, err := instance.GetProperty("AdapterSerialNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetAllocatedSize sets the value of AllocatedSize for the instance +func (instance *MSFT_Disk) SetPropertyAllocatedSize(value uint64) (err error) { + return instance.SetProperty("AllocatedSize", (value)) +} + +// GetAllocatedSize gets the value of AllocatedSize for the instance +func (instance *MSFT_Disk) GetPropertyAllocatedSize() (value uint64, err error) { + retValue, err := instance.GetProperty("AllocatedSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetBootFromDisk sets the value of BootFromDisk for the instance +func (instance *MSFT_Disk) SetPropertyBootFromDisk(value bool) (err error) { + return instance.SetProperty("BootFromDisk", (value)) +} + +// GetBootFromDisk gets the value of BootFromDisk for the instance +func (instance *MSFT_Disk) GetPropertyBootFromDisk() (value bool, err error) { + retValue, err := instance.GetProperty("BootFromDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetBusType sets the value of BusType for the instance +func (instance *MSFT_Disk) SetPropertyBusType(value uint16) (err error) { + return instance.SetProperty("BusType", (value)) +} + +// GetBusType gets the value of BusType for the instance +func (instance *MSFT_Disk) GetPropertyBusType() (value uint16, err error) { + retValue, err := instance.GetProperty("BusType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetFirmwareVersion sets the value of FirmwareVersion for the instance +func (instance *MSFT_Disk) SetPropertyFirmwareVersion(value string) (err error) { + return instance.SetProperty("FirmwareVersion", (value)) +} + +// GetFirmwareVersion gets the value of FirmwareVersion for the instance +func (instance *MSFT_Disk) GetPropertyFirmwareVersion() (value string, err error) { + retValue, err := instance.GetProperty("FirmwareVersion") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFriendlyName sets the value of FriendlyName for the instance +func (instance *MSFT_Disk) SetPropertyFriendlyName(value string) (err error) { + return instance.SetProperty("FriendlyName", (value)) +} + +// GetFriendlyName gets the value of FriendlyName for the instance +func (instance *MSFT_Disk) GetPropertyFriendlyName() (value string, err error) { + retValue, err := instance.GetProperty("FriendlyName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetGuid sets the value of Guid for the instance +func (instance *MSFT_Disk) SetPropertyGuid(value string) (err error) { + return instance.SetProperty("Guid", (value)) +} + +// GetGuid gets the value of Guid for the instance +func (instance *MSFT_Disk) GetPropertyGuid() (value string, err error) { + retValue, err := instance.GetProperty("Guid") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetHealthStatus sets the value of HealthStatus for the instance +func (instance *MSFT_Disk) SetPropertyHealthStatus(value uint16) (err error) { + return instance.SetProperty("HealthStatus", (value)) +} + +// GetHealthStatus gets the value of HealthStatus for the instance +func (instance *MSFT_Disk) GetPropertyHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("HealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetIsBoot sets the value of IsBoot for the instance +func (instance *MSFT_Disk) SetPropertyIsBoot(value bool) (err error) { + return instance.SetProperty("IsBoot", (value)) +} + +// GetIsBoot gets the value of IsBoot for the instance +func (instance *MSFT_Disk) GetPropertyIsBoot() (value bool, err error) { + retValue, err := instance.GetProperty("IsBoot") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsClustered sets the value of IsClustered for the instance +func (instance *MSFT_Disk) SetPropertyIsClustered(value bool) (err error) { + return instance.SetProperty("IsClustered", (value)) +} + +// GetIsClustered gets the value of IsClustered for the instance +func (instance *MSFT_Disk) GetPropertyIsClustered() (value bool, err error) { + retValue, err := instance.GetProperty("IsClustered") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsHighlyAvailable sets the value of IsHighlyAvailable for the instance +func (instance *MSFT_Disk) SetPropertyIsHighlyAvailable(value bool) (err error) { + return instance.SetProperty("IsHighlyAvailable", (value)) +} + +// GetIsHighlyAvailable gets the value of IsHighlyAvailable for the instance +func (instance *MSFT_Disk) GetPropertyIsHighlyAvailable() (value bool, err error) { + retValue, err := instance.GetProperty("IsHighlyAvailable") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsOffline sets the value of IsOffline for the instance +func (instance *MSFT_Disk) SetPropertyIsOffline(value bool) (err error) { + return instance.SetProperty("IsOffline", (value)) +} + +// GetIsOffline gets the value of IsOffline for the instance +func (instance *MSFT_Disk) GetPropertyIsOffline() (value bool, err error) { + retValue, err := instance.GetProperty("IsOffline") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsReadOnly sets the value of IsReadOnly for the instance +func (instance *MSFT_Disk) SetPropertyIsReadOnly(value bool) (err error) { + return instance.SetProperty("IsReadOnly", (value)) +} + +// GetIsReadOnly gets the value of IsReadOnly for the instance +func (instance *MSFT_Disk) GetPropertyIsReadOnly() (value bool, err error) { + retValue, err := instance.GetProperty("IsReadOnly") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsScaleOut sets the value of IsScaleOut for the instance +func (instance *MSFT_Disk) SetPropertyIsScaleOut(value bool) (err error) { + return instance.SetProperty("IsScaleOut", (value)) +} + +// GetIsScaleOut gets the value of IsScaleOut for the instance +func (instance *MSFT_Disk) GetPropertyIsScaleOut() (value bool, err error) { + retValue, err := instance.GetProperty("IsScaleOut") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsSystem sets the value of IsSystem for the instance +func (instance *MSFT_Disk) SetPropertyIsSystem(value bool) (err error) { + return instance.SetProperty("IsSystem", (value)) +} + +// GetIsSystem gets the value of IsSystem for the instance +func (instance *MSFT_Disk) GetPropertyIsSystem() (value bool, err error) { + retValue, err := instance.GetProperty("IsSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetLargestFreeExtent sets the value of LargestFreeExtent for the instance +func (instance *MSFT_Disk) SetPropertyLargestFreeExtent(value uint64) (err error) { + return instance.SetProperty("LargestFreeExtent", (value)) +} + +// GetLargestFreeExtent gets the value of LargestFreeExtent for the instance +func (instance *MSFT_Disk) GetPropertyLargestFreeExtent() (value uint64, err error) { + retValue, err := instance.GetProperty("LargestFreeExtent") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetLocation sets the value of Location for the instance +func (instance *MSFT_Disk) SetPropertyLocation(value string) (err error) { + return instance.SetProperty("Location", (value)) +} + +// GetLocation gets the value of Location for the instance +func (instance *MSFT_Disk) GetPropertyLocation() (value string, err error) { + retValue, err := instance.GetProperty("Location") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetLogicalSectorSize sets the value of LogicalSectorSize for the instance +func (instance *MSFT_Disk) SetPropertyLogicalSectorSize(value uint32) (err error) { + return instance.SetProperty("LogicalSectorSize", (value)) +} + +// GetLogicalSectorSize gets the value of LogicalSectorSize for the instance +func (instance *MSFT_Disk) GetPropertyLogicalSectorSize() (value uint32, err error) { + retValue, err := instance.GetProperty("LogicalSectorSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetManufacturer sets the value of Manufacturer for the instance +func (instance *MSFT_Disk) SetPropertyManufacturer(value string) (err error) { + return instance.SetProperty("Manufacturer", (value)) +} + +// GetManufacturer gets the value of Manufacturer for the instance +func (instance *MSFT_Disk) GetPropertyManufacturer() (value string, err error) { + retValue, err := instance.GetProperty("Manufacturer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetModel sets the value of Model for the instance +func (instance *MSFT_Disk) SetPropertyModel(value string) (err error) { + return instance.SetProperty("Model", (value)) +} + +// GetModel gets the value of Model for the instance +func (instance *MSFT_Disk) GetPropertyModel() (value string, err error) { + retValue, err := instance.GetProperty("Model") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetNumber sets the value of Number for the instance +func (instance *MSFT_Disk) SetPropertyNumber(value uint32) (err error) { + return instance.SetProperty("Number", (value)) +} + +// GetNumber gets the value of Number for the instance +func (instance *MSFT_Disk) GetPropertyNumber() (value uint32, err error) { + retValue, err := instance.GetProperty("Number") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetNumberOfPartitions sets the value of NumberOfPartitions for the instance +func (instance *MSFT_Disk) SetPropertyNumberOfPartitions(value uint32) (err error) { + return instance.SetProperty("NumberOfPartitions", (value)) +} + +// GetNumberOfPartitions gets the value of NumberOfPartitions for the instance +func (instance *MSFT_Disk) GetPropertyNumberOfPartitions() (value uint32, err error) { + retValue, err := instance.GetProperty("NumberOfPartitions") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetOfflineReason sets the value of OfflineReason for the instance +func (instance *MSFT_Disk) SetPropertyOfflineReason(value uint16) (err error) { + return instance.SetProperty("OfflineReason", (value)) +} + +// GetOfflineReason gets the value of OfflineReason for the instance +func (instance *MSFT_Disk) GetPropertyOfflineReason() (value uint16, err error) { + retValue, err := instance.GetProperty("OfflineReason") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_Disk) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_Disk) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetPartitionStyle sets the value of PartitionStyle for the instance +func (instance *MSFT_Disk) SetPropertyPartitionStyle(value uint16) (err error) { + return instance.SetProperty("PartitionStyle", (value)) +} + +// GetPartitionStyle gets the value of PartitionStyle for the instance +func (instance *MSFT_Disk) GetPropertyPartitionStyle() (value uint16, err error) { + retValue, err := instance.GetProperty("PartitionStyle") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetPath sets the value of Path for the instance +func (instance *MSFT_Disk) SetPropertyPath(value string) (err error) { + return instance.SetProperty("Path", (value)) +} + +// GetPath gets the value of Path for the instance +func (instance *MSFT_Disk) GetPropertyPath() (value string, err error) { + retValue, err := instance.GetProperty("Path") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPhysicalSectorSize sets the value of PhysicalSectorSize for the instance +func (instance *MSFT_Disk) SetPropertyPhysicalSectorSize(value uint32) (err error) { + return instance.SetProperty("PhysicalSectorSize", (value)) +} + +// GetPhysicalSectorSize gets the value of PhysicalSectorSize for the instance +func (instance *MSFT_Disk) GetPropertyPhysicalSectorSize() (value uint32, err error) { + retValue, err := instance.GetProperty("PhysicalSectorSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetProvisioningType sets the value of ProvisioningType for the instance +func (instance *MSFT_Disk) SetPropertyProvisioningType(value uint16) (err error) { + return instance.SetProperty("ProvisioningType", (value)) +} + +// GetProvisioningType gets the value of ProvisioningType for the instance +func (instance *MSFT_Disk) GetPropertyProvisioningType() (value uint16, err error) { + retValue, err := instance.GetProperty("ProvisioningType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSerialNumber sets the value of SerialNumber for the instance +func (instance *MSFT_Disk) SetPropertySerialNumber(value string) (err error) { + return instance.SetProperty("SerialNumber", (value)) +} + +// GetSerialNumber gets the value of SerialNumber for the instance +func (instance *MSFT_Disk) GetPropertySerialNumber() (value string, err error) { + retValue, err := instance.GetProperty("SerialNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSignature sets the value of Signature for the instance +func (instance *MSFT_Disk) SetPropertySignature(value uint32) (err error) { + return instance.SetProperty("Signature", (value)) +} + +// GetSignature gets the value of Signature for the instance +func (instance *MSFT_Disk) GetPropertySignature() (value uint32, err error) { + retValue, err := instance.GetProperty("Signature") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetSize sets the value of Size for the instance +func (instance *MSFT_Disk) SetPropertySize(value uint64) (err error) { + return instance.SetProperty("Size", (value)) +} + +// GetSize gets the value of Size for the instance +func (instance *MSFT_Disk) GetPropertySize() (value uint64, err error) { + retValue, err := instance.GetProperty("Size") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetUniqueIdFormat sets the value of UniqueIdFormat for the instance +func (instance *MSFT_Disk) SetPropertyUniqueIdFormat(value uint16) (err error) { + return instance.SetProperty("UniqueIdFormat", (value)) +} + +// GetUniqueIdFormat gets the value of UniqueIdFormat for the instance +func (instance *MSFT_Disk) GetPropertyUniqueIdFormat() (value uint16, err error) { + retValue, err := instance.GetProperty("UniqueIdFormat") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// + +// +// +// +// +// +// +// +// +// +// + +// +// +// +func (instance *MSFT_Disk) CreatePartition( /* IN */ Size uint64, + /* IN */ UseMaximumSize bool, + /* IN */ Offset uint64, + /* IN */ Alignment uint32, + /* IN */ DriveLetter byte, + /* IN */ AssignDriveLetter bool, + /* IN */ MbrType uint16, + /* IN */ GptType string, + /* IN */ IsHidden bool, + /* IN */ IsActive bool, + /* OUT */ CreatedPartition MSFT_Partition, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreatePartition", Size, UseMaximumSize, Offset, Alignment, DriveLetter, AssignDriveLetter, MbrType, GptType, IsHidden, IsActive) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_Disk) Initialize( /* IN */ PartitionStyle uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Initialize", PartitionStyle) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// + +// +// +// +func (instance *MSFT_Disk) Clear( /* IN */ RemoveData bool, + /* IN */ RemoveOEM bool, + /* IN */ ZeroOutEntireDisk bool, + /* IN */ Sanitize bool, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Clear", RemoveData, RemoveOEM, ZeroOutEntireDisk, Sanitize, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_Disk) ConvertStyle( /* IN */ PartitionStyle uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("ConvertStyle", PartitionStyle) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_Disk) Offline( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Offline") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_Disk) Online( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Online") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// + +// +// +func (instance *MSFT_Disk) SetAttributes( /* IN */ IsReadOnly bool, + /* IN */ Signature uint32, + /* IN */ Guid string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetAttributes", IsReadOnly, Signature, Guid) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_Disk) Refresh( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Refresh") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// + +// +// +// +// +func (instance *MSFT_Disk) CreateVolume( /* IN */ FriendlyName string, + /* IN */ FileSystem uint16, + /* IN */ AccessPath string, + /* IN */ AllocationUnitSize uint32, + /* OUT */ CreatedVolume MSFT_Volume, + /* OPTIONAL IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateVolume", FriendlyName, FileSystem, AccessPath, AllocationUnitSize, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_Disk) EnableHighAvailability( /* IN */ ScaleOut bool, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("EnableHighAvailability", ScaleOut, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_Disk) DisableHighAvailability( /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("DisableHighAvailability", RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskImage.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskImage.go new file mode 100644 index 000000000..806211e9c --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskImage.go @@ -0,0 +1,356 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_DiskImage struct +type MSFT_DiskImage struct { + *cim.WmiInstance + + // + Attached bool + + // + BlockSize uint64 + + // + DevicePath string + + // + FileSize uint64 + + // + ImagePath string + + // + LogicalSectorSize uint64 + + // + Number uint32 + + // + Size uint64 + + // + StorageType uint32 +} + +func NewMSFT_DiskImageEx1(instance *cim.WmiInstance) (newInstance *MSFT_DiskImage, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_DiskImage{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_DiskImageEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_DiskImage, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_DiskImage{ + WmiInstance: tmp, + } + return +} + +// SetAttached sets the value of Attached for the instance +func (instance *MSFT_DiskImage) SetPropertyAttached(value bool) (err error) { + return instance.SetProperty("Attached", (value)) +} + +// GetAttached gets the value of Attached for the instance +func (instance *MSFT_DiskImage) GetPropertyAttached() (value bool, err error) { + retValue, err := instance.GetProperty("Attached") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetBlockSize sets the value of BlockSize for the instance +func (instance *MSFT_DiskImage) SetPropertyBlockSize(value uint64) (err error) { + return instance.SetProperty("BlockSize", (value)) +} + +// GetBlockSize gets the value of BlockSize for the instance +func (instance *MSFT_DiskImage) GetPropertyBlockSize() (value uint64, err error) { + retValue, err := instance.GetProperty("BlockSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetDevicePath sets the value of DevicePath for the instance +func (instance *MSFT_DiskImage) SetPropertyDevicePath(value string) (err error) { + return instance.SetProperty("DevicePath", (value)) +} + +// GetDevicePath gets the value of DevicePath for the instance +func (instance *MSFT_DiskImage) GetPropertyDevicePath() (value string, err error) { + retValue, err := instance.GetProperty("DevicePath") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFileSize sets the value of FileSize for the instance +func (instance *MSFT_DiskImage) SetPropertyFileSize(value uint64) (err error) { + return instance.SetProperty("FileSize", (value)) +} + +// GetFileSize gets the value of FileSize for the instance +func (instance *MSFT_DiskImage) GetPropertyFileSize() (value uint64, err error) { + retValue, err := instance.GetProperty("FileSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetImagePath sets the value of ImagePath for the instance +func (instance *MSFT_DiskImage) SetPropertyImagePath(value string) (err error) { + return instance.SetProperty("ImagePath", (value)) +} + +// GetImagePath gets the value of ImagePath for the instance +func (instance *MSFT_DiskImage) GetPropertyImagePath() (value string, err error) { + retValue, err := instance.GetProperty("ImagePath") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetLogicalSectorSize sets the value of LogicalSectorSize for the instance +func (instance *MSFT_DiskImage) SetPropertyLogicalSectorSize(value uint64) (err error) { + return instance.SetProperty("LogicalSectorSize", (value)) +} + +// GetLogicalSectorSize gets the value of LogicalSectorSize for the instance +func (instance *MSFT_DiskImage) GetPropertyLogicalSectorSize() (value uint64, err error) { + retValue, err := instance.GetProperty("LogicalSectorSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetNumber sets the value of Number for the instance +func (instance *MSFT_DiskImage) SetPropertyNumber(value uint32) (err error) { + return instance.SetProperty("Number", (value)) +} + +// GetNumber gets the value of Number for the instance +func (instance *MSFT_DiskImage) GetPropertyNumber() (value uint32, err error) { + retValue, err := instance.GetProperty("Number") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetSize sets the value of Size for the instance +func (instance *MSFT_DiskImage) SetPropertySize(value uint64) (err error) { + return instance.SetProperty("Size", (value)) +} + +// GetSize gets the value of Size for the instance +func (instance *MSFT_DiskImage) GetPropertySize() (value uint64, err error) { + retValue, err := instance.GetProperty("Size") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetStorageType sets the value of StorageType for the instance +func (instance *MSFT_DiskImage) SetPropertyStorageType(value uint32) (err error) { + return instance.SetProperty("StorageType", (value)) +} + +// GetStorageType gets the value of StorageType for the instance +func (instance *MSFT_DiskImage) GetPropertyStorageType() (value uint32, err error) { + retValue, err := instance.GetProperty("StorageType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// + +// +// + +// +// +func (instance *MSFT_DiskImage) Mount( /* IN */ Access uint16, + /* IN */ NoDriveLetter bool, + /* OUT */ DiskImage MSFT_DiskImage) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Mount", Access, NoDriveLetter) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_DiskImage) Dismount( /* OUT */ DiskImage MSFT_DiskImage) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Dismount") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskImageToVolume.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskImageToVolume.go new file mode 100644 index 000000000..4bb32563f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskImageToVolume.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_DiskImageToVolume struct +type MSFT_DiskImageToVolume struct { + *cim.WmiInstance + + // + DiskImage MSFT_DiskImage + + // + Volume MSFT_Volume +} + +func NewMSFT_DiskImageToVolumeEx1(instance *cim.WmiInstance) (newInstance *MSFT_DiskImageToVolume, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_DiskImageToVolume{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_DiskImageToVolumeEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_DiskImageToVolume, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_DiskImageToVolume{ + WmiInstance: tmp, + } + return +} + +// SetDiskImage sets the value of DiskImage for the instance +func (instance *MSFT_DiskImageToVolume) SetPropertyDiskImage(value MSFT_DiskImage) (err error) { + return instance.SetProperty("DiskImage", (value)) +} + +// GetDiskImage gets the value of DiskImage for the instance +func (instance *MSFT_DiskImageToVolume) GetPropertyDiskImage() (value MSFT_DiskImage, err error) { + retValue, err := instance.GetProperty("DiskImage") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_DiskImage) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_DiskImage is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_DiskImage(valuetmp) + + return +} + +// SetVolume sets the value of Volume for the instance +func (instance *MSFT_DiskImageToVolume) SetPropertyVolume(value MSFT_Volume) (err error) { + return instance.SetProperty("Volume", (value)) +} + +// GetVolume gets the value of Volume for the instance +func (instance *MSFT_DiskImageToVolume) GetPropertyVolume() (value MSFT_Volume, err error) { + retValue, err := instance.GetProperty("Volume") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Volume) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Volume is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Volume(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskToPartition.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskToPartition.go new file mode 100644 index 000000000..b6d31c2a7 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskToPartition.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_DiskToPartition struct +type MSFT_DiskToPartition struct { + *cim.WmiInstance + + // + Disk MSFT_Disk + + // + Partition MSFT_Partition +} + +func NewMSFT_DiskToPartitionEx1(instance *cim.WmiInstance) (newInstance *MSFT_DiskToPartition, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_DiskToPartition{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_DiskToPartitionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_DiskToPartition, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_DiskToPartition{ + WmiInstance: tmp, + } + return +} + +// SetDisk sets the value of Disk for the instance +func (instance *MSFT_DiskToPartition) SetPropertyDisk(value MSFT_Disk) (err error) { + return instance.SetProperty("Disk", (value)) +} + +// GetDisk gets the value of Disk for the instance +func (instance *MSFT_DiskToPartition) GetPropertyDisk() (value MSFT_Disk, err error) { + retValue, err := instance.GetProperty("Disk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Disk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Disk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Disk(valuetmp) + + return +} + +// SetPartition sets the value of Partition for the instance +func (instance *MSFT_DiskToPartition) SetPropertyPartition(value MSFT_Partition) (err error) { + return instance.SetProperty("Partition", (value)) +} + +// GetPartition gets the value of Partition for the instance +func (instance *MSFT_DiskToPartition) GetPropertyPartition() (value MSFT_Partition, err error) { + retValue, err := instance.GetProperty("Partition") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Partition) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Partition is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Partition(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskToStorageReliabilityCounter.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskToStorageReliabilityCounter.go new file mode 100644 index 000000000..e66fe870f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_DiskToStorageReliabilityCounter.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_DiskToStorageReliabilityCounter struct +type MSFT_DiskToStorageReliabilityCounter struct { + *cim.WmiInstance + + // + Disk MSFT_Disk + + // + StorageReliabilityCounter MSFT_StorageReliabilityCounter +} + +func NewMSFT_DiskToStorageReliabilityCounterEx1(instance *cim.WmiInstance) (newInstance *MSFT_DiskToStorageReliabilityCounter, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_DiskToStorageReliabilityCounter{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_DiskToStorageReliabilityCounterEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_DiskToStorageReliabilityCounter, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_DiskToStorageReliabilityCounter{ + WmiInstance: tmp, + } + return +} + +// SetDisk sets the value of Disk for the instance +func (instance *MSFT_DiskToStorageReliabilityCounter) SetPropertyDisk(value MSFT_Disk) (err error) { + return instance.SetProperty("Disk", (value)) +} + +// GetDisk gets the value of Disk for the instance +func (instance *MSFT_DiskToStorageReliabilityCounter) GetPropertyDisk() (value MSFT_Disk, err error) { + retValue, err := instance.GetProperty("Disk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Disk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Disk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Disk(valuetmp) + + return +} + +// SetStorageReliabilityCounter sets the value of StorageReliabilityCounter for the instance +func (instance *MSFT_DiskToStorageReliabilityCounter) SetPropertyStorageReliabilityCounter(value MSFT_StorageReliabilityCounter) (err error) { + return instance.SetProperty("StorageReliabilityCounter", (value)) +} + +// GetStorageReliabilityCounter gets the value of StorageReliabilityCounter for the instance +func (instance *MSFT_DiskToStorageReliabilityCounter) GetPropertyStorageReliabilityCounter() (value MSFT_StorageReliabilityCounter, err error) { + retValue, err := instance.GetProperty("StorageReliabilityCounter") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageReliabilityCounter) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageReliabilityCounter is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageReliabilityCounter(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ExtendedStatus.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ExtendedStatus.go new file mode 100644 index 000000000..b030a50d7 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ExtendedStatus.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_ExtendedStatus struct +type MSFT_ExtendedStatus struct { + *CIM_Error +} + +func NewMSFT_ExtendedStatusEx1(instance *cim.WmiInstance) (newInstance *MSFT_ExtendedStatus, err error) { + tmp, err := NewCIM_ErrorEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_ExtendedStatus{ + CIM_Error: tmp, + } + return +} + +func NewMSFT_ExtendedStatusEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_ExtendedStatus, err error) { + tmp, err := NewCIM_ErrorEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_ExtendedStatus{ + CIM_Error: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileIntegrity.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileIntegrity.go new file mode 100644 index 000000000..25805e4b4 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileIntegrity.go @@ -0,0 +1,201 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_FileIntegrity struct +type MSFT_FileIntegrity struct { + *cim.WmiInstance + + // + Enabled bool + + // + Enforced bool + + // + FileName string +} + +func NewMSFT_FileIntegrityEx1(instance *cim.WmiInstance) (newInstance *MSFT_FileIntegrity, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_FileIntegrity{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_FileIntegrityEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_FileIntegrity, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_FileIntegrity{ + WmiInstance: tmp, + } + return +} + +// SetEnabled sets the value of Enabled for the instance +func (instance *MSFT_FileIntegrity) SetPropertyEnabled(value bool) (err error) { + return instance.SetProperty("Enabled", (value)) +} + +// GetEnabled gets the value of Enabled for the instance +func (instance *MSFT_FileIntegrity) GetPropertyEnabled() (value bool, err error) { + retValue, err := instance.GetProperty("Enabled") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetEnforced sets the value of Enforced for the instance +func (instance *MSFT_FileIntegrity) SetPropertyEnforced(value bool) (err error) { + return instance.SetProperty("Enforced", (value)) +} + +// GetEnforced gets the value of Enforced for the instance +func (instance *MSFT_FileIntegrity) GetPropertyEnforced() (value bool, err error) { + retValue, err := instance.GetProperty("Enforced") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetFileName sets the value of FileName for the instance +func (instance *MSFT_FileIntegrity) SetPropertyFileName(value string) (err error) { + return instance.SetProperty("FileName", (value)) +} + +// GetFileName gets the value of FileName for the instance +func (instance *MSFT_FileIntegrity) GetPropertyFileName() (value string, err error) { + retValue, err := instance.GetProperty("FileName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// + +// + +// +// +// +func (instance *MSFT_FileIntegrity) Get( /* IN */ FileName string, + /* OUT */ FileIntegrity MSFT_FileIntegrity, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Get", FileName) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_FileIntegrity) Repair( /* IN */ FileName string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Repair", FileName) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// + +// +// +func (instance *MSFT_FileIntegrity) Set( /* IN */ FileName string, + /* IN */ Enable bool, + /* IN */ Enforce bool, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Set", FileName, Enable, Enforce) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileServer.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileServer.go new file mode 100644 index 000000000..73073561c --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileServer.go @@ -0,0 +1,398 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_FileServer struct +type MSFT_FileServer struct { + *MSFT_StorageObject + + // + FileSharingProtocols []uint16 + + // + FileSharingProtocolVersions []string + + // + FriendlyName string + + // + HealthStatus uint16 + + // + HostNames []string + + // + OperationalStatus []uint16 + + // + OtherOperationalStatusDescription string + + // + SupportsContinuouslyAvailableFileShare bool + + // + SupportsFileShareCreation bool +} + +func NewMSFT_FileServerEx1(instance *cim.WmiInstance) (newInstance *MSFT_FileServer, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_FileServer{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_FileServerEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_FileServer, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_FileServer{ + MSFT_StorageObject: tmp, + } + return +} + +// SetFileSharingProtocols sets the value of FileSharingProtocols for the instance +func (instance *MSFT_FileServer) SetPropertyFileSharingProtocols(value []uint16) (err error) { + return instance.SetProperty("FileSharingProtocols", (value)) +} + +// GetFileSharingProtocols gets the value of FileSharingProtocols for the instance +func (instance *MSFT_FileServer) GetPropertyFileSharingProtocols() (value []uint16, err error) { + retValue, err := instance.GetProperty("FileSharingProtocols") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetFileSharingProtocolVersions sets the value of FileSharingProtocolVersions for the instance +func (instance *MSFT_FileServer) SetPropertyFileSharingProtocolVersions(value []string) (err error) { + return instance.SetProperty("FileSharingProtocolVersions", (value)) +} + +// GetFileSharingProtocolVersions gets the value of FileSharingProtocolVersions for the instance +func (instance *MSFT_FileServer) GetPropertyFileSharingProtocolVersions() (value []string, err error) { + retValue, err := instance.GetProperty("FileSharingProtocolVersions") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetFriendlyName sets the value of FriendlyName for the instance +func (instance *MSFT_FileServer) SetPropertyFriendlyName(value string) (err error) { + return instance.SetProperty("FriendlyName", (value)) +} + +// GetFriendlyName gets the value of FriendlyName for the instance +func (instance *MSFT_FileServer) GetPropertyFriendlyName() (value string, err error) { + retValue, err := instance.GetProperty("FriendlyName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetHealthStatus sets the value of HealthStatus for the instance +func (instance *MSFT_FileServer) SetPropertyHealthStatus(value uint16) (err error) { + return instance.SetProperty("HealthStatus", (value)) +} + +// GetHealthStatus gets the value of HealthStatus for the instance +func (instance *MSFT_FileServer) GetPropertyHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("HealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetHostNames sets the value of HostNames for the instance +func (instance *MSFT_FileServer) SetPropertyHostNames(value []string) (err error) { + return instance.SetProperty("HostNames", (value)) +} + +// GetHostNames gets the value of HostNames for the instance +func (instance *MSFT_FileServer) GetPropertyHostNames() (value []string, err error) { + retValue, err := instance.GetProperty("HostNames") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_FileServer) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_FileServer) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetOtherOperationalStatusDescription sets the value of OtherOperationalStatusDescription for the instance +func (instance *MSFT_FileServer) SetPropertyOtherOperationalStatusDescription(value string) (err error) { + return instance.SetProperty("OtherOperationalStatusDescription", (value)) +} + +// GetOtherOperationalStatusDescription gets the value of OtherOperationalStatusDescription for the instance +func (instance *MSFT_FileServer) GetPropertyOtherOperationalStatusDescription() (value string, err error) { + retValue, err := instance.GetProperty("OtherOperationalStatusDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSupportsContinuouslyAvailableFileShare sets the value of SupportsContinuouslyAvailableFileShare for the instance +func (instance *MSFT_FileServer) SetPropertySupportsContinuouslyAvailableFileShare(value bool) (err error) { + return instance.SetProperty("SupportsContinuouslyAvailableFileShare", (value)) +} + +// GetSupportsContinuouslyAvailableFileShare gets the value of SupportsContinuouslyAvailableFileShare for the instance +func (instance *MSFT_FileServer) GetPropertySupportsContinuouslyAvailableFileShare() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsContinuouslyAvailableFileShare") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsFileShareCreation sets the value of SupportsFileShareCreation for the instance +func (instance *MSFT_FileServer) SetPropertySupportsFileShareCreation(value bool) (err error) { + return instance.SetProperty("SupportsFileShareCreation", (value)) +} + +// GetSupportsFileShareCreation gets the value of SupportsFileShareCreation for the instance +func (instance *MSFT_FileServer) GetPropertySupportsFileShareCreation() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsFileShareCreation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// + +// +// +// +// +// +// +// +// + +// +// +// +// +func (instance *MSFT_FileServer) CreateFileShare( /* IN */ Name string, + /* IN */ Description string, + /* IN */ SourceVolume MSFT_Volume, + /* IN */ VolumeRelativePath string, + /* IN */ ContinuouslyAvailable bool, + /* IN */ EncryptData bool, + /* IN */ FileSharingProtocol uint16, + /* IN */ RunAsJob bool, + /* OUT */ CreatedFileShare MSFT_FileShare, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateFileShare", Name, Description, SourceVolume, VolumeRelativePath, ContinuouslyAvailable, EncryptData, FileSharingProtocol, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_FileServer) DeleteObject( /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("DeleteObject", RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_FileServer) SetFriendlyName( /* IN */ FriendlyName string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetFriendlyName", FriendlyName) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileServerToFileShare.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileServerToFileShare.go new file mode 100644 index 000000000..635b20a33 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileServerToFileShare.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_FileServerToFileShare struct +type MSFT_FileServerToFileShare struct { + *cim.WmiInstance + + // + FileServer MSFT_FileServer + + // + FileShare MSFT_FileShare +} + +func NewMSFT_FileServerToFileShareEx1(instance *cim.WmiInstance) (newInstance *MSFT_FileServerToFileShare, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_FileServerToFileShare{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_FileServerToFileShareEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_FileServerToFileShare, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_FileServerToFileShare{ + WmiInstance: tmp, + } + return +} + +// SetFileServer sets the value of FileServer for the instance +func (instance *MSFT_FileServerToFileShare) SetPropertyFileServer(value MSFT_FileServer) (err error) { + return instance.SetProperty("FileServer", (value)) +} + +// GetFileServer gets the value of FileServer for the instance +func (instance *MSFT_FileServerToFileShare) GetPropertyFileServer() (value MSFT_FileServer, err error) { + retValue, err := instance.GetProperty("FileServer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_FileServer) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_FileServer is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_FileServer(valuetmp) + + return +} + +// SetFileShare sets the value of FileShare for the instance +func (instance *MSFT_FileServerToFileShare) SetPropertyFileShare(value MSFT_FileShare) (err error) { + return instance.SetProperty("FileShare", (value)) +} + +// GetFileShare gets the value of FileShare for the instance +func (instance *MSFT_FileServerToFileShare) GetPropertyFileShare() (value MSFT_FileShare, err error) { + retValue, err := instance.GetProperty("FileShare") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_FileShare) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_FileShare is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_FileShare(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileServerToVolume.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileServerToVolume.go new file mode 100644 index 000000000..a8b18a42f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileServerToVolume.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_FileServerToVolume struct +type MSFT_FileServerToVolume struct { + *cim.WmiInstance + + // + FileServer MSFT_FileServer + + // + Volume MSFT_Volume +} + +func NewMSFT_FileServerToVolumeEx1(instance *cim.WmiInstance) (newInstance *MSFT_FileServerToVolume, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_FileServerToVolume{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_FileServerToVolumeEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_FileServerToVolume, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_FileServerToVolume{ + WmiInstance: tmp, + } + return +} + +// SetFileServer sets the value of FileServer for the instance +func (instance *MSFT_FileServerToVolume) SetPropertyFileServer(value MSFT_FileServer) (err error) { + return instance.SetProperty("FileServer", (value)) +} + +// GetFileServer gets the value of FileServer for the instance +func (instance *MSFT_FileServerToVolume) GetPropertyFileServer() (value MSFT_FileServer, err error) { + retValue, err := instance.GetProperty("FileServer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_FileServer) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_FileServer is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_FileServer(valuetmp) + + return +} + +// SetVolume sets the value of Volume for the instance +func (instance *MSFT_FileServerToVolume) SetPropertyVolume(value MSFT_Volume) (err error) { + return instance.SetProperty("Volume", (value)) +} + +// GetVolume gets the value of Volume for the instance +func (instance *MSFT_FileServerToVolume) GetPropertyVolume() (value MSFT_Volume, err error) { + retValue, err := instance.GetProperty("Volume") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Volume) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Volume is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Volume(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileShare.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileShare.go new file mode 100644 index 000000000..1d0716304 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileShare.go @@ -0,0 +1,502 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_FileShare struct +type MSFT_FileShare struct { + *MSFT_StorageObject + + // + ContinuouslyAvailable bool + + // + Description string + + // + EncryptData bool + + // + FileSharingProtocol uint16 + + // + HealthStatus uint16 + + // + Name string + + // + OperationalStatus []uint16 + + // + ShareState uint16 + + // + VolumeRelativePath string +} + +func NewMSFT_FileShareEx1(instance *cim.WmiInstance) (newInstance *MSFT_FileShare, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_FileShare{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_FileShareEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_FileShare, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_FileShare{ + MSFT_StorageObject: tmp, + } + return +} + +// SetContinuouslyAvailable sets the value of ContinuouslyAvailable for the instance +func (instance *MSFT_FileShare) SetPropertyContinuouslyAvailable(value bool) (err error) { + return instance.SetProperty("ContinuouslyAvailable", (value)) +} + +// GetContinuouslyAvailable gets the value of ContinuouslyAvailable for the instance +func (instance *MSFT_FileShare) GetPropertyContinuouslyAvailable() (value bool, err error) { + retValue, err := instance.GetProperty("ContinuouslyAvailable") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetDescription sets the value of Description for the instance +func (instance *MSFT_FileShare) SetPropertyDescription(value string) (err error) { + return instance.SetProperty("Description", (value)) +} + +// GetDescription gets the value of Description for the instance +func (instance *MSFT_FileShare) GetPropertyDescription() (value string, err error) { + retValue, err := instance.GetProperty("Description") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetEncryptData sets the value of EncryptData for the instance +func (instance *MSFT_FileShare) SetPropertyEncryptData(value bool) (err error) { + return instance.SetProperty("EncryptData", (value)) +} + +// GetEncryptData gets the value of EncryptData for the instance +func (instance *MSFT_FileShare) GetPropertyEncryptData() (value bool, err error) { + retValue, err := instance.GetProperty("EncryptData") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetFileSharingProtocol sets the value of FileSharingProtocol for the instance +func (instance *MSFT_FileShare) SetPropertyFileSharingProtocol(value uint16) (err error) { + return instance.SetProperty("FileSharingProtocol", (value)) +} + +// GetFileSharingProtocol gets the value of FileSharingProtocol for the instance +func (instance *MSFT_FileShare) GetPropertyFileSharingProtocol() (value uint16, err error) { + retValue, err := instance.GetProperty("FileSharingProtocol") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetHealthStatus sets the value of HealthStatus for the instance +func (instance *MSFT_FileShare) SetPropertyHealthStatus(value uint16) (err error) { + return instance.SetProperty("HealthStatus", (value)) +} + +// GetHealthStatus gets the value of HealthStatus for the instance +func (instance *MSFT_FileShare) GetPropertyHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("HealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetName sets the value of Name for the instance +func (instance *MSFT_FileShare) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *MSFT_FileShare) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_FileShare) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_FileShare) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetShareState sets the value of ShareState for the instance +func (instance *MSFT_FileShare) SetPropertyShareState(value uint16) (err error) { + return instance.SetProperty("ShareState", (value)) +} + +// GetShareState gets the value of ShareState for the instance +func (instance *MSFT_FileShare) GetPropertyShareState() (value uint16, err error) { + retValue, err := instance.GetProperty("ShareState") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetVolumeRelativePath sets the value of VolumeRelativePath for the instance +func (instance *MSFT_FileShare) SetPropertyVolumeRelativePath(value string) (err error) { + return instance.SetProperty("VolumeRelativePath", (value)) +} + +// GetVolumeRelativePath gets the value of VolumeRelativePath for the instance +func (instance *MSFT_FileShare) GetPropertyVolumeRelativePath() (value string, err error) { + retValue, err := instance.GetProperty("VolumeRelativePath") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// + +// + +// +// +// +func (instance *MSFT_FileShare) DeleteObject( /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("DeleteObject", RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_FileShare) SetDescription( /* IN */ Description string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetDescription", Description) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_FileShare) SetAttributes( /* IN */ EncryptData bool, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetAttributes", EncryptData) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_FileShare) GetAccessControlEntries( /* OUT */ AccessControlEntries []MSFT_FileShareAccessControlEntry, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetAccessControlEntries") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +func (instance *MSFT_FileShare) GrantAccess( /* IN */ AccountNames []string, + /* IN */ AccessRight uint32, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GrantAccess", AccountNames, AccessRight) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_FileShare) RevokeAccess( /* IN */ AccountNames []string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RevokeAccess", AccountNames) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_FileShare) BlockAccess( /* IN */ AccountNames []string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("BlockAccess", AccountNames) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_FileShare) UnblockAccess( /* IN */ AccountNames []string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("UnblockAccess", AccountNames) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_FileShare) Diagnose( /* OUT */ DiagnoseResults []MSFT_StorageDiagnoseResult, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Diagnose") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_FileShare) GetActions( /* OUT */ ActionResults []MSFT_HealthAction, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetActions") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileShareAccessControlEntry.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileShareAccessControlEntry.go new file mode 100644 index 000000000..3c7fd3058 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileShareAccessControlEntry.go @@ -0,0 +1,141 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_FileShareAccessControlEntry struct +type MSFT_FileShareAccessControlEntry struct { + *cim.WmiInstance + + // + AccessControlType uint16 + + // + AccessRight uint16 + + // + AccountName string +} + +func NewMSFT_FileShareAccessControlEntryEx1(instance *cim.WmiInstance) (newInstance *MSFT_FileShareAccessControlEntry, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_FileShareAccessControlEntry{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_FileShareAccessControlEntryEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_FileShareAccessControlEntry, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_FileShareAccessControlEntry{ + WmiInstance: tmp, + } + return +} + +// SetAccessControlType sets the value of AccessControlType for the instance +func (instance *MSFT_FileShareAccessControlEntry) SetPropertyAccessControlType(value uint16) (err error) { + return instance.SetProperty("AccessControlType", (value)) +} + +// GetAccessControlType gets the value of AccessControlType for the instance +func (instance *MSFT_FileShareAccessControlEntry) GetPropertyAccessControlType() (value uint16, err error) { + retValue, err := instance.GetProperty("AccessControlType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetAccessRight sets the value of AccessRight for the instance +func (instance *MSFT_FileShareAccessControlEntry) SetPropertyAccessRight(value uint16) (err error) { + return instance.SetProperty("AccessRight", (value)) +} + +// GetAccessRight gets the value of AccessRight for the instance +func (instance *MSFT_FileShareAccessControlEntry) GetPropertyAccessRight() (value uint16, err error) { + retValue, err := instance.GetProperty("AccessRight") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetAccountName sets the value of AccountName for the instance +func (instance *MSFT_FileShareAccessControlEntry) SetPropertyAccountName(value string) (err error) { + return instance.SetProperty("AccountName", (value)) +} + +// GetAccountName gets the value of AccountName for the instance +func (instance *MSFT_FileShareAccessControlEntry) GetPropertyAccountName() (value string, err error) { + retValue, err := instance.GetProperty("AccountName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileStorageTier.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileStorageTier.go new file mode 100644 index 000000000..7c18ffe0b --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_FileStorageTier.go @@ -0,0 +1,353 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_FileStorageTier struct +type MSFT_FileStorageTier struct { + *cim.WmiInstance + + // + DesiredStorageTierClass uint16 + + // + DesiredStorageTierName string + + // + FilePath string + + // + FileSize uint64 + + // + FileSizeOnDesiredStorageTier uint64 + + // + FileSizeOnDesiredStorageTierClass uint64 + + // + PlacementStatus uint16 + + // + State uint16 +} + +func NewMSFT_FileStorageTierEx1(instance *cim.WmiInstance) (newInstance *MSFT_FileStorageTier, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_FileStorageTier{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_FileStorageTierEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_FileStorageTier, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_FileStorageTier{ + WmiInstance: tmp, + } + return +} + +// SetDesiredStorageTierClass sets the value of DesiredStorageTierClass for the instance +func (instance *MSFT_FileStorageTier) SetPropertyDesiredStorageTierClass(value uint16) (err error) { + return instance.SetProperty("DesiredStorageTierClass", (value)) +} + +// GetDesiredStorageTierClass gets the value of DesiredStorageTierClass for the instance +func (instance *MSFT_FileStorageTier) GetPropertyDesiredStorageTierClass() (value uint16, err error) { + retValue, err := instance.GetProperty("DesiredStorageTierClass") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetDesiredStorageTierName sets the value of DesiredStorageTierName for the instance +func (instance *MSFT_FileStorageTier) SetPropertyDesiredStorageTierName(value string) (err error) { + return instance.SetProperty("DesiredStorageTierName", (value)) +} + +// GetDesiredStorageTierName gets the value of DesiredStorageTierName for the instance +func (instance *MSFT_FileStorageTier) GetPropertyDesiredStorageTierName() (value string, err error) { + retValue, err := instance.GetProperty("DesiredStorageTierName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFilePath sets the value of FilePath for the instance +func (instance *MSFT_FileStorageTier) SetPropertyFilePath(value string) (err error) { + return instance.SetProperty("FilePath", (value)) +} + +// GetFilePath gets the value of FilePath for the instance +func (instance *MSFT_FileStorageTier) GetPropertyFilePath() (value string, err error) { + retValue, err := instance.GetProperty("FilePath") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFileSize sets the value of FileSize for the instance +func (instance *MSFT_FileStorageTier) SetPropertyFileSize(value uint64) (err error) { + return instance.SetProperty("FileSize", (value)) +} + +// GetFileSize gets the value of FileSize for the instance +func (instance *MSFT_FileStorageTier) GetPropertyFileSize() (value uint64, err error) { + retValue, err := instance.GetProperty("FileSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetFileSizeOnDesiredStorageTier sets the value of FileSizeOnDesiredStorageTier for the instance +func (instance *MSFT_FileStorageTier) SetPropertyFileSizeOnDesiredStorageTier(value uint64) (err error) { + return instance.SetProperty("FileSizeOnDesiredStorageTier", (value)) +} + +// GetFileSizeOnDesiredStorageTier gets the value of FileSizeOnDesiredStorageTier for the instance +func (instance *MSFT_FileStorageTier) GetPropertyFileSizeOnDesiredStorageTier() (value uint64, err error) { + retValue, err := instance.GetProperty("FileSizeOnDesiredStorageTier") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetFileSizeOnDesiredStorageTierClass sets the value of FileSizeOnDesiredStorageTierClass for the instance +func (instance *MSFT_FileStorageTier) SetPropertyFileSizeOnDesiredStorageTierClass(value uint64) (err error) { + return instance.SetProperty("FileSizeOnDesiredStorageTierClass", (value)) +} + +// GetFileSizeOnDesiredStorageTierClass gets the value of FileSizeOnDesiredStorageTierClass for the instance +func (instance *MSFT_FileStorageTier) GetPropertyFileSizeOnDesiredStorageTierClass() (value uint64, err error) { + retValue, err := instance.GetProperty("FileSizeOnDesiredStorageTierClass") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetPlacementStatus sets the value of PlacementStatus for the instance +func (instance *MSFT_FileStorageTier) SetPropertyPlacementStatus(value uint16) (err error) { + return instance.SetProperty("PlacementStatus", (value)) +} + +// GetPlacementStatus gets the value of PlacementStatus for the instance +func (instance *MSFT_FileStorageTier) GetPropertyPlacementStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("PlacementStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetState sets the value of State for the instance +func (instance *MSFT_FileStorageTier) SetPropertyState(value uint16) (err error) { + return instance.SetProperty("State", (value)) +} + +// GetState gets the value of State for the instance +func (instance *MSFT_FileStorageTier) GetPropertyState() (value uint16, err error) { + retValue, err := instance.GetProperty("State") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// + +// +// +// +// + +// +// +func (instance *MSFT_FileStorageTier) Get( /* IN */ FilePath string, + /* IN */ VolumeDriveLetter byte, + /* IN */ VolumePath string, + /* IN */ Volume MSFT_Volume, + /* OUT */ FileStorageTier []MSFT_FileStorageTier) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Get", FilePath, VolumeDriveLetter, VolumePath, Volume) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// + +// +func (instance *MSFT_FileStorageTier) Set( /* IN */ FilePath string, + /* IN */ DesiredStorageTierFriendlyName string, + /* IN */ DesiredStorageTierUniqueId string, + /* IN */ DesiredStorageTierClass uint16, + /* IN */ DesiredStorageTier MSFT_StorageTier) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("Set", FilePath, DesiredStorageTierFriendlyName, DesiredStorageTierUniqueId, DesiredStorageTierClass, DesiredStorageTier) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// + +// +func (instance *MSFT_FileStorageTier) Clear( /* IN */ FilePath string) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("Clear", FilePath) + if err != nil { + return + } + result = uint32(retVal) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthAction.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthAction.go new file mode 100644 index 000000000..d589500e8 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthAction.go @@ -0,0 +1,441 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_HealthAction struct +type MSFT_HealthAction struct { + *MSFT_StorageObject + + // + Description string + + // + ErrorCode uint32 + + // + ErrorDescription string + + // + MessageParameters []string + + // + PercentComplete uint16 + + // + Reason string + + // + ReportingObjectId string + + // + ReportingObjectType string + + // + ReportingObjectUniqueId string + + // + StartTime string + + // + State uint16 + + // + Status string + + // + Type string +} + +func NewMSFT_HealthActionEx1(instance *cim.WmiInstance) (newInstance *MSFT_HealthAction, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_HealthAction{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_HealthActionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_HealthAction, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_HealthAction{ + MSFT_StorageObject: tmp, + } + return +} + +// SetDescription sets the value of Description for the instance +func (instance *MSFT_HealthAction) SetPropertyDescription(value string) (err error) { + return instance.SetProperty("Description", (value)) +} + +// GetDescription gets the value of Description for the instance +func (instance *MSFT_HealthAction) GetPropertyDescription() (value string, err error) { + retValue, err := instance.GetProperty("Description") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetErrorCode sets the value of ErrorCode for the instance +func (instance *MSFT_HealthAction) SetPropertyErrorCode(value uint32) (err error) { + return instance.SetProperty("ErrorCode", (value)) +} + +// GetErrorCode gets the value of ErrorCode for the instance +func (instance *MSFT_HealthAction) GetPropertyErrorCode() (value uint32, err error) { + retValue, err := instance.GetProperty("ErrorCode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetErrorDescription sets the value of ErrorDescription for the instance +func (instance *MSFT_HealthAction) SetPropertyErrorDescription(value string) (err error) { + return instance.SetProperty("ErrorDescription", (value)) +} + +// GetErrorDescription gets the value of ErrorDescription for the instance +func (instance *MSFT_HealthAction) GetPropertyErrorDescription() (value string, err error) { + retValue, err := instance.GetProperty("ErrorDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetMessageParameters sets the value of MessageParameters for the instance +func (instance *MSFT_HealthAction) SetPropertyMessageParameters(value []string) (err error) { + return instance.SetProperty("MessageParameters", (value)) +} + +// GetMessageParameters gets the value of MessageParameters for the instance +func (instance *MSFT_HealthAction) GetPropertyMessageParameters() (value []string, err error) { + retValue, err := instance.GetProperty("MessageParameters") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetPercentComplete sets the value of PercentComplete for the instance +func (instance *MSFT_HealthAction) SetPropertyPercentComplete(value uint16) (err error) { + return instance.SetProperty("PercentComplete", (value)) +} + +// GetPercentComplete gets the value of PercentComplete for the instance +func (instance *MSFT_HealthAction) GetPropertyPercentComplete() (value uint16, err error) { + retValue, err := instance.GetProperty("PercentComplete") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetReason sets the value of Reason for the instance +func (instance *MSFT_HealthAction) SetPropertyReason(value string) (err error) { + return instance.SetProperty("Reason", (value)) +} + +// GetReason gets the value of Reason for the instance +func (instance *MSFT_HealthAction) GetPropertyReason() (value string, err error) { + retValue, err := instance.GetProperty("Reason") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetReportingObjectId sets the value of ReportingObjectId for the instance +func (instance *MSFT_HealthAction) SetPropertyReportingObjectId(value string) (err error) { + return instance.SetProperty("ReportingObjectId", (value)) +} + +// GetReportingObjectId gets the value of ReportingObjectId for the instance +func (instance *MSFT_HealthAction) GetPropertyReportingObjectId() (value string, err error) { + retValue, err := instance.GetProperty("ReportingObjectId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetReportingObjectType sets the value of ReportingObjectType for the instance +func (instance *MSFT_HealthAction) SetPropertyReportingObjectType(value string) (err error) { + return instance.SetProperty("ReportingObjectType", (value)) +} + +// GetReportingObjectType gets the value of ReportingObjectType for the instance +func (instance *MSFT_HealthAction) GetPropertyReportingObjectType() (value string, err error) { + retValue, err := instance.GetProperty("ReportingObjectType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetReportingObjectUniqueId sets the value of ReportingObjectUniqueId for the instance +func (instance *MSFT_HealthAction) SetPropertyReportingObjectUniqueId(value string) (err error) { + return instance.SetProperty("ReportingObjectUniqueId", (value)) +} + +// GetReportingObjectUniqueId gets the value of ReportingObjectUniqueId for the instance +func (instance *MSFT_HealthAction) GetPropertyReportingObjectUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("ReportingObjectUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetStartTime sets the value of StartTime for the instance +func (instance *MSFT_HealthAction) SetPropertyStartTime(value string) (err error) { + return instance.SetProperty("StartTime", (value)) +} + +// GetStartTime gets the value of StartTime for the instance +func (instance *MSFT_HealthAction) GetPropertyStartTime() (value string, err error) { + retValue, err := instance.GetProperty("StartTime") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetState sets the value of State for the instance +func (instance *MSFT_HealthAction) SetPropertyState(value uint16) (err error) { + return instance.SetProperty("State", (value)) +} + +// GetState gets the value of State for the instance +func (instance *MSFT_HealthAction) GetPropertyState() (value uint16, err error) { + retValue, err := instance.GetProperty("State") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetStatus sets the value of Status for the instance +func (instance *MSFT_HealthAction) SetPropertyStatus(value string) (err error) { + return instance.SetProperty("Status", (value)) +} + +// GetStatus gets the value of Status for the instance +func (instance *MSFT_HealthAction) GetPropertyStatus() (value string, err error) { + retValue, err := instance.GetProperty("Status") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetType sets the value of Type for the instance +func (instance *MSFT_HealthAction) SetPropertyType(value string) (err error) { + return instance.SetProperty("Type", (value)) +} + +// GetType gets the value of Type for the instance +func (instance *MSFT_HealthAction) GetPropertyType() (value string, err error) { + retValue, err := instance.GetProperty("Type") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthActionEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthActionEvent.go new file mode 100644 index 000000000..48d5e9378 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthActionEvent.go @@ -0,0 +1,320 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_HealthActionEvent struct +type MSFT_HealthActionEvent struct { + *MSFT_StorageEvent + + // + ChangeType uint16 + + // + HealthActionId string + + // + HealthActionType string + + // + PercentComplete uint16 + + // + Reason string + + // + StartTime string + + // + State uint16 + + // + Status string + + // + StorageSubsystemUniqueId string +} + +func NewMSFT_HealthActionEventEx1(instance *cim.WmiInstance) (newInstance *MSFT_HealthActionEvent, err error) { + tmp, err := NewMSFT_StorageEventEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_HealthActionEvent{ + MSFT_StorageEvent: tmp, + } + return +} + +func NewMSFT_HealthActionEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_HealthActionEvent, err error) { + tmp, err := NewMSFT_StorageEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_HealthActionEvent{ + MSFT_StorageEvent: tmp, + } + return +} + +// SetChangeType sets the value of ChangeType for the instance +func (instance *MSFT_HealthActionEvent) SetPropertyChangeType(value uint16) (err error) { + return instance.SetProperty("ChangeType", (value)) +} + +// GetChangeType gets the value of ChangeType for the instance +func (instance *MSFT_HealthActionEvent) GetPropertyChangeType() (value uint16, err error) { + retValue, err := instance.GetProperty("ChangeType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetHealthActionId sets the value of HealthActionId for the instance +func (instance *MSFT_HealthActionEvent) SetPropertyHealthActionId(value string) (err error) { + return instance.SetProperty("HealthActionId", (value)) +} + +// GetHealthActionId gets the value of HealthActionId for the instance +func (instance *MSFT_HealthActionEvent) GetPropertyHealthActionId() (value string, err error) { + retValue, err := instance.GetProperty("HealthActionId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetHealthActionType sets the value of HealthActionType for the instance +func (instance *MSFT_HealthActionEvent) SetPropertyHealthActionType(value string) (err error) { + return instance.SetProperty("HealthActionType", (value)) +} + +// GetHealthActionType gets the value of HealthActionType for the instance +func (instance *MSFT_HealthActionEvent) GetPropertyHealthActionType() (value string, err error) { + retValue, err := instance.GetProperty("HealthActionType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPercentComplete sets the value of PercentComplete for the instance +func (instance *MSFT_HealthActionEvent) SetPropertyPercentComplete(value uint16) (err error) { + return instance.SetProperty("PercentComplete", (value)) +} + +// GetPercentComplete gets the value of PercentComplete for the instance +func (instance *MSFT_HealthActionEvent) GetPropertyPercentComplete() (value uint16, err error) { + retValue, err := instance.GetProperty("PercentComplete") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetReason sets the value of Reason for the instance +func (instance *MSFT_HealthActionEvent) SetPropertyReason(value string) (err error) { + return instance.SetProperty("Reason", (value)) +} + +// GetReason gets the value of Reason for the instance +func (instance *MSFT_HealthActionEvent) GetPropertyReason() (value string, err error) { + retValue, err := instance.GetProperty("Reason") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetStartTime sets the value of StartTime for the instance +func (instance *MSFT_HealthActionEvent) SetPropertyStartTime(value string) (err error) { + return instance.SetProperty("StartTime", (value)) +} + +// GetStartTime gets the value of StartTime for the instance +func (instance *MSFT_HealthActionEvent) GetPropertyStartTime() (value string, err error) { + retValue, err := instance.GetProperty("StartTime") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetState sets the value of State for the instance +func (instance *MSFT_HealthActionEvent) SetPropertyState(value uint16) (err error) { + return instance.SetProperty("State", (value)) +} + +// GetState gets the value of State for the instance +func (instance *MSFT_HealthActionEvent) GetPropertyState() (value uint16, err error) { + retValue, err := instance.GetProperty("State") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetStatus sets the value of Status for the instance +func (instance *MSFT_HealthActionEvent) SetPropertyStatus(value string) (err error) { + return instance.SetProperty("Status", (value)) +} + +// GetStatus gets the value of Status for the instance +func (instance *MSFT_HealthActionEvent) GetPropertyStatus() (value string, err error) { + retValue, err := instance.GetProperty("Status") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetStorageSubsystemUniqueId sets the value of StorageSubsystemUniqueId for the instance +func (instance *MSFT_HealthActionEvent) SetPropertyStorageSubsystemUniqueId(value string) (err error) { + return instance.SetProperty("StorageSubsystemUniqueId", (value)) +} + +// GetStorageSubsystemUniqueId gets the value of StorageSubsystemUniqueId for the instance +func (instance *MSFT_HealthActionEvent) GetPropertyStorageSubsystemUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("StorageSubsystemUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthRecord.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthRecord.go new file mode 100644 index 000000000..c40d1ae8c --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthRecord.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_HealthRecord struct +type MSFT_HealthRecord struct { + *cim.WmiInstance + + // + Name string + + // + Units uint16 +} + +func NewMSFT_HealthRecordEx1(instance *cim.WmiInstance) (newInstance *MSFT_HealthRecord, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_HealthRecord{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_HealthRecordEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_HealthRecord, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_HealthRecord{ + WmiInstance: tmp, + } + return +} + +// SetName sets the value of Name for the instance +func (instance *MSFT_HealthRecord) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *MSFT_HealthRecord) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetUnits sets the value of Units for the instance +func (instance *MSFT_HealthRecord) SetPropertyUnits(value uint16) (err error) { + return instance.SetProperty("Units", (value)) +} + +// GetUnits gets the value of Units for the instance +func (instance *MSFT_HealthRecord) GetPropertyUnits() (value uint16, err error) { + retValue, err := instance.GetProperty("Units") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthRecordReal64.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthRecordReal64.go new file mode 100644 index 000000000..697c04814 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthRecordReal64.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_HealthRecordReal64 struct +type MSFT_HealthRecordReal64 struct { + *MSFT_HealthRecord + + // + Value float64 +} + +func NewMSFT_HealthRecordReal64Ex1(instance *cim.WmiInstance) (newInstance *MSFT_HealthRecordReal64, err error) { + tmp, err := NewMSFT_HealthRecordEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_HealthRecordReal64{ + MSFT_HealthRecord: tmp, + } + return +} + +func NewMSFT_HealthRecordReal64Ex6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_HealthRecordReal64, err error) { + tmp, err := NewMSFT_HealthRecordEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_HealthRecordReal64{ + MSFT_HealthRecord: tmp, + } + return +} + +// SetValue sets the value of Value for the instance +func (instance *MSFT_HealthRecordReal64) SetPropertyValue(value float64) (err error) { + return instance.SetProperty("Value", (value)) +} + +// GetValue gets the value of Value for the instance +func (instance *MSFT_HealthRecordReal64) GetPropertyValue() (value float64, err error) { + retValue, err := instance.GetProperty("Value") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(float64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " float64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = float64(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthRecordUInt64.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthRecordUInt64.go new file mode 100644 index 000000000..e4d50c0ac --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_HealthRecordUInt64.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_HealthRecordUInt64 struct +type MSFT_HealthRecordUInt64 struct { + *MSFT_HealthRecord + + // + Value uint64 +} + +func NewMSFT_HealthRecordUInt64Ex1(instance *cim.WmiInstance) (newInstance *MSFT_HealthRecordUInt64, err error) { + tmp, err := NewMSFT_HealthRecordEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_HealthRecordUInt64{ + MSFT_HealthRecord: tmp, + } + return +} + +func NewMSFT_HealthRecordUInt64Ex6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_HealthRecordUInt64, err error) { + tmp, err := NewMSFT_HealthRecordEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_HealthRecordUInt64{ + MSFT_HealthRecord: tmp, + } + return +} + +// SetValue sets the value of Value for the instance +func (instance *MSFT_HealthRecordUInt64) SetPropertyValue(value uint64) (err error) { + return instance.SetProperty("Value", (value)) +} + +// GetValue gets the value of Value for the instance +func (instance *MSFT_HealthRecordUInt64) GetPropertyValue() (value uint64, err error) { + retValue, err := instance.GetProperty("Value") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorId.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorId.go new file mode 100644 index 000000000..79af1e575 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorId.go @@ -0,0 +1,187 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_InitiatorId struct +type MSFT_InitiatorId struct { + *MSFT_StorageObject + + // + HostType []uint16 + + // + InitiatorAddress string + + // + OtherHostTypeDescription []string + + // + Type uint16 +} + +func NewMSFT_InitiatorIdEx1(instance *cim.WmiInstance) (newInstance *MSFT_InitiatorId, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_InitiatorId{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_InitiatorIdEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_InitiatorId, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_InitiatorId{ + MSFT_StorageObject: tmp, + } + return +} + +// SetHostType sets the value of HostType for the instance +func (instance *MSFT_InitiatorId) SetPropertyHostType(value []uint16) (err error) { + return instance.SetProperty("HostType", (value)) +} + +// GetHostType gets the value of HostType for the instance +func (instance *MSFT_InitiatorId) GetPropertyHostType() (value []uint16, err error) { + retValue, err := instance.GetProperty("HostType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetInitiatorAddress sets the value of InitiatorAddress for the instance +func (instance *MSFT_InitiatorId) SetPropertyInitiatorAddress(value string) (err error) { + return instance.SetProperty("InitiatorAddress", (value)) +} + +// GetInitiatorAddress gets the value of InitiatorAddress for the instance +func (instance *MSFT_InitiatorId) GetPropertyInitiatorAddress() (value string, err error) { + retValue, err := instance.GetProperty("InitiatorAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOtherHostTypeDescription sets the value of OtherHostTypeDescription for the instance +func (instance *MSFT_InitiatorId) SetPropertyOtherHostTypeDescription(value []string) (err error) { + return instance.SetProperty("OtherHostTypeDescription", (value)) +} + +// GetOtherHostTypeDescription gets the value of OtherHostTypeDescription for the instance +func (instance *MSFT_InitiatorId) GetPropertyOtherHostTypeDescription() (value []string, err error) { + retValue, err := instance.GetProperty("OtherHostTypeDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetType sets the value of Type for the instance +func (instance *MSFT_InitiatorId) SetPropertyType(value uint16) (err error) { + return instance.SetProperty("Type", (value)) +} + +// GetType gets the value of Type for the instance +func (instance *MSFT_InitiatorId) GetPropertyType() (value uint16, err error) { + retValue, err := instance.GetProperty("Type") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// + +// +// +func (instance *MSFT_InitiatorId) DeleteObject( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("DeleteObject") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorIdToVirtualDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorIdToVirtualDisk.go new file mode 100644 index 000000000..1f534252d --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorIdToVirtualDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_InitiatorIdToVirtualDisk struct +type MSFT_InitiatorIdToVirtualDisk struct { + *cim.WmiInstance + + // + InitiatorId MSFT_InitiatorId + + // + VirtualDisk MSFT_VirtualDisk +} + +func NewMSFT_InitiatorIdToVirtualDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_InitiatorIdToVirtualDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_InitiatorIdToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_InitiatorIdToVirtualDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_InitiatorIdToVirtualDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_InitiatorIdToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +// SetInitiatorId sets the value of InitiatorId for the instance +func (instance *MSFT_InitiatorIdToVirtualDisk) SetPropertyInitiatorId(value MSFT_InitiatorId) (err error) { + return instance.SetProperty("InitiatorId", (value)) +} + +// GetInitiatorId gets the value of InitiatorId for the instance +func (instance *MSFT_InitiatorIdToVirtualDisk) GetPropertyInitiatorId() (value MSFT_InitiatorId, err error) { + retValue, err := instance.GetProperty("InitiatorId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_InitiatorId) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_InitiatorId is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_InitiatorId(valuetmp) + + return +} + +// SetVirtualDisk sets the value of VirtualDisk for the instance +func (instance *MSFT_InitiatorIdToVirtualDisk) SetPropertyVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("VirtualDisk", (value)) +} + +// GetVirtualDisk gets the value of VirtualDisk for the instance +func (instance *MSFT_InitiatorIdToVirtualDisk) GetPropertyVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("VirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPort.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPort.go new file mode 100644 index 000000000..d911657f4 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPort.go @@ -0,0 +1,372 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_InitiatorPort struct +type MSFT_InitiatorPort struct { + *cim.WmiInstance + + // + AlternateNodeAddress []string + + // + AlternatePortAddress []string + + // + ConnectionType uint16 + + // + InstanceName string + + // + NodeAddress string + + // + ObjectId string + + // + OperationalStatus []uint16 + + // + OtherConnectionTypeDescription string + + // + PortAddress string + + // + PortType uint16 +} + +func NewMSFT_InitiatorPortEx1(instance *cim.WmiInstance) (newInstance *MSFT_InitiatorPort, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_InitiatorPort{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_InitiatorPortEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_InitiatorPort, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_InitiatorPort{ + WmiInstance: tmp, + } + return +} + +// SetAlternateNodeAddress sets the value of AlternateNodeAddress for the instance +func (instance *MSFT_InitiatorPort) SetPropertyAlternateNodeAddress(value []string) (err error) { + return instance.SetProperty("AlternateNodeAddress", (value)) +} + +// GetAlternateNodeAddress gets the value of AlternateNodeAddress for the instance +func (instance *MSFT_InitiatorPort) GetPropertyAlternateNodeAddress() (value []string, err error) { + retValue, err := instance.GetProperty("AlternateNodeAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetAlternatePortAddress sets the value of AlternatePortAddress for the instance +func (instance *MSFT_InitiatorPort) SetPropertyAlternatePortAddress(value []string) (err error) { + return instance.SetProperty("AlternatePortAddress", (value)) +} + +// GetAlternatePortAddress gets the value of AlternatePortAddress for the instance +func (instance *MSFT_InitiatorPort) GetPropertyAlternatePortAddress() (value []string, err error) { + retValue, err := instance.GetProperty("AlternatePortAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetConnectionType sets the value of ConnectionType for the instance +func (instance *MSFT_InitiatorPort) SetPropertyConnectionType(value uint16) (err error) { + return instance.SetProperty("ConnectionType", (value)) +} + +// GetConnectionType gets the value of ConnectionType for the instance +func (instance *MSFT_InitiatorPort) GetPropertyConnectionType() (value uint16, err error) { + retValue, err := instance.GetProperty("ConnectionType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetInstanceName sets the value of InstanceName for the instance +func (instance *MSFT_InitiatorPort) SetPropertyInstanceName(value string) (err error) { + return instance.SetProperty("InstanceName", (value)) +} + +// GetInstanceName gets the value of InstanceName for the instance +func (instance *MSFT_InitiatorPort) GetPropertyInstanceName() (value string, err error) { + retValue, err := instance.GetProperty("InstanceName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetNodeAddress sets the value of NodeAddress for the instance +func (instance *MSFT_InitiatorPort) SetPropertyNodeAddress(value string) (err error) { + return instance.SetProperty("NodeAddress", (value)) +} + +// GetNodeAddress gets the value of NodeAddress for the instance +func (instance *MSFT_InitiatorPort) GetPropertyNodeAddress() (value string, err error) { + retValue, err := instance.GetProperty("NodeAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetObjectId sets the value of ObjectId for the instance +func (instance *MSFT_InitiatorPort) SetPropertyObjectId(value string) (err error) { + return instance.SetProperty("ObjectId", (value)) +} + +// GetObjectId gets the value of ObjectId for the instance +func (instance *MSFT_InitiatorPort) GetPropertyObjectId() (value string, err error) { + retValue, err := instance.GetProperty("ObjectId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_InitiatorPort) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_InitiatorPort) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetOtherConnectionTypeDescription sets the value of OtherConnectionTypeDescription for the instance +func (instance *MSFT_InitiatorPort) SetPropertyOtherConnectionTypeDescription(value string) (err error) { + return instance.SetProperty("OtherConnectionTypeDescription", (value)) +} + +// GetOtherConnectionTypeDescription gets the value of OtherConnectionTypeDescription for the instance +func (instance *MSFT_InitiatorPort) GetPropertyOtherConnectionTypeDescription() (value string, err error) { + retValue, err := instance.GetProperty("OtherConnectionTypeDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPortAddress sets the value of PortAddress for the instance +func (instance *MSFT_InitiatorPort) SetPropertyPortAddress(value string) (err error) { + return instance.SetProperty("PortAddress", (value)) +} + +// GetPortAddress gets the value of PortAddress for the instance +func (instance *MSFT_InitiatorPort) GetPropertyPortAddress() (value string, err error) { + retValue, err := instance.GetProperty("PortAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPortType sets the value of PortType for the instance +func (instance *MSFT_InitiatorPort) SetPropertyPortType(value uint16) (err error) { + return instance.SetProperty("PortType", (value)) +} + +// GetPortType gets the value of PortType for the instance +func (instance *MSFT_InitiatorPort) GetPropertyPortType() (value uint16, err error) { + retValue, err := instance.GetProperty("PortType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// + +// + +// +// +func (instance *MSFT_InitiatorPort) SetNodeAddress( /* IN */ NodeAddress string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetNodeAddress", NodeAddress) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPortToiSCSIConnection.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPortToiSCSIConnection.go new file mode 100644 index 000000000..c914afd58 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPortToiSCSIConnection.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_InitiatorPortToiSCSIConnection struct +type MSFT_InitiatorPortToiSCSIConnection struct { + *cim.WmiInstance + + // + InitiatorPort MSFT_InitiatorPort + + // + iSCSIConnection MSFT_iSCSIConnection +} + +func NewMSFT_InitiatorPortToiSCSIConnectionEx1(instance *cim.WmiInstance) (newInstance *MSFT_InitiatorPortToiSCSIConnection, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_InitiatorPortToiSCSIConnection{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_InitiatorPortToiSCSIConnectionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_InitiatorPortToiSCSIConnection, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_InitiatorPortToiSCSIConnection{ + WmiInstance: tmp, + } + return +} + +// SetInitiatorPort sets the value of InitiatorPort for the instance +func (instance *MSFT_InitiatorPortToiSCSIConnection) SetPropertyInitiatorPort(value MSFT_InitiatorPort) (err error) { + return instance.SetProperty("InitiatorPort", (value)) +} + +// GetInitiatorPort gets the value of InitiatorPort for the instance +func (instance *MSFT_InitiatorPortToiSCSIConnection) GetPropertyInitiatorPort() (value MSFT_InitiatorPort, err error) { + retValue, err := instance.GetProperty("InitiatorPort") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_InitiatorPort) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_InitiatorPort is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_InitiatorPort(valuetmp) + + return +} + +// SetiSCSIConnection sets the value of iSCSIConnection for the instance +func (instance *MSFT_InitiatorPortToiSCSIConnection) SetPropertyiSCSIConnection(value MSFT_iSCSIConnection) (err error) { + return instance.SetProperty("iSCSIConnection", (value)) +} + +// GetiSCSIConnection gets the value of iSCSIConnection for the instance +func (instance *MSFT_InitiatorPortToiSCSIConnection) GetPropertyiSCSIConnection() (value MSFT_iSCSIConnection, err error) { + retValue, err := instance.GetProperty("iSCSIConnection") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSIConnection) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSIConnection is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSIConnection(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPortToiSCSISession.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPortToiSCSISession.go new file mode 100644 index 000000000..3743e41ce --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPortToiSCSISession.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_InitiatorPortToiSCSISession struct +type MSFT_InitiatorPortToiSCSISession struct { + *cim.WmiInstance + + // + InitiatorPort MSFT_InitiatorPort + + // + iSCSISession MSFT_iSCSISession +} + +func NewMSFT_InitiatorPortToiSCSISessionEx1(instance *cim.WmiInstance) (newInstance *MSFT_InitiatorPortToiSCSISession, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_InitiatorPortToiSCSISession{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_InitiatorPortToiSCSISessionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_InitiatorPortToiSCSISession, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_InitiatorPortToiSCSISession{ + WmiInstance: tmp, + } + return +} + +// SetInitiatorPort sets the value of InitiatorPort for the instance +func (instance *MSFT_InitiatorPortToiSCSISession) SetPropertyInitiatorPort(value MSFT_InitiatorPort) (err error) { + return instance.SetProperty("InitiatorPort", (value)) +} + +// GetInitiatorPort gets the value of InitiatorPort for the instance +func (instance *MSFT_InitiatorPortToiSCSISession) GetPropertyInitiatorPort() (value MSFT_InitiatorPort, err error) { + retValue, err := instance.GetProperty("InitiatorPort") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_InitiatorPort) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_InitiatorPort is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_InitiatorPort(valuetmp) + + return +} + +// SetiSCSISession sets the value of iSCSISession for the instance +func (instance *MSFT_InitiatorPortToiSCSISession) SetPropertyiSCSISession(value MSFT_iSCSISession) (err error) { + return instance.SetProperty("iSCSISession", (value)) +} + +// GetiSCSISession gets the value of iSCSISession for the instance +func (instance *MSFT_InitiatorPortToiSCSISession) GetPropertyiSCSISession() (value MSFT_iSCSISession, err error) { + retValue, err := instance.GetProperty("iSCSISession") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSISession) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSISession is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSISession(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPortToiSCSITarget.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPortToiSCSITarget.go new file mode 100644 index 000000000..f39fa9791 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_InitiatorPortToiSCSITarget.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_InitiatorPortToiSCSITarget struct +type MSFT_InitiatorPortToiSCSITarget struct { + *cim.WmiInstance + + // + InitiatorPort MSFT_InitiatorPort + + // + iSCSITarget MSFT_iSCSITarget +} + +func NewMSFT_InitiatorPortToiSCSITargetEx1(instance *cim.WmiInstance) (newInstance *MSFT_InitiatorPortToiSCSITarget, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_InitiatorPortToiSCSITarget{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_InitiatorPortToiSCSITargetEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_InitiatorPortToiSCSITarget, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_InitiatorPortToiSCSITarget{ + WmiInstance: tmp, + } + return +} + +// SetInitiatorPort sets the value of InitiatorPort for the instance +func (instance *MSFT_InitiatorPortToiSCSITarget) SetPropertyInitiatorPort(value MSFT_InitiatorPort) (err error) { + return instance.SetProperty("InitiatorPort", (value)) +} + +// GetInitiatorPort gets the value of InitiatorPort for the instance +func (instance *MSFT_InitiatorPortToiSCSITarget) GetPropertyInitiatorPort() (value MSFT_InitiatorPort, err error) { + retValue, err := instance.GetProperty("InitiatorPort") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_InitiatorPort) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_InitiatorPort is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_InitiatorPort(valuetmp) + + return +} + +// SetiSCSITarget sets the value of iSCSITarget for the instance +func (instance *MSFT_InitiatorPortToiSCSITarget) SetPropertyiSCSITarget(value MSFT_iSCSITarget) (err error) { + return instance.SetProperty("iSCSITarget", (value)) +} + +// GetiSCSITarget gets the value of iSCSITarget for the instance +func (instance *MSFT_InitiatorPortToiSCSITarget) GetPropertyiSCSITarget() (value MSFT_iSCSITarget, err error) { + retValue, err := instance.GetProperty("iSCSITarget") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSITarget) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSITarget is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSITarget(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSet.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSet.go new file mode 100644 index 000000000..66fba832f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSet.go @@ -0,0 +1,351 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_MaskingSet struct +type MSFT_MaskingSet struct { + *MSFT_StorageObject + + // + FriendlyName string + + // + HostType uint16 + + // + Name string +} + +func NewMSFT_MaskingSetEx1(instance *cim.WmiInstance) (newInstance *MSFT_MaskingSet, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_MaskingSet{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_MaskingSetEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_MaskingSet, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_MaskingSet{ + MSFT_StorageObject: tmp, + } + return +} + +// SetFriendlyName sets the value of FriendlyName for the instance +func (instance *MSFT_MaskingSet) SetPropertyFriendlyName(value string) (err error) { + return instance.SetProperty("FriendlyName", (value)) +} + +// GetFriendlyName gets the value of FriendlyName for the instance +func (instance *MSFT_MaskingSet) GetPropertyFriendlyName() (value string, err error) { + retValue, err := instance.GetProperty("FriendlyName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetHostType sets the value of HostType for the instance +func (instance *MSFT_MaskingSet) SetPropertyHostType(value uint16) (err error) { + return instance.SetProperty("HostType", (value)) +} + +// GetHostType gets the value of HostType for the instance +func (instance *MSFT_MaskingSet) GetPropertyHostType() (value uint16, err error) { + retValue, err := instance.GetProperty("HostType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetName sets the value of Name for the instance +func (instance *MSFT_MaskingSet) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *MSFT_MaskingSet) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// + +// +// +// + +// +// +// +func (instance *MSFT_MaskingSet) AddInitiatorId( /* IN */ InitiatorIds []string, + /* IN */ HostType uint16, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("AddInitiatorId", InitiatorIds, HostType, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_MaskingSet) RemoveInitiatorId( /* IN */ InitiatorIds []string, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RemoveInitiatorId", InitiatorIds, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_MaskingSet) AddTargetPort( /* IN */ TargetPortAddresses []string, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("AddTargetPort", TargetPortAddresses, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_MaskingSet) RemoveTargetPort( /* IN */ TargetPortAddresses []string, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RemoveTargetPort", TargetPortAddresses, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// + +// +// +// +func (instance *MSFT_MaskingSet) AddVirtualDisk( /* IN */ VirtualDiskNames []string, + /* IN */ DeviceNumbers []string, + /* IN */ DeviceAccesses []uint16, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("AddVirtualDisk", VirtualDiskNames, DeviceNumbers, DeviceAccesses, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_MaskingSet) RemoveVirtualDisk( /* IN */ VirtualDiskNames []string, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RemoveVirtualDisk", VirtualDiskNames, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_MaskingSet) DeleteObject( /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("DeleteObject", RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_MaskingSet) SetFriendlyName( /* IN */ FriendlyName string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetFriendlyName", FriendlyName) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_MaskingSet) GetSecurityDescriptor( /* OUT */ SecurityDescriptor string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSecurityDescriptor") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_MaskingSet) SetSecurityDescriptor( /* IN */ SecurityDescriptor string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetSecurityDescriptor", SecurityDescriptor) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSetToInitiatorId.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSetToInitiatorId.go new file mode 100644 index 000000000..e11cd5ab4 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSetToInitiatorId.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_MaskingSetToInitiatorId struct +type MSFT_MaskingSetToInitiatorId struct { + *cim.WmiInstance + + // + InitiatorId MSFT_InitiatorId + + // + MaskingSet MSFT_MaskingSet +} + +func NewMSFT_MaskingSetToInitiatorIdEx1(instance *cim.WmiInstance) (newInstance *MSFT_MaskingSetToInitiatorId, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_MaskingSetToInitiatorId{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_MaskingSetToInitiatorIdEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_MaskingSetToInitiatorId, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_MaskingSetToInitiatorId{ + WmiInstance: tmp, + } + return +} + +// SetInitiatorId sets the value of InitiatorId for the instance +func (instance *MSFT_MaskingSetToInitiatorId) SetPropertyInitiatorId(value MSFT_InitiatorId) (err error) { + return instance.SetProperty("InitiatorId", (value)) +} + +// GetInitiatorId gets the value of InitiatorId for the instance +func (instance *MSFT_MaskingSetToInitiatorId) GetPropertyInitiatorId() (value MSFT_InitiatorId, err error) { + retValue, err := instance.GetProperty("InitiatorId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_InitiatorId) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_InitiatorId is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_InitiatorId(valuetmp) + + return +} + +// SetMaskingSet sets the value of MaskingSet for the instance +func (instance *MSFT_MaskingSetToInitiatorId) SetPropertyMaskingSet(value MSFT_MaskingSet) (err error) { + return instance.SetProperty("MaskingSet", (value)) +} + +// GetMaskingSet gets the value of MaskingSet for the instance +func (instance *MSFT_MaskingSetToInitiatorId) GetPropertyMaskingSet() (value MSFT_MaskingSet, err error) { + retValue, err := instance.GetProperty("MaskingSet") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_MaskingSet) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_MaskingSet is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_MaskingSet(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSetToTargetPort.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSetToTargetPort.go new file mode 100644 index 000000000..851ef30b6 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSetToTargetPort.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_MaskingSetToTargetPort struct +type MSFT_MaskingSetToTargetPort struct { + *cim.WmiInstance + + // + MaskingSet MSFT_MaskingSet + + // + TargetPort MSFT_TargetPort +} + +func NewMSFT_MaskingSetToTargetPortEx1(instance *cim.WmiInstance) (newInstance *MSFT_MaskingSetToTargetPort, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_MaskingSetToTargetPort{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_MaskingSetToTargetPortEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_MaskingSetToTargetPort, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_MaskingSetToTargetPort{ + WmiInstance: tmp, + } + return +} + +// SetMaskingSet sets the value of MaskingSet for the instance +func (instance *MSFT_MaskingSetToTargetPort) SetPropertyMaskingSet(value MSFT_MaskingSet) (err error) { + return instance.SetProperty("MaskingSet", (value)) +} + +// GetMaskingSet gets the value of MaskingSet for the instance +func (instance *MSFT_MaskingSetToTargetPort) GetPropertyMaskingSet() (value MSFT_MaskingSet, err error) { + retValue, err := instance.GetProperty("MaskingSet") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_MaskingSet) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_MaskingSet is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_MaskingSet(valuetmp) + + return +} + +// SetTargetPort sets the value of TargetPort for the instance +func (instance *MSFT_MaskingSetToTargetPort) SetPropertyTargetPort(value MSFT_TargetPort) (err error) { + return instance.SetProperty("TargetPort", (value)) +} + +// GetTargetPort gets the value of TargetPort for the instance +func (instance *MSFT_MaskingSetToTargetPort) GetPropertyTargetPort() (value MSFT_TargetPort, err error) { + retValue, err := instance.GetProperty("TargetPort") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_TargetPort) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_TargetPort is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_TargetPort(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSetToVirtualDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSetToVirtualDisk.go new file mode 100644 index 000000000..5cf6b88bf --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_MaskingSetToVirtualDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_MaskingSetToVirtualDisk struct +type MSFT_MaskingSetToVirtualDisk struct { + *cim.WmiInstance + + // + MaskingSet MSFT_MaskingSet + + // + VirtualDisk MSFT_VirtualDisk +} + +func NewMSFT_MaskingSetToVirtualDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_MaskingSetToVirtualDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_MaskingSetToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_MaskingSetToVirtualDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_MaskingSetToVirtualDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_MaskingSetToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +// SetMaskingSet sets the value of MaskingSet for the instance +func (instance *MSFT_MaskingSetToVirtualDisk) SetPropertyMaskingSet(value MSFT_MaskingSet) (err error) { + return instance.SetProperty("MaskingSet", (value)) +} + +// GetMaskingSet gets the value of MaskingSet for the instance +func (instance *MSFT_MaskingSetToVirtualDisk) GetPropertyMaskingSet() (value MSFT_MaskingSet, err error) { + retValue, err := instance.GetProperty("MaskingSet") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_MaskingSet) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_MaskingSet is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_MaskingSet(valuetmp) + + return +} + +// SetVirtualDisk sets the value of VirtualDisk for the instance +func (instance *MSFT_MaskingSetToVirtualDisk) SetPropertyVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("VirtualDisk", (value)) +} + +// GetVirtualDisk gets the value of VirtualDisk for the instance +func (instance *MSFT_MaskingSetToVirtualDisk) GetPropertyVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("VirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_OffloadDataTransferSetting.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_OffloadDataTransferSetting.go new file mode 100644 index 000000000..485b0f268 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_OffloadDataTransferSetting.go @@ -0,0 +1,170 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_OffloadDataTransferSetting struct +type MSFT_OffloadDataTransferSetting struct { + *MSFT_StorageObject + + // + NumberOfTokensInUse uint32 + + // + NumberOfTokensMax uint32 + + // + OptimalDataTokenSize uint32 + + // + SupportInterSubsystem bool +} + +func NewMSFT_OffloadDataTransferSettingEx1(instance *cim.WmiInstance) (newInstance *MSFT_OffloadDataTransferSetting, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_OffloadDataTransferSetting{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_OffloadDataTransferSettingEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_OffloadDataTransferSetting, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_OffloadDataTransferSetting{ + MSFT_StorageObject: tmp, + } + return +} + +// SetNumberOfTokensInUse sets the value of NumberOfTokensInUse for the instance +func (instance *MSFT_OffloadDataTransferSetting) SetPropertyNumberOfTokensInUse(value uint32) (err error) { + return instance.SetProperty("NumberOfTokensInUse", (value)) +} + +// GetNumberOfTokensInUse gets the value of NumberOfTokensInUse for the instance +func (instance *MSFT_OffloadDataTransferSetting) GetPropertyNumberOfTokensInUse() (value uint32, err error) { + retValue, err := instance.GetProperty("NumberOfTokensInUse") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetNumberOfTokensMax sets the value of NumberOfTokensMax for the instance +func (instance *MSFT_OffloadDataTransferSetting) SetPropertyNumberOfTokensMax(value uint32) (err error) { + return instance.SetProperty("NumberOfTokensMax", (value)) +} + +// GetNumberOfTokensMax gets the value of NumberOfTokensMax for the instance +func (instance *MSFT_OffloadDataTransferSetting) GetPropertyNumberOfTokensMax() (value uint32, err error) { + retValue, err := instance.GetProperty("NumberOfTokensMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetOptimalDataTokenSize sets the value of OptimalDataTokenSize for the instance +func (instance *MSFT_OffloadDataTransferSetting) SetPropertyOptimalDataTokenSize(value uint32) (err error) { + return instance.SetProperty("OptimalDataTokenSize", (value)) +} + +// GetOptimalDataTokenSize gets the value of OptimalDataTokenSize for the instance +func (instance *MSFT_OffloadDataTransferSetting) GetPropertyOptimalDataTokenSize() (value uint32, err error) { + retValue, err := instance.GetProperty("OptimalDataTokenSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetSupportInterSubsystem sets the value of SupportInterSubsystem for the instance +func (instance *MSFT_OffloadDataTransferSetting) SetPropertySupportInterSubsystem(value bool) (err error) { + return instance.SetProperty("SupportInterSubsystem", (value)) +} + +// GetSupportInterSubsystem gets the value of SupportInterSubsystem for the instance +func (instance *MSFT_OffloadDataTransferSetting) GetPropertySupportInterSubsystem() (value bool, err error) { + retValue, err := instance.GetProperty("SupportInterSubsystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Partition.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Partition.go new file mode 100644 index 000000000..b07ae2674 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Partition.go @@ -0,0 +1,850 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_Partition struct +type MSFT_Partition struct { + *MSFT_StorageObject + + // + AccessPaths []string + + // + DiskId string + + // + DiskNumber uint32 + + // + DriveLetter byte + + // + GptType string + + // + Guid string + + // + IsActive bool + + // + IsBoot bool + + // + IsDAX bool + + // + IsHidden bool + + // + IsOffline bool + + // + IsReadOnly bool + + // + IsShadowCopy bool + + // + IsSystem bool + + // + MbrType uint16 + + // + NoDefaultDriveLetter bool + + // + Offset uint64 + + // + OperationalStatus uint16 + + // + PartitionNumber uint32 + + // + Size uint64 + + // + TransitionState uint16 +} + +func NewMSFT_PartitionEx1(instance *cim.WmiInstance) (newInstance *MSFT_Partition, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_Partition{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_PartitionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_Partition, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_Partition{ + MSFT_StorageObject: tmp, + } + return +} + +// SetAccessPaths sets the value of AccessPaths for the instance +func (instance *MSFT_Partition) SetPropertyAccessPaths(value []string) (err error) { + return instance.SetProperty("AccessPaths", (value)) +} + +// GetAccessPaths gets the value of AccessPaths for the instance +func (instance *MSFT_Partition) GetPropertyAccessPaths() (value []string, err error) { + retValue, err := instance.GetProperty("AccessPaths") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetDiskId sets the value of DiskId for the instance +func (instance *MSFT_Partition) SetPropertyDiskId(value string) (err error) { + return instance.SetProperty("DiskId", (value)) +} + +// GetDiskId gets the value of DiskId for the instance +func (instance *MSFT_Partition) GetPropertyDiskId() (value string, err error) { + retValue, err := instance.GetProperty("DiskId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetDiskNumber sets the value of DiskNumber for the instance +func (instance *MSFT_Partition) SetPropertyDiskNumber(value uint32) (err error) { + return instance.SetProperty("DiskNumber", (value)) +} + +// GetDiskNumber gets the value of DiskNumber for the instance +func (instance *MSFT_Partition) GetPropertyDiskNumber() (value uint32, err error) { + retValue, err := instance.GetProperty("DiskNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetDriveLetter sets the value of DriveLetter for the instance +func (instance *MSFT_Partition) SetPropertyDriveLetter(value byte) (err error) { + return instance.SetProperty("DriveLetter", (value)) +} + +// GetDriveLetter gets the value of DriveLetter for the instance +func (instance *MSFT_Partition) GetPropertyDriveLetter() (value byte, err error) { + retValue, err := instance.GetProperty("DriveLetter") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(byte) + if !ok { + err = errors.Wrapf(errors.InvalidType, " byte is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = byte(valuetmp) + + return +} + +// SetGptType sets the value of GptType for the instance +func (instance *MSFT_Partition) SetPropertyGptType(value string) (err error) { + return instance.SetProperty("GptType", (value)) +} + +// GetGptType gets the value of GptType for the instance +func (instance *MSFT_Partition) GetPropertyGptType() (value string, err error) { + retValue, err := instance.GetProperty("GptType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetGuid sets the value of Guid for the instance +func (instance *MSFT_Partition) SetPropertyGuid(value string) (err error) { + return instance.SetProperty("Guid", (value)) +} + +// GetGuid gets the value of Guid for the instance +func (instance *MSFT_Partition) GetPropertyGuid() (value string, err error) { + retValue, err := instance.GetProperty("Guid") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetIsActive sets the value of IsActive for the instance +func (instance *MSFT_Partition) SetPropertyIsActive(value bool) (err error) { + return instance.SetProperty("IsActive", (value)) +} + +// GetIsActive gets the value of IsActive for the instance +func (instance *MSFT_Partition) GetPropertyIsActive() (value bool, err error) { + retValue, err := instance.GetProperty("IsActive") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsBoot sets the value of IsBoot for the instance +func (instance *MSFT_Partition) SetPropertyIsBoot(value bool) (err error) { + return instance.SetProperty("IsBoot", (value)) +} + +// GetIsBoot gets the value of IsBoot for the instance +func (instance *MSFT_Partition) GetPropertyIsBoot() (value bool, err error) { + retValue, err := instance.GetProperty("IsBoot") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsDAX sets the value of IsDAX for the instance +func (instance *MSFT_Partition) SetPropertyIsDAX(value bool) (err error) { + return instance.SetProperty("IsDAX", (value)) +} + +// GetIsDAX gets the value of IsDAX for the instance +func (instance *MSFT_Partition) GetPropertyIsDAX() (value bool, err error) { + retValue, err := instance.GetProperty("IsDAX") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsHidden sets the value of IsHidden for the instance +func (instance *MSFT_Partition) SetPropertyIsHidden(value bool) (err error) { + return instance.SetProperty("IsHidden", (value)) +} + +// GetIsHidden gets the value of IsHidden for the instance +func (instance *MSFT_Partition) GetPropertyIsHidden() (value bool, err error) { + retValue, err := instance.GetProperty("IsHidden") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsOffline sets the value of IsOffline for the instance +func (instance *MSFT_Partition) SetPropertyIsOffline(value bool) (err error) { + return instance.SetProperty("IsOffline", (value)) +} + +// GetIsOffline gets the value of IsOffline for the instance +func (instance *MSFT_Partition) GetPropertyIsOffline() (value bool, err error) { + retValue, err := instance.GetProperty("IsOffline") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsReadOnly sets the value of IsReadOnly for the instance +func (instance *MSFT_Partition) SetPropertyIsReadOnly(value bool) (err error) { + return instance.SetProperty("IsReadOnly", (value)) +} + +// GetIsReadOnly gets the value of IsReadOnly for the instance +func (instance *MSFT_Partition) GetPropertyIsReadOnly() (value bool, err error) { + retValue, err := instance.GetProperty("IsReadOnly") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsShadowCopy sets the value of IsShadowCopy for the instance +func (instance *MSFT_Partition) SetPropertyIsShadowCopy(value bool) (err error) { + return instance.SetProperty("IsShadowCopy", (value)) +} + +// GetIsShadowCopy gets the value of IsShadowCopy for the instance +func (instance *MSFT_Partition) GetPropertyIsShadowCopy() (value bool, err error) { + retValue, err := instance.GetProperty("IsShadowCopy") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsSystem sets the value of IsSystem for the instance +func (instance *MSFT_Partition) SetPropertyIsSystem(value bool) (err error) { + return instance.SetProperty("IsSystem", (value)) +} + +// GetIsSystem gets the value of IsSystem for the instance +func (instance *MSFT_Partition) GetPropertyIsSystem() (value bool, err error) { + retValue, err := instance.GetProperty("IsSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetMbrType sets the value of MbrType for the instance +func (instance *MSFT_Partition) SetPropertyMbrType(value uint16) (err error) { + return instance.SetProperty("MbrType", (value)) +} + +// GetMbrType gets the value of MbrType for the instance +func (instance *MSFT_Partition) GetPropertyMbrType() (value uint16, err error) { + retValue, err := instance.GetProperty("MbrType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNoDefaultDriveLetter sets the value of NoDefaultDriveLetter for the instance +func (instance *MSFT_Partition) SetPropertyNoDefaultDriveLetter(value bool) (err error) { + return instance.SetProperty("NoDefaultDriveLetter", (value)) +} + +// GetNoDefaultDriveLetter gets the value of NoDefaultDriveLetter for the instance +func (instance *MSFT_Partition) GetPropertyNoDefaultDriveLetter() (value bool, err error) { + retValue, err := instance.GetProperty("NoDefaultDriveLetter") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetOffset sets the value of Offset for the instance +func (instance *MSFT_Partition) SetPropertyOffset(value uint64) (err error) { + return instance.SetProperty("Offset", (value)) +} + +// GetOffset gets the value of Offset for the instance +func (instance *MSFT_Partition) GetPropertyOffset() (value uint64, err error) { + retValue, err := instance.GetProperty("Offset") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_Partition) SetPropertyOperationalStatus(value uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_Partition) GetPropertyOperationalStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetPartitionNumber sets the value of PartitionNumber for the instance +func (instance *MSFT_Partition) SetPropertyPartitionNumber(value uint32) (err error) { + return instance.SetProperty("PartitionNumber", (value)) +} + +// GetPartitionNumber gets the value of PartitionNumber for the instance +func (instance *MSFT_Partition) GetPropertyPartitionNumber() (value uint32, err error) { + retValue, err := instance.GetProperty("PartitionNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetSize sets the value of Size for the instance +func (instance *MSFT_Partition) SetPropertySize(value uint64) (err error) { + return instance.SetProperty("Size", (value)) +} + +// GetSize gets the value of Size for the instance +func (instance *MSFT_Partition) GetPropertySize() (value uint64, err error) { + retValue, err := instance.GetProperty("Size") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetTransitionState sets the value of TransitionState for the instance +func (instance *MSFT_Partition) SetPropertyTransitionState(value uint16) (err error) { + return instance.SetProperty("TransitionState", (value)) +} + +// GetTransitionState gets the value of TransitionState for the instance +func (instance *MSFT_Partition) GetPropertyTransitionState() (value uint16, err error) { + retValue, err := instance.GetProperty("TransitionState") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// + +// +// +func (instance *MSFT_Partition) DeleteObject( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("DeleteObject") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_Partition) GetAccessPaths( /* OUT */ AccessPaths []string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetAccessPaths") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +func (instance *MSFT_Partition) AddAccessPath( /* IN */ AccessPath string, + /* IN */ AssignDriveLetter bool, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("AddAccessPath", AccessPath, AssignDriveLetter) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_Partition) RemoveAccessPath( /* IN */ AccessPath string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RemoveAccessPath", AccessPath) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_Partition) Resize( /* IN */ Size uint64, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Resize", Size) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +func (instance *MSFT_Partition) GetSupportedSize( /* OUT */ SizeMin uint64, + /* OUT */ SizeMax uint64, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSupportedSize") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_Partition) Online( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Online") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_Partition) Offline( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Offline") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// +// + +// +// +func (instance *MSFT_Partition) SetAttributes( /* IN */ IsReadOnly bool, + /* IN */ NoDefaultDriveLetter bool, + /* IN */ IsActive bool, + /* IN */ IsHidden bool, + /* IN */ IsShadowCopy bool, + /* IN */ IsDAX bool, + /* IN */ MbrType uint16, + /* IN */ GptType string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetAttributes", IsReadOnly, NoDefaultDriveLetter, IsActive, IsHidden, IsShadowCopy, IsDAX, MbrType, GptType) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PartitionToReplicaPeer.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PartitionToReplicaPeer.go new file mode 100644 index 000000000..d4b9dfcf7 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PartitionToReplicaPeer.go @@ -0,0 +1,110 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_PartitionToReplicaPeer struct +type MSFT_PartitionToReplicaPeer struct { + *MSFT_Synchronized + + // + Partition MSFT_Partition + + // + ReplicaPeer MSFT_ReplicaPeer +} + +func NewMSFT_PartitionToReplicaPeerEx1(instance *cim.WmiInstance) (newInstance *MSFT_PartitionToReplicaPeer, err error) { + tmp, err := NewMSFT_SynchronizedEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_PartitionToReplicaPeer{ + MSFT_Synchronized: tmp, + } + return +} + +func NewMSFT_PartitionToReplicaPeerEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_PartitionToReplicaPeer, err error) { + tmp, err := NewMSFT_SynchronizedEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_PartitionToReplicaPeer{ + MSFT_Synchronized: tmp, + } + return +} + +// SetPartition sets the value of Partition for the instance +func (instance *MSFT_PartitionToReplicaPeer) SetPropertyPartition(value MSFT_Partition) (err error) { + return instance.SetProperty("Partition", (value)) +} + +// GetPartition gets the value of Partition for the instance +func (instance *MSFT_PartitionToReplicaPeer) GetPropertyPartition() (value MSFT_Partition, err error) { + retValue, err := instance.GetProperty("Partition") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Partition) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Partition is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Partition(valuetmp) + + return +} + +// SetReplicaPeer sets the value of ReplicaPeer for the instance +func (instance *MSFT_PartitionToReplicaPeer) SetPropertyReplicaPeer(value MSFT_ReplicaPeer) (err error) { + return instance.SetProperty("ReplicaPeer", (value)) +} + +// GetReplicaPeer gets the value of ReplicaPeer for the instance +func (instance *MSFT_PartitionToReplicaPeer) GetPropertyReplicaPeer() (value MSFT_ReplicaPeer, err error) { + retValue, err := instance.GetProperty("ReplicaPeer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_ReplicaPeer) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_ReplicaPeer is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_ReplicaPeer(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PartitionToVolume.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PartitionToVolume.go new file mode 100644 index 000000000..c076fbff1 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PartitionToVolume.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_PartitionToVolume struct +type MSFT_PartitionToVolume struct { + *cim.WmiInstance + + // + Partition MSFT_Partition + + // + Volume MSFT_Volume +} + +func NewMSFT_PartitionToVolumeEx1(instance *cim.WmiInstance) (newInstance *MSFT_PartitionToVolume, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_PartitionToVolume{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_PartitionToVolumeEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_PartitionToVolume, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_PartitionToVolume{ + WmiInstance: tmp, + } + return +} + +// SetPartition sets the value of Partition for the instance +func (instance *MSFT_PartitionToVolume) SetPropertyPartition(value MSFT_Partition) (err error) { + return instance.SetProperty("Partition", (value)) +} + +// GetPartition gets the value of Partition for the instance +func (instance *MSFT_PartitionToVolume) GetPropertyPartition() (value MSFT_Partition, err error) { + retValue, err := instance.GetProperty("Partition") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Partition) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Partition is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Partition(valuetmp) + + return +} + +// SetVolume sets the value of Volume for the instance +func (instance *MSFT_PartitionToVolume) SetPropertyVolume(value MSFT_Volume) (err error) { + return instance.SetProperty("Volume", (value)) +} + +// GetVolume gets the value of Volume for the instance +func (instance *MSFT_PartitionToVolume) GetPropertyVolume() (value MSFT_Volume, err error) { + retValue, err := instance.GetProperty("Volume") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Volume) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Volume is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Volume(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PhysicalDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PhysicalDisk.go new file mode 100644 index 000000000..beb380499 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PhysicalDisk.go @@ -0,0 +1,985 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_PhysicalDisk struct +type MSFT_PhysicalDisk struct { + *MSFT_StorageFaultDomain + + // + AdapterSerialNumber string + + // + AllocatedSize uint64 + + // + BusType uint16 + + // + CannotPoolReason []uint16 + + // + CanPool bool + + // + DeviceId string + + // + EnclosureNumber uint16 + + // + FirmwareVersion string + + // + IsIndicationEnabled bool + + // + IsPartial bool + + // + LogicalSectorSize uint64 + + // + MediaType uint16 + + // + OtherCannotPoolReasonDescription string + + // + PartNumber string + + // + PhysicalSectorSize uint64 + + // + Size uint64 + + // + SlotNumber uint16 + + // + SoftwareVersion string + + // + SpindleSpeed uint32 + + // + StoragePoolUniqueId string + + // + SupportedUsages []uint16 + + // + UniqueIdFormat uint16 + + // + Usage uint16 + + // + VirtualDiskFootprint uint64 +} + +func NewMSFT_PhysicalDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_PhysicalDisk, err error) { + tmp, err := NewMSFT_StorageFaultDomainEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_PhysicalDisk{ + MSFT_StorageFaultDomain: tmp, + } + return +} + +func NewMSFT_PhysicalDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_PhysicalDisk, err error) { + tmp, err := NewMSFT_StorageFaultDomainEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_PhysicalDisk{ + MSFT_StorageFaultDomain: tmp, + } + return +} + +// SetAdapterSerialNumber sets the value of AdapterSerialNumber for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyAdapterSerialNumber(value string) (err error) { + return instance.SetProperty("AdapterSerialNumber", (value)) +} + +// GetAdapterSerialNumber gets the value of AdapterSerialNumber for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyAdapterSerialNumber() (value string, err error) { + retValue, err := instance.GetProperty("AdapterSerialNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetAllocatedSize sets the value of AllocatedSize for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyAllocatedSize(value uint64) (err error) { + return instance.SetProperty("AllocatedSize", (value)) +} + +// GetAllocatedSize gets the value of AllocatedSize for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyAllocatedSize() (value uint64, err error) { + retValue, err := instance.GetProperty("AllocatedSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetBusType sets the value of BusType for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyBusType(value uint16) (err error) { + return instance.SetProperty("BusType", (value)) +} + +// GetBusType gets the value of BusType for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyBusType() (value uint16, err error) { + retValue, err := instance.GetProperty("BusType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetCannotPoolReason sets the value of CannotPoolReason for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyCannotPoolReason(value []uint16) (err error) { + return instance.SetProperty("CannotPoolReason", (value)) +} + +// GetCannotPoolReason gets the value of CannotPoolReason for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyCannotPoolReason() (value []uint16, err error) { + retValue, err := instance.GetProperty("CannotPoolReason") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetCanPool sets the value of CanPool for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyCanPool(value bool) (err error) { + return instance.SetProperty("CanPool", (value)) +} + +// GetCanPool gets the value of CanPool for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyCanPool() (value bool, err error) { + retValue, err := instance.GetProperty("CanPool") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetDeviceId sets the value of DeviceId for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyDeviceId(value string) (err error) { + return instance.SetProperty("DeviceId", (value)) +} + +// GetDeviceId gets the value of DeviceId for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyDeviceId() (value string, err error) { + retValue, err := instance.GetProperty("DeviceId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetEnclosureNumber sets the value of EnclosureNumber for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyEnclosureNumber(value uint16) (err error) { + return instance.SetProperty("EnclosureNumber", (value)) +} + +// GetEnclosureNumber gets the value of EnclosureNumber for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyEnclosureNumber() (value uint16, err error) { + retValue, err := instance.GetProperty("EnclosureNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetFirmwareVersion sets the value of FirmwareVersion for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyFirmwareVersion(value string) (err error) { + return instance.SetProperty("FirmwareVersion", (value)) +} + +// GetFirmwareVersion gets the value of FirmwareVersion for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyFirmwareVersion() (value string, err error) { + retValue, err := instance.GetProperty("FirmwareVersion") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetIsIndicationEnabled sets the value of IsIndicationEnabled for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyIsIndicationEnabled(value bool) (err error) { + return instance.SetProperty("IsIndicationEnabled", (value)) +} + +// GetIsIndicationEnabled gets the value of IsIndicationEnabled for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyIsIndicationEnabled() (value bool, err error) { + retValue, err := instance.GetProperty("IsIndicationEnabled") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsPartial sets the value of IsPartial for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyIsPartial(value bool) (err error) { + return instance.SetProperty("IsPartial", (value)) +} + +// GetIsPartial gets the value of IsPartial for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyIsPartial() (value bool, err error) { + retValue, err := instance.GetProperty("IsPartial") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetLogicalSectorSize sets the value of LogicalSectorSize for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyLogicalSectorSize(value uint64) (err error) { + return instance.SetProperty("LogicalSectorSize", (value)) +} + +// GetLogicalSectorSize gets the value of LogicalSectorSize for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyLogicalSectorSize() (value uint64, err error) { + retValue, err := instance.GetProperty("LogicalSectorSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetMediaType sets the value of MediaType for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyMediaType(value uint16) (err error) { + return instance.SetProperty("MediaType", (value)) +} + +// GetMediaType gets the value of MediaType for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyMediaType() (value uint16, err error) { + retValue, err := instance.GetProperty("MediaType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetOtherCannotPoolReasonDescription sets the value of OtherCannotPoolReasonDescription for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyOtherCannotPoolReasonDescription(value string) (err error) { + return instance.SetProperty("OtherCannotPoolReasonDescription", (value)) +} + +// GetOtherCannotPoolReasonDescription gets the value of OtherCannotPoolReasonDescription for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyOtherCannotPoolReasonDescription() (value string, err error) { + retValue, err := instance.GetProperty("OtherCannotPoolReasonDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPartNumber sets the value of PartNumber for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyPartNumber(value string) (err error) { + return instance.SetProperty("PartNumber", (value)) +} + +// GetPartNumber gets the value of PartNumber for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyPartNumber() (value string, err error) { + retValue, err := instance.GetProperty("PartNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPhysicalSectorSize sets the value of PhysicalSectorSize for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyPhysicalSectorSize(value uint64) (err error) { + return instance.SetProperty("PhysicalSectorSize", (value)) +} + +// GetPhysicalSectorSize gets the value of PhysicalSectorSize for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyPhysicalSectorSize() (value uint64, err error) { + retValue, err := instance.GetProperty("PhysicalSectorSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetSize sets the value of Size for the instance +func (instance *MSFT_PhysicalDisk) SetPropertySize(value uint64) (err error) { + return instance.SetProperty("Size", (value)) +} + +// GetSize gets the value of Size for the instance +func (instance *MSFT_PhysicalDisk) GetPropertySize() (value uint64, err error) { + retValue, err := instance.GetProperty("Size") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetSlotNumber sets the value of SlotNumber for the instance +func (instance *MSFT_PhysicalDisk) SetPropertySlotNumber(value uint16) (err error) { + return instance.SetProperty("SlotNumber", (value)) +} + +// GetSlotNumber gets the value of SlotNumber for the instance +func (instance *MSFT_PhysicalDisk) GetPropertySlotNumber() (value uint16, err error) { + retValue, err := instance.GetProperty("SlotNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSoftwareVersion sets the value of SoftwareVersion for the instance +func (instance *MSFT_PhysicalDisk) SetPropertySoftwareVersion(value string) (err error) { + return instance.SetProperty("SoftwareVersion", (value)) +} + +// GetSoftwareVersion gets the value of SoftwareVersion for the instance +func (instance *MSFT_PhysicalDisk) GetPropertySoftwareVersion() (value string, err error) { + retValue, err := instance.GetProperty("SoftwareVersion") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSpindleSpeed sets the value of SpindleSpeed for the instance +func (instance *MSFT_PhysicalDisk) SetPropertySpindleSpeed(value uint32) (err error) { + return instance.SetProperty("SpindleSpeed", (value)) +} + +// GetSpindleSpeed gets the value of SpindleSpeed for the instance +func (instance *MSFT_PhysicalDisk) GetPropertySpindleSpeed() (value uint32, err error) { + retValue, err := instance.GetProperty("SpindleSpeed") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetStoragePoolUniqueId sets the value of StoragePoolUniqueId for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyStoragePoolUniqueId(value string) (err error) { + return instance.SetProperty("StoragePoolUniqueId", (value)) +} + +// GetStoragePoolUniqueId gets the value of StoragePoolUniqueId for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyStoragePoolUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("StoragePoolUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSupportedUsages sets the value of SupportedUsages for the instance +func (instance *MSFT_PhysicalDisk) SetPropertySupportedUsages(value []uint16) (err error) { + return instance.SetProperty("SupportedUsages", (value)) +} + +// GetSupportedUsages gets the value of SupportedUsages for the instance +func (instance *MSFT_PhysicalDisk) GetPropertySupportedUsages() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedUsages") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetUniqueIdFormat sets the value of UniqueIdFormat for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyUniqueIdFormat(value uint16) (err error) { + return instance.SetProperty("UniqueIdFormat", (value)) +} + +// GetUniqueIdFormat gets the value of UniqueIdFormat for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyUniqueIdFormat() (value uint16, err error) { + retValue, err := instance.GetProperty("UniqueIdFormat") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetUsage sets the value of Usage for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyUsage(value uint16) (err error) { + return instance.SetProperty("Usage", (value)) +} + +// GetUsage gets the value of Usage for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyUsage() (value uint16, err error) { + retValue, err := instance.GetProperty("Usage") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetVirtualDiskFootprint sets the value of VirtualDiskFootprint for the instance +func (instance *MSFT_PhysicalDisk) SetPropertyVirtualDiskFootprint(value uint64) (err error) { + return instance.SetProperty("VirtualDiskFootprint", (value)) +} + +// GetVirtualDiskFootprint gets the value of VirtualDiskFootprint for the instance +func (instance *MSFT_PhysicalDisk) GetPropertyVirtualDiskFootprint() (value uint64, err error) { + retValue, err := instance.GetProperty("VirtualDiskFootprint") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// + +// +// +// +func (instance *MSFT_PhysicalDisk) GetPhysicalExtent( /* OUT */ PhysicalExtents []MSFT_PhysicalExtent, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetPhysicalExtent") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// + +// +// +func (instance *MSFT_PhysicalDisk) Maintenance( /* IN */ EnableIndication bool, + /* IN */ EnableMaintenanceMode bool, + /* IN */ Timeout uint32, + /* IN */ IgnoreDetachedVirtualDisks bool, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Maintenance", EnableIndication, EnableMaintenanceMode, Timeout, IgnoreDetachedVirtualDisks) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_PhysicalDisk) Reset( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Reset") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_PhysicalDisk) SetFriendlyName( /* IN */ FriendlyName string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetFriendlyName", FriendlyName) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_PhysicalDisk) SetDescription( /* IN */ Description string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetDescription", Description) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_PhysicalDisk) SetUsage( /* IN */ Usage uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetUsage", Usage) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// + +// +// +func (instance *MSFT_PhysicalDisk) SetAttributes( /* IN */ MediaType uint16, + /* IN */ StorageEnclosureId string, + /* IN */ StorageScaleUnitId string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetAttributes", MediaType, StorageEnclosureId, StorageScaleUnitId) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_PhysicalDisk) IsDeviceCacheEnabled( /* OUT */ IsDeviceCacheEnabled bool, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("IsDeviceCacheEnabled") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_PhysicalDisk) IsPowerProtected( /* OUT */ IsPowerProtected bool, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("IsPowerProtected") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// +// +func (instance *MSFT_PhysicalDisk) GetFirmwareInformation( /* OUT */ SupportsUpdate bool, + /* OUT */ NumberOfSlots uint16, + /* OUT */ ActiveSlotNumber uint16, + /* OUT */ SlotNumber []uint16, + /* OUT */ IsSlotWritable []bool, + /* OUT */ FirmwareVersionInSlot []string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetFirmwareInformation") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +func (instance *MSFT_PhysicalDisk) UpdateFirmware( /* IN */ ImagePath string, + /* IN */ SlotNumber uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("UpdateFirmware", ImagePath, SlotNumber) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PhysicalDiskToStorageReliabilityCounter.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PhysicalDiskToStorageReliabilityCounter.go new file mode 100644 index 000000000..70bf4eb88 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PhysicalDiskToStorageReliabilityCounter.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_PhysicalDiskToStorageReliabilityCounter struct +type MSFT_PhysicalDiskToStorageReliabilityCounter struct { + *cim.WmiInstance + + // + PhysicalDisk MSFT_PhysicalDisk + + // + StorageReliabilityCounter MSFT_StorageReliabilityCounter +} + +func NewMSFT_PhysicalDiskToStorageReliabilityCounterEx1(instance *cim.WmiInstance) (newInstance *MSFT_PhysicalDiskToStorageReliabilityCounter, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_PhysicalDiskToStorageReliabilityCounter{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_PhysicalDiskToStorageReliabilityCounterEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_PhysicalDiskToStorageReliabilityCounter, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_PhysicalDiskToStorageReliabilityCounter{ + WmiInstance: tmp, + } + return +} + +// SetPhysicalDisk sets the value of PhysicalDisk for the instance +func (instance *MSFT_PhysicalDiskToStorageReliabilityCounter) SetPropertyPhysicalDisk(value MSFT_PhysicalDisk) (err error) { + return instance.SetProperty("PhysicalDisk", (value)) +} + +// GetPhysicalDisk gets the value of PhysicalDisk for the instance +func (instance *MSFT_PhysicalDiskToStorageReliabilityCounter) GetPropertyPhysicalDisk() (value MSFT_PhysicalDisk, err error) { + retValue, err := instance.GetProperty("PhysicalDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_PhysicalDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_PhysicalDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_PhysicalDisk(valuetmp) + + return +} + +// SetStorageReliabilityCounter sets the value of StorageReliabilityCounter for the instance +func (instance *MSFT_PhysicalDiskToStorageReliabilityCounter) SetPropertyStorageReliabilityCounter(value MSFT_StorageReliabilityCounter) (err error) { + return instance.SetProperty("StorageReliabilityCounter", (value)) +} + +// GetStorageReliabilityCounter gets the value of StorageReliabilityCounter for the instance +func (instance *MSFT_PhysicalDiskToStorageReliabilityCounter) GetPropertyStorageReliabilityCounter() (value MSFT_StorageReliabilityCounter, err error) { + retValue, err := instance.GetProperty("StorageReliabilityCounter") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageReliabilityCounter) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageReliabilityCounter is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageReliabilityCounter(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PhysicalExtent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PhysicalExtent.go new file mode 100644 index 000000000..ec589a4b1 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_PhysicalExtent.go @@ -0,0 +1,413 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_PhysicalExtent struct +type MSFT_PhysicalExtent struct { + *cim.WmiInstance + + // + ColumnNumber uint16 + + // + CopyNumber uint16 + + // + Flags uint64 + + // + OperationalDetails []string + + // + OperationalStatus []uint16 + + // + PhysicalDiskOffset uint64 + + // + PhysicalDiskUniqueId string + + // + ReplacementCopyNumber uint16 + + // + Size uint64 + + // + StorageTierUniqueId string + + // + VirtualDiskOffset uint64 + + // + VirtualDiskUniqueId string +} + +func NewMSFT_PhysicalExtentEx1(instance *cim.WmiInstance) (newInstance *MSFT_PhysicalExtent, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_PhysicalExtent{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_PhysicalExtentEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_PhysicalExtent, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_PhysicalExtent{ + WmiInstance: tmp, + } + return +} + +// SetColumnNumber sets the value of ColumnNumber for the instance +func (instance *MSFT_PhysicalExtent) SetPropertyColumnNumber(value uint16) (err error) { + return instance.SetProperty("ColumnNumber", (value)) +} + +// GetColumnNumber gets the value of ColumnNumber for the instance +func (instance *MSFT_PhysicalExtent) GetPropertyColumnNumber() (value uint16, err error) { + retValue, err := instance.GetProperty("ColumnNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetCopyNumber sets the value of CopyNumber for the instance +func (instance *MSFT_PhysicalExtent) SetPropertyCopyNumber(value uint16) (err error) { + return instance.SetProperty("CopyNumber", (value)) +} + +// GetCopyNumber gets the value of CopyNumber for the instance +func (instance *MSFT_PhysicalExtent) GetPropertyCopyNumber() (value uint16, err error) { + retValue, err := instance.GetProperty("CopyNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetFlags sets the value of Flags for the instance +func (instance *MSFT_PhysicalExtent) SetPropertyFlags(value uint64) (err error) { + return instance.SetProperty("Flags", (value)) +} + +// GetFlags gets the value of Flags for the instance +func (instance *MSFT_PhysicalExtent) GetPropertyFlags() (value uint64, err error) { + retValue, err := instance.GetProperty("Flags") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetOperationalDetails sets the value of OperationalDetails for the instance +func (instance *MSFT_PhysicalExtent) SetPropertyOperationalDetails(value []string) (err error) { + return instance.SetProperty("OperationalDetails", (value)) +} + +// GetOperationalDetails gets the value of OperationalDetails for the instance +func (instance *MSFT_PhysicalExtent) GetPropertyOperationalDetails() (value []string, err error) { + retValue, err := instance.GetProperty("OperationalDetails") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_PhysicalExtent) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_PhysicalExtent) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetPhysicalDiskOffset sets the value of PhysicalDiskOffset for the instance +func (instance *MSFT_PhysicalExtent) SetPropertyPhysicalDiskOffset(value uint64) (err error) { + return instance.SetProperty("PhysicalDiskOffset", (value)) +} + +// GetPhysicalDiskOffset gets the value of PhysicalDiskOffset for the instance +func (instance *MSFT_PhysicalExtent) GetPropertyPhysicalDiskOffset() (value uint64, err error) { + retValue, err := instance.GetProperty("PhysicalDiskOffset") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetPhysicalDiskUniqueId sets the value of PhysicalDiskUniqueId for the instance +func (instance *MSFT_PhysicalExtent) SetPropertyPhysicalDiskUniqueId(value string) (err error) { + return instance.SetProperty("PhysicalDiskUniqueId", (value)) +} + +// GetPhysicalDiskUniqueId gets the value of PhysicalDiskUniqueId for the instance +func (instance *MSFT_PhysicalExtent) GetPropertyPhysicalDiskUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("PhysicalDiskUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetReplacementCopyNumber sets the value of ReplacementCopyNumber for the instance +func (instance *MSFT_PhysicalExtent) SetPropertyReplacementCopyNumber(value uint16) (err error) { + return instance.SetProperty("ReplacementCopyNumber", (value)) +} + +// GetReplacementCopyNumber gets the value of ReplacementCopyNumber for the instance +func (instance *MSFT_PhysicalExtent) GetPropertyReplacementCopyNumber() (value uint16, err error) { + retValue, err := instance.GetProperty("ReplacementCopyNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSize sets the value of Size for the instance +func (instance *MSFT_PhysicalExtent) SetPropertySize(value uint64) (err error) { + return instance.SetProperty("Size", (value)) +} + +// GetSize gets the value of Size for the instance +func (instance *MSFT_PhysicalExtent) GetPropertySize() (value uint64, err error) { + retValue, err := instance.GetProperty("Size") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetStorageTierUniqueId sets the value of StorageTierUniqueId for the instance +func (instance *MSFT_PhysicalExtent) SetPropertyStorageTierUniqueId(value string) (err error) { + return instance.SetProperty("StorageTierUniqueId", (value)) +} + +// GetStorageTierUniqueId gets the value of StorageTierUniqueId for the instance +func (instance *MSFT_PhysicalExtent) GetPropertyStorageTierUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("StorageTierUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetVirtualDiskOffset sets the value of VirtualDiskOffset for the instance +func (instance *MSFT_PhysicalExtent) SetPropertyVirtualDiskOffset(value uint64) (err error) { + return instance.SetProperty("VirtualDiskOffset", (value)) +} + +// GetVirtualDiskOffset gets the value of VirtualDiskOffset for the instance +func (instance *MSFT_PhysicalExtent) GetPropertyVirtualDiskOffset() (value uint64, err error) { + retValue, err := instance.GetProperty("VirtualDiskOffset") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetVirtualDiskUniqueId sets the value of VirtualDiskUniqueId for the instance +func (instance *MSFT_PhysicalExtent) SetPropertyVirtualDiskUniqueId(value string) (err error) { + return instance.SetProperty("VirtualDiskUniqueId", (value)) +} + +// GetVirtualDiskUniqueId gets the value of VirtualDiskUniqueId for the instance +func (instance *MSFT_PhysicalExtent) GetPropertyVirtualDiskUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("VirtualDiskUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicaPeer.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicaPeer.go new file mode 100644 index 000000000..4cb1c852e --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicaPeer.go @@ -0,0 +1,290 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_ReplicaPeer struct +type MSFT_ReplicaPeer struct { + *MSFT_StorageObject + + // + IsPrimary bool + + // + PeerObject MSFT_StorageObject + + // + PeerObjectId string + + // + PeerObjectName string + + // + PeerObjectType uint16 + + // + PeerProviderURI string + + // + PeerSubsystemName string + + // + PeerUniqueId string +} + +func NewMSFT_ReplicaPeerEx1(instance *cim.WmiInstance) (newInstance *MSFT_ReplicaPeer, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_ReplicaPeer{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_ReplicaPeerEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_ReplicaPeer, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_ReplicaPeer{ + MSFT_StorageObject: tmp, + } + return +} + +// SetIsPrimary sets the value of IsPrimary for the instance +func (instance *MSFT_ReplicaPeer) SetPropertyIsPrimary(value bool) (err error) { + return instance.SetProperty("IsPrimary", (value)) +} + +// GetIsPrimary gets the value of IsPrimary for the instance +func (instance *MSFT_ReplicaPeer) GetPropertyIsPrimary() (value bool, err error) { + retValue, err := instance.GetProperty("IsPrimary") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetPeerObject sets the value of PeerObject for the instance +func (instance *MSFT_ReplicaPeer) SetPropertyPeerObject(value MSFT_StorageObject) (err error) { + return instance.SetProperty("PeerObject", (value)) +} + +// GetPeerObject gets the value of PeerObject for the instance +func (instance *MSFT_ReplicaPeer) GetPropertyPeerObject() (value MSFT_StorageObject, err error) { + retValue, err := instance.GetProperty("PeerObject") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageObject) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageObject is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageObject(valuetmp) + + return +} + +// SetPeerObjectId sets the value of PeerObjectId for the instance +func (instance *MSFT_ReplicaPeer) SetPropertyPeerObjectId(value string) (err error) { + return instance.SetProperty("PeerObjectId", (value)) +} + +// GetPeerObjectId gets the value of PeerObjectId for the instance +func (instance *MSFT_ReplicaPeer) GetPropertyPeerObjectId() (value string, err error) { + retValue, err := instance.GetProperty("PeerObjectId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPeerObjectName sets the value of PeerObjectName for the instance +func (instance *MSFT_ReplicaPeer) SetPropertyPeerObjectName(value string) (err error) { + return instance.SetProperty("PeerObjectName", (value)) +} + +// GetPeerObjectName gets the value of PeerObjectName for the instance +func (instance *MSFT_ReplicaPeer) GetPropertyPeerObjectName() (value string, err error) { + retValue, err := instance.GetProperty("PeerObjectName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPeerObjectType sets the value of PeerObjectType for the instance +func (instance *MSFT_ReplicaPeer) SetPropertyPeerObjectType(value uint16) (err error) { + return instance.SetProperty("PeerObjectType", (value)) +} + +// GetPeerObjectType gets the value of PeerObjectType for the instance +func (instance *MSFT_ReplicaPeer) GetPropertyPeerObjectType() (value uint16, err error) { + retValue, err := instance.GetProperty("PeerObjectType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetPeerProviderURI sets the value of PeerProviderURI for the instance +func (instance *MSFT_ReplicaPeer) SetPropertyPeerProviderURI(value string) (err error) { + return instance.SetProperty("PeerProviderURI", (value)) +} + +// GetPeerProviderURI gets the value of PeerProviderURI for the instance +func (instance *MSFT_ReplicaPeer) GetPropertyPeerProviderURI() (value string, err error) { + retValue, err := instance.GetProperty("PeerProviderURI") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPeerSubsystemName sets the value of PeerSubsystemName for the instance +func (instance *MSFT_ReplicaPeer) SetPropertyPeerSubsystemName(value string) (err error) { + return instance.SetProperty("PeerSubsystemName", (value)) +} + +// GetPeerSubsystemName gets the value of PeerSubsystemName for the instance +func (instance *MSFT_ReplicaPeer) GetPropertyPeerSubsystemName() (value string, err error) { + retValue, err := instance.GetProperty("PeerSubsystemName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPeerUniqueId sets the value of PeerUniqueId for the instance +func (instance *MSFT_ReplicaPeer) SetPropertyPeerUniqueId(value string) (err error) { + return instance.SetProperty("PeerUniqueId", (value)) +} + +// GetPeerUniqueId gets the value of PeerUniqueId for the instance +func (instance *MSFT_ReplicaPeer) GetPropertyPeerUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("PeerUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationCapabilities.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationCapabilities.go new file mode 100644 index 000000000..ae472b99c --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationCapabilities.go @@ -0,0 +1,590 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_ReplicationCapabilities struct +type MSFT_ReplicationCapabilities struct { + *MSFT_StorageObject + + // + DefaultRecoveryPointObjective uint32 + + // + SupportedAsynchronousActions []uint16 + + // + SupportedLogVolumeFeatures []uint16 + + // + SupportedMaximumLogSize uint64 + + // + SupportedMinimumLogSize uint64 + + // + SupportedObjectTypes []uint16 + + // + SupportedReplicatedPartitionFeatures []uint16 + + // + SupportedReplicationTypes []uint16 + + // + SupportedSynchronousActions []uint16 + + // + SupportsCreateReplicationRelationshipMethod bool + + // + SupportsEmptyReplicationGroup bool + + // + SupportsFullDiscovery bool + + // + SupportsReplicationGroup bool +} + +func NewMSFT_ReplicationCapabilitiesEx1(instance *cim.WmiInstance) (newInstance *MSFT_ReplicationCapabilities, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_ReplicationCapabilities{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_ReplicationCapabilitiesEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_ReplicationCapabilities, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_ReplicationCapabilities{ + MSFT_StorageObject: tmp, + } + return +} + +// SetDefaultRecoveryPointObjective sets the value of DefaultRecoveryPointObjective for the instance +func (instance *MSFT_ReplicationCapabilities) SetPropertyDefaultRecoveryPointObjective(value uint32) (err error) { + return instance.SetProperty("DefaultRecoveryPointObjective", (value)) +} + +// GetDefaultRecoveryPointObjective gets the value of DefaultRecoveryPointObjective for the instance +func (instance *MSFT_ReplicationCapabilities) GetPropertyDefaultRecoveryPointObjective() (value uint32, err error) { + retValue, err := instance.GetProperty("DefaultRecoveryPointObjective") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetSupportedAsynchronousActions sets the value of SupportedAsynchronousActions for the instance +func (instance *MSFT_ReplicationCapabilities) SetPropertySupportedAsynchronousActions(value []uint16) (err error) { + return instance.SetProperty("SupportedAsynchronousActions", (value)) +} + +// GetSupportedAsynchronousActions gets the value of SupportedAsynchronousActions for the instance +func (instance *MSFT_ReplicationCapabilities) GetPropertySupportedAsynchronousActions() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedAsynchronousActions") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSupportedLogVolumeFeatures sets the value of SupportedLogVolumeFeatures for the instance +func (instance *MSFT_ReplicationCapabilities) SetPropertySupportedLogVolumeFeatures(value []uint16) (err error) { + return instance.SetProperty("SupportedLogVolumeFeatures", (value)) +} + +// GetSupportedLogVolumeFeatures gets the value of SupportedLogVolumeFeatures for the instance +func (instance *MSFT_ReplicationCapabilities) GetPropertySupportedLogVolumeFeatures() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedLogVolumeFeatures") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSupportedMaximumLogSize sets the value of SupportedMaximumLogSize for the instance +func (instance *MSFT_ReplicationCapabilities) SetPropertySupportedMaximumLogSize(value uint64) (err error) { + return instance.SetProperty("SupportedMaximumLogSize", (value)) +} + +// GetSupportedMaximumLogSize gets the value of SupportedMaximumLogSize for the instance +func (instance *MSFT_ReplicationCapabilities) GetPropertySupportedMaximumLogSize() (value uint64, err error) { + retValue, err := instance.GetProperty("SupportedMaximumLogSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetSupportedMinimumLogSize sets the value of SupportedMinimumLogSize for the instance +func (instance *MSFT_ReplicationCapabilities) SetPropertySupportedMinimumLogSize(value uint64) (err error) { + return instance.SetProperty("SupportedMinimumLogSize", (value)) +} + +// GetSupportedMinimumLogSize gets the value of SupportedMinimumLogSize for the instance +func (instance *MSFT_ReplicationCapabilities) GetPropertySupportedMinimumLogSize() (value uint64, err error) { + retValue, err := instance.GetProperty("SupportedMinimumLogSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetSupportedObjectTypes sets the value of SupportedObjectTypes for the instance +func (instance *MSFT_ReplicationCapabilities) SetPropertySupportedObjectTypes(value []uint16) (err error) { + return instance.SetProperty("SupportedObjectTypes", (value)) +} + +// GetSupportedObjectTypes gets the value of SupportedObjectTypes for the instance +func (instance *MSFT_ReplicationCapabilities) GetPropertySupportedObjectTypes() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedObjectTypes") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSupportedReplicatedPartitionFeatures sets the value of SupportedReplicatedPartitionFeatures for the instance +func (instance *MSFT_ReplicationCapabilities) SetPropertySupportedReplicatedPartitionFeatures(value []uint16) (err error) { + return instance.SetProperty("SupportedReplicatedPartitionFeatures", (value)) +} + +// GetSupportedReplicatedPartitionFeatures gets the value of SupportedReplicatedPartitionFeatures for the instance +func (instance *MSFT_ReplicationCapabilities) GetPropertySupportedReplicatedPartitionFeatures() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedReplicatedPartitionFeatures") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSupportedReplicationTypes sets the value of SupportedReplicationTypes for the instance +func (instance *MSFT_ReplicationCapabilities) SetPropertySupportedReplicationTypes(value []uint16) (err error) { + return instance.SetProperty("SupportedReplicationTypes", (value)) +} + +// GetSupportedReplicationTypes gets the value of SupportedReplicationTypes for the instance +func (instance *MSFT_ReplicationCapabilities) GetPropertySupportedReplicationTypes() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedReplicationTypes") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSupportedSynchronousActions sets the value of SupportedSynchronousActions for the instance +func (instance *MSFT_ReplicationCapabilities) SetPropertySupportedSynchronousActions(value []uint16) (err error) { + return instance.SetProperty("SupportedSynchronousActions", (value)) +} + +// GetSupportedSynchronousActions gets the value of SupportedSynchronousActions for the instance +func (instance *MSFT_ReplicationCapabilities) GetPropertySupportedSynchronousActions() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedSynchronousActions") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSupportsCreateReplicationRelationshipMethod sets the value of SupportsCreateReplicationRelationshipMethod for the instance +func (instance *MSFT_ReplicationCapabilities) SetPropertySupportsCreateReplicationRelationshipMethod(value bool) (err error) { + return instance.SetProperty("SupportsCreateReplicationRelationshipMethod", (value)) +} + +// GetSupportsCreateReplicationRelationshipMethod gets the value of SupportsCreateReplicationRelationshipMethod for the instance +func (instance *MSFT_ReplicationCapabilities) GetPropertySupportsCreateReplicationRelationshipMethod() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsCreateReplicationRelationshipMethod") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsEmptyReplicationGroup sets the value of SupportsEmptyReplicationGroup for the instance +func (instance *MSFT_ReplicationCapabilities) SetPropertySupportsEmptyReplicationGroup(value bool) (err error) { + return instance.SetProperty("SupportsEmptyReplicationGroup", (value)) +} + +// GetSupportsEmptyReplicationGroup gets the value of SupportsEmptyReplicationGroup for the instance +func (instance *MSFT_ReplicationCapabilities) GetPropertySupportsEmptyReplicationGroup() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsEmptyReplicationGroup") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsFullDiscovery sets the value of SupportsFullDiscovery for the instance +func (instance *MSFT_ReplicationCapabilities) SetPropertySupportsFullDiscovery(value bool) (err error) { + return instance.SetProperty("SupportsFullDiscovery", (value)) +} + +// GetSupportsFullDiscovery gets the value of SupportsFullDiscovery for the instance +func (instance *MSFT_ReplicationCapabilities) GetPropertySupportsFullDiscovery() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsFullDiscovery") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsReplicationGroup sets the value of SupportsReplicationGroup for the instance +func (instance *MSFT_ReplicationCapabilities) SetPropertySupportsReplicationGroup(value bool) (err error) { + return instance.SetProperty("SupportsReplicationGroup", (value)) +} + +// GetSupportsReplicationGroup gets the value of SupportsReplicationGroup for the instance +func (instance *MSFT_ReplicationCapabilities) GetPropertySupportsReplicationGroup() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsReplicationGroup") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// + +// + +// +// +// +func (instance *MSFT_ReplicationCapabilities) GetSupportedOperations( /* IN */ ReplicationType uint16, + /* OUT */ SupportedOperations []uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSupportedOperations", ReplicationType) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_ReplicationCapabilities) GetSupportedGroupOperations( /* IN */ ReplicationType uint16, + /* OUT */ SupportedGroupOperations []uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSupportedGroupOperations", ReplicationType) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_ReplicationCapabilities) GetSupportedFeatures( /* IN */ ReplicationType uint16, + /* OUT */ Features []uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSupportedFeatures", ReplicationType) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_ReplicationCapabilities) GetSupportedGroupFeatures( /* IN */ ReplicationType uint16, + /* OUT */ GroupFeatures []uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSupportedGroupFeatures", ReplicationType) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_ReplicationCapabilities) GetSupportedCopyStates( /* IN */ ReplicationType uint16, + /* OUT */ SupportedCopyStates []uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSupportedCopyStates", ReplicationType) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_ReplicationCapabilities) GetSupportedGroupCopyStates( /* IN */ ReplicationType uint16, + /* OUT */ SupportedCopyStates []uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSupportedGroupCopyStates", ReplicationType) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +// +// +func (instance *MSFT_ReplicationCapabilities) GetRecoveryPointData( /* IN */ ReplicationType uint16, + /* OUT */ DefaultRecoveryPoint uint32, + /* OUT */ RecoveryPointValues []uint32, + /* OUT */ RecoveryPointIndicator uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetRecoveryPointData", ReplicationType) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroup.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroup.go new file mode 100644 index 000000000..857bd37ee --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroup.go @@ -0,0 +1,341 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_ReplicationGroup struct +type MSFT_ReplicationGroup struct { + *MSFT_StorageObject + + // + Description string + + // + FriendlyName string + + // + HealthStatus uint16 + + // + OperationalStatus []uint16 +} + +func NewMSFT_ReplicationGroupEx1(instance *cim.WmiInstance) (newInstance *MSFT_ReplicationGroup, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_ReplicationGroup{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_ReplicationGroupEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_ReplicationGroup, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_ReplicationGroup{ + MSFT_StorageObject: tmp, + } + return +} + +// SetDescription sets the value of Description for the instance +func (instance *MSFT_ReplicationGroup) SetPropertyDescription(value string) (err error) { + return instance.SetProperty("Description", (value)) +} + +// GetDescription gets the value of Description for the instance +func (instance *MSFT_ReplicationGroup) GetPropertyDescription() (value string, err error) { + retValue, err := instance.GetProperty("Description") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFriendlyName sets the value of FriendlyName for the instance +func (instance *MSFT_ReplicationGroup) SetPropertyFriendlyName(value string) (err error) { + return instance.SetProperty("FriendlyName", (value)) +} + +// GetFriendlyName gets the value of FriendlyName for the instance +func (instance *MSFT_ReplicationGroup) GetPropertyFriendlyName() (value string, err error) { + retValue, err := instance.GetProperty("FriendlyName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetHealthStatus sets the value of HealthStatus for the instance +func (instance *MSFT_ReplicationGroup) SetPropertyHealthStatus(value uint16) (err error) { + return instance.SetProperty("HealthStatus", (value)) +} + +// GetHealthStatus gets the value of HealthStatus for the instance +func (instance *MSFT_ReplicationGroup) GetPropertyHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("HealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_ReplicationGroup) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_ReplicationGroup) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// + +// +// +// +// +// +// +// +// + +// +// +// +// +func (instance *MSFT_ReplicationGroup) CreateReplica( /* IN */ FriendlyName string, + /* IN */ TargetStorageSubsystem MSFT_ReplicaPeer, + /* IN */ TargetGroupObjectId string, + /* IN */ TargetStoragePoolObjectId string, + /* IN */ RecoveryPointObjective uint32, + /* IN */ ReplicationSettings MSFT_ReplicationSettings, + /* IN */ SyncType uint16, + /* IN */ RunAsJob bool, + /* OUT */ CreatedReplicaPeer MSFT_ReplicaPeer, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateReplica", FriendlyName, TargetStorageSubsystem, TargetGroupObjectId, TargetStoragePoolObjectId, RecoveryPointObjective, ReplicationSettings, SyncType, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// + +// +// +// +func (instance *MSFT_ReplicationGroup) SetReplicationRelationship( /* IN */ Operation uint16, + /* IN */ TargetGroup MSFT_ReplicaPeer, + /* IN */ SourceStorageObjects []MSFT_StorageObject, + /* IN */ TargetStorageObjects []MSFT_StorageObject, + /* IN */ SyncPairs []MSFT_Synchronized, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetReplicationRelationship", Operation, TargetGroup, SourceStorageObjects, TargetStorageObjects, SyncPairs, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_ReplicationGroup) SetReplicationSettings( /* IN */ ReplicationSettings MSFT_ReplicationSettings, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetReplicationSettings", ReplicationSettings) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_ReplicationGroup) GetReplicationSettings( /* OUT */ ReplicationSettings MSFT_ReplicationSettings, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetReplicationSettings") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_ReplicationGroup) AddMember( /* IN */ StorageObjects []MSFT_StorageObject, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("AddMember", StorageObjects) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_ReplicationGroup) RemoveMember( /* IN */ StorageObjects []MSFT_StorageObject, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RemoveMember", StorageObjects) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_ReplicationGroup) SetFriendlyName( /* IN */ FriendlyName string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetFriendlyName", FriendlyName) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_ReplicationGroup) DeleteObject( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("DeleteObject") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroupToPartition.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroupToPartition.go new file mode 100644 index 000000000..a58591b83 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroupToPartition.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_ReplicationGroupToPartition struct +type MSFT_ReplicationGroupToPartition struct { + *cim.WmiInstance + + // + Partition MSFT_Partition + + // + ReplicationGroup MSFT_ReplicationGroup +} + +func NewMSFT_ReplicationGroupToPartitionEx1(instance *cim.WmiInstance) (newInstance *MSFT_ReplicationGroupToPartition, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_ReplicationGroupToPartition{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_ReplicationGroupToPartitionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_ReplicationGroupToPartition, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_ReplicationGroupToPartition{ + WmiInstance: tmp, + } + return +} + +// SetPartition sets the value of Partition for the instance +func (instance *MSFT_ReplicationGroupToPartition) SetPropertyPartition(value MSFT_Partition) (err error) { + return instance.SetProperty("Partition", (value)) +} + +// GetPartition gets the value of Partition for the instance +func (instance *MSFT_ReplicationGroupToPartition) GetPropertyPartition() (value MSFT_Partition, err error) { + retValue, err := instance.GetProperty("Partition") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Partition) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Partition is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Partition(valuetmp) + + return +} + +// SetReplicationGroup sets the value of ReplicationGroup for the instance +func (instance *MSFT_ReplicationGroupToPartition) SetPropertyReplicationGroup(value MSFT_ReplicationGroup) (err error) { + return instance.SetProperty("ReplicationGroup", (value)) +} + +// GetReplicationGroup gets the value of ReplicationGroup for the instance +func (instance *MSFT_ReplicationGroupToPartition) GetPropertyReplicationGroup() (value MSFT_ReplicationGroup, err error) { + retValue, err := instance.GetProperty("ReplicationGroup") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_ReplicationGroup) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_ReplicationGroup is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_ReplicationGroup(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroupToReplicaPeer.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroupToReplicaPeer.go new file mode 100644 index 000000000..3a316a0b7 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroupToReplicaPeer.go @@ -0,0 +1,170 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_ReplicationGroupToReplicaPeer struct +type MSFT_ReplicationGroupToReplicaPeer struct { + *MSFT_Synchronized + + // + ConsistencyState uint16 + + // + ConsistencyType uint16 + + // + ReplicaPeer MSFT_ReplicaPeer + + // + ReplicationGroup MSFT_ReplicationGroup +} + +func NewMSFT_ReplicationGroupToReplicaPeerEx1(instance *cim.WmiInstance) (newInstance *MSFT_ReplicationGroupToReplicaPeer, err error) { + tmp, err := NewMSFT_SynchronizedEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_ReplicationGroupToReplicaPeer{ + MSFT_Synchronized: tmp, + } + return +} + +func NewMSFT_ReplicationGroupToReplicaPeerEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_ReplicationGroupToReplicaPeer, err error) { + tmp, err := NewMSFT_SynchronizedEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_ReplicationGroupToReplicaPeer{ + MSFT_Synchronized: tmp, + } + return +} + +// SetConsistencyState sets the value of ConsistencyState for the instance +func (instance *MSFT_ReplicationGroupToReplicaPeer) SetPropertyConsistencyState(value uint16) (err error) { + return instance.SetProperty("ConsistencyState", (value)) +} + +// GetConsistencyState gets the value of ConsistencyState for the instance +func (instance *MSFT_ReplicationGroupToReplicaPeer) GetPropertyConsistencyState() (value uint16, err error) { + retValue, err := instance.GetProperty("ConsistencyState") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetConsistencyType sets the value of ConsistencyType for the instance +func (instance *MSFT_ReplicationGroupToReplicaPeer) SetPropertyConsistencyType(value uint16) (err error) { + return instance.SetProperty("ConsistencyType", (value)) +} + +// GetConsistencyType gets the value of ConsistencyType for the instance +func (instance *MSFT_ReplicationGroupToReplicaPeer) GetPropertyConsistencyType() (value uint16, err error) { + retValue, err := instance.GetProperty("ConsistencyType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetReplicaPeer sets the value of ReplicaPeer for the instance +func (instance *MSFT_ReplicationGroupToReplicaPeer) SetPropertyReplicaPeer(value MSFT_ReplicaPeer) (err error) { + return instance.SetProperty("ReplicaPeer", (value)) +} + +// GetReplicaPeer gets the value of ReplicaPeer for the instance +func (instance *MSFT_ReplicationGroupToReplicaPeer) GetPropertyReplicaPeer() (value MSFT_ReplicaPeer, err error) { + retValue, err := instance.GetProperty("ReplicaPeer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_ReplicaPeer) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_ReplicaPeer is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_ReplicaPeer(valuetmp) + + return +} + +// SetReplicationGroup sets the value of ReplicationGroup for the instance +func (instance *MSFT_ReplicationGroupToReplicaPeer) SetPropertyReplicationGroup(value MSFT_ReplicationGroup) (err error) { + return instance.SetProperty("ReplicationGroup", (value)) +} + +// GetReplicationGroup gets the value of ReplicationGroup for the instance +func (instance *MSFT_ReplicationGroupToReplicaPeer) GetPropertyReplicationGroup() (value MSFT_ReplicationGroup, err error) { + retValue, err := instance.GetProperty("ReplicationGroup") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_ReplicationGroup) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_ReplicationGroup is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_ReplicationGroup(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroupToVirtualDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroupToVirtualDisk.go new file mode 100644 index 000000000..f30365bd9 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationGroupToVirtualDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_ReplicationGroupToVirtualDisk struct +type MSFT_ReplicationGroupToVirtualDisk struct { + *cim.WmiInstance + + // + ReplicationGroup MSFT_ReplicationGroup + + // + VirtualDisk MSFT_VirtualDisk +} + +func NewMSFT_ReplicationGroupToVirtualDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_ReplicationGroupToVirtualDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_ReplicationGroupToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_ReplicationGroupToVirtualDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_ReplicationGroupToVirtualDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_ReplicationGroupToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +// SetReplicationGroup sets the value of ReplicationGroup for the instance +func (instance *MSFT_ReplicationGroupToVirtualDisk) SetPropertyReplicationGroup(value MSFT_ReplicationGroup) (err error) { + return instance.SetProperty("ReplicationGroup", (value)) +} + +// GetReplicationGroup gets the value of ReplicationGroup for the instance +func (instance *MSFT_ReplicationGroupToVirtualDisk) GetPropertyReplicationGroup() (value MSFT_ReplicationGroup, err error) { + retValue, err := instance.GetProperty("ReplicationGroup") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_ReplicationGroup) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_ReplicationGroup is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_ReplicationGroup(valuetmp) + + return +} + +// SetVirtualDisk sets the value of VirtualDisk for the instance +func (instance *MSFT_ReplicationGroupToVirtualDisk) SetPropertyVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("VirtualDisk", (value)) +} + +// GetVirtualDisk gets the value of VirtualDisk for the instance +func (instance *MSFT_ReplicationGroupToVirtualDisk) GetPropertyVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("VirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationSettings.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationSettings.go new file mode 100644 index 000000000..bb1ee8568 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ReplicationSettings.go @@ -0,0 +1,232 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_ReplicationSettings struct +type MSFT_ReplicationSettings struct { + *cim.WmiInstance + + // + LogDevices []MSFT_Volume + + // + LogSizeInBytes uint64 + + // + ReplicationQuorum uint16 + + // + SyncMode uint16 + + // + TargetElementSupplier uint16 + + // + ThinProvisioningPolicy uint16 +} + +func NewMSFT_ReplicationSettingsEx1(instance *cim.WmiInstance) (newInstance *MSFT_ReplicationSettings, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_ReplicationSettings{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_ReplicationSettingsEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_ReplicationSettings, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_ReplicationSettings{ + WmiInstance: tmp, + } + return +} + +// SetLogDevices sets the value of LogDevices for the instance +func (instance *MSFT_ReplicationSettings) SetPropertyLogDevices(value []MSFT_Volume) (err error) { + return instance.SetProperty("LogDevices", (value)) +} + +// GetLogDevices gets the value of LogDevices for the instance +func (instance *MSFT_ReplicationSettings) GetPropertyLogDevices() (value []MSFT_Volume, err error) { + retValue, err := instance.GetProperty("LogDevices") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(MSFT_Volume) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Volume is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, MSFT_Volume(valuetmp)) + } + + return +} + +// SetLogSizeInBytes sets the value of LogSizeInBytes for the instance +func (instance *MSFT_ReplicationSettings) SetPropertyLogSizeInBytes(value uint64) (err error) { + return instance.SetProperty("LogSizeInBytes", (value)) +} + +// GetLogSizeInBytes gets the value of LogSizeInBytes for the instance +func (instance *MSFT_ReplicationSettings) GetPropertyLogSizeInBytes() (value uint64, err error) { + retValue, err := instance.GetProperty("LogSizeInBytes") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetReplicationQuorum sets the value of ReplicationQuorum for the instance +func (instance *MSFT_ReplicationSettings) SetPropertyReplicationQuorum(value uint16) (err error) { + return instance.SetProperty("ReplicationQuorum", (value)) +} + +// GetReplicationQuorum gets the value of ReplicationQuorum for the instance +func (instance *MSFT_ReplicationSettings) GetPropertyReplicationQuorum() (value uint16, err error) { + retValue, err := instance.GetProperty("ReplicationQuorum") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSyncMode sets the value of SyncMode for the instance +func (instance *MSFT_ReplicationSettings) SetPropertySyncMode(value uint16) (err error) { + return instance.SetProperty("SyncMode", (value)) +} + +// GetSyncMode gets the value of SyncMode for the instance +func (instance *MSFT_ReplicationSettings) GetPropertySyncMode() (value uint16, err error) { + retValue, err := instance.GetProperty("SyncMode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetTargetElementSupplier sets the value of TargetElementSupplier for the instance +func (instance *MSFT_ReplicationSettings) SetPropertyTargetElementSupplier(value uint16) (err error) { + return instance.SetProperty("TargetElementSupplier", (value)) +} + +// GetTargetElementSupplier gets the value of TargetElementSupplier for the instance +func (instance *MSFT_ReplicationSettings) GetPropertyTargetElementSupplier() (value uint16, err error) { + retValue, err := instance.GetProperty("TargetElementSupplier") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetThinProvisioningPolicy sets the value of ThinProvisioningPolicy for the instance +func (instance *MSFT_ReplicationSettings) SetPropertyThinProvisioningPolicy(value uint16) (err error) { + return instance.SetProperty("ThinProvisioningPolicy", (value)) +} + +// GetThinProvisioningPolicy gets the value of ThinProvisioningPolicy for the instance +func (instance *MSFT_ReplicationSettings) GetPropertyThinProvisioningPolicy() (value uint16, err error) { + retValue, err := instance.GetProperty("ThinProvisioningPolicy") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ResiliencySetting.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ResiliencySetting.go new file mode 100644 index 000000000..971e200ce --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_ResiliencySetting.go @@ -0,0 +1,648 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_ResiliencySetting struct +type MSFT_ResiliencySetting struct { + *MSFT_StorageObject + + // + Description string + + // + InterleaveDefault uint64 + + // + InterleaveMax uint64 + + // + InterleaveMin uint64 + + // + Name string + + // + NumberOfColumnsDefault uint16 + + // + NumberOfColumnsMax uint16 + + // + NumberOfColumnsMin uint16 + + // + NumberOfDataCopiesDefault uint16 + + // + NumberOfDataCopiesMax uint16 + + // + NumberOfDataCopiesMin uint16 + + // + NumberOfGroupsDefault uint16 + + // + NumberOfGroupsMax uint16 + + // + NumberOfGroupsMin uint16 + + // + ParityLayout uint16 + + // + PhysicalDiskRedundancyDefault uint16 + + // + PhysicalDiskRedundancyMax uint16 + + // + PhysicalDiskRedundancyMin uint16 + + // + RequestNoSinglePointOfFailure bool +} + +func NewMSFT_ResiliencySettingEx1(instance *cim.WmiInstance) (newInstance *MSFT_ResiliencySetting, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_ResiliencySetting{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_ResiliencySettingEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_ResiliencySetting, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_ResiliencySetting{ + MSFT_StorageObject: tmp, + } + return +} + +// SetDescription sets the value of Description for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyDescription(value string) (err error) { + return instance.SetProperty("Description", (value)) +} + +// GetDescription gets the value of Description for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyDescription() (value string, err error) { + retValue, err := instance.GetProperty("Description") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInterleaveDefault sets the value of InterleaveDefault for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyInterleaveDefault(value uint64) (err error) { + return instance.SetProperty("InterleaveDefault", (value)) +} + +// GetInterleaveDefault gets the value of InterleaveDefault for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyInterleaveDefault() (value uint64, err error) { + retValue, err := instance.GetProperty("InterleaveDefault") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetInterleaveMax sets the value of InterleaveMax for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyInterleaveMax(value uint64) (err error) { + return instance.SetProperty("InterleaveMax", (value)) +} + +// GetInterleaveMax gets the value of InterleaveMax for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyInterleaveMax() (value uint64, err error) { + retValue, err := instance.GetProperty("InterleaveMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetInterleaveMin sets the value of InterleaveMin for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyInterleaveMin(value uint64) (err error) { + return instance.SetProperty("InterleaveMin", (value)) +} + +// GetInterleaveMin gets the value of InterleaveMin for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyInterleaveMin() (value uint64, err error) { + retValue, err := instance.GetProperty("InterleaveMin") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetName sets the value of Name for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetNumberOfColumnsDefault sets the value of NumberOfColumnsDefault for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyNumberOfColumnsDefault(value uint16) (err error) { + return instance.SetProperty("NumberOfColumnsDefault", (value)) +} + +// GetNumberOfColumnsDefault gets the value of NumberOfColumnsDefault for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyNumberOfColumnsDefault() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfColumnsDefault") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfColumnsMax sets the value of NumberOfColumnsMax for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyNumberOfColumnsMax(value uint16) (err error) { + return instance.SetProperty("NumberOfColumnsMax", (value)) +} + +// GetNumberOfColumnsMax gets the value of NumberOfColumnsMax for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyNumberOfColumnsMax() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfColumnsMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfColumnsMin sets the value of NumberOfColumnsMin for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyNumberOfColumnsMin(value uint16) (err error) { + return instance.SetProperty("NumberOfColumnsMin", (value)) +} + +// GetNumberOfColumnsMin gets the value of NumberOfColumnsMin for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyNumberOfColumnsMin() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfColumnsMin") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfDataCopiesDefault sets the value of NumberOfDataCopiesDefault for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyNumberOfDataCopiesDefault(value uint16) (err error) { + return instance.SetProperty("NumberOfDataCopiesDefault", (value)) +} + +// GetNumberOfDataCopiesDefault gets the value of NumberOfDataCopiesDefault for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyNumberOfDataCopiesDefault() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfDataCopiesDefault") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfDataCopiesMax sets the value of NumberOfDataCopiesMax for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyNumberOfDataCopiesMax(value uint16) (err error) { + return instance.SetProperty("NumberOfDataCopiesMax", (value)) +} + +// GetNumberOfDataCopiesMax gets the value of NumberOfDataCopiesMax for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyNumberOfDataCopiesMax() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfDataCopiesMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfDataCopiesMin sets the value of NumberOfDataCopiesMin for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyNumberOfDataCopiesMin(value uint16) (err error) { + return instance.SetProperty("NumberOfDataCopiesMin", (value)) +} + +// GetNumberOfDataCopiesMin gets the value of NumberOfDataCopiesMin for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyNumberOfDataCopiesMin() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfDataCopiesMin") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfGroupsDefault sets the value of NumberOfGroupsDefault for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyNumberOfGroupsDefault(value uint16) (err error) { + return instance.SetProperty("NumberOfGroupsDefault", (value)) +} + +// GetNumberOfGroupsDefault gets the value of NumberOfGroupsDefault for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyNumberOfGroupsDefault() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfGroupsDefault") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfGroupsMax sets the value of NumberOfGroupsMax for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyNumberOfGroupsMax(value uint16) (err error) { + return instance.SetProperty("NumberOfGroupsMax", (value)) +} + +// GetNumberOfGroupsMax gets the value of NumberOfGroupsMax for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyNumberOfGroupsMax() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfGroupsMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfGroupsMin sets the value of NumberOfGroupsMin for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyNumberOfGroupsMin(value uint16) (err error) { + return instance.SetProperty("NumberOfGroupsMin", (value)) +} + +// GetNumberOfGroupsMin gets the value of NumberOfGroupsMin for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyNumberOfGroupsMin() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfGroupsMin") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetParityLayout sets the value of ParityLayout for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyParityLayout(value uint16) (err error) { + return instance.SetProperty("ParityLayout", (value)) +} + +// GetParityLayout gets the value of ParityLayout for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyParityLayout() (value uint16, err error) { + retValue, err := instance.GetProperty("ParityLayout") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetPhysicalDiskRedundancyDefault sets the value of PhysicalDiskRedundancyDefault for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyPhysicalDiskRedundancyDefault(value uint16) (err error) { + return instance.SetProperty("PhysicalDiskRedundancyDefault", (value)) +} + +// GetPhysicalDiskRedundancyDefault gets the value of PhysicalDiskRedundancyDefault for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyPhysicalDiskRedundancyDefault() (value uint16, err error) { + retValue, err := instance.GetProperty("PhysicalDiskRedundancyDefault") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetPhysicalDiskRedundancyMax sets the value of PhysicalDiskRedundancyMax for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyPhysicalDiskRedundancyMax(value uint16) (err error) { + return instance.SetProperty("PhysicalDiskRedundancyMax", (value)) +} + +// GetPhysicalDiskRedundancyMax gets the value of PhysicalDiskRedundancyMax for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyPhysicalDiskRedundancyMax() (value uint16, err error) { + retValue, err := instance.GetProperty("PhysicalDiskRedundancyMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetPhysicalDiskRedundancyMin sets the value of PhysicalDiskRedundancyMin for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyPhysicalDiskRedundancyMin(value uint16) (err error) { + return instance.SetProperty("PhysicalDiskRedundancyMin", (value)) +} + +// GetPhysicalDiskRedundancyMin gets the value of PhysicalDiskRedundancyMin for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyPhysicalDiskRedundancyMin() (value uint16, err error) { + retValue, err := instance.GetProperty("PhysicalDiskRedundancyMin") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetRequestNoSinglePointOfFailure sets the value of RequestNoSinglePointOfFailure for the instance +func (instance *MSFT_ResiliencySetting) SetPropertyRequestNoSinglePointOfFailure(value bool) (err error) { + return instance.SetProperty("RequestNoSinglePointOfFailure", (value)) +} + +// GetRequestNoSinglePointOfFailure gets the value of RequestNoSinglePointOfFailure for the instance +func (instance *MSFT_ResiliencySetting) GetPropertyRequestNoSinglePointOfFailure() (value bool, err error) { + retValue, err := instance.GetProperty("RequestNoSinglePointOfFailure") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// + +// +// +// +// +// +// + +// +// +func (instance *MSFT_ResiliencySetting) SetDefaults( /* IN */ NumberOfDataCopiesDefault uint16, + /* IN */ PhysicalDiskRedundancyDefault uint16, + /* IN */ NumberOfColumnsDefault uint16, + /* IN */ AutoNumberOfColumns bool, + /* IN */ InterleaveDefault uint64, + /* IN */ NumberOfGroupsDefault uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetDefaults", NumberOfDataCopiesDefault, PhysicalDiskRedundancyDefault, NumberOfColumnsDefault, AutoNumberOfColumns, InterleaveDefault, NumberOfGroupsDefault) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SBLTargetCacheConfiguration.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SBLTargetCacheConfiguration.go new file mode 100644 index 000000000..7b7b4ca73 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SBLTargetCacheConfiguration.go @@ -0,0 +1,752 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_SBLTargetCacheConfiguration struct +type MSFT_SBLTargetCacheConfiguration struct { + *cim.WmiInstance + + // + CacheBehavior uint64 + + // + CachePageSizeinKB uint32 + + // + CurrentCacheModeHDD uint32 + + // + CurrentCacheModeSSD uint32 + + // + CurrentState uint32 + + // + CurrentStateProgress uint64 + + // + CurrentStateProgressMax uint64 + + // + DesiredCacheModeHDD uint32 + + // + DesiredCacheModeSSD uint32 + + // + DesiredState uint32 + + // + FlashMetadataReserveBytes uint64 + + // + FlashReservePercent uint32 + + // + Identifier string + + // + ProvisioningStage uint64 + + // + ProvisioningStageMax uint64 + + // + SpacesDirectEnabled bool +} + +func NewMSFT_SBLTargetCacheConfigurationEx1(instance *cim.WmiInstance) (newInstance *MSFT_SBLTargetCacheConfiguration, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_SBLTargetCacheConfiguration{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_SBLTargetCacheConfigurationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_SBLTargetCacheConfiguration, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_SBLTargetCacheConfiguration{ + WmiInstance: tmp, + } + return +} + +// SetCacheBehavior sets the value of CacheBehavior for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyCacheBehavior(value uint64) (err error) { + return instance.SetProperty("CacheBehavior", (value)) +} + +// GetCacheBehavior gets the value of CacheBehavior for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyCacheBehavior() (value uint64, err error) { + retValue, err := instance.GetProperty("CacheBehavior") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetCachePageSizeinKB sets the value of CachePageSizeinKB for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyCachePageSizeinKB(value uint32) (err error) { + return instance.SetProperty("CachePageSizeinKB", (value)) +} + +// GetCachePageSizeinKB gets the value of CachePageSizeinKB for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyCachePageSizeinKB() (value uint32, err error) { + retValue, err := instance.GetProperty("CachePageSizeinKB") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetCurrentCacheModeHDD sets the value of CurrentCacheModeHDD for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyCurrentCacheModeHDD(value uint32) (err error) { + return instance.SetProperty("CurrentCacheModeHDD", (value)) +} + +// GetCurrentCacheModeHDD gets the value of CurrentCacheModeHDD for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyCurrentCacheModeHDD() (value uint32, err error) { + retValue, err := instance.GetProperty("CurrentCacheModeHDD") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetCurrentCacheModeSSD sets the value of CurrentCacheModeSSD for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyCurrentCacheModeSSD(value uint32) (err error) { + return instance.SetProperty("CurrentCacheModeSSD", (value)) +} + +// GetCurrentCacheModeSSD gets the value of CurrentCacheModeSSD for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyCurrentCacheModeSSD() (value uint32, err error) { + retValue, err := instance.GetProperty("CurrentCacheModeSSD") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetCurrentState sets the value of CurrentState for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyCurrentState(value uint32) (err error) { + return instance.SetProperty("CurrentState", (value)) +} + +// GetCurrentState gets the value of CurrentState for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyCurrentState() (value uint32, err error) { + retValue, err := instance.GetProperty("CurrentState") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetCurrentStateProgress sets the value of CurrentStateProgress for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyCurrentStateProgress(value uint64) (err error) { + return instance.SetProperty("CurrentStateProgress", (value)) +} + +// GetCurrentStateProgress gets the value of CurrentStateProgress for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyCurrentStateProgress() (value uint64, err error) { + retValue, err := instance.GetProperty("CurrentStateProgress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetCurrentStateProgressMax sets the value of CurrentStateProgressMax for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyCurrentStateProgressMax(value uint64) (err error) { + return instance.SetProperty("CurrentStateProgressMax", (value)) +} + +// GetCurrentStateProgressMax gets the value of CurrentStateProgressMax for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyCurrentStateProgressMax() (value uint64, err error) { + retValue, err := instance.GetProperty("CurrentStateProgressMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetDesiredCacheModeHDD sets the value of DesiredCacheModeHDD for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyDesiredCacheModeHDD(value uint32) (err error) { + return instance.SetProperty("DesiredCacheModeHDD", (value)) +} + +// GetDesiredCacheModeHDD gets the value of DesiredCacheModeHDD for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyDesiredCacheModeHDD() (value uint32, err error) { + retValue, err := instance.GetProperty("DesiredCacheModeHDD") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetDesiredCacheModeSSD sets the value of DesiredCacheModeSSD for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyDesiredCacheModeSSD(value uint32) (err error) { + return instance.SetProperty("DesiredCacheModeSSD", (value)) +} + +// GetDesiredCacheModeSSD gets the value of DesiredCacheModeSSD for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyDesiredCacheModeSSD() (value uint32, err error) { + retValue, err := instance.GetProperty("DesiredCacheModeSSD") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetDesiredState sets the value of DesiredState for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyDesiredState(value uint32) (err error) { + return instance.SetProperty("DesiredState", (value)) +} + +// GetDesiredState gets the value of DesiredState for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyDesiredState() (value uint32, err error) { + retValue, err := instance.GetProperty("DesiredState") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetFlashMetadataReserveBytes sets the value of FlashMetadataReserveBytes for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyFlashMetadataReserveBytes(value uint64) (err error) { + return instance.SetProperty("FlashMetadataReserveBytes", (value)) +} + +// GetFlashMetadataReserveBytes gets the value of FlashMetadataReserveBytes for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyFlashMetadataReserveBytes() (value uint64, err error) { + retValue, err := instance.GetProperty("FlashMetadataReserveBytes") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetFlashReservePercent sets the value of FlashReservePercent for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyFlashReservePercent(value uint32) (err error) { + return instance.SetProperty("FlashReservePercent", (value)) +} + +// GetFlashReservePercent gets the value of FlashReservePercent for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyFlashReservePercent() (value uint32, err error) { + retValue, err := instance.GetProperty("FlashReservePercent") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetIdentifier sets the value of Identifier for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyIdentifier(value string) (err error) { + return instance.SetProperty("Identifier", (value)) +} + +// GetIdentifier gets the value of Identifier for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyIdentifier() (value string, err error) { + retValue, err := instance.GetProperty("Identifier") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetProvisioningStage sets the value of ProvisioningStage for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyProvisioningStage(value uint64) (err error) { + return instance.SetProperty("ProvisioningStage", (value)) +} + +// GetProvisioningStage gets the value of ProvisioningStage for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyProvisioningStage() (value uint64, err error) { + retValue, err := instance.GetProperty("ProvisioningStage") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetProvisioningStageMax sets the value of ProvisioningStageMax for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertyProvisioningStageMax(value uint64) (err error) { + return instance.SetProperty("ProvisioningStageMax", (value)) +} + +// GetProvisioningStageMax gets the value of ProvisioningStageMax for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertyProvisioningStageMax() (value uint64, err error) { + retValue, err := instance.GetProperty("ProvisioningStageMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetSpacesDirectEnabled sets the value of SpacesDirectEnabled for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) SetPropertySpacesDirectEnabled(value bool) (err error) { + return instance.SetProperty("SpacesDirectEnabled", (value)) +} + +// GetSpacesDirectEnabled gets the value of SpacesDirectEnabled for the instance +func (instance *MSFT_SBLTargetCacheConfiguration) GetPropertySpacesDirectEnabled() (value bool, err error) { + retValue, err := instance.GetProperty("SpacesDirectEnabled") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// + +// +// +// +// +// +// +// +// +// + +// +func (instance *MSFT_SBLTargetCacheConfiguration) NotifyDisk( /* IN */ DiskGuid string, + /* IN */ PoolId string, + /* IN */ Name string, + /* IN */ Description string, + /* IN */ Manufacturer string, + /* IN */ ProductId string, + /* IN */ Serial string, + /* IN */ SlotNumber uint32, + /* IN */ EnclosureId string) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("NotifyDisk", DiskGuid, PoolId, Name, Description, Manufacturer, ProductId, Serial, SlotNumber, EnclosureId) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// +// +// + +// +func (instance *MSFT_SBLTargetCacheConfiguration) NotifyEnclosure( /* IN */ EnclosureGuid string, + /* IN */ Name string, + /* IN */ Description string, + /* IN */ Manufacturer string, + /* IN */ ProductId string, + /* IN */ Serial string) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("NotifyEnclosure", EnclosureGuid, Name, Description, Manufacturer, ProductId, Serial) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// + +// +func (instance *MSFT_SBLTargetCacheConfiguration) NotifyDiskStateChange( /* IN */ DiskGuid string, + /* IN */ StateChange uint32) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("NotifyDiskStateChange", DiskGuid, StateChange) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// + +// +func (instance *MSFT_SBLTargetCacheConfiguration) SetDiskUsage( /* IN */ DiskGuid string, + /* IN */ UseForStorageSpacesDirect uint32) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetDiskUsage", DiskGuid, UseForStorageSpacesDirect) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// + +// +func (instance *MSFT_SBLTargetCacheConfiguration) StartOptimize( /* IN */ Flags uint32) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("StartOptimize", Flags) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// + +// +func (instance *MSFT_SBLTargetCacheConfiguration) CheckSystemSupportsCacheState( /* IN */ CacheState uint32) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("CheckSystemSupportsCacheState", CacheState) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// + +// +func (instance *MSFT_SBLTargetCacheConfiguration) CheckDiskSupportsCacheState( /* IN */ DiskGuid string, + /* IN */ CacheState uint32) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("CheckDiskSupportsCacheState", DiskGuid, CacheState) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// + +// +// +// +// +func (instance *MSFT_SBLTargetCacheConfiguration) CheckAllDisksSupportCache( /* IN */ CacheState uint32, + /* OUT */ DiskGuids []string, + /* OUT */ DiskNumbers []uint32, + /* OUT */ SupportStatuses []uint32) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CheckAllDisksSupportCache", CacheState) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_SBLTargetCacheConfiguration) QueryBoundDevices( /* IN */ DiskGuid string, + /* OUT */ BoundDiskGuids []string) (result uint32, err error) { + retVal, err := instance.InvokeMethod("QueryBoundDevices", DiskGuid) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// + +// +func (instance *MSFT_SBLTargetCacheConfiguration) SetDiskCacheMode( /* IN */ DiskGuid string, + /* IN */ CacheMode uint32, + /* IN */ Flags uint32, + /* IN */ Originator uint32, + /* IN */ Force bool) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetDiskCacheMode", DiskGuid, CacheMode, Flags, Originator, Force) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// + +// +func (instance *MSFT_SBLTargetCacheConfiguration) SetDiskCacheHint( /* IN */ DiskGuid string, + /* IN */ CacheHint uint32, + /* IN */ Flags uint32, + /* IN */ Originator uint32) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetDiskCacheHint", DiskGuid, CacheHint, Flags, Originator) + if err != nil { + return + } + result = uint32(retVal) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SBLTargetDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SBLTargetDisk.go new file mode 100644 index 000000000..c2140f23f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SBLTargetDisk.go @@ -0,0 +1,471 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_SBLTargetDisk struct +type MSFT_SBLTargetDisk struct { + *cim.WmiInstance + + // + CacheMode uint32 + + // + CurrentUsage uint32 + + // + DesiredUsage uint32 + + // + DeviceNumber uint32 + + // + Identifier string + + // + IsFlash bool + + // + IsSblCacheDevice bool + + // + LastStateChangeTime string + + // + ReadMediaErrorCount uint64 + + // + ReadTotalErrorCount uint64 + + // + SblAttributes uint32 + + // + State uint32 + + // + WriteMediaErrorCount uint64 + + // + WriteTotalErrorCount uint64 +} + +func NewMSFT_SBLTargetDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_SBLTargetDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_SBLTargetDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_SBLTargetDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_SBLTargetDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_SBLTargetDisk{ + WmiInstance: tmp, + } + return +} + +// SetCacheMode sets the value of CacheMode for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertyCacheMode(value uint32) (err error) { + return instance.SetProperty("CacheMode", (value)) +} + +// GetCacheMode gets the value of CacheMode for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertyCacheMode() (value uint32, err error) { + retValue, err := instance.GetProperty("CacheMode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetCurrentUsage sets the value of CurrentUsage for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertyCurrentUsage(value uint32) (err error) { + return instance.SetProperty("CurrentUsage", (value)) +} + +// GetCurrentUsage gets the value of CurrentUsage for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertyCurrentUsage() (value uint32, err error) { + retValue, err := instance.GetProperty("CurrentUsage") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetDesiredUsage sets the value of DesiredUsage for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertyDesiredUsage(value uint32) (err error) { + return instance.SetProperty("DesiredUsage", (value)) +} + +// GetDesiredUsage gets the value of DesiredUsage for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertyDesiredUsage() (value uint32, err error) { + retValue, err := instance.GetProperty("DesiredUsage") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetDeviceNumber sets the value of DeviceNumber for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertyDeviceNumber(value uint32) (err error) { + return instance.SetProperty("DeviceNumber", (value)) +} + +// GetDeviceNumber gets the value of DeviceNumber for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertyDeviceNumber() (value uint32, err error) { + retValue, err := instance.GetProperty("DeviceNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetIdentifier sets the value of Identifier for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertyIdentifier(value string) (err error) { + return instance.SetProperty("Identifier", (value)) +} + +// GetIdentifier gets the value of Identifier for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertyIdentifier() (value string, err error) { + retValue, err := instance.GetProperty("Identifier") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetIsFlash sets the value of IsFlash for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertyIsFlash(value bool) (err error) { + return instance.SetProperty("IsFlash", (value)) +} + +// GetIsFlash gets the value of IsFlash for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertyIsFlash() (value bool, err error) { + retValue, err := instance.GetProperty("IsFlash") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsSblCacheDevice sets the value of IsSblCacheDevice for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertyIsSblCacheDevice(value bool) (err error) { + return instance.SetProperty("IsSblCacheDevice", (value)) +} + +// GetIsSblCacheDevice gets the value of IsSblCacheDevice for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertyIsSblCacheDevice() (value bool, err error) { + retValue, err := instance.GetProperty("IsSblCacheDevice") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetLastStateChangeTime sets the value of LastStateChangeTime for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertyLastStateChangeTime(value string) (err error) { + return instance.SetProperty("LastStateChangeTime", (value)) +} + +// GetLastStateChangeTime gets the value of LastStateChangeTime for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertyLastStateChangeTime() (value string, err error) { + retValue, err := instance.GetProperty("LastStateChangeTime") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetReadMediaErrorCount sets the value of ReadMediaErrorCount for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertyReadMediaErrorCount(value uint64) (err error) { + return instance.SetProperty("ReadMediaErrorCount", (value)) +} + +// GetReadMediaErrorCount gets the value of ReadMediaErrorCount for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertyReadMediaErrorCount() (value uint64, err error) { + retValue, err := instance.GetProperty("ReadMediaErrorCount") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetReadTotalErrorCount sets the value of ReadTotalErrorCount for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertyReadTotalErrorCount(value uint64) (err error) { + return instance.SetProperty("ReadTotalErrorCount", (value)) +} + +// GetReadTotalErrorCount gets the value of ReadTotalErrorCount for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertyReadTotalErrorCount() (value uint64, err error) { + retValue, err := instance.GetProperty("ReadTotalErrorCount") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetSblAttributes sets the value of SblAttributes for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertySblAttributes(value uint32) (err error) { + return instance.SetProperty("SblAttributes", (value)) +} + +// GetSblAttributes gets the value of SblAttributes for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertySblAttributes() (value uint32, err error) { + retValue, err := instance.GetProperty("SblAttributes") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetState sets the value of State for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertyState(value uint32) (err error) { + return instance.SetProperty("State", (value)) +} + +// GetState gets the value of State for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertyState() (value uint32, err error) { + retValue, err := instance.GetProperty("State") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetWriteMediaErrorCount sets the value of WriteMediaErrorCount for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertyWriteMediaErrorCount(value uint64) (err error) { + return instance.SetProperty("WriteMediaErrorCount", (value)) +} + +// GetWriteMediaErrorCount gets the value of WriteMediaErrorCount for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertyWriteMediaErrorCount() (value uint64, err error) { + retValue, err := instance.GetProperty("WriteMediaErrorCount") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetWriteTotalErrorCount sets the value of WriteTotalErrorCount for the instance +func (instance *MSFT_SBLTargetDisk) SetPropertyWriteTotalErrorCount(value uint64) (err error) { + return instance.SetProperty("WriteTotalErrorCount", (value)) +} + +// GetWriteTotalErrorCount gets the value of WriteTotalErrorCount for the instance +func (instance *MSFT_SBLTargetDisk) GetPropertyWriteTotalErrorCount() (value uint64, err error) { + retValue, err := instance.GetProperty("WriteTotalErrorCount") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError.go new file mode 100644 index 000000000..ea0a6f13e --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_SoftError struct +type MSFT_SoftError struct { + *CIM_Error +} + +func NewMSFT_SoftErrorEx1(instance *cim.WmiInstance) (newInstance *MSFT_SoftError, err error) { + tmp, err := NewCIM_ErrorEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_SoftError{ + CIM_Error: tmp, + } + return +} + +func NewMSFT_SoftErrorEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_SoftError, err error) { + tmp, err := NewCIM_ErrorEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_SoftError{ + CIM_Error: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_EmptyCache.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_EmptyCache.go new file mode 100644 index 000000000..c6080c862 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_EmptyCache.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_SoftError_EmptyCache struct +type MSFT_SoftError_EmptyCache struct { + *MSFT_SoftError +} + +func NewMSFT_SoftError_EmptyCacheEx1(instance *cim.WmiInstance) (newInstance *MSFT_SoftError_EmptyCache, err error) { + tmp, err := NewMSFT_SoftErrorEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_SoftError_EmptyCache{ + MSFT_SoftError: tmp, + } + return +} + +func NewMSFT_SoftError_EmptyCacheEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_SoftError_EmptyCache, err error) { + tmp, err := NewMSFT_SoftErrorEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_SoftError_EmptyCache{ + MSFT_SoftError: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_NotAuthenticated.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_NotAuthenticated.go new file mode 100644 index 000000000..de645a1dc --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_NotAuthenticated.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_SoftError_NotAuthenticated struct +type MSFT_SoftError_NotAuthenticated struct { + *MSFT_SoftError +} + +func NewMSFT_SoftError_NotAuthenticatedEx1(instance *cim.WmiInstance) (newInstance *MSFT_SoftError_NotAuthenticated, err error) { + tmp, err := NewMSFT_SoftErrorEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_SoftError_NotAuthenticated{ + MSFT_SoftError: tmp, + } + return +} + +func NewMSFT_SoftError_NotAuthenticatedEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_SoftError_NotAuthenticated, err error) { + tmp, err := NewMSFT_SoftErrorEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_SoftError_NotAuthenticated{ + MSFT_SoftError: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_NotInCache.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_NotInCache.go new file mode 100644 index 000000000..026c111fd --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_NotInCache.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_SoftError_NotInCache struct +type MSFT_SoftError_NotInCache struct { + *MSFT_SoftError +} + +func NewMSFT_SoftError_NotInCacheEx1(instance *cim.WmiInstance) (newInstance *MSFT_SoftError_NotInCache, err error) { + tmp, err := NewMSFT_SoftErrorEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_SoftError_NotInCache{ + MSFT_SoftError: tmp, + } + return +} + +func NewMSFT_SoftError_NotInCacheEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_SoftError_NotInCache, err error) { + tmp, err := NewMSFT_SoftErrorEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_SoftError_NotInCache{ + MSFT_SoftError: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_RelativePath.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_RelativePath.go new file mode 100644 index 000000000..badc71d14 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_SoftError_RelativePath.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_SoftError_RelativePath struct +type MSFT_SoftError_RelativePath struct { + *MSFT_SoftError +} + +func NewMSFT_SoftError_RelativePathEx1(instance *cim.WmiInstance) (newInstance *MSFT_SoftError_RelativePath, err error) { + tmp, err := NewMSFT_SoftErrorEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_SoftError_RelativePath{ + MSFT_SoftError: tmp, + } + return +} + +func NewMSFT_SoftError_RelativePathEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_SoftError_RelativePath, err error) { + tmp, err := NewMSFT_SoftErrorEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_SoftError_RelativePath{ + MSFT_SoftError: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageAlertEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageAlertEvent.go new file mode 100644 index 000000000..3b22d0f03 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageAlertEvent.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageAlertEvent struct +type MSFT_StorageAlertEvent struct { + *MSFT_StorageEvent + + // + AlertType uint16 +} + +func NewMSFT_StorageAlertEventEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageAlertEvent, err error) { + tmp, err := NewMSFT_StorageEventEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageAlertEvent{ + MSFT_StorageEvent: tmp, + } + return +} + +func NewMSFT_StorageAlertEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageAlertEvent, err error) { + tmp, err := NewMSFT_StorageEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageAlertEvent{ + MSFT_StorageEvent: tmp, + } + return +} + +// SetAlertType sets the value of AlertType for the instance +func (instance *MSFT_StorageAlertEvent) SetPropertyAlertType(value uint16) (err error) { + return instance.SetProperty("AlertType", (value)) +} + +// GetAlertType gets the value of AlertType for the instance +func (instance *MSFT_StorageAlertEvent) GetPropertyAlertType() (value uint16, err error) { + retValue, err := instance.GetProperty("AlertType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageArrivalEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageArrivalEvent.go new file mode 100644 index 000000000..c40db283a --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageArrivalEvent.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_StorageArrivalEvent struct +type MSFT_StorageArrivalEvent struct { + *MSFT_StorageEvent +} + +func NewMSFT_StorageArrivalEventEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageArrivalEvent, err error) { + tmp, err := NewMSFT_StorageEventEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageArrivalEvent{ + MSFT_StorageEvent: tmp, + } + return +} + +func NewMSFT_StorageArrivalEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageArrivalEvent, err error) { + tmp, err := NewMSFT_StorageEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageArrivalEvent{ + MSFT_StorageEvent: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageChassis.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageChassis.go new file mode 100644 index 000000000..16c164ee0 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageChassis.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_StorageChassis struct +type MSFT_StorageChassis struct { + *MSFT_StorageFaultDomain +} + +func NewMSFT_StorageChassisEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageChassis, err error) { + tmp, err := NewMSFT_StorageFaultDomainEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageChassis{ + MSFT_StorageFaultDomain: tmp, + } + return +} + +func NewMSFT_StorageChassisEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageChassis, err error) { + tmp, err := NewMSFT_StorageFaultDomainEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageChassis{ + MSFT_StorageFaultDomain: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageDepartureEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageDepartureEvent.go new file mode 100644 index 000000000..305d2c5ba --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageDepartureEvent.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_StorageDepartureEvent struct +type MSFT_StorageDepartureEvent struct { + *MSFT_StorageEvent +} + +func NewMSFT_StorageDepartureEventEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageDepartureEvent, err error) { + tmp, err := NewMSFT_StorageEventEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageDepartureEvent{ + MSFT_StorageEvent: tmp, + } + return +} + +func NewMSFT_StorageDepartureEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageDepartureEvent, err error) { + tmp, err := NewMSFT_StorageEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageDepartureEvent{ + MSFT_StorageEvent: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageDiagnoseResult.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageDiagnoseResult.go new file mode 100644 index 000000000..21e46aae8 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageDiagnoseResult.go @@ -0,0 +1,352 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageDiagnoseResult struct +type MSFT_StorageDiagnoseResult struct { + *cim.WmiInstance + + // + FaultId string + + // + FaultingObjectDescription string + + // + FaultingObjectLocation string + + // + FaultingObjectType string + + // + FaultingObjectUniqueId string + + // + FaultTime string + + // + FaultType string + + // + PerceivedSeverity uint16 + + // + Reason string + + // + RecommendedActions []string +} + +func NewMSFT_StorageDiagnoseResultEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageDiagnoseResult, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageDiagnoseResult{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageDiagnoseResultEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageDiagnoseResult, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageDiagnoseResult{ + WmiInstance: tmp, + } + return +} + +// SetFaultId sets the value of FaultId for the instance +func (instance *MSFT_StorageDiagnoseResult) SetPropertyFaultId(value string) (err error) { + return instance.SetProperty("FaultId", (value)) +} + +// GetFaultId gets the value of FaultId for the instance +func (instance *MSFT_StorageDiagnoseResult) GetPropertyFaultId() (value string, err error) { + retValue, err := instance.GetProperty("FaultId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFaultingObjectDescription sets the value of FaultingObjectDescription for the instance +func (instance *MSFT_StorageDiagnoseResult) SetPropertyFaultingObjectDescription(value string) (err error) { + return instance.SetProperty("FaultingObjectDescription", (value)) +} + +// GetFaultingObjectDescription gets the value of FaultingObjectDescription for the instance +func (instance *MSFT_StorageDiagnoseResult) GetPropertyFaultingObjectDescription() (value string, err error) { + retValue, err := instance.GetProperty("FaultingObjectDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFaultingObjectLocation sets the value of FaultingObjectLocation for the instance +func (instance *MSFT_StorageDiagnoseResult) SetPropertyFaultingObjectLocation(value string) (err error) { + return instance.SetProperty("FaultingObjectLocation", (value)) +} + +// GetFaultingObjectLocation gets the value of FaultingObjectLocation for the instance +func (instance *MSFT_StorageDiagnoseResult) GetPropertyFaultingObjectLocation() (value string, err error) { + retValue, err := instance.GetProperty("FaultingObjectLocation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFaultingObjectType sets the value of FaultingObjectType for the instance +func (instance *MSFT_StorageDiagnoseResult) SetPropertyFaultingObjectType(value string) (err error) { + return instance.SetProperty("FaultingObjectType", (value)) +} + +// GetFaultingObjectType gets the value of FaultingObjectType for the instance +func (instance *MSFT_StorageDiagnoseResult) GetPropertyFaultingObjectType() (value string, err error) { + retValue, err := instance.GetProperty("FaultingObjectType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFaultingObjectUniqueId sets the value of FaultingObjectUniqueId for the instance +func (instance *MSFT_StorageDiagnoseResult) SetPropertyFaultingObjectUniqueId(value string) (err error) { + return instance.SetProperty("FaultingObjectUniqueId", (value)) +} + +// GetFaultingObjectUniqueId gets the value of FaultingObjectUniqueId for the instance +func (instance *MSFT_StorageDiagnoseResult) GetPropertyFaultingObjectUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("FaultingObjectUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFaultTime sets the value of FaultTime for the instance +func (instance *MSFT_StorageDiagnoseResult) SetPropertyFaultTime(value string) (err error) { + return instance.SetProperty("FaultTime", (value)) +} + +// GetFaultTime gets the value of FaultTime for the instance +func (instance *MSFT_StorageDiagnoseResult) GetPropertyFaultTime() (value string, err error) { + retValue, err := instance.GetProperty("FaultTime") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFaultType sets the value of FaultType for the instance +func (instance *MSFT_StorageDiagnoseResult) SetPropertyFaultType(value string) (err error) { + return instance.SetProperty("FaultType", (value)) +} + +// GetFaultType gets the value of FaultType for the instance +func (instance *MSFT_StorageDiagnoseResult) GetPropertyFaultType() (value string, err error) { + retValue, err := instance.GetProperty("FaultType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPerceivedSeverity sets the value of PerceivedSeverity for the instance +func (instance *MSFT_StorageDiagnoseResult) SetPropertyPerceivedSeverity(value uint16) (err error) { + return instance.SetProperty("PerceivedSeverity", (value)) +} + +// GetPerceivedSeverity gets the value of PerceivedSeverity for the instance +func (instance *MSFT_StorageDiagnoseResult) GetPropertyPerceivedSeverity() (value uint16, err error) { + retValue, err := instance.GetProperty("PerceivedSeverity") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetReason sets the value of Reason for the instance +func (instance *MSFT_StorageDiagnoseResult) SetPropertyReason(value string) (err error) { + return instance.SetProperty("Reason", (value)) +} + +// GetReason gets the value of Reason for the instance +func (instance *MSFT_StorageDiagnoseResult) GetPropertyReason() (value string, err error) { + retValue, err := instance.GetProperty("Reason") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetRecommendedActions sets the value of RecommendedActions for the instance +func (instance *MSFT_StorageDiagnoseResult) SetPropertyRecommendedActions(value []string) (err error) { + return instance.SetProperty("RecommendedActions", (value)) +} + +// GetRecommendedActions gets the value of RecommendedActions for the instance +func (instance *MSFT_StorageDiagnoseResult) GetPropertyRecommendedActions() (value []string, err error) { + retValue, err := instance.GetProperty("RecommendedActions") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageEnclosure.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageEnclosure.go new file mode 100644 index 000000000..cc98a1a98 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageEnclosure.go @@ -0,0 +1,520 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageEnclosure struct +type MSFT_StorageEnclosure struct { + *MSFT_StorageFaultDomain + + // + BusType uint16 + + // + CurrentSensorOperationalStatus []uint16 + + // + DeviceId string + + // + FanOperationalStatus []uint16 + + // + FirmwareVersion string + + // + IOControllerOperationalStatus []uint16 + + // + NumberOfSlots uint32 + + // + PowerSupplyOperationalStatus []uint16 + + // + SlotOperationalStatus []uint16 + + // + TemperatureSensorOperationalStatus []uint16 + + // + VoltageSensorOperationalStatus []uint16 +} + +func NewMSFT_StorageEnclosureEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageEnclosure, err error) { + tmp, err := NewMSFT_StorageFaultDomainEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageEnclosure{ + MSFT_StorageFaultDomain: tmp, + } + return +} + +func NewMSFT_StorageEnclosureEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageEnclosure, err error) { + tmp, err := NewMSFT_StorageFaultDomainEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageEnclosure{ + MSFT_StorageFaultDomain: tmp, + } + return +} + +// SetBusType sets the value of BusType for the instance +func (instance *MSFT_StorageEnclosure) SetPropertyBusType(value uint16) (err error) { + return instance.SetProperty("BusType", (value)) +} + +// GetBusType gets the value of BusType for the instance +func (instance *MSFT_StorageEnclosure) GetPropertyBusType() (value uint16, err error) { + retValue, err := instance.GetProperty("BusType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetCurrentSensorOperationalStatus sets the value of CurrentSensorOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) SetPropertyCurrentSensorOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("CurrentSensorOperationalStatus", (value)) +} + +// GetCurrentSensorOperationalStatus gets the value of CurrentSensorOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) GetPropertyCurrentSensorOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("CurrentSensorOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetDeviceId sets the value of DeviceId for the instance +func (instance *MSFT_StorageEnclosure) SetPropertyDeviceId(value string) (err error) { + return instance.SetProperty("DeviceId", (value)) +} + +// GetDeviceId gets the value of DeviceId for the instance +func (instance *MSFT_StorageEnclosure) GetPropertyDeviceId() (value string, err error) { + retValue, err := instance.GetProperty("DeviceId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFanOperationalStatus sets the value of FanOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) SetPropertyFanOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("FanOperationalStatus", (value)) +} + +// GetFanOperationalStatus gets the value of FanOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) GetPropertyFanOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("FanOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetFirmwareVersion sets the value of FirmwareVersion for the instance +func (instance *MSFT_StorageEnclosure) SetPropertyFirmwareVersion(value string) (err error) { + return instance.SetProperty("FirmwareVersion", (value)) +} + +// GetFirmwareVersion gets the value of FirmwareVersion for the instance +func (instance *MSFT_StorageEnclosure) GetPropertyFirmwareVersion() (value string, err error) { + retValue, err := instance.GetProperty("FirmwareVersion") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetIOControllerOperationalStatus sets the value of IOControllerOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) SetPropertyIOControllerOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("IOControllerOperationalStatus", (value)) +} + +// GetIOControllerOperationalStatus gets the value of IOControllerOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) GetPropertyIOControllerOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("IOControllerOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetNumberOfSlots sets the value of NumberOfSlots for the instance +func (instance *MSFT_StorageEnclosure) SetPropertyNumberOfSlots(value uint32) (err error) { + return instance.SetProperty("NumberOfSlots", (value)) +} + +// GetNumberOfSlots gets the value of NumberOfSlots for the instance +func (instance *MSFT_StorageEnclosure) GetPropertyNumberOfSlots() (value uint32, err error) { + retValue, err := instance.GetProperty("NumberOfSlots") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetPowerSupplyOperationalStatus sets the value of PowerSupplyOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) SetPropertyPowerSupplyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("PowerSupplyOperationalStatus", (value)) +} + +// GetPowerSupplyOperationalStatus gets the value of PowerSupplyOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) GetPropertyPowerSupplyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("PowerSupplyOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSlotOperationalStatus sets the value of SlotOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) SetPropertySlotOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("SlotOperationalStatus", (value)) +} + +// GetSlotOperationalStatus gets the value of SlotOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) GetPropertySlotOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("SlotOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetTemperatureSensorOperationalStatus sets the value of TemperatureSensorOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) SetPropertyTemperatureSensorOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("TemperatureSensorOperationalStatus", (value)) +} + +// GetTemperatureSensorOperationalStatus gets the value of TemperatureSensorOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) GetPropertyTemperatureSensorOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("TemperatureSensorOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetVoltageSensorOperationalStatus sets the value of VoltageSensorOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) SetPropertyVoltageSensorOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("VoltageSensorOperationalStatus", (value)) +} + +// GetVoltageSensorOperationalStatus gets the value of VoltageSensorOperationalStatus for the instance +func (instance *MSFT_StorageEnclosure) GetPropertyVoltageSensorOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("VoltageSensorOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// + +// +// + +// +// +func (instance *MSFT_StorageEnclosure) IdentifyElement( /* IN */ Enable bool, + /* IN */ SlotNumbers []uint32, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("IdentifyElement", Enable, SlotNumbers) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_StorageEnclosure) GetVendorData( /* IN */ PageNumber uint16, + /* OUT */ VendorData string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetVendorData", PageNumber) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// + +// +// +func (instance *MSFT_StorageEnclosure) Maintenance( /* IN */ EnableMaintenanceMode bool, + /* IN */ Timeout uint32, + /* IN */ Model string, + /* IN */ Manufacturer string, + /* IN */ IgnoreDetachedVirtualDisks bool, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Maintenance", EnableMaintenanceMode, Timeout, Model, Manufacturer, IgnoreDetachedVirtualDisks) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +func (instance *MSFT_StorageEnclosure) PowerElement( /* IN */ Off bool, + /* IN */ SlotNumbers []uint32, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("PowerElement", Off, SlotNumbers) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// +// +func (instance *MSFT_StorageEnclosure) GetFirmwareInformation( /* OUT */ SupportsUpdate bool, + /* OUT */ NumberOfSlots uint16, + /* OUT */ ActiveSlotNumber uint16, + /* OUT */ SlotNumber []uint16, + /* OUT */ IsSlotWritable []bool, + /* OUT */ FirmwareVersionInSlot []string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetFirmwareInformation") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +func (instance *MSFT_StorageEnclosure) UpdateFirmware( /* IN */ ImagePath string, + /* IN */ SlotNumber uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("UpdateFirmware", ImagePath, SlotNumber) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageEnclosureToPhysicalDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageEnclosureToPhysicalDisk.go new file mode 100644 index 000000000..4335f4dff --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageEnclosureToPhysicalDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageEnclosureToPhysicalDisk struct +type MSFT_StorageEnclosureToPhysicalDisk struct { + *cim.WmiInstance + + // + PhysicalDisk MSFT_PhysicalDisk + + // + StorageEnclosure MSFT_StorageEnclosure +} + +func NewMSFT_StorageEnclosureToPhysicalDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageEnclosureToPhysicalDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageEnclosureToPhysicalDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageEnclosureToPhysicalDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageEnclosureToPhysicalDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageEnclosureToPhysicalDisk{ + WmiInstance: tmp, + } + return +} + +// SetPhysicalDisk sets the value of PhysicalDisk for the instance +func (instance *MSFT_StorageEnclosureToPhysicalDisk) SetPropertyPhysicalDisk(value MSFT_PhysicalDisk) (err error) { + return instance.SetProperty("PhysicalDisk", (value)) +} + +// GetPhysicalDisk gets the value of PhysicalDisk for the instance +func (instance *MSFT_StorageEnclosureToPhysicalDisk) GetPropertyPhysicalDisk() (value MSFT_PhysicalDisk, err error) { + retValue, err := instance.GetProperty("PhysicalDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_PhysicalDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_PhysicalDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_PhysicalDisk(valuetmp) + + return +} + +// SetStorageEnclosure sets the value of StorageEnclosure for the instance +func (instance *MSFT_StorageEnclosureToPhysicalDisk) SetPropertyStorageEnclosure(value MSFT_StorageEnclosure) (err error) { + return instance.SetProperty("StorageEnclosure", (value)) +} + +// GetStorageEnclosure gets the value of StorageEnclosure for the instance +func (instance *MSFT_StorageEnclosureToPhysicalDisk) GetPropertyStorageEnclosure() (value MSFT_StorageEnclosure, err error) { + retValue, err := instance.GetProperty("StorageEnclosure") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageEnclosure) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageEnclosure is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageEnclosure(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageEvent.go new file mode 100644 index 000000000..ede9d0a12 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageEvent.go @@ -0,0 +1,321 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageEvent struct +type MSFT_StorageEvent struct { + *cim.WmiInstance + + // + Description string + + // + EventTime string + + // + PerceivedSeverity uint16 + + // + SourceClassName string + + // + SourceInstance MSFT_StorageObject + + // + SourceNamespace string + + // + SourceObjectId string + + // + SourceServer string + + // + StorageSubsystemObjectId string +} + +func NewMSFT_StorageEventEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageEvent, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageEvent{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageEvent, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageEvent{ + WmiInstance: tmp, + } + return +} + +// SetDescription sets the value of Description for the instance +func (instance *MSFT_StorageEvent) SetPropertyDescription(value string) (err error) { + return instance.SetProperty("Description", (value)) +} + +// GetDescription gets the value of Description for the instance +func (instance *MSFT_StorageEvent) GetPropertyDescription() (value string, err error) { + retValue, err := instance.GetProperty("Description") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetEventTime sets the value of EventTime for the instance +func (instance *MSFT_StorageEvent) SetPropertyEventTime(value string) (err error) { + return instance.SetProperty("EventTime", (value)) +} + +// GetEventTime gets the value of EventTime for the instance +func (instance *MSFT_StorageEvent) GetPropertyEventTime() (value string, err error) { + retValue, err := instance.GetProperty("EventTime") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPerceivedSeverity sets the value of PerceivedSeverity for the instance +func (instance *MSFT_StorageEvent) SetPropertyPerceivedSeverity(value uint16) (err error) { + return instance.SetProperty("PerceivedSeverity", (value)) +} + +// GetPerceivedSeverity gets the value of PerceivedSeverity for the instance +func (instance *MSFT_StorageEvent) GetPropertyPerceivedSeverity() (value uint16, err error) { + retValue, err := instance.GetProperty("PerceivedSeverity") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSourceClassName sets the value of SourceClassName for the instance +func (instance *MSFT_StorageEvent) SetPropertySourceClassName(value string) (err error) { + return instance.SetProperty("SourceClassName", (value)) +} + +// GetSourceClassName gets the value of SourceClassName for the instance +func (instance *MSFT_StorageEvent) GetPropertySourceClassName() (value string, err error) { + retValue, err := instance.GetProperty("SourceClassName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSourceInstance sets the value of SourceInstance for the instance +func (instance *MSFT_StorageEvent) SetPropertySourceInstance(value MSFT_StorageObject) (err error) { + return instance.SetProperty("SourceInstance", (value)) +} + +// GetSourceInstance gets the value of SourceInstance for the instance +func (instance *MSFT_StorageEvent) GetPropertySourceInstance() (value MSFT_StorageObject, err error) { + retValue, err := instance.GetProperty("SourceInstance") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageObject) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageObject is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageObject(valuetmp) + + return +} + +// SetSourceNamespace sets the value of SourceNamespace for the instance +func (instance *MSFT_StorageEvent) SetPropertySourceNamespace(value string) (err error) { + return instance.SetProperty("SourceNamespace", (value)) +} + +// GetSourceNamespace gets the value of SourceNamespace for the instance +func (instance *MSFT_StorageEvent) GetPropertySourceNamespace() (value string, err error) { + retValue, err := instance.GetProperty("SourceNamespace") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSourceObjectId sets the value of SourceObjectId for the instance +func (instance *MSFT_StorageEvent) SetPropertySourceObjectId(value string) (err error) { + return instance.SetProperty("SourceObjectId", (value)) +} + +// GetSourceObjectId gets the value of SourceObjectId for the instance +func (instance *MSFT_StorageEvent) GetPropertySourceObjectId() (value string, err error) { + retValue, err := instance.GetProperty("SourceObjectId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSourceServer sets the value of SourceServer for the instance +func (instance *MSFT_StorageEvent) SetPropertySourceServer(value string) (err error) { + return instance.SetProperty("SourceServer", (value)) +} + +// GetSourceServer gets the value of SourceServer for the instance +func (instance *MSFT_StorageEvent) GetPropertySourceServer() (value string, err error) { + retValue, err := instance.GetProperty("SourceServer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetStorageSubsystemObjectId sets the value of StorageSubsystemObjectId for the instance +func (instance *MSFT_StorageEvent) SetPropertyStorageSubsystemObjectId(value string) (err error) { + return instance.SetProperty("StorageSubsystemObjectId", (value)) +} + +// GetStorageSubsystemObjectId gets the value of StorageSubsystemObjectId for the instance +func (instance *MSFT_StorageEvent) GetPropertyStorageSubsystemObjectId() (value string, err error) { + retValue, err := instance.GetProperty("StorageSubsystemObjectId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageExtendedStatus.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageExtendedStatus.go new file mode 100644 index 000000000..7df636754 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageExtendedStatus.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_StorageExtendedStatus struct +type MSFT_StorageExtendedStatus struct { + *CIM_Error +} + +func NewMSFT_StorageExtendedStatusEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageExtendedStatus, err error) { + tmp, err := NewCIM_ErrorEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageExtendedStatus{ + CIM_Error: tmp, + } + return +} + +func NewMSFT_StorageExtendedStatusEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageExtendedStatus, err error) { + tmp, err := NewCIM_ErrorEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageExtendedStatus{ + CIM_Error: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageFaultDomain.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageFaultDomain.go new file mode 100644 index 000000000..6b2067490 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageFaultDomain.go @@ -0,0 +1,322 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageFaultDomain struct +type MSFT_StorageFaultDomain struct { + *MSFT_StorageObject + + // + Description string + + // + FriendlyName string + + // + HealthStatus uint16 + + // + Manufacturer string + + // + Model string + + // + OperationalDetails []string + + // + OperationalStatus []uint16 + + // + PhysicalLocation string + + // + SerialNumber string +} + +func NewMSFT_StorageFaultDomainEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageFaultDomain, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageFaultDomain{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_StorageFaultDomainEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageFaultDomain, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageFaultDomain{ + MSFT_StorageObject: tmp, + } + return +} + +// SetDescription sets the value of Description for the instance +func (instance *MSFT_StorageFaultDomain) SetPropertyDescription(value string) (err error) { + return instance.SetProperty("Description", (value)) +} + +// GetDescription gets the value of Description for the instance +func (instance *MSFT_StorageFaultDomain) GetPropertyDescription() (value string, err error) { + retValue, err := instance.GetProperty("Description") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFriendlyName sets the value of FriendlyName for the instance +func (instance *MSFT_StorageFaultDomain) SetPropertyFriendlyName(value string) (err error) { + return instance.SetProperty("FriendlyName", (value)) +} + +// GetFriendlyName gets the value of FriendlyName for the instance +func (instance *MSFT_StorageFaultDomain) GetPropertyFriendlyName() (value string, err error) { + retValue, err := instance.GetProperty("FriendlyName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetHealthStatus sets the value of HealthStatus for the instance +func (instance *MSFT_StorageFaultDomain) SetPropertyHealthStatus(value uint16) (err error) { + return instance.SetProperty("HealthStatus", (value)) +} + +// GetHealthStatus gets the value of HealthStatus for the instance +func (instance *MSFT_StorageFaultDomain) GetPropertyHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("HealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetManufacturer sets the value of Manufacturer for the instance +func (instance *MSFT_StorageFaultDomain) SetPropertyManufacturer(value string) (err error) { + return instance.SetProperty("Manufacturer", (value)) +} + +// GetManufacturer gets the value of Manufacturer for the instance +func (instance *MSFT_StorageFaultDomain) GetPropertyManufacturer() (value string, err error) { + retValue, err := instance.GetProperty("Manufacturer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetModel sets the value of Model for the instance +func (instance *MSFT_StorageFaultDomain) SetPropertyModel(value string) (err error) { + return instance.SetProperty("Model", (value)) +} + +// GetModel gets the value of Model for the instance +func (instance *MSFT_StorageFaultDomain) GetPropertyModel() (value string, err error) { + retValue, err := instance.GetProperty("Model") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOperationalDetails sets the value of OperationalDetails for the instance +func (instance *MSFT_StorageFaultDomain) SetPropertyOperationalDetails(value []string) (err error) { + return instance.SetProperty("OperationalDetails", (value)) +} + +// GetOperationalDetails gets the value of OperationalDetails for the instance +func (instance *MSFT_StorageFaultDomain) GetPropertyOperationalDetails() (value []string, err error) { + retValue, err := instance.GetProperty("OperationalDetails") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_StorageFaultDomain) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_StorageFaultDomain) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetPhysicalLocation sets the value of PhysicalLocation for the instance +func (instance *MSFT_StorageFaultDomain) SetPropertyPhysicalLocation(value string) (err error) { + return instance.SetProperty("PhysicalLocation", (value)) +} + +// GetPhysicalLocation gets the value of PhysicalLocation for the instance +func (instance *MSFT_StorageFaultDomain) GetPropertyPhysicalLocation() (value string, err error) { + retValue, err := instance.GetProperty("PhysicalLocation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSerialNumber sets the value of SerialNumber for the instance +func (instance *MSFT_StorageFaultDomain) SetPropertySerialNumber(value string) (err error) { + return instance.SetProperty("SerialNumber", (value)) +} + +// GetSerialNumber gets the value of SerialNumber for the instance +func (instance *MSFT_StorageFaultDomain) GetPropertySerialNumber() (value string, err error) { + retValue, err := instance.GetProperty("SerialNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageFaultDomainToStorageFaultDomain.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageFaultDomainToStorageFaultDomain.go new file mode 100644 index 000000000..cc4be93d8 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageFaultDomainToStorageFaultDomain.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageFaultDomainToStorageFaultDomain struct +type MSFT_StorageFaultDomainToStorageFaultDomain struct { + *cim.WmiInstance + + // + SourceStorageFaultDomain MSFT_StorageFaultDomain + + // + TargetStorageFaultDomain MSFT_StorageFaultDomain +} + +func NewMSFT_StorageFaultDomainToStorageFaultDomainEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageFaultDomainToStorageFaultDomain, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageFaultDomainToStorageFaultDomain{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageFaultDomainToStorageFaultDomainEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageFaultDomainToStorageFaultDomain, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageFaultDomainToStorageFaultDomain{ + WmiInstance: tmp, + } + return +} + +// SetSourceStorageFaultDomain sets the value of SourceStorageFaultDomain for the instance +func (instance *MSFT_StorageFaultDomainToStorageFaultDomain) SetPropertySourceStorageFaultDomain(value MSFT_StorageFaultDomain) (err error) { + return instance.SetProperty("SourceStorageFaultDomain", (value)) +} + +// GetSourceStorageFaultDomain gets the value of SourceStorageFaultDomain for the instance +func (instance *MSFT_StorageFaultDomainToStorageFaultDomain) GetPropertySourceStorageFaultDomain() (value MSFT_StorageFaultDomain, err error) { + retValue, err := instance.GetProperty("SourceStorageFaultDomain") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageFaultDomain) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageFaultDomain is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageFaultDomain(valuetmp) + + return +} + +// SetTargetStorageFaultDomain sets the value of TargetStorageFaultDomain for the instance +func (instance *MSFT_StorageFaultDomainToStorageFaultDomain) SetPropertyTargetStorageFaultDomain(value MSFT_StorageFaultDomain) (err error) { + return instance.SetProperty("TargetStorageFaultDomain", (value)) +} + +// GetTargetStorageFaultDomain gets the value of TargetStorageFaultDomain for the instance +func (instance *MSFT_StorageFaultDomainToStorageFaultDomain) GetPropertyTargetStorageFaultDomain() (value MSFT_StorageFaultDomain, err error) { + retValue, err := instance.GetProperty("TargetStorageFaultDomain") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageFaultDomain) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageFaultDomain is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageFaultDomain(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageFaultEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageFaultEvent.go new file mode 100644 index 000000000..c694fe00d --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageFaultEvent.go @@ -0,0 +1,381 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageFaultEvent struct +type MSFT_StorageFaultEvent struct { + *MSFT_StorageEvent + + // + ChangeType uint16 + + // + FaultId string + + // + FaultingObjectDescription string + + // + FaultingObjectLocation string + + // + FaultingObjectType string + + // + FaultingObjectUniqueId string + + // + FaultType string + + // + Reason string + + // + RecommendedActions []string + + // + SourceUniqueId string + + // + StorageSubsystemUniqueId string +} + +func NewMSFT_StorageFaultEventEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageFaultEvent, err error) { + tmp, err := NewMSFT_StorageEventEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageFaultEvent{ + MSFT_StorageEvent: tmp, + } + return +} + +func NewMSFT_StorageFaultEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageFaultEvent, err error) { + tmp, err := NewMSFT_StorageEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageFaultEvent{ + MSFT_StorageEvent: tmp, + } + return +} + +// SetChangeType sets the value of ChangeType for the instance +func (instance *MSFT_StorageFaultEvent) SetPropertyChangeType(value uint16) (err error) { + return instance.SetProperty("ChangeType", (value)) +} + +// GetChangeType gets the value of ChangeType for the instance +func (instance *MSFT_StorageFaultEvent) GetPropertyChangeType() (value uint16, err error) { + retValue, err := instance.GetProperty("ChangeType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetFaultId sets the value of FaultId for the instance +func (instance *MSFT_StorageFaultEvent) SetPropertyFaultId(value string) (err error) { + return instance.SetProperty("FaultId", (value)) +} + +// GetFaultId gets the value of FaultId for the instance +func (instance *MSFT_StorageFaultEvent) GetPropertyFaultId() (value string, err error) { + retValue, err := instance.GetProperty("FaultId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFaultingObjectDescription sets the value of FaultingObjectDescription for the instance +func (instance *MSFT_StorageFaultEvent) SetPropertyFaultingObjectDescription(value string) (err error) { + return instance.SetProperty("FaultingObjectDescription", (value)) +} + +// GetFaultingObjectDescription gets the value of FaultingObjectDescription for the instance +func (instance *MSFT_StorageFaultEvent) GetPropertyFaultingObjectDescription() (value string, err error) { + retValue, err := instance.GetProperty("FaultingObjectDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFaultingObjectLocation sets the value of FaultingObjectLocation for the instance +func (instance *MSFT_StorageFaultEvent) SetPropertyFaultingObjectLocation(value string) (err error) { + return instance.SetProperty("FaultingObjectLocation", (value)) +} + +// GetFaultingObjectLocation gets the value of FaultingObjectLocation for the instance +func (instance *MSFT_StorageFaultEvent) GetPropertyFaultingObjectLocation() (value string, err error) { + retValue, err := instance.GetProperty("FaultingObjectLocation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFaultingObjectType sets the value of FaultingObjectType for the instance +func (instance *MSFT_StorageFaultEvent) SetPropertyFaultingObjectType(value string) (err error) { + return instance.SetProperty("FaultingObjectType", (value)) +} + +// GetFaultingObjectType gets the value of FaultingObjectType for the instance +func (instance *MSFT_StorageFaultEvent) GetPropertyFaultingObjectType() (value string, err error) { + retValue, err := instance.GetProperty("FaultingObjectType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFaultingObjectUniqueId sets the value of FaultingObjectUniqueId for the instance +func (instance *MSFT_StorageFaultEvent) SetPropertyFaultingObjectUniqueId(value string) (err error) { + return instance.SetProperty("FaultingObjectUniqueId", (value)) +} + +// GetFaultingObjectUniqueId gets the value of FaultingObjectUniqueId for the instance +func (instance *MSFT_StorageFaultEvent) GetPropertyFaultingObjectUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("FaultingObjectUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFaultType sets the value of FaultType for the instance +func (instance *MSFT_StorageFaultEvent) SetPropertyFaultType(value string) (err error) { + return instance.SetProperty("FaultType", (value)) +} + +// GetFaultType gets the value of FaultType for the instance +func (instance *MSFT_StorageFaultEvent) GetPropertyFaultType() (value string, err error) { + retValue, err := instance.GetProperty("FaultType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetReason sets the value of Reason for the instance +func (instance *MSFT_StorageFaultEvent) SetPropertyReason(value string) (err error) { + return instance.SetProperty("Reason", (value)) +} + +// GetReason gets the value of Reason for the instance +func (instance *MSFT_StorageFaultEvent) GetPropertyReason() (value string, err error) { + retValue, err := instance.GetProperty("Reason") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetRecommendedActions sets the value of RecommendedActions for the instance +func (instance *MSFT_StorageFaultEvent) SetPropertyRecommendedActions(value []string) (err error) { + return instance.SetProperty("RecommendedActions", (value)) +} + +// GetRecommendedActions gets the value of RecommendedActions for the instance +func (instance *MSFT_StorageFaultEvent) GetPropertyRecommendedActions() (value []string, err error) { + retValue, err := instance.GetProperty("RecommendedActions") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetSourceUniqueId sets the value of SourceUniqueId for the instance +func (instance *MSFT_StorageFaultEvent) SetPropertySourceUniqueId(value string) (err error) { + return instance.SetProperty("SourceUniqueId", (value)) +} + +// GetSourceUniqueId gets the value of SourceUniqueId for the instance +func (instance *MSFT_StorageFaultEvent) GetPropertySourceUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("SourceUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetStorageSubsystemUniqueId sets the value of StorageSubsystemUniqueId for the instance +func (instance *MSFT_StorageFaultEvent) SetPropertyStorageSubsystemUniqueId(value string) (err error) { + return instance.SetProperty("StorageSubsystemUniqueId", (value)) +} + +// GetStorageSubsystemUniqueId gets the value of StorageSubsystemUniqueId for the instance +func (instance *MSFT_StorageFaultEvent) GetPropertyStorageSubsystemUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("StorageSubsystemUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealth.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealth.go new file mode 100644 index 000000000..09fb63198 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealth.go @@ -0,0 +1,176 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_StorageHealth struct +type MSFT_StorageHealth struct { + *MSFT_StorageObject +} + +func NewMSFT_StorageHealthEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageHealth, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageHealth{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_StorageHealthEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageHealth, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageHealth{ + MSFT_StorageObject: tmp, + } + return +} + +// + +// + +// +// +// +func (instance *MSFT_StorageHealth) GetSetting( /* IN */ Name string, + /* OUT */ StorageHealthSetting []MSFT_StorageHealthSetting, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSetting", Name) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +func (instance *MSFT_StorageHealth) SetSetting( /* IN */ Name string, + /* IN */ Value string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetSetting", Name, Value) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_StorageHealth) RemoveSetting( /* IN */ Name string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RemoveSetting", Name) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_StorageHealth) GetReport( /* IN */ TargetObject MSFT_StorageObject, + /* IN */ Count uint32, + /* OUT */ Reports []MSFT_StorageHealthReport, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetReport", TargetObject, Count) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// + +// +// +func (instance *MSFT_StorageHealth) Maintenance( /* IN */ TargetObject MSFT_StorageFaultDomain, + /* IN */ EnableMaintenanceMode bool, + /* IN */ IgnoreDetachedVirtualDisks bool, + /* IN */ Timeout uint32, + /* IN */ Model string, + /* IN */ Manufacturer string, + /* IN */ ValidationFlags uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Maintenance", TargetObject, EnableMaintenanceMode, IgnoreDetachedVirtualDisks, Timeout, Model, Manufacturer, ValidationFlags) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_StorageHealth) RemoveIntent( /* IN */ TargetObject MSFT_StorageObject, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RemoveIntent", TargetObject) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealthReport.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealthReport.go new file mode 100644 index 000000000..20e656750 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealthReport.go @@ -0,0 +1,142 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageHealthReport struct +type MSFT_StorageHealthReport struct { + *cim.WmiInstance + + // + Records []MSFT_HealthRecord + + // + ReportedObjectUniqueId string + + // + StorageSubsystemUniqueId string +} + +func NewMSFT_StorageHealthReportEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageHealthReport, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageHealthReport{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageHealthReportEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageHealthReport, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageHealthReport{ + WmiInstance: tmp, + } + return +} + +// SetRecords sets the value of Records for the instance +func (instance *MSFT_StorageHealthReport) SetPropertyRecords(value []MSFT_HealthRecord) (err error) { + return instance.SetProperty("Records", (value)) +} + +// GetRecords gets the value of Records for the instance +func (instance *MSFT_StorageHealthReport) GetPropertyRecords() (value []MSFT_HealthRecord, err error) { + retValue, err := instance.GetProperty("Records") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(MSFT_HealthRecord) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_HealthRecord is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, MSFT_HealthRecord(valuetmp)) + } + + return +} + +// SetReportedObjectUniqueId sets the value of ReportedObjectUniqueId for the instance +func (instance *MSFT_StorageHealthReport) SetPropertyReportedObjectUniqueId(value string) (err error) { + return instance.SetProperty("ReportedObjectUniqueId", (value)) +} + +// GetReportedObjectUniqueId gets the value of ReportedObjectUniqueId for the instance +func (instance *MSFT_StorageHealthReport) GetPropertyReportedObjectUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("ReportedObjectUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetStorageSubsystemUniqueId sets the value of StorageSubsystemUniqueId for the instance +func (instance *MSFT_StorageHealthReport) SetPropertyStorageSubsystemUniqueId(value string) (err error) { + return instance.SetProperty("StorageSubsystemUniqueId", (value)) +} + +// GetStorageSubsystemUniqueId gets the value of StorageSubsystemUniqueId for the instance +func (instance *MSFT_StorageHealthReport) GetPropertyStorageSubsystemUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("StorageSubsystemUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealthSetting.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealthSetting.go new file mode 100644 index 000000000..4c117e475 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealthSetting.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageHealthSetting struct +type MSFT_StorageHealthSetting struct { + *cim.WmiInstance + + // + Name string + + // + Value string +} + +func NewMSFT_StorageHealthSettingEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageHealthSetting, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageHealthSetting{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageHealthSettingEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageHealthSetting, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageHealthSetting{ + WmiInstance: tmp, + } + return +} + +// SetName sets the value of Name for the instance +func (instance *MSFT_StorageHealthSetting) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *MSFT_StorageHealthSetting) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetValue sets the value of Value for the instance +func (instance *MSFT_StorageHealthSetting) SetPropertyValue(value string) (err error) { + return instance.SetProperty("Value", (value)) +} + +// GetValue gets the value of Value for the instance +func (instance *MSFT_StorageHealthSetting) GetPropertyValue() (value string, err error) { + retValue, err := instance.GetProperty("Value") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealthStatusChangeEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealthStatusChangeEvent.go new file mode 100644 index 000000000..121d4cd74 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageHealthStatusChangeEvent.go @@ -0,0 +1,170 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageHealthStatusChangeEvent struct +type MSFT_StorageHealthStatusChangeEvent struct { + *MSFT_StorageEvent + + // + CurrentHealthStatus uint16 + + // + PreviousHealthStatus uint16 + + // + SourceUniqueId string + + // + StorageSubsystemUniqueId string +} + +func NewMSFT_StorageHealthStatusChangeEventEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageHealthStatusChangeEvent, err error) { + tmp, err := NewMSFT_StorageEventEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageHealthStatusChangeEvent{ + MSFT_StorageEvent: tmp, + } + return +} + +func NewMSFT_StorageHealthStatusChangeEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageHealthStatusChangeEvent, err error) { + tmp, err := NewMSFT_StorageEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageHealthStatusChangeEvent{ + MSFT_StorageEvent: tmp, + } + return +} + +// SetCurrentHealthStatus sets the value of CurrentHealthStatus for the instance +func (instance *MSFT_StorageHealthStatusChangeEvent) SetPropertyCurrentHealthStatus(value uint16) (err error) { + return instance.SetProperty("CurrentHealthStatus", (value)) +} + +// GetCurrentHealthStatus gets the value of CurrentHealthStatus for the instance +func (instance *MSFT_StorageHealthStatusChangeEvent) GetPropertyCurrentHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("CurrentHealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetPreviousHealthStatus sets the value of PreviousHealthStatus for the instance +func (instance *MSFT_StorageHealthStatusChangeEvent) SetPropertyPreviousHealthStatus(value uint16) (err error) { + return instance.SetProperty("PreviousHealthStatus", (value)) +} + +// GetPreviousHealthStatus gets the value of PreviousHealthStatus for the instance +func (instance *MSFT_StorageHealthStatusChangeEvent) GetPropertyPreviousHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("PreviousHealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSourceUniqueId sets the value of SourceUniqueId for the instance +func (instance *MSFT_StorageHealthStatusChangeEvent) SetPropertySourceUniqueId(value string) (err error) { + return instance.SetProperty("SourceUniqueId", (value)) +} + +// GetSourceUniqueId gets the value of SourceUniqueId for the instance +func (instance *MSFT_StorageHealthStatusChangeEvent) GetPropertySourceUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("SourceUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetStorageSubsystemUniqueId sets the value of StorageSubsystemUniqueId for the instance +func (instance *MSFT_StorageHealthStatusChangeEvent) SetPropertyStorageSubsystemUniqueId(value string) (err error) { + return instance.SetProperty("StorageSubsystemUniqueId", (value)) +} + +// GetStorageSubsystemUniqueId gets the value of StorageSubsystemUniqueId for the instance +func (instance *MSFT_StorageHealthStatusChangeEvent) GetPropertyStorageSubsystemUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("StorageSubsystemUniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageJob.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageJob.go new file mode 100644 index 000000000..5168145aa --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageJob.go @@ -0,0 +1,747 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageJob struct +type MSFT_StorageJob struct { + *MSFT_StorageObject + + // + BytesProcessed uint64 + + // + BytesTotal uint64 + + // + DeleteOnCompletion bool + + // + Description string + + // + ElapsedTime string + + // + ErrorCode uint16 + + // + ErrorDescription string + + // + IsBackgroundTask bool + + // + JobState uint16 + + // + JobStatus string + + // + LocalOrUtcTime uint16 + + // + Name string + + // + OperationalStatus []uint16 + + // + OtherRecoveryAction string + + // + PercentComplete uint16 + + // + RecoveryAction uint16 + + // + StartTime string + + // + StatusDescriptions []string + + // + TimeBeforeRemoval string + + // + TimeOfLastStateChange string + + // + TimeSubmitted string +} + +func NewMSFT_StorageJobEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageJob, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageJob{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_StorageJobEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageJob, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageJob{ + MSFT_StorageObject: tmp, + } + return +} + +// SetBytesProcessed sets the value of BytesProcessed for the instance +func (instance *MSFT_StorageJob) SetPropertyBytesProcessed(value uint64) (err error) { + return instance.SetProperty("BytesProcessed", (value)) +} + +// GetBytesProcessed gets the value of BytesProcessed for the instance +func (instance *MSFT_StorageJob) GetPropertyBytesProcessed() (value uint64, err error) { + retValue, err := instance.GetProperty("BytesProcessed") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetBytesTotal sets the value of BytesTotal for the instance +func (instance *MSFT_StorageJob) SetPropertyBytesTotal(value uint64) (err error) { + return instance.SetProperty("BytesTotal", (value)) +} + +// GetBytesTotal gets the value of BytesTotal for the instance +func (instance *MSFT_StorageJob) GetPropertyBytesTotal() (value uint64, err error) { + retValue, err := instance.GetProperty("BytesTotal") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetDeleteOnCompletion sets the value of DeleteOnCompletion for the instance +func (instance *MSFT_StorageJob) SetPropertyDeleteOnCompletion(value bool) (err error) { + return instance.SetProperty("DeleteOnCompletion", (value)) +} + +// GetDeleteOnCompletion gets the value of DeleteOnCompletion for the instance +func (instance *MSFT_StorageJob) GetPropertyDeleteOnCompletion() (value bool, err error) { + retValue, err := instance.GetProperty("DeleteOnCompletion") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetDescription sets the value of Description for the instance +func (instance *MSFT_StorageJob) SetPropertyDescription(value string) (err error) { + return instance.SetProperty("Description", (value)) +} + +// GetDescription gets the value of Description for the instance +func (instance *MSFT_StorageJob) GetPropertyDescription() (value string, err error) { + retValue, err := instance.GetProperty("Description") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetElapsedTime sets the value of ElapsedTime for the instance +func (instance *MSFT_StorageJob) SetPropertyElapsedTime(value string) (err error) { + return instance.SetProperty("ElapsedTime", (value)) +} + +// GetElapsedTime gets the value of ElapsedTime for the instance +func (instance *MSFT_StorageJob) GetPropertyElapsedTime() (value string, err error) { + retValue, err := instance.GetProperty("ElapsedTime") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetErrorCode sets the value of ErrorCode for the instance +func (instance *MSFT_StorageJob) SetPropertyErrorCode(value uint16) (err error) { + return instance.SetProperty("ErrorCode", (value)) +} + +// GetErrorCode gets the value of ErrorCode for the instance +func (instance *MSFT_StorageJob) GetPropertyErrorCode() (value uint16, err error) { + retValue, err := instance.GetProperty("ErrorCode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetErrorDescription sets the value of ErrorDescription for the instance +func (instance *MSFT_StorageJob) SetPropertyErrorDescription(value string) (err error) { + return instance.SetProperty("ErrorDescription", (value)) +} + +// GetErrorDescription gets the value of ErrorDescription for the instance +func (instance *MSFT_StorageJob) GetPropertyErrorDescription() (value string, err error) { + retValue, err := instance.GetProperty("ErrorDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetIsBackgroundTask sets the value of IsBackgroundTask for the instance +func (instance *MSFT_StorageJob) SetPropertyIsBackgroundTask(value bool) (err error) { + return instance.SetProperty("IsBackgroundTask", (value)) +} + +// GetIsBackgroundTask gets the value of IsBackgroundTask for the instance +func (instance *MSFT_StorageJob) GetPropertyIsBackgroundTask() (value bool, err error) { + retValue, err := instance.GetProperty("IsBackgroundTask") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetJobState sets the value of JobState for the instance +func (instance *MSFT_StorageJob) SetPropertyJobState(value uint16) (err error) { + return instance.SetProperty("JobState", (value)) +} + +// GetJobState gets the value of JobState for the instance +func (instance *MSFT_StorageJob) GetPropertyJobState() (value uint16, err error) { + retValue, err := instance.GetProperty("JobState") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetJobStatus sets the value of JobStatus for the instance +func (instance *MSFT_StorageJob) SetPropertyJobStatus(value string) (err error) { + return instance.SetProperty("JobStatus", (value)) +} + +// GetJobStatus gets the value of JobStatus for the instance +func (instance *MSFT_StorageJob) GetPropertyJobStatus() (value string, err error) { + retValue, err := instance.GetProperty("JobStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetLocalOrUtcTime sets the value of LocalOrUtcTime for the instance +func (instance *MSFT_StorageJob) SetPropertyLocalOrUtcTime(value uint16) (err error) { + return instance.SetProperty("LocalOrUtcTime", (value)) +} + +// GetLocalOrUtcTime gets the value of LocalOrUtcTime for the instance +func (instance *MSFT_StorageJob) GetPropertyLocalOrUtcTime() (value uint16, err error) { + retValue, err := instance.GetProperty("LocalOrUtcTime") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetName sets the value of Name for the instance +func (instance *MSFT_StorageJob) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *MSFT_StorageJob) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_StorageJob) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_StorageJob) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetOtherRecoveryAction sets the value of OtherRecoveryAction for the instance +func (instance *MSFT_StorageJob) SetPropertyOtherRecoveryAction(value string) (err error) { + return instance.SetProperty("OtherRecoveryAction", (value)) +} + +// GetOtherRecoveryAction gets the value of OtherRecoveryAction for the instance +func (instance *MSFT_StorageJob) GetPropertyOtherRecoveryAction() (value string, err error) { + retValue, err := instance.GetProperty("OtherRecoveryAction") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPercentComplete sets the value of PercentComplete for the instance +func (instance *MSFT_StorageJob) SetPropertyPercentComplete(value uint16) (err error) { + return instance.SetProperty("PercentComplete", (value)) +} + +// GetPercentComplete gets the value of PercentComplete for the instance +func (instance *MSFT_StorageJob) GetPropertyPercentComplete() (value uint16, err error) { + retValue, err := instance.GetProperty("PercentComplete") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetRecoveryAction sets the value of RecoveryAction for the instance +func (instance *MSFT_StorageJob) SetPropertyRecoveryAction(value uint16) (err error) { + return instance.SetProperty("RecoveryAction", (value)) +} + +// GetRecoveryAction gets the value of RecoveryAction for the instance +func (instance *MSFT_StorageJob) GetPropertyRecoveryAction() (value uint16, err error) { + retValue, err := instance.GetProperty("RecoveryAction") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetStartTime sets the value of StartTime for the instance +func (instance *MSFT_StorageJob) SetPropertyStartTime(value string) (err error) { + return instance.SetProperty("StartTime", (value)) +} + +// GetStartTime gets the value of StartTime for the instance +func (instance *MSFT_StorageJob) GetPropertyStartTime() (value string, err error) { + retValue, err := instance.GetProperty("StartTime") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetStatusDescriptions sets the value of StatusDescriptions for the instance +func (instance *MSFT_StorageJob) SetPropertyStatusDescriptions(value []string) (err error) { + return instance.SetProperty("StatusDescriptions", (value)) +} + +// GetStatusDescriptions gets the value of StatusDescriptions for the instance +func (instance *MSFT_StorageJob) GetPropertyStatusDescriptions() (value []string, err error) { + retValue, err := instance.GetProperty("StatusDescriptions") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetTimeBeforeRemoval sets the value of TimeBeforeRemoval for the instance +func (instance *MSFT_StorageJob) SetPropertyTimeBeforeRemoval(value string) (err error) { + return instance.SetProperty("TimeBeforeRemoval", (value)) +} + +// GetTimeBeforeRemoval gets the value of TimeBeforeRemoval for the instance +func (instance *MSFT_StorageJob) GetPropertyTimeBeforeRemoval() (value string, err error) { + retValue, err := instance.GetProperty("TimeBeforeRemoval") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetTimeOfLastStateChange sets the value of TimeOfLastStateChange for the instance +func (instance *MSFT_StorageJob) SetPropertyTimeOfLastStateChange(value string) (err error) { + return instance.SetProperty("TimeOfLastStateChange", (value)) +} + +// GetTimeOfLastStateChange gets the value of TimeOfLastStateChange for the instance +func (instance *MSFT_StorageJob) GetPropertyTimeOfLastStateChange() (value string, err error) { + retValue, err := instance.GetProperty("TimeOfLastStateChange") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetTimeSubmitted sets the value of TimeSubmitted for the instance +func (instance *MSFT_StorageJob) SetPropertyTimeSubmitted(value string) (err error) { + return instance.SetProperty("TimeSubmitted", (value)) +} + +// GetTimeSubmitted gets the value of TimeSubmitted for the instance +func (instance *MSFT_StorageJob) GetPropertyTimeSubmitted() (value string, err error) { + retValue, err := instance.GetProperty("TimeSubmitted") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// + +// + +// +// +func (instance *MSFT_StorageJob) RequestStateChange( /* IN */ RequestedState uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RequestStateChange", RequestedState) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_StorageJob) GetExtendedStatus( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetExtendedStatus") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_StorageJob) GetMessages( /* OUT */ Channels []uint16, + /* OUT */ Messages []string) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetMessages") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_StorageJob) GetOutParameters( /* OUT */ OutParameters MSFT_StorageJobOutParams) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetOutParameters") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageJobOutParams.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageJobOutParams.go new file mode 100644 index 000000000..b465e3158 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageJobOutParams.go @@ -0,0 +1,49 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_StorageJobOutParams struct +type MSFT_StorageJobOutParams struct { + *cim.WmiInstance +} + +func NewMSFT_StorageJobOutParamsEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageJobOutParams, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageJobOutParams{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageJobOutParamsEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageJobOutParams, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageJobOutParams{ + WmiInstance: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageJobToAffectedStorageObject.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageJobToAffectedStorageObject.go new file mode 100644 index 000000000..47cf886ce --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageJobToAffectedStorageObject.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageJobToAffectedStorageObject struct +type MSFT_StorageJobToAffectedStorageObject struct { + *cim.WmiInstance + + // + AffectedStorageObject MSFT_StorageObject + + // + StorageJob MSFT_StorageJob +} + +func NewMSFT_StorageJobToAffectedStorageObjectEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageJobToAffectedStorageObject, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageJobToAffectedStorageObject{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageJobToAffectedStorageObjectEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageJobToAffectedStorageObject, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageJobToAffectedStorageObject{ + WmiInstance: tmp, + } + return +} + +// SetAffectedStorageObject sets the value of AffectedStorageObject for the instance +func (instance *MSFT_StorageJobToAffectedStorageObject) SetPropertyAffectedStorageObject(value MSFT_StorageObject) (err error) { + return instance.SetProperty("AffectedStorageObject", (value)) +} + +// GetAffectedStorageObject gets the value of AffectedStorageObject for the instance +func (instance *MSFT_StorageJobToAffectedStorageObject) GetPropertyAffectedStorageObject() (value MSFT_StorageObject, err error) { + retValue, err := instance.GetProperty("AffectedStorageObject") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageObject) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageObject is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageObject(valuetmp) + + return +} + +// SetStorageJob sets the value of StorageJob for the instance +func (instance *MSFT_StorageJobToAffectedStorageObject) SetPropertyStorageJob(value MSFT_StorageJob) (err error) { + return instance.SetProperty("StorageJob", (value)) +} + +// GetStorageJob gets the value of StorageJob for the instance +func (instance *MSFT_StorageJobToAffectedStorageObject) GetPropertyStorageJob() (value MSFT_StorageJob, err error) { + retValue, err := instance.GetProperty("StorageJob") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageJob) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageJob is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageJob(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageModificationEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageModificationEvent.go new file mode 100644 index 000000000..2674815a1 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageModificationEvent.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_StorageModificationEvent struct +type MSFT_StorageModificationEvent struct { + *MSFT_StorageEvent +} + +func NewMSFT_StorageModificationEventEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageModificationEvent, err error) { + tmp, err := NewMSFT_StorageEventEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageModificationEvent{ + MSFT_StorageEvent: tmp, + } + return +} + +func NewMSFT_StorageModificationEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageModificationEvent, err error) { + tmp, err := NewMSFT_StorageEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageModificationEvent{ + MSFT_StorageEvent: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNode.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNode.go new file mode 100644 index 000000000..cba00848c --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNode.go @@ -0,0 +1,322 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageNode struct +type MSFT_StorageNode struct { + *MSFT_StorageObject + + // + FirmwareVersion string + + // + Manufacturer string + + // + Model string + + // + Name string + + // + NameFormat uint16 + + // + OperationalStatus uint16 + + // + OtherIdentifyingInfo []string + + // + OtherIdentifyingInfoDescription []string + + // + SerialNumber string +} + +func NewMSFT_StorageNodeEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageNode, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageNode{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_StorageNodeEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageNode, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageNode{ + MSFT_StorageObject: tmp, + } + return +} + +// SetFirmwareVersion sets the value of FirmwareVersion for the instance +func (instance *MSFT_StorageNode) SetPropertyFirmwareVersion(value string) (err error) { + return instance.SetProperty("FirmwareVersion", (value)) +} + +// GetFirmwareVersion gets the value of FirmwareVersion for the instance +func (instance *MSFT_StorageNode) GetPropertyFirmwareVersion() (value string, err error) { + retValue, err := instance.GetProperty("FirmwareVersion") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetManufacturer sets the value of Manufacturer for the instance +func (instance *MSFT_StorageNode) SetPropertyManufacturer(value string) (err error) { + return instance.SetProperty("Manufacturer", (value)) +} + +// GetManufacturer gets the value of Manufacturer for the instance +func (instance *MSFT_StorageNode) GetPropertyManufacturer() (value string, err error) { + retValue, err := instance.GetProperty("Manufacturer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetModel sets the value of Model for the instance +func (instance *MSFT_StorageNode) SetPropertyModel(value string) (err error) { + return instance.SetProperty("Model", (value)) +} + +// GetModel gets the value of Model for the instance +func (instance *MSFT_StorageNode) GetPropertyModel() (value string, err error) { + retValue, err := instance.GetProperty("Model") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetName sets the value of Name for the instance +func (instance *MSFT_StorageNode) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *MSFT_StorageNode) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetNameFormat sets the value of NameFormat for the instance +func (instance *MSFT_StorageNode) SetPropertyNameFormat(value uint16) (err error) { + return instance.SetProperty("NameFormat", (value)) +} + +// GetNameFormat gets the value of NameFormat for the instance +func (instance *MSFT_StorageNode) GetPropertyNameFormat() (value uint16, err error) { + retValue, err := instance.GetProperty("NameFormat") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_StorageNode) SetPropertyOperationalStatus(value uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_StorageNode) GetPropertyOperationalStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetOtherIdentifyingInfo sets the value of OtherIdentifyingInfo for the instance +func (instance *MSFT_StorageNode) SetPropertyOtherIdentifyingInfo(value []string) (err error) { + return instance.SetProperty("OtherIdentifyingInfo", (value)) +} + +// GetOtherIdentifyingInfo gets the value of OtherIdentifyingInfo for the instance +func (instance *MSFT_StorageNode) GetPropertyOtherIdentifyingInfo() (value []string, err error) { + retValue, err := instance.GetProperty("OtherIdentifyingInfo") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetOtherIdentifyingInfoDescription sets the value of OtherIdentifyingInfoDescription for the instance +func (instance *MSFT_StorageNode) SetPropertyOtherIdentifyingInfoDescription(value []string) (err error) { + return instance.SetProperty("OtherIdentifyingInfoDescription", (value)) +} + +// GetOtherIdentifyingInfoDescription gets the value of OtherIdentifyingInfoDescription for the instance +func (instance *MSFT_StorageNode) GetPropertyOtherIdentifyingInfoDescription() (value []string, err error) { + retValue, err := instance.GetProperty("OtherIdentifyingInfoDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetSerialNumber sets the value of SerialNumber for the instance +func (instance *MSFT_StorageNode) SetPropertySerialNumber(value string) (err error) { + return instance.SetProperty("SerialNumber", (value)) +} + +// GetSerialNumber gets the value of SerialNumber for the instance +func (instance *MSFT_StorageNode) GetPropertySerialNumber() (value string, err error) { + retValue, err := instance.GetProperty("SerialNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToDisk.go new file mode 100644 index 000000000..b0a81cfa8 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToDisk.go @@ -0,0 +1,292 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageNodeToDisk struct +type MSFT_StorageNodeToDisk struct { + *cim.WmiInstance + + // + Disk MSFT_Disk + + // + DiskNumber uint32 + + // + HealthStatus uint16 + + // + IsOffline bool + + // + IsReadOnly bool + + // + OfflineReason uint16 + + // + OperationalStatus []uint16 + + // + StorageNode MSFT_StorageNode +} + +func NewMSFT_StorageNodeToDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageNodeToDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageNodeToDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageNodeToDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageNodeToDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageNodeToDisk{ + WmiInstance: tmp, + } + return +} + +// SetDisk sets the value of Disk for the instance +func (instance *MSFT_StorageNodeToDisk) SetPropertyDisk(value MSFT_Disk) (err error) { + return instance.SetProperty("Disk", (value)) +} + +// GetDisk gets the value of Disk for the instance +func (instance *MSFT_StorageNodeToDisk) GetPropertyDisk() (value MSFT_Disk, err error) { + retValue, err := instance.GetProperty("Disk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Disk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Disk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Disk(valuetmp) + + return +} + +// SetDiskNumber sets the value of DiskNumber for the instance +func (instance *MSFT_StorageNodeToDisk) SetPropertyDiskNumber(value uint32) (err error) { + return instance.SetProperty("DiskNumber", (value)) +} + +// GetDiskNumber gets the value of DiskNumber for the instance +func (instance *MSFT_StorageNodeToDisk) GetPropertyDiskNumber() (value uint32, err error) { + retValue, err := instance.GetProperty("DiskNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetHealthStatus sets the value of HealthStatus for the instance +func (instance *MSFT_StorageNodeToDisk) SetPropertyHealthStatus(value uint16) (err error) { + return instance.SetProperty("HealthStatus", (value)) +} + +// GetHealthStatus gets the value of HealthStatus for the instance +func (instance *MSFT_StorageNodeToDisk) GetPropertyHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("HealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetIsOffline sets the value of IsOffline for the instance +func (instance *MSFT_StorageNodeToDisk) SetPropertyIsOffline(value bool) (err error) { + return instance.SetProperty("IsOffline", (value)) +} + +// GetIsOffline gets the value of IsOffline for the instance +func (instance *MSFT_StorageNodeToDisk) GetPropertyIsOffline() (value bool, err error) { + retValue, err := instance.GetProperty("IsOffline") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsReadOnly sets the value of IsReadOnly for the instance +func (instance *MSFT_StorageNodeToDisk) SetPropertyIsReadOnly(value bool) (err error) { + return instance.SetProperty("IsReadOnly", (value)) +} + +// GetIsReadOnly gets the value of IsReadOnly for the instance +func (instance *MSFT_StorageNodeToDisk) GetPropertyIsReadOnly() (value bool, err error) { + retValue, err := instance.GetProperty("IsReadOnly") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetOfflineReason sets the value of OfflineReason for the instance +func (instance *MSFT_StorageNodeToDisk) SetPropertyOfflineReason(value uint16) (err error) { + return instance.SetProperty("OfflineReason", (value)) +} + +// GetOfflineReason gets the value of OfflineReason for the instance +func (instance *MSFT_StorageNodeToDisk) GetPropertyOfflineReason() (value uint16, err error) { + retValue, err := instance.GetProperty("OfflineReason") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_StorageNodeToDisk) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_StorageNodeToDisk) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetStorageNode sets the value of StorageNode for the instance +func (instance *MSFT_StorageNodeToDisk) SetPropertyStorageNode(value MSFT_StorageNode) (err error) { + return instance.SetProperty("StorageNode", (value)) +} + +// GetStorageNode gets the value of StorageNode for the instance +func (instance *MSFT_StorageNodeToDisk) GetPropertyStorageNode() (value MSFT_StorageNode, err error) { + retValue, err := instance.GetProperty("StorageNode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageNode) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageNode is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageNode(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToPhysicalDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToPhysicalDisk.go new file mode 100644 index 000000000..d177647c9 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToPhysicalDisk.go @@ -0,0 +1,354 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageNodeToPhysicalDisk struct +type MSFT_StorageNodeToPhysicalDisk struct { + *cim.WmiInstance + + // + DiskNumber uint32 + + // + HealthStatus uint16 + + // + IsMpioEnabled bool + + // + IsPhysicallyConnected bool + + // + LoadBalancePolicy uint16 + + // + OperationalStatus []uint16 + + // + PathId []string + + // + PathState []uint16 + + // + PhysicalDisk MSFT_PhysicalDisk + + // + StorageNode MSFT_StorageNode +} + +func NewMSFT_StorageNodeToPhysicalDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageNodeToPhysicalDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageNodeToPhysicalDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageNodeToPhysicalDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageNodeToPhysicalDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageNodeToPhysicalDisk{ + WmiInstance: tmp, + } + return +} + +// SetDiskNumber sets the value of DiskNumber for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) SetPropertyDiskNumber(value uint32) (err error) { + return instance.SetProperty("DiskNumber", (value)) +} + +// GetDiskNumber gets the value of DiskNumber for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) GetPropertyDiskNumber() (value uint32, err error) { + retValue, err := instance.GetProperty("DiskNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetHealthStatus sets the value of HealthStatus for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) SetPropertyHealthStatus(value uint16) (err error) { + return instance.SetProperty("HealthStatus", (value)) +} + +// GetHealthStatus gets the value of HealthStatus for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) GetPropertyHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("HealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetIsMpioEnabled sets the value of IsMpioEnabled for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) SetPropertyIsMpioEnabled(value bool) (err error) { + return instance.SetProperty("IsMpioEnabled", (value)) +} + +// GetIsMpioEnabled gets the value of IsMpioEnabled for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) GetPropertyIsMpioEnabled() (value bool, err error) { + retValue, err := instance.GetProperty("IsMpioEnabled") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsPhysicallyConnected sets the value of IsPhysicallyConnected for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) SetPropertyIsPhysicallyConnected(value bool) (err error) { + return instance.SetProperty("IsPhysicallyConnected", (value)) +} + +// GetIsPhysicallyConnected gets the value of IsPhysicallyConnected for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) GetPropertyIsPhysicallyConnected() (value bool, err error) { + retValue, err := instance.GetProperty("IsPhysicallyConnected") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetLoadBalancePolicy sets the value of LoadBalancePolicy for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) SetPropertyLoadBalancePolicy(value uint16) (err error) { + return instance.SetProperty("LoadBalancePolicy", (value)) +} + +// GetLoadBalancePolicy gets the value of LoadBalancePolicy for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) GetPropertyLoadBalancePolicy() (value uint16, err error) { + retValue, err := instance.GetProperty("LoadBalancePolicy") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetPathId sets the value of PathId for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) SetPropertyPathId(value []string) (err error) { + return instance.SetProperty("PathId", (value)) +} + +// GetPathId gets the value of PathId for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) GetPropertyPathId() (value []string, err error) { + retValue, err := instance.GetProperty("PathId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetPathState sets the value of PathState for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) SetPropertyPathState(value []uint16) (err error) { + return instance.SetProperty("PathState", (value)) +} + +// GetPathState gets the value of PathState for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) GetPropertyPathState() (value []uint16, err error) { + retValue, err := instance.GetProperty("PathState") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetPhysicalDisk sets the value of PhysicalDisk for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) SetPropertyPhysicalDisk(value MSFT_PhysicalDisk) (err error) { + return instance.SetProperty("PhysicalDisk", (value)) +} + +// GetPhysicalDisk gets the value of PhysicalDisk for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) GetPropertyPhysicalDisk() (value MSFT_PhysicalDisk, err error) { + retValue, err := instance.GetProperty("PhysicalDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_PhysicalDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_PhysicalDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_PhysicalDisk(valuetmp) + + return +} + +// SetStorageNode sets the value of StorageNode for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) SetPropertyStorageNode(value MSFT_StorageNode) (err error) { + return instance.SetProperty("StorageNode", (value)) +} + +// GetStorageNode gets the value of StorageNode for the instance +func (instance *MSFT_StorageNodeToPhysicalDisk) GetPropertyStorageNode() (value MSFT_StorageNode, err error) { + retValue, err := instance.GetProperty("StorageNode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageNode) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageNode is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageNode(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToStorageEnclosure.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToStorageEnclosure.go new file mode 100644 index 000000000..3ae28efbf --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToStorageEnclosure.go @@ -0,0 +1,418 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageNodeToStorageEnclosure struct +type MSFT_StorageNodeToStorageEnclosure struct { + *cim.WmiInstance + + // + CurrentSensorOperationalStatus []uint16 + + // + EnclosureNumber uint32 + + // + FanOperationalStatus []uint16 + + // + HealthStatus uint16 + + // + IOControllerOperationalStatus []uint16 + + // + IsPhysicallyConnected bool + + // + PowerSupplyOperationalStatus []uint16 + + // + SlotOperationalStatus []uint16 + + // + StorageEnclosure MSFT_StorageEnclosure + + // + StorageNode MSFT_StorageNode + + // + TemperatureSensorOperationalStatus []uint16 + + // + VoltageSensorOperationalStatus []uint16 +} + +func NewMSFT_StorageNodeToStorageEnclosureEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageNodeToStorageEnclosure, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageNodeToStorageEnclosure{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageNodeToStorageEnclosureEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageNodeToStorageEnclosure, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageNodeToStorageEnclosure{ + WmiInstance: tmp, + } + return +} + +// SetCurrentSensorOperationalStatus sets the value of CurrentSensorOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) SetPropertyCurrentSensorOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("CurrentSensorOperationalStatus", (value)) +} + +// GetCurrentSensorOperationalStatus gets the value of CurrentSensorOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) GetPropertyCurrentSensorOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("CurrentSensorOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetEnclosureNumber sets the value of EnclosureNumber for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) SetPropertyEnclosureNumber(value uint32) (err error) { + return instance.SetProperty("EnclosureNumber", (value)) +} + +// GetEnclosureNumber gets the value of EnclosureNumber for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) GetPropertyEnclosureNumber() (value uint32, err error) { + retValue, err := instance.GetProperty("EnclosureNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetFanOperationalStatus sets the value of FanOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) SetPropertyFanOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("FanOperationalStatus", (value)) +} + +// GetFanOperationalStatus gets the value of FanOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) GetPropertyFanOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("FanOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetHealthStatus sets the value of HealthStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) SetPropertyHealthStatus(value uint16) (err error) { + return instance.SetProperty("HealthStatus", (value)) +} + +// GetHealthStatus gets the value of HealthStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) GetPropertyHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("HealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetIOControllerOperationalStatus sets the value of IOControllerOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) SetPropertyIOControllerOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("IOControllerOperationalStatus", (value)) +} + +// GetIOControllerOperationalStatus gets the value of IOControllerOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) GetPropertyIOControllerOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("IOControllerOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetIsPhysicallyConnected sets the value of IsPhysicallyConnected for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) SetPropertyIsPhysicallyConnected(value bool) (err error) { + return instance.SetProperty("IsPhysicallyConnected", (value)) +} + +// GetIsPhysicallyConnected gets the value of IsPhysicallyConnected for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) GetPropertyIsPhysicallyConnected() (value bool, err error) { + retValue, err := instance.GetProperty("IsPhysicallyConnected") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetPowerSupplyOperationalStatus sets the value of PowerSupplyOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) SetPropertyPowerSupplyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("PowerSupplyOperationalStatus", (value)) +} + +// GetPowerSupplyOperationalStatus gets the value of PowerSupplyOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) GetPropertyPowerSupplyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("PowerSupplyOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSlotOperationalStatus sets the value of SlotOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) SetPropertySlotOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("SlotOperationalStatus", (value)) +} + +// GetSlotOperationalStatus gets the value of SlotOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) GetPropertySlotOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("SlotOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetStorageEnclosure sets the value of StorageEnclosure for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) SetPropertyStorageEnclosure(value MSFT_StorageEnclosure) (err error) { + return instance.SetProperty("StorageEnclosure", (value)) +} + +// GetStorageEnclosure gets the value of StorageEnclosure for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) GetPropertyStorageEnclosure() (value MSFT_StorageEnclosure, err error) { + retValue, err := instance.GetProperty("StorageEnclosure") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageEnclosure) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageEnclosure is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageEnclosure(valuetmp) + + return +} + +// SetStorageNode sets the value of StorageNode for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) SetPropertyStorageNode(value MSFT_StorageNode) (err error) { + return instance.SetProperty("StorageNode", (value)) +} + +// GetStorageNode gets the value of StorageNode for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) GetPropertyStorageNode() (value MSFT_StorageNode, err error) { + retValue, err := instance.GetProperty("StorageNode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageNode) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageNode is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageNode(valuetmp) + + return +} + +// SetTemperatureSensorOperationalStatus sets the value of TemperatureSensorOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) SetPropertyTemperatureSensorOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("TemperatureSensorOperationalStatus", (value)) +} + +// GetTemperatureSensorOperationalStatus gets the value of TemperatureSensorOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) GetPropertyTemperatureSensorOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("TemperatureSensorOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetVoltageSensorOperationalStatus sets the value of VoltageSensorOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) SetPropertyVoltageSensorOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("VoltageSensorOperationalStatus", (value)) +} + +// GetVoltageSensorOperationalStatus gets the value of VoltageSensorOperationalStatus for the instance +func (instance *MSFT_StorageNodeToStorageEnclosure) GetPropertyVoltageSensorOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("VoltageSensorOperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToStoragePool.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToStoragePool.go new file mode 100644 index 000000000..2cded689a --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToStoragePool.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageNodeToStoragePool struct +type MSFT_StorageNodeToStoragePool struct { + *cim.WmiInstance + + // + StorageNode MSFT_StorageNode + + // + StoragePool MSFT_StoragePool +} + +func NewMSFT_StorageNodeToStoragePoolEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageNodeToStoragePool, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageNodeToStoragePool{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageNodeToStoragePoolEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageNodeToStoragePool, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageNodeToStoragePool{ + WmiInstance: tmp, + } + return +} + +// SetStorageNode sets the value of StorageNode for the instance +func (instance *MSFT_StorageNodeToStoragePool) SetPropertyStorageNode(value MSFT_StorageNode) (err error) { + return instance.SetProperty("StorageNode", (value)) +} + +// GetStorageNode gets the value of StorageNode for the instance +func (instance *MSFT_StorageNodeToStoragePool) GetPropertyStorageNode() (value MSFT_StorageNode, err error) { + retValue, err := instance.GetProperty("StorageNode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageNode) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageNode is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageNode(valuetmp) + + return +} + +// SetStoragePool sets the value of StoragePool for the instance +func (instance *MSFT_StorageNodeToStoragePool) SetPropertyStoragePool(value MSFT_StoragePool) (err error) { + return instance.SetProperty("StoragePool", (value)) +} + +// GetStoragePool gets the value of StoragePool for the instance +func (instance *MSFT_StorageNodeToStoragePool) GetPropertyStoragePool() (value MSFT_StoragePool, err error) { + retValue, err := instance.GetProperty("StoragePool") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StoragePool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StoragePool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StoragePool(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToVirtualDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToVirtualDisk.go new file mode 100644 index 000000000..35d81102b --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToVirtualDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageNodeToVirtualDisk struct +type MSFT_StorageNodeToVirtualDisk struct { + *cim.WmiInstance + + // + StorageNode MSFT_StorageNode + + // + VirtualDisk MSFT_VirtualDisk +} + +func NewMSFT_StorageNodeToVirtualDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageNodeToVirtualDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageNodeToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageNodeToVirtualDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageNodeToVirtualDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageNodeToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +// SetStorageNode sets the value of StorageNode for the instance +func (instance *MSFT_StorageNodeToVirtualDisk) SetPropertyStorageNode(value MSFT_StorageNode) (err error) { + return instance.SetProperty("StorageNode", (value)) +} + +// GetStorageNode gets the value of StorageNode for the instance +func (instance *MSFT_StorageNodeToVirtualDisk) GetPropertyStorageNode() (value MSFT_StorageNode, err error) { + retValue, err := instance.GetProperty("StorageNode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageNode) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageNode is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageNode(valuetmp) + + return +} + +// SetVirtualDisk sets the value of VirtualDisk for the instance +func (instance *MSFT_StorageNodeToVirtualDisk) SetPropertyVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("VirtualDisk", (value)) +} + +// GetVirtualDisk gets the value of VirtualDisk for the instance +func (instance *MSFT_StorageNodeToVirtualDisk) GetPropertyVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("VirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToVolume.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToVolume.go new file mode 100644 index 000000000..038141919 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageNodeToVolume.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageNodeToVolume struct +type MSFT_StorageNodeToVolume struct { + *cim.WmiInstance + + // + StorageNode MSFT_StorageNode + + // + Volume MSFT_Volume +} + +func NewMSFT_StorageNodeToVolumeEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageNodeToVolume, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageNodeToVolume{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageNodeToVolumeEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageNodeToVolume, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageNodeToVolume{ + WmiInstance: tmp, + } + return +} + +// SetStorageNode sets the value of StorageNode for the instance +func (instance *MSFT_StorageNodeToVolume) SetPropertyStorageNode(value MSFT_StorageNode) (err error) { + return instance.SetProperty("StorageNode", (value)) +} + +// GetStorageNode gets the value of StorageNode for the instance +func (instance *MSFT_StorageNodeToVolume) GetPropertyStorageNode() (value MSFT_StorageNode, err error) { + retValue, err := instance.GetProperty("StorageNode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageNode) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageNode is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageNode(valuetmp) + + return +} + +// SetVolume sets the value of Volume for the instance +func (instance *MSFT_StorageNodeToVolume) SetPropertyVolume(value MSFT_Volume) (err error) { + return instance.SetProperty("Volume", (value)) +} + +// GetVolume gets the value of Volume for the instance +func (instance *MSFT_StorageNodeToVolume) GetPropertyVolume() (value MSFT_Volume, err error) { + retValue, err := instance.GetProperty("Volume") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Volume) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Volume is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Volume(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageObject.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageObject.go new file mode 100644 index 000000000..c2bb86dce --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageObject.go @@ -0,0 +1,231 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageObject struct +type MSFT_StorageObject struct { + *cim.WmiInstance + + // + ObjectId string + + // + PassThroughClass string + + // + PassThroughIds string + + // + PassThroughNamespace string + + // + PassThroughServer string + + // + UniqueId string +} + +func NewMSFT_StorageObjectEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageObject, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageObject{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageObjectEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageObject, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageObject{ + WmiInstance: tmp, + } + return +} + +// SetObjectId sets the value of ObjectId for the instance +func (instance *MSFT_StorageObject) SetPropertyObjectId(value string) (err error) { + return instance.SetProperty("ObjectId", (value)) +} + +// GetObjectId gets the value of ObjectId for the instance +func (instance *MSFT_StorageObject) GetPropertyObjectId() (value string, err error) { + retValue, err := instance.GetProperty("ObjectId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPassThroughClass sets the value of PassThroughClass for the instance +func (instance *MSFT_StorageObject) SetPropertyPassThroughClass(value string) (err error) { + return instance.SetProperty("PassThroughClass", (value)) +} + +// GetPassThroughClass gets the value of PassThroughClass for the instance +func (instance *MSFT_StorageObject) GetPropertyPassThroughClass() (value string, err error) { + retValue, err := instance.GetProperty("PassThroughClass") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPassThroughIds sets the value of PassThroughIds for the instance +func (instance *MSFT_StorageObject) SetPropertyPassThroughIds(value string) (err error) { + return instance.SetProperty("PassThroughIds", (value)) +} + +// GetPassThroughIds gets the value of PassThroughIds for the instance +func (instance *MSFT_StorageObject) GetPropertyPassThroughIds() (value string, err error) { + retValue, err := instance.GetProperty("PassThroughIds") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPassThroughNamespace sets the value of PassThroughNamespace for the instance +func (instance *MSFT_StorageObject) SetPropertyPassThroughNamespace(value string) (err error) { + return instance.SetProperty("PassThroughNamespace", (value)) +} + +// GetPassThroughNamespace gets the value of PassThroughNamespace for the instance +func (instance *MSFT_StorageObject) GetPropertyPassThroughNamespace() (value string, err error) { + retValue, err := instance.GetProperty("PassThroughNamespace") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPassThroughServer sets the value of PassThroughServer for the instance +func (instance *MSFT_StorageObject) SetPropertyPassThroughServer(value string) (err error) { + return instance.SetProperty("PassThroughServer", (value)) +} + +// GetPassThroughServer gets the value of PassThroughServer for the instance +func (instance *MSFT_StorageObject) GetPropertyPassThroughServer() (value string, err error) { + retValue, err := instance.GetProperty("PassThroughServer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetUniqueId sets the value of UniqueId for the instance +func (instance *MSFT_StorageObject) SetPropertyUniqueId(value string) (err error) { + return instance.SetProperty("UniqueId", (value)) +} + +// GetUniqueId gets the value of UniqueId for the instance +func (instance *MSFT_StorageObject) GetPropertyUniqueId() (value string, err error) { + retValue, err := instance.GetProperty("UniqueId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePool.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePool.go new file mode 100644 index 000000000..56cb03b4f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePool.go @@ -0,0 +1,1415 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StoragePool struct +type MSFT_StoragePool struct { + *MSFT_StorageObject + + // + AllocatedSize uint64 + + // + ClearOnDeallocate bool + + // + EnclosureAwareDefault bool + + // + FaultDomainAwarenessDefault uint16 + + // + FriendlyName string + + // + HealthStatus uint16 + + // + IsClustered bool + + // + IsPowerProtected bool + + // + IsPrimordial bool + + // + IsReadOnly bool + + // + LogicalSectorSize uint64 + + // + MediaTypeDefault uint16 + + // + Name string + + // + OperationalStatus []uint16 + + // + OtherOperationalStatusDescription string + + // + OtherUsageDescription string + + // + PhysicalSectorSize uint64 + + // + ProvisioningTypeDefault uint16 + + // + ReadOnlyReason uint16 + + // + RepairPolicy uint16 + + // + ResiliencySettingNameDefault string + + // + RetireMissingPhysicalDisks uint16 + + // + Size uint64 + + // + SupportedProvisioningTypes []uint16 + + // + SupportsDeduplication bool + + // + ThinProvisioningAlertThresholds []uint16 + + // + Usage uint16 + + // + Version uint16 + + // + WriteCacheSizeDefault uint64 + + // + WriteCacheSizeMax uint64 + + // + WriteCacheSizeMin uint64 +} + +func NewMSFT_StoragePoolEx1(instance *cim.WmiInstance) (newInstance *MSFT_StoragePool, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StoragePool{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_StoragePoolEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StoragePool, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StoragePool{ + MSFT_StorageObject: tmp, + } + return +} + +// SetAllocatedSize sets the value of AllocatedSize for the instance +func (instance *MSFT_StoragePool) SetPropertyAllocatedSize(value uint64) (err error) { + return instance.SetProperty("AllocatedSize", (value)) +} + +// GetAllocatedSize gets the value of AllocatedSize for the instance +func (instance *MSFT_StoragePool) GetPropertyAllocatedSize() (value uint64, err error) { + retValue, err := instance.GetProperty("AllocatedSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetClearOnDeallocate sets the value of ClearOnDeallocate for the instance +func (instance *MSFT_StoragePool) SetPropertyClearOnDeallocate(value bool) (err error) { + return instance.SetProperty("ClearOnDeallocate", (value)) +} + +// GetClearOnDeallocate gets the value of ClearOnDeallocate for the instance +func (instance *MSFT_StoragePool) GetPropertyClearOnDeallocate() (value bool, err error) { + retValue, err := instance.GetProperty("ClearOnDeallocate") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetEnclosureAwareDefault sets the value of EnclosureAwareDefault for the instance +func (instance *MSFT_StoragePool) SetPropertyEnclosureAwareDefault(value bool) (err error) { + return instance.SetProperty("EnclosureAwareDefault", (value)) +} + +// GetEnclosureAwareDefault gets the value of EnclosureAwareDefault for the instance +func (instance *MSFT_StoragePool) GetPropertyEnclosureAwareDefault() (value bool, err error) { + retValue, err := instance.GetProperty("EnclosureAwareDefault") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetFaultDomainAwarenessDefault sets the value of FaultDomainAwarenessDefault for the instance +func (instance *MSFT_StoragePool) SetPropertyFaultDomainAwarenessDefault(value uint16) (err error) { + return instance.SetProperty("FaultDomainAwarenessDefault", (value)) +} + +// GetFaultDomainAwarenessDefault gets the value of FaultDomainAwarenessDefault for the instance +func (instance *MSFT_StoragePool) GetPropertyFaultDomainAwarenessDefault() (value uint16, err error) { + retValue, err := instance.GetProperty("FaultDomainAwarenessDefault") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetFriendlyName sets the value of FriendlyName for the instance +func (instance *MSFT_StoragePool) SetPropertyFriendlyName(value string) (err error) { + return instance.SetProperty("FriendlyName", (value)) +} + +// GetFriendlyName gets the value of FriendlyName for the instance +func (instance *MSFT_StoragePool) GetPropertyFriendlyName() (value string, err error) { + retValue, err := instance.GetProperty("FriendlyName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetHealthStatus sets the value of HealthStatus for the instance +func (instance *MSFT_StoragePool) SetPropertyHealthStatus(value uint16) (err error) { + return instance.SetProperty("HealthStatus", (value)) +} + +// GetHealthStatus gets the value of HealthStatus for the instance +func (instance *MSFT_StoragePool) GetPropertyHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("HealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetIsClustered sets the value of IsClustered for the instance +func (instance *MSFT_StoragePool) SetPropertyIsClustered(value bool) (err error) { + return instance.SetProperty("IsClustered", (value)) +} + +// GetIsClustered gets the value of IsClustered for the instance +func (instance *MSFT_StoragePool) GetPropertyIsClustered() (value bool, err error) { + retValue, err := instance.GetProperty("IsClustered") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsPowerProtected sets the value of IsPowerProtected for the instance +func (instance *MSFT_StoragePool) SetPropertyIsPowerProtected(value bool) (err error) { + return instance.SetProperty("IsPowerProtected", (value)) +} + +// GetIsPowerProtected gets the value of IsPowerProtected for the instance +func (instance *MSFT_StoragePool) GetPropertyIsPowerProtected() (value bool, err error) { + retValue, err := instance.GetProperty("IsPowerProtected") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsPrimordial sets the value of IsPrimordial for the instance +func (instance *MSFT_StoragePool) SetPropertyIsPrimordial(value bool) (err error) { + return instance.SetProperty("IsPrimordial", (value)) +} + +// GetIsPrimordial gets the value of IsPrimordial for the instance +func (instance *MSFT_StoragePool) GetPropertyIsPrimordial() (value bool, err error) { + retValue, err := instance.GetProperty("IsPrimordial") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsReadOnly sets the value of IsReadOnly for the instance +func (instance *MSFT_StoragePool) SetPropertyIsReadOnly(value bool) (err error) { + return instance.SetProperty("IsReadOnly", (value)) +} + +// GetIsReadOnly gets the value of IsReadOnly for the instance +func (instance *MSFT_StoragePool) GetPropertyIsReadOnly() (value bool, err error) { + retValue, err := instance.GetProperty("IsReadOnly") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetLogicalSectorSize sets the value of LogicalSectorSize for the instance +func (instance *MSFT_StoragePool) SetPropertyLogicalSectorSize(value uint64) (err error) { + return instance.SetProperty("LogicalSectorSize", (value)) +} + +// GetLogicalSectorSize gets the value of LogicalSectorSize for the instance +func (instance *MSFT_StoragePool) GetPropertyLogicalSectorSize() (value uint64, err error) { + retValue, err := instance.GetProperty("LogicalSectorSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetMediaTypeDefault sets the value of MediaTypeDefault for the instance +func (instance *MSFT_StoragePool) SetPropertyMediaTypeDefault(value uint16) (err error) { + return instance.SetProperty("MediaTypeDefault", (value)) +} + +// GetMediaTypeDefault gets the value of MediaTypeDefault for the instance +func (instance *MSFT_StoragePool) GetPropertyMediaTypeDefault() (value uint16, err error) { + retValue, err := instance.GetProperty("MediaTypeDefault") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetName sets the value of Name for the instance +func (instance *MSFT_StoragePool) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *MSFT_StoragePool) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_StoragePool) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_StoragePool) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetOtherOperationalStatusDescription sets the value of OtherOperationalStatusDescription for the instance +func (instance *MSFT_StoragePool) SetPropertyOtherOperationalStatusDescription(value string) (err error) { + return instance.SetProperty("OtherOperationalStatusDescription", (value)) +} + +// GetOtherOperationalStatusDescription gets the value of OtherOperationalStatusDescription for the instance +func (instance *MSFT_StoragePool) GetPropertyOtherOperationalStatusDescription() (value string, err error) { + retValue, err := instance.GetProperty("OtherOperationalStatusDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOtherUsageDescription sets the value of OtherUsageDescription for the instance +func (instance *MSFT_StoragePool) SetPropertyOtherUsageDescription(value string) (err error) { + return instance.SetProperty("OtherUsageDescription", (value)) +} + +// GetOtherUsageDescription gets the value of OtherUsageDescription for the instance +func (instance *MSFT_StoragePool) GetPropertyOtherUsageDescription() (value string, err error) { + retValue, err := instance.GetProperty("OtherUsageDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPhysicalSectorSize sets the value of PhysicalSectorSize for the instance +func (instance *MSFT_StoragePool) SetPropertyPhysicalSectorSize(value uint64) (err error) { + return instance.SetProperty("PhysicalSectorSize", (value)) +} + +// GetPhysicalSectorSize gets the value of PhysicalSectorSize for the instance +func (instance *MSFT_StoragePool) GetPropertyPhysicalSectorSize() (value uint64, err error) { + retValue, err := instance.GetProperty("PhysicalSectorSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetProvisioningTypeDefault sets the value of ProvisioningTypeDefault for the instance +func (instance *MSFT_StoragePool) SetPropertyProvisioningTypeDefault(value uint16) (err error) { + return instance.SetProperty("ProvisioningTypeDefault", (value)) +} + +// GetProvisioningTypeDefault gets the value of ProvisioningTypeDefault for the instance +func (instance *MSFT_StoragePool) GetPropertyProvisioningTypeDefault() (value uint16, err error) { + retValue, err := instance.GetProperty("ProvisioningTypeDefault") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetReadOnlyReason sets the value of ReadOnlyReason for the instance +func (instance *MSFT_StoragePool) SetPropertyReadOnlyReason(value uint16) (err error) { + return instance.SetProperty("ReadOnlyReason", (value)) +} + +// GetReadOnlyReason gets the value of ReadOnlyReason for the instance +func (instance *MSFT_StoragePool) GetPropertyReadOnlyReason() (value uint16, err error) { + retValue, err := instance.GetProperty("ReadOnlyReason") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetRepairPolicy sets the value of RepairPolicy for the instance +func (instance *MSFT_StoragePool) SetPropertyRepairPolicy(value uint16) (err error) { + return instance.SetProperty("RepairPolicy", (value)) +} + +// GetRepairPolicy gets the value of RepairPolicy for the instance +func (instance *MSFT_StoragePool) GetPropertyRepairPolicy() (value uint16, err error) { + retValue, err := instance.GetProperty("RepairPolicy") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetResiliencySettingNameDefault sets the value of ResiliencySettingNameDefault for the instance +func (instance *MSFT_StoragePool) SetPropertyResiliencySettingNameDefault(value string) (err error) { + return instance.SetProperty("ResiliencySettingNameDefault", (value)) +} + +// GetResiliencySettingNameDefault gets the value of ResiliencySettingNameDefault for the instance +func (instance *MSFT_StoragePool) GetPropertyResiliencySettingNameDefault() (value string, err error) { + retValue, err := instance.GetProperty("ResiliencySettingNameDefault") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetRetireMissingPhysicalDisks sets the value of RetireMissingPhysicalDisks for the instance +func (instance *MSFT_StoragePool) SetPropertyRetireMissingPhysicalDisks(value uint16) (err error) { + return instance.SetProperty("RetireMissingPhysicalDisks", (value)) +} + +// GetRetireMissingPhysicalDisks gets the value of RetireMissingPhysicalDisks for the instance +func (instance *MSFT_StoragePool) GetPropertyRetireMissingPhysicalDisks() (value uint16, err error) { + retValue, err := instance.GetProperty("RetireMissingPhysicalDisks") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSize sets the value of Size for the instance +func (instance *MSFT_StoragePool) SetPropertySize(value uint64) (err error) { + return instance.SetProperty("Size", (value)) +} + +// GetSize gets the value of Size for the instance +func (instance *MSFT_StoragePool) GetPropertySize() (value uint64, err error) { + retValue, err := instance.GetProperty("Size") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetSupportedProvisioningTypes sets the value of SupportedProvisioningTypes for the instance +func (instance *MSFT_StoragePool) SetPropertySupportedProvisioningTypes(value []uint16) (err error) { + return instance.SetProperty("SupportedProvisioningTypes", (value)) +} + +// GetSupportedProvisioningTypes gets the value of SupportedProvisioningTypes for the instance +func (instance *MSFT_StoragePool) GetPropertySupportedProvisioningTypes() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedProvisioningTypes") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSupportsDeduplication sets the value of SupportsDeduplication for the instance +func (instance *MSFT_StoragePool) SetPropertySupportsDeduplication(value bool) (err error) { + return instance.SetProperty("SupportsDeduplication", (value)) +} + +// GetSupportsDeduplication gets the value of SupportsDeduplication for the instance +func (instance *MSFT_StoragePool) GetPropertySupportsDeduplication() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsDeduplication") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetThinProvisioningAlertThresholds sets the value of ThinProvisioningAlertThresholds for the instance +func (instance *MSFT_StoragePool) SetPropertyThinProvisioningAlertThresholds(value []uint16) (err error) { + return instance.SetProperty("ThinProvisioningAlertThresholds", (value)) +} + +// GetThinProvisioningAlertThresholds gets the value of ThinProvisioningAlertThresholds for the instance +func (instance *MSFT_StoragePool) GetPropertyThinProvisioningAlertThresholds() (value []uint16, err error) { + retValue, err := instance.GetProperty("ThinProvisioningAlertThresholds") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetUsage sets the value of Usage for the instance +func (instance *MSFT_StoragePool) SetPropertyUsage(value uint16) (err error) { + return instance.SetProperty("Usage", (value)) +} + +// GetUsage gets the value of Usage for the instance +func (instance *MSFT_StoragePool) GetPropertyUsage() (value uint16, err error) { + retValue, err := instance.GetProperty("Usage") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetVersion sets the value of Version for the instance +func (instance *MSFT_StoragePool) SetPropertyVersion(value uint16) (err error) { + return instance.SetProperty("Version", (value)) +} + +// GetVersion gets the value of Version for the instance +func (instance *MSFT_StoragePool) GetPropertyVersion() (value uint16, err error) { + retValue, err := instance.GetProperty("Version") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetWriteCacheSizeDefault sets the value of WriteCacheSizeDefault for the instance +func (instance *MSFT_StoragePool) SetPropertyWriteCacheSizeDefault(value uint64) (err error) { + return instance.SetProperty("WriteCacheSizeDefault", (value)) +} + +// GetWriteCacheSizeDefault gets the value of WriteCacheSizeDefault for the instance +func (instance *MSFT_StoragePool) GetPropertyWriteCacheSizeDefault() (value uint64, err error) { + retValue, err := instance.GetProperty("WriteCacheSizeDefault") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetWriteCacheSizeMax sets the value of WriteCacheSizeMax for the instance +func (instance *MSFT_StoragePool) SetPropertyWriteCacheSizeMax(value uint64) (err error) { + return instance.SetProperty("WriteCacheSizeMax", (value)) +} + +// GetWriteCacheSizeMax gets the value of WriteCacheSizeMax for the instance +func (instance *MSFT_StoragePool) GetPropertyWriteCacheSizeMax() (value uint64, err error) { + retValue, err := instance.GetProperty("WriteCacheSizeMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetWriteCacheSizeMin sets the value of WriteCacheSizeMin for the instance +func (instance *MSFT_StoragePool) SetPropertyWriteCacheSizeMin(value uint64) (err error) { + return instance.SetProperty("WriteCacheSizeMin", (value)) +} + +// GetWriteCacheSizeMin gets the value of WriteCacheSizeMin for the instance +func (instance *MSFT_StoragePool) GetPropertyWriteCacheSizeMin() (value uint64, err error) { + retValue, err := instance.GetProperty("WriteCacheSizeMin") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +// +// +// +// +func (instance *MSFT_StoragePool) CreateVirtualDisk( /* IN */ FriendlyName string, + /* IN */ Size uint64, + /* IN */ UseMaximumSize bool, + /* IN */ ProvisioningType uint16, + /* IN */ AllocationUnitSize uint64, + /* IN */ MediaType uint16, + /* IN */ ResiliencySettingName string, + /* IN */ Usage uint16, + /* IN */ OtherUsageDescription string, + /* IN */ NumberOfDataCopies uint16, + /* IN */ PhysicalDiskRedundancy uint16, + /* IN */ NumberOfColumns uint16, + /* IN */ AutoNumberOfColumns bool, + /* IN */ Interleave uint64, + /* IN */ NumberOfGroups uint16, + /* IN */ IsEnclosureAware bool, + /* IN */ FaultDomainAwareness uint16, + /* IN */ ColumnIsolation uint16, + /* IN */ PhysicalDisksToUse []MSFT_PhysicalDisk, + /* IN */ StorageFaultDomainsToUse []MSFT_StorageFaultDomain, + /* IN */ StorageTiers []MSFT_StorageTier, + /* IN */ StorageTierSizes []uint64, + /* IN */ WriteCacheSize uint64, + /* IN */ AutoWriteCacheSize bool, + /* IN */ ReadCacheSize uint64, + /* IN */ RunAsJob bool, + /* OUT */ CreatedVirtualDisk MSFT_VirtualDisk, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateVirtualDisk", FriendlyName, Size, UseMaximumSize, ProvisioningType, AllocationUnitSize, MediaType, ResiliencySettingName, Usage, OtherUsageDescription, NumberOfDataCopies, PhysicalDiskRedundancy, NumberOfColumns, AutoNumberOfColumns, Interleave, NumberOfGroups, IsEnclosureAware, FaultDomainAwareness, ColumnIsolation, PhysicalDisksToUse, StorageFaultDomainsToUse, StorageTiers, StorageTierSizes, WriteCacheSize, AutoWriteCacheSize, ReadCacheSize, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +// +// +// +// +func (instance *MSFT_StoragePool) CreateVolume( /* IN */ FriendlyName string, + /* IN */ Size uint64, + /* IN */ StorageTiers []MSFT_StorageTier, + /* IN */ StorageTierSizes []uint64, + /* IN */ ProvisioningType uint16, + /* IN */ ResiliencySettingName string, + /* IN */ PhysicalDiskRedundancy uint16, + /* IN */ NumberOfColumns uint16, + /* IN */ FileSystem uint16, + /* IN */ AccessPath string, + /* IN */ AllocationUnitSize uint32, + /* IN */ ReadCacheSize uint64, + /* IN */ FileServer MSFT_FileServer, + /* OUT */ CreatedVolume MSFT_Volume, + /* OPTIONAL IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateVolume", FriendlyName, Size, StorageTiers, StorageTierSizes, ProvisioningType, ResiliencySettingName, PhysicalDiskRedundancy, NumberOfColumns, FileSystem, AccessPath, AllocationUnitSize, ReadCacheSize, FileServer, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +// +// +// +// +func (instance *MSFT_StoragePool) CreateStorageTier( /* IN */ FriendlyName string, + /* IN */ ProvisioningType uint16, + /* IN */ AllocationUnitSize uint64, + /* IN */ MediaType uint16, + /* IN */ FaultDomainAwareness uint16, + /* IN */ ColumnIsolation uint16, + /* IN */ StorageFaultDomainsToUse []MSFT_StorageFaultDomain, + /* IN */ ResiliencySettingName string, + /* IN */ Usage uint16, + /* IN */ Interleave uint64, + /* IN */ NumberOfDataCopies uint16, + /* IN */ NumberOfGroups uint16, + /* IN */ NumberOfColumns uint16, + /* IN */ PhysicalDiskRedundancy uint16, + /* IN */ Description string, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageTier MSFT_StorageTier, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateStorageTier", FriendlyName, ProvisioningType, AllocationUnitSize, MediaType, FaultDomainAwareness, ColumnIsolation, StorageFaultDomainsToUse, ResiliencySettingName, Usage, Interleave, NumberOfDataCopies, NumberOfGroups, NumberOfColumns, PhysicalDiskRedundancy, Description, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_StoragePool) DeleteObject( /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("DeleteObject", RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_StoragePool) Upgrade( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Upgrade") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_StoragePool) Optimize( /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Optimize", RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// + +// +// +// +func (instance *MSFT_StoragePool) AddPhysicalDisk( /* IN */ PhysicalDisks []MSFT_PhysicalDisk, + /* IN */ Usage uint16, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("AddPhysicalDisk", PhysicalDisks, Usage, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_StoragePool) RemovePhysicalDisk( /* IN */ PhysicalDisks []MSFT_PhysicalDisk, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RemovePhysicalDisk", PhysicalDisks, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +// +// +// +func (instance *MSFT_StoragePool) GetSupportedSize( /* IN */ ResiliencySettingName string, + /* IN */ FaultDomainAwareness uint16, + /* OUT */ SupportedSizes []uint64, + /* OUT */ VirtualDiskSizeMin uint64, + /* OUT */ VirtualDiskSizeMax uint64, + /* OUT */ VirtualDiskSizeDivisor uint64, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSupportedSize", ResiliencySettingName, FaultDomainAwareness) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_StoragePool) GetSecurityDescriptor( /* OUT */ SecurityDescriptor string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSecurityDescriptor") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_StoragePool) SetSecurityDescriptor( /* IN */ SecurityDescriptor string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetSecurityDescriptor", SecurityDescriptor) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_StoragePool) SetFriendlyName( /* IN */ FriendlyName string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetFriendlyName", FriendlyName) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +func (instance *MSFT_StoragePool) SetUsage( /* IN */ Usage uint16, + /* IN */ OtherUsageDescription string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetUsage", Usage, OtherUsageDescription) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// + +// +// +func (instance *MSFT_StoragePool) SetDefaults( /* IN */ ProvisioningTypeDefault uint16, + /* IN */ MediaTypeDefault uint16, + /* IN */ ResiliencySettingNameDefault string, + /* IN */ EnclosureAwareDefault bool, + /* IN */ FaultDomainAwarenessDefault uint16, + /* IN */ WriteCacheSizeDefault uint64, + /* IN */ AutoWriteCacheSize bool, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetDefaults", ProvisioningTypeDefault, MediaTypeDefault, ResiliencySettingNameDefault, EnclosureAwareDefault, FaultDomainAwarenessDefault, WriteCacheSizeDefault, AutoWriteCacheSize) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// + +// +// +func (instance *MSFT_StoragePool) SetAttributes( /* IN */ IsReadOnly bool, + /* IN */ ClearOnDeallocate bool, + /* IN */ IsPowerProtected bool, + /* IN */ RepairPolicy uint16, + /* IN */ RetireMissingPhysicalDisks uint16, + /* IN */ ThinProvisioningAlertThresholds []uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetAttributes", IsReadOnly, ClearOnDeallocate, IsPowerProtected, RepairPolicy, RetireMissingPhysicalDisks, ThinProvisioningAlertThresholds) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToPhysicalDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToPhysicalDisk.go new file mode 100644 index 000000000..6180c6d23 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToPhysicalDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StoragePoolToPhysicalDisk struct +type MSFT_StoragePoolToPhysicalDisk struct { + *cim.WmiInstance + + // + PhysicalDisk MSFT_PhysicalDisk + + // + StoragePool MSFT_StoragePool +} + +func NewMSFT_StoragePoolToPhysicalDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_StoragePoolToPhysicalDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StoragePoolToPhysicalDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StoragePoolToPhysicalDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StoragePoolToPhysicalDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StoragePoolToPhysicalDisk{ + WmiInstance: tmp, + } + return +} + +// SetPhysicalDisk sets the value of PhysicalDisk for the instance +func (instance *MSFT_StoragePoolToPhysicalDisk) SetPropertyPhysicalDisk(value MSFT_PhysicalDisk) (err error) { + return instance.SetProperty("PhysicalDisk", (value)) +} + +// GetPhysicalDisk gets the value of PhysicalDisk for the instance +func (instance *MSFT_StoragePoolToPhysicalDisk) GetPropertyPhysicalDisk() (value MSFT_PhysicalDisk, err error) { + retValue, err := instance.GetProperty("PhysicalDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_PhysicalDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_PhysicalDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_PhysicalDisk(valuetmp) + + return +} + +// SetStoragePool sets the value of StoragePool for the instance +func (instance *MSFT_StoragePoolToPhysicalDisk) SetPropertyStoragePool(value MSFT_StoragePool) (err error) { + return instance.SetProperty("StoragePool", (value)) +} + +// GetStoragePool gets the value of StoragePool for the instance +func (instance *MSFT_StoragePoolToPhysicalDisk) GetPropertyStoragePool() (value MSFT_StoragePool, err error) { + retValue, err := instance.GetProperty("StoragePool") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StoragePool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StoragePool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StoragePool(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToResiliencySetting.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToResiliencySetting.go new file mode 100644 index 000000000..3878f86f5 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToResiliencySetting.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StoragePoolToResiliencySetting struct +type MSFT_StoragePoolToResiliencySetting struct { + *cim.WmiInstance + + // + ResiliencySetting MSFT_ResiliencySetting + + // + StoragePool MSFT_StoragePool +} + +func NewMSFT_StoragePoolToResiliencySettingEx1(instance *cim.WmiInstance) (newInstance *MSFT_StoragePoolToResiliencySetting, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StoragePoolToResiliencySetting{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StoragePoolToResiliencySettingEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StoragePoolToResiliencySetting, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StoragePoolToResiliencySetting{ + WmiInstance: tmp, + } + return +} + +// SetResiliencySetting sets the value of ResiliencySetting for the instance +func (instance *MSFT_StoragePoolToResiliencySetting) SetPropertyResiliencySetting(value MSFT_ResiliencySetting) (err error) { + return instance.SetProperty("ResiliencySetting", (value)) +} + +// GetResiliencySetting gets the value of ResiliencySetting for the instance +func (instance *MSFT_StoragePoolToResiliencySetting) GetPropertyResiliencySetting() (value MSFT_ResiliencySetting, err error) { + retValue, err := instance.GetProperty("ResiliencySetting") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_ResiliencySetting) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_ResiliencySetting is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_ResiliencySetting(valuetmp) + + return +} + +// SetStoragePool sets the value of StoragePool for the instance +func (instance *MSFT_StoragePoolToResiliencySetting) SetPropertyStoragePool(value MSFT_StoragePool) (err error) { + return instance.SetProperty("StoragePool", (value)) +} + +// GetStoragePool gets the value of StoragePool for the instance +func (instance *MSFT_StoragePoolToResiliencySetting) GetPropertyStoragePool() (value MSFT_StoragePool, err error) { + retValue, err := instance.GetProperty("StoragePool") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StoragePool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StoragePool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StoragePool(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToStorageTier.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToStorageTier.go new file mode 100644 index 000000000..44d42e5b4 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToStorageTier.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StoragePoolToStorageTier struct +type MSFT_StoragePoolToStorageTier struct { + *cim.WmiInstance + + // + StoragePool MSFT_StoragePool + + // + StorageTier MSFT_StorageTier +} + +func NewMSFT_StoragePoolToStorageTierEx1(instance *cim.WmiInstance) (newInstance *MSFT_StoragePoolToStorageTier, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StoragePoolToStorageTier{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StoragePoolToStorageTierEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StoragePoolToStorageTier, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StoragePoolToStorageTier{ + WmiInstance: tmp, + } + return +} + +// SetStoragePool sets the value of StoragePool for the instance +func (instance *MSFT_StoragePoolToStorageTier) SetPropertyStoragePool(value MSFT_StoragePool) (err error) { + return instance.SetProperty("StoragePool", (value)) +} + +// GetStoragePool gets the value of StoragePool for the instance +func (instance *MSFT_StoragePoolToStorageTier) GetPropertyStoragePool() (value MSFT_StoragePool, err error) { + retValue, err := instance.GetProperty("StoragePool") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StoragePool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StoragePool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StoragePool(valuetmp) + + return +} + +// SetStorageTier sets the value of StorageTier for the instance +func (instance *MSFT_StoragePoolToStorageTier) SetPropertyStorageTier(value MSFT_StorageTier) (err error) { + return instance.SetProperty("StorageTier", (value)) +} + +// GetStorageTier gets the value of StorageTier for the instance +func (instance *MSFT_StoragePoolToStorageTier) GetPropertyStorageTier() (value MSFT_StorageTier, err error) { + retValue, err := instance.GetProperty("StorageTier") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageTier) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageTier is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageTier(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToVirtualDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToVirtualDisk.go new file mode 100644 index 000000000..8f5e7e38c --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToVirtualDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StoragePoolToVirtualDisk struct +type MSFT_StoragePoolToVirtualDisk struct { + *cim.WmiInstance + + // + StoragePool MSFT_StoragePool + + // + VirtualDisk MSFT_VirtualDisk +} + +func NewMSFT_StoragePoolToVirtualDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_StoragePoolToVirtualDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StoragePoolToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StoragePoolToVirtualDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StoragePoolToVirtualDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StoragePoolToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +// SetStoragePool sets the value of StoragePool for the instance +func (instance *MSFT_StoragePoolToVirtualDisk) SetPropertyStoragePool(value MSFT_StoragePool) (err error) { + return instance.SetProperty("StoragePool", (value)) +} + +// GetStoragePool gets the value of StoragePool for the instance +func (instance *MSFT_StoragePoolToVirtualDisk) GetPropertyStoragePool() (value MSFT_StoragePool, err error) { + retValue, err := instance.GetProperty("StoragePool") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StoragePool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StoragePool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StoragePool(valuetmp) + + return +} + +// SetVirtualDisk sets the value of VirtualDisk for the instance +func (instance *MSFT_StoragePoolToVirtualDisk) SetPropertyVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("VirtualDisk", (value)) +} + +// GetVirtualDisk gets the value of VirtualDisk for the instance +func (instance *MSFT_StoragePoolToVirtualDisk) GetPropertyVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("VirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToVolume.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToVolume.go new file mode 100644 index 000000000..60a72c274 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StoragePoolToVolume.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StoragePoolToVolume struct +type MSFT_StoragePoolToVolume struct { + *cim.WmiInstance + + // + StoragePool MSFT_StoragePool + + // + Volume MSFT_Volume +} + +func NewMSFT_StoragePoolToVolumeEx1(instance *cim.WmiInstance) (newInstance *MSFT_StoragePoolToVolume, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StoragePoolToVolume{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StoragePoolToVolumeEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StoragePoolToVolume, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StoragePoolToVolume{ + WmiInstance: tmp, + } + return +} + +// SetStoragePool sets the value of StoragePool for the instance +func (instance *MSFT_StoragePoolToVolume) SetPropertyStoragePool(value MSFT_StoragePool) (err error) { + return instance.SetProperty("StoragePool", (value)) +} + +// GetStoragePool gets the value of StoragePool for the instance +func (instance *MSFT_StoragePoolToVolume) GetPropertyStoragePool() (value MSFT_StoragePool, err error) { + retValue, err := instance.GetProperty("StoragePool") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StoragePool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StoragePool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StoragePool(valuetmp) + + return +} + +// SetVolume sets the value of Volume for the instance +func (instance *MSFT_StoragePoolToVolume) SetPropertyVolume(value MSFT_Volume) (err error) { + return instance.SetProperty("Volume", (value)) +} + +// GetVolume gets the value of Volume for the instance +func (instance *MSFT_StoragePoolToVolume) GetPropertyVolume() (value MSFT_Volume, err error) { + retValue, err := instance.GetProperty("Volume") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Volume) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Volume is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Volume(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageProvider.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageProvider.go new file mode 100644 index 000000000..8b271da66 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageProvider.go @@ -0,0 +1,472 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageProvider struct +type MSFT_StorageProvider struct { + *MSFT_StorageObject + + // + CimServerName string + + // + Manufacturer string + + // + Name string + + // + RemoteSubsystemCacheMode uint16 + + // + SupportedRemoteSubsystemCacheModes []uint16 + + // + SupportsSubsystemRegistration bool + + // + Type uint16 + + // + URI string + + // + URI_IP string + + // + Version string +} + +func NewMSFT_StorageProviderEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageProvider, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageProvider{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_StorageProviderEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageProvider, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageProvider{ + MSFT_StorageObject: tmp, + } + return +} + +// SetCimServerName sets the value of CimServerName for the instance +func (instance *MSFT_StorageProvider) SetPropertyCimServerName(value string) (err error) { + return instance.SetProperty("CimServerName", (value)) +} + +// GetCimServerName gets the value of CimServerName for the instance +func (instance *MSFT_StorageProvider) GetPropertyCimServerName() (value string, err error) { + retValue, err := instance.GetProperty("CimServerName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetManufacturer sets the value of Manufacturer for the instance +func (instance *MSFT_StorageProvider) SetPropertyManufacturer(value string) (err error) { + return instance.SetProperty("Manufacturer", (value)) +} + +// GetManufacturer gets the value of Manufacturer for the instance +func (instance *MSFT_StorageProvider) GetPropertyManufacturer() (value string, err error) { + retValue, err := instance.GetProperty("Manufacturer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetName sets the value of Name for the instance +func (instance *MSFT_StorageProvider) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *MSFT_StorageProvider) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetRemoteSubsystemCacheMode sets the value of RemoteSubsystemCacheMode for the instance +func (instance *MSFT_StorageProvider) SetPropertyRemoteSubsystemCacheMode(value uint16) (err error) { + return instance.SetProperty("RemoteSubsystemCacheMode", (value)) +} + +// GetRemoteSubsystemCacheMode gets the value of RemoteSubsystemCacheMode for the instance +func (instance *MSFT_StorageProvider) GetPropertyRemoteSubsystemCacheMode() (value uint16, err error) { + retValue, err := instance.GetProperty("RemoteSubsystemCacheMode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSupportedRemoteSubsystemCacheModes sets the value of SupportedRemoteSubsystemCacheModes for the instance +func (instance *MSFT_StorageProvider) SetPropertySupportedRemoteSubsystemCacheModes(value []uint16) (err error) { + return instance.SetProperty("SupportedRemoteSubsystemCacheModes", (value)) +} + +// GetSupportedRemoteSubsystemCacheModes gets the value of SupportedRemoteSubsystemCacheModes for the instance +func (instance *MSFT_StorageProvider) GetPropertySupportedRemoteSubsystemCacheModes() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedRemoteSubsystemCacheModes") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSupportsSubsystemRegistration sets the value of SupportsSubsystemRegistration for the instance +func (instance *MSFT_StorageProvider) SetPropertySupportsSubsystemRegistration(value bool) (err error) { + return instance.SetProperty("SupportsSubsystemRegistration", (value)) +} + +// GetSupportsSubsystemRegistration gets the value of SupportsSubsystemRegistration for the instance +func (instance *MSFT_StorageProvider) GetPropertySupportsSubsystemRegistration() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsSubsystemRegistration") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetType sets the value of Type for the instance +func (instance *MSFT_StorageProvider) SetPropertyType(value uint16) (err error) { + return instance.SetProperty("Type", (value)) +} + +// GetType gets the value of Type for the instance +func (instance *MSFT_StorageProvider) GetPropertyType() (value uint16, err error) { + retValue, err := instance.GetProperty("Type") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetURI sets the value of URI for the instance +func (instance *MSFT_StorageProvider) SetPropertyURI(value string) (err error) { + return instance.SetProperty("URI", (value)) +} + +// GetURI gets the value of URI for the instance +func (instance *MSFT_StorageProvider) GetPropertyURI() (value string, err error) { + retValue, err := instance.GetProperty("URI") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetURI_IP sets the value of URI_IP for the instance +func (instance *MSFT_StorageProvider) SetPropertyURI_IP(value string) (err error) { + return instance.SetProperty("URI_IP", (value)) +} + +// GetURI_IP gets the value of URI_IP for the instance +func (instance *MSFT_StorageProvider) GetPropertyURI_IP() (value string, err error) { + retValue, err := instance.GetProperty("URI_IP") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetVersion sets the value of Version for the instance +func (instance *MSFT_StorageProvider) SetPropertyVersion(value string) (err error) { + return instance.SetProperty("Version", (value)) +} + +// GetVersion gets the value of Version for the instance +func (instance *MSFT_StorageProvider) GetPropertyVersion() (value string, err error) { + retValue, err := instance.GetProperty("Version") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// + +// +// +// + +// +// +// +func (instance *MSFT_StorageProvider) Discover( /* IN */ DiscoveryLevel uint16, + /* IN */ RootObject MSFT_StorageObject, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Discover", DiscoveryLevel, RootObject, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_StorageProvider) GetSecurityDescriptor( /* OUT */ SecurityDescriptor string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSecurityDescriptor") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_StorageProvider) SetSecurityDescriptor( /* IN */ SecurityDescriptor string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetSecurityDescriptor", SecurityDescriptor) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_StorageProvider) RegisterSubsystem( /* IN */ ComputerName string, + /* IN */ Credential string, + /* OUT */ RegisteredSubsystem MSFT_StorageSubSystem, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RegisterSubsystem", ComputerName, Credential) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// + +// +// +func (instance *MSFT_StorageProvider) UnregisterSubsystem( /* IN */ Subsystem MSFT_StorageSubSystem, + /* IN */ StorageSubSystemUniqueId string, + /* IN */ Force bool, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("UnregisterSubsystem", Subsystem, StorageSubSystemUniqueId, Force) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_StorageProvider) SetAttributes( /* IN */ RemoteSubsystemCacheMode uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetAttributes", RemoteSubsystemCacheMode) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageProviderToStorageSubSystem.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageProviderToStorageSubSystem.go new file mode 100644 index 000000000..623a012dd --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageProviderToStorageSubSystem.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageProviderToStorageSubSystem struct +type MSFT_StorageProviderToStorageSubSystem struct { + *cim.WmiInstance + + // + StorageProvider MSFT_StorageProvider + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageProviderToStorageSubSystemEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageProviderToStorageSubSystem, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageProviderToStorageSubSystem{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageProviderToStorageSubSystemEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageProviderToStorageSubSystem, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageProviderToStorageSubSystem{ + WmiInstance: tmp, + } + return +} + +// SetStorageProvider sets the value of StorageProvider for the instance +func (instance *MSFT_StorageProviderToStorageSubSystem) SetPropertyStorageProvider(value MSFT_StorageProvider) (err error) { + return instance.SetProperty("StorageProvider", (value)) +} + +// GetStorageProvider gets the value of StorageProvider for the instance +func (instance *MSFT_StorageProviderToStorageSubSystem) GetPropertyStorageProvider() (value MSFT_StorageProvider, err error) { + retValue, err := instance.GetProperty("StorageProvider") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageProvider) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageProvider is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageProvider(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageProviderToStorageSubSystem) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageProviderToStorageSubSystem) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSFlow.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSFlow.go new file mode 100644 index 000000000..d1466afd4 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSFlow.go @@ -0,0 +1,651 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageQoSFlow struct +type MSFT_StorageQoSFlow struct { + *cim.WmiInstance + + // + BandwidthLimit uint64 + + // + FilePath string + + // + FlowId string + + // + InitiatorBandwidth uint64 + + // + InitiatorId string + + // + InitiatorIOPS uint64 + + // + InitiatorLatency uint64 + + // + InitiatorName string + + // + InitiatorNodeName string + + // + Interval uint64 + + // + Limit uint64 + + // + PolicyId string + + // + Reservation uint64 + + // + Status uint16 + + // + StorageNodeBandwidth uint64 + + // + StorageNodeIOPS uint64 + + // + StorageNodeLatency uint64 + + // + StorageNodeName string + + // + TimeStamp uint64 + + // + VolumeId string +} + +func NewMSFT_StorageQoSFlowEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageQoSFlow, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageQoSFlow{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageQoSFlowEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageQoSFlow, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageQoSFlow{ + WmiInstance: tmp, + } + return +} + +// SetBandwidthLimit sets the value of BandwidthLimit for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyBandwidthLimit(value uint64) (err error) { + return instance.SetProperty("BandwidthLimit", (value)) +} + +// GetBandwidthLimit gets the value of BandwidthLimit for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyBandwidthLimit() (value uint64, err error) { + retValue, err := instance.GetProperty("BandwidthLimit") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetFilePath sets the value of FilePath for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyFilePath(value string) (err error) { + return instance.SetProperty("FilePath", (value)) +} + +// GetFilePath gets the value of FilePath for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyFilePath() (value string, err error) { + retValue, err := instance.GetProperty("FilePath") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFlowId sets the value of FlowId for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyFlowId(value string) (err error) { + return instance.SetProperty("FlowId", (value)) +} + +// GetFlowId gets the value of FlowId for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyFlowId() (value string, err error) { + retValue, err := instance.GetProperty("FlowId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInitiatorBandwidth sets the value of InitiatorBandwidth for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyInitiatorBandwidth(value uint64) (err error) { + return instance.SetProperty("InitiatorBandwidth", (value)) +} + +// GetInitiatorBandwidth gets the value of InitiatorBandwidth for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyInitiatorBandwidth() (value uint64, err error) { + retValue, err := instance.GetProperty("InitiatorBandwidth") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetInitiatorId sets the value of InitiatorId for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyInitiatorId(value string) (err error) { + return instance.SetProperty("InitiatorId", (value)) +} + +// GetInitiatorId gets the value of InitiatorId for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyInitiatorId() (value string, err error) { + retValue, err := instance.GetProperty("InitiatorId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInitiatorIOPS sets the value of InitiatorIOPS for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyInitiatorIOPS(value uint64) (err error) { + return instance.SetProperty("InitiatorIOPS", (value)) +} + +// GetInitiatorIOPS gets the value of InitiatorIOPS for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyInitiatorIOPS() (value uint64, err error) { + retValue, err := instance.GetProperty("InitiatorIOPS") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetInitiatorLatency sets the value of InitiatorLatency for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyInitiatorLatency(value uint64) (err error) { + return instance.SetProperty("InitiatorLatency", (value)) +} + +// GetInitiatorLatency gets the value of InitiatorLatency for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyInitiatorLatency() (value uint64, err error) { + retValue, err := instance.GetProperty("InitiatorLatency") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetInitiatorName sets the value of InitiatorName for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyInitiatorName(value string) (err error) { + return instance.SetProperty("InitiatorName", (value)) +} + +// GetInitiatorName gets the value of InitiatorName for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyInitiatorName() (value string, err error) { + retValue, err := instance.GetProperty("InitiatorName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInitiatorNodeName sets the value of InitiatorNodeName for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyInitiatorNodeName(value string) (err error) { + return instance.SetProperty("InitiatorNodeName", (value)) +} + +// GetInitiatorNodeName gets the value of InitiatorNodeName for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyInitiatorNodeName() (value string, err error) { + retValue, err := instance.GetProperty("InitiatorNodeName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInterval sets the value of Interval for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyInterval(value uint64) (err error) { + return instance.SetProperty("Interval", (value)) +} + +// GetInterval gets the value of Interval for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyInterval() (value uint64, err error) { + retValue, err := instance.GetProperty("Interval") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetLimit sets the value of Limit for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyLimit(value uint64) (err error) { + return instance.SetProperty("Limit", (value)) +} + +// GetLimit gets the value of Limit for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyLimit() (value uint64, err error) { + retValue, err := instance.GetProperty("Limit") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetPolicyId sets the value of PolicyId for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyPolicyId(value string) (err error) { + return instance.SetProperty("PolicyId", (value)) +} + +// GetPolicyId gets the value of PolicyId for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyPolicyId() (value string, err error) { + retValue, err := instance.GetProperty("PolicyId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetReservation sets the value of Reservation for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyReservation(value uint64) (err error) { + return instance.SetProperty("Reservation", (value)) +} + +// GetReservation gets the value of Reservation for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyReservation() (value uint64, err error) { + retValue, err := instance.GetProperty("Reservation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetStatus sets the value of Status for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyStatus(value uint16) (err error) { + return instance.SetProperty("Status", (value)) +} + +// GetStatus gets the value of Status for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("Status") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetStorageNodeBandwidth sets the value of StorageNodeBandwidth for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyStorageNodeBandwidth(value uint64) (err error) { + return instance.SetProperty("StorageNodeBandwidth", (value)) +} + +// GetStorageNodeBandwidth gets the value of StorageNodeBandwidth for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyStorageNodeBandwidth() (value uint64, err error) { + retValue, err := instance.GetProperty("StorageNodeBandwidth") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetStorageNodeIOPS sets the value of StorageNodeIOPS for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyStorageNodeIOPS(value uint64) (err error) { + return instance.SetProperty("StorageNodeIOPS", (value)) +} + +// GetStorageNodeIOPS gets the value of StorageNodeIOPS for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyStorageNodeIOPS() (value uint64, err error) { + retValue, err := instance.GetProperty("StorageNodeIOPS") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetStorageNodeLatency sets the value of StorageNodeLatency for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyStorageNodeLatency(value uint64) (err error) { + return instance.SetProperty("StorageNodeLatency", (value)) +} + +// GetStorageNodeLatency gets the value of StorageNodeLatency for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyStorageNodeLatency() (value uint64, err error) { + retValue, err := instance.GetProperty("StorageNodeLatency") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetStorageNodeName sets the value of StorageNodeName for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyStorageNodeName(value string) (err error) { + return instance.SetProperty("StorageNodeName", (value)) +} + +// GetStorageNodeName gets the value of StorageNodeName for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyStorageNodeName() (value string, err error) { + retValue, err := instance.GetProperty("StorageNodeName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetTimeStamp sets the value of TimeStamp for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyTimeStamp(value uint64) (err error) { + return instance.SetProperty("TimeStamp", (value)) +} + +// GetTimeStamp gets the value of TimeStamp for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyTimeStamp() (value uint64, err error) { + retValue, err := instance.GetProperty("TimeStamp") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetVolumeId sets the value of VolumeId for the instance +func (instance *MSFT_StorageQoSFlow) SetPropertyVolumeId(value string) (err error) { + return instance.SetProperty("VolumeId", (value)) +} + +// GetVolumeId gets the value of VolumeId for the instance +func (instance *MSFT_StorageQoSFlow) GetPropertyVolumeId() (value string, err error) { + retValue, err := instance.GetProperty("VolumeId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicy.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicy.go new file mode 100644 index 000000000..bff48c2a4 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicy.go @@ -0,0 +1,325 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageQoSPolicy struct +type MSFT_StorageQoSPolicy struct { + *cim.WmiInstance + + // + BandwidthLimit uint64 + + // + Name string + + // + ParentPolicy string + + // + PolicyId string + + // + PolicyType uint16 + + // + Status uint16 + + // + ThroughputLimit uint64 + + // + ThroughputReservation uint64 +} + +func NewMSFT_StorageQoSPolicyEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageQoSPolicy, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageQoSPolicy{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageQoSPolicyEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageQoSPolicy, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageQoSPolicy{ + WmiInstance: tmp, + } + return +} + +// SetBandwidthLimit sets the value of BandwidthLimit for the instance +func (instance *MSFT_StorageQoSPolicy) SetPropertyBandwidthLimit(value uint64) (err error) { + return instance.SetProperty("BandwidthLimit", (value)) +} + +// GetBandwidthLimit gets the value of BandwidthLimit for the instance +func (instance *MSFT_StorageQoSPolicy) GetPropertyBandwidthLimit() (value uint64, err error) { + retValue, err := instance.GetProperty("BandwidthLimit") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetName sets the value of Name for the instance +func (instance *MSFT_StorageQoSPolicy) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *MSFT_StorageQoSPolicy) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetParentPolicy sets the value of ParentPolicy for the instance +func (instance *MSFT_StorageQoSPolicy) SetPropertyParentPolicy(value string) (err error) { + return instance.SetProperty("ParentPolicy", (value)) +} + +// GetParentPolicy gets the value of ParentPolicy for the instance +func (instance *MSFT_StorageQoSPolicy) GetPropertyParentPolicy() (value string, err error) { + retValue, err := instance.GetProperty("ParentPolicy") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPolicyId sets the value of PolicyId for the instance +func (instance *MSFT_StorageQoSPolicy) SetPropertyPolicyId(value string) (err error) { + return instance.SetProperty("PolicyId", (value)) +} + +// GetPolicyId gets the value of PolicyId for the instance +func (instance *MSFT_StorageQoSPolicy) GetPropertyPolicyId() (value string, err error) { + retValue, err := instance.GetProperty("PolicyId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPolicyType sets the value of PolicyType for the instance +func (instance *MSFT_StorageQoSPolicy) SetPropertyPolicyType(value uint16) (err error) { + return instance.SetProperty("PolicyType", (value)) +} + +// GetPolicyType gets the value of PolicyType for the instance +func (instance *MSFT_StorageQoSPolicy) GetPropertyPolicyType() (value uint16, err error) { + retValue, err := instance.GetProperty("PolicyType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetStatus sets the value of Status for the instance +func (instance *MSFT_StorageQoSPolicy) SetPropertyStatus(value uint16) (err error) { + return instance.SetProperty("Status", (value)) +} + +// GetStatus gets the value of Status for the instance +func (instance *MSFT_StorageQoSPolicy) GetPropertyStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("Status") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetThroughputLimit sets the value of ThroughputLimit for the instance +func (instance *MSFT_StorageQoSPolicy) SetPropertyThroughputLimit(value uint64) (err error) { + return instance.SetProperty("ThroughputLimit", (value)) +} + +// GetThroughputLimit gets the value of ThroughputLimit for the instance +func (instance *MSFT_StorageQoSPolicy) GetPropertyThroughputLimit() (value uint64, err error) { + retValue, err := instance.GetProperty("ThroughputLimit") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetThroughputReservation sets the value of ThroughputReservation for the instance +func (instance *MSFT_StorageQoSPolicy) SetPropertyThroughputReservation(value uint64) (err error) { + return instance.SetProperty("ThroughputReservation", (value)) +} + +// GetThroughputReservation gets the value of ThroughputReservation for the instance +func (instance *MSFT_StorageQoSPolicy) GetPropertyThroughputReservation() (value uint64, err error) { + retValue, err := instance.GetProperty("ThroughputReservation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// + +// +// +// +// + +// +func (instance *MSFT_StorageQoSPolicy) SetAttributes( /* IN */ NewName string, + /* IN */ Limit uint64, + /* IN */ Reservation uint64, + /* IN */ BandwidthLimit uint64) (result int32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetAttributes", NewName, Limit, Reservation, BandwidthLimit) + if err != nil { + return + } + result = int32(retVal) + return + +} + +// + +// +func (instance *MSFT_StorageQoSPolicy) DeletePolicy() (result int32, err error) { + retVal, err := instance.InvokeMethodWithReturn("DeletePolicy") + if err != nil { + return + } + result = int32(retVal) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicyStore.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicyStore.go new file mode 100644 index 000000000..e89cc6592 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicyStore.go @@ -0,0 +1,143 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageQoSPolicyStore struct +type MSFT_StorageQoSPolicyStore struct { + *cim.WmiInstance + + // + Id string + + // + IOPSNormalizationSize uint32 +} + +func NewMSFT_StorageQoSPolicyStoreEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageQoSPolicyStore, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageQoSPolicyStore{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageQoSPolicyStoreEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageQoSPolicyStore, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageQoSPolicyStore{ + WmiInstance: tmp, + } + return +} + +// SetId sets the value of Id for the instance +func (instance *MSFT_StorageQoSPolicyStore) SetPropertyId(value string) (err error) { + return instance.SetProperty("Id", (value)) +} + +// GetId gets the value of Id for the instance +func (instance *MSFT_StorageQoSPolicyStore) GetPropertyId() (value string, err error) { + retValue, err := instance.GetProperty("Id") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetIOPSNormalizationSize sets the value of IOPSNormalizationSize for the instance +func (instance *MSFT_StorageQoSPolicyStore) SetPropertyIOPSNormalizationSize(value uint32) (err error) { + return instance.SetProperty("IOPSNormalizationSize", (value)) +} + +// GetIOPSNormalizationSize gets the value of IOPSNormalizationSize for the instance +func (instance *MSFT_StorageQoSPolicyStore) GetPropertyIOPSNormalizationSize() (value uint32, err error) { + retValue, err := instance.GetProperty("IOPSNormalizationSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// + +// + +// +// +func (instance *MSFT_StorageQoSPolicyStore) CreatePolicy( /* IN/OUT */ Policy MSFT_StorageQoSPolicy) (result int32, err error) { + retVal, err := instance.InvokeMethod("CreatePolicy") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = int32(retValue) + return + +} + +// + +// + +// +func (instance *MSFT_StorageQoSPolicyStore) SetAttributes( /* IN */ IOPSNormalizationSize uint32) (result int32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetAttributes", IOPSNormalizationSize) + if err != nil { + return + } + result = int32(retVal) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicyToChildPolicy.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicyToChildPolicy.go new file mode 100644 index 000000000..6a69dc044 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicyToChildPolicy.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageQoSPolicyToChildPolicy struct +type MSFT_StorageQoSPolicyToChildPolicy struct { + *cim.WmiInstance + + // + ChildPolicy MSFT_StorageQoSPolicy + + // + ParentPolicy MSFT_StorageQoSPolicy +} + +func NewMSFT_StorageQoSPolicyToChildPolicyEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageQoSPolicyToChildPolicy, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageQoSPolicyToChildPolicy{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageQoSPolicyToChildPolicyEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageQoSPolicyToChildPolicy, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageQoSPolicyToChildPolicy{ + WmiInstance: tmp, + } + return +} + +// SetChildPolicy sets the value of ChildPolicy for the instance +func (instance *MSFT_StorageQoSPolicyToChildPolicy) SetPropertyChildPolicy(value MSFT_StorageQoSPolicy) (err error) { + return instance.SetProperty("ChildPolicy", (value)) +} + +// GetChildPolicy gets the value of ChildPolicy for the instance +func (instance *MSFT_StorageQoSPolicyToChildPolicy) GetPropertyChildPolicy() (value MSFT_StorageQoSPolicy, err error) { + retValue, err := instance.GetProperty("ChildPolicy") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageQoSPolicy) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageQoSPolicy is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageQoSPolicy(valuetmp) + + return +} + +// SetParentPolicy sets the value of ParentPolicy for the instance +func (instance *MSFT_StorageQoSPolicyToChildPolicy) SetPropertyParentPolicy(value MSFT_StorageQoSPolicy) (err error) { + return instance.SetProperty("ParentPolicy", (value)) +} + +// GetParentPolicy gets the value of ParentPolicy for the instance +func (instance *MSFT_StorageQoSPolicyToChildPolicy) GetPropertyParentPolicy() (value MSFT_StorageQoSPolicy, err error) { + retValue, err := instance.GetProperty("ParentPolicy") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageQoSPolicy) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageQoSPolicy is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageQoSPolicy(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicyToFlow.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicyToFlow.go new file mode 100644 index 000000000..7c09d6445 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSPolicyToFlow.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageQoSPolicyToFlow struct +type MSFT_StorageQoSPolicyToFlow struct { + *cim.WmiInstance + + // + Flow MSFT_StorageQoSFlow + + // + Policy MSFT_StorageQoSPolicy +} + +func NewMSFT_StorageQoSPolicyToFlowEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageQoSPolicyToFlow, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageQoSPolicyToFlow{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageQoSPolicyToFlowEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageQoSPolicyToFlow, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageQoSPolicyToFlow{ + WmiInstance: tmp, + } + return +} + +// SetFlow sets the value of Flow for the instance +func (instance *MSFT_StorageQoSPolicyToFlow) SetPropertyFlow(value MSFT_StorageQoSFlow) (err error) { + return instance.SetProperty("Flow", (value)) +} + +// GetFlow gets the value of Flow for the instance +func (instance *MSFT_StorageQoSPolicyToFlow) GetPropertyFlow() (value MSFT_StorageQoSFlow, err error) { + retValue, err := instance.GetProperty("Flow") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageQoSFlow) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageQoSFlow is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageQoSFlow(valuetmp) + + return +} + +// SetPolicy sets the value of Policy for the instance +func (instance *MSFT_StorageQoSPolicyToFlow) SetPropertyPolicy(value MSFT_StorageQoSPolicy) (err error) { + return instance.SetProperty("Policy", (value)) +} + +// GetPolicy gets the value of Policy for the instance +func (instance *MSFT_StorageQoSPolicyToFlow) GetPropertyPolicy() (value MSFT_StorageQoSPolicy, err error) { + retValue, err := instance.GetProperty("Policy") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageQoSPolicy) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageQoSPolicy is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageQoSPolicy(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSVolume.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSVolume.go new file mode 100644 index 000000000..58d60c1fc --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageQoSVolume.go @@ -0,0 +1,381 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageQoSVolume struct +type MSFT_StorageQoSVolume struct { + *cim.WmiInstance + + // + Bandwidth uint64 + + // + BandwidthLimit uint64 + + // + Interval uint64 + + // + IOPS uint64 + + // + Latency uint64 + + // + Limit uint64 + + // + Mountpoint string + + // + Reservation uint64 + + // + Status uint16 + + // + TimeStamp uint64 + + // + VolumeId string +} + +func NewMSFT_StorageQoSVolumeEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageQoSVolume, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageQoSVolume{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageQoSVolumeEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageQoSVolume, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageQoSVolume{ + WmiInstance: tmp, + } + return +} + +// SetBandwidth sets the value of Bandwidth for the instance +func (instance *MSFT_StorageQoSVolume) SetPropertyBandwidth(value uint64) (err error) { + return instance.SetProperty("Bandwidth", (value)) +} + +// GetBandwidth gets the value of Bandwidth for the instance +func (instance *MSFT_StorageQoSVolume) GetPropertyBandwidth() (value uint64, err error) { + retValue, err := instance.GetProperty("Bandwidth") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetBandwidthLimit sets the value of BandwidthLimit for the instance +func (instance *MSFT_StorageQoSVolume) SetPropertyBandwidthLimit(value uint64) (err error) { + return instance.SetProperty("BandwidthLimit", (value)) +} + +// GetBandwidthLimit gets the value of BandwidthLimit for the instance +func (instance *MSFT_StorageQoSVolume) GetPropertyBandwidthLimit() (value uint64, err error) { + retValue, err := instance.GetProperty("BandwidthLimit") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetInterval sets the value of Interval for the instance +func (instance *MSFT_StorageQoSVolume) SetPropertyInterval(value uint64) (err error) { + return instance.SetProperty("Interval", (value)) +} + +// GetInterval gets the value of Interval for the instance +func (instance *MSFT_StorageQoSVolume) GetPropertyInterval() (value uint64, err error) { + retValue, err := instance.GetProperty("Interval") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetIOPS sets the value of IOPS for the instance +func (instance *MSFT_StorageQoSVolume) SetPropertyIOPS(value uint64) (err error) { + return instance.SetProperty("IOPS", (value)) +} + +// GetIOPS gets the value of IOPS for the instance +func (instance *MSFT_StorageQoSVolume) GetPropertyIOPS() (value uint64, err error) { + retValue, err := instance.GetProperty("IOPS") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetLatency sets the value of Latency for the instance +func (instance *MSFT_StorageQoSVolume) SetPropertyLatency(value uint64) (err error) { + return instance.SetProperty("Latency", (value)) +} + +// GetLatency gets the value of Latency for the instance +func (instance *MSFT_StorageQoSVolume) GetPropertyLatency() (value uint64, err error) { + retValue, err := instance.GetProperty("Latency") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetLimit sets the value of Limit for the instance +func (instance *MSFT_StorageQoSVolume) SetPropertyLimit(value uint64) (err error) { + return instance.SetProperty("Limit", (value)) +} + +// GetLimit gets the value of Limit for the instance +func (instance *MSFT_StorageQoSVolume) GetPropertyLimit() (value uint64, err error) { + retValue, err := instance.GetProperty("Limit") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetMountpoint sets the value of Mountpoint for the instance +func (instance *MSFT_StorageQoSVolume) SetPropertyMountpoint(value string) (err error) { + return instance.SetProperty("Mountpoint", (value)) +} + +// GetMountpoint gets the value of Mountpoint for the instance +func (instance *MSFT_StorageQoSVolume) GetPropertyMountpoint() (value string, err error) { + retValue, err := instance.GetProperty("Mountpoint") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetReservation sets the value of Reservation for the instance +func (instance *MSFT_StorageQoSVolume) SetPropertyReservation(value uint64) (err error) { + return instance.SetProperty("Reservation", (value)) +} + +// GetReservation gets the value of Reservation for the instance +func (instance *MSFT_StorageQoSVolume) GetPropertyReservation() (value uint64, err error) { + retValue, err := instance.GetProperty("Reservation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetStatus sets the value of Status for the instance +func (instance *MSFT_StorageQoSVolume) SetPropertyStatus(value uint16) (err error) { + return instance.SetProperty("Status", (value)) +} + +// GetStatus gets the value of Status for the instance +func (instance *MSFT_StorageQoSVolume) GetPropertyStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("Status") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetTimeStamp sets the value of TimeStamp for the instance +func (instance *MSFT_StorageQoSVolume) SetPropertyTimeStamp(value uint64) (err error) { + return instance.SetProperty("TimeStamp", (value)) +} + +// GetTimeStamp gets the value of TimeStamp for the instance +func (instance *MSFT_StorageQoSVolume) GetPropertyTimeStamp() (value uint64, err error) { + retValue, err := instance.GetProperty("TimeStamp") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetVolumeId sets the value of VolumeId for the instance +func (instance *MSFT_StorageQoSVolume) SetPropertyVolumeId(value string) (err error) { + return instance.SetProperty("VolumeId", (value)) +} + +// GetVolumeId gets the value of VolumeId for the instance +func (instance *MSFT_StorageQoSVolume) GetPropertyVolumeId() (value string, err error) { + retValue, err := instance.GetProperty("VolumeId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageRack.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageRack.go new file mode 100644 index 000000000..b5996bcb9 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageRack.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_StorageRack struct +type MSFT_StorageRack struct { + *MSFT_StorageFaultDomain +} + +func NewMSFT_StorageRackEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageRack, err error) { + tmp, err := NewMSFT_StorageFaultDomainEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageRack{ + MSFT_StorageFaultDomain: tmp, + } + return +} + +func NewMSFT_StorageRackEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageRack, err error) { + tmp, err := NewMSFT_StorageFaultDomainEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageRack{ + MSFT_StorageFaultDomain: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageReliabilityCounter.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageReliabilityCounter.go new file mode 100644 index 000000000..d2991a615 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageReliabilityCounter.go @@ -0,0 +1,633 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageReliabilityCounter struct +type MSFT_StorageReliabilityCounter struct { + *MSFT_StorageObject + + // + DeviceId string + + // + FlushLatencyMax uint64 + + // + LoadUnloadCycleCount uint32 + + // + LoadUnloadCycleCountMax uint32 + + // + ManufactureDate string + + // + PowerOnHours uint32 + + // + ReadErrorsCorrected uint64 + + // + ReadErrorsTotal uint64 + + // + ReadErrorsUncorrected uint64 + + // + ReadLatencyMax uint64 + + // + StartStopCycleCount uint32 + + // + StartStopCycleCountMax uint32 + + // + Temperature uint8 + + // + TemperatureMax uint8 + + // + Wear uint8 + + // + WriteErrorsCorrected uint64 + + // + WriteErrorsTotal uint64 + + // + WriteErrorsUncorrected uint64 + + // + WriteLatencyMax uint64 +} + +func NewMSFT_StorageReliabilityCounterEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageReliabilityCounter, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageReliabilityCounter{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_StorageReliabilityCounterEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageReliabilityCounter, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageReliabilityCounter{ + MSFT_StorageObject: tmp, + } + return +} + +// SetDeviceId sets the value of DeviceId for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyDeviceId(value string) (err error) { + return instance.SetProperty("DeviceId", (value)) +} + +// GetDeviceId gets the value of DeviceId for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyDeviceId() (value string, err error) { + retValue, err := instance.GetProperty("DeviceId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFlushLatencyMax sets the value of FlushLatencyMax for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyFlushLatencyMax(value uint64) (err error) { + return instance.SetProperty("FlushLatencyMax", (value)) +} + +// GetFlushLatencyMax gets the value of FlushLatencyMax for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyFlushLatencyMax() (value uint64, err error) { + retValue, err := instance.GetProperty("FlushLatencyMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetLoadUnloadCycleCount sets the value of LoadUnloadCycleCount for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyLoadUnloadCycleCount(value uint32) (err error) { + return instance.SetProperty("LoadUnloadCycleCount", (value)) +} + +// GetLoadUnloadCycleCount gets the value of LoadUnloadCycleCount for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyLoadUnloadCycleCount() (value uint32, err error) { + retValue, err := instance.GetProperty("LoadUnloadCycleCount") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetLoadUnloadCycleCountMax sets the value of LoadUnloadCycleCountMax for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyLoadUnloadCycleCountMax(value uint32) (err error) { + return instance.SetProperty("LoadUnloadCycleCountMax", (value)) +} + +// GetLoadUnloadCycleCountMax gets the value of LoadUnloadCycleCountMax for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyLoadUnloadCycleCountMax() (value uint32, err error) { + retValue, err := instance.GetProperty("LoadUnloadCycleCountMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetManufactureDate sets the value of ManufactureDate for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyManufactureDate(value string) (err error) { + return instance.SetProperty("ManufactureDate", (value)) +} + +// GetManufactureDate gets the value of ManufactureDate for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyManufactureDate() (value string, err error) { + retValue, err := instance.GetProperty("ManufactureDate") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPowerOnHours sets the value of PowerOnHours for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyPowerOnHours(value uint32) (err error) { + return instance.SetProperty("PowerOnHours", (value)) +} + +// GetPowerOnHours gets the value of PowerOnHours for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyPowerOnHours() (value uint32, err error) { + retValue, err := instance.GetProperty("PowerOnHours") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetReadErrorsCorrected sets the value of ReadErrorsCorrected for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyReadErrorsCorrected(value uint64) (err error) { + return instance.SetProperty("ReadErrorsCorrected", (value)) +} + +// GetReadErrorsCorrected gets the value of ReadErrorsCorrected for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyReadErrorsCorrected() (value uint64, err error) { + retValue, err := instance.GetProperty("ReadErrorsCorrected") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetReadErrorsTotal sets the value of ReadErrorsTotal for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyReadErrorsTotal(value uint64) (err error) { + return instance.SetProperty("ReadErrorsTotal", (value)) +} + +// GetReadErrorsTotal gets the value of ReadErrorsTotal for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyReadErrorsTotal() (value uint64, err error) { + retValue, err := instance.GetProperty("ReadErrorsTotal") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetReadErrorsUncorrected sets the value of ReadErrorsUncorrected for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyReadErrorsUncorrected(value uint64) (err error) { + return instance.SetProperty("ReadErrorsUncorrected", (value)) +} + +// GetReadErrorsUncorrected gets the value of ReadErrorsUncorrected for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyReadErrorsUncorrected() (value uint64, err error) { + retValue, err := instance.GetProperty("ReadErrorsUncorrected") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetReadLatencyMax sets the value of ReadLatencyMax for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyReadLatencyMax(value uint64) (err error) { + return instance.SetProperty("ReadLatencyMax", (value)) +} + +// GetReadLatencyMax gets the value of ReadLatencyMax for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyReadLatencyMax() (value uint64, err error) { + retValue, err := instance.GetProperty("ReadLatencyMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetStartStopCycleCount sets the value of StartStopCycleCount for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyStartStopCycleCount(value uint32) (err error) { + return instance.SetProperty("StartStopCycleCount", (value)) +} + +// GetStartStopCycleCount gets the value of StartStopCycleCount for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyStartStopCycleCount() (value uint32, err error) { + retValue, err := instance.GetProperty("StartStopCycleCount") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetStartStopCycleCountMax sets the value of StartStopCycleCountMax for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyStartStopCycleCountMax(value uint32) (err error) { + return instance.SetProperty("StartStopCycleCountMax", (value)) +} + +// GetStartStopCycleCountMax gets the value of StartStopCycleCountMax for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyStartStopCycleCountMax() (value uint32, err error) { + retValue, err := instance.GetProperty("StartStopCycleCountMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetTemperature sets the value of Temperature for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyTemperature(value uint8) (err error) { + return instance.SetProperty("Temperature", (value)) +} + +// GetTemperature gets the value of Temperature for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyTemperature() (value uint8, err error) { + retValue, err := instance.GetProperty("Temperature") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint8) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint8 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint8(valuetmp) + + return +} + +// SetTemperatureMax sets the value of TemperatureMax for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyTemperatureMax(value uint8) (err error) { + return instance.SetProperty("TemperatureMax", (value)) +} + +// GetTemperatureMax gets the value of TemperatureMax for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyTemperatureMax() (value uint8, err error) { + retValue, err := instance.GetProperty("TemperatureMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint8) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint8 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint8(valuetmp) + + return +} + +// SetWear sets the value of Wear for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyWear(value uint8) (err error) { + return instance.SetProperty("Wear", (value)) +} + +// GetWear gets the value of Wear for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyWear() (value uint8, err error) { + retValue, err := instance.GetProperty("Wear") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint8) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint8 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint8(valuetmp) + + return +} + +// SetWriteErrorsCorrected sets the value of WriteErrorsCorrected for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyWriteErrorsCorrected(value uint64) (err error) { + return instance.SetProperty("WriteErrorsCorrected", (value)) +} + +// GetWriteErrorsCorrected gets the value of WriteErrorsCorrected for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyWriteErrorsCorrected() (value uint64, err error) { + retValue, err := instance.GetProperty("WriteErrorsCorrected") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetWriteErrorsTotal sets the value of WriteErrorsTotal for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyWriteErrorsTotal(value uint64) (err error) { + return instance.SetProperty("WriteErrorsTotal", (value)) +} + +// GetWriteErrorsTotal gets the value of WriteErrorsTotal for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyWriteErrorsTotal() (value uint64, err error) { + retValue, err := instance.GetProperty("WriteErrorsTotal") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetWriteErrorsUncorrected sets the value of WriteErrorsUncorrected for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyWriteErrorsUncorrected(value uint64) (err error) { + return instance.SetProperty("WriteErrorsUncorrected", (value)) +} + +// GetWriteErrorsUncorrected gets the value of WriteErrorsUncorrected for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyWriteErrorsUncorrected() (value uint64, err error) { + retValue, err := instance.GetProperty("WriteErrorsUncorrected") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetWriteLatencyMax sets the value of WriteLatencyMax for the instance +func (instance *MSFT_StorageReliabilityCounter) SetPropertyWriteLatencyMax(value uint64) (err error) { + return instance.SetProperty("WriteLatencyMax", (value)) +} + +// GetWriteLatencyMax gets the value of WriteLatencyMax for the instance +func (instance *MSFT_StorageReliabilityCounter) GetPropertyWriteLatencyMax() (value uint64, err error) { + retValue, err := instance.GetProperty("WriteLatencyMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// + +// +func (instance *MSFT_StorageReliabilityCounter) Reset() (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("Reset") + if err != nil { + return + } + result = uint32(retVal) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageScaleUnit.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageScaleUnit.go new file mode 100644 index 000000000..8fc7224c1 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageScaleUnit.go @@ -0,0 +1,74 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_StorageScaleUnit struct +type MSFT_StorageScaleUnit struct { + *MSFT_StorageFaultDomain +} + +func NewMSFT_StorageScaleUnitEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageScaleUnit, err error) { + tmp, err := NewMSFT_StorageFaultDomainEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageScaleUnit{ + MSFT_StorageFaultDomain: tmp, + } + return +} + +func NewMSFT_StorageScaleUnitEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageScaleUnit, err error) { + tmp, err := NewMSFT_StorageFaultDomainEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageScaleUnit{ + MSFT_StorageFaultDomain: tmp, + } + return +} + +// + +// +// +// +// +// + +// +// +func (instance *MSFT_StorageScaleUnit) Maintenance( /* IN */ EnableMaintenanceMode bool, + /* IN */ Timeout uint32, + /* IN */ Model string, + /* IN */ Manufacturer string, + /* IN */ IgnoreDetachedVirtualDisks bool, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Maintenance", EnableMaintenanceMode, Timeout, Model, Manufacturer, IgnoreDetachedVirtualDisks) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSetting.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSetting.go new file mode 100644 index 000000000..f9ee55c14 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSetting.go @@ -0,0 +1,156 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSetting struct +type MSFT_StorageSetting struct { + *cim.WmiInstance + + // + NewDiskPolicy uint16 + + // + ScrubPolicy uint32 +} + +func NewMSFT_StorageSettingEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSetting, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSetting{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSettingEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSetting, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSetting{ + WmiInstance: tmp, + } + return +} + +// SetNewDiskPolicy sets the value of NewDiskPolicy for the instance +func (instance *MSFT_StorageSetting) SetPropertyNewDiskPolicy(value uint16) (err error) { + return instance.SetProperty("NewDiskPolicy", (value)) +} + +// GetNewDiskPolicy gets the value of NewDiskPolicy for the instance +func (instance *MSFT_StorageSetting) GetPropertyNewDiskPolicy() (value uint16, err error) { + retValue, err := instance.GetProperty("NewDiskPolicy") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetScrubPolicy sets the value of ScrubPolicy for the instance +func (instance *MSFT_StorageSetting) SetPropertyScrubPolicy(value uint32) (err error) { + return instance.SetProperty("ScrubPolicy", (value)) +} + +// GetScrubPolicy gets the value of ScrubPolicy for the instance +func (instance *MSFT_StorageSetting) GetPropertyScrubPolicy() (value uint32, err error) { + retValue, err := instance.GetProperty("ScrubPolicy") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// + +// +// +func (instance *MSFT_StorageSetting) Get( /* OUT */ StorageSetting MSFT_StorageSetting) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Get") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +func (instance *MSFT_StorageSetting) Set( /* IN */ NewDiskPolicy uint16, + /* IN */ ScrubPolicy uint32) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("Set", NewDiskPolicy, ScrubPolicy) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +func (instance *MSFT_StorageSetting) UpdateHostStorageCache() (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("UpdateHostStorageCache") + if err != nil { + return + } + result = uint32(retVal) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSite.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSite.go new file mode 100644 index 000000000..d59a3c98f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSite.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// MSFT_StorageSite struct +type MSFT_StorageSite struct { + *MSFT_StorageFaultDomain +} + +func NewMSFT_StorageSiteEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSite, err error) { + tmp, err := NewMSFT_StorageFaultDomainEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageSite{ + MSFT_StorageFaultDomain: tmp, + } + return +} + +func NewMSFT_StorageSiteEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSite, err error) { + tmp, err := NewMSFT_StorageFaultDomainEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSite{ + MSFT_StorageFaultDomain: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystem.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystem.go new file mode 100644 index 000000000..6449e9272 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystem.go @@ -0,0 +1,2530 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystem struct +type MSFT_StorageSubSystem struct { + *MSFT_StorageObject + + // + AutomaticClusteringEnabled bool + + // + CimServerName string + + // + CurrentCacheLevel uint16 + + // + DataTieringType uint16 + + // + Description string + + // + FaultDomainAwarenessDefault uint16 + + // + FirmwareVersion string + + // + FriendlyName string + + // + HealthStatus uint16 + + // + iSCSITargetCreationScheme uint16 + + // + Manufacturer string + + // + MaskingClientSelectableDeviceNumbers bool + + // + MaskingMapCountMax uint16 + + // + MaskingOneInitiatorIdPerView bool + + // + MaskingOtherValidInitiatorIdTypes []string + + // + MaskingPortsPerView uint16 + + // + MaskingValidInitiatorIdTypes []uint16 + + // + Model string + + // + Name string + + // + NameFormat uint16 + + // + NumberOfSlots uint32 + + // + OperationalStatus []uint16 + + // + OtherHostTypeDescription []string + + // + OtherIdentifyingInfo []string + + // + OtherIdentifyingInfoDescription []string + + // + OtherOperationalStatusDescription string + + // + PhysicalDisksPerStoragePoolMin uint16 + + // + ReplicasPerSourceCloneMax uint16 + + // + ReplicasPerSourceMirrorMax uint16 + + // + ReplicasPerSourceSnapshotMax uint16 + + // + SerialNumber string + + // + StorageConnectionType uint16 + + // + SupportedDeduplicationFileSystemTypes []uint16 + + // + SupportedDeduplicationObjectTypes []uint16 + + // + SupportedFileServerProtocols []uint16 + + // + SupportedFileSystems []uint16 + + // + SupportedHostType []uint16 + + // + SupportsAutomaticStoragePoolSelection bool + + // + SupportsCloneLocal bool + + // + SupportsCloneRemote bool + + // + SupportsContinuouslyAvailableFileServer bool + + // + SupportsFileServer bool + + // + SupportsFileServerCreation bool + + // + SupportsMaskingVirtualDiskToHosts bool + + // + SupportsMirrorLocal bool + + // + SupportsMirrorRemote bool + + // + SupportsMultipleResiliencySettingsPerStoragePool bool + + // + SupportsSnapshotLocal bool + + // + SupportsSnapshotRemote bool + + // + SupportsStoragePoolAddPhysicalDisk bool + + // + SupportsStoragePoolCreation bool + + // + SupportsStoragePoolDeletion bool + + // + SupportsStoragePoolFriendlyNameModification bool + + // + SupportsStoragePoolRemovePhysicalDisk bool + + // + SupportsStorageTierCreation bool + + // + SupportsStorageTierDeletion bool + + // + SupportsStorageTieredVirtualDiskCreation bool + + // + SupportsStorageTierFriendlyNameModification bool + + // + SupportsStorageTierResize bool + + // + SupportsVirtualDiskCapacityExpansion bool + + // + SupportsVirtualDiskCapacityReduction bool + + // + SupportsVirtualDiskCreation bool + + // + SupportsVirtualDiskDeletion bool + + // + SupportsVirtualDiskModification bool + + // + SupportsVirtualDiskRepair bool + + // + SupportsVolumeCreation bool + + // + Tag string +} + +func NewMSFT_StorageSubSystemEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystem, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystem{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_StorageSubSystemEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystem, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystem{ + MSFT_StorageObject: tmp, + } + return +} + +// SetAutomaticClusteringEnabled sets the value of AutomaticClusteringEnabled for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyAutomaticClusteringEnabled(value bool) (err error) { + return instance.SetProperty("AutomaticClusteringEnabled", (value)) +} + +// GetAutomaticClusteringEnabled gets the value of AutomaticClusteringEnabled for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyAutomaticClusteringEnabled() (value bool, err error) { + retValue, err := instance.GetProperty("AutomaticClusteringEnabled") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetCimServerName sets the value of CimServerName for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyCimServerName(value string) (err error) { + return instance.SetProperty("CimServerName", (value)) +} + +// GetCimServerName gets the value of CimServerName for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyCimServerName() (value string, err error) { + retValue, err := instance.GetProperty("CimServerName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetCurrentCacheLevel sets the value of CurrentCacheLevel for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyCurrentCacheLevel(value uint16) (err error) { + return instance.SetProperty("CurrentCacheLevel", (value)) +} + +// GetCurrentCacheLevel gets the value of CurrentCacheLevel for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyCurrentCacheLevel() (value uint16, err error) { + retValue, err := instance.GetProperty("CurrentCacheLevel") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetDataTieringType sets the value of DataTieringType for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyDataTieringType(value uint16) (err error) { + return instance.SetProperty("DataTieringType", (value)) +} + +// GetDataTieringType gets the value of DataTieringType for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyDataTieringType() (value uint16, err error) { + retValue, err := instance.GetProperty("DataTieringType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetDescription sets the value of Description for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyDescription(value string) (err error) { + return instance.SetProperty("Description", (value)) +} + +// GetDescription gets the value of Description for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyDescription() (value string, err error) { + retValue, err := instance.GetProperty("Description") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFaultDomainAwarenessDefault sets the value of FaultDomainAwarenessDefault for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyFaultDomainAwarenessDefault(value uint16) (err error) { + return instance.SetProperty("FaultDomainAwarenessDefault", (value)) +} + +// GetFaultDomainAwarenessDefault gets the value of FaultDomainAwarenessDefault for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyFaultDomainAwarenessDefault() (value uint16, err error) { + retValue, err := instance.GetProperty("FaultDomainAwarenessDefault") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetFirmwareVersion sets the value of FirmwareVersion for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyFirmwareVersion(value string) (err error) { + return instance.SetProperty("FirmwareVersion", (value)) +} + +// GetFirmwareVersion gets the value of FirmwareVersion for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyFirmwareVersion() (value string, err error) { + retValue, err := instance.GetProperty("FirmwareVersion") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFriendlyName sets the value of FriendlyName for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyFriendlyName(value string) (err error) { + return instance.SetProperty("FriendlyName", (value)) +} + +// GetFriendlyName gets the value of FriendlyName for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyFriendlyName() (value string, err error) { + retValue, err := instance.GetProperty("FriendlyName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetHealthStatus sets the value of HealthStatus for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyHealthStatus(value uint16) (err error) { + return instance.SetProperty("HealthStatus", (value)) +} + +// GetHealthStatus gets the value of HealthStatus for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("HealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetiSCSITargetCreationScheme sets the value of iSCSITargetCreationScheme for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyiSCSITargetCreationScheme(value uint16) (err error) { + return instance.SetProperty("iSCSITargetCreationScheme", (value)) +} + +// GetiSCSITargetCreationScheme gets the value of iSCSITargetCreationScheme for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyiSCSITargetCreationScheme() (value uint16, err error) { + retValue, err := instance.GetProperty("iSCSITargetCreationScheme") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetManufacturer sets the value of Manufacturer for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyManufacturer(value string) (err error) { + return instance.SetProperty("Manufacturer", (value)) +} + +// GetManufacturer gets the value of Manufacturer for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyManufacturer() (value string, err error) { + retValue, err := instance.GetProperty("Manufacturer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetMaskingClientSelectableDeviceNumbers sets the value of MaskingClientSelectableDeviceNumbers for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyMaskingClientSelectableDeviceNumbers(value bool) (err error) { + return instance.SetProperty("MaskingClientSelectableDeviceNumbers", (value)) +} + +// GetMaskingClientSelectableDeviceNumbers gets the value of MaskingClientSelectableDeviceNumbers for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyMaskingClientSelectableDeviceNumbers() (value bool, err error) { + retValue, err := instance.GetProperty("MaskingClientSelectableDeviceNumbers") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetMaskingMapCountMax sets the value of MaskingMapCountMax for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyMaskingMapCountMax(value uint16) (err error) { + return instance.SetProperty("MaskingMapCountMax", (value)) +} + +// GetMaskingMapCountMax gets the value of MaskingMapCountMax for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyMaskingMapCountMax() (value uint16, err error) { + retValue, err := instance.GetProperty("MaskingMapCountMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetMaskingOneInitiatorIdPerView sets the value of MaskingOneInitiatorIdPerView for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyMaskingOneInitiatorIdPerView(value bool) (err error) { + return instance.SetProperty("MaskingOneInitiatorIdPerView", (value)) +} + +// GetMaskingOneInitiatorIdPerView gets the value of MaskingOneInitiatorIdPerView for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyMaskingOneInitiatorIdPerView() (value bool, err error) { + retValue, err := instance.GetProperty("MaskingOneInitiatorIdPerView") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetMaskingOtherValidInitiatorIdTypes sets the value of MaskingOtherValidInitiatorIdTypes for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyMaskingOtherValidInitiatorIdTypes(value []string) (err error) { + return instance.SetProperty("MaskingOtherValidInitiatorIdTypes", (value)) +} + +// GetMaskingOtherValidInitiatorIdTypes gets the value of MaskingOtherValidInitiatorIdTypes for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyMaskingOtherValidInitiatorIdTypes() (value []string, err error) { + retValue, err := instance.GetProperty("MaskingOtherValidInitiatorIdTypes") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetMaskingPortsPerView sets the value of MaskingPortsPerView for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyMaskingPortsPerView(value uint16) (err error) { + return instance.SetProperty("MaskingPortsPerView", (value)) +} + +// GetMaskingPortsPerView gets the value of MaskingPortsPerView for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyMaskingPortsPerView() (value uint16, err error) { + retValue, err := instance.GetProperty("MaskingPortsPerView") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetMaskingValidInitiatorIdTypes sets the value of MaskingValidInitiatorIdTypes for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyMaskingValidInitiatorIdTypes(value []uint16) (err error) { + return instance.SetProperty("MaskingValidInitiatorIdTypes", (value)) +} + +// GetMaskingValidInitiatorIdTypes gets the value of MaskingValidInitiatorIdTypes for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyMaskingValidInitiatorIdTypes() (value []uint16, err error) { + retValue, err := instance.GetProperty("MaskingValidInitiatorIdTypes") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetModel sets the value of Model for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyModel(value string) (err error) { + return instance.SetProperty("Model", (value)) +} + +// GetModel gets the value of Model for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyModel() (value string, err error) { + retValue, err := instance.GetProperty("Model") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetName sets the value of Name for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetNameFormat sets the value of NameFormat for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyNameFormat(value uint16) (err error) { + return instance.SetProperty("NameFormat", (value)) +} + +// GetNameFormat gets the value of NameFormat for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyNameFormat() (value uint16, err error) { + retValue, err := instance.GetProperty("NameFormat") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfSlots sets the value of NumberOfSlots for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyNumberOfSlots(value uint32) (err error) { + return instance.SetProperty("NumberOfSlots", (value)) +} + +// GetNumberOfSlots gets the value of NumberOfSlots for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyNumberOfSlots() (value uint32, err error) { + retValue, err := instance.GetProperty("NumberOfSlots") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetOtherHostTypeDescription sets the value of OtherHostTypeDescription for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyOtherHostTypeDescription(value []string) (err error) { + return instance.SetProperty("OtherHostTypeDescription", (value)) +} + +// GetOtherHostTypeDescription gets the value of OtherHostTypeDescription for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyOtherHostTypeDescription() (value []string, err error) { + retValue, err := instance.GetProperty("OtherHostTypeDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetOtherIdentifyingInfo sets the value of OtherIdentifyingInfo for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyOtherIdentifyingInfo(value []string) (err error) { + return instance.SetProperty("OtherIdentifyingInfo", (value)) +} + +// GetOtherIdentifyingInfo gets the value of OtherIdentifyingInfo for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyOtherIdentifyingInfo() (value []string, err error) { + retValue, err := instance.GetProperty("OtherIdentifyingInfo") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetOtherIdentifyingInfoDescription sets the value of OtherIdentifyingInfoDescription for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyOtherIdentifyingInfoDescription(value []string) (err error) { + return instance.SetProperty("OtherIdentifyingInfoDescription", (value)) +} + +// GetOtherIdentifyingInfoDescription gets the value of OtherIdentifyingInfoDescription for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyOtherIdentifyingInfoDescription() (value []string, err error) { + retValue, err := instance.GetProperty("OtherIdentifyingInfoDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetOtherOperationalStatusDescription sets the value of OtherOperationalStatusDescription for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyOtherOperationalStatusDescription(value string) (err error) { + return instance.SetProperty("OtherOperationalStatusDescription", (value)) +} + +// GetOtherOperationalStatusDescription gets the value of OtherOperationalStatusDescription for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyOtherOperationalStatusDescription() (value string, err error) { + retValue, err := instance.GetProperty("OtherOperationalStatusDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPhysicalDisksPerStoragePoolMin sets the value of PhysicalDisksPerStoragePoolMin for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyPhysicalDisksPerStoragePoolMin(value uint16) (err error) { + return instance.SetProperty("PhysicalDisksPerStoragePoolMin", (value)) +} + +// GetPhysicalDisksPerStoragePoolMin gets the value of PhysicalDisksPerStoragePoolMin for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyPhysicalDisksPerStoragePoolMin() (value uint16, err error) { + retValue, err := instance.GetProperty("PhysicalDisksPerStoragePoolMin") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetReplicasPerSourceCloneMax sets the value of ReplicasPerSourceCloneMax for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyReplicasPerSourceCloneMax(value uint16) (err error) { + return instance.SetProperty("ReplicasPerSourceCloneMax", (value)) +} + +// GetReplicasPerSourceCloneMax gets the value of ReplicasPerSourceCloneMax for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyReplicasPerSourceCloneMax() (value uint16, err error) { + retValue, err := instance.GetProperty("ReplicasPerSourceCloneMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetReplicasPerSourceMirrorMax sets the value of ReplicasPerSourceMirrorMax for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyReplicasPerSourceMirrorMax(value uint16) (err error) { + return instance.SetProperty("ReplicasPerSourceMirrorMax", (value)) +} + +// GetReplicasPerSourceMirrorMax gets the value of ReplicasPerSourceMirrorMax for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyReplicasPerSourceMirrorMax() (value uint16, err error) { + retValue, err := instance.GetProperty("ReplicasPerSourceMirrorMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetReplicasPerSourceSnapshotMax sets the value of ReplicasPerSourceSnapshotMax for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyReplicasPerSourceSnapshotMax(value uint16) (err error) { + return instance.SetProperty("ReplicasPerSourceSnapshotMax", (value)) +} + +// GetReplicasPerSourceSnapshotMax gets the value of ReplicasPerSourceSnapshotMax for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyReplicasPerSourceSnapshotMax() (value uint16, err error) { + retValue, err := instance.GetProperty("ReplicasPerSourceSnapshotMax") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSerialNumber sets the value of SerialNumber for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySerialNumber(value string) (err error) { + return instance.SetProperty("SerialNumber", (value)) +} + +// GetSerialNumber gets the value of SerialNumber for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySerialNumber() (value string, err error) { + retValue, err := instance.GetProperty("SerialNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetStorageConnectionType sets the value of StorageConnectionType for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyStorageConnectionType(value uint16) (err error) { + return instance.SetProperty("StorageConnectionType", (value)) +} + +// GetStorageConnectionType gets the value of StorageConnectionType for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyStorageConnectionType() (value uint16, err error) { + retValue, err := instance.GetProperty("StorageConnectionType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSupportedDeduplicationFileSystemTypes sets the value of SupportedDeduplicationFileSystemTypes for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportedDeduplicationFileSystemTypes(value []uint16) (err error) { + return instance.SetProperty("SupportedDeduplicationFileSystemTypes", (value)) +} + +// GetSupportedDeduplicationFileSystemTypes gets the value of SupportedDeduplicationFileSystemTypes for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportedDeduplicationFileSystemTypes() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedDeduplicationFileSystemTypes") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSupportedDeduplicationObjectTypes sets the value of SupportedDeduplicationObjectTypes for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportedDeduplicationObjectTypes(value []uint16) (err error) { + return instance.SetProperty("SupportedDeduplicationObjectTypes", (value)) +} + +// GetSupportedDeduplicationObjectTypes gets the value of SupportedDeduplicationObjectTypes for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportedDeduplicationObjectTypes() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedDeduplicationObjectTypes") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSupportedFileServerProtocols sets the value of SupportedFileServerProtocols for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportedFileServerProtocols(value []uint16) (err error) { + return instance.SetProperty("SupportedFileServerProtocols", (value)) +} + +// GetSupportedFileServerProtocols gets the value of SupportedFileServerProtocols for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportedFileServerProtocols() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedFileServerProtocols") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSupportedFileSystems sets the value of SupportedFileSystems for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportedFileSystems(value []uint16) (err error) { + return instance.SetProperty("SupportedFileSystems", (value)) +} + +// GetSupportedFileSystems gets the value of SupportedFileSystems for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportedFileSystems() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedFileSystems") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSupportedHostType sets the value of SupportedHostType for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportedHostType(value []uint16) (err error) { + return instance.SetProperty("SupportedHostType", (value)) +} + +// GetSupportedHostType gets the value of SupportedHostType for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportedHostType() (value []uint16, err error) { + retValue, err := instance.GetProperty("SupportedHostType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetSupportsAutomaticStoragePoolSelection sets the value of SupportsAutomaticStoragePoolSelection for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsAutomaticStoragePoolSelection(value bool) (err error) { + return instance.SetProperty("SupportsAutomaticStoragePoolSelection", (value)) +} + +// GetSupportsAutomaticStoragePoolSelection gets the value of SupportsAutomaticStoragePoolSelection for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsAutomaticStoragePoolSelection() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsAutomaticStoragePoolSelection") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsCloneLocal sets the value of SupportsCloneLocal for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsCloneLocal(value bool) (err error) { + return instance.SetProperty("SupportsCloneLocal", (value)) +} + +// GetSupportsCloneLocal gets the value of SupportsCloneLocal for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsCloneLocal() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsCloneLocal") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsCloneRemote sets the value of SupportsCloneRemote for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsCloneRemote(value bool) (err error) { + return instance.SetProperty("SupportsCloneRemote", (value)) +} + +// GetSupportsCloneRemote gets the value of SupportsCloneRemote for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsCloneRemote() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsCloneRemote") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsContinuouslyAvailableFileServer sets the value of SupportsContinuouslyAvailableFileServer for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsContinuouslyAvailableFileServer(value bool) (err error) { + return instance.SetProperty("SupportsContinuouslyAvailableFileServer", (value)) +} + +// GetSupportsContinuouslyAvailableFileServer gets the value of SupportsContinuouslyAvailableFileServer for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsContinuouslyAvailableFileServer() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsContinuouslyAvailableFileServer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsFileServer sets the value of SupportsFileServer for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsFileServer(value bool) (err error) { + return instance.SetProperty("SupportsFileServer", (value)) +} + +// GetSupportsFileServer gets the value of SupportsFileServer for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsFileServer() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsFileServer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsFileServerCreation sets the value of SupportsFileServerCreation for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsFileServerCreation(value bool) (err error) { + return instance.SetProperty("SupportsFileServerCreation", (value)) +} + +// GetSupportsFileServerCreation gets the value of SupportsFileServerCreation for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsFileServerCreation() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsFileServerCreation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsMaskingVirtualDiskToHosts sets the value of SupportsMaskingVirtualDiskToHosts for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsMaskingVirtualDiskToHosts(value bool) (err error) { + return instance.SetProperty("SupportsMaskingVirtualDiskToHosts", (value)) +} + +// GetSupportsMaskingVirtualDiskToHosts gets the value of SupportsMaskingVirtualDiskToHosts for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsMaskingVirtualDiskToHosts() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsMaskingVirtualDiskToHosts") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsMirrorLocal sets the value of SupportsMirrorLocal for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsMirrorLocal(value bool) (err error) { + return instance.SetProperty("SupportsMirrorLocal", (value)) +} + +// GetSupportsMirrorLocal gets the value of SupportsMirrorLocal for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsMirrorLocal() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsMirrorLocal") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsMirrorRemote sets the value of SupportsMirrorRemote for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsMirrorRemote(value bool) (err error) { + return instance.SetProperty("SupportsMirrorRemote", (value)) +} + +// GetSupportsMirrorRemote gets the value of SupportsMirrorRemote for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsMirrorRemote() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsMirrorRemote") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsMultipleResiliencySettingsPerStoragePool sets the value of SupportsMultipleResiliencySettingsPerStoragePool for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsMultipleResiliencySettingsPerStoragePool(value bool) (err error) { + return instance.SetProperty("SupportsMultipleResiliencySettingsPerStoragePool", (value)) +} + +// GetSupportsMultipleResiliencySettingsPerStoragePool gets the value of SupportsMultipleResiliencySettingsPerStoragePool for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsMultipleResiliencySettingsPerStoragePool() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsMultipleResiliencySettingsPerStoragePool") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsSnapshotLocal sets the value of SupportsSnapshotLocal for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsSnapshotLocal(value bool) (err error) { + return instance.SetProperty("SupportsSnapshotLocal", (value)) +} + +// GetSupportsSnapshotLocal gets the value of SupportsSnapshotLocal for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsSnapshotLocal() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsSnapshotLocal") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsSnapshotRemote sets the value of SupportsSnapshotRemote for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsSnapshotRemote(value bool) (err error) { + return instance.SetProperty("SupportsSnapshotRemote", (value)) +} + +// GetSupportsSnapshotRemote gets the value of SupportsSnapshotRemote for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsSnapshotRemote() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsSnapshotRemote") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsStoragePoolAddPhysicalDisk sets the value of SupportsStoragePoolAddPhysicalDisk for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsStoragePoolAddPhysicalDisk(value bool) (err error) { + return instance.SetProperty("SupportsStoragePoolAddPhysicalDisk", (value)) +} + +// GetSupportsStoragePoolAddPhysicalDisk gets the value of SupportsStoragePoolAddPhysicalDisk for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsStoragePoolAddPhysicalDisk() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsStoragePoolAddPhysicalDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsStoragePoolCreation sets the value of SupportsStoragePoolCreation for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsStoragePoolCreation(value bool) (err error) { + return instance.SetProperty("SupportsStoragePoolCreation", (value)) +} + +// GetSupportsStoragePoolCreation gets the value of SupportsStoragePoolCreation for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsStoragePoolCreation() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsStoragePoolCreation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsStoragePoolDeletion sets the value of SupportsStoragePoolDeletion for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsStoragePoolDeletion(value bool) (err error) { + return instance.SetProperty("SupportsStoragePoolDeletion", (value)) +} + +// GetSupportsStoragePoolDeletion gets the value of SupportsStoragePoolDeletion for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsStoragePoolDeletion() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsStoragePoolDeletion") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsStoragePoolFriendlyNameModification sets the value of SupportsStoragePoolFriendlyNameModification for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsStoragePoolFriendlyNameModification(value bool) (err error) { + return instance.SetProperty("SupportsStoragePoolFriendlyNameModification", (value)) +} + +// GetSupportsStoragePoolFriendlyNameModification gets the value of SupportsStoragePoolFriendlyNameModification for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsStoragePoolFriendlyNameModification() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsStoragePoolFriendlyNameModification") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsStoragePoolRemovePhysicalDisk sets the value of SupportsStoragePoolRemovePhysicalDisk for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsStoragePoolRemovePhysicalDisk(value bool) (err error) { + return instance.SetProperty("SupportsStoragePoolRemovePhysicalDisk", (value)) +} + +// GetSupportsStoragePoolRemovePhysicalDisk gets the value of SupportsStoragePoolRemovePhysicalDisk for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsStoragePoolRemovePhysicalDisk() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsStoragePoolRemovePhysicalDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsStorageTierCreation sets the value of SupportsStorageTierCreation for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsStorageTierCreation(value bool) (err error) { + return instance.SetProperty("SupportsStorageTierCreation", (value)) +} + +// GetSupportsStorageTierCreation gets the value of SupportsStorageTierCreation for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsStorageTierCreation() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsStorageTierCreation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsStorageTierDeletion sets the value of SupportsStorageTierDeletion for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsStorageTierDeletion(value bool) (err error) { + return instance.SetProperty("SupportsStorageTierDeletion", (value)) +} + +// GetSupportsStorageTierDeletion gets the value of SupportsStorageTierDeletion for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsStorageTierDeletion() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsStorageTierDeletion") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsStorageTieredVirtualDiskCreation sets the value of SupportsStorageTieredVirtualDiskCreation for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsStorageTieredVirtualDiskCreation(value bool) (err error) { + return instance.SetProperty("SupportsStorageTieredVirtualDiskCreation", (value)) +} + +// GetSupportsStorageTieredVirtualDiskCreation gets the value of SupportsStorageTieredVirtualDiskCreation for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsStorageTieredVirtualDiskCreation() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsStorageTieredVirtualDiskCreation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsStorageTierFriendlyNameModification sets the value of SupportsStorageTierFriendlyNameModification for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsStorageTierFriendlyNameModification(value bool) (err error) { + return instance.SetProperty("SupportsStorageTierFriendlyNameModification", (value)) +} + +// GetSupportsStorageTierFriendlyNameModification gets the value of SupportsStorageTierFriendlyNameModification for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsStorageTierFriendlyNameModification() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsStorageTierFriendlyNameModification") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsStorageTierResize sets the value of SupportsStorageTierResize for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsStorageTierResize(value bool) (err error) { + return instance.SetProperty("SupportsStorageTierResize", (value)) +} + +// GetSupportsStorageTierResize gets the value of SupportsStorageTierResize for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsStorageTierResize() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsStorageTierResize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsVirtualDiskCapacityExpansion sets the value of SupportsVirtualDiskCapacityExpansion for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsVirtualDiskCapacityExpansion(value bool) (err error) { + return instance.SetProperty("SupportsVirtualDiskCapacityExpansion", (value)) +} + +// GetSupportsVirtualDiskCapacityExpansion gets the value of SupportsVirtualDiskCapacityExpansion for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsVirtualDiskCapacityExpansion() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsVirtualDiskCapacityExpansion") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsVirtualDiskCapacityReduction sets the value of SupportsVirtualDiskCapacityReduction for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsVirtualDiskCapacityReduction(value bool) (err error) { + return instance.SetProperty("SupportsVirtualDiskCapacityReduction", (value)) +} + +// GetSupportsVirtualDiskCapacityReduction gets the value of SupportsVirtualDiskCapacityReduction for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsVirtualDiskCapacityReduction() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsVirtualDiskCapacityReduction") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsVirtualDiskCreation sets the value of SupportsVirtualDiskCreation for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsVirtualDiskCreation(value bool) (err error) { + return instance.SetProperty("SupportsVirtualDiskCreation", (value)) +} + +// GetSupportsVirtualDiskCreation gets the value of SupportsVirtualDiskCreation for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsVirtualDiskCreation() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsVirtualDiskCreation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsVirtualDiskDeletion sets the value of SupportsVirtualDiskDeletion for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsVirtualDiskDeletion(value bool) (err error) { + return instance.SetProperty("SupportsVirtualDiskDeletion", (value)) +} + +// GetSupportsVirtualDiskDeletion gets the value of SupportsVirtualDiskDeletion for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsVirtualDiskDeletion() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsVirtualDiskDeletion") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsVirtualDiskModification sets the value of SupportsVirtualDiskModification for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsVirtualDiskModification(value bool) (err error) { + return instance.SetProperty("SupportsVirtualDiskModification", (value)) +} + +// GetSupportsVirtualDiskModification gets the value of SupportsVirtualDiskModification for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsVirtualDiskModification() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsVirtualDiskModification") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsVirtualDiskRepair sets the value of SupportsVirtualDiskRepair for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsVirtualDiskRepair(value bool) (err error) { + return instance.SetProperty("SupportsVirtualDiskRepair", (value)) +} + +// GetSupportsVirtualDiskRepair gets the value of SupportsVirtualDiskRepair for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsVirtualDiskRepair() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsVirtualDiskRepair") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsVolumeCreation sets the value of SupportsVolumeCreation for the instance +func (instance *MSFT_StorageSubSystem) SetPropertySupportsVolumeCreation(value bool) (err error) { + return instance.SetProperty("SupportsVolumeCreation", (value)) +} + +// GetSupportsVolumeCreation gets the value of SupportsVolumeCreation for the instance +func (instance *MSFT_StorageSubSystem) GetPropertySupportsVolumeCreation() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsVolumeCreation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetTag sets the value of Tag for the instance +func (instance *MSFT_StorageSubSystem) SetPropertyTag(value string) (err error) { + return instance.SetProperty("Tag", (value)) +} + +// GetTag gets the value of Tag for the instance +func (instance *MSFT_StorageSubSystem) GetPropertyTag() (value string, err error) { + retValue, err := instance.GetProperty("Tag") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +// +// +// +// +func (instance *MSFT_StorageSubSystem) CreateStoragePool( /* IN */ FriendlyName string, + /* IN */ Usage uint16, + /* IN */ OtherUsageDescription string, + /* IN */ PhysicalDisks []MSFT_PhysicalDisk, + /* IN */ ResiliencySettingNameDefault string, + /* IN */ ProvisioningTypeDefault uint16, + /* IN */ MediaTypeDefault uint16, + /* IN */ LogicalSectorSizeDefault uint64, + /* IN */ EnclosureAwareDefault bool, + /* IN */ FaultDomainAwarenessDefault uint16, + /* IN */ WriteCacheSizeDefault uint64, + /* IN */ AutoWriteCacheSize bool, + /* IN */ Version uint16, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStoragePool MSFT_StoragePool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateStoragePool", FriendlyName, Usage, OtherUsageDescription, PhysicalDisks, ResiliencySettingNameDefault, ProvisioningTypeDefault, MediaTypeDefault, LogicalSectorSizeDefault, EnclosureAwareDefault, FaultDomainAwarenessDefault, WriteCacheSizeDefault, AutoWriteCacheSize, Version, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +// +// +// +// +// +func (instance *MSFT_StorageSubSystem) CreateVirtualDisk( /* IN */ FriendlyName string, + /* IN */ Usage uint16, + /* IN */ OtherUsageDescription string, + /* IN/OUT */ Size uint64, + /* IN */ UseMaximumSize bool, + /* IN */ NumberOfDataCopies uint16, + /* IN */ PhysicalDiskRedundancy uint16, + /* IN */ NumberOfColumns uint16, + /* IN */ Interleave uint64, + /* IN */ ParityLayout uint16, + /* IN */ RequestNoSinglePointOfFailure bool, + /* IN */ IsEnclosureAware bool, + /* IN */ FaultDomainAwareness uint16, + /* IN */ ProvisioningType uint16, + /* IN */ RunAsJob bool, + /* OUT */ CreatedVirtualDisk MSFT_VirtualDisk, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateVirtualDisk", FriendlyName, Usage, OtherUsageDescription, UseMaximumSize, NumberOfDataCopies, PhysicalDiskRedundancy, NumberOfColumns, Interleave, ParityLayout, RequestNoSinglePointOfFailure, IsEnclosureAware, FaultDomainAwareness, ProvisioningType, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// +// + +// +// +// +// +func (instance *MSFT_StorageSubSystem) CreateMaskingSet( /* IN */ FriendlyName string, + /* IN */ VirtualDiskNames []string, + /* IN */ DeviceAccesses []uint16, + /* IN */ DeviceNumbers []string, + /* IN */ TargetPortAddresses []string, + /* IN */ InitiatorAddresses []string, + /* IN */ HostType uint16, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ CreatedMaskingSet MSFT_MaskingSet, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateMaskingSet", FriendlyName, VirtualDiskNames, DeviceAccesses, DeviceNumbers, TargetPortAddresses, InitiatorAddresses, HostType, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_StorageSubSystem) GetSecurityDescriptor( /* OUT */ SecurityDescriptor string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSecurityDescriptor") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_StorageSubSystem) SetSecurityDescriptor( /* IN */ SecurityDescriptor string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetSecurityDescriptor", SecurityDescriptor) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_StorageSubSystem) SetDescription( /* IN */ Description string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetDescription", Description) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +func (instance *MSFT_StorageSubSystem) SetAttributes( /* IN */ AutomaticClusteringEnabled bool, + /* IN */ FaultDomainAwarenessDefault uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetAttributes", AutomaticClusteringEnabled, FaultDomainAwarenessDefault) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +// +// +// +// +// +func (instance *MSFT_StorageSubSystem) CreateReplicationRelationship( /* IN */ FriendlyName string, + /* IN */ SyncType uint16, + /* IN */ TargetStorageSubsystem MSFT_ReplicaPeer, + /* IN */ SourceReplicationGroupFriendlyName string, + /* IN */ SourceReplicationGroupDescription string, + /* IN */ SourceStorageElements []MSFT_StorageObject, + /* IN */ SourceGroupSettings MSFT_ReplicationSettings, + /* IN */ TargetReplicationGroupFriendlyName string, + /* IN */ TargetReplicationGroupDescription string, + /* IN */ TargetStorageElements []MSFT_StorageObject, + /* IN */ TargetStoragePool MSFT_StoragePool, + /* IN */ TargetStoragePools []MSFT_StoragePool, + /* IN */ TargetGroupSettings MSFT_ReplicationSettings, + /* IN */ RecoveryPointObjective uint32, + /* IN */ RunAsJob bool, + /* IN/OUT */ SourceGroup MSFT_ReplicationGroup, + /* IN */ TargetGroup MSFT_ReplicationGroup, + /* OUT */ CreatedReplicaPeer MSFT_ReplicaPeer, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateReplicationRelationship", FriendlyName, SyncType, TargetStorageSubsystem, SourceReplicationGroupFriendlyName, SourceReplicationGroupDescription, SourceStorageElements, SourceGroupSettings, TargetReplicationGroupFriendlyName, TargetReplicationGroupDescription, TargetStorageElements, TargetStoragePool, TargetStoragePools, TargetGroupSettings, RecoveryPointObjective, RunAsJob, TargetGroup) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// + +// +// +// +func (instance *MSFT_StorageSubSystem) DeleteReplicationRelationship( /* IN */ SourceReplicationGroup MSFT_ReplicationGroup, + /* IN */ TargetGroupReplicaPeer MSFT_ReplicaPeer, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("DeleteReplicationRelationship", SourceReplicationGroup, TargetGroupReplicaPeer, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// + +// +// +// +// +func (instance *MSFT_StorageSubSystem) CreateReplicationGroup( /* IN */ FriendlyName string, + /* IN */ Description string, + /* IN */ StorageElements []MSFT_StorageObject, + /* IN */ ReplicationSettings MSFT_ReplicationSettings, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ CreatedReplicationGroup MSFT_ReplicationGroup, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateReplicationGroup", FriendlyName, Description, StorageElements, ReplicationSettings, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// + +// +// +// +// +func (instance *MSFT_StorageSubSystem) CreateFileServer( /* IN */ FriendlyName string, + /* IN */ FileSharingProtocols []uint16, + /* IN */ HostNames []string, + /* IN */ RunAsJob bool, + /* OUT */ CreatedFileServer MSFT_FileServer, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateFileServer", FriendlyName, FileSharingProtocols, HostNames, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// + +// +// +func (instance *MSFT_StorageSubSystem) GetDiagnosticInfo( /* IN */ DestinationPath string, + /* IN */ TimeSpan uint32, + /* IN */ ActivityId string, + /* IN */ ExcludeOperationalLog bool, + /* IN */ ExcludeDiagnosticLog bool, + /* IN */ IncludeLiveDump bool, + /* IN */ CopyExistingInfoOnly bool, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetDiagnosticInfo", DestinationPath, TimeSpan, ActivityId, ExcludeOperationalLog, ExcludeDiagnosticLog, IncludeLiveDump, CopyExistingInfoOnly) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_StorageSubSystem) ClearDiagnosticInfo( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("ClearDiagnosticInfo") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +func (instance *MSFT_StorageSubSystem) StartDiagnosticLog( /* IN */ Level uint16, + /* IN */ MaxLogSize uint64, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("StartDiagnosticLog", Level, MaxLogSize) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_StorageSubSystem) StopDiagnosticLog( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("StopDiagnosticLog") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_StorageSubSystem) Diagnose( /* OUT */ DiagnoseResults []MSFT_StorageDiagnoseResult, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Diagnose") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_StorageSubSystem) GetActions( /* OUT */ ActionResults []MSFT_HealthAction, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetActions") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToDisk.go new file mode 100644 index 000000000..3a5f89b78 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToDisk struct +type MSFT_StorageSubSystemToDisk struct { + *cim.WmiInstance + + // + Disk MSFT_Disk + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToDisk{ + WmiInstance: tmp, + } + return +} + +// SetDisk sets the value of Disk for the instance +func (instance *MSFT_StorageSubSystemToDisk) SetPropertyDisk(value MSFT_Disk) (err error) { + return instance.SetProperty("Disk", (value)) +} + +// GetDisk gets the value of Disk for the instance +func (instance *MSFT_StorageSubSystemToDisk) GetPropertyDisk() (value MSFT_Disk, err error) { + retValue, err := instance.GetProperty("Disk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Disk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Disk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Disk(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToDisk) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToDisk) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToFileServer.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToFileServer.go new file mode 100644 index 000000000..11a0a1321 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToFileServer.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToFileServer struct +type MSFT_StorageSubSystemToFileServer struct { + *cim.WmiInstance + + // + FileServer MSFT_FileServer + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToFileServerEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToFileServer, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToFileServer{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToFileServerEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToFileServer, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToFileServer{ + WmiInstance: tmp, + } + return +} + +// SetFileServer sets the value of FileServer for the instance +func (instance *MSFT_StorageSubSystemToFileServer) SetPropertyFileServer(value MSFT_FileServer) (err error) { + return instance.SetProperty("FileServer", (value)) +} + +// GetFileServer gets the value of FileServer for the instance +func (instance *MSFT_StorageSubSystemToFileServer) GetPropertyFileServer() (value MSFT_FileServer, err error) { + retValue, err := instance.GetProperty("FileServer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_FileServer) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_FileServer is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_FileServer(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToFileServer) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToFileServer) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToFileShare.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToFileShare.go new file mode 100644 index 000000000..9ef9ca15f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToFileShare.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToFileShare struct +type MSFT_StorageSubSystemToFileShare struct { + *cim.WmiInstance + + // + FileShare MSFT_FileShare + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToFileShareEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToFileShare, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToFileShare{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToFileShareEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToFileShare, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToFileShare{ + WmiInstance: tmp, + } + return +} + +// SetFileShare sets the value of FileShare for the instance +func (instance *MSFT_StorageSubSystemToFileShare) SetPropertyFileShare(value MSFT_FileShare) (err error) { + return instance.SetProperty("FileShare", (value)) +} + +// GetFileShare gets the value of FileShare for the instance +func (instance *MSFT_StorageSubSystemToFileShare) GetPropertyFileShare() (value MSFT_FileShare, err error) { + retValue, err := instance.GetProperty("FileShare") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_FileShare) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_FileShare is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_FileShare(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToFileShare) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToFileShare) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToInitiatorId.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToInitiatorId.go new file mode 100644 index 000000000..5ef51e2d9 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToInitiatorId.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToInitiatorId struct +type MSFT_StorageSubSystemToInitiatorId struct { + *cim.WmiInstance + + // + InitiatorId MSFT_InitiatorId + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToInitiatorIdEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToInitiatorId, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToInitiatorId{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToInitiatorIdEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToInitiatorId, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToInitiatorId{ + WmiInstance: tmp, + } + return +} + +// SetInitiatorId sets the value of InitiatorId for the instance +func (instance *MSFT_StorageSubSystemToInitiatorId) SetPropertyInitiatorId(value MSFT_InitiatorId) (err error) { + return instance.SetProperty("InitiatorId", (value)) +} + +// GetInitiatorId gets the value of InitiatorId for the instance +func (instance *MSFT_StorageSubSystemToInitiatorId) GetPropertyInitiatorId() (value MSFT_InitiatorId, err error) { + retValue, err := instance.GetProperty("InitiatorId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_InitiatorId) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_InitiatorId is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_InitiatorId(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToInitiatorId) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToInitiatorId) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToMaskingSet.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToMaskingSet.go new file mode 100644 index 000000000..135a59fb7 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToMaskingSet.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToMaskingSet struct +type MSFT_StorageSubSystemToMaskingSet struct { + *cim.WmiInstance + + // + MaskingSet MSFT_MaskingSet + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToMaskingSetEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToMaskingSet, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToMaskingSet{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToMaskingSetEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToMaskingSet, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToMaskingSet{ + WmiInstance: tmp, + } + return +} + +// SetMaskingSet sets the value of MaskingSet for the instance +func (instance *MSFT_StorageSubSystemToMaskingSet) SetPropertyMaskingSet(value MSFT_MaskingSet) (err error) { + return instance.SetProperty("MaskingSet", (value)) +} + +// GetMaskingSet gets the value of MaskingSet for the instance +func (instance *MSFT_StorageSubSystemToMaskingSet) GetPropertyMaskingSet() (value MSFT_MaskingSet, err error) { + retValue, err := instance.GetProperty("MaskingSet") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_MaskingSet) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_MaskingSet is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_MaskingSet(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToMaskingSet) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToMaskingSet) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToOffloadDataTransferSetting.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToOffloadDataTransferSetting.go new file mode 100644 index 000000000..87f5c9c39 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToOffloadDataTransferSetting.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToOffloadDataTransferSetting struct +type MSFT_StorageSubSystemToOffloadDataTransferSetting struct { + *cim.WmiInstance + + // + OffloadDataTransferSetting MSFT_OffloadDataTransferSetting + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToOffloadDataTransferSettingEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToOffloadDataTransferSetting, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToOffloadDataTransferSetting{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToOffloadDataTransferSettingEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToOffloadDataTransferSetting, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToOffloadDataTransferSetting{ + WmiInstance: tmp, + } + return +} + +// SetOffloadDataTransferSetting sets the value of OffloadDataTransferSetting for the instance +func (instance *MSFT_StorageSubSystemToOffloadDataTransferSetting) SetPropertyOffloadDataTransferSetting(value MSFT_OffloadDataTransferSetting) (err error) { + return instance.SetProperty("OffloadDataTransferSetting", (value)) +} + +// GetOffloadDataTransferSetting gets the value of OffloadDataTransferSetting for the instance +func (instance *MSFT_StorageSubSystemToOffloadDataTransferSetting) GetPropertyOffloadDataTransferSetting() (value MSFT_OffloadDataTransferSetting, err error) { + retValue, err := instance.GetProperty("OffloadDataTransferSetting") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_OffloadDataTransferSetting) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_OffloadDataTransferSetting is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_OffloadDataTransferSetting(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToOffloadDataTransferSetting) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToOffloadDataTransferSetting) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToPartition.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToPartition.go new file mode 100644 index 000000000..9e0015b93 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToPartition.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToPartition struct +type MSFT_StorageSubSystemToPartition struct { + *cim.WmiInstance + + // + Partition MSFT_Partition + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToPartitionEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToPartition, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToPartition{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToPartitionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToPartition, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToPartition{ + WmiInstance: tmp, + } + return +} + +// SetPartition sets the value of Partition for the instance +func (instance *MSFT_StorageSubSystemToPartition) SetPropertyPartition(value MSFT_Partition) (err error) { + return instance.SetProperty("Partition", (value)) +} + +// GetPartition gets the value of Partition for the instance +func (instance *MSFT_StorageSubSystemToPartition) GetPropertyPartition() (value MSFT_Partition, err error) { + retValue, err := instance.GetProperty("Partition") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Partition) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Partition is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Partition(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToPartition) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToPartition) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToPhysicalDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToPhysicalDisk.go new file mode 100644 index 000000000..3c6e8ec8d --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToPhysicalDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToPhysicalDisk struct +type MSFT_StorageSubSystemToPhysicalDisk struct { + *cim.WmiInstance + + // + PhysicalDisk MSFT_PhysicalDisk + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToPhysicalDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToPhysicalDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToPhysicalDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToPhysicalDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToPhysicalDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToPhysicalDisk{ + WmiInstance: tmp, + } + return +} + +// SetPhysicalDisk sets the value of PhysicalDisk for the instance +func (instance *MSFT_StorageSubSystemToPhysicalDisk) SetPropertyPhysicalDisk(value MSFT_PhysicalDisk) (err error) { + return instance.SetProperty("PhysicalDisk", (value)) +} + +// GetPhysicalDisk gets the value of PhysicalDisk for the instance +func (instance *MSFT_StorageSubSystemToPhysicalDisk) GetPropertyPhysicalDisk() (value MSFT_PhysicalDisk, err error) { + retValue, err := instance.GetProperty("PhysicalDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_PhysicalDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_PhysicalDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_PhysicalDisk(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToPhysicalDisk) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToPhysicalDisk) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToReplicaPeer.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToReplicaPeer.go new file mode 100644 index 000000000..07e186f33 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToReplicaPeer.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToReplicaPeer struct +type MSFT_StorageSubSystemToReplicaPeer struct { + *cim.WmiInstance + + // + ReplicaPeer MSFT_ReplicaPeer + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToReplicaPeerEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToReplicaPeer, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToReplicaPeer{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToReplicaPeerEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToReplicaPeer, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToReplicaPeer{ + WmiInstance: tmp, + } + return +} + +// SetReplicaPeer sets the value of ReplicaPeer for the instance +func (instance *MSFT_StorageSubSystemToReplicaPeer) SetPropertyReplicaPeer(value MSFT_ReplicaPeer) (err error) { + return instance.SetProperty("ReplicaPeer", (value)) +} + +// GetReplicaPeer gets the value of ReplicaPeer for the instance +func (instance *MSFT_StorageSubSystemToReplicaPeer) GetPropertyReplicaPeer() (value MSFT_ReplicaPeer, err error) { + retValue, err := instance.GetProperty("ReplicaPeer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_ReplicaPeer) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_ReplicaPeer is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_ReplicaPeer(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToReplicaPeer) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToReplicaPeer) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToReplicationCapabilities.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToReplicationCapabilities.go new file mode 100644 index 000000000..e6ee9c12f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToReplicationCapabilities.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToReplicationCapabilities struct +type MSFT_StorageSubSystemToReplicationCapabilities struct { + *cim.WmiInstance + + // + ReplicationCapabilities MSFT_ReplicationCapabilities + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToReplicationCapabilitiesEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToReplicationCapabilities, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToReplicationCapabilities{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToReplicationCapabilitiesEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToReplicationCapabilities, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToReplicationCapabilities{ + WmiInstance: tmp, + } + return +} + +// SetReplicationCapabilities sets the value of ReplicationCapabilities for the instance +func (instance *MSFT_StorageSubSystemToReplicationCapabilities) SetPropertyReplicationCapabilities(value MSFT_ReplicationCapabilities) (err error) { + return instance.SetProperty("ReplicationCapabilities", (value)) +} + +// GetReplicationCapabilities gets the value of ReplicationCapabilities for the instance +func (instance *MSFT_StorageSubSystemToReplicationCapabilities) GetPropertyReplicationCapabilities() (value MSFT_ReplicationCapabilities, err error) { + retValue, err := instance.GetProperty("ReplicationCapabilities") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_ReplicationCapabilities) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_ReplicationCapabilities is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_ReplicationCapabilities(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToReplicationCapabilities) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToReplicationCapabilities) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToReplicationGroup.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToReplicationGroup.go new file mode 100644 index 000000000..41845c593 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToReplicationGroup.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToReplicationGroup struct +type MSFT_StorageSubSystemToReplicationGroup struct { + *cim.WmiInstance + + // + ReplicationGroup MSFT_ReplicationGroup + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToReplicationGroupEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToReplicationGroup, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToReplicationGroup{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToReplicationGroupEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToReplicationGroup, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToReplicationGroup{ + WmiInstance: tmp, + } + return +} + +// SetReplicationGroup sets the value of ReplicationGroup for the instance +func (instance *MSFT_StorageSubSystemToReplicationGroup) SetPropertyReplicationGroup(value MSFT_ReplicationGroup) (err error) { + return instance.SetProperty("ReplicationGroup", (value)) +} + +// GetReplicationGroup gets the value of ReplicationGroup for the instance +func (instance *MSFT_StorageSubSystemToReplicationGroup) GetPropertyReplicationGroup() (value MSFT_ReplicationGroup, err error) { + retValue, err := instance.GetProperty("ReplicationGroup") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_ReplicationGroup) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_ReplicationGroup is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_ReplicationGroup(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToReplicationGroup) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToReplicationGroup) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageEnclosure.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageEnclosure.go new file mode 100644 index 000000000..a5aebf84c --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageEnclosure.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToStorageEnclosure struct +type MSFT_StorageSubSystemToStorageEnclosure struct { + *cim.WmiInstance + + // + StorageEnclosure MSFT_StorageEnclosure + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToStorageEnclosureEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToStorageEnclosure, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToStorageEnclosure{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToStorageEnclosureEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToStorageEnclosure, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToStorageEnclosure{ + WmiInstance: tmp, + } + return +} + +// SetStorageEnclosure sets the value of StorageEnclosure for the instance +func (instance *MSFT_StorageSubSystemToStorageEnclosure) SetPropertyStorageEnclosure(value MSFT_StorageEnclosure) (err error) { + return instance.SetProperty("StorageEnclosure", (value)) +} + +// GetStorageEnclosure gets the value of StorageEnclosure for the instance +func (instance *MSFT_StorageSubSystemToStorageEnclosure) GetPropertyStorageEnclosure() (value MSFT_StorageEnclosure, err error) { + retValue, err := instance.GetProperty("StorageEnclosure") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageEnclosure) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageEnclosure is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageEnclosure(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToStorageEnclosure) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToStorageEnclosure) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageFaultDomain.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageFaultDomain.go new file mode 100644 index 000000000..f1f429415 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageFaultDomain.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToStorageFaultDomain struct +type MSFT_StorageSubSystemToStorageFaultDomain struct { + *cim.WmiInstance + + // + StorageFaultDomain MSFT_StorageFaultDomain + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToStorageFaultDomainEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToStorageFaultDomain, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToStorageFaultDomain{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToStorageFaultDomainEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToStorageFaultDomain, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToStorageFaultDomain{ + WmiInstance: tmp, + } + return +} + +// SetStorageFaultDomain sets the value of StorageFaultDomain for the instance +func (instance *MSFT_StorageSubSystemToStorageFaultDomain) SetPropertyStorageFaultDomain(value MSFT_StorageFaultDomain) (err error) { + return instance.SetProperty("StorageFaultDomain", (value)) +} + +// GetStorageFaultDomain gets the value of StorageFaultDomain for the instance +func (instance *MSFT_StorageSubSystemToStorageFaultDomain) GetPropertyStorageFaultDomain() (value MSFT_StorageFaultDomain, err error) { + retValue, err := instance.GetProperty("StorageFaultDomain") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageFaultDomain) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageFaultDomain is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageFaultDomain(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToStorageFaultDomain) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToStorageFaultDomain) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageHealth.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageHealth.go new file mode 100644 index 000000000..e2935bb1e --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageHealth.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToStorageHealth struct +type MSFT_StorageSubSystemToStorageHealth struct { + *cim.WmiInstance + + // + StorageHealth MSFT_StorageHealth + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToStorageHealthEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToStorageHealth, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToStorageHealth{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToStorageHealthEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToStorageHealth, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToStorageHealth{ + WmiInstance: tmp, + } + return +} + +// SetStorageHealth sets the value of StorageHealth for the instance +func (instance *MSFT_StorageSubSystemToStorageHealth) SetPropertyStorageHealth(value MSFT_StorageHealth) (err error) { + return instance.SetProperty("StorageHealth", (value)) +} + +// GetStorageHealth gets the value of StorageHealth for the instance +func (instance *MSFT_StorageSubSystemToStorageHealth) GetPropertyStorageHealth() (value MSFT_StorageHealth, err error) { + retValue, err := instance.GetProperty("StorageHealth") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageHealth) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageHealth is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageHealth(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToStorageHealth) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToStorageHealth) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageNode.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageNode.go new file mode 100644 index 000000000..e8b225f3f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStorageNode.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToStorageNode struct +type MSFT_StorageSubSystemToStorageNode struct { + *cim.WmiInstance + + // + StorageNode MSFT_StorageNode + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToStorageNodeEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToStorageNode, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToStorageNode{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToStorageNodeEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToStorageNode, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToStorageNode{ + WmiInstance: tmp, + } + return +} + +// SetStorageNode sets the value of StorageNode for the instance +func (instance *MSFT_StorageSubSystemToStorageNode) SetPropertyStorageNode(value MSFT_StorageNode) (err error) { + return instance.SetProperty("StorageNode", (value)) +} + +// GetStorageNode gets the value of StorageNode for the instance +func (instance *MSFT_StorageSubSystemToStorageNode) GetPropertyStorageNode() (value MSFT_StorageNode, err error) { + retValue, err := instance.GetProperty("StorageNode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageNode) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageNode is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageNode(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToStorageNode) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToStorageNode) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStoragePool.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStoragePool.go new file mode 100644 index 000000000..6946f6ab3 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToStoragePool.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToStoragePool struct +type MSFT_StorageSubSystemToStoragePool struct { + *cim.WmiInstance + + // + StoragePool MSFT_StoragePool + + // + StorageSubSystem MSFT_StorageSubSystem +} + +func NewMSFT_StorageSubSystemToStoragePoolEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToStoragePool, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToStoragePool{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToStoragePoolEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToStoragePool, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToStoragePool{ + WmiInstance: tmp, + } + return +} + +// SetStoragePool sets the value of StoragePool for the instance +func (instance *MSFT_StorageSubSystemToStoragePool) SetPropertyStoragePool(value MSFT_StoragePool) (err error) { + return instance.SetProperty("StoragePool", (value)) +} + +// GetStoragePool gets the value of StoragePool for the instance +func (instance *MSFT_StorageSubSystemToStoragePool) GetPropertyStoragePool() (value MSFT_StoragePool, err error) { + retValue, err := instance.GetProperty("StoragePool") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StoragePool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StoragePool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StoragePool(valuetmp) + + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToStoragePool) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToStoragePool) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToTargetPort.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToTargetPort.go new file mode 100644 index 000000000..38f1968ab --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToTargetPort.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToTargetPort struct +type MSFT_StorageSubSystemToTargetPort struct { + *cim.WmiInstance + + // + StorageSubSystem MSFT_StorageSubSystem + + // + TargetPort MSFT_TargetPort +} + +func NewMSFT_StorageSubSystemToTargetPortEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToTargetPort, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToTargetPort{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToTargetPortEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToTargetPort, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToTargetPort{ + WmiInstance: tmp, + } + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToTargetPort) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToTargetPort) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} + +// SetTargetPort sets the value of TargetPort for the instance +func (instance *MSFT_StorageSubSystemToTargetPort) SetPropertyTargetPort(value MSFT_TargetPort) (err error) { + return instance.SetProperty("TargetPort", (value)) +} + +// GetTargetPort gets the value of TargetPort for the instance +func (instance *MSFT_StorageSubSystemToTargetPort) GetPropertyTargetPort() (value MSFT_TargetPort, err error) { + retValue, err := instance.GetProperty("TargetPort") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_TargetPort) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_TargetPort is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_TargetPort(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToTargetPortal.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToTargetPortal.go new file mode 100644 index 000000000..651b4245b --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToTargetPortal.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToTargetPortal struct +type MSFT_StorageSubSystemToTargetPortal struct { + *cim.WmiInstance + + // + StorageSubSystem MSFT_StorageSubSystem + + // + TargetPortal MSFT_TargetPortal +} + +func NewMSFT_StorageSubSystemToTargetPortalEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToTargetPortal, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToTargetPortal{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToTargetPortalEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToTargetPortal, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToTargetPortal{ + WmiInstance: tmp, + } + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToTargetPortal) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToTargetPortal) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} + +// SetTargetPortal sets the value of TargetPortal for the instance +func (instance *MSFT_StorageSubSystemToTargetPortal) SetPropertyTargetPortal(value MSFT_TargetPortal) (err error) { + return instance.SetProperty("TargetPortal", (value)) +} + +// GetTargetPortal gets the value of TargetPortal for the instance +func (instance *MSFT_StorageSubSystemToTargetPortal) GetPropertyTargetPortal() (value MSFT_TargetPortal, err error) { + retValue, err := instance.GetProperty("TargetPortal") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_TargetPortal) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_TargetPortal is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_TargetPortal(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToVirtualDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToVirtualDisk.go new file mode 100644 index 000000000..041590742 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToVirtualDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToVirtualDisk struct +type MSFT_StorageSubSystemToVirtualDisk struct { + *cim.WmiInstance + + // + StorageSubSystem MSFT_StorageSubSystem + + // + VirtualDisk MSFT_VirtualDisk +} + +func NewMSFT_StorageSubSystemToVirtualDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToVirtualDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToVirtualDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToVirtualDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToVirtualDisk) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToVirtualDisk) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} + +// SetVirtualDisk sets the value of VirtualDisk for the instance +func (instance *MSFT_StorageSubSystemToVirtualDisk) SetPropertyVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("VirtualDisk", (value)) +} + +// GetVirtualDisk gets the value of VirtualDisk for the instance +func (instance *MSFT_StorageSubSystemToVirtualDisk) GetPropertyVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("VirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToVolume.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToVolume.go new file mode 100644 index 000000000..72d94be98 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageSubSystemToVolume.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageSubSystemToVolume struct +type MSFT_StorageSubSystemToVolume struct { + *cim.WmiInstance + + // + StorageSubSystem MSFT_StorageSubSystem + + // + Volume MSFT_Volume +} + +func NewMSFT_StorageSubSystemToVolumeEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageSubSystemToVolume, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToVolume{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_StorageSubSystemToVolumeEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageSubSystemToVolume, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageSubSystemToVolume{ + WmiInstance: tmp, + } + return +} + +// SetStorageSubSystem sets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToVolume) SetPropertyStorageSubSystem(value MSFT_StorageSubSystem) (err error) { + return instance.SetProperty("StorageSubSystem", (value)) +} + +// GetStorageSubSystem gets the value of StorageSubSystem for the instance +func (instance *MSFT_StorageSubSystemToVolume) GetPropertyStorageSubSystem() (value MSFT_StorageSubSystem, err error) { + retValue, err := instance.GetProperty("StorageSubSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageSubSystem) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageSubSystem is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageSubSystem(valuetmp) + + return +} + +// SetVolume sets the value of Volume for the instance +func (instance *MSFT_StorageSubSystemToVolume) SetPropertyVolume(value MSFT_Volume) (err error) { + return instance.SetProperty("Volume", (value)) +} + +// GetVolume gets the value of Volume for the instance +func (instance *MSFT_StorageSubSystemToVolume) GetPropertyVolume() (value MSFT_Volume, err error) { + retValue, err := instance.GetProperty("Volume") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Volume) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Volume is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Volume(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageTier.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageTier.go new file mode 100644 index 000000000..c5e342c86 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_StorageTier.go @@ -0,0 +1,826 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_StorageTier struct +type MSFT_StorageTier struct { + *MSFT_StorageObject + + // + AllocatedSize uint64 + + // + AllocationUnitSize uint64 + + // + ColumnIsolation uint16 + + // + Description string + + // + FaultDomainAwareness uint16 + + // + FootprintOnPool uint64 + + // + FriendlyName string + + // + Interleave uint64 + + // + MediaType uint16 + + // + NumberOfColumns uint16 + + // + NumberOfDataCopies uint16 + + // + NumberOfGroups uint16 + + // + ParityLayout uint16 + + // + PhysicalDiskRedundancy uint16 + + // + ProvisioningType uint16 + + // + ResiliencySettingName string + + // + Size uint64 + + // + TierClass uint16 + + // + Usage uint16 +} + +func NewMSFT_StorageTierEx1(instance *cim.WmiInstance) (newInstance *MSFT_StorageTier, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_StorageTier{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_StorageTierEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_StorageTier, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_StorageTier{ + MSFT_StorageObject: tmp, + } + return +} + +// SetAllocatedSize sets the value of AllocatedSize for the instance +func (instance *MSFT_StorageTier) SetPropertyAllocatedSize(value uint64) (err error) { + return instance.SetProperty("AllocatedSize", (value)) +} + +// GetAllocatedSize gets the value of AllocatedSize for the instance +func (instance *MSFT_StorageTier) GetPropertyAllocatedSize() (value uint64, err error) { + retValue, err := instance.GetProperty("AllocatedSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetAllocationUnitSize sets the value of AllocationUnitSize for the instance +func (instance *MSFT_StorageTier) SetPropertyAllocationUnitSize(value uint64) (err error) { + return instance.SetProperty("AllocationUnitSize", (value)) +} + +// GetAllocationUnitSize gets the value of AllocationUnitSize for the instance +func (instance *MSFT_StorageTier) GetPropertyAllocationUnitSize() (value uint64, err error) { + retValue, err := instance.GetProperty("AllocationUnitSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetColumnIsolation sets the value of ColumnIsolation for the instance +func (instance *MSFT_StorageTier) SetPropertyColumnIsolation(value uint16) (err error) { + return instance.SetProperty("ColumnIsolation", (value)) +} + +// GetColumnIsolation gets the value of ColumnIsolation for the instance +func (instance *MSFT_StorageTier) GetPropertyColumnIsolation() (value uint16, err error) { + retValue, err := instance.GetProperty("ColumnIsolation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetDescription sets the value of Description for the instance +func (instance *MSFT_StorageTier) SetPropertyDescription(value string) (err error) { + return instance.SetProperty("Description", (value)) +} + +// GetDescription gets the value of Description for the instance +func (instance *MSFT_StorageTier) GetPropertyDescription() (value string, err error) { + retValue, err := instance.GetProperty("Description") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFaultDomainAwareness sets the value of FaultDomainAwareness for the instance +func (instance *MSFT_StorageTier) SetPropertyFaultDomainAwareness(value uint16) (err error) { + return instance.SetProperty("FaultDomainAwareness", (value)) +} + +// GetFaultDomainAwareness gets the value of FaultDomainAwareness for the instance +func (instance *MSFT_StorageTier) GetPropertyFaultDomainAwareness() (value uint16, err error) { + retValue, err := instance.GetProperty("FaultDomainAwareness") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetFootprintOnPool sets the value of FootprintOnPool for the instance +func (instance *MSFT_StorageTier) SetPropertyFootprintOnPool(value uint64) (err error) { + return instance.SetProperty("FootprintOnPool", (value)) +} + +// GetFootprintOnPool gets the value of FootprintOnPool for the instance +func (instance *MSFT_StorageTier) GetPropertyFootprintOnPool() (value uint64, err error) { + retValue, err := instance.GetProperty("FootprintOnPool") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetFriendlyName sets the value of FriendlyName for the instance +func (instance *MSFT_StorageTier) SetPropertyFriendlyName(value string) (err error) { + return instance.SetProperty("FriendlyName", (value)) +} + +// GetFriendlyName gets the value of FriendlyName for the instance +func (instance *MSFT_StorageTier) GetPropertyFriendlyName() (value string, err error) { + retValue, err := instance.GetProperty("FriendlyName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInterleave sets the value of Interleave for the instance +func (instance *MSFT_StorageTier) SetPropertyInterleave(value uint64) (err error) { + return instance.SetProperty("Interleave", (value)) +} + +// GetInterleave gets the value of Interleave for the instance +func (instance *MSFT_StorageTier) GetPropertyInterleave() (value uint64, err error) { + retValue, err := instance.GetProperty("Interleave") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetMediaType sets the value of MediaType for the instance +func (instance *MSFT_StorageTier) SetPropertyMediaType(value uint16) (err error) { + return instance.SetProperty("MediaType", (value)) +} + +// GetMediaType gets the value of MediaType for the instance +func (instance *MSFT_StorageTier) GetPropertyMediaType() (value uint16, err error) { + retValue, err := instance.GetProperty("MediaType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfColumns sets the value of NumberOfColumns for the instance +func (instance *MSFT_StorageTier) SetPropertyNumberOfColumns(value uint16) (err error) { + return instance.SetProperty("NumberOfColumns", (value)) +} + +// GetNumberOfColumns gets the value of NumberOfColumns for the instance +func (instance *MSFT_StorageTier) GetPropertyNumberOfColumns() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfColumns") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfDataCopies sets the value of NumberOfDataCopies for the instance +func (instance *MSFT_StorageTier) SetPropertyNumberOfDataCopies(value uint16) (err error) { + return instance.SetProperty("NumberOfDataCopies", (value)) +} + +// GetNumberOfDataCopies gets the value of NumberOfDataCopies for the instance +func (instance *MSFT_StorageTier) GetPropertyNumberOfDataCopies() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfDataCopies") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfGroups sets the value of NumberOfGroups for the instance +func (instance *MSFT_StorageTier) SetPropertyNumberOfGroups(value uint16) (err error) { + return instance.SetProperty("NumberOfGroups", (value)) +} + +// GetNumberOfGroups gets the value of NumberOfGroups for the instance +func (instance *MSFT_StorageTier) GetPropertyNumberOfGroups() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfGroups") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetParityLayout sets the value of ParityLayout for the instance +func (instance *MSFT_StorageTier) SetPropertyParityLayout(value uint16) (err error) { + return instance.SetProperty("ParityLayout", (value)) +} + +// GetParityLayout gets the value of ParityLayout for the instance +func (instance *MSFT_StorageTier) GetPropertyParityLayout() (value uint16, err error) { + retValue, err := instance.GetProperty("ParityLayout") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetPhysicalDiskRedundancy sets the value of PhysicalDiskRedundancy for the instance +func (instance *MSFT_StorageTier) SetPropertyPhysicalDiskRedundancy(value uint16) (err error) { + return instance.SetProperty("PhysicalDiskRedundancy", (value)) +} + +// GetPhysicalDiskRedundancy gets the value of PhysicalDiskRedundancy for the instance +func (instance *MSFT_StorageTier) GetPropertyPhysicalDiskRedundancy() (value uint16, err error) { + retValue, err := instance.GetProperty("PhysicalDiskRedundancy") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetProvisioningType sets the value of ProvisioningType for the instance +func (instance *MSFT_StorageTier) SetPropertyProvisioningType(value uint16) (err error) { + return instance.SetProperty("ProvisioningType", (value)) +} + +// GetProvisioningType gets the value of ProvisioningType for the instance +func (instance *MSFT_StorageTier) GetPropertyProvisioningType() (value uint16, err error) { + retValue, err := instance.GetProperty("ProvisioningType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetResiliencySettingName sets the value of ResiliencySettingName for the instance +func (instance *MSFT_StorageTier) SetPropertyResiliencySettingName(value string) (err error) { + return instance.SetProperty("ResiliencySettingName", (value)) +} + +// GetResiliencySettingName gets the value of ResiliencySettingName for the instance +func (instance *MSFT_StorageTier) GetPropertyResiliencySettingName() (value string, err error) { + retValue, err := instance.GetProperty("ResiliencySettingName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSize sets the value of Size for the instance +func (instance *MSFT_StorageTier) SetPropertySize(value uint64) (err error) { + return instance.SetProperty("Size", (value)) +} + +// GetSize gets the value of Size for the instance +func (instance *MSFT_StorageTier) GetPropertySize() (value uint64, err error) { + retValue, err := instance.GetProperty("Size") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetTierClass sets the value of TierClass for the instance +func (instance *MSFT_StorageTier) SetPropertyTierClass(value uint16) (err error) { + return instance.SetProperty("TierClass", (value)) +} + +// GetTierClass gets the value of TierClass for the instance +func (instance *MSFT_StorageTier) GetPropertyTierClass() (value uint16, err error) { + retValue, err := instance.GetProperty("TierClass") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetUsage sets the value of Usage for the instance +func (instance *MSFT_StorageTier) SetPropertyUsage(value uint16) (err error) { + return instance.SetProperty("Usage", (value)) +} + +// GetUsage gets the value of Usage for the instance +func (instance *MSFT_StorageTier) GetPropertyUsage() (value uint16, err error) { + retValue, err := instance.GetProperty("Usage") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// + +// +// +// +func (instance *MSFT_StorageTier) GetPhysicalExtent( /* OUT */ PhysicalExtents []MSFT_PhysicalExtent, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetPhysicalExtent") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_StorageTier) DeleteObject( /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("DeleteObject", RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +// +func (instance *MSFT_StorageTier) Resize( /* IN/OUT */ Size uint64, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Resize", RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_StorageTier) SetFriendlyName( /* IN */ FriendlyName string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetFriendlyName", FriendlyName) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// + +// +// +func (instance *MSFT_StorageTier) SetAttributes( /* IN */ ProvisioningType uint16, + /* IN */ AllocationUnitSize uint64, + /* IN */ MediaType uint16, + /* IN */ FaultDomainAwareness uint16, + /* IN */ ColumnIsolation uint16, + /* IN */ ResiliencySettingName string, + /* IN */ Usage uint16, + /* IN */ PhysicalDiskRedundancy uint16, + /* IN */ NumberOfDataCopies uint16, + /* IN */ NumberOfGroups uint16, + /* IN */ NumberOfColumns uint16, + /* IN */ Interleave uint64, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetAttributes", ProvisioningType, AllocationUnitSize, MediaType, FaultDomainAwareness, ColumnIsolation, ResiliencySettingName, Usage, PhysicalDiskRedundancy, NumberOfDataCopies, NumberOfGroups, NumberOfColumns, Interleave) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_StorageTier) SetDescription( /* IN */ Description string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetDescription", Description) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +// +// +// +func (instance *MSFT_StorageTier) GetSupportedSize( /* IN */ ResiliencySettingName string, + /* OUT */ SupportedSizes []uint64, + /* OUT */ TierSizeMin uint64, + /* OUT */ TierSizeMax uint64, + /* OUT */ TierSizeDivisor uint64, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSupportedSize", ResiliencySettingName) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_StorageTier) AddStorageFaultDomain( /* IN */ StorageFaultDomains []MSFT_StorageFaultDomain, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("AddStorageFaultDomain", StorageFaultDomains, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_StorageTier) RemoveStorageFaultDomain( /* IN */ StorageFaultDomains []MSFT_StorageFaultDomain, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RemoveStorageFaultDomain", StorageFaultDomains, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Synchronized.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Synchronized.go new file mode 100644 index 000000000..35fc2d8fc --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Synchronized.go @@ -0,0 +1,471 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_Synchronized struct +type MSFT_Synchronized struct { + *cim.WmiInstance + + // + CopyMethodology uint16 + + // + CopyPriority uint16 + + // + CopyState uint16 + + // + CopyType uint16 + + // + PercentSynced uint16 + + // + ProgressStatus uint16 + + // + RecoveryPointObjective uint32 + + // + ReplicaType uint16 + + // + RequestedCopyState uint16 + + // + SyncMaintained bool + + // + SyncMode uint16 + + // + SyncState uint16 + + // + SyncTime string + + // + SyncType uint16 +} + +func NewMSFT_SynchronizedEx1(instance *cim.WmiInstance) (newInstance *MSFT_Synchronized, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_Synchronized{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_SynchronizedEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_Synchronized, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_Synchronized{ + WmiInstance: tmp, + } + return +} + +// SetCopyMethodology sets the value of CopyMethodology for the instance +func (instance *MSFT_Synchronized) SetPropertyCopyMethodology(value uint16) (err error) { + return instance.SetProperty("CopyMethodology", (value)) +} + +// GetCopyMethodology gets the value of CopyMethodology for the instance +func (instance *MSFT_Synchronized) GetPropertyCopyMethodology() (value uint16, err error) { + retValue, err := instance.GetProperty("CopyMethodology") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetCopyPriority sets the value of CopyPriority for the instance +func (instance *MSFT_Synchronized) SetPropertyCopyPriority(value uint16) (err error) { + return instance.SetProperty("CopyPriority", (value)) +} + +// GetCopyPriority gets the value of CopyPriority for the instance +func (instance *MSFT_Synchronized) GetPropertyCopyPriority() (value uint16, err error) { + retValue, err := instance.GetProperty("CopyPriority") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetCopyState sets the value of CopyState for the instance +func (instance *MSFT_Synchronized) SetPropertyCopyState(value uint16) (err error) { + return instance.SetProperty("CopyState", (value)) +} + +// GetCopyState gets the value of CopyState for the instance +func (instance *MSFT_Synchronized) GetPropertyCopyState() (value uint16, err error) { + retValue, err := instance.GetProperty("CopyState") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetCopyType sets the value of CopyType for the instance +func (instance *MSFT_Synchronized) SetPropertyCopyType(value uint16) (err error) { + return instance.SetProperty("CopyType", (value)) +} + +// GetCopyType gets the value of CopyType for the instance +func (instance *MSFT_Synchronized) GetPropertyCopyType() (value uint16, err error) { + retValue, err := instance.GetProperty("CopyType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetPercentSynced sets the value of PercentSynced for the instance +func (instance *MSFT_Synchronized) SetPropertyPercentSynced(value uint16) (err error) { + return instance.SetProperty("PercentSynced", (value)) +} + +// GetPercentSynced gets the value of PercentSynced for the instance +func (instance *MSFT_Synchronized) GetPropertyPercentSynced() (value uint16, err error) { + retValue, err := instance.GetProperty("PercentSynced") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetProgressStatus sets the value of ProgressStatus for the instance +func (instance *MSFT_Synchronized) SetPropertyProgressStatus(value uint16) (err error) { + return instance.SetProperty("ProgressStatus", (value)) +} + +// GetProgressStatus gets the value of ProgressStatus for the instance +func (instance *MSFT_Synchronized) GetPropertyProgressStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("ProgressStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetRecoveryPointObjective sets the value of RecoveryPointObjective for the instance +func (instance *MSFT_Synchronized) SetPropertyRecoveryPointObjective(value uint32) (err error) { + return instance.SetProperty("RecoveryPointObjective", (value)) +} + +// GetRecoveryPointObjective gets the value of RecoveryPointObjective for the instance +func (instance *MSFT_Synchronized) GetPropertyRecoveryPointObjective() (value uint32, err error) { + retValue, err := instance.GetProperty("RecoveryPointObjective") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetReplicaType sets the value of ReplicaType for the instance +func (instance *MSFT_Synchronized) SetPropertyReplicaType(value uint16) (err error) { + return instance.SetProperty("ReplicaType", (value)) +} + +// GetReplicaType gets the value of ReplicaType for the instance +func (instance *MSFT_Synchronized) GetPropertyReplicaType() (value uint16, err error) { + retValue, err := instance.GetProperty("ReplicaType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetRequestedCopyState sets the value of RequestedCopyState for the instance +func (instance *MSFT_Synchronized) SetPropertyRequestedCopyState(value uint16) (err error) { + return instance.SetProperty("RequestedCopyState", (value)) +} + +// GetRequestedCopyState gets the value of RequestedCopyState for the instance +func (instance *MSFT_Synchronized) GetPropertyRequestedCopyState() (value uint16, err error) { + retValue, err := instance.GetProperty("RequestedCopyState") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSyncMaintained sets the value of SyncMaintained for the instance +func (instance *MSFT_Synchronized) SetPropertySyncMaintained(value bool) (err error) { + return instance.SetProperty("SyncMaintained", (value)) +} + +// GetSyncMaintained gets the value of SyncMaintained for the instance +func (instance *MSFT_Synchronized) GetPropertySyncMaintained() (value bool, err error) { + retValue, err := instance.GetProperty("SyncMaintained") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSyncMode sets the value of SyncMode for the instance +func (instance *MSFT_Synchronized) SetPropertySyncMode(value uint16) (err error) { + return instance.SetProperty("SyncMode", (value)) +} + +// GetSyncMode gets the value of SyncMode for the instance +func (instance *MSFT_Synchronized) GetPropertySyncMode() (value uint16, err error) { + retValue, err := instance.GetProperty("SyncMode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSyncState sets the value of SyncState for the instance +func (instance *MSFT_Synchronized) SetPropertySyncState(value uint16) (err error) { + return instance.SetProperty("SyncState", (value)) +} + +// GetSyncState gets the value of SyncState for the instance +func (instance *MSFT_Synchronized) GetPropertySyncState() (value uint16, err error) { + retValue, err := instance.GetProperty("SyncState") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSyncTime sets the value of SyncTime for the instance +func (instance *MSFT_Synchronized) SetPropertySyncTime(value string) (err error) { + return instance.SetProperty("SyncTime", (value)) +} + +// GetSyncTime gets the value of SyncTime for the instance +func (instance *MSFT_Synchronized) GetPropertySyncTime() (value string, err error) { + retValue, err := instance.GetProperty("SyncTime") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSyncType sets the value of SyncType for the instance +func (instance *MSFT_Synchronized) SetPropertySyncType(value uint16) (err error) { + return instance.SetProperty("SyncType", (value)) +} + +// GetSyncType gets the value of SyncType for the instance +func (instance *MSFT_Synchronized) GetPropertySyncType() (value uint16, err error) { + retValue, err := instance.GetProperty("SyncType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPort.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPort.go new file mode 100644 index 000000000..0abcaac55 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPort.go @@ -0,0 +1,593 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_TargetPort struct +type MSFT_TargetPort struct { + *MSFT_StorageObject + + // + ConnectionType uint16 + + // + FriendlyName string + + // + HealthStatus uint16 + + // + LinkTechnology uint16 + + // + MaxSpeed uint64 + + // + NetworkAddresses []string + + // + NodeAddress string + + // + OperationalStatus []uint16 + + // + OtherConnectionTypeDescription string + + // + OtherLinkTechnology string + + // + OtherOperationalStatusDescription string + + // + PortAddress string + + // + PortNumbers []uint16 + + // + PortType uint16 + + // + Role uint16 + + // + Speed uint64 + + // + StorageControllerId string + + // + UsageRestriction uint16 +} + +func NewMSFT_TargetPortEx1(instance *cim.WmiInstance) (newInstance *MSFT_TargetPort, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_TargetPort{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_TargetPortEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_TargetPort, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_TargetPort{ + MSFT_StorageObject: tmp, + } + return +} + +// SetConnectionType sets the value of ConnectionType for the instance +func (instance *MSFT_TargetPort) SetPropertyConnectionType(value uint16) (err error) { + return instance.SetProperty("ConnectionType", (value)) +} + +// GetConnectionType gets the value of ConnectionType for the instance +func (instance *MSFT_TargetPort) GetPropertyConnectionType() (value uint16, err error) { + retValue, err := instance.GetProperty("ConnectionType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetFriendlyName sets the value of FriendlyName for the instance +func (instance *MSFT_TargetPort) SetPropertyFriendlyName(value string) (err error) { + return instance.SetProperty("FriendlyName", (value)) +} + +// GetFriendlyName gets the value of FriendlyName for the instance +func (instance *MSFT_TargetPort) GetPropertyFriendlyName() (value string, err error) { + retValue, err := instance.GetProperty("FriendlyName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetHealthStatus sets the value of HealthStatus for the instance +func (instance *MSFT_TargetPort) SetPropertyHealthStatus(value uint16) (err error) { + return instance.SetProperty("HealthStatus", (value)) +} + +// GetHealthStatus gets the value of HealthStatus for the instance +func (instance *MSFT_TargetPort) GetPropertyHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("HealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetLinkTechnology sets the value of LinkTechnology for the instance +func (instance *MSFT_TargetPort) SetPropertyLinkTechnology(value uint16) (err error) { + return instance.SetProperty("LinkTechnology", (value)) +} + +// GetLinkTechnology gets the value of LinkTechnology for the instance +func (instance *MSFT_TargetPort) GetPropertyLinkTechnology() (value uint16, err error) { + retValue, err := instance.GetProperty("LinkTechnology") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetMaxSpeed sets the value of MaxSpeed for the instance +func (instance *MSFT_TargetPort) SetPropertyMaxSpeed(value uint64) (err error) { + return instance.SetProperty("MaxSpeed", (value)) +} + +// GetMaxSpeed gets the value of MaxSpeed for the instance +func (instance *MSFT_TargetPort) GetPropertyMaxSpeed() (value uint64, err error) { + retValue, err := instance.GetProperty("MaxSpeed") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetNetworkAddresses sets the value of NetworkAddresses for the instance +func (instance *MSFT_TargetPort) SetPropertyNetworkAddresses(value []string) (err error) { + return instance.SetProperty("NetworkAddresses", (value)) +} + +// GetNetworkAddresses gets the value of NetworkAddresses for the instance +func (instance *MSFT_TargetPort) GetPropertyNetworkAddresses() (value []string, err error) { + retValue, err := instance.GetProperty("NetworkAddresses") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetNodeAddress sets the value of NodeAddress for the instance +func (instance *MSFT_TargetPort) SetPropertyNodeAddress(value string) (err error) { + return instance.SetProperty("NodeAddress", (value)) +} + +// GetNodeAddress gets the value of NodeAddress for the instance +func (instance *MSFT_TargetPort) GetPropertyNodeAddress() (value string, err error) { + retValue, err := instance.GetProperty("NodeAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_TargetPort) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_TargetPort) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetOtherConnectionTypeDescription sets the value of OtherConnectionTypeDescription for the instance +func (instance *MSFT_TargetPort) SetPropertyOtherConnectionTypeDescription(value string) (err error) { + return instance.SetProperty("OtherConnectionTypeDescription", (value)) +} + +// GetOtherConnectionTypeDescription gets the value of OtherConnectionTypeDescription for the instance +func (instance *MSFT_TargetPort) GetPropertyOtherConnectionTypeDescription() (value string, err error) { + retValue, err := instance.GetProperty("OtherConnectionTypeDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOtherLinkTechnology sets the value of OtherLinkTechnology for the instance +func (instance *MSFT_TargetPort) SetPropertyOtherLinkTechnology(value string) (err error) { + return instance.SetProperty("OtherLinkTechnology", (value)) +} + +// GetOtherLinkTechnology gets the value of OtherLinkTechnology for the instance +func (instance *MSFT_TargetPort) GetPropertyOtherLinkTechnology() (value string, err error) { + retValue, err := instance.GetProperty("OtherLinkTechnology") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOtherOperationalStatusDescription sets the value of OtherOperationalStatusDescription for the instance +func (instance *MSFT_TargetPort) SetPropertyOtherOperationalStatusDescription(value string) (err error) { + return instance.SetProperty("OtherOperationalStatusDescription", (value)) +} + +// GetOtherOperationalStatusDescription gets the value of OtherOperationalStatusDescription for the instance +func (instance *MSFT_TargetPort) GetPropertyOtherOperationalStatusDescription() (value string, err error) { + retValue, err := instance.GetProperty("OtherOperationalStatusDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPortAddress sets the value of PortAddress for the instance +func (instance *MSFT_TargetPort) SetPropertyPortAddress(value string) (err error) { + return instance.SetProperty("PortAddress", (value)) +} + +// GetPortAddress gets the value of PortAddress for the instance +func (instance *MSFT_TargetPort) GetPropertyPortAddress() (value string, err error) { + retValue, err := instance.GetProperty("PortAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPortNumbers sets the value of PortNumbers for the instance +func (instance *MSFT_TargetPort) SetPropertyPortNumbers(value []uint16) (err error) { + return instance.SetProperty("PortNumbers", (value)) +} + +// GetPortNumbers gets the value of PortNumbers for the instance +func (instance *MSFT_TargetPort) GetPropertyPortNumbers() (value []uint16, err error) { + retValue, err := instance.GetProperty("PortNumbers") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetPortType sets the value of PortType for the instance +func (instance *MSFT_TargetPort) SetPropertyPortType(value uint16) (err error) { + return instance.SetProperty("PortType", (value)) +} + +// GetPortType gets the value of PortType for the instance +func (instance *MSFT_TargetPort) GetPropertyPortType() (value uint16, err error) { + retValue, err := instance.GetProperty("PortType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetRole sets the value of Role for the instance +func (instance *MSFT_TargetPort) SetPropertyRole(value uint16) (err error) { + return instance.SetProperty("Role", (value)) +} + +// GetRole gets the value of Role for the instance +func (instance *MSFT_TargetPort) GetPropertyRole() (value uint16, err error) { + retValue, err := instance.GetProperty("Role") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetSpeed sets the value of Speed for the instance +func (instance *MSFT_TargetPort) SetPropertySpeed(value uint64) (err error) { + return instance.SetProperty("Speed", (value)) +} + +// GetSpeed gets the value of Speed for the instance +func (instance *MSFT_TargetPort) GetPropertySpeed() (value uint64, err error) { + retValue, err := instance.GetProperty("Speed") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetStorageControllerId sets the value of StorageControllerId for the instance +func (instance *MSFT_TargetPort) SetPropertyStorageControllerId(value string) (err error) { + return instance.SetProperty("StorageControllerId", (value)) +} + +// GetStorageControllerId gets the value of StorageControllerId for the instance +func (instance *MSFT_TargetPort) GetPropertyStorageControllerId() (value string, err error) { + retValue, err := instance.GetProperty("StorageControllerId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetUsageRestriction sets the value of UsageRestriction for the instance +func (instance *MSFT_TargetPort) SetPropertyUsageRestriction(value uint16) (err error) { + return instance.SetProperty("UsageRestriction", (value)) +} + +// GetUsageRestriction gets the value of UsageRestriction for the instance +func (instance *MSFT_TargetPort) GetPropertyUsageRestriction() (value uint16, err error) { + retValue, err := instance.GetProperty("UsageRestriction") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPortToTargetPortal.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPortToTargetPortal.go new file mode 100644 index 000000000..2c954be46 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPortToTargetPortal.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_TargetPortToTargetPortal struct +type MSFT_TargetPortToTargetPortal struct { + *cim.WmiInstance + + // + TargetPort MSFT_TargetPort + + // + TargetPortal MSFT_TargetPortal +} + +func NewMSFT_TargetPortToTargetPortalEx1(instance *cim.WmiInstance) (newInstance *MSFT_TargetPortToTargetPortal, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_TargetPortToTargetPortal{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_TargetPortToTargetPortalEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_TargetPortToTargetPortal, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_TargetPortToTargetPortal{ + WmiInstance: tmp, + } + return +} + +// SetTargetPort sets the value of TargetPort for the instance +func (instance *MSFT_TargetPortToTargetPortal) SetPropertyTargetPort(value MSFT_TargetPort) (err error) { + return instance.SetProperty("TargetPort", (value)) +} + +// GetTargetPort gets the value of TargetPort for the instance +func (instance *MSFT_TargetPortToTargetPortal) GetPropertyTargetPort() (value MSFT_TargetPort, err error) { + retValue, err := instance.GetProperty("TargetPort") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_TargetPort) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_TargetPort is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_TargetPort(valuetmp) + + return +} + +// SetTargetPortal sets the value of TargetPortal for the instance +func (instance *MSFT_TargetPortToTargetPortal) SetPropertyTargetPortal(value MSFT_TargetPortal) (err error) { + return instance.SetProperty("TargetPortal", (value)) +} + +// GetTargetPortal gets the value of TargetPortal for the instance +func (instance *MSFT_TargetPortToTargetPortal) GetPropertyTargetPortal() (value MSFT_TargetPortal, err error) { + retValue, err := instance.GetProperty("TargetPortal") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_TargetPortal) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_TargetPortal is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_TargetPortal(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPortToVirtualDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPortToVirtualDisk.go new file mode 100644 index 000000000..2c6cbb640 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPortToVirtualDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_TargetPortToVirtualDisk struct +type MSFT_TargetPortToVirtualDisk struct { + *cim.WmiInstance + + // + TargetPort MSFT_TargetPort + + // + VirtualDisk MSFT_VirtualDisk +} + +func NewMSFT_TargetPortToVirtualDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_TargetPortToVirtualDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_TargetPortToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_TargetPortToVirtualDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_TargetPortToVirtualDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_TargetPortToVirtualDisk{ + WmiInstance: tmp, + } + return +} + +// SetTargetPort sets the value of TargetPort for the instance +func (instance *MSFT_TargetPortToVirtualDisk) SetPropertyTargetPort(value MSFT_TargetPort) (err error) { + return instance.SetProperty("TargetPort", (value)) +} + +// GetTargetPort gets the value of TargetPort for the instance +func (instance *MSFT_TargetPortToVirtualDisk) GetPropertyTargetPort() (value MSFT_TargetPort, err error) { + retValue, err := instance.GetProperty("TargetPort") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_TargetPort) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_TargetPort is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_TargetPort(valuetmp) + + return +} + +// SetVirtualDisk sets the value of VirtualDisk for the instance +func (instance *MSFT_TargetPortToVirtualDisk) SetPropertyVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("VirtualDisk", (value)) +} + +// GetVirtualDisk gets the value of VirtualDisk for the instance +func (instance *MSFT_TargetPortToVirtualDisk) GetPropertyVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("VirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPortal.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPortal.go new file mode 100644 index 000000000..4b21c4b5b --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_TargetPortal.go @@ -0,0 +1,170 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_TargetPortal struct +type MSFT_TargetPortal struct { + *MSFT_StorageObject + + // + IPv4Address string + + // + IPv6Address string + + // + PortNumber uint32 + + // + SubnetMask string +} + +func NewMSFT_TargetPortalEx1(instance *cim.WmiInstance) (newInstance *MSFT_TargetPortal, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_TargetPortal{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_TargetPortalEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_TargetPortal, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_TargetPortal{ + MSFT_StorageObject: tmp, + } + return +} + +// SetIPv4Address sets the value of IPv4Address for the instance +func (instance *MSFT_TargetPortal) SetPropertyIPv4Address(value string) (err error) { + return instance.SetProperty("IPv4Address", (value)) +} + +// GetIPv4Address gets the value of IPv4Address for the instance +func (instance *MSFT_TargetPortal) GetPropertyIPv4Address() (value string, err error) { + retValue, err := instance.GetProperty("IPv4Address") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetIPv6Address sets the value of IPv6Address for the instance +func (instance *MSFT_TargetPortal) SetPropertyIPv6Address(value string) (err error) { + return instance.SetProperty("IPv6Address", (value)) +} + +// GetIPv6Address gets the value of IPv6Address for the instance +func (instance *MSFT_TargetPortal) GetPropertyIPv6Address() (value string, err error) { + retValue, err := instance.GetProperty("IPv6Address") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPortNumber sets the value of PortNumber for the instance +func (instance *MSFT_TargetPortal) SetPropertyPortNumber(value uint32) (err error) { + return instance.SetProperty("PortNumber", (value)) +} + +// GetPortNumber gets the value of PortNumber for the instance +func (instance *MSFT_TargetPortal) GetPropertyPortNumber() (value uint32, err error) { + retValue, err := instance.GetProperty("PortNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetSubnetMask sets the value of SubnetMask for the instance +func (instance *MSFT_TargetPortal) SetPropertySubnetMask(value string) (err error) { + return instance.SetProperty("SubnetMask", (value)) +} + +// GetSubnetMask gets the value of SubnetMask for the instance +func (instance *MSFT_TargetPortal) GetPropertySubnetMask() (value string, err error) { + retValue, err := instance.GetProperty("SubnetMask") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDisk.go new file mode 100644 index 000000000..e6514192d --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDisk.go @@ -0,0 +1,1692 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_VirtualDisk struct +type MSFT_VirtualDisk struct { + *MSFT_StorageObject + + // + Access uint16 + + // + AllocatedSize uint64 + + // + AllocationUnitSize uint64 + + // + ColumnIsolation uint16 + + // + DetachedReason uint16 + + // + FaultDomainAwareness uint16 + + // + FootprintOnPool uint64 + + // + FriendlyName string + + // + HealthStatus uint16 + + // + Interleave uint64 + + // + IsDeduplicationEnabled bool + + // + IsEnclosureAware bool + + // + IsManualAttach bool + + // + IsSnapshot bool + + // + IsTiered bool + + // + LogicalSectorSize uint64 + + // + MediaType uint16 + + // + Name string + + // + NameFormat uint16 + + // + NumberOfAvailableCopies uint16 + + // + NumberOfColumns uint16 + + // + NumberOfDataCopies uint16 + + // + NumberOfGroups uint16 + + // + OperationalStatus []uint16 + + // + OtherOperationalStatusDescription string + + // + OtherUsageDescription string + + // + ParityLayout uint16 + + // + PhysicalDiskRedundancy uint16 + + // + PhysicalSectorSize uint64 + + // + ProvisioningType uint16 + + // + ReadCacheSize uint64 + + // + RequestNoSinglePointOfFailure bool + + // + ResiliencySettingName string + + // + Size uint64 + + // + UniqueIdFormat uint16 + + // + UniqueIdFormatDescription string + + // + Usage uint16 + + // + WriteCacheSize uint64 +} + +func NewMSFT_VirtualDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_VirtualDisk, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_VirtualDisk{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_VirtualDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_VirtualDisk, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_VirtualDisk{ + MSFT_StorageObject: tmp, + } + return +} + +// SetAccess sets the value of Access for the instance +func (instance *MSFT_VirtualDisk) SetPropertyAccess(value uint16) (err error) { + return instance.SetProperty("Access", (value)) +} + +// GetAccess gets the value of Access for the instance +func (instance *MSFT_VirtualDisk) GetPropertyAccess() (value uint16, err error) { + retValue, err := instance.GetProperty("Access") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetAllocatedSize sets the value of AllocatedSize for the instance +func (instance *MSFT_VirtualDisk) SetPropertyAllocatedSize(value uint64) (err error) { + return instance.SetProperty("AllocatedSize", (value)) +} + +// GetAllocatedSize gets the value of AllocatedSize for the instance +func (instance *MSFT_VirtualDisk) GetPropertyAllocatedSize() (value uint64, err error) { + retValue, err := instance.GetProperty("AllocatedSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetAllocationUnitSize sets the value of AllocationUnitSize for the instance +func (instance *MSFT_VirtualDisk) SetPropertyAllocationUnitSize(value uint64) (err error) { + return instance.SetProperty("AllocationUnitSize", (value)) +} + +// GetAllocationUnitSize gets the value of AllocationUnitSize for the instance +func (instance *MSFT_VirtualDisk) GetPropertyAllocationUnitSize() (value uint64, err error) { + retValue, err := instance.GetProperty("AllocationUnitSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetColumnIsolation sets the value of ColumnIsolation for the instance +func (instance *MSFT_VirtualDisk) SetPropertyColumnIsolation(value uint16) (err error) { + return instance.SetProperty("ColumnIsolation", (value)) +} + +// GetColumnIsolation gets the value of ColumnIsolation for the instance +func (instance *MSFT_VirtualDisk) GetPropertyColumnIsolation() (value uint16, err error) { + retValue, err := instance.GetProperty("ColumnIsolation") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetDetachedReason sets the value of DetachedReason for the instance +func (instance *MSFT_VirtualDisk) SetPropertyDetachedReason(value uint16) (err error) { + return instance.SetProperty("DetachedReason", (value)) +} + +// GetDetachedReason gets the value of DetachedReason for the instance +func (instance *MSFT_VirtualDisk) GetPropertyDetachedReason() (value uint16, err error) { + retValue, err := instance.GetProperty("DetachedReason") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetFaultDomainAwareness sets the value of FaultDomainAwareness for the instance +func (instance *MSFT_VirtualDisk) SetPropertyFaultDomainAwareness(value uint16) (err error) { + return instance.SetProperty("FaultDomainAwareness", (value)) +} + +// GetFaultDomainAwareness gets the value of FaultDomainAwareness for the instance +func (instance *MSFT_VirtualDisk) GetPropertyFaultDomainAwareness() (value uint16, err error) { + retValue, err := instance.GetProperty("FaultDomainAwareness") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetFootprintOnPool sets the value of FootprintOnPool for the instance +func (instance *MSFT_VirtualDisk) SetPropertyFootprintOnPool(value uint64) (err error) { + return instance.SetProperty("FootprintOnPool", (value)) +} + +// GetFootprintOnPool gets the value of FootprintOnPool for the instance +func (instance *MSFT_VirtualDisk) GetPropertyFootprintOnPool() (value uint64, err error) { + retValue, err := instance.GetProperty("FootprintOnPool") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetFriendlyName sets the value of FriendlyName for the instance +func (instance *MSFT_VirtualDisk) SetPropertyFriendlyName(value string) (err error) { + return instance.SetProperty("FriendlyName", (value)) +} + +// GetFriendlyName gets the value of FriendlyName for the instance +func (instance *MSFT_VirtualDisk) GetPropertyFriendlyName() (value string, err error) { + retValue, err := instance.GetProperty("FriendlyName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetHealthStatus sets the value of HealthStatus for the instance +func (instance *MSFT_VirtualDisk) SetPropertyHealthStatus(value uint16) (err error) { + return instance.SetProperty("HealthStatus", (value)) +} + +// GetHealthStatus gets the value of HealthStatus for the instance +func (instance *MSFT_VirtualDisk) GetPropertyHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("HealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetInterleave sets the value of Interleave for the instance +func (instance *MSFT_VirtualDisk) SetPropertyInterleave(value uint64) (err error) { + return instance.SetProperty("Interleave", (value)) +} + +// GetInterleave gets the value of Interleave for the instance +func (instance *MSFT_VirtualDisk) GetPropertyInterleave() (value uint64, err error) { + retValue, err := instance.GetProperty("Interleave") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetIsDeduplicationEnabled sets the value of IsDeduplicationEnabled for the instance +func (instance *MSFT_VirtualDisk) SetPropertyIsDeduplicationEnabled(value bool) (err error) { + return instance.SetProperty("IsDeduplicationEnabled", (value)) +} + +// GetIsDeduplicationEnabled gets the value of IsDeduplicationEnabled for the instance +func (instance *MSFT_VirtualDisk) GetPropertyIsDeduplicationEnabled() (value bool, err error) { + retValue, err := instance.GetProperty("IsDeduplicationEnabled") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsEnclosureAware sets the value of IsEnclosureAware for the instance +func (instance *MSFT_VirtualDisk) SetPropertyIsEnclosureAware(value bool) (err error) { + return instance.SetProperty("IsEnclosureAware", (value)) +} + +// GetIsEnclosureAware gets the value of IsEnclosureAware for the instance +func (instance *MSFT_VirtualDisk) GetPropertyIsEnclosureAware() (value bool, err error) { + retValue, err := instance.GetProperty("IsEnclosureAware") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsManualAttach sets the value of IsManualAttach for the instance +func (instance *MSFT_VirtualDisk) SetPropertyIsManualAttach(value bool) (err error) { + return instance.SetProperty("IsManualAttach", (value)) +} + +// GetIsManualAttach gets the value of IsManualAttach for the instance +func (instance *MSFT_VirtualDisk) GetPropertyIsManualAttach() (value bool, err error) { + retValue, err := instance.GetProperty("IsManualAttach") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsSnapshot sets the value of IsSnapshot for the instance +func (instance *MSFT_VirtualDisk) SetPropertyIsSnapshot(value bool) (err error) { + return instance.SetProperty("IsSnapshot", (value)) +} + +// GetIsSnapshot gets the value of IsSnapshot for the instance +func (instance *MSFT_VirtualDisk) GetPropertyIsSnapshot() (value bool, err error) { + retValue, err := instance.GetProperty("IsSnapshot") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsTiered sets the value of IsTiered for the instance +func (instance *MSFT_VirtualDisk) SetPropertyIsTiered(value bool) (err error) { + return instance.SetProperty("IsTiered", (value)) +} + +// GetIsTiered gets the value of IsTiered for the instance +func (instance *MSFT_VirtualDisk) GetPropertyIsTiered() (value bool, err error) { + retValue, err := instance.GetProperty("IsTiered") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetLogicalSectorSize sets the value of LogicalSectorSize for the instance +func (instance *MSFT_VirtualDisk) SetPropertyLogicalSectorSize(value uint64) (err error) { + return instance.SetProperty("LogicalSectorSize", (value)) +} + +// GetLogicalSectorSize gets the value of LogicalSectorSize for the instance +func (instance *MSFT_VirtualDisk) GetPropertyLogicalSectorSize() (value uint64, err error) { + retValue, err := instance.GetProperty("LogicalSectorSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetMediaType sets the value of MediaType for the instance +func (instance *MSFT_VirtualDisk) SetPropertyMediaType(value uint16) (err error) { + return instance.SetProperty("MediaType", (value)) +} + +// GetMediaType gets the value of MediaType for the instance +func (instance *MSFT_VirtualDisk) GetPropertyMediaType() (value uint16, err error) { + retValue, err := instance.GetProperty("MediaType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetName sets the value of Name for the instance +func (instance *MSFT_VirtualDisk) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *MSFT_VirtualDisk) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetNameFormat sets the value of NameFormat for the instance +func (instance *MSFT_VirtualDisk) SetPropertyNameFormat(value uint16) (err error) { + return instance.SetProperty("NameFormat", (value)) +} + +// GetNameFormat gets the value of NameFormat for the instance +func (instance *MSFT_VirtualDisk) GetPropertyNameFormat() (value uint16, err error) { + retValue, err := instance.GetProperty("NameFormat") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfAvailableCopies sets the value of NumberOfAvailableCopies for the instance +func (instance *MSFT_VirtualDisk) SetPropertyNumberOfAvailableCopies(value uint16) (err error) { + return instance.SetProperty("NumberOfAvailableCopies", (value)) +} + +// GetNumberOfAvailableCopies gets the value of NumberOfAvailableCopies for the instance +func (instance *MSFT_VirtualDisk) GetPropertyNumberOfAvailableCopies() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfAvailableCopies") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfColumns sets the value of NumberOfColumns for the instance +func (instance *MSFT_VirtualDisk) SetPropertyNumberOfColumns(value uint16) (err error) { + return instance.SetProperty("NumberOfColumns", (value)) +} + +// GetNumberOfColumns gets the value of NumberOfColumns for the instance +func (instance *MSFT_VirtualDisk) GetPropertyNumberOfColumns() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfColumns") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfDataCopies sets the value of NumberOfDataCopies for the instance +func (instance *MSFT_VirtualDisk) SetPropertyNumberOfDataCopies(value uint16) (err error) { + return instance.SetProperty("NumberOfDataCopies", (value)) +} + +// GetNumberOfDataCopies gets the value of NumberOfDataCopies for the instance +func (instance *MSFT_VirtualDisk) GetPropertyNumberOfDataCopies() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfDataCopies") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetNumberOfGroups sets the value of NumberOfGroups for the instance +func (instance *MSFT_VirtualDisk) SetPropertyNumberOfGroups(value uint16) (err error) { + return instance.SetProperty("NumberOfGroups", (value)) +} + +// GetNumberOfGroups gets the value of NumberOfGroups for the instance +func (instance *MSFT_VirtualDisk) GetPropertyNumberOfGroups() (value uint16, err error) { + retValue, err := instance.GetProperty("NumberOfGroups") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_VirtualDisk) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_VirtualDisk) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetOtherOperationalStatusDescription sets the value of OtherOperationalStatusDescription for the instance +func (instance *MSFT_VirtualDisk) SetPropertyOtherOperationalStatusDescription(value string) (err error) { + return instance.SetProperty("OtherOperationalStatusDescription", (value)) +} + +// GetOtherOperationalStatusDescription gets the value of OtherOperationalStatusDescription for the instance +func (instance *MSFT_VirtualDisk) GetPropertyOtherOperationalStatusDescription() (value string, err error) { + retValue, err := instance.GetProperty("OtherOperationalStatusDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetOtherUsageDescription sets the value of OtherUsageDescription for the instance +func (instance *MSFT_VirtualDisk) SetPropertyOtherUsageDescription(value string) (err error) { + return instance.SetProperty("OtherUsageDescription", (value)) +} + +// GetOtherUsageDescription gets the value of OtherUsageDescription for the instance +func (instance *MSFT_VirtualDisk) GetPropertyOtherUsageDescription() (value string, err error) { + retValue, err := instance.GetProperty("OtherUsageDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetParityLayout sets the value of ParityLayout for the instance +func (instance *MSFT_VirtualDisk) SetPropertyParityLayout(value uint16) (err error) { + return instance.SetProperty("ParityLayout", (value)) +} + +// GetParityLayout gets the value of ParityLayout for the instance +func (instance *MSFT_VirtualDisk) GetPropertyParityLayout() (value uint16, err error) { + retValue, err := instance.GetProperty("ParityLayout") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetPhysicalDiskRedundancy sets the value of PhysicalDiskRedundancy for the instance +func (instance *MSFT_VirtualDisk) SetPropertyPhysicalDiskRedundancy(value uint16) (err error) { + return instance.SetProperty("PhysicalDiskRedundancy", (value)) +} + +// GetPhysicalDiskRedundancy gets the value of PhysicalDiskRedundancy for the instance +func (instance *MSFT_VirtualDisk) GetPropertyPhysicalDiskRedundancy() (value uint16, err error) { + retValue, err := instance.GetProperty("PhysicalDiskRedundancy") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetPhysicalSectorSize sets the value of PhysicalSectorSize for the instance +func (instance *MSFT_VirtualDisk) SetPropertyPhysicalSectorSize(value uint64) (err error) { + return instance.SetProperty("PhysicalSectorSize", (value)) +} + +// GetPhysicalSectorSize gets the value of PhysicalSectorSize for the instance +func (instance *MSFT_VirtualDisk) GetPropertyPhysicalSectorSize() (value uint64, err error) { + retValue, err := instance.GetProperty("PhysicalSectorSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetProvisioningType sets the value of ProvisioningType for the instance +func (instance *MSFT_VirtualDisk) SetPropertyProvisioningType(value uint16) (err error) { + return instance.SetProperty("ProvisioningType", (value)) +} + +// GetProvisioningType gets the value of ProvisioningType for the instance +func (instance *MSFT_VirtualDisk) GetPropertyProvisioningType() (value uint16, err error) { + retValue, err := instance.GetProperty("ProvisioningType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetReadCacheSize sets the value of ReadCacheSize for the instance +func (instance *MSFT_VirtualDisk) SetPropertyReadCacheSize(value uint64) (err error) { + return instance.SetProperty("ReadCacheSize", (value)) +} + +// GetReadCacheSize gets the value of ReadCacheSize for the instance +func (instance *MSFT_VirtualDisk) GetPropertyReadCacheSize() (value uint64, err error) { + retValue, err := instance.GetProperty("ReadCacheSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetRequestNoSinglePointOfFailure sets the value of RequestNoSinglePointOfFailure for the instance +func (instance *MSFT_VirtualDisk) SetPropertyRequestNoSinglePointOfFailure(value bool) (err error) { + return instance.SetProperty("RequestNoSinglePointOfFailure", (value)) +} + +// GetRequestNoSinglePointOfFailure gets the value of RequestNoSinglePointOfFailure for the instance +func (instance *MSFT_VirtualDisk) GetPropertyRequestNoSinglePointOfFailure() (value bool, err error) { + retValue, err := instance.GetProperty("RequestNoSinglePointOfFailure") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetResiliencySettingName sets the value of ResiliencySettingName for the instance +func (instance *MSFT_VirtualDisk) SetPropertyResiliencySettingName(value string) (err error) { + return instance.SetProperty("ResiliencySettingName", (value)) +} + +// GetResiliencySettingName gets the value of ResiliencySettingName for the instance +func (instance *MSFT_VirtualDisk) GetPropertyResiliencySettingName() (value string, err error) { + retValue, err := instance.GetProperty("ResiliencySettingName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSize sets the value of Size for the instance +func (instance *MSFT_VirtualDisk) SetPropertySize(value uint64) (err error) { + return instance.SetProperty("Size", (value)) +} + +// GetSize gets the value of Size for the instance +func (instance *MSFT_VirtualDisk) GetPropertySize() (value uint64, err error) { + retValue, err := instance.GetProperty("Size") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetUniqueIdFormat sets the value of UniqueIdFormat for the instance +func (instance *MSFT_VirtualDisk) SetPropertyUniqueIdFormat(value uint16) (err error) { + return instance.SetProperty("UniqueIdFormat", (value)) +} + +// GetUniqueIdFormat gets the value of UniqueIdFormat for the instance +func (instance *MSFT_VirtualDisk) GetPropertyUniqueIdFormat() (value uint16, err error) { + retValue, err := instance.GetProperty("UniqueIdFormat") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetUniqueIdFormatDescription sets the value of UniqueIdFormatDescription for the instance +func (instance *MSFT_VirtualDisk) SetPropertyUniqueIdFormatDescription(value string) (err error) { + return instance.SetProperty("UniqueIdFormatDescription", (value)) +} + +// GetUniqueIdFormatDescription gets the value of UniqueIdFormatDescription for the instance +func (instance *MSFT_VirtualDisk) GetPropertyUniqueIdFormatDescription() (value string, err error) { + retValue, err := instance.GetProperty("UniqueIdFormatDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetUsage sets the value of Usage for the instance +func (instance *MSFT_VirtualDisk) SetPropertyUsage(value uint16) (err error) { + return instance.SetProperty("Usage", (value)) +} + +// GetUsage gets the value of Usage for the instance +func (instance *MSFT_VirtualDisk) GetPropertyUsage() (value uint16, err error) { + retValue, err := instance.GetProperty("Usage") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetWriteCacheSize sets the value of WriteCacheSize for the instance +func (instance *MSFT_VirtualDisk) SetPropertyWriteCacheSize(value uint64) (err error) { + return instance.SetProperty("WriteCacheSize", (value)) +} + +// GetWriteCacheSize gets the value of WriteCacheSize for the instance +func (instance *MSFT_VirtualDisk) GetPropertyWriteCacheSize() (value uint64, err error) { + retValue, err := instance.GetProperty("WriteCacheSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// + +// +// +// +func (instance *MSFT_VirtualDisk) GetPhysicalExtent( /* OUT */ PhysicalExtents []MSFT_PhysicalExtent, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetPhysicalExtent") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_VirtualDisk) DeleteObject( /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("DeleteObject", RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// + +// +// +// +func (instance *MSFT_VirtualDisk) Show( /* IN */ TargetPortAddresses []string, + /* IN */ InitiatorAddress string, + /* IN */ HostType uint16, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Show", TargetPortAddresses, InitiatorAddress, HostType, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// + +// +// +// +func (instance *MSFT_VirtualDisk) Hide( /* IN */ TargetPortAddresses []string, + /* IN */ InitiatorAddress string, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Hide", TargetPortAddresses, InitiatorAddress, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// + +// +// +// +// +func (instance *MSFT_VirtualDisk) CreateSnapshot( /* IN */ FriendlyName string, + /* IN */ TargetStoragePoolName string, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ CreatedVirtualDisk MSFT_VirtualDisk, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateSnapshot", FriendlyName, TargetStoragePoolName, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// + +// +// +// +// +func (instance *MSFT_VirtualDisk) CreateClone( /* IN */ FriendlyName string, + /* IN */ TargetStoragePoolName string, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ CreatedVirtualDisk MSFT_VirtualDisk, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateClone", FriendlyName, TargetStoragePoolName, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +// +func (instance *MSFT_VirtualDisk) Resize( /* IN/OUT */ Size uint64, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Resize", RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_VirtualDisk) Repair( /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Repair", RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_VirtualDisk) GetSecurityDescriptor( /* OUT */ SecurityDescriptor string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSecurityDescriptor") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_VirtualDisk) SetSecurityDescriptor( /* IN */ SecurityDescriptor string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetSecurityDescriptor", SecurityDescriptor) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_VirtualDisk) SetFriendlyName( /* IN */ FriendlyName string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetFriendlyName", FriendlyName) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +func (instance *MSFT_VirtualDisk) SetUsage( /* IN */ Usage uint16, + /* IN */ OtherUsageDescription string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetUsage", Usage, OtherUsageDescription) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// + +// +// +func (instance *MSFT_VirtualDisk) SetAttributes( /* IN */ IsManualAttach bool, + /* IN */ StorageNodeName string, + /* IN */ Access uint16, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetAttributes", IsManualAttach, StorageNodeName, Access) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// +// + +// +// +func (instance *MSFT_VirtualDisk) SetProperties( /* IN */ ProvisioningType uint16, + /* IN */ AllocationUnitSize uint64, + /* IN */ MediaType uint16, + /* IN */ FaultDomainAwareness uint16, + /* IN */ ColumnIsolation uint16, + /* IN */ ResiliencySettingName string, + /* IN */ PhysicalDiskRedundancy uint16, + /* IN */ NumberOfDataCopies uint16, + /* IN */ NumberOfGroups uint16, + /* IN */ NumberOfColumns uint16, + /* IN */ Interleave uint64, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetProperties", ProvisioningType, AllocationUnitSize, MediaType, FaultDomainAwareness, ColumnIsolation, ResiliencySettingName, PhysicalDiskRedundancy, NumberOfDataCopies, NumberOfGroups, NumberOfColumns, Interleave) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_VirtualDisk) Attach( /* IN */ StorageNodeName string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Attach", StorageNodeName) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_VirtualDisk) Detach( /* IN */ StorageNodeName string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Detach", StorageNodeName) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// + +// +// +// +func (instance *MSFT_VirtualDisk) AddPhysicalDisk( /* IN */ PhysicalDisks []MSFT_PhysicalDisk, + /* IN */ Usage uint16, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("AddPhysicalDisk", PhysicalDisks, Usage, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_VirtualDisk) RemovePhysicalDisk( /* IN */ PhysicalDisks []MSFT_PhysicalDisk, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RemovePhysicalDisk", PhysicalDisks, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_VirtualDisk) AddStorageFaultDomain( /* IN */ StorageFaultDomains []MSFT_StorageFaultDomain, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("AddStorageFaultDomain", StorageFaultDomains, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_VirtualDisk) RemoveStorageFaultDomain( /* IN */ StorageFaultDomains []MSFT_StorageFaultDomain, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("RemoveStorageFaultDomain", StorageFaultDomains, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// +// + +// +// +// +// +func (instance *MSFT_VirtualDisk) CreateReplica( /* IN */ FriendlyName string, + /* IN */ TargetStorageSubsystem MSFT_ReplicaPeer, + /* IN */ TargetVirtualDiskObjectId string, + /* IN */ TargetStoragePoolObjectId string, + /* IN */ RecoveryPointObjective uint16, + /* IN */ ReplicationSettings MSFT_ReplicationSettings, + /* IN */ SyncType uint16, + /* IN */ RunAsJob bool, + /* OUT */ CreatedReplicaPeer MSFT_ReplicaPeer, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateReplica", FriendlyName, TargetStorageSubsystem, TargetVirtualDiskObjectId, TargetStoragePoolObjectId, RecoveryPointObjective, ReplicationSettings, SyncType, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// + +// +// +// +func (instance *MSFT_VirtualDisk) SetReplicationRelationship( /* IN */ Operation uint16, + /* IN */ VirtualDiskReplicaPeer MSFT_ReplicaPeer, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetReplicationRelationship", Operation, VirtualDiskReplicaPeer, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToDisk.go new file mode 100644 index 000000000..b811259e9 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_VirtualDiskToDisk struct +type MSFT_VirtualDiskToDisk struct { + *cim.WmiInstance + + // + Disk MSFT_Disk + + // + VirtualDisk MSFT_VirtualDisk +} + +func NewMSFT_VirtualDiskToDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_VirtualDiskToDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_VirtualDiskToDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_VirtualDiskToDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_VirtualDiskToDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_VirtualDiskToDisk{ + WmiInstance: tmp, + } + return +} + +// SetDisk sets the value of Disk for the instance +func (instance *MSFT_VirtualDiskToDisk) SetPropertyDisk(value MSFT_Disk) (err error) { + return instance.SetProperty("Disk", (value)) +} + +// GetDisk gets the value of Disk for the instance +func (instance *MSFT_VirtualDiskToDisk) GetPropertyDisk() (value MSFT_Disk, err error) { + retValue, err := instance.GetProperty("Disk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Disk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Disk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Disk(valuetmp) + + return +} + +// SetVirtualDisk sets the value of VirtualDisk for the instance +func (instance *MSFT_VirtualDiskToDisk) SetPropertyVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("VirtualDisk", (value)) +} + +// GetVirtualDisk gets the value of VirtualDisk for the instance +func (instance *MSFT_VirtualDiskToDisk) GetPropertyVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("VirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToPhysicalDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToPhysicalDisk.go new file mode 100644 index 000000000..08d7193c0 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToPhysicalDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_VirtualDiskToPhysicalDisk struct +type MSFT_VirtualDiskToPhysicalDisk struct { + *cim.WmiInstance + + // + PhysicalDisk MSFT_PhysicalDisk + + // + VirtualDisk MSFT_VirtualDisk +} + +func NewMSFT_VirtualDiskToPhysicalDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_VirtualDiskToPhysicalDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_VirtualDiskToPhysicalDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_VirtualDiskToPhysicalDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_VirtualDiskToPhysicalDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_VirtualDiskToPhysicalDisk{ + WmiInstance: tmp, + } + return +} + +// SetPhysicalDisk sets the value of PhysicalDisk for the instance +func (instance *MSFT_VirtualDiskToPhysicalDisk) SetPropertyPhysicalDisk(value MSFT_PhysicalDisk) (err error) { + return instance.SetProperty("PhysicalDisk", (value)) +} + +// GetPhysicalDisk gets the value of PhysicalDisk for the instance +func (instance *MSFT_VirtualDiskToPhysicalDisk) GetPropertyPhysicalDisk() (value MSFT_PhysicalDisk, err error) { + retValue, err := instance.GetProperty("PhysicalDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_PhysicalDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_PhysicalDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_PhysicalDisk(valuetmp) + + return +} + +// SetVirtualDisk sets the value of VirtualDisk for the instance +func (instance *MSFT_VirtualDiskToPhysicalDisk) SetPropertyVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("VirtualDisk", (value)) +} + +// GetVirtualDisk gets the value of VirtualDisk for the instance +func (instance *MSFT_VirtualDiskToPhysicalDisk) GetPropertyVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("VirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToReplicaPeer.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToReplicaPeer.go new file mode 100644 index 000000000..21631fbab --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToReplicaPeer.go @@ -0,0 +1,110 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_VirtualDiskToReplicaPeer struct +type MSFT_VirtualDiskToReplicaPeer struct { + *MSFT_Synchronized + + // + ReplicaPeer MSFT_ReplicaPeer + + // + VirtualDisk MSFT_VirtualDisk +} + +func NewMSFT_VirtualDiskToReplicaPeerEx1(instance *cim.WmiInstance) (newInstance *MSFT_VirtualDiskToReplicaPeer, err error) { + tmp, err := NewMSFT_SynchronizedEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_VirtualDiskToReplicaPeer{ + MSFT_Synchronized: tmp, + } + return +} + +func NewMSFT_VirtualDiskToReplicaPeerEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_VirtualDiskToReplicaPeer, err error) { + tmp, err := NewMSFT_SynchronizedEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_VirtualDiskToReplicaPeer{ + MSFT_Synchronized: tmp, + } + return +} + +// SetReplicaPeer sets the value of ReplicaPeer for the instance +func (instance *MSFT_VirtualDiskToReplicaPeer) SetPropertyReplicaPeer(value MSFT_ReplicaPeer) (err error) { + return instance.SetProperty("ReplicaPeer", (value)) +} + +// GetReplicaPeer gets the value of ReplicaPeer for the instance +func (instance *MSFT_VirtualDiskToReplicaPeer) GetPropertyReplicaPeer() (value MSFT_ReplicaPeer, err error) { + retValue, err := instance.GetProperty("ReplicaPeer") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_ReplicaPeer) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_ReplicaPeer is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_ReplicaPeer(valuetmp) + + return +} + +// SetVirtualDisk sets the value of VirtualDisk for the instance +func (instance *MSFT_VirtualDiskToReplicaPeer) SetPropertyVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("VirtualDisk", (value)) +} + +// GetVirtualDisk gets the value of VirtualDisk for the instance +func (instance *MSFT_VirtualDiskToReplicaPeer) GetPropertyVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("VirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToStorageFaultDomain.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToStorageFaultDomain.go new file mode 100644 index 000000000..4cf7949c9 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToStorageFaultDomain.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_VirtualDiskToStorageFaultDomain struct +type MSFT_VirtualDiskToStorageFaultDomain struct { + *cim.WmiInstance + + // + StorageFaultDomain MSFT_StorageFaultDomain + + // + VirtualDisk MSFT_VirtualDisk +} + +func NewMSFT_VirtualDiskToStorageFaultDomainEx1(instance *cim.WmiInstance) (newInstance *MSFT_VirtualDiskToStorageFaultDomain, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_VirtualDiskToStorageFaultDomain{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_VirtualDiskToStorageFaultDomainEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_VirtualDiskToStorageFaultDomain, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_VirtualDiskToStorageFaultDomain{ + WmiInstance: tmp, + } + return +} + +// SetStorageFaultDomain sets the value of StorageFaultDomain for the instance +func (instance *MSFT_VirtualDiskToStorageFaultDomain) SetPropertyStorageFaultDomain(value MSFT_StorageFaultDomain) (err error) { + return instance.SetProperty("StorageFaultDomain", (value)) +} + +// GetStorageFaultDomain gets the value of StorageFaultDomain for the instance +func (instance *MSFT_VirtualDiskToStorageFaultDomain) GetPropertyStorageFaultDomain() (value MSFT_StorageFaultDomain, err error) { + retValue, err := instance.GetProperty("StorageFaultDomain") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageFaultDomain) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageFaultDomain is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageFaultDomain(valuetmp) + + return +} + +// SetVirtualDisk sets the value of VirtualDisk for the instance +func (instance *MSFT_VirtualDiskToStorageFaultDomain) SetPropertyVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("VirtualDisk", (value)) +} + +// GetVirtualDisk gets the value of VirtualDisk for the instance +func (instance *MSFT_VirtualDiskToStorageFaultDomain) GetPropertyVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("VirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToStorageTier.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToStorageTier.go new file mode 100644 index 000000000..82dd6f286 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToStorageTier.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_VirtualDiskToStorageTier struct +type MSFT_VirtualDiskToStorageTier struct { + *cim.WmiInstance + + // + StorageTier MSFT_StorageTier + + // + VirtualDisk MSFT_VirtualDisk +} + +func NewMSFT_VirtualDiskToStorageTierEx1(instance *cim.WmiInstance) (newInstance *MSFT_VirtualDiskToStorageTier, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_VirtualDiskToStorageTier{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_VirtualDiskToStorageTierEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_VirtualDiskToStorageTier, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_VirtualDiskToStorageTier{ + WmiInstance: tmp, + } + return +} + +// SetStorageTier sets the value of StorageTier for the instance +func (instance *MSFT_VirtualDiskToStorageTier) SetPropertyStorageTier(value MSFT_StorageTier) (err error) { + return instance.SetProperty("StorageTier", (value)) +} + +// GetStorageTier gets the value of StorageTier for the instance +func (instance *MSFT_VirtualDiskToStorageTier) GetPropertyStorageTier() (value MSFT_StorageTier, err error) { + retValue, err := instance.GetProperty("StorageTier") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_StorageTier) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_StorageTier is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_StorageTier(valuetmp) + + return +} + +// SetVirtualDisk sets the value of VirtualDisk for the instance +func (instance *MSFT_VirtualDiskToStorageTier) SetPropertyVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("VirtualDisk", (value)) +} + +// GetVirtualDisk gets the value of VirtualDisk for the instance +func (instance *MSFT_VirtualDiskToStorageTier) GetPropertyVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("VirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToVirtualDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToVirtualDisk.go new file mode 100644 index 000000000..92ea16470 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VirtualDiskToVirtualDisk.go @@ -0,0 +1,110 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_VirtualDiskToVirtualDisk struct +type MSFT_VirtualDiskToVirtualDisk struct { + *MSFT_Synchronized + + // + SourceVirtualDisk MSFT_VirtualDisk + + // + TargetVirtualDisk MSFT_VirtualDisk +} + +func NewMSFT_VirtualDiskToVirtualDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_VirtualDiskToVirtualDisk, err error) { + tmp, err := NewMSFT_SynchronizedEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_VirtualDiskToVirtualDisk{ + MSFT_Synchronized: tmp, + } + return +} + +func NewMSFT_VirtualDiskToVirtualDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_VirtualDiskToVirtualDisk, err error) { + tmp, err := NewMSFT_SynchronizedEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_VirtualDiskToVirtualDisk{ + MSFT_Synchronized: tmp, + } + return +} + +// SetSourceVirtualDisk sets the value of SourceVirtualDisk for the instance +func (instance *MSFT_VirtualDiskToVirtualDisk) SetPropertySourceVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("SourceVirtualDisk", (value)) +} + +// GetSourceVirtualDisk gets the value of SourceVirtualDisk for the instance +func (instance *MSFT_VirtualDiskToVirtualDisk) GetPropertySourceVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("SourceVirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} + +// SetTargetVirtualDisk sets the value of TargetVirtualDisk for the instance +func (instance *MSFT_VirtualDiskToVirtualDisk) SetPropertyTargetVirtualDisk(value MSFT_VirtualDisk) (err error) { + return instance.SetProperty("TargetVirtualDisk", (value)) +} + +// GetTargetVirtualDisk gets the value of TargetVirtualDisk for the instance +func (instance *MSFT_VirtualDiskToVirtualDisk) GetPropertyTargetVirtualDisk() (value MSFT_VirtualDisk, err error) { + retValue, err := instance.GetProperty("TargetVirtualDisk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_VirtualDisk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_VirtualDisk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_VirtualDisk(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Volume.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Volume.go new file mode 100644 index 000000000..8a7d3b8b0 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Volume.go @@ -0,0 +1,744 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_Volume struct +type MSFT_Volume struct { + *MSFT_StorageObject + + // + AllocationUnitSize uint32 + + // + DedupMode uint32 + + // + DriveLetter byte + + // + DriveType uint32 + + // + FileSystem string + + // + FileSystemLabel string + + // + FileSystemType uint16 + + // + HealthStatus uint16 + + // + OperationalStatus []uint16 + + // + Path string + + // + Size uint64 + + // + SizeRemaining uint64 +} + +func NewMSFT_VolumeEx1(instance *cim.WmiInstance) (newInstance *MSFT_Volume, err error) { + tmp, err := NewMSFT_StorageObjectEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_Volume{ + MSFT_StorageObject: tmp, + } + return +} + +func NewMSFT_VolumeEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_Volume, err error) { + tmp, err := NewMSFT_StorageObjectEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_Volume{ + MSFT_StorageObject: tmp, + } + return +} + +// SetAllocationUnitSize sets the value of AllocationUnitSize for the instance +func (instance *MSFT_Volume) SetPropertyAllocationUnitSize(value uint32) (err error) { + return instance.SetProperty("AllocationUnitSize", (value)) +} + +// GetAllocationUnitSize gets the value of AllocationUnitSize for the instance +func (instance *MSFT_Volume) GetPropertyAllocationUnitSize() (value uint32, err error) { + retValue, err := instance.GetProperty("AllocationUnitSize") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetDedupMode sets the value of DedupMode for the instance +func (instance *MSFT_Volume) SetPropertyDedupMode(value uint32) (err error) { + return instance.SetProperty("DedupMode", (value)) +} + +// GetDedupMode gets the value of DedupMode for the instance +func (instance *MSFT_Volume) GetPropertyDedupMode() (value uint32, err error) { + retValue, err := instance.GetProperty("DedupMode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetDriveLetter sets the value of DriveLetter for the instance +func (instance *MSFT_Volume) SetPropertyDriveLetter(value byte) (err error) { + return instance.SetProperty("DriveLetter", (value)) +} + +// GetDriveLetter gets the value of DriveLetter for the instance +func (instance *MSFT_Volume) GetPropertyDriveLetter() (value byte, err error) { + retValue, err := instance.GetProperty("DriveLetter") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(byte) + if !ok { + err = errors.Wrapf(errors.InvalidType, " byte is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = byte(valuetmp) + + return +} + +// SetDriveType sets the value of DriveType for the instance +func (instance *MSFT_Volume) SetPropertyDriveType(value uint32) (err error) { + return instance.SetProperty("DriveType", (value)) +} + +// GetDriveType gets the value of DriveType for the instance +func (instance *MSFT_Volume) GetPropertyDriveType() (value uint32, err error) { + retValue, err := instance.GetProperty("DriveType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetFileSystem sets the value of FileSystem for the instance +func (instance *MSFT_Volume) SetPropertyFileSystem(value string) (err error) { + return instance.SetProperty("FileSystem", (value)) +} + +// GetFileSystem gets the value of FileSystem for the instance +func (instance *MSFT_Volume) GetPropertyFileSystem() (value string, err error) { + retValue, err := instance.GetProperty("FileSystem") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFileSystemLabel sets the value of FileSystemLabel for the instance +func (instance *MSFT_Volume) SetPropertyFileSystemLabel(value string) (err error) { + return instance.SetProperty("FileSystemLabel", (value)) +} + +// GetFileSystemLabel gets the value of FileSystemLabel for the instance +func (instance *MSFT_Volume) GetPropertyFileSystemLabel() (value string, err error) { + retValue, err := instance.GetProperty("FileSystemLabel") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFileSystemType sets the value of FileSystemType for the instance +func (instance *MSFT_Volume) SetPropertyFileSystemType(value uint16) (err error) { + return instance.SetProperty("FileSystemType", (value)) +} + +// GetFileSystemType gets the value of FileSystemType for the instance +func (instance *MSFT_Volume) GetPropertyFileSystemType() (value uint16, err error) { + retValue, err := instance.GetProperty("FileSystemType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetHealthStatus sets the value of HealthStatus for the instance +func (instance *MSFT_Volume) SetPropertyHealthStatus(value uint16) (err error) { + return instance.SetProperty("HealthStatus", (value)) +} + +// GetHealthStatus gets the value of HealthStatus for the instance +func (instance *MSFT_Volume) GetPropertyHealthStatus() (value uint16, err error) { + retValue, err := instance.GetProperty("HealthStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// SetOperationalStatus sets the value of OperationalStatus for the instance +func (instance *MSFT_Volume) SetPropertyOperationalStatus(value []uint16) (err error) { + return instance.SetProperty("OperationalStatus", (value)) +} + +// GetOperationalStatus gets the value of OperationalStatus for the instance +func (instance *MSFT_Volume) GetPropertyOperationalStatus() (value []uint16, err error) { + retValue, err := instance.GetProperty("OperationalStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint16(valuetmp)) + } + + return +} + +// SetPath sets the value of Path for the instance +func (instance *MSFT_Volume) SetPropertyPath(value string) (err error) { + return instance.SetProperty("Path", (value)) +} + +// GetPath gets the value of Path for the instance +func (instance *MSFT_Volume) GetPropertyPath() (value string, err error) { + retValue, err := instance.GetProperty("Path") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSize sets the value of Size for the instance +func (instance *MSFT_Volume) SetPropertySize(value uint64) (err error) { + return instance.SetProperty("Size", (value)) +} + +// GetSize gets the value of Size for the instance +func (instance *MSFT_Volume) GetPropertySize() (value uint64, err error) { + retValue, err := instance.GetProperty("Size") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// SetSizeRemaining sets the value of SizeRemaining for the instance +func (instance *MSFT_Volume) SetPropertySizeRemaining(value uint64) (err error) { + return instance.SetProperty("SizeRemaining", (value)) +} + +// GetSizeRemaining gets the value of SizeRemaining for the instance +func (instance *MSFT_Volume) GetPropertySizeRemaining() (value uint64, err error) { + retValue, err := instance.GetProperty("SizeRemaining") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} + +// + +// + +// +// +// +func (instance *MSFT_Volume) DeleteObject( /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("DeleteObject", RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// + +// +// +// +// +func (instance *MSFT_Volume) Format( /* IN */ FileSystem string, + /* IN */ FileSystemLabel string, + /* IN */ AllocationUnitSize uint32, + /* IN */ Full bool, + /* IN */ Force bool, + /* IN */ Compress bool, + /* IN */ ShortFileNameSupport bool, + /* IN */ SetIntegrityStreams bool, + /* IN */ UseLargeFRS bool, + /* IN */ DisableHeatGathering bool, + /* IN */ IsDAX bool, + /* IN */ RunAsJob bool, + /* OUT */ FormattedVolume MSFT_Volume, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Format", FileSystem, FileSystemLabel, AllocationUnitSize, Full, Force, Compress, ShortFileNameSupport, SetIntegrityStreams, UseLargeFRS, DisableHeatGathering, IsDAX, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// + +// +// +// +// +func (instance *MSFT_Volume) Repair( /* IN */ OfflineScanAndFix bool, + /* IN */ Scan bool, + /* IN */ SpotFix bool, + /* OUT */ Output uint32, + /* OPTIONAL IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Repair", OfflineScanAndFix, Scan, SpotFix, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// +// +// + +// +// +// +func (instance *MSFT_Volume) Optimize( /* IN */ ReTrim bool, + /* IN */ Analyze bool, + /* IN */ Defrag bool, + /* IN */ SlabConsolidate bool, + /* IN */ TierOptimize bool, + /* IN */ NormalPriority bool, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Optimize", ReTrim, Analyze, Defrag, SlabConsolidate, TierOptimize, NormalPriority, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_Volume) SetFileSystemLabel( /* IN */ FileSystemLabel string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetFileSystemLabel", FileSystemLabel) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_Volume) GetSupportedFileSystems( /* OUT */ SupportedFileSystems []string, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSupportedFileSystems") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +// +func (instance *MSFT_Volume) GetSupportedClusterSizes( /* IN */ FileSystem string, + /* OUT */ SupportedClusterSizes []uint32, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSupportedClusterSizes", FileSystem) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_Volume) GetCorruptionCount( /* OUT */ CorruptionCount uint32, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetCorruptionCount") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *MSFT_Volume) GetAttributes( /* OUT */ VolumeScrubEnabled bool) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetAttributes") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_Volume) SetAttributes( /* IN */ EnableVolumeScrub bool, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetAttributes", EnableVolumeScrub) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +func (instance *MSFT_Volume) Flush() (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("Flush") + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// + +// +// +// +func (instance *MSFT_Volume) Resize( /* IN */ Size uint64, + /* IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Resize", Size, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_Volume) Diagnose( /* OUT */ DiagnoseResults []MSFT_StorageDiagnoseResult, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Diagnose") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +// +func (instance *MSFT_Volume) SetDedupMode( /* IN */ DedupMode uint32, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("SetDedupMode", DedupMode) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_Volume) GetDedupProperties( /* OUT */ DedupProperties MSFT_DedupProperties, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetDedupProperties") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +func (instance *MSFT_Volume) GetActions( /* OUT */ ActionResults []MSFT_HealthAction, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetActions") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VolumeToFileShare.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VolumeToFileShare.go new file mode 100644 index 000000000..74c6a9f01 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_VolumeToFileShare.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_VolumeToFileShare struct +type MSFT_VolumeToFileShare struct { + *cim.WmiInstance + + // + FileShare MSFT_FileShare + + // + Volume MSFT_Volume +} + +func NewMSFT_VolumeToFileShareEx1(instance *cim.WmiInstance) (newInstance *MSFT_VolumeToFileShare, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_VolumeToFileShare{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_VolumeToFileShareEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_VolumeToFileShare, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_VolumeToFileShare{ + WmiInstance: tmp, + } + return +} + +// SetFileShare sets the value of FileShare for the instance +func (instance *MSFT_VolumeToFileShare) SetPropertyFileShare(value MSFT_FileShare) (err error) { + return instance.SetProperty("FileShare", (value)) +} + +// GetFileShare gets the value of FileShare for the instance +func (instance *MSFT_VolumeToFileShare) GetPropertyFileShare() (value MSFT_FileShare, err error) { + retValue, err := instance.GetProperty("FileShare") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_FileShare) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_FileShare is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_FileShare(valuetmp) + + return +} + +// SetVolume sets the value of Volume for the instance +func (instance *MSFT_VolumeToFileShare) SetPropertyVolume(value MSFT_Volume) (err error) { + return instance.SetProperty("Volume", (value)) +} + +// GetVolume gets the value of Volume for the instance +func (instance *MSFT_VolumeToFileShare) GetPropertyVolume() (value MSFT_Volume, err error) { + retValue, err := instance.GetProperty("Volume") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Volume) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Volume is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Volume(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Volume_Repair_AsyncOutput.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Volume_Repair_AsyncOutput.go new file mode 100644 index 000000000..e806a97eb --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_Volume_Repair_AsyncOutput.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_Volume_Repair_AsyncOutput struct +type MSFT_Volume_Repair_AsyncOutput struct { + *MSFT_StorageJobOutParams + + // + Output uint32 +} + +func NewMSFT_Volume_Repair_AsyncOutputEx1(instance *cim.WmiInstance) (newInstance *MSFT_Volume_Repair_AsyncOutput, err error) { + tmp, err := NewMSFT_StorageJobOutParamsEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_Volume_Repair_AsyncOutput{ + MSFT_StorageJobOutParams: tmp, + } + return +} + +func NewMSFT_Volume_Repair_AsyncOutputEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_Volume_Repair_AsyncOutput, err error) { + tmp, err := NewMSFT_StorageJobOutParamsEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_Volume_Repair_AsyncOutput{ + MSFT_StorageJobOutParams: tmp, + } + return +} + +// SetOutput sets the value of Output for the instance +func (instance *MSFT_Volume_Repair_AsyncOutput) SetPropertyOutput(value uint32) (err error) { + return instance.SetProperty("Output", (value)) +} + +// GetOutput gets the value of Output for the instance +func (instance *MSFT_Volume_Repair_AsyncOutput) GetPropertyOutput() (value uint32, err error) { + retValue, err := instance.GetProperty("Output") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_WmiError.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_WmiError.go new file mode 100644 index 000000000..21f077d66 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_WmiError.go @@ -0,0 +1,170 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_WmiError struct +type MSFT_WmiError struct { + *CIM_Error + + // Error Category. + error_Category uint16 + + // Error code. + error_Code uint32 + + // Error Type. + error_Type string + + // Windows error message. + error_WindowsErrorMessage string +} + +func NewMSFT_WmiErrorEx1(instance *cim.WmiInstance) (newInstance *MSFT_WmiError, err error) { + tmp, err := NewCIM_ErrorEx1(instance) + + if err != nil { + return + } + newInstance = &MSFT_WmiError{ + CIM_Error: tmp, + } + return +} + +func NewMSFT_WmiErrorEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_WmiError, err error) { + tmp, err := NewCIM_ErrorEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_WmiError{ + CIM_Error: tmp, + } + return +} + +// Seterror_Category sets the value of error_Category for the instance +func (instance *MSFT_WmiError) SetPropertyerror_Category(value uint16) (err error) { + return instance.SetProperty("error_Category", (value)) +} + +// Geterror_Category gets the value of error_Category for the instance +func (instance *MSFT_WmiError) GetPropertyerror_Category() (value uint16, err error) { + retValue, err := instance.GetProperty("error_Category") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// Seterror_Code sets the value of error_Code for the instance +func (instance *MSFT_WmiError) SetPropertyerror_Code(value uint32) (err error) { + return instance.SetProperty("error_Code", (value)) +} + +// Geterror_Code gets the value of error_Code for the instance +func (instance *MSFT_WmiError) GetPropertyerror_Code() (value uint32, err error) { + retValue, err := instance.GetProperty("error_Code") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// Seterror_Type sets the value of error_Type for the instance +func (instance *MSFT_WmiError) SetPropertyerror_Type(value string) (err error) { + return instance.SetProperty("error_Type", (value)) +} + +// Geterror_Type gets the value of error_Type for the instance +func (instance *MSFT_WmiError) GetPropertyerror_Type() (value string, err error) { + retValue, err := instance.GetProperty("error_Type") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// Seterror_WindowsErrorMessage sets the value of error_WindowsErrorMessage for the instance +func (instance *MSFT_WmiError) SetPropertyerror_WindowsErrorMessage(value string) (err error) { + return instance.SetProperty("error_WindowsErrorMessage", (value)) +} + +// Geterror_WindowsErrorMessage gets the value of error_WindowsErrorMessage for the instance +func (instance *MSFT_WmiError) GetPropertyerror_WindowsErrorMessage() (value string, err error) { + retValue, err := instance.GetProperty("error_WindowsErrorMessage") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSIConnection.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSIConnection.go new file mode 100644 index 000000000..276708c67 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSIConnection.go @@ -0,0 +1,201 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_iSCSIConnection struct +type MSFT_iSCSIConnection struct { + *cim.WmiInstance + + // + ConnectionIdentifier string + + // + InitiatorAddress string + + // + InitiatorPortNumber uint32 + + // + TargetAddress string + + // + TargetPortNumber uint32 +} + +func NewMSFT_iSCSIConnectionEx1(instance *cim.WmiInstance) (newInstance *MSFT_iSCSIConnection, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_iSCSIConnection{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_iSCSIConnectionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_iSCSIConnection, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_iSCSIConnection{ + WmiInstance: tmp, + } + return +} + +// SetConnectionIdentifier sets the value of ConnectionIdentifier for the instance +func (instance *MSFT_iSCSIConnection) SetPropertyConnectionIdentifier(value string) (err error) { + return instance.SetProperty("ConnectionIdentifier", (value)) +} + +// GetConnectionIdentifier gets the value of ConnectionIdentifier for the instance +func (instance *MSFT_iSCSIConnection) GetPropertyConnectionIdentifier() (value string, err error) { + retValue, err := instance.GetProperty("ConnectionIdentifier") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInitiatorAddress sets the value of InitiatorAddress for the instance +func (instance *MSFT_iSCSIConnection) SetPropertyInitiatorAddress(value string) (err error) { + return instance.SetProperty("InitiatorAddress", (value)) +} + +// GetInitiatorAddress gets the value of InitiatorAddress for the instance +func (instance *MSFT_iSCSIConnection) GetPropertyInitiatorAddress() (value string, err error) { + retValue, err := instance.GetProperty("InitiatorAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInitiatorPortNumber sets the value of InitiatorPortNumber for the instance +func (instance *MSFT_iSCSIConnection) SetPropertyInitiatorPortNumber(value uint32) (err error) { + return instance.SetProperty("InitiatorPortNumber", (value)) +} + +// GetInitiatorPortNumber gets the value of InitiatorPortNumber for the instance +func (instance *MSFT_iSCSIConnection) GetPropertyInitiatorPortNumber() (value uint32, err error) { + retValue, err := instance.GetProperty("InitiatorPortNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetTargetAddress sets the value of TargetAddress for the instance +func (instance *MSFT_iSCSIConnection) SetPropertyTargetAddress(value string) (err error) { + return instance.SetProperty("TargetAddress", (value)) +} + +// GetTargetAddress gets the value of TargetAddress for the instance +func (instance *MSFT_iSCSIConnection) GetPropertyTargetAddress() (value string, err error) { + retValue, err := instance.GetProperty("TargetAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetTargetPortNumber sets the value of TargetPortNumber for the instance +func (instance *MSFT_iSCSIConnection) SetPropertyTargetPortNumber(value uint32) (err error) { + return instance.SetProperty("TargetPortNumber", (value)) +} + +// GetTargetPortNumber gets the value of TargetPortNumber for the instance +func (instance *MSFT_iSCSIConnection) GetPropertyTargetPortNumber() (value uint32, err error) { + retValue, err := instance.GetProperty("TargetPortNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSIConnectionToDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSIConnectionToDisk.go new file mode 100644 index 000000000..2ccb384de --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSIConnectionToDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_iSCSIConnectionToDisk struct +type MSFT_iSCSIConnectionToDisk struct { + *cim.WmiInstance + + // + Disk MSFT_Disk + + // + iSCSIConnection MSFT_iSCSIConnection +} + +func NewMSFT_iSCSIConnectionToDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_iSCSIConnectionToDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_iSCSIConnectionToDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_iSCSIConnectionToDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_iSCSIConnectionToDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_iSCSIConnectionToDisk{ + WmiInstance: tmp, + } + return +} + +// SetDisk sets the value of Disk for the instance +func (instance *MSFT_iSCSIConnectionToDisk) SetPropertyDisk(value MSFT_Disk) (err error) { + return instance.SetProperty("Disk", (value)) +} + +// GetDisk gets the value of Disk for the instance +func (instance *MSFT_iSCSIConnectionToDisk) GetPropertyDisk() (value MSFT_Disk, err error) { + retValue, err := instance.GetProperty("Disk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Disk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Disk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Disk(valuetmp) + + return +} + +// SetiSCSIConnection sets the value of iSCSIConnection for the instance +func (instance *MSFT_iSCSIConnectionToDisk) SetPropertyiSCSIConnection(value MSFT_iSCSIConnection) (err error) { + return instance.SetProperty("iSCSIConnection", (value)) +} + +// GetiSCSIConnection gets the value of iSCSIConnection for the instance +func (instance *MSFT_iSCSIConnectionToDisk) GetPropertyiSCSIConnection() (value MSFT_iSCSIConnection, err error) { + retValue, err := instance.GetProperty("iSCSIConnection") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSIConnection) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSIConnection is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSIConnection(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSIConnectionToiSCSITargetPortal.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSIConnectionToiSCSITargetPortal.go new file mode 100644 index 000000000..fbc936547 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSIConnectionToiSCSITargetPortal.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_iSCSIConnectionToiSCSITargetPortal struct +type MSFT_iSCSIConnectionToiSCSITargetPortal struct { + *cim.WmiInstance + + // + iSCSIConnection MSFT_iSCSIConnection + + // + iSCSITargetPortal MSFT_iSCSITargetPortal +} + +func NewMSFT_iSCSIConnectionToiSCSITargetPortalEx1(instance *cim.WmiInstance) (newInstance *MSFT_iSCSIConnectionToiSCSITargetPortal, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_iSCSIConnectionToiSCSITargetPortal{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_iSCSIConnectionToiSCSITargetPortalEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_iSCSIConnectionToiSCSITargetPortal, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_iSCSIConnectionToiSCSITargetPortal{ + WmiInstance: tmp, + } + return +} + +// SetiSCSIConnection sets the value of iSCSIConnection for the instance +func (instance *MSFT_iSCSIConnectionToiSCSITargetPortal) SetPropertyiSCSIConnection(value MSFT_iSCSIConnection) (err error) { + return instance.SetProperty("iSCSIConnection", (value)) +} + +// GetiSCSIConnection gets the value of iSCSIConnection for the instance +func (instance *MSFT_iSCSIConnectionToiSCSITargetPortal) GetPropertyiSCSIConnection() (value MSFT_iSCSIConnection, err error) { + retValue, err := instance.GetProperty("iSCSIConnection") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSIConnection) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSIConnection is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSIConnection(valuetmp) + + return +} + +// SetiSCSITargetPortal sets the value of iSCSITargetPortal for the instance +func (instance *MSFT_iSCSIConnectionToiSCSITargetPortal) SetPropertyiSCSITargetPortal(value MSFT_iSCSITargetPortal) (err error) { + return instance.SetProperty("iSCSITargetPortal", (value)) +} + +// GetiSCSITargetPortal gets the value of iSCSITargetPortal for the instance +func (instance *MSFT_iSCSIConnectionToiSCSITargetPortal) GetPropertyiSCSITargetPortal() (value MSFT_iSCSITargetPortal, err error) { + retValue, err := instance.GetProperty("iSCSITargetPortal") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSITargetPortal) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSITargetPortal is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSITargetPortal(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISession.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISession.go new file mode 100644 index 000000000..75ded6ecb --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISession.go @@ -0,0 +1,518 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_iSCSISession struct +type MSFT_iSCSISession struct { + *cim.WmiInstance + + // + AuthenticationType string + + // + InitiatorInstanceName string + + // + InitiatorNodeAddress string + + // + InitiatorPortalAddress string + + // + InitiatorSideIdentifier string + + // + IsConnected bool + + // + IsDataDigest bool + + // + IsDiscovered bool + + // + IsHeaderDigest bool + + // + IsPersistent bool + + // + NumberOfConnections uint32 + + // + SessionIdentifier string + + // + TargetNodeAddress string + + // + TargetSideIdentifier string +} + +func NewMSFT_iSCSISessionEx1(instance *cim.WmiInstance) (newInstance *MSFT_iSCSISession, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_iSCSISession{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_iSCSISessionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_iSCSISession, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_iSCSISession{ + WmiInstance: tmp, + } + return +} + +// SetAuthenticationType sets the value of AuthenticationType for the instance +func (instance *MSFT_iSCSISession) SetPropertyAuthenticationType(value string) (err error) { + return instance.SetProperty("AuthenticationType", (value)) +} + +// GetAuthenticationType gets the value of AuthenticationType for the instance +func (instance *MSFT_iSCSISession) GetPropertyAuthenticationType() (value string, err error) { + retValue, err := instance.GetProperty("AuthenticationType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInitiatorInstanceName sets the value of InitiatorInstanceName for the instance +func (instance *MSFT_iSCSISession) SetPropertyInitiatorInstanceName(value string) (err error) { + return instance.SetProperty("InitiatorInstanceName", (value)) +} + +// GetInitiatorInstanceName gets the value of InitiatorInstanceName for the instance +func (instance *MSFT_iSCSISession) GetPropertyInitiatorInstanceName() (value string, err error) { + retValue, err := instance.GetProperty("InitiatorInstanceName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInitiatorNodeAddress sets the value of InitiatorNodeAddress for the instance +func (instance *MSFT_iSCSISession) SetPropertyInitiatorNodeAddress(value string) (err error) { + return instance.SetProperty("InitiatorNodeAddress", (value)) +} + +// GetInitiatorNodeAddress gets the value of InitiatorNodeAddress for the instance +func (instance *MSFT_iSCSISession) GetPropertyInitiatorNodeAddress() (value string, err error) { + retValue, err := instance.GetProperty("InitiatorNodeAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInitiatorPortalAddress sets the value of InitiatorPortalAddress for the instance +func (instance *MSFT_iSCSISession) SetPropertyInitiatorPortalAddress(value string) (err error) { + return instance.SetProperty("InitiatorPortalAddress", (value)) +} + +// GetInitiatorPortalAddress gets the value of InitiatorPortalAddress for the instance +func (instance *MSFT_iSCSISession) GetPropertyInitiatorPortalAddress() (value string, err error) { + retValue, err := instance.GetProperty("InitiatorPortalAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInitiatorSideIdentifier sets the value of InitiatorSideIdentifier for the instance +func (instance *MSFT_iSCSISession) SetPropertyInitiatorSideIdentifier(value string) (err error) { + return instance.SetProperty("InitiatorSideIdentifier", (value)) +} + +// GetInitiatorSideIdentifier gets the value of InitiatorSideIdentifier for the instance +func (instance *MSFT_iSCSISession) GetPropertyInitiatorSideIdentifier() (value string, err error) { + retValue, err := instance.GetProperty("InitiatorSideIdentifier") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetIsConnected sets the value of IsConnected for the instance +func (instance *MSFT_iSCSISession) SetPropertyIsConnected(value bool) (err error) { + return instance.SetProperty("IsConnected", (value)) +} + +// GetIsConnected gets the value of IsConnected for the instance +func (instance *MSFT_iSCSISession) GetPropertyIsConnected() (value bool, err error) { + retValue, err := instance.GetProperty("IsConnected") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsDataDigest sets the value of IsDataDigest for the instance +func (instance *MSFT_iSCSISession) SetPropertyIsDataDigest(value bool) (err error) { + return instance.SetProperty("IsDataDigest", (value)) +} + +// GetIsDataDigest gets the value of IsDataDigest for the instance +func (instance *MSFT_iSCSISession) GetPropertyIsDataDigest() (value bool, err error) { + retValue, err := instance.GetProperty("IsDataDigest") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsDiscovered sets the value of IsDiscovered for the instance +func (instance *MSFT_iSCSISession) SetPropertyIsDiscovered(value bool) (err error) { + return instance.SetProperty("IsDiscovered", (value)) +} + +// GetIsDiscovered gets the value of IsDiscovered for the instance +func (instance *MSFT_iSCSISession) GetPropertyIsDiscovered() (value bool, err error) { + retValue, err := instance.GetProperty("IsDiscovered") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsHeaderDigest sets the value of IsHeaderDigest for the instance +func (instance *MSFT_iSCSISession) SetPropertyIsHeaderDigest(value bool) (err error) { + return instance.SetProperty("IsHeaderDigest", (value)) +} + +// GetIsHeaderDigest gets the value of IsHeaderDigest for the instance +func (instance *MSFT_iSCSISession) GetPropertyIsHeaderDigest() (value bool, err error) { + retValue, err := instance.GetProperty("IsHeaderDigest") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsPersistent sets the value of IsPersistent for the instance +func (instance *MSFT_iSCSISession) SetPropertyIsPersistent(value bool) (err error) { + return instance.SetProperty("IsPersistent", (value)) +} + +// GetIsPersistent gets the value of IsPersistent for the instance +func (instance *MSFT_iSCSISession) GetPropertyIsPersistent() (value bool, err error) { + retValue, err := instance.GetProperty("IsPersistent") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetNumberOfConnections sets the value of NumberOfConnections for the instance +func (instance *MSFT_iSCSISession) SetPropertyNumberOfConnections(value uint32) (err error) { + return instance.SetProperty("NumberOfConnections", (value)) +} + +// GetNumberOfConnections gets the value of NumberOfConnections for the instance +func (instance *MSFT_iSCSISession) GetPropertyNumberOfConnections() (value uint32, err error) { + retValue, err := instance.GetProperty("NumberOfConnections") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetSessionIdentifier sets the value of SessionIdentifier for the instance +func (instance *MSFT_iSCSISession) SetPropertySessionIdentifier(value string) (err error) { + return instance.SetProperty("SessionIdentifier", (value)) +} + +// GetSessionIdentifier gets the value of SessionIdentifier for the instance +func (instance *MSFT_iSCSISession) GetPropertySessionIdentifier() (value string, err error) { + retValue, err := instance.GetProperty("SessionIdentifier") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetTargetNodeAddress sets the value of TargetNodeAddress for the instance +func (instance *MSFT_iSCSISession) SetPropertyTargetNodeAddress(value string) (err error) { + return instance.SetProperty("TargetNodeAddress", (value)) +} + +// GetTargetNodeAddress gets the value of TargetNodeAddress for the instance +func (instance *MSFT_iSCSISession) GetPropertyTargetNodeAddress() (value string, err error) { + retValue, err := instance.GetProperty("TargetNodeAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetTargetSideIdentifier sets the value of TargetSideIdentifier for the instance +func (instance *MSFT_iSCSISession) SetPropertyTargetSideIdentifier(value string) (err error) { + return instance.SetProperty("TargetSideIdentifier", (value)) +} + +// GetTargetSideIdentifier gets the value of TargetSideIdentifier for the instance +func (instance *MSFT_iSCSISession) GetPropertyTargetSideIdentifier() (value string, err error) { + retValue, err := instance.GetProperty("TargetSideIdentifier") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// + +// +// +// + +// +func (instance *MSFT_iSCSISession) Register( /* IN */ IsMultipathEnabled bool, + /* IN */ ChapUsername string, + /* IN */ ChapSecret string) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("Register", IsMultipathEnabled, ChapUsername, ChapSecret) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +func (instance *MSFT_iSCSISession) Unregister() (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("Unregister") + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// + +// +func (instance *MSFT_iSCSISession) SetCHAPSecret( /* IN */ ChapSecret string) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetCHAPSecret", ChapSecret) + if err != nil { + return + } + result = uint32(retVal) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISessionToDisk.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISessionToDisk.go new file mode 100644 index 000000000..bfe584e93 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISessionToDisk.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_iSCSISessionToDisk struct +type MSFT_iSCSISessionToDisk struct { + *cim.WmiInstance + + // + Disk MSFT_Disk + + // + iSCSISession MSFT_iSCSISession +} + +func NewMSFT_iSCSISessionToDiskEx1(instance *cim.WmiInstance) (newInstance *MSFT_iSCSISessionToDisk, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_iSCSISessionToDisk{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_iSCSISessionToDiskEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_iSCSISessionToDisk, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_iSCSISessionToDisk{ + WmiInstance: tmp, + } + return +} + +// SetDisk sets the value of Disk for the instance +func (instance *MSFT_iSCSISessionToDisk) SetPropertyDisk(value MSFT_Disk) (err error) { + return instance.SetProperty("Disk", (value)) +} + +// GetDisk gets the value of Disk for the instance +func (instance *MSFT_iSCSISessionToDisk) GetPropertyDisk() (value MSFT_Disk, err error) { + retValue, err := instance.GetProperty("Disk") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_Disk) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_Disk is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_Disk(valuetmp) + + return +} + +// SetiSCSISession sets the value of iSCSISession for the instance +func (instance *MSFT_iSCSISessionToDisk) SetPropertyiSCSISession(value MSFT_iSCSISession) (err error) { + return instance.SetProperty("iSCSISession", (value)) +} + +// GetiSCSISession gets the value of iSCSISession for the instance +func (instance *MSFT_iSCSISessionToDisk) GetPropertyiSCSISession() (value MSFT_iSCSISession, err error) { + retValue, err := instance.GetProperty("iSCSISession") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSISession) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSISession is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSISession(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISessionToiSCSIConnection.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISessionToiSCSIConnection.go new file mode 100644 index 000000000..029211dd5 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISessionToiSCSIConnection.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_iSCSISessionToiSCSIConnection struct +type MSFT_iSCSISessionToiSCSIConnection struct { + *cim.WmiInstance + + // + iSCSIConnection MSFT_iSCSIConnection + + // + iSCSISession MSFT_iSCSISession +} + +func NewMSFT_iSCSISessionToiSCSIConnectionEx1(instance *cim.WmiInstance) (newInstance *MSFT_iSCSISessionToiSCSIConnection, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_iSCSISessionToiSCSIConnection{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_iSCSISessionToiSCSIConnectionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_iSCSISessionToiSCSIConnection, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_iSCSISessionToiSCSIConnection{ + WmiInstance: tmp, + } + return +} + +// SetiSCSIConnection sets the value of iSCSIConnection for the instance +func (instance *MSFT_iSCSISessionToiSCSIConnection) SetPropertyiSCSIConnection(value MSFT_iSCSIConnection) (err error) { + return instance.SetProperty("iSCSIConnection", (value)) +} + +// GetiSCSIConnection gets the value of iSCSIConnection for the instance +func (instance *MSFT_iSCSISessionToiSCSIConnection) GetPropertyiSCSIConnection() (value MSFT_iSCSIConnection, err error) { + retValue, err := instance.GetProperty("iSCSIConnection") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSIConnection) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSIConnection is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSIConnection(valuetmp) + + return +} + +// SetiSCSISession sets the value of iSCSISession for the instance +func (instance *MSFT_iSCSISessionToiSCSIConnection) SetPropertyiSCSISession(value MSFT_iSCSISession) (err error) { + return instance.SetProperty("iSCSISession", (value)) +} + +// GetiSCSISession gets the value of iSCSISession for the instance +func (instance *MSFT_iSCSISessionToiSCSIConnection) GetPropertyiSCSISession() (value MSFT_iSCSISession, err error) { + retValue, err := instance.GetProperty("iSCSISession") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSISession) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSISession is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSISession(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISessionToiSCSITargetPortal.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISessionToiSCSITargetPortal.go new file mode 100644 index 000000000..9f881ccf4 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSISessionToiSCSITargetPortal.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_iSCSISessionToiSCSITargetPortal struct +type MSFT_iSCSISessionToiSCSITargetPortal struct { + *cim.WmiInstance + + // + iSCSISession MSFT_iSCSISession + + // + iSCSITargetPortal MSFT_iSCSITargetPortal +} + +func NewMSFT_iSCSISessionToiSCSITargetPortalEx1(instance *cim.WmiInstance) (newInstance *MSFT_iSCSISessionToiSCSITargetPortal, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_iSCSISessionToiSCSITargetPortal{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_iSCSISessionToiSCSITargetPortalEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_iSCSISessionToiSCSITargetPortal, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_iSCSISessionToiSCSITargetPortal{ + WmiInstance: tmp, + } + return +} + +// SetiSCSISession sets the value of iSCSISession for the instance +func (instance *MSFT_iSCSISessionToiSCSITargetPortal) SetPropertyiSCSISession(value MSFT_iSCSISession) (err error) { + return instance.SetProperty("iSCSISession", (value)) +} + +// GetiSCSISession gets the value of iSCSISession for the instance +func (instance *MSFT_iSCSISessionToiSCSITargetPortal) GetPropertyiSCSISession() (value MSFT_iSCSISession, err error) { + retValue, err := instance.GetProperty("iSCSISession") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSISession) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSISession is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSISession(valuetmp) + + return +} + +// SetiSCSITargetPortal sets the value of iSCSITargetPortal for the instance +func (instance *MSFT_iSCSISessionToiSCSITargetPortal) SetPropertyiSCSITargetPortal(value MSFT_iSCSITargetPortal) (err error) { + return instance.SetProperty("iSCSITargetPortal", (value)) +} + +// GetiSCSITargetPortal gets the value of iSCSITargetPortal for the instance +func (instance *MSFT_iSCSISessionToiSCSITargetPortal) GetPropertyiSCSITargetPortal() (value MSFT_iSCSITargetPortal, err error) { + retValue, err := instance.GetProperty("iSCSITargetPortal") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSITargetPortal) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSITargetPortal is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSITargetPortal(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITarget.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITarget.go new file mode 100644 index 000000000..49090065f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITarget.go @@ -0,0 +1,181 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_iSCSITarget struct +type MSFT_iSCSITarget struct { + *cim.WmiInstance + + // + IsConnected bool + + // + NodeAddress string +} + +func NewMSFT_iSCSITargetEx1(instance *cim.WmiInstance) (newInstance *MSFT_iSCSITarget, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_iSCSITarget{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_iSCSITargetEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_iSCSITarget, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_iSCSITarget{ + WmiInstance: tmp, + } + return +} + +// SetIsConnected sets the value of IsConnected for the instance +func (instance *MSFT_iSCSITarget) SetPropertyIsConnected(value bool) (err error) { + return instance.SetProperty("IsConnected", (value)) +} + +// GetIsConnected gets the value of IsConnected for the instance +func (instance *MSFT_iSCSITarget) GetPropertyIsConnected() (value bool, err error) { + retValue, err := instance.GetProperty("IsConnected") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetNodeAddress sets the value of NodeAddress for the instance +func (instance *MSFT_iSCSITarget) SetPropertyNodeAddress(value string) (err error) { + return instance.SetProperty("NodeAddress", (value)) +} + +// GetNodeAddress gets the value of NodeAddress for the instance +func (instance *MSFT_iSCSITarget) GetPropertyNodeAddress() (value string, err error) { + retValue, err := instance.GetProperty("NodeAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// + +// + +// +func (instance *MSFT_iSCSITarget) Disconnect( /* IN */ SessionIdentifier string) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("Disconnect", SessionIdentifier) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +func (instance *MSFT_iSCSITarget) Update() (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("Update") + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// +// + +// +// +func (instance *MSFT_iSCSITarget) Connect( /* IN */ NodeAddress string, + /* IN */ TargetPortalAddress string, + /* IN */ TargetPortalPortNumber uint16, + /* IN */ InitiatorPortalAddress string, + /* IN */ IsDataDigest bool, + /* IN */ IsHeaderDigest bool, + /* IN */ ReportToPnP bool, + /* IN */ AuthenticationType string, + /* IN */ ChapUsername string, + /* IN */ ChapSecret string, + /* IN */ IsMultipathEnabled bool, + /* IN */ IsPersistent bool, + /* IN */ InitiatorInstanceName string, + /* OUT */ CreatediSCSISession MSFT_iSCSISession) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Connect", NodeAddress, TargetPortalAddress, TargetPortalPortNumber, InitiatorPortalAddress, IsDataDigest, IsHeaderDigest, ReportToPnP, AuthenticationType, ChapUsername, ChapSecret, IsMultipathEnabled, IsPersistent, InitiatorInstanceName) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetPortal.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetPortal.go new file mode 100644 index 000000000..fa165bdca --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetPortal.go @@ -0,0 +1,307 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_iSCSITargetPortal struct +type MSFT_iSCSITargetPortal struct { + *cim.WmiInstance + + // + InitiatorInstanceName string + + // + InitiatorPortalAddress string + + // + IsDataDigest bool + + // + IsHeaderDigest bool + + // + TargetPortalAddress string + + // + TargetPortalPortNumber uint16 +} + +func NewMSFT_iSCSITargetPortalEx1(instance *cim.WmiInstance) (newInstance *MSFT_iSCSITargetPortal, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_iSCSITargetPortal{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_iSCSITargetPortalEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_iSCSITargetPortal, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_iSCSITargetPortal{ + WmiInstance: tmp, + } + return +} + +// SetInitiatorInstanceName sets the value of InitiatorInstanceName for the instance +func (instance *MSFT_iSCSITargetPortal) SetPropertyInitiatorInstanceName(value string) (err error) { + return instance.SetProperty("InitiatorInstanceName", (value)) +} + +// GetInitiatorInstanceName gets the value of InitiatorInstanceName for the instance +func (instance *MSFT_iSCSITargetPortal) GetPropertyInitiatorInstanceName() (value string, err error) { + retValue, err := instance.GetProperty("InitiatorInstanceName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInitiatorPortalAddress sets the value of InitiatorPortalAddress for the instance +func (instance *MSFT_iSCSITargetPortal) SetPropertyInitiatorPortalAddress(value string) (err error) { + return instance.SetProperty("InitiatorPortalAddress", (value)) +} + +// GetInitiatorPortalAddress gets the value of InitiatorPortalAddress for the instance +func (instance *MSFT_iSCSITargetPortal) GetPropertyInitiatorPortalAddress() (value string, err error) { + retValue, err := instance.GetProperty("InitiatorPortalAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetIsDataDigest sets the value of IsDataDigest for the instance +func (instance *MSFT_iSCSITargetPortal) SetPropertyIsDataDigest(value bool) (err error) { + return instance.SetProperty("IsDataDigest", (value)) +} + +// GetIsDataDigest gets the value of IsDataDigest for the instance +func (instance *MSFT_iSCSITargetPortal) GetPropertyIsDataDigest() (value bool, err error) { + retValue, err := instance.GetProperty("IsDataDigest") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetIsHeaderDigest sets the value of IsHeaderDigest for the instance +func (instance *MSFT_iSCSITargetPortal) SetPropertyIsHeaderDigest(value bool) (err error) { + return instance.SetProperty("IsHeaderDigest", (value)) +} + +// GetIsHeaderDigest gets the value of IsHeaderDigest for the instance +func (instance *MSFT_iSCSITargetPortal) GetPropertyIsHeaderDigest() (value bool, err error) { + retValue, err := instance.GetProperty("IsHeaderDigest") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetTargetPortalAddress sets the value of TargetPortalAddress for the instance +func (instance *MSFT_iSCSITargetPortal) SetPropertyTargetPortalAddress(value string) (err error) { + return instance.SetProperty("TargetPortalAddress", (value)) +} + +// GetTargetPortalAddress gets the value of TargetPortalAddress for the instance +func (instance *MSFT_iSCSITargetPortal) GetPropertyTargetPortalAddress() (value string, err error) { + retValue, err := instance.GetProperty("TargetPortalAddress") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetTargetPortalPortNumber sets the value of TargetPortalPortNumber for the instance +func (instance *MSFT_iSCSITargetPortal) SetPropertyTargetPortalPortNumber(value uint16) (err error) { + return instance.SetProperty("TargetPortalPortNumber", (value)) +} + +// GetTargetPortalPortNumber gets the value of TargetPortalPortNumber for the instance +func (instance *MSFT_iSCSITargetPortal) GetPropertyTargetPortalPortNumber() (value uint16, err error) { + retValue, err := instance.GetProperty("TargetPortalPortNumber") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint16) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint16 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint16(valuetmp) + + return +} + +// + +// +// +// +// +// +// +// +// +// + +// +// +func (instance *MSFT_iSCSITargetPortal) New( /* IN */ TargetPortalAddress string, + /* IN */ TargetPortalPortNumber uint16, + /* IN */ InitiatorInstanceName string, + /* IN */ InitiatorPortalAddress string, + /* IN */ AuthenticationType string, + /* IN */ ChapUsername string, + /* IN */ ChapSecret string, + /* IN */ IsHeaderDigest bool, + /* IN */ IsDataDigest bool, + /* OUT */ CreatedTargetPortal MSFT_iSCSITargetPortal) (result uint32, err error) { + retVal, err := instance.InvokeMethod("New", TargetPortalAddress, TargetPortalPortNumber, InitiatorInstanceName, InitiatorPortalAddress, AuthenticationType, ChapUsername, ChapSecret, IsHeaderDigest, IsDataDigest) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// + +// +func (instance *MSFT_iSCSITargetPortal) Remove( /* IN */ InitiatorInstanceName string, + /* IN */ InitiatorPortalAddress string, + /* IN */ TargetPortalPortNumber uint16, + /* IN */ TargetPortalAddress string) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("Remove", InitiatorInstanceName, InitiatorPortalAddress, TargetPortalPortNumber, TargetPortalAddress) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// + +// +func (instance *MSFT_iSCSITargetPortal) Update( /* IN */ InitiatorInstanceName string, + /* IN */ InitiatorPortalAddress string, + /* IN */ TargetPortalAddress string, + /* IN */ TargetPortalPortNumber uint16) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("Update", InitiatorInstanceName, InitiatorPortalAddress, TargetPortalAddress, TargetPortalPortNumber) + if err != nil { + return + } + result = uint32(retVal) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetToiSCSIConnection.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetToiSCSIConnection.go new file mode 100644 index 000000000..02e325ede --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetToiSCSIConnection.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_iSCSITargetToiSCSIConnection struct +type MSFT_iSCSITargetToiSCSIConnection struct { + *cim.WmiInstance + + // + iSCSIConnection MSFT_iSCSIConnection + + // + iSCSITarget MSFT_iSCSITarget +} + +func NewMSFT_iSCSITargetToiSCSIConnectionEx1(instance *cim.WmiInstance) (newInstance *MSFT_iSCSITargetToiSCSIConnection, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_iSCSITargetToiSCSIConnection{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_iSCSITargetToiSCSIConnectionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_iSCSITargetToiSCSIConnection, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_iSCSITargetToiSCSIConnection{ + WmiInstance: tmp, + } + return +} + +// SetiSCSIConnection sets the value of iSCSIConnection for the instance +func (instance *MSFT_iSCSITargetToiSCSIConnection) SetPropertyiSCSIConnection(value MSFT_iSCSIConnection) (err error) { + return instance.SetProperty("iSCSIConnection", (value)) +} + +// GetiSCSIConnection gets the value of iSCSIConnection for the instance +func (instance *MSFT_iSCSITargetToiSCSIConnection) GetPropertyiSCSIConnection() (value MSFT_iSCSIConnection, err error) { + retValue, err := instance.GetProperty("iSCSIConnection") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSIConnection) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSIConnection is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSIConnection(valuetmp) + + return +} + +// SetiSCSITarget sets the value of iSCSITarget for the instance +func (instance *MSFT_iSCSITargetToiSCSIConnection) SetPropertyiSCSITarget(value MSFT_iSCSITarget) (err error) { + return instance.SetProperty("iSCSITarget", (value)) +} + +// GetiSCSITarget gets the value of iSCSITarget for the instance +func (instance *MSFT_iSCSITargetToiSCSIConnection) GetPropertyiSCSITarget() (value MSFT_iSCSITarget, err error) { + retValue, err := instance.GetProperty("iSCSITarget") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSITarget) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSITarget is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSITarget(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetToiSCSISession.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetToiSCSISession.go new file mode 100644 index 000000000..b49e2ae47 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetToiSCSISession.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_iSCSITargetToiSCSISession struct +type MSFT_iSCSITargetToiSCSISession struct { + *cim.WmiInstance + + // + iSCSISession MSFT_iSCSISession + + // + iSCSITarget MSFT_iSCSITarget +} + +func NewMSFT_iSCSITargetToiSCSISessionEx1(instance *cim.WmiInstance) (newInstance *MSFT_iSCSITargetToiSCSISession, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_iSCSITargetToiSCSISession{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_iSCSITargetToiSCSISessionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_iSCSITargetToiSCSISession, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_iSCSITargetToiSCSISession{ + WmiInstance: tmp, + } + return +} + +// SetiSCSISession sets the value of iSCSISession for the instance +func (instance *MSFT_iSCSITargetToiSCSISession) SetPropertyiSCSISession(value MSFT_iSCSISession) (err error) { + return instance.SetProperty("iSCSISession", (value)) +} + +// GetiSCSISession gets the value of iSCSISession for the instance +func (instance *MSFT_iSCSITargetToiSCSISession) GetPropertyiSCSISession() (value MSFT_iSCSISession, err error) { + retValue, err := instance.GetProperty("iSCSISession") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSISession) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSISession is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSISession(valuetmp) + + return +} + +// SetiSCSITarget sets the value of iSCSITarget for the instance +func (instance *MSFT_iSCSITargetToiSCSISession) SetPropertyiSCSITarget(value MSFT_iSCSITarget) (err error) { + return instance.SetProperty("iSCSITarget", (value)) +} + +// GetiSCSITarget gets the value of iSCSITarget for the instance +func (instance *MSFT_iSCSITargetToiSCSISession) GetPropertyiSCSITarget() (value MSFT_iSCSITarget, err error) { + retValue, err := instance.GetProperty("iSCSITarget") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSITarget) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSITarget is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSITarget(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetToiSCSITargetPortal.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetToiSCSITargetPortal.go new file mode 100644 index 000000000..4746aae6e --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MSFT_iSCSITargetToiSCSITargetPortal.go @@ -0,0 +1,111 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// MSFT_iSCSITargetToiSCSITargetPortal struct +type MSFT_iSCSITargetToiSCSITargetPortal struct { + *cim.WmiInstance + + // + iSCSITarget MSFT_iSCSITarget + + // + iSCSITargetPortal MSFT_iSCSITargetPortal +} + +func NewMSFT_iSCSITargetToiSCSITargetPortalEx1(instance *cim.WmiInstance) (newInstance *MSFT_iSCSITargetToiSCSITargetPortal, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &MSFT_iSCSITargetToiSCSITargetPortal{ + WmiInstance: tmp, + } + return +} + +func NewMSFT_iSCSITargetToiSCSITargetPortalEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *MSFT_iSCSITargetToiSCSITargetPortal, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &MSFT_iSCSITargetToiSCSITargetPortal{ + WmiInstance: tmp, + } + return +} + +// SetiSCSITarget sets the value of iSCSITarget for the instance +func (instance *MSFT_iSCSITargetToiSCSITargetPortal) SetPropertyiSCSITarget(value MSFT_iSCSITarget) (err error) { + return instance.SetProperty("iSCSITarget", (value)) +} + +// GetiSCSITarget gets the value of iSCSITarget for the instance +func (instance *MSFT_iSCSITargetToiSCSITargetPortal) GetPropertyiSCSITarget() (value MSFT_iSCSITarget, err error) { + retValue, err := instance.GetProperty("iSCSITarget") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSITarget) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSITarget is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSITarget(valuetmp) + + return +} + +// SetiSCSITargetPortal sets the value of iSCSITargetPortal for the instance +func (instance *MSFT_iSCSITargetToiSCSITargetPortal) SetPropertyiSCSITargetPortal(value MSFT_iSCSITargetPortal) (err error) { + return instance.SetProperty("iSCSITargetPortal", (value)) +} + +// GetiSCSITargetPortal gets the value of iSCSITargetPortal for the instance +func (instance *MSFT_iSCSITargetToiSCSITargetPortal) GetPropertyiSCSITargetPortal() (value MSFT_iSCSITargetPortal, err error) { + retValue, err := instance.GetProperty("iSCSITargetPortal") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(MSFT_iSCSITargetPortal) + if !ok { + err = errors.Wrapf(errors.InvalidType, " MSFT_iSCSITargetPortal is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = MSFT_iSCSITargetPortal(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MethodInvocationEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MethodInvocationEvent.go new file mode 100644 index 000000000..8c5343109 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MethodInvocationEvent.go @@ -0,0 +1,140 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __MethodInvocationEvent struct +type __MethodInvocationEvent struct { + *__InstanceOperationEvent + + // + Method string + + // + Parameters interface{} + + // + PreCall bool +} + +func New__MethodInvocationEventEx1(instance *cim.WmiInstance) (newInstance *__MethodInvocationEvent, err error) { + tmp, err := New__InstanceOperationEventEx1(instance) + + if err != nil { + return + } + newInstance = &__MethodInvocationEvent{ + __InstanceOperationEvent: tmp, + } + return +} + +func New__MethodInvocationEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__MethodInvocationEvent, err error) { + tmp, err := New__InstanceOperationEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__MethodInvocationEvent{ + __InstanceOperationEvent: tmp, + } + return +} + +// SetMethod sets the value of Method for the instance +func (instance *__MethodInvocationEvent) SetPropertyMethod(value string) (err error) { + return instance.SetProperty("Method", (value)) +} + +// GetMethod gets the value of Method for the instance +func (instance *__MethodInvocationEvent) GetPropertyMethod() (value string, err error) { + retValue, err := instance.GetProperty("Method") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetParameters sets the value of Parameters for the instance +func (instance *__MethodInvocationEvent) SetPropertyParameters(value interface{}) (err error) { + return instance.SetProperty("Parameters", (value)) +} + +// GetParameters gets the value of Parameters for the instance +func (instance *__MethodInvocationEvent) GetPropertyParameters() (value interface{}, err error) { + retValue, err := instance.GetProperty("Parameters") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(interface{}) + if !ok { + err = errors.Wrapf(errors.InvalidType, " interface{} is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = interface{}(valuetmp) + + return +} + +// SetPreCall sets the value of PreCall for the instance +func (instance *__MethodInvocationEvent) SetPropertyPreCall(value bool) (err error) { + return instance.SetProperty("PreCall", (value)) +} + +// GetPreCall gets the value of PreCall for the instance +func (instance *__MethodInvocationEvent) GetPropertyPreCall() (value bool, err error) { + retValue, err := instance.GetProperty("PreCall") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MethodProviderRegistration.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MethodProviderRegistration.go new file mode 100644 index 000000000..5df05a38f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/MethodProviderRegistration.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __MethodProviderRegistration struct +type __MethodProviderRegistration struct { + *__ProviderRegistration +} + +func New__MethodProviderRegistrationEx1(instance *cim.WmiInstance) (newInstance *__MethodProviderRegistration, err error) { + tmp, err := New__ProviderRegistrationEx1(instance) + + if err != nil { + return + } + newInstance = &__MethodProviderRegistration{ + __ProviderRegistration: tmp, + } + return +} + +func New__MethodProviderRegistrationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__MethodProviderRegistration, err error) { + tmp, err := New__ProviderRegistrationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__MethodProviderRegistration{ + __ProviderRegistration: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NTLMUser9X.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NTLMUser9X.go new file mode 100644 index 000000000..7c069eb4a --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NTLMUser9X.go @@ -0,0 +1,200 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __NTLMUser9X struct +type __NTLMUser9X struct { + *__SecurityRelatedClass + + // + Authority string + + // + Flags int32 + + // + Mask int32 + + // + Name string + + // + Type int32 +} + +func New__NTLMUser9XEx1(instance *cim.WmiInstance) (newInstance *__NTLMUser9X, err error) { + tmp, err := New__SecurityRelatedClassEx1(instance) + + if err != nil { + return + } + newInstance = &__NTLMUser9X{ + __SecurityRelatedClass: tmp, + } + return +} + +func New__NTLMUser9XEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__NTLMUser9X, err error) { + tmp, err := New__SecurityRelatedClassEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__NTLMUser9X{ + __SecurityRelatedClass: tmp, + } + return +} + +// SetAuthority sets the value of Authority for the instance +func (instance *__NTLMUser9X) SetPropertyAuthority(value string) (err error) { + return instance.SetProperty("Authority", (value)) +} + +// GetAuthority gets the value of Authority for the instance +func (instance *__NTLMUser9X) GetPropertyAuthority() (value string, err error) { + retValue, err := instance.GetProperty("Authority") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetFlags sets the value of Flags for the instance +func (instance *__NTLMUser9X) SetPropertyFlags(value int32) (err error) { + return instance.SetProperty("Flags", (value)) +} + +// GetFlags gets the value of Flags for the instance +func (instance *__NTLMUser9X) GetPropertyFlags() (value int32, err error) { + retValue, err := instance.GetProperty("Flags") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(int32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " int32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = int32(valuetmp) + + return +} + +// SetMask sets the value of Mask for the instance +func (instance *__NTLMUser9X) SetPropertyMask(value int32) (err error) { + return instance.SetProperty("Mask", (value)) +} + +// GetMask gets the value of Mask for the instance +func (instance *__NTLMUser9X) GetPropertyMask() (value int32, err error) { + retValue, err := instance.GetProperty("Mask") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(int32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " int32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = int32(valuetmp) + + return +} + +// SetName sets the value of Name for the instance +func (instance *__NTLMUser9X) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *__NTLMUser9X) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetType sets the value of Type for the instance +func (instance *__NTLMUser9X) SetPropertyType(value int32) (err error) { + return instance.SetProperty("Type", (value)) +} + +// GetType gets the value of Type for the instance +func (instance *__NTLMUser9X) GetPropertyType() (value int32, err error) { + retValue, err := instance.GetProperty("Type") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(int32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " int32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = int32(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Namespace.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Namespace.go new file mode 100644 index 000000000..db90da357 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Namespace.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __Namespace struct +type __Namespace struct { + *__SystemClass + + // + Name string +} + +func New__NamespaceEx1(instance *cim.WmiInstance) (newInstance *__Namespace, err error) { + tmp, err := New__SystemClassEx1(instance) + + if err != nil { + return + } + newInstance = &__Namespace{ + __SystemClass: tmp, + } + return +} + +func New__NamespaceEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__Namespace, err error) { + tmp, err := New__SystemClassEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__Namespace{ + __SystemClass: tmp, + } + return +} + +// SetName sets the value of Name for the instance +func (instance *__Namespace) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *__Namespace) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceCreationEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceCreationEvent.go new file mode 100644 index 000000000..602c134bf --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceCreationEvent.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __NamespaceCreationEvent struct +type __NamespaceCreationEvent struct { + *__NamespaceOperationEvent +} + +func New__NamespaceCreationEventEx1(instance *cim.WmiInstance) (newInstance *__NamespaceCreationEvent, err error) { + tmp, err := New__NamespaceOperationEventEx1(instance) + + if err != nil { + return + } + newInstance = &__NamespaceCreationEvent{ + __NamespaceOperationEvent: tmp, + } + return +} + +func New__NamespaceCreationEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__NamespaceCreationEvent, err error) { + tmp, err := New__NamespaceOperationEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__NamespaceCreationEvent{ + __NamespaceOperationEvent: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceDeletionEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceDeletionEvent.go new file mode 100644 index 000000000..bb206a637 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceDeletionEvent.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __NamespaceDeletionEvent struct +type __NamespaceDeletionEvent struct { + *__NamespaceOperationEvent +} + +func New__NamespaceDeletionEventEx1(instance *cim.WmiInstance) (newInstance *__NamespaceDeletionEvent, err error) { + tmp, err := New__NamespaceOperationEventEx1(instance) + + if err != nil { + return + } + newInstance = &__NamespaceDeletionEvent{ + __NamespaceOperationEvent: tmp, + } + return +} + +func New__NamespaceDeletionEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__NamespaceDeletionEvent, err error) { + tmp, err := New__NamespaceOperationEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__NamespaceDeletionEvent{ + __NamespaceOperationEvent: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceModificationEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceModificationEvent.go new file mode 100644 index 000000000..55e09d368 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceModificationEvent.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __NamespaceModificationEvent struct +type __NamespaceModificationEvent struct { + *__NamespaceOperationEvent + + // + PreviousNamespace __Namespace +} + +func New__NamespaceModificationEventEx1(instance *cim.WmiInstance) (newInstance *__NamespaceModificationEvent, err error) { + tmp, err := New__NamespaceOperationEventEx1(instance) + + if err != nil { + return + } + newInstance = &__NamespaceModificationEvent{ + __NamespaceOperationEvent: tmp, + } + return +} + +func New__NamespaceModificationEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__NamespaceModificationEvent, err error) { + tmp, err := New__NamespaceOperationEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__NamespaceModificationEvent{ + __NamespaceOperationEvent: tmp, + } + return +} + +// SetPreviousNamespace sets the value of PreviousNamespace for the instance +func (instance *__NamespaceModificationEvent) SetPropertyPreviousNamespace(value __Namespace) (err error) { + return instance.SetProperty("PreviousNamespace", (value)) +} + +// GetPreviousNamespace gets the value of PreviousNamespace for the instance +func (instance *__NamespaceModificationEvent) GetPropertyPreviousNamespace() (value __Namespace, err error) { + retValue, err := instance.GetProperty("PreviousNamespace") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(__Namespace) + if !ok { + err = errors.Wrapf(errors.InvalidType, " __Namespace is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = __Namespace(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceOperationEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceOperationEvent.go new file mode 100644 index 000000000..291a20b3c --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NamespaceOperationEvent.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __NamespaceOperationEvent struct +type __NamespaceOperationEvent struct { + *__Event + + // + TargetNamespace __Namespace +} + +func New__NamespaceOperationEventEx1(instance *cim.WmiInstance) (newInstance *__NamespaceOperationEvent, err error) { + tmp, err := New__EventEx1(instance) + + if err != nil { + return + } + newInstance = &__NamespaceOperationEvent{ + __Event: tmp, + } + return +} + +func New__NamespaceOperationEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__NamespaceOperationEvent, err error) { + tmp, err := New__EventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__NamespaceOperationEvent{ + __Event: tmp, + } + return +} + +// SetTargetNamespace sets the value of TargetNamespace for the instance +func (instance *__NamespaceOperationEvent) SetPropertyTargetNamespace(value __Namespace) (err error) { + return instance.SetProperty("TargetNamespace", (value)) +} + +// GetTargetNamespace gets the value of TargetNamespace for the instance +func (instance *__NamespaceOperationEvent) GetPropertyTargetNamespace() (value __Namespace, err error) { + retValue, err := instance.GetProperty("TargetNamespace") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(__Namespace) + if !ok { + err = errors.Wrapf(errors.InvalidType, " __Namespace is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = __Namespace(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NotifyStatus.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NotifyStatus.go new file mode 100644 index 000000000..8d36b68ea --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/NotifyStatus.go @@ -0,0 +1,81 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __NotifyStatus struct +type __NotifyStatus struct { + *cim.WmiInstance + + // + StatusCode uint32 +} + +func New__NotifyStatusEx1(instance *cim.WmiInstance) (newInstance *__NotifyStatus, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &__NotifyStatus{ + WmiInstance: tmp, + } + return +} + +func New__NotifyStatusEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__NotifyStatus, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__NotifyStatus{ + WmiInstance: tmp, + } + return +} + +// SetStatusCode sets the value of StatusCode for the instance +func (instance *__NotifyStatus) SetPropertyStatusCode(value uint32) (err error) { + return instance.SetProperty("StatusCode", (value)) +} + +// GetStatusCode gets the value of StatusCode for the instance +func (instance *__NotifyStatus) GetPropertyStatusCode() (value uint32, err error) { + retValue, err := instance.GetProperty("StatusCode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ObjectProviderRegistration.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ObjectProviderRegistration.go new file mode 100644 index 000000000..1e2501378 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ObjectProviderRegistration.go @@ -0,0 +1,291 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __ObjectProviderRegistration struct +type __ObjectProviderRegistration struct { + *__ProviderRegistration + + // + InteractionType ObjectProviderRegistration_InteractionType + + // + QuerySupportLevels []string + + // + SupportsBatching bool + + // + SupportsDelete bool + + // + SupportsEnumeration bool + + // + SupportsGet bool + + // + SupportsPut bool + + // + SupportsTransactions bool +} + +func New__ObjectProviderRegistrationEx1(instance *cim.WmiInstance) (newInstance *__ObjectProviderRegistration, err error) { + tmp, err := New__ProviderRegistrationEx1(instance) + + if err != nil { + return + } + newInstance = &__ObjectProviderRegistration{ + __ProviderRegistration: tmp, + } + return +} + +func New__ObjectProviderRegistrationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__ObjectProviderRegistration, err error) { + tmp, err := New__ProviderRegistrationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__ObjectProviderRegistration{ + __ProviderRegistration: tmp, + } + return +} + +// SetInteractionType sets the value of InteractionType for the instance +func (instance *__ObjectProviderRegistration) SetPropertyInteractionType(value ObjectProviderRegistration_InteractionType) (err error) { + return instance.SetProperty("InteractionType", (value)) +} + +// GetInteractionType gets the value of InteractionType for the instance +func (instance *__ObjectProviderRegistration) GetPropertyInteractionType() (value ObjectProviderRegistration_InteractionType, err error) { + retValue, err := instance.GetProperty("InteractionType") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(int32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " int32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = ObjectProviderRegistration_InteractionType(valuetmp) + + return +} + +// SetQuerySupportLevels sets the value of QuerySupportLevels for the instance +func (instance *__ObjectProviderRegistration) SetPropertyQuerySupportLevels(value []string) (err error) { + return instance.SetProperty("QuerySupportLevels", (value)) +} + +// GetQuerySupportLevels gets the value of QuerySupportLevels for the instance +func (instance *__ObjectProviderRegistration) GetPropertyQuerySupportLevels() (value []string, err error) { + retValue, err := instance.GetProperty("QuerySupportLevels") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, string(valuetmp)) + } + + return +} + +// SetSupportsBatching sets the value of SupportsBatching for the instance +func (instance *__ObjectProviderRegistration) SetPropertySupportsBatching(value bool) (err error) { + return instance.SetProperty("SupportsBatching", (value)) +} + +// GetSupportsBatching gets the value of SupportsBatching for the instance +func (instance *__ObjectProviderRegistration) GetPropertySupportsBatching() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsBatching") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsDelete sets the value of SupportsDelete for the instance +func (instance *__ObjectProviderRegistration) SetPropertySupportsDelete(value bool) (err error) { + return instance.SetProperty("SupportsDelete", (value)) +} + +// GetSupportsDelete gets the value of SupportsDelete for the instance +func (instance *__ObjectProviderRegistration) GetPropertySupportsDelete() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsDelete") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsEnumeration sets the value of SupportsEnumeration for the instance +func (instance *__ObjectProviderRegistration) SetPropertySupportsEnumeration(value bool) (err error) { + return instance.SetProperty("SupportsEnumeration", (value)) +} + +// GetSupportsEnumeration gets the value of SupportsEnumeration for the instance +func (instance *__ObjectProviderRegistration) GetPropertySupportsEnumeration() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsEnumeration") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsGet sets the value of SupportsGet for the instance +func (instance *__ObjectProviderRegistration) SetPropertySupportsGet(value bool) (err error) { + return instance.SetProperty("SupportsGet", (value)) +} + +// GetSupportsGet gets the value of SupportsGet for the instance +func (instance *__ObjectProviderRegistration) GetPropertySupportsGet() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsGet") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsPut sets the value of SupportsPut for the instance +func (instance *__ObjectProviderRegistration) SetPropertySupportsPut(value bool) (err error) { + return instance.SetProperty("SupportsPut", (value)) +} + +// GetSupportsPut gets the value of SupportsPut for the instance +func (instance *__ObjectProviderRegistration) GetPropertySupportsPut() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsPut") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsTransactions sets the value of SupportsTransactions for the instance +func (instance *__ObjectProviderRegistration) SetPropertySupportsTransactions(value bool) (err error) { + return instance.SetProperty("SupportsTransactions", (value)) +} + +// GetSupportsTransactions gets the value of SupportsTransactions for the instance +func (instance *__ObjectProviderRegistration) GetPropertySupportsTransactions() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsTransactions") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ObjectProviderRegistration_InteractionType.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ObjectProviderRegistration_InteractionType.go new file mode 100644 index 000000000..8c448fe71 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ObjectProviderRegistration_InteractionType.go @@ -0,0 +1,21 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source ObjectProviderRegistration_InteractionType +////////////////////////////////////////////// +package storage + +// ObjectProviderRegistration_InteractionType +type ObjectProviderRegistration_InteractionType int + +const ( + // Pull enum + ObjectProviderRegistration_InteractionType_Pull ObjectProviderRegistration_InteractionType = 0 + // Push enum + ObjectProviderRegistration_InteractionType_Push ObjectProviderRegistration_InteractionType = 1 + // PushVerify enum + ObjectProviderRegistration_InteractionType_PushVerify ObjectProviderRegistration_InteractionType = 2 +) diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/PARAMETERS.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/PARAMETERS.go new file mode 100644 index 000000000..f83acb6c4 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/PARAMETERS.go @@ -0,0 +1,49 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __PARAMETERS struct +type __PARAMETERS struct { + *cim.WmiInstance +} + +func New__PARAMETERSEx1(instance *cim.WmiInstance) (newInstance *__PARAMETERS, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &__PARAMETERS{ + WmiInstance: tmp, + } + return +} + +func New__PARAMETERSEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__PARAMETERS, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__PARAMETERS{ + WmiInstance: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/PS_StorageCmdlets.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/PS_StorageCmdlets.go new file mode 100644 index 000000000..cf24ee2db --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/PS_StorageCmdlets.go @@ -0,0 +1,551 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// PS_StorageCmdlets struct +type PS_StorageCmdlets struct { + *cim.WmiInstance +} + +func NewPS_StorageCmdletsEx1(instance *cim.WmiInstance) (newInstance *PS_StorageCmdlets, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &PS_StorageCmdlets{ + WmiInstance: tmp, + } + return +} + +func NewPS_StorageCmdletsEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *PS_StorageCmdlets, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &PS_StorageCmdlets{ + WmiInstance: tmp, + } + return +} + +// + +// +// +// +// +// +// +// +// +// + +// +func (instance *PS_StorageCmdlets) SetDisk( /* IN */ InputObject []MSFT_Disk, + /* IN */ UniqueId string, + /* IN */ Path string, + /* IN */ Number uint32, + /* IN */ PartitionStyle uint16, + /* IN */ IsReadOnly bool, + /* IN */ IsOffline bool, + /* IN */ Signature uint32, + /* IN */ Guid string) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetDisk", InputObject, UniqueId, Path, Number, PartitionStyle, IsReadOnly, IsOffline, Signature, Guid) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// +// +// +// + +// +func (instance *PS_StorageCmdlets) SetVolume( /* IN */ InputObject []MSFT_Volume, + /* IN */ UniqueId string, + /* IN */ Path string, + /* IN */ FileSystemLabel string, + /* IN */ DriveLetter byte, + /* IN */ NewFileSystemLabel string, + /* IN */ DedupMode uint32) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetVolume", InputObject, UniqueId, Path, FileSystemLabel, DriveLetter, NewFileSystemLabel, DedupMode) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +// +func (instance *PS_StorageCmdlets) SetPartition( /* IN */ InputObject []MSFT_Partition, + /* IN */ DiskId string, + /* IN */ Offset uint64, + /* IN */ DiskNumber uint32, + /* IN */ PartitionNumber uint32, + /* IN */ DriveLetter byte, + /* IN */ NewDriveLetter byte, + /* IN */ IsOffline bool, + /* IN */ IsReadOnly bool, + /* IN */ NoDefaultDriveLetter bool, + /* IN */ IsActive bool, + /* IN */ IsHidden bool, + /* IN */ IsShadowCopy bool, + /* IN */ IsDAX bool, + /* IN */ MbrType uint16, + /* IN */ GptType string) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetPartition", InputObject, DiskId, Offset, DiskNumber, PartitionNumber, DriveLetter, NewDriveLetter, IsOffline, IsReadOnly, NoDefaultDriveLetter, IsActive, IsHidden, IsShadowCopy, IsDAX, MbrType, GptType) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// +// +// +// +// +// + +// +func (instance *PS_StorageCmdlets) SetPhysicalDisk( /* IN */ InputObject []MSFT_PhysicalDisk, + /* IN */ UniqueId string, + /* IN */ FriendlyName string, + /* IN */ NewFriendlyName string, + /* IN */ Description string, + /* IN */ Usage uint16, + /* IN */ MediaType uint16, + /* IN */ StorageEnclosureId string, + /* IN */ StorageScaleUnitId string) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetPhysicalDisk", InputObject, UniqueId, FriendlyName, NewFriendlyName, Description, Usage, MediaType, StorageEnclosureId, StorageScaleUnitId) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +// +func (instance *PS_StorageCmdlets) SetStoragePool( /* IN */ InputObject []MSFT_StoragePool, + /* IN */ UniqueId string, + /* IN */ Name string, + /* IN */ FriendlyName string, + /* IN */ NewFriendlyName string, + /* IN */ Usage uint16, + /* IN */ OtherUsageDescription string, + /* IN */ ProvisioningTypeDefault uint16, + /* IN */ MediaTypeDefault uint16, + /* IN */ ResiliencySettingNameDefault string, + /* IN */ EnclosureAwareDefault bool, + /* IN */ FaultDomainAwarenessDefault uint16, + /* IN */ WriteCacheSizeDefault uint64, + /* IN */ AutoWriteCacheSize bool, + /* IN */ IsReadOnly bool, + /* IN */ ClearOnDeallocate bool, + /* IN */ IsPowerProtected bool, + /* IN */ RepairPolicy uint16, + /* IN */ RetireMissingPhysicalDisks uint16, + /* IN */ ThinProvisioningAlertThresholds []uint16) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetStoragePool", InputObject, UniqueId, Name, FriendlyName, NewFriendlyName, Usage, OtherUsageDescription, ProvisioningTypeDefault, MediaTypeDefault, ResiliencySettingNameDefault, EnclosureAwareDefault, FaultDomainAwarenessDefault, WriteCacheSizeDefault, AutoWriteCacheSize, IsReadOnly, ClearOnDeallocate, IsPowerProtected, RepairPolicy, RetireMissingPhysicalDisks, ThinProvisioningAlertThresholds) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +// +func (instance *PS_StorageCmdlets) SetVirtualDisk( /* IN */ InputObject []MSFT_VirtualDisk, + /* IN */ UniqueId string, + /* IN */ Name string, + /* IN */ FriendlyName string, + /* IN */ NewFriendlyName string, + /* IN */ Usage uint16, + /* IN */ OtherUsageDescription string, + /* IN */ IsManualAttach bool, + /* IN */ StorageNodeName string, + /* IN */ Access uint16, + /* IN */ ProvisioningType uint16, + /* IN */ AllocationUnitSize uint64, + /* IN */ MediaType uint16, + /* IN */ FaultDomainAwareness uint16, + /* IN */ ColumnIsolation uint16, + /* IN */ ResiliencySettingName string, + /* IN */ PhysicalDiskRedundancy uint16, + /* IN */ NumberOfDataCopies uint16, + /* IN */ NumberOfGroups uint16, + /* IN */ NumberOfColumns uint16, + /* IN */ Interleave uint64) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetVirtualDisk", InputObject, UniqueId, Name, FriendlyName, NewFriendlyName, Usage, OtherUsageDescription, IsManualAttach, StorageNodeName, Access, ProvisioningType, AllocationUnitSize, MediaType, FaultDomainAwareness, ColumnIsolation, ResiliencySettingName, PhysicalDiskRedundancy, NumberOfDataCopies, NumberOfGroups, NumberOfColumns, Interleave) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +// +func (instance *PS_StorageCmdlets) SetStorageTier( /* IN */ InputObject []MSFT_StorageTier, + /* IN */ UniqueId string, + /* IN */ FriendlyName string, + /* IN */ NewFriendlyName string, + /* IN */ ProvisioningType uint16, + /* IN */ AllocationUnitSize uint64, + /* IN */ MediaType uint16, + /* IN */ FaultDomainAwareness uint16, + /* IN */ ColumnIsolation uint16, + /* IN */ ResiliencySettingName string, + /* IN */ Usage uint16, + /* IN */ PhysicalDiskRedundancy uint16, + /* IN */ NumberOfDataCopies uint16, + /* IN */ NumberOfGroups uint16, + /* IN */ NumberOfColumns uint16, + /* IN */ Interleave uint64, + /* IN */ Description string) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetStorageTier", InputObject, UniqueId, FriendlyName, NewFriendlyName, ProvisioningType, AllocationUnitSize, MediaType, FaultDomainAwareness, ColumnIsolation, ResiliencySettingName, Usage, PhysicalDiskRedundancy, NumberOfDataCopies, NumberOfGroups, NumberOfColumns, Interleave, Description) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// +// +// +// + +// +func (instance *PS_StorageCmdlets) SetStorageSubSystem( /* IN */ InputObject []MSFT_StorageSubSystem, + /* IN */ UniqueId string, + /* IN */ Name string, + /* IN */ FriendlyName string, + /* IN */ Description string, + /* IN */ AutomaticClusteringEnabled bool, + /* IN */ FaultDomainAwarenessDefault uint16) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetStorageSubSystem", InputObject, UniqueId, Name, FriendlyName, Description, AutomaticClusteringEnabled, FaultDomainAwarenessDefault) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// + +// +func (instance *PS_StorageCmdlets) AddPhysicalDisk( /* IN */ StoragePool MSFT_StoragePool, + /* IN */ StoragePoolUniqueId string, + /* IN */ StoragePoolName string, + /* IN */ StoragePoolFriendlyName string, + /* IN */ VirtualDisk MSFT_VirtualDisk, + /* IN */ VirtualDiskUniqueId string, + /* IN */ VirtualDiskName string, + /* IN */ VirtualDiskFriendlyName string, + /* IN */ PhysicalDisks []MSFT_PhysicalDisk, + /* IN */ Usage uint16) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("AddPhysicalDisk", StoragePool, StoragePoolUniqueId, StoragePoolName, StoragePoolFriendlyName, VirtualDisk, VirtualDiskUniqueId, VirtualDiskName, VirtualDiskFriendlyName, PhysicalDisks, Usage) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// +// +// +// +// +// + +// +func (instance *PS_StorageCmdlets) RemovePhysicalDisk( /* IN */ StoragePool MSFT_StoragePool, + /* IN */ StoragePoolUniqueId string, + /* IN */ StoragePoolName string, + /* IN */ StoragePoolFriendlyName string, + /* IN */ VirtualDisk MSFT_VirtualDisk, + /* IN */ VirtualDiskUniqueId string, + /* IN */ VirtualDiskName string, + /* IN */ VirtualDiskFriendlyName string, + /* IN */ PhysicalDisks []MSFT_PhysicalDisk) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("RemovePhysicalDisk", StoragePool, StoragePoolUniqueId, StoragePoolName, StoragePoolFriendlyName, VirtualDisk, VirtualDiskUniqueId, VirtualDiskName, VirtualDiskFriendlyName, PhysicalDisks) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +func (instance *PS_StorageCmdlets) LaunchProviderHost( /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("LaunchProviderHost") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +// +// +// + +// +func (instance *PS_StorageCmdlets) SetFileShare( /* IN */ InputObject []MSFT_FileShare, + /* IN */ UniqueId string, + /* IN */ Name string, + /* IN */ Description string, + /* IN */ EncryptData bool) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetFileShare", InputObject, UniqueId, Name, Description, EncryptData) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + +// +// +// +// +func (instance *PS_StorageCmdlets) CreateVolume( /* IN */ StoragePool MSFT_StoragePool, + /* IN */ StoragePoolUniqueId string, + /* IN */ StoragePoolName string, + /* IN */ StoragePoolFriendlyName string, + /* IN */ Disk MSFT_Disk, + /* IN */ DiskNumber uint32, + /* IN */ DiskPath string, + /* IN */ DiskUniqueId string, + /* IN */ FriendlyName string, + /* IN */ Size uint64, + /* IN */ StorageTiers []MSFT_StorageTier, + /* IN */ StorageTierSizes []uint64, + /* IN */ ProvisioningType uint16, + /* IN */ ResiliencySettingName string, + /* IN */ PhysicalDiskRedundancy uint16, + /* IN */ NumberOfColumns uint16, + /* IN */ FileSystem uint16, + /* IN */ AccessPath string, + /* IN */ AllocationUnitSize uint32, + /* IN */ ReadCacheSize uint64, + /* IN */ FileServer MSFT_FileServer, + /* OUT */ CreatedVolume []MSFT_Volume, + /* OPTIONAL IN */ RunAsJob bool, + /* OUT */ CreatedStorageJob MSFT_StorageJob, + /* OUT */ ExtendedStatus MSFT_StorageExtendedStatus) (result uint32, err error) { + retVal, err := instance.InvokeMethod("CreateVolume", StoragePool, StoragePoolUniqueId, StoragePoolName, StoragePoolFriendlyName, Disk, DiskNumber, DiskPath, DiskUniqueId, FriendlyName, Size, StorageTiers, StorageTierSizes, ProvisioningType, ResiliencySettingName, PhysicalDiskRedundancy, NumberOfColumns, FileSystem, AccessPath, AllocationUnitSize, ReadCacheSize, FileServer, RunAsJob) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// + +// +// +func (instance *PS_StorageCmdlets) GetStorageReliabilityCounter( /* IN */ PhysicalDisk MSFT_PhysicalDisk, + /* IN */ Disk MSFT_Disk, + /* OUT */ StorageReliabilityCounter MSFT_StorageReliabilityCounter) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetStorageReliabilityCounter", PhysicalDisk, Disk) + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/PropertyProviderRegistration.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/PropertyProviderRegistration.go new file mode 100644 index 000000000..0b21dbd76 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/PropertyProviderRegistration.go @@ -0,0 +1,110 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __PropertyProviderRegistration struct +type __PropertyProviderRegistration struct { + *__ProviderRegistration + + // + SupportsGet bool + + // + SupportsPut bool +} + +func New__PropertyProviderRegistrationEx1(instance *cim.WmiInstance) (newInstance *__PropertyProviderRegistration, err error) { + tmp, err := New__ProviderRegistrationEx1(instance) + + if err != nil { + return + } + newInstance = &__PropertyProviderRegistration{ + __ProviderRegistration: tmp, + } + return +} + +func New__PropertyProviderRegistrationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__PropertyProviderRegistration, err error) { + tmp, err := New__ProviderRegistrationEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__PropertyProviderRegistration{ + __ProviderRegistration: tmp, + } + return +} + +// SetSupportsGet sets the value of SupportsGet for the instance +func (instance *__PropertyProviderRegistration) SetPropertySupportsGet(value bool) (err error) { + return instance.SetProperty("SupportsGet", (value)) +} + +// GetSupportsGet gets the value of SupportsGet for the instance +func (instance *__PropertyProviderRegistration) GetPropertySupportsGet() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsGet") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsPut sets the value of SupportsPut for the instance +func (instance *__PropertyProviderRegistration) SetPropertySupportsPut(value bool) (err error) { + return instance.SetProperty("SupportsPut", (value)) +} + +// GetSupportsPut gets the value of SupportsPut for the instance +func (instance *__PropertyProviderRegistration) GetPropertySupportsPut() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsPut") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Provider.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Provider.go new file mode 100644 index 000000000..975afcb05 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Provider.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __Provider struct +type __Provider struct { + *__SystemClass + + // + Name string +} + +func New__ProviderEx1(instance *cim.WmiInstance) (newInstance *__Provider, err error) { + tmp, err := New__SystemClassEx1(instance) + + if err != nil { + return + } + newInstance = &__Provider{ + __SystemClass: tmp, + } + return +} + +func New__ProviderEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__Provider, err error) { + tmp, err := New__SystemClassEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__Provider{ + __SystemClass: tmp, + } + return +} + +// SetName sets the value of Name for the instance +func (instance *__Provider) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *__Provider) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ProviderRegistration.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ProviderRegistration.go new file mode 100644 index 000000000..342ae011f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/ProviderRegistration.go @@ -0,0 +1,80 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __ProviderRegistration struct +type __ProviderRegistration struct { + *__SystemClass + + // + provider __Provider +} + +func New__ProviderRegistrationEx1(instance *cim.WmiInstance) (newInstance *__ProviderRegistration, err error) { + tmp, err := New__SystemClassEx1(instance) + + if err != nil { + return + } + newInstance = &__ProviderRegistration{ + __SystemClass: tmp, + } + return +} + +func New__ProviderRegistrationEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__ProviderRegistration, err error) { + tmp, err := New__SystemClassEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__ProviderRegistration{ + __SystemClass: tmp, + } + return +} + +// Setprovider sets the value of provider for the instance +func (instance *__ProviderRegistration) SetPropertyprovider(value __Provider) (err error) { + return instance.SetProperty("provider", (value)) +} + +// Getprovider gets the value of provider for the instance +func (instance *__ProviderRegistration) GetPropertyprovider() (value __Provider, err error) { + retValue, err := instance.GetProperty("provider") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(__Provider) + if !ok { + err = errors.Wrapf(errors.InvalidType, " __Provider is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = __Provider(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/QOSFailureEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/QOSFailureEvent.go new file mode 100644 index 000000000..bbf232ee4 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/QOSFailureEvent.go @@ -0,0 +1,110 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __QOSFailureEvent struct +type __QOSFailureEvent struct { + *__EventDroppedEvent + + // + ErrorCode uint32 + + // + ErrorDescription string +} + +func New__QOSFailureEventEx1(instance *cim.WmiInstance) (newInstance *__QOSFailureEvent, err error) { + tmp, err := New__EventDroppedEventEx1(instance) + + if err != nil { + return + } + newInstance = &__QOSFailureEvent{ + __EventDroppedEvent: tmp, + } + return +} + +func New__QOSFailureEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__QOSFailureEvent, err error) { + tmp, err := New__EventDroppedEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__QOSFailureEvent{ + __EventDroppedEvent: tmp, + } + return +} + +// SetErrorCode sets the value of ErrorCode for the instance +func (instance *__QOSFailureEvent) SetPropertyErrorCode(value uint32) (err error) { + return instance.SetProperty("ErrorCode", (value)) +} + +// GetErrorCode gets the value of ErrorCode for the instance +func (instance *__QOSFailureEvent) GetPropertyErrorCode() (value uint32, err error) { + retValue, err := instance.GetProperty("ErrorCode") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetErrorDescription sets the value of ErrorDescription for the instance +func (instance *__QOSFailureEvent) SetPropertyErrorDescription(value string) (err error) { + return instance.SetProperty("ErrorDescription", (value)) +} + +// GetErrorDescription gets the value of ErrorDescription for the instance +func (instance *__QOSFailureEvent) GetPropertyErrorDescription() (value string, err error) { + retValue, err := instance.GetProperty("ErrorDescription") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SecurityDescriptor.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SecurityDescriptor.go new file mode 100644 index 000000000..f9cc5e5b4 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SecurityDescriptor.go @@ -0,0 +1,232 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __SecurityDescriptor struct +type __SecurityDescriptor struct { + *__SecurityRelatedClass + + // + ControlFlags uint32 + + // + DACL []__ACE + + // + Group __ACE + + // + Owner __ACE + + // + SACL []__ACE + + // + TIME_CREATED uint64 +} + +func New__SecurityDescriptorEx1(instance *cim.WmiInstance) (newInstance *__SecurityDescriptor, err error) { + tmp, err := New__SecurityRelatedClassEx1(instance) + + if err != nil { + return + } + newInstance = &__SecurityDescriptor{ + __SecurityRelatedClass: tmp, + } + return +} + +func New__SecurityDescriptorEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__SecurityDescriptor, err error) { + tmp, err := New__SecurityRelatedClassEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__SecurityDescriptor{ + __SecurityRelatedClass: tmp, + } + return +} + +// SetControlFlags sets the value of ControlFlags for the instance +func (instance *__SecurityDescriptor) SetPropertyControlFlags(value uint32) (err error) { + return instance.SetProperty("ControlFlags", (value)) +} + +// GetControlFlags gets the value of ControlFlags for the instance +func (instance *__SecurityDescriptor) GetPropertyControlFlags() (value uint32, err error) { + retValue, err := instance.GetProperty("ControlFlags") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetDACL sets the value of DACL for the instance +func (instance *__SecurityDescriptor) SetPropertyDACL(value []__ACE) (err error) { + return instance.SetProperty("DACL", (value)) +} + +// GetDACL gets the value of DACL for the instance +func (instance *__SecurityDescriptor) GetPropertyDACL() (value []__ACE, err error) { + retValue, err := instance.GetProperty("DACL") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(__ACE) + if !ok { + err = errors.Wrapf(errors.InvalidType, " __ACE is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, __ACE(valuetmp)) + } + + return +} + +// SetGroup sets the value of Group for the instance +func (instance *__SecurityDescriptor) SetPropertyGroup(value __ACE) (err error) { + return instance.SetProperty("Group", (value)) +} + +// GetGroup gets the value of Group for the instance +func (instance *__SecurityDescriptor) GetPropertyGroup() (value __ACE, err error) { + retValue, err := instance.GetProperty("Group") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(__ACE) + if !ok { + err = errors.Wrapf(errors.InvalidType, " __ACE is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = __ACE(valuetmp) + + return +} + +// SetOwner sets the value of Owner for the instance +func (instance *__SecurityDescriptor) SetPropertyOwner(value __ACE) (err error) { + return instance.SetProperty("Owner", (value)) +} + +// GetOwner gets the value of Owner for the instance +func (instance *__SecurityDescriptor) GetPropertyOwner() (value __ACE, err error) { + retValue, err := instance.GetProperty("Owner") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(__ACE) + if !ok { + err = errors.Wrapf(errors.InvalidType, " __ACE is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = __ACE(valuetmp) + + return +} + +// SetSACL sets the value of SACL for the instance +func (instance *__SecurityDescriptor) SetPropertySACL(value []__ACE) (err error) { + return instance.SetProperty("SACL", (value)) +} + +// GetSACL gets the value of SACL for the instance +func (instance *__SecurityDescriptor) GetPropertySACL() (value []__ACE, err error) { + retValue, err := instance.GetProperty("SACL") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(__ACE) + if !ok { + err = errors.Wrapf(errors.InvalidType, " __ACE is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, __ACE(valuetmp)) + } + + return +} + +// SetTIME_CREATED sets the value of TIME_CREATED for the instance +func (instance *__SecurityDescriptor) SetPropertyTIME_CREATED(value uint64) (err error) { + return instance.SetProperty("TIME_CREATED", (value)) +} + +// GetTIME_CREATED gets the value of TIME_CREATED for the instance +func (instance *__SecurityDescriptor) GetPropertyTIME_CREATED() (value uint64, err error) { + retValue, err := instance.GetProperty("TIME_CREATED") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SecurityRelatedClass.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SecurityRelatedClass.go new file mode 100644 index 000000000..d962defb3 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SecurityRelatedClass.go @@ -0,0 +1,49 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __SecurityRelatedClass struct +type __SecurityRelatedClass struct { + *cim.WmiInstance +} + +func New__SecurityRelatedClassEx1(instance *cim.WmiInstance) (newInstance *__SecurityRelatedClass, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &__SecurityRelatedClass{ + WmiInstance: tmp, + } + return +} + +func New__SecurityRelatedClassEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__SecurityRelatedClass, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__SecurityRelatedClass{ + WmiInstance: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SystemClass.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SystemClass.go new file mode 100644 index 000000000..71d35347f --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SystemClass.go @@ -0,0 +1,49 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __SystemClass struct +type __SystemClass struct { + *cim.WmiInstance +} + +func New__SystemClassEx1(instance *cim.WmiInstance) (newInstance *__SystemClass, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &__SystemClass{ + WmiInstance: tmp, + } + return +} + +func New__SystemClassEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__SystemClass, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__SystemClass{ + WmiInstance: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SystemEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SystemEvent.go new file mode 100644 index 000000000..3a287ff49 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SystemEvent.go @@ -0,0 +1,48 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __SystemEvent struct +type __SystemEvent struct { + *__ExtrinsicEvent +} + +func New__SystemEventEx1(instance *cim.WmiInstance) (newInstance *__SystemEvent, err error) { + tmp, err := New__ExtrinsicEventEx1(instance) + + if err != nil { + return + } + newInstance = &__SystemEvent{ + __ExtrinsicEvent: tmp, + } + return +} + +func New__SystemEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__SystemEvent, err error) { + tmp, err := New__ExtrinsicEventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__SystemEvent{ + __ExtrinsicEvent: tmp, + } + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SystemSecurity.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SystemSecurity.go new file mode 100644 index 000000000..ac4a7eb2b --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/SystemSecurity.go @@ -0,0 +1,154 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/instance" + "github.com/microsoft/wmi/pkg/base/query" + cim "github.com/microsoft/wmi/pkg/wmiinstance" +) + +// __SystemSecurity struct +type __SystemSecurity struct { + *cim.WmiInstance +} + +func New__SystemSecurityEx1(instance *cim.WmiInstance) (newInstance *__SystemSecurity, err error) { + tmp, err := instance, nil + + if err != nil { + return + } + newInstance = &__SystemSecurity{ + WmiInstance: tmp, + } + return +} + +func New__SystemSecurityEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__SystemSecurity, err error) { + tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__SystemSecurity{ + WmiInstance: tmp, + } + return +} + +// + +// +// +func (instance *__SystemSecurity) GetSD( /* OUT */ SD []uint8) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSD") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *__SystemSecurity) GetSecurityDescriptor( /* OUT */ Descriptor __SecurityDescriptor) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetSecurityDescriptor") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// +// +func (instance *__SystemSecurity) Get9XUserList( /* OUT */ ul []__NTLMUser9X) (result uint32, err error) { + retVal, err := instance.InvokeMethod("Get9XUserList") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} + +// + +// + +// +func (instance *__SystemSecurity) SetSD( /* IN */ SD []uint8) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetSD", SD) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// + +// +func (instance *__SystemSecurity) SetSecurityDescriptor( /* IN */ Descriptor __SecurityDescriptor) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("SetSecurityDescriptor", Descriptor) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// + +// +func (instance *__SystemSecurity) Set9XUserList( /* IN */ ul []__NTLMUser9X) (result uint32, err error) { + retVal, err := instance.InvokeMethodWithReturn("Set9XUserList", ul) + if err != nil { + return + } + result = uint32(retVal) + return + +} + +// + +// +// +func (instance *__SystemSecurity) GetCallerAccessRights( /* OUT */ rights int32) (result uint32, err error) { + retVal, err := instance.InvokeMethod("GetCallerAccessRights") + if err != nil { + return + } + retValue := retVal[0].(int32) + result = uint32(retValue) + return + +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/TimerEvent.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/TimerEvent.go new file mode 100644 index 000000000..0727c5a71 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/TimerEvent.go @@ -0,0 +1,110 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __TimerEvent struct +type __TimerEvent struct { + *__Event + + // + NumFirings uint32 + + // + TimerId string +} + +func New__TimerEventEx1(instance *cim.WmiInstance) (newInstance *__TimerEvent, err error) { + tmp, err := New__EventEx1(instance) + + if err != nil { + return + } + newInstance = &__TimerEvent{ + __Event: tmp, + } + return +} + +func New__TimerEventEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__TimerEvent, err error) { + tmp, err := New__EventEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__TimerEvent{ + __Event: tmp, + } + return +} + +// SetNumFirings sets the value of NumFirings for the instance +func (instance *__TimerEvent) SetPropertyNumFirings(value uint32) (err error) { + return instance.SetProperty("NumFirings", (value)) +} + +// GetNumFirings gets the value of NumFirings for the instance +func (instance *__TimerEvent) GetPropertyNumFirings() (value uint32, err error) { + retValue, err := instance.GetProperty("NumFirings") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetTimerId sets the value of TimerId for the instance +func (instance *__TimerEvent) SetPropertyTimerId(value string) (err error) { + return instance.SetProperty("TimerId", (value)) +} + +// GetTimerId gets the value of TimerId for the instance +func (instance *__TimerEvent) GetPropertyTimerId() (value string, err error) { + retValue, err := instance.GetProperty("TimerId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/TimerInstruction.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/TimerInstruction.go new file mode 100644 index 000000000..8e6e47cee --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/TimerInstruction.go @@ -0,0 +1,110 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __TimerInstruction struct +type __TimerInstruction struct { + *__EventGenerator + + // + SkipIfPassed bool + + // + TimerId string +} + +func New__TimerInstructionEx1(instance *cim.WmiInstance) (newInstance *__TimerInstruction, err error) { + tmp, err := New__EventGeneratorEx1(instance) + + if err != nil { + return + } + newInstance = &__TimerInstruction{ + __EventGenerator: tmp, + } + return +} + +func New__TimerInstructionEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__TimerInstruction, err error) { + tmp, err := New__EventGeneratorEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__TimerInstruction{ + __EventGenerator: tmp, + } + return +} + +// SetSkipIfPassed sets the value of SkipIfPassed for the instance +func (instance *__TimerInstruction) SetPropertySkipIfPassed(value bool) (err error) { + return instance.SetProperty("SkipIfPassed", (value)) +} + +// GetSkipIfPassed gets the value of SkipIfPassed for the instance +func (instance *__TimerInstruction) GetPropertySkipIfPassed() (value bool, err error) { + retValue, err := instance.GetProperty("SkipIfPassed") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetTimerId sets the value of TimerId for the instance +func (instance *__TimerInstruction) SetPropertyTimerId(value string) (err error) { + return instance.SetProperty("TimerId", (value)) +} + +// GetTimerId gets the value of TimerId for the instance +func (instance *__TimerInstruction) GetPropertyTimerId() (value string, err error) { + retValue, err := instance.GetProperty("TimerId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/TimerNextFiring.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/TimerNextFiring.go new file mode 100644 index 000000000..1f797ee25 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/TimerNextFiring.go @@ -0,0 +1,110 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __TimerNextFiring struct +type __TimerNextFiring struct { + *__IndicationRelated + + // + NextEvent64BitTime int64 + + // + TimerId string +} + +func New__TimerNextFiringEx1(instance *cim.WmiInstance) (newInstance *__TimerNextFiring, err error) { + tmp, err := New__IndicationRelatedEx1(instance) + + if err != nil { + return + } + newInstance = &__TimerNextFiring{ + __IndicationRelated: tmp, + } + return +} + +func New__TimerNextFiringEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__TimerNextFiring, err error) { + tmp, err := New__IndicationRelatedEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__TimerNextFiring{ + __IndicationRelated: tmp, + } + return +} + +// SetNextEvent64BitTime sets the value of NextEvent64BitTime for the instance +func (instance *__TimerNextFiring) SetPropertyNextEvent64BitTime(value int64) (err error) { + return instance.SetProperty("NextEvent64BitTime", (value)) +} + +// GetNextEvent64BitTime gets the value of NextEvent64BitTime for the instance +func (instance *__TimerNextFiring) GetPropertyNextEvent64BitTime() (value int64, err error) { + retValue, err := instance.GetProperty("NextEvent64BitTime") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(int64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " int64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = int64(valuetmp) + + return +} + +// SetTimerId sets the value of TimerId for the instance +func (instance *__TimerNextFiring) SetPropertyTimerId(value string) (err error) { + return instance.SetProperty("TimerId", (value)) +} + +// GetTimerId gets the value of TimerId for the instance +func (instance *__TimerNextFiring) GetPropertyTimerId() (value string, err error) { + retValue, err := instance.GetProperty("TimerId") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Trustee.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Trustee.go new file mode 100644 index 000000000..092df8cf3 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Trustee.go @@ -0,0 +1,231 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __Trustee struct +type __Trustee struct { + *__SecurityRelatedClass + + // + Domain string + + // + Name string + + // + SID []uint8 + + // + SidLength uint32 + + // + SIDString string + + // + TIME_CREATED uint64 +} + +func New__TrusteeEx1(instance *cim.WmiInstance) (newInstance *__Trustee, err error) { + tmp, err := New__SecurityRelatedClassEx1(instance) + + if err != nil { + return + } + newInstance = &__Trustee{ + __SecurityRelatedClass: tmp, + } + return +} + +func New__TrusteeEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__Trustee, err error) { + tmp, err := New__SecurityRelatedClassEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__Trustee{ + __SecurityRelatedClass: tmp, + } + return +} + +// SetDomain sets the value of Domain for the instance +func (instance *__Trustee) SetPropertyDomain(value string) (err error) { + return instance.SetProperty("Domain", (value)) +} + +// GetDomain gets the value of Domain for the instance +func (instance *__Trustee) GetPropertyDomain() (value string, err error) { + retValue, err := instance.GetProperty("Domain") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetName sets the value of Name for the instance +func (instance *__Trustee) SetPropertyName(value string) (err error) { + return instance.SetProperty("Name", (value)) +} + +// GetName gets the value of Name for the instance +func (instance *__Trustee) GetPropertyName() (value string, err error) { + retValue, err := instance.GetProperty("Name") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSID sets the value of SID for the instance +func (instance *__Trustee) SetPropertySID(value []uint8) (err error) { + return instance.SetProperty("SID", (value)) +} + +// GetSID gets the value of SID for the instance +func (instance *__Trustee) GetPropertySID() (value []uint8, err error) { + retValue, err := instance.GetProperty("SID") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint8) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint8 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint8(valuetmp)) + } + + return +} + +// SetSidLength sets the value of SidLength for the instance +func (instance *__Trustee) SetPropertySidLength(value uint32) (err error) { + return instance.SetProperty("SidLength", (value)) +} + +// GetSidLength gets the value of SidLength for the instance +func (instance *__Trustee) GetPropertySidLength() (value uint32, err error) { + retValue, err := instance.GetProperty("SidLength") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} + +// SetSIDString sets the value of SIDString for the instance +func (instance *__Trustee) SetPropertySIDString(value string) (err error) { + return instance.SetProperty("SIDString", (value)) +} + +// GetSIDString gets the value of SIDString for the instance +func (instance *__Trustee) GetPropertySIDString() (value string, err error) { + retValue, err := instance.GetProperty("SIDString") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetTIME_CREATED sets the value of TIME_CREATED for the instance +func (instance *__Trustee) SetPropertyTIME_CREATED(value uint64) (err error) { + return instance.SetProperty("TIME_CREATED", (value)) +} + +// GetTIME_CREATED gets the value of TIME_CREATED for the instance +func (instance *__Trustee) GetPropertyTIME_CREATED() (value uint64, err error) { + retValue, err := instance.GetProperty("TIME_CREATED") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint64) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint64 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint64(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Win32Provider.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Win32Provider.go new file mode 100644 index 000000000..75cb93642 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Win32Provider.go @@ -0,0 +1,740 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __Win32Provider struct +type __Win32Provider struct { + *__Provider + + // + ClientLoadableCLSID string + + // + CLSID string + + // + Concurrency int32 + + // + DefaultMachineName string + + // + Enabled bool + + // + HostingModel string + + // + ImpersonationLevel Win32Provider_ImpersonationLevel + + // + InitializationReentrancy Win32Provider_InitializationReentrancy + + // + InitializationTimeoutInterval string + + // + InitializeAsAdminFirst bool + + // + OperationTimeoutInterval string + + // + PerLocaleInitialization bool + + // + PerUserInitialization bool + + // + Pure bool + + // + SecurityDescriptor string + + // + SupportsExplicitShutdown bool + + // + SupportsExtendedStatus bool + + // + SupportsQuotas bool + + // + SupportsSendStatus bool + + // + SupportsShutdown bool + + // + SupportsThrottling bool + + // + UnloadTimeout string + + // + Version uint32 +} + +func New__Win32ProviderEx1(instance *cim.WmiInstance) (newInstance *__Win32Provider, err error) { + tmp, err := New__ProviderEx1(instance) + + if err != nil { + return + } + newInstance = &__Win32Provider{ + __Provider: tmp, + } + return +} + +func New__Win32ProviderEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__Win32Provider, err error) { + tmp, err := New__ProviderEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__Win32Provider{ + __Provider: tmp, + } + return +} + +// SetClientLoadableCLSID sets the value of ClientLoadableCLSID for the instance +func (instance *__Win32Provider) SetPropertyClientLoadableCLSID(value string) (err error) { + return instance.SetProperty("ClientLoadableCLSID", (value)) +} + +// GetClientLoadableCLSID gets the value of ClientLoadableCLSID for the instance +func (instance *__Win32Provider) GetPropertyClientLoadableCLSID() (value string, err error) { + retValue, err := instance.GetProperty("ClientLoadableCLSID") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetCLSID sets the value of CLSID for the instance +func (instance *__Win32Provider) SetPropertyCLSID(value string) (err error) { + return instance.SetProperty("CLSID", (value)) +} + +// GetCLSID gets the value of CLSID for the instance +func (instance *__Win32Provider) GetPropertyCLSID() (value string, err error) { + retValue, err := instance.GetProperty("CLSID") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetConcurrency sets the value of Concurrency for the instance +func (instance *__Win32Provider) SetPropertyConcurrency(value int32) (err error) { + return instance.SetProperty("Concurrency", (value)) +} + +// GetConcurrency gets the value of Concurrency for the instance +func (instance *__Win32Provider) GetPropertyConcurrency() (value int32, err error) { + retValue, err := instance.GetProperty("Concurrency") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(int32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " int32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = int32(valuetmp) + + return +} + +// SetDefaultMachineName sets the value of DefaultMachineName for the instance +func (instance *__Win32Provider) SetPropertyDefaultMachineName(value string) (err error) { + return instance.SetProperty("DefaultMachineName", (value)) +} + +// GetDefaultMachineName gets the value of DefaultMachineName for the instance +func (instance *__Win32Provider) GetPropertyDefaultMachineName() (value string, err error) { + retValue, err := instance.GetProperty("DefaultMachineName") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetEnabled sets the value of Enabled for the instance +func (instance *__Win32Provider) SetPropertyEnabled(value bool) (err error) { + return instance.SetProperty("Enabled", (value)) +} + +// GetEnabled gets the value of Enabled for the instance +func (instance *__Win32Provider) GetPropertyEnabled() (value bool, err error) { + retValue, err := instance.GetProperty("Enabled") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetHostingModel sets the value of HostingModel for the instance +func (instance *__Win32Provider) SetPropertyHostingModel(value string) (err error) { + return instance.SetProperty("HostingModel", (value)) +} + +// GetHostingModel gets the value of HostingModel for the instance +func (instance *__Win32Provider) GetPropertyHostingModel() (value string, err error) { + retValue, err := instance.GetProperty("HostingModel") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetImpersonationLevel sets the value of ImpersonationLevel for the instance +func (instance *__Win32Provider) SetPropertyImpersonationLevel(value Win32Provider_ImpersonationLevel) (err error) { + return instance.SetProperty("ImpersonationLevel", (value)) +} + +// GetImpersonationLevel gets the value of ImpersonationLevel for the instance +func (instance *__Win32Provider) GetPropertyImpersonationLevel() (value Win32Provider_ImpersonationLevel, err error) { + retValue, err := instance.GetProperty("ImpersonationLevel") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(int32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " int32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = Win32Provider_ImpersonationLevel(valuetmp) + + return +} + +// SetInitializationReentrancy sets the value of InitializationReentrancy for the instance +func (instance *__Win32Provider) SetPropertyInitializationReentrancy(value Win32Provider_InitializationReentrancy) (err error) { + return instance.SetProperty("InitializationReentrancy", (value)) +} + +// GetInitializationReentrancy gets the value of InitializationReentrancy for the instance +func (instance *__Win32Provider) GetPropertyInitializationReentrancy() (value Win32Provider_InitializationReentrancy, err error) { + retValue, err := instance.GetProperty("InitializationReentrancy") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(int32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " int32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = Win32Provider_InitializationReentrancy(valuetmp) + + return +} + +// SetInitializationTimeoutInterval sets the value of InitializationTimeoutInterval for the instance +func (instance *__Win32Provider) SetPropertyInitializationTimeoutInterval(value string) (err error) { + return instance.SetProperty("InitializationTimeoutInterval", (value)) +} + +// GetInitializationTimeoutInterval gets the value of InitializationTimeoutInterval for the instance +func (instance *__Win32Provider) GetPropertyInitializationTimeoutInterval() (value string, err error) { + retValue, err := instance.GetProperty("InitializationTimeoutInterval") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetInitializeAsAdminFirst sets the value of InitializeAsAdminFirst for the instance +func (instance *__Win32Provider) SetPropertyInitializeAsAdminFirst(value bool) (err error) { + return instance.SetProperty("InitializeAsAdminFirst", (value)) +} + +// GetInitializeAsAdminFirst gets the value of InitializeAsAdminFirst for the instance +func (instance *__Win32Provider) GetPropertyInitializeAsAdminFirst() (value bool, err error) { + retValue, err := instance.GetProperty("InitializeAsAdminFirst") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetOperationTimeoutInterval sets the value of OperationTimeoutInterval for the instance +func (instance *__Win32Provider) SetPropertyOperationTimeoutInterval(value string) (err error) { + return instance.SetProperty("OperationTimeoutInterval", (value)) +} + +// GetOperationTimeoutInterval gets the value of OperationTimeoutInterval for the instance +func (instance *__Win32Provider) GetPropertyOperationTimeoutInterval() (value string, err error) { + retValue, err := instance.GetProperty("OperationTimeoutInterval") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetPerLocaleInitialization sets the value of PerLocaleInitialization for the instance +func (instance *__Win32Provider) SetPropertyPerLocaleInitialization(value bool) (err error) { + return instance.SetProperty("PerLocaleInitialization", (value)) +} + +// GetPerLocaleInitialization gets the value of PerLocaleInitialization for the instance +func (instance *__Win32Provider) GetPropertyPerLocaleInitialization() (value bool, err error) { + retValue, err := instance.GetProperty("PerLocaleInitialization") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetPerUserInitialization sets the value of PerUserInitialization for the instance +func (instance *__Win32Provider) SetPropertyPerUserInitialization(value bool) (err error) { + return instance.SetProperty("PerUserInitialization", (value)) +} + +// GetPerUserInitialization gets the value of PerUserInitialization for the instance +func (instance *__Win32Provider) GetPropertyPerUserInitialization() (value bool, err error) { + retValue, err := instance.GetProperty("PerUserInitialization") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetPure sets the value of Pure for the instance +func (instance *__Win32Provider) SetPropertyPure(value bool) (err error) { + return instance.SetProperty("Pure", (value)) +} + +// GetPure gets the value of Pure for the instance +func (instance *__Win32Provider) GetPropertyPure() (value bool, err error) { + retValue, err := instance.GetProperty("Pure") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSecurityDescriptor sets the value of SecurityDescriptor for the instance +func (instance *__Win32Provider) SetPropertySecurityDescriptor(value string) (err error) { + return instance.SetProperty("SecurityDescriptor", (value)) +} + +// GetSecurityDescriptor gets the value of SecurityDescriptor for the instance +func (instance *__Win32Provider) GetPropertySecurityDescriptor() (value string, err error) { + retValue, err := instance.GetProperty("SecurityDescriptor") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetSupportsExplicitShutdown sets the value of SupportsExplicitShutdown for the instance +func (instance *__Win32Provider) SetPropertySupportsExplicitShutdown(value bool) (err error) { + return instance.SetProperty("SupportsExplicitShutdown", (value)) +} + +// GetSupportsExplicitShutdown gets the value of SupportsExplicitShutdown for the instance +func (instance *__Win32Provider) GetPropertySupportsExplicitShutdown() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsExplicitShutdown") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsExtendedStatus sets the value of SupportsExtendedStatus for the instance +func (instance *__Win32Provider) SetPropertySupportsExtendedStatus(value bool) (err error) { + return instance.SetProperty("SupportsExtendedStatus", (value)) +} + +// GetSupportsExtendedStatus gets the value of SupportsExtendedStatus for the instance +func (instance *__Win32Provider) GetPropertySupportsExtendedStatus() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsExtendedStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsQuotas sets the value of SupportsQuotas for the instance +func (instance *__Win32Provider) SetPropertySupportsQuotas(value bool) (err error) { + return instance.SetProperty("SupportsQuotas", (value)) +} + +// GetSupportsQuotas gets the value of SupportsQuotas for the instance +func (instance *__Win32Provider) GetPropertySupportsQuotas() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsQuotas") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsSendStatus sets the value of SupportsSendStatus for the instance +func (instance *__Win32Provider) SetPropertySupportsSendStatus(value bool) (err error) { + return instance.SetProperty("SupportsSendStatus", (value)) +} + +// GetSupportsSendStatus gets the value of SupportsSendStatus for the instance +func (instance *__Win32Provider) GetPropertySupportsSendStatus() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsSendStatus") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsShutdown sets the value of SupportsShutdown for the instance +func (instance *__Win32Provider) SetPropertySupportsShutdown(value bool) (err error) { + return instance.SetProperty("SupportsShutdown", (value)) +} + +// GetSupportsShutdown gets the value of SupportsShutdown for the instance +func (instance *__Win32Provider) GetPropertySupportsShutdown() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsShutdown") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetSupportsThrottling sets the value of SupportsThrottling for the instance +func (instance *__Win32Provider) SetPropertySupportsThrottling(value bool) (err error) { + return instance.SetProperty("SupportsThrottling", (value)) +} + +// GetSupportsThrottling gets the value of SupportsThrottling for the instance +func (instance *__Win32Provider) GetPropertySupportsThrottling() (value bool, err error) { + retValue, err := instance.GetProperty("SupportsThrottling") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(bool) + if !ok { + err = errors.Wrapf(errors.InvalidType, " bool is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = bool(valuetmp) + + return +} + +// SetUnloadTimeout sets the value of UnloadTimeout for the instance +func (instance *__Win32Provider) SetPropertyUnloadTimeout(value string) (err error) { + return instance.SetProperty("UnloadTimeout", (value)) +} + +// GetUnloadTimeout gets the value of UnloadTimeout for the instance +func (instance *__Win32Provider) GetPropertyUnloadTimeout() (value string, err error) { + retValue, err := instance.GetProperty("UnloadTimeout") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(string) + if !ok { + err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = string(valuetmp) + + return +} + +// SetVersion sets the value of Version for the instance +func (instance *__Win32Provider) SetPropertyVersion(value uint32) (err error) { + return instance.SetProperty("Version", (value)) +} + +// GetVersion gets the value of Version for the instance +func (instance *__Win32Provider) GetPropertyVersion() (value uint32, err error) { + retValue, err := instance.GetProperty("Version") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + valuetmp, ok := retValue.(uint32) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue)) + return + } + + value = uint32(valuetmp) + + return +} diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Win32Provider_ImpersonationLevel.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Win32Provider_ImpersonationLevel.go new file mode 100644 index 000000000..9ba78c006 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Win32Provider_ImpersonationLevel.go @@ -0,0 +1,17 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source Win32Provider_ImpersonationLevel +////////////////////////////////////////////// +package storage + +// Win32Provider_ImpersonationLevel +type Win32Provider_ImpersonationLevel int + +const ( + // None enum + Win32Provider_ImpersonationLevel_None Win32Provider_ImpersonationLevel = 0 +) diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Win32Provider_InitializationReentrancy.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Win32Provider_InitializationReentrancy.go new file mode 100644 index 000000000..a480eb22b --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/Win32Provider_InitializationReentrancy.go @@ -0,0 +1,21 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source Win32Provider_InitializationReentrancy +////////////////////////////////////////////// +package storage + +// Win32Provider_InitializationReentrancy +type Win32Provider_InitializationReentrancy int + +const ( + // CLSID enum + Win32Provider_InitializationReentrancy_CLSID Win32Provider_InitializationReentrancy = 0 + // Namespace enum + Win32Provider_InitializationReentrancy_Namespace Win32Provider_InitializationReentrancy = 1 + // COM_Object enum + Win32Provider_InitializationReentrancy_COM_Object Win32Provider_InitializationReentrancy = 2 +) diff --git a/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/thisNAMESPACE.go b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/thisNAMESPACE.go new file mode 100644 index 000000000..62e850af2 --- /dev/null +++ b/vendor/github.com/microsoft/wmi/server2019/root/microsoft/windows/storage/thisNAMESPACE.go @@ -0,0 +1,81 @@ +// Copyright 2019 (c) Microsoft Corporation. +// Licensed under the MIT license. + +// +// Author: +// Auto Generated on 9/18/2020 using wmigen +// Source root.Microsoft.Windows.Storage +////////////////////////////////////////////// +package storage + +import ( + "github.com/microsoft/wmi/pkg/base/query" + "github.com/microsoft/wmi/pkg/errors" + cim "github.com/microsoft/wmi/pkg/wmiinstance" + "reflect" +) + +// __thisNAMESPACE struct +type __thisNAMESPACE struct { + *__SystemClass + + // + SECURITY_DESCRIPTOR []uint8 +} + +func New__thisNAMESPACEEx1(instance *cim.WmiInstance) (newInstance *__thisNAMESPACE, err error) { + tmp, err := New__SystemClassEx1(instance) + + if err != nil { + return + } + newInstance = &__thisNAMESPACE{ + __SystemClass: tmp, + } + return +} + +func New__thisNAMESPACEEx6(hostName string, + wmiNamespace string, + userName string, + password string, + domainName string, + query *query.WmiQuery) (newInstance *__thisNAMESPACE, err error) { + tmp, err := New__SystemClassEx6(hostName, wmiNamespace, userName, password, domainName, query) + + if err != nil { + return + } + newInstance = &__thisNAMESPACE{ + __SystemClass: tmp, + } + return +} + +// SetSECURITY_DESCRIPTOR sets the value of SECURITY_DESCRIPTOR for the instance +func (instance *__thisNAMESPACE) SetPropertySECURITY_DESCRIPTOR(value []uint8) (err error) { + return instance.SetProperty("SECURITY_DESCRIPTOR", (value)) +} + +// GetSECURITY_DESCRIPTOR gets the value of SECURITY_DESCRIPTOR for the instance +func (instance *__thisNAMESPACE) GetPropertySECURITY_DESCRIPTOR() (value []uint8, err error) { + retValue, err := instance.GetProperty("SECURITY_DESCRIPTOR") + if err != nil { + return + } + if retValue == nil { + // Doesn't have any value. Return empty + return + } + + for _, interfaceValue := range retValue.([]interface{}) { + valuetmp, ok := interfaceValue.(uint8) + if !ok { + err = errors.Wrapf(errors.InvalidType, " uint8 is Invalid. Expected %s", reflect.TypeOf(interfaceValue)) + return + } + value = append(value, uint8(valuetmp)) + } + + return +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 3498ca691..a4ca34793 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -20,6 +20,10 @@ github.com/davecgh/go-spew/spew # github.com/go-logr/logr v1.4.2 ## explicit; go 1.18 github.com/go-logr/logr +# github.com/go-ole/go-ole v1.3.0 +## explicit; go 1.12 +github.com/go-ole/go-ole +github.com/go-ole/go-ole/oleutil # github.com/golang/protobuf v1.5.4 ## explicit; go 1.17 github.com/golang/protobuf/proto @@ -98,6 +102,17 @@ github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta1 github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta2 github.com/kubernetes-csi/csi-proxy/client/groups/volume/v1beta3 github.com/kubernetes-csi/csi-proxy/client/groups/volume/v2alpha1 +# github.com/microsoft/wmi v0.25.1 +## explicit; go 1.22 +github.com/microsoft/wmi/go/wmi +github.com/microsoft/wmi/pkg/base/credential +github.com/microsoft/wmi/pkg/base/host +github.com/microsoft/wmi/pkg/base/instance +github.com/microsoft/wmi/pkg/base/query +github.com/microsoft/wmi/pkg/base/session +github.com/microsoft/wmi/pkg/errors +github.com/microsoft/wmi/pkg/wmiinstance +github.com/microsoft/wmi/server2019/root/microsoft/windows/storage # github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 ## explicit github.com/munnerz/goautoneg