diff --git a/.github/linters/.markdown-lint.yml b/.github/linters/.markdown-lint.yml
index df1b1a2825e..5e8d65905eb 100644
--- a/.github/linters/.markdown-lint.yml
+++ b/.github/linters/.markdown-lint.yml
@@ -27,27 +27,15 @@ MD004: false
# MD007/ul-indent Unordered list indentation
MD007: false
-# MD009/no-trailing-spaces Trailing spaces
-MD009: false
-
# MD010/no-hard-tabs Hard tabs
MD010: false
-# MD012/no-multiple-blanks Multiple consecutive blank lines
-MD012: false
-
# MD013/line-length Line length
MD013: false
# MD014/commands-show-output Dollar signs used before commands without showing output
MD014: false
-# MD018/no-missing-space-atx No space after hash on atx style heading
-MD018: false
-
-# MD019/no-multiple-space-atx Multiple spaces after hash on atx style heading
-MD019: false
-
# MD022/blanks-around-headings Headings should be surrounded by blank lines
MD022: false
diff --git a/.gitignore b/.gitignore
index 648b93b0696..abaef83e455 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,9 +5,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index e8f3c6093a9..803f182f3b8 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -34,7 +34,7 @@ repos:
- id: check-merge-conflict
- id: check-symlinks
- id: check-vcs-permalinks
- #- id: check-yaml
+ - id: check-yaml
- id: destroyed-symlinks
- id: detect-aws-credentials
args: [--allow-missing-credentials]
@@ -59,7 +59,7 @@ repos:
- id: mixed-line-ending
exclude: \.(cs|xml)$
- id: trailing-whitespace
- files: \.(header|in|java|md|properties|py|rb|sh|sql|txt|vue|xml|yaml|yml)$
+ files: \.(cs|bat|css|gitignore|header|in|install|java|md|properties|py|rb|sh|sql|txt|vue|xml|xsl|yaml|yml)$
args: [--markdown-linebreak-ext=md]
exclude: ^services/console-proxy/rdpconsole/src/test/doc/freerdp-debug-log\.txt$
- repo: https://github.com/codespell-project/codespell
@@ -87,7 +87,7 @@ repos:
^setup/bindir/cloud-setup-encryption\.in$|
^venv/.*$
- repo: https://github.com/igorshubovych/markdownlint-cli
- rev: v0.40.0
+ rev: v0.43.0
hooks:
- id: markdownlint
name: run markdownlint
diff --git a/CHANGES.md b/CHANGES.md
index 9544fc014c7..8fea4f3a355 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -242,7 +242,6 @@ Bug ID | Description
[CLOUDSTACK-7722](https://issues.apache.org/jira/browse/CLOUDSTACK-7722) | add.label: Add button for tags show the label not "Add" text...
[CLOUDSTACK-7246](https://issues.apache.org/jira/browse/CLOUDSTACK-7246) | VM deployment failed due to wrong in script name createipalias.sh...
-
Version 4.4.1
-------------
@@ -276,7 +275,6 @@ Bug ID | Description
[CLOUDSTACK-1632](https://issues.apache.org/jira/browse/CLOUDSTACK-1632) | Mistakes in authorizeSecurityGroup* API docs...
[CLOUDSTACK-401](https://issues.apache.org/jira/browse/CLOUDSTACK-401) | Storage options missing from table...
-
Version 4.4.0
-------------
@@ -930,7 +928,6 @@ Security Fixes:
* CVE-2012-4501: Apache CloudStack configuration vulnerability
-
Version 4.0.2
------------------------
@@ -979,7 +976,6 @@ Issues fixed in this release:
* CLOUDSTACK-2090: Upgrade from version 4.0.1 to version 4.0.2 triggers the 4.0.0 to 4.0.1.
* CLOUDSTACK-2091: Error in API documentation for 4.0.x.
-
Version 4.0.1-incubating
------------------------
@@ -1023,7 +1019,6 @@ Bugs fixed in this release:
* CLOUDSTACK-961: Installation docs don't detail dependencies for building RPMs
* CLOUDSTACK-995: Not able to add the KVM host
-
Version 4.0.0-incubating
------------------------
@@ -1056,7 +1051,6 @@ Security Fixes:
* CVE-2012-4501: Apache CloudStack configuration vulnerability
-
Updating this file
------------------
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index bb84e4e91fb..a6d006938f3 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -51,11 +51,9 @@ $ git fetch upstream
$ git rebase upstream/main
```
-
Making changes
--------------
-
It is important that you create a new branch to make changes on and that you do not change the `main` branch (other than to rebase in changes from `upstream/main`). In this example I will assume you will be making your changes to a branch called `feature_x`. This `feature_x` branch will be created on your local repository and will be pushed to your forked repository on GitHub. Once this branch is on your fork you will create a Pull Request for the changes to be added to the ACS project.
It is best practice to create a new branch each time you want to contribute to the project and only track the changes for that pull request in this branch.
@@ -70,7 +68,6 @@ $ git commit -a -m "descriptive commit message for your changes"
> The `-b` specifies that you want to create a new branch called `feature_x`. You only specify `-b` the first time you checkout because you are creating a new branch. Once the `feature_x` branch exists, you can later switch to it with only `git checkout feature_x`.
-
Rebase `feature_x` to include updates from `upstream/main`
------------------------------------------------------------
@@ -92,7 +89,6 @@ $ git rebase main
> Now your `feature_x` branch is up-to-date with all the code in `upstream/main`.
-
Make a GitHub Pull Request to contribute your changes
-----------------------------------------------------
@@ -107,7 +103,7 @@ $ git push origin main
$ git push origin feature_x
```
-Now that the `feature_x` branch has been pushed to your GitHub repository, you can initiate the pull request.
+Now that the `feature_x` branch has been pushed to your GitHub repository, you can initiate the pull request.
To initiate the pull request, do the following:
@@ -118,7 +114,6 @@ To initiate the pull request, do the following:
If you are requested to make modifications to your proposed changes, make the changes locally on your `feature_x` branch, re-push the `feature_x` branch to your fork. The existing pull request should automatically pick up the change and update accordingly.
-
Cleaning up after a successful pull request
-------------------------------------------
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
index 85c1ac9ec6a..4a48a4e7591 100644
--- a/ISSUE_TEMPLATE.md
+++ b/ISSUE_TEMPLATE.md
@@ -35,17 +35,14 @@ New line separated list of affected versions, commit ID for issues on main branc
Information about the configuration if relevant, e.g. basic network, advanced networking, etc. N/A otherwise
-->
-
##### OS / ENVIRONMENT
-
##### SUMMARY
-
##### STEPS TO REPRODUCE
@@ -53,5 +51,4 @@ This PR...
-
diff --git a/README.md b/README.md
index f66a4dc6f97..cc71c848d5d 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Apache CloudStack [](https://github.com/apache/cloudstack/actions/workflows/build.yml) [](https://github.com/apache/cloudstack/actions/workflows/ui.yml) [](https://github.com/apache/cloudstack/actions/workflows/rat.yml) [](https://github.com/apache/cloudstack/actions/workflows/ci.yml) [](https://sonarcloud.io/dashboard?id=apache_cloudstack) [](https://codecov.io/gh/apache/cloudstack)
-[](https://cloudstack.apache.org/)
+[](https://cloudstack.apache.org/)
Apache CloudStack is open source software designed to deploy and manage large
networks of virtual machines, as a highly available, highly scalable
diff --git a/agent/pom.xml b/agent/pom.xml
index 9caa6d992c8..76c37cd87be 100644
--- a/agent/pom.xml
+++ b/agent/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
diff --git a/agent/src/main/java/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java b/agent/src/main/java/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
index ccd0d976e58..26f9d4b3d73 100644
--- a/agent/src/main/java/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
+++ b/agent/src/main/java/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java
@@ -397,9 +397,8 @@ public class ConsoleProxyResource extends ServerResourceBase implements ServerRe
}
public String authenticateConsoleAccess(String host, String port, String vmId, String sid, String ticket,
- Boolean isReauthentication, String sessionToken) {
-
- ConsoleAccessAuthenticationCommand cmd = new ConsoleAccessAuthenticationCommand(host, port, vmId, sid, ticket, sessionToken);
+ Boolean isReauthentication, String sessionToken, String clientAddress) {
+ ConsoleAccessAuthenticationCommand cmd = new ConsoleAccessAuthenticationCommand(host, port, vmId, sid, ticket, sessionToken, clientAddress);
cmd.setReauthenticating(isReauthentication);
ConsoleProxyAuthenticationResult result = new ConsoleProxyAuthenticationResult();
diff --git a/api/pom.xml b/api/pom.xml
index 32897725e0c..ec68e24c7e5 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
diff --git a/api/src/main/java/com/cloud/agent/api/to/PortForwardingRuleTO.java b/api/src/main/java/com/cloud/agent/api/to/PortForwardingRuleTO.java
index 76d6d952814..d43625c09a9 100644
--- a/api/src/main/java/com/cloud/agent/api/to/PortForwardingRuleTO.java
+++ b/api/src/main/java/com/cloud/agent/api/to/PortForwardingRuleTO.java
@@ -19,6 +19,9 @@ package com.cloud.agent.api.to;
import com.cloud.network.rules.FirewallRule;
import com.cloud.network.rules.PortForwardingRule;
import com.cloud.utils.net.NetUtils;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.List;
/**
* PortForwardingRuleTO specifies one port forwarding rule.
@@ -29,6 +32,8 @@ public class PortForwardingRuleTO extends FirewallRuleTO {
String dstIp;
int[] dstPortRange;
+ List sourceCidrList;
+
protected PortForwardingRuleTO() {
super();
}
@@ -37,6 +42,7 @@ public class PortForwardingRuleTO extends FirewallRuleTO {
super(rule, srcVlanTag, srcIp);
this.dstIp = rule.getDestinationIpAddress().addr();
this.dstPortRange = new int[] {rule.getDestinationPortStart(), rule.getDestinationPortEnd()};
+ this.sourceCidrList = rule.getSourceCidrList();
}
public PortForwardingRuleTO(long id, String srcIp, int srcPortStart, int srcPortEnd, String dstIp, int dstPortStart, int dstPortEnd, String protocol,
@@ -58,4 +64,11 @@ public class PortForwardingRuleTO extends FirewallRuleTO {
return NetUtils.portRangeToString(dstPortRange);
}
+ public String getSourceCidrListAsString() {
+ if (sourceCidrList != null) {
+ return StringUtils.join(sourceCidrList, ",");
+ }
+ return null;
+ }
+
}
diff --git a/api/src/main/java/com/cloud/bgp/BGPService.java b/api/src/main/java/com/cloud/bgp/BGPService.java
index 935237092dd..61d149f2847 100644
--- a/api/src/main/java/com/cloud/bgp/BGPService.java
+++ b/api/src/main/java/com/cloud/bgp/BGPService.java
@@ -21,6 +21,7 @@ import com.cloud.network.Network;
import com.cloud.network.vpc.Vpc;
import com.cloud.utils.Pair;
import org.apache.cloudstack.api.command.user.bgp.ListASNumbersCmd;
+import org.apache.cloudstack.network.BgpPeer;
import java.util.List;
@@ -36,4 +37,8 @@ public interface BGPService {
boolean applyBgpPeers(Network network, boolean continueOnError) throws ResourceUnavailableException;
boolean applyBgpPeers(Vpc vpc, boolean continueOnError) throws ResourceUnavailableException;
+
+ List extends BgpPeer> getBgpPeersForNetwork(Network network);
+
+ List extends BgpPeer> getBgpPeersForVpc(Vpc vpc);
}
diff --git a/api/src/main/java/com/cloud/event/EventTypes.java b/api/src/main/java/com/cloud/event/EventTypes.java
index 5e5309965c1..81ed185dae5 100644
--- a/api/src/main/java/com/cloud/event/EventTypes.java
+++ b/api/src/main/java/com/cloud/event/EventTypes.java
@@ -292,6 +292,7 @@ public class EventTypes {
//register for user API and secret keys
public static final String EVENT_REGISTER_FOR_SECRET_API_KEY = "REGISTER.USER.KEY";
+ public static final String API_KEY_ACCESS_UPDATE = "API.KEY.ACCESS.UPDATE";
// Template Events
public static final String EVENT_TEMPLATE_CREATE = "TEMPLATE.CREATE";
diff --git a/api/src/main/java/com/cloud/hypervisor/Hypervisor.java b/api/src/main/java/com/cloud/hypervisor/Hypervisor.java
index e1108b34a83..27ffef1c370 100644
--- a/api/src/main/java/com/cloud/hypervisor/Hypervisor.java
+++ b/api/src/main/java/com/cloud/hypervisor/Hypervisor.java
@@ -20,37 +20,57 @@ import com.cloud.storage.Storage.ImageFormat;
import org.apache.commons.lang3.StringUtils;
import java.util.LinkedHashMap;
+import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
+import java.util.Set;
+import java.util.EnumSet;
+import java.util.stream.Collectors;
+
+import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.DirectDownloadTemplate;
+import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.RootDiskSizeOverride;
+import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.VmStorageMigration;
public class Hypervisor {
public static class HypervisorType {
+ public enum Functionality {
+ DirectDownloadTemplate,
+ RootDiskSizeOverride,
+ VmStorageMigration
+ }
+
private static final Map hypervisorTypeMap = new LinkedHashMap<>();
public static final HypervisorType None = new HypervisorType("None"); //for storage hosts
- public static final HypervisorType XenServer = new HypervisorType("XenServer", ImageFormat.VHD);
- public static final HypervisorType KVM = new HypervisorType("KVM", ImageFormat.QCOW2);
- public static final HypervisorType VMware = new HypervisorType("VMware", ImageFormat.OVA);
+ public static final HypervisorType XenServer = new HypervisorType("XenServer", ImageFormat.VHD, EnumSet.of(RootDiskSizeOverride, VmStorageMigration));
+ public static final HypervisorType KVM = new HypervisorType("KVM", ImageFormat.QCOW2, EnumSet.of(DirectDownloadTemplate, RootDiskSizeOverride, VmStorageMigration));
+ public static final HypervisorType VMware = new HypervisorType("VMware", ImageFormat.OVA, EnumSet.of(RootDiskSizeOverride, VmStorageMigration));
public static final HypervisorType Hyperv = new HypervisorType("Hyperv");
public static final HypervisorType VirtualBox = new HypervisorType("VirtualBox");
public static final HypervisorType Parralels = new HypervisorType("Parralels");
public static final HypervisorType BareMetal = new HypervisorType("BareMetal");
- public static final HypervisorType Simulator = new HypervisorType("Simulator");
+ public static final HypervisorType Simulator = new HypervisorType("Simulator", null, EnumSet.of(RootDiskSizeOverride, VmStorageMigration));
public static final HypervisorType Ovm = new HypervisorType("Ovm", ImageFormat.RAW);
public static final HypervisorType Ovm3 = new HypervisorType("Ovm3", ImageFormat.RAW);
public static final HypervisorType LXC = new HypervisorType("LXC");
- public static final HypervisorType Custom = new HypervisorType("Custom");
+ public static final HypervisorType Custom = new HypervisorType("Custom", null, EnumSet.of(RootDiskSizeOverride));
public static final HypervisorType Any = new HypervisorType("Any"); /*If you don't care about the hypervisor type*/
private final String name;
private final ImageFormat imageFormat;
+ private final Set supportedFunctionalities;
public HypervisorType(String name) {
- this(name, null);
+ this(name, null, EnumSet.noneOf(Functionality.class));
}
public HypervisorType(String name, ImageFormat imageFormat) {
+ this(name, imageFormat, EnumSet.noneOf(Functionality.class));
+ }
+
+ public HypervisorType(String name, ImageFormat imageFormat, Set supportedFunctionalities) {
this.name = name;
this.imageFormat = imageFormat;
+ this.supportedFunctionalities = supportedFunctionalities;
if (name.equals("Parralels")){ // typo in the original code
hypervisorTypeMap.put("parallels", this);
} else {
@@ -81,6 +101,12 @@ public class Hypervisor {
return hypervisorType;
}
+ public static List getListOfHypervisorsSupportingFunctionality(Functionality functionality) {
+ return hypervisorTypeMap.values().stream()
+ .filter(hypervisor -> hypervisor.supportedFunctionalities.contains(functionality))
+ .collect(Collectors.toList());
+ }
+
/**
* Returns the display name of a hypervisor type in case the custom hypervisor is used,
* using the 'hypervisor.custom.display.name' setting. Otherwise, returns hypervisor name
@@ -102,6 +128,15 @@ public class Hypervisor {
return name;
}
+ /**
+ * Make this method to be part of the properties of the hypervisor type itself.
+ *
+ * @return true if the hypervisor plugin support the specified functionality
+ */
+ public boolean isFunctionalitySupported(Functionality functionality) {
+ return supportedFunctionalities.contains(functionality);
+ }
+
@Override
public int hashCode() {
return Objects.hash(name);
diff --git a/api/src/main/java/com/cloud/network/rules/RulesService.java b/api/src/main/java/com/cloud/network/rules/RulesService.java
index 0b4afeef945..547d4ab51e0 100644
--- a/api/src/main/java/com/cloud/network/rules/RulesService.java
+++ b/api/src/main/java/com/cloud/network/rules/RulesService.java
@@ -26,6 +26,7 @@ import com.cloud.exception.ResourceUnavailableException;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
import com.cloud.utils.net.Ip;
+import org.apache.cloudstack.api.command.user.firewall.UpdatePortForwardingRuleCmd;
public interface RulesService {
Pair, Integer> searchStaticNatRules(Long ipId, Long id, Long vmId, Long start, Long size, String accountName, Long domainId,
@@ -81,6 +82,8 @@ public interface RulesService {
boolean disableStaticNat(long ipId) throws ResourceUnavailableException, NetworkRuleConflictException, InsufficientAddressCapacityException;
- PortForwardingRule updatePortForwardingRule(long id, Integer privatePort, Integer privateEndPort, Long virtualMachineId, Ip vmGuestIp, String customId, Boolean forDisplay);
+ PortForwardingRule updatePortForwardingRule(UpdatePortForwardingRuleCmd cmd);
+
+ void validatePortForwardingSourceCidrList(List sourceCidrList);
}
diff --git a/api/src/main/java/com/cloud/server/ManagementServerHostStats.java b/api/src/main/java/com/cloud/server/ManagementServerHostStats.java
index 1f201d7689f..1eea7addba3 100644
--- a/api/src/main/java/com/cloud/server/ManagementServerHostStats.java
+++ b/api/src/main/java/com/cloud/server/ManagementServerHostStats.java
@@ -32,6 +32,8 @@ public interface ManagementServerHostStats {
String getManagementServerHostUuid();
+ long getManagementServerRunId();
+
long getSessions();
double getCpuUtilization();
diff --git a/api/src/main/java/com/cloud/user/Account.java b/api/src/main/java/com/cloud/user/Account.java
index bb9838f137a..6be4d0a48f6 100644
--- a/api/src/main/java/com/cloud/user/Account.java
+++ b/api/src/main/java/com/cloud/user/Account.java
@@ -93,4 +93,8 @@ public interface Account extends ControlledEntity, InternalIdentity, Identity {
boolean isDefault();
+ public void setApiKeyAccess(Boolean apiKeyAccess);
+
+ public Boolean getApiKeyAccess();
+
}
diff --git a/api/src/main/java/com/cloud/user/AccountService.java b/api/src/main/java/com/cloud/user/AccountService.java
index 63f5455cfd0..e2c3bed0c29 100644
--- a/api/src/main/java/com/cloud/user/AccountService.java
+++ b/api/src/main/java/com/cloud/user/AccountService.java
@@ -19,6 +19,7 @@ package com.cloud.user;
import java.util.List;
import java.util.Map;
+import com.cloud.utils.Pair;
import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
@@ -116,6 +117,8 @@ public interface AccountService {
void checkAccess(Account account, AccessType accessType, boolean sameOwner, String apiName, ControlledEntity... entities) throws PermissionDeniedException;
+ void validateAccountHasAccessToResource(Account account, AccessType accessType, Object resource);
+
Long finalyzeAccountId(String accountName, Long domainId, Long projectId, boolean enabledOnly);
/**
@@ -125,9 +128,9 @@ public interface AccountService {
*/
UserAccount getUserAccountById(Long userId);
- public Map getKeys(GetUserKeysCmd cmd);
+ public Pair> getKeys(GetUserKeysCmd cmd);
- public Map getKeys(Long userId);
+ public Pair> getKeys(Long userId);
/**
* Lists user two-factor authentication provider plugins
diff --git a/api/src/main/java/com/cloud/user/User.java b/api/src/main/java/com/cloud/user/User.java
index 422e264f10b..041b39ad272 100644
--- a/api/src/main/java/com/cloud/user/User.java
+++ b/api/src/main/java/com/cloud/user/User.java
@@ -94,4 +94,9 @@ public interface User extends OwnedBy, InternalIdentity {
public boolean isUser2faEnabled();
public String getKeyFor2fa();
+
+ public void setApiKeyAccess(Boolean apiKeyAccess);
+
+ public Boolean getApiKeyAccess();
+
}
diff --git a/api/src/main/java/com/cloud/vm/VmDetailConstants.java b/api/src/main/java/com/cloud/vm/VmDetailConstants.java
index c21f6d23485..040f32ee322 100644
--- a/api/src/main/java/com/cloud/vm/VmDetailConstants.java
+++ b/api/src/main/java/com/cloud/vm/VmDetailConstants.java
@@ -74,6 +74,7 @@ public interface VmDetailConstants {
String ENCRYPTED_PASSWORD = "Encrypted.Password";
String CONFIG_DRIVE_LOCATION = "configDriveLocation";
+ String LAST_CONFIG_DRIVE_LOCATION = "lastConfigDriveLocation";
String SKIP_DRS = "skipFromDRS";
diff --git a/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java b/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
index cf667063e38..77373aaf10b 100644
--- a/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
@@ -35,6 +35,7 @@ public class ApiConstants {
public static final String ALLOW_USER_FORCE_STOP_VM = "allowuserforcestopvm";
public static final String ANNOTATION = "annotation";
public static final String API_KEY = "apikey";
+ public static final String API_KEY_ACCESS = "apikeyaccess";
public static final String ARCHIVED = "archived";
public static final String ARCH = "arch";
public static final String AS_NUMBER = "asnumber";
@@ -244,6 +245,7 @@ public class ApiConstants {
public static final String ICMP_TYPE = "icmptype";
public static final String ID = "id";
public static final String IDS = "ids";
+ public static final String IMPORT_INSTANCE_HOST_ID = "importinstancehostid";
public static final String INDEX = "index";
public static final String INSTANCES_DISKS_STATS_RETENTION_ENABLED = "instancesdisksstatsretentionenabled";
public static final String INSTANCES_DISKS_STATS_RETENTION_TIME = "instancesdisksstatsretentiontime";
@@ -385,6 +387,14 @@ public class ApiConstants {
public static final String PATH = "path";
public static final String PAYLOAD = "payload";
public static final String PAYLOAD_URL = "payloadurl";
+ public static final String PEERS = "peers";
+ public static final String PEER_ID = "peerid";
+ public static final String PEER_NAME = "peername";
+ public static final String PEER_MSID = "peermsid";
+ public static final String PEER_RUNID = "peerrunid";
+ public static final String PEER_SERVICE_IP = "peerserviceip";
+ public static final String PEER_SERVICE_PORT = "peerserviceport";
+ public static final String PEER_STATE = "peerstate";
public static final String POD_ID = "podid";
public static final String POD_NAME = "podname";
public static final String POD_IDS = "podids";
@@ -459,6 +469,7 @@ public class ApiConstants {
public static final String SNAPSHOT_POLICY_ID = "snapshotpolicyid";
public static final String SNAPSHOT_TYPE = "snapshottype";
public static final String SNAPSHOT_QUIESCEVM = "quiescevm";
+ public static final String SOURCE_CIDR_LIST = "sourcecidrlist";
public static final String SOURCE_ZONE_ID = "sourcezoneid";
public static final String SSL_VERIFICATION = "sslverification";
public static final String START_ASN = "startasn";
@@ -997,6 +1008,7 @@ public class ApiConstants {
public static final String ACL_NAME = "aclname";
public static final String NUMBER = "number";
public static final String IS_DYNAMICALLY_SCALABLE = "isdynamicallyscalable";
+ public static final String ROUTED_MODE_ENABLED = "routedmodeenabled";
public static final String ROUTING = "isrouting";
public static final String ROUTING_MODE = "routingmode";
public static final String MAX_CONNECTIONS = "maxconnections";
@@ -1255,4 +1267,30 @@ public class ApiConstants {
public enum DomainDetails {
all, resource, min;
}
+
+ public enum ApiKeyAccess {
+ DISABLED(false),
+ ENABLED(true),
+ INHERIT(null);
+
+ Boolean apiKeyAccess;
+
+ ApiKeyAccess(Boolean keyAccess) {
+ apiKeyAccess = keyAccess;
+ }
+
+ public Boolean toBoolean() {
+ return apiKeyAccess;
+ }
+
+ public static ApiKeyAccess fromBoolean(Boolean value) {
+ if (value == null) {
+ return INHERIT;
+ } else if (value) {
+ return ENABLED;
+ } else {
+ return DISABLED;
+ }
+ }
+ }
}
diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java
index 91cbb90e4da..3347a0d09f3 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java
@@ -21,7 +21,9 @@ import java.util.Map;
import javax.inject.Inject;
+import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.ApiCommandResourceType;
+import org.apache.cloudstack.api.command.user.UserCmd;
import org.apache.cloudstack.api.response.RoleResponse;
import org.apache.cloudstack.acl.SecurityChecker.AccessType;
@@ -40,8 +42,8 @@ import org.apache.cloudstack.region.RegionService;
import com.cloud.user.Account;
@APICommand(name = "updateAccount", description = "Updates account information for the authenticated user", responseObject = AccountResponse.class, entityType = {Account.class},
- requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
-public class UpdateAccountCmd extends BaseCmd {
+ responseView = ResponseView.Restricted, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
+public class UpdateAccountCmd extends BaseCmd implements UserCmd {
/////////////////////////////////////////////////////
//////////////// API parameters /////////////////////
@@ -70,6 +72,9 @@ public class UpdateAccountCmd extends BaseCmd {
@Parameter(name = ApiConstants.ACCOUNT_DETAILS, type = CommandType.MAP, description = "Details for the account used to store specific parameters")
private Map details;
+ @Parameter(name = ApiConstants.API_KEY_ACCESS, type = CommandType.STRING, description = "Determines if Api key access for this user is enabled, disabled or inherits the value from its parent, the domain level setting api.key.access", since = "4.20.1.0", authorized = {RoleType.Admin})
+ private String apiKeyAccess;
+
@Inject
RegionService _regionService;
@@ -109,6 +114,10 @@ public class UpdateAccountCmd extends BaseCmd {
return params;
}
+ public String getApiKeyAccess() {
+ return apiKeyAccess;
+ }
+
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -131,7 +140,7 @@ public class UpdateAccountCmd extends BaseCmd {
public void execute() {
Account result = _regionService.updateAccount(this);
if (result != null){
- AccountResponse response = _responseGenerator.createAccountResponse(ResponseView.Full, result);
+ AccountResponse response = _responseGenerator.createAccountResponse(getResponseView(), result);
response.setResponseName(getCommandName());
setResponseObject(response);
} else {
diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/management/ListMgmtsCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/management/ListMgmtsCmd.java
index a68ed62857a..7b7eae1d0e9 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/admin/management/ListMgmtsCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/management/ListMgmtsCmd.java
@@ -23,6 +23,7 @@ import org.apache.cloudstack.api.BaseListCmd;
import org.apache.cloudstack.api.Parameter;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.ManagementServerResponse;
+import org.apache.commons.lang3.BooleanUtils;
@APICommand(name = "listManagementServers", description = "Lists management servers.", responseObject = ManagementServerResponse.class,
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
@@ -39,6 +40,11 @@ public class ListMgmtsCmd extends BaseListCmd {
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, description = "the name of the management server")
private String hostName;
+ @Parameter(name = ApiConstants.PEERS, type = CommandType.BOOLEAN,
+ description = "Whether to return the management server peers or not. By default, the management server peers will not be returned.",
+ since = "4.20.1.0")
+ private Boolean peers;
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -51,6 +57,10 @@ public class ListMgmtsCmd extends BaseListCmd {
return hostName;
}
+ public Boolean getPeers() {
+ return BooleanUtils.toBooleanDefaultIfNull(peers, false);
+ }
+
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/user/GetUserKeysCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/user/GetUserKeysCmd.java
index 3a3414d95d8..cdd239f72b5 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/admin/user/GetUserKeysCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/user/GetUserKeysCmd.java
@@ -20,6 +20,7 @@ package org.apache.cloudstack.api.command.admin.user;
import com.cloud.user.Account;
import com.cloud.user.User;
+import com.cloud.utils.Pair;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
@@ -54,11 +55,13 @@ public class GetUserKeysCmd extends BaseCmd{
else return Account.ACCOUNT_ID_SYSTEM;
}
public void execute(){
- Map keys = _accountService.getKeys(this);
+ Pair> keys = _accountService.getKeys(this);
+
RegisterResponse response = new RegisterResponse();
if(keys != null){
- response.setApiKey(keys.get("apikey"));
- response.setSecretKey(keys.get("secretkey"));
+ response.setApiKeyAccess(keys.first());
+ response.setApiKey(keys.second().get("apikey"));
+ response.setSecretKey(keys.second().get("secretkey"));
}
response.setObjectName("userkeys");
diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java
index ef9e3fa2240..2f29b1ec1e4 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/user/ListUsersCmd.java
@@ -16,23 +16,29 @@
// under the License.
package org.apache.cloudstack.api.command.admin.user;
+import com.cloud.exception.InvalidParameterValueException;
import com.cloud.server.ResourceIcon;
import com.cloud.server.ResourceTag;
import com.cloud.user.Account;
+import com.cloud.user.User;
+import org.apache.cloudstack.acl.RoleType;
+import org.apache.cloudstack.api.command.user.UserCmd;
import org.apache.cloudstack.api.response.ResourceIconResponse;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseListAccountResourcesCmd;
import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ResponseObject.ResponseView;
import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.api.response.UserResponse;
+import org.apache.commons.lang3.EnumUtils;
import java.util.List;
@APICommand(name = "listUsers", description = "Lists user accounts", responseObject = UserResponse.class,
- requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
-public class ListUsersCmd extends BaseListAccountResourcesCmd {
+ responseView = ResponseView.Restricted, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true)
+public class ListUsersCmd extends BaseListAccountResourcesCmd implements UserCmd {
/////////////////////////////////////////////////////
@@ -53,10 +59,17 @@ public class ListUsersCmd extends BaseListAccountResourcesCmd {
@Parameter(name = ApiConstants.USERNAME, type = CommandType.STRING, description = "List user by the username")
private String username;
+ @Parameter(name = ApiConstants.API_KEY_ACCESS, type = CommandType.STRING, description = "List users by the Api key access value", since = "4.20.1.0", authorized = {RoleType.Admin})
+ private String apiKeyAccess;
+
@Parameter(name = ApiConstants.SHOW_RESOURCE_ICON, type = CommandType.BOOLEAN,
description = "flag to display the resource icon for users")
private Boolean showIcon;
+ @Parameter(name = ApiConstants.USER_SOURCE, type = CommandType.STRING, since = "4.21.0.0",
+ description = "List users by their authentication source. Valid values are: native, ldap, saml2 and saml2disabled.")
+ private String userSource;
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -77,17 +90,38 @@ public class ListUsersCmd extends BaseListAccountResourcesCmd {
return username;
}
+ public String getApiKeyAccess() {
+ return apiKeyAccess;
+ }
+
public Boolean getShowIcon() {
return showIcon != null ? showIcon : false;
}
+ public User.Source getUserSource() {
+ if (userSource == null) {
+ return null;
+ }
+
+ User.Source source = EnumUtils.getEnumIgnoreCase(User.Source.class, userSource);
+ if (source == null || List.of(User.Source.OAUTH2, User.Source.UNKNOWN).contains(source)) {
+ throw new InvalidParameterValueException(String.format("Invalid user source: %s. Valid values are: native, ldap, saml2 and saml2disabled.", userSource));
+ }
+
+ if (source == User.Source.NATIVE) {
+ return User.Source.UNKNOWN;
+ }
+
+ return source;
+ }
+
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
public void execute() {
- ListResponse response = _queryService.searchForUsers(this);
+ ListResponse response = _queryService.searchForUsers(getResponseView(), this);
response.setResponseName(getCommandName());
this.setResponseObject(response);
if (response != null && response.getCount() > 0 && getShowIcon()) {
diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java
index c9e1e934152..3d7f51ae220 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/user/UpdateUserCmd.java
@@ -18,6 +18,7 @@ package org.apache.cloudstack.api.command.admin.user;
import javax.inject.Inject;
+import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
@@ -69,6 +70,9 @@ public class UpdateUserCmd extends BaseCmd {
@Parameter(name = ApiConstants.USER_SECRET_KEY, type = CommandType.STRING, description = "The secret key for the user. Must be specified with userApiKey")
private String secretKey;
+ @Parameter(name = ApiConstants.API_KEY_ACCESS, type = CommandType.STRING, description = "Determines if Api key access for this user is enabled, disabled or inherits the value from its parent, the owning account", since = "4.20.1.0", authorized = {RoleType.Admin})
+ private String apiKeyAccess;
+
@Parameter(name = ApiConstants.TIMEZONE,
type = CommandType.STRING,
description = "Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.")
@@ -120,6 +124,10 @@ public class UpdateUserCmd extends BaseCmd {
return secretKey;
}
+ public String getApiKeyAccess() {
+ return apiKeyAccess;
+ }
+
public String getTimezone() {
return timezone;
}
diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ImportVmCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ImportVmCmd.java
index 6f148ff0ee4..db43b53ab9a 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ImportVmCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ImportVmCmd.java
@@ -144,15 +144,19 @@ public class ImportVmCmd extends ImportUnmanagedInstanceCmd {
private String clusterName;
@Parameter(name = ApiConstants.CONVERT_INSTANCE_HOST_ID, type = CommandType.UUID, entityType = HostResponse.class,
- description = "(only for importing VMs from VMware to KVM) optional - the host to perform the virt-v2v migration from VMware to KVM.")
+ description = "(only for importing VMs from VMware to KVM) optional - the host to perform the virt-v2v conversion from VMware to KVM.")
private Long convertInstanceHostId;
+ @Parameter(name = ApiConstants.IMPORT_INSTANCE_HOST_ID, type = CommandType.UUID, entityType = HostResponse.class, since = "4.19.2",
+ description = "(only for importing VMs from VMware to KVM) optional - the host to import the converted instance from VMware to KVM.")
+ private Long importInstanceHostId;
+
@Parameter(name = ApiConstants.CONVERT_INSTANCE_STORAGE_POOL_ID, type = CommandType.UUID, entityType = StoragePoolResponse.class,
description = "(only for importing VMs from VMware to KVM) optional - the temporary storage pool to perform the virt-v2v migration from VMware to KVM.")
private Long convertStoragePoolId;
@Parameter(name = ApiConstants.FORCE_MS_TO_IMPORT_VM_FILES, type = CommandType.BOOLEAN,
- description = "(only for importing VMs from VMware to KVM) optional - if true, forces MS to import VM file(s) to temporary storage, else uses KVM Host if ovftool is available, falls back to MS if not.")
+ description = "(only for importing VMs from VMware to KVM) optional - if true, forces MS to export OVF from VMware to temporary storage, else uses KVM Host if ovftool is available, falls back to MS if not.")
private Boolean forceMsToImportVmFiles;
/////////////////////////////////////////////////////
@@ -199,6 +203,10 @@ public class ImportVmCmd extends ImportUnmanagedInstanceCmd {
return convertInstanceHostId;
}
+ public Long getImportInstanceHostId() {
+ return importInstanceHostId;
+ }
+
public Long getConvertStoragePoolId() {
return convertStoragePoolId;
}
diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
index 0a962b19e4f..9157188fdee 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
+import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
@@ -70,6 +71,9 @@ public class ListAccountsCmd extends BaseListDomainResourcesCmd implements UserC
description = "comma separated list of account details requested, value can be a list of [ all, resource, min]")
private List viewDetails;
+ @Parameter(name = ApiConstants.API_KEY_ACCESS, type = CommandType.STRING, description = "List accounts by the Api key access value", since = "4.20.1.0", authorized = {RoleType.Admin})
+ private String apiKeyAccess;
+
@Parameter(name = ApiConstants.SHOW_RESOURCE_ICON, type = CommandType.BOOLEAN,
description = "flag to display the resource icon for accounts")
private Boolean showIcon;
@@ -120,6 +124,10 @@ public class ListAccountsCmd extends BaseListDomainResourcesCmd implements UserC
return dv;
}
+ public String getApiKeyAccess() {
+ return apiKeyAccess;
+ }
+
public boolean getShowIcon() {
return showIcon != null ? showIcon : false;
}
diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/backup/ListBackupScheduleCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/backup/ListBackupScheduleCmd.java
index a7610717435..fa6e3ea5d45 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/user/backup/ListBackupScheduleCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/user/backup/ListBackupScheduleCmd.java
@@ -82,7 +82,7 @@ public class ListBackupScheduleCmd extends BaseCmd {
List schedules = backupManager.listBackupSchedule(getVmId());
ListResponse response = new ListResponse<>();
List scheduleResponses = new ArrayList<>();
- if (CollectionUtils.isNullOrEmpty(schedules)) {
+ if (!CollectionUtils.isNullOrEmpty(schedules)) {
for (BackupSchedule schedule : schedules) {
scheduleResponses.add(_responseGenerator.createBackupScheduleResponse(schedule));
}
diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
index 3545b3d21fb..9d1fe176019 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java
@@ -105,8 +105,12 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
description = "the ID of the virtual machine for the port forwarding rule")
private Long virtualMachineId;
- @Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, description = "the cidr list to forward traffic from. Multiple entries must be separated by a single comma character (,). This parameter is deprecated. Do not use.")
- private List cidrlist;
+ @Parameter(name = ApiConstants.CIDR_LIST,
+ type = CommandType.LIST,
+ collectionType = CommandType.STRING,
+ description = " the source CIDR list to allow traffic from; all other CIDRs will be blocked. " +
+ "Multiple entries must be separated by a single comma character (,). This param will be used only for VPC tiers. By default, all CIDRs are allowed.")
+ private List sourceCidrList;
@Parameter(name = ApiConstants.OPEN_FIREWALL, type = CommandType.BOOLEAN, description = "if true, firewall rule for source/end public port is automatically created; "
+ "if false - firewall rule has to be created explicitly. If not specified 1) defaulted to false when PF"
@@ -155,11 +159,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
@Override
public List getSourceCidrList() {
- if (cidrlist != null) {
- throw new InvalidParameterValueException("Parameter cidrList is deprecated; if you need to open firewall "
- + "rule for the specific cidr, please refer to createFirewallRule command");
- }
- return null;
+ return sourceCidrList;
}
public Boolean getOpenFirewall() {
@@ -332,12 +332,6 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
@Override
public void create() {
- // cidr list parameter is deprecated
- if (cidrlist != null) {
- throw new InvalidParameterValueException(
- "Parameter cidrList is deprecated; if you need to open firewall rule for the specific cidr, please refer to createFirewallRule command");
- }
-
Ip privateIp = getVmSecondaryIp();
if (privateIp != null) {
if (!NetUtils.isValidIp4(privateIp.toString())) {
@@ -345,6 +339,8 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P
}
}
+ _rulesService.validatePortForwardingSourceCidrList(sourceCidrList);
+
try {
PortForwardingRule result = _rulesService.createPortForwardingRule(this, virtualMachineId, privateIp, getOpenFirewall(), isDisplay());
setEntityId(result.getId());
diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
index 3fb66bd861f..ee4bd18ad40 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java
@@ -32,6 +32,8 @@ import com.cloud.network.rules.PortForwardingRule;
import com.cloud.user.Account;
import com.cloud.utils.net.Ip;
+import java.util.List;
+
@APICommand(name = "updatePortForwardingRule",
responseObject = FirewallRuleResponse.class,
description = "Updates a port forwarding rule. Only the private port and the virtual machine can be updated.", entityType = {PortForwardingRule.class},
@@ -63,6 +65,13 @@ public class UpdatePortForwardingRuleCmd extends BaseAsyncCustomIdCmd {
@Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the rule to the end user or not", since = "4.4", authorized = {RoleType.Admin})
private Boolean display;
+ @Parameter(name = ApiConstants.CIDR_LIST,
+ type = CommandType.LIST,
+ collectionType = CommandType.STRING,
+ description = " the source CIDR list to allow traffic from; all other CIDRs will be blocked. " +
+ "Multiple entries must be separated by a single comma character (,). This param will be used only for VPC tiers. By default, all CIDRs are allowed.")
+ private List sourceCidrList;
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -94,6 +103,10 @@ public class UpdatePortForwardingRuleCmd extends BaseAsyncCustomIdCmd {
return display;
}
+ public List getSourceCidrList() {
+ return sourceCidrList;
+ }
+
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@@ -130,7 +143,7 @@ public class UpdatePortForwardingRuleCmd extends BaseAsyncCustomIdCmd {
@Override
public void execute() {
- PortForwardingRule rule = _rulesService.updatePortForwardingRule(getId(), getPrivatePort(), getPrivateEndPort(), getVirtualMachineId(), getVmGuestIp(), getCustomId(), getDisplay());
+ PortForwardingRule rule = _rulesService.updatePortForwardingRule(this);
FirewallRuleResponse fwResponse = new FirewallRuleResponse();
if (rule != null) {
fwResponse = _responseGenerator.createPortForwardingRuleResponse(rule);
diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
index f86d1ae85da..34798c4efe1 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java
@@ -104,7 +104,7 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd /*implements L
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class, description = "the domain ID associated with the load balancer")
private Long domainId;
- @Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, since = "4.18.0.0", description = "the CIDR list to allow traffic, "
+ @Parameter(name = ApiConstants.CIDR_LIST, type = CommandType.LIST, collectionType = CommandType.STRING, since = "4.18.0.0", description = "the source CIDR list to allow traffic from; "
+ "all other CIDRs will be blocked. Multiple entries must be separated by a single comma character (,). By default, all CIDRs are allowed.")
private List cidrlist;
diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
index 6dc51272fad..b7c14a6d3c8 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/user/template/RegisterTemplateCmd.java
@@ -371,7 +371,9 @@ public class RegisterTemplateCmd extends BaseCmd implements UserCmd {
"Parameter zoneids cannot combine all zones (-1) option with other zones");
String customHypervisor = HypervisorGuru.HypervisorCustomDisplayName.value();
- if (isDirectDownload() && !(getHypervisor().equalsIgnoreCase(Hypervisor.HypervisorType.KVM.toString())
+ if (isDirectDownload() &&
+ !(Hypervisor.HypervisorType.getType(getHypervisor())
+ .isFunctionalitySupported(Hypervisor.HypervisorType.Functionality.DirectDownloadTemplate)
|| getHypervisor().equalsIgnoreCase(customHypervisor))) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, String.format("Parameter directdownload " +
"is only allowed for KVM or %s templates", customHypervisor));
diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
index 65a3d6a7063..eb89115cf46 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java
@@ -73,6 +73,10 @@ public class ResizeVolumeCmd extends BaseAsyncCmd implements UserCmd {
description = "new disk offering id")
private Long newDiskOfferingId;
+ @Parameter(name = ApiConstants.AUTO_MIGRATE, type = CommandType.BOOLEAN, required = false,
+ description = "Flag to allow automatic migration of the volume to another suitable storage pool that accommodates the new size", since = "4.20.1")
+ private Boolean autoMigrate;
+
/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
@@ -129,6 +133,10 @@ public class ResizeVolumeCmd extends BaseAsyncCmd implements UserCmd {
return newDiskOfferingId;
}
+ public boolean getAutoMigrate() {
+ return autoMigrate == null ? false : autoMigrate;
+ }
+
/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
diff --git a/api/src/main/java/org/apache/cloudstack/api/response/AccountResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/AccountResponse.java
index 7a84e85a4a6..6fc098295f6 100644
--- a/api/src/main/java/org/apache/cloudstack/api/response/AccountResponse.java
+++ b/api/src/main/java/org/apache/cloudstack/api/response/AccountResponse.java
@@ -271,6 +271,10 @@ public class AccountResponse extends BaseResponse implements ResourceLimitAndCou
@Param(description = "The tagged resource limit and count for the account", since = "4.20.0")
List taggedResources;
+ @SerializedName(ApiConstants.API_KEY_ACCESS)
+ @Param(description = "whether api key access is Enabled, Disabled or set to Inherit (it inherits the value from the parent)", since = "4.20.1.0")
+ ApiConstants.ApiKeyAccess apiKeyAccess;
+
@Override
public String getObjectId() {
return id;
@@ -554,4 +558,8 @@ public class AccountResponse extends BaseResponse implements ResourceLimitAndCou
public void setTaggedResourceLimitsAndCounts(List taggedResourceLimitsAndCounts) {
this.taggedResources = taggedResourceLimitsAndCounts;
}
+
+ public void setApiKeyAccess(Boolean apiKeyAccess) {
+ this.apiKeyAccess = ApiConstants.ApiKeyAccess.fromBoolean(apiKeyAccess);
+ }
}
diff --git a/api/src/main/java/org/apache/cloudstack/api/response/ManagementServerResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/ManagementServerResponse.java
index a471045eb67..fc7d3b722ab 100644
--- a/api/src/main/java/org/apache/cloudstack/api/response/ManagementServerResponse.java
+++ b/api/src/main/java/org/apache/cloudstack/api/response/ManagementServerResponse.java
@@ -24,7 +24,9 @@ import org.apache.cloudstack.api.BaseResponse;
import org.apache.cloudstack.api.EntityReference;
import org.apache.cloudstack.management.ManagementServerHost.State;
+import java.util.ArrayList;
import java.util.Date;
+import java.util.List;
@EntityReference(value = ManagementServerHost.class)
public class ManagementServerResponse extends BaseResponse {
@@ -76,6 +78,10 @@ public class ManagementServerResponse extends BaseResponse {
@Param(description = "the IP Address for this Management Server")
private String serviceIp;
+ @SerializedName(ApiConstants.PEERS)
+ @Param(description = "the Management Server Peers")
+ private List peers;
+
public String getId() {
return this.id;
}
@@ -171,4 +177,19 @@ public class ManagementServerResponse extends BaseResponse {
public String getKernelVersion() {
return kernelVersion;
}
+
+ public List getPeers() {
+ return peers;
+ }
+
+ public void setPeers(List peers) {
+ this.peers = peers;
+ }
+
+ public void addPeer(PeerManagementServerNodeResponse peer) {
+ if (peers == null) {
+ peers = new ArrayList<>();
+ }
+ peers.add(peer);
+ }
}
diff --git a/api/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java
new file mode 100644
index 00000000000..802294171fa
--- /dev/null
+++ b/api/src/main/java/org/apache/cloudstack/api/response/PeerManagementServerNodeResponse.java
@@ -0,0 +1,100 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.response;
+
+import com.cloud.serializer.Param;
+import com.google.gson.annotations.SerializedName;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseResponse;
+import org.apache.cloudstack.management.ManagementServerHost.State;
+
+import java.util.Date;
+
+public class PeerManagementServerNodeResponse extends BaseResponse {
+
+ @SerializedName(ApiConstants.STATE)
+ @Param(description = "the state of the management server peer")
+ private State state;
+
+ @SerializedName(ApiConstants.LAST_UPDATED)
+ @Param(description = "the last updated time of the management server peer state")
+ private Date lastUpdated;
+
+ @SerializedName(ApiConstants.PEER_ID)
+ @Param(description = "the ID of the peer management server")
+ private String peerId;
+
+ @SerializedName(ApiConstants.PEER_NAME)
+ @Param(description = "the name of the peer management server")
+ private String peerName;
+
+ @SerializedName(ApiConstants.PEER_MSID)
+ @Param(description = "the management ID of the peer management server")
+ private String peerMsId;
+
+ @SerializedName(ApiConstants.PEER_RUNID)
+ @Param(description = "the run ID of the peer management server")
+ private String peerRunId;
+
+ @SerializedName(ApiConstants.PEER_STATE)
+ @Param(description = "the state of the peer management server")
+ private String peerState;
+
+ @SerializedName(ApiConstants.PEER_SERVICE_IP)
+ @Param(description = "the IP Address for the peer Management Server")
+ private String peerServiceIp;
+
+ @SerializedName(ApiConstants.PEER_SERVICE_PORT)
+ @Param(description = "the service port for the peer Management Server")
+ private String peerServicePort;
+
+ public void setState(State state) {
+ this.state = state;
+ }
+
+ public void setLastUpdated(Date lastUpdated) {
+ this.lastUpdated = lastUpdated;
+ }
+
+ public void setPeerId(String peerId) {
+ this.peerId = peerId;
+ }
+
+ public void setPeerName(String peerName) {
+ this.peerName = peerName;
+ }
+
+ public void setPeerMsId(String peerMsId) {
+ this.peerMsId = peerMsId;
+ }
+
+ public void setPeerRunId(String peerRunId) {
+ this.peerRunId = peerRunId;
+ }
+
+ public void setPeerState(String peerState) {
+ this.peerState = peerState;
+ }
+
+ public void setPeerServiceIp(String peerServiceIp) {
+ this.peerServiceIp = peerServiceIp;
+ }
+
+ public void setPeerServicePort(String peerServicePort) {
+ this.peerServicePort = peerServicePort;
+ }
+}
diff --git a/api/src/main/java/org/apache/cloudstack/api/response/RegisterResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/RegisterResponse.java
index 5faedabfc16..dd17cc5cc8a 100644
--- a/api/src/main/java/org/apache/cloudstack/api/response/RegisterResponse.java
+++ b/api/src/main/java/org/apache/cloudstack/api/response/RegisterResponse.java
@@ -18,19 +18,24 @@ package org.apache.cloudstack.api.response;
import com.google.gson.annotations.SerializedName;
+import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
import com.cloud.serializer.Param;
public class RegisterResponse extends BaseResponse {
- @SerializedName("apikey")
+ @SerializedName(ApiConstants.API_KEY)
@Param(description = "the api key of the registered user", isSensitive = true)
private String apiKey;
- @SerializedName("secretkey")
+ @SerializedName(ApiConstants.SECRET_KEY)
@Param(description = "the secret key of the registered user", isSensitive = true)
private String secretKey;
+ @SerializedName(ApiConstants.API_KEY_ACCESS)
+ @Param(description = "whether api key access is allowed or not", isSensitive = true)
+ private Boolean apiKeyAccess;
+
public String getApiKey() {
return apiKey;
}
@@ -46,4 +51,8 @@ public class RegisterResponse extends BaseResponse {
public void setSecretKey(String secretKey) {
this.secretKey = secretKey;
}
+
+ public void setApiKeyAccess(Boolean apiKeyAccess) {
+ this.apiKeyAccess = apiKeyAccess;
+ }
}
diff --git a/api/src/main/java/org/apache/cloudstack/api/response/UserResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/UserResponse.java
index 1a17f3b8698..5e4e6e1f3c8 100644
--- a/api/src/main/java/org/apache/cloudstack/api/response/UserResponse.java
+++ b/api/src/main/java/org/apache/cloudstack/api/response/UserResponse.java
@@ -67,7 +67,7 @@ public class UserResponse extends BaseResponse implements SetResourceIconRespons
@Param(description = "the account type of the user")
private Integer accountType;
- @SerializedName("usersource")
+ @SerializedName(ApiConstants.USER_SOURCE)
@Param(description = "the source type of the user in lowercase, such as native, ldap, saml2")
private String userSource;
@@ -128,6 +128,10 @@ public class UserResponse extends BaseResponse implements SetResourceIconRespons
@Param(description = "true if user has two factor authentication is mandated", since = "4.18.0.0")
private Boolean is2FAmandated;
+ @SerializedName(ApiConstants.API_KEY_ACCESS)
+ @Param(description = "whether api key access is Enabled, Disabled or set to Inherit (it inherits the value from the parent)", since = "4.20.1.0")
+ ApiConstants.ApiKeyAccess apiKeyAccess;
+
@Override
public String getObjectId() {
return this.getId();
@@ -309,4 +313,8 @@ public class UserResponse extends BaseResponse implements SetResourceIconRespons
public void set2FAmandated(Boolean is2FAmandated) {
this.is2FAmandated = is2FAmandated;
}
+
+ public void setApiKeyAccess(Boolean apiKeyAccess) {
+ this.apiKeyAccess = ApiConstants.ApiKeyAccess.fromBoolean(apiKeyAccess);
+ }
}
diff --git a/api/src/main/java/org/apache/cloudstack/api/response/ZoneResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/ZoneResponse.java
index 143dfad0eaf..4a5279753a1 100644
--- a/api/src/main/java/org/apache/cloudstack/api/response/ZoneResponse.java
+++ b/api/src/main/java/org/apache/cloudstack/api/response/ZoneResponse.java
@@ -157,6 +157,11 @@ public class ZoneResponse extends BaseResponseWithAnnotations implements SetReso
@Param(description = "AS Number Range")
private String asnRange;
+ @SerializedName(ApiConstants.ROUTED_MODE_ENABLED)
+ @Param(description = "true, if routed network/vpc is enabled", since = "4.20.1")
+ private boolean routedModeEnabled = false;
+
+
public ZoneResponse() {
tags = new LinkedHashSet();
}
@@ -412,4 +417,12 @@ public class ZoneResponse extends BaseResponseWithAnnotations implements SetReso
public String getAsnRange() {
return asnRange;
}
+
+ public boolean isRoutedModeEnabled() {
+ return routedModeEnabled;
+ }
+
+ public void setRoutedModeEnabled(boolean routedModeEnabled) {
+ this.routedModeEnabled = routedModeEnabled;
+ }
}
diff --git a/api/src/main/java/org/apache/cloudstack/consoleproxy/ConsoleAccessManager.java b/api/src/main/java/org/apache/cloudstack/consoleproxy/ConsoleAccessManager.java
index 5bd9699b201..23b571e7fae 100644
--- a/api/src/main/java/org/apache/cloudstack/consoleproxy/ConsoleAccessManager.java
+++ b/api/src/main/java/org/apache/cloudstack/consoleproxy/ConsoleAccessManager.java
@@ -44,7 +44,7 @@ public interface ConsoleAccessManager extends Manager, Configurable {
void removeSessions(String[] sessionUuids);
- void acquireSession(String sessionUuid);
+ void acquireSession(String sessionUuid, String clientAddress);
String genAccessTicket(String host, String port, String sid, String tag, String sessionUuid);
String genAccessTicket(String host, String port, String sid, String tag, Date normalizedHashTime, String sessionUuid);
diff --git a/api/src/main/java/org/apache/cloudstack/network/RoutedIpv4Manager.java b/api/src/main/java/org/apache/cloudstack/network/RoutedIpv4Manager.java
index 2f704e9f47d..221a550ad63 100644
--- a/api/src/main/java/org/apache/cloudstack/network/RoutedIpv4Manager.java
+++ b/api/src/main/java/org/apache/cloudstack/network/RoutedIpv4Manager.java
@@ -57,6 +57,13 @@ import java.util.List;
public interface RoutedIpv4Manager extends PluggableService, Configurable {
+ ConfigKey RoutedNetworkVpcEnabled = new ConfigKey<>(ConfigKey.CATEGORY_NETWORK, Boolean.class,
+ "routed.network.vpc.enabled",
+ "true",
+ "If true, the Routed network and VPC are enabled in the zone.",
+ true,
+ ConfigKey.Scope.Zone);
+
ConfigKey RoutedNetworkIPv4MaxCidrSize = new ConfigKey<>(ConfigKey.CATEGORY_NETWORK, Integer.class,
"routed.network.ipv4.max.cidr.size", "30", "The maximum value of the cidr size for isolated networks in ROUTED mode",
true, ConfigKey.Scope.Account);
@@ -196,4 +203,6 @@ public interface RoutedIpv4Manager extends PluggableService, Configurable {
void removeBgpPeersByAccountId(long accountId);
void removeBgpPeersByDomainId(long domainId);
+
+ Boolean isRoutedNetworkVpcEnabled(long zoneId);
}
diff --git a/api/src/main/java/org/apache/cloudstack/query/QueryService.java b/api/src/main/java/org/apache/cloudstack/query/QueryService.java
index c93e43d9f37..88081494320 100644
--- a/api/src/main/java/org/apache/cloudstack/query/QueryService.java
+++ b/api/src/main/java/org/apache/cloudstack/query/QueryService.java
@@ -19,6 +19,7 @@ package org.apache.cloudstack.query;
import java.util.List;
import org.apache.cloudstack.affinity.AffinityGroupResponse;
+import org.apache.cloudstack.api.ResponseObject;
import org.apache.cloudstack.api.command.admin.domain.ListDomainsCmd;
import org.apache.cloudstack.api.command.admin.host.ListHostTagsCmd;
import org.apache.cloudstack.api.command.admin.host.ListHostsCmd;
@@ -130,7 +131,7 @@ public interface QueryService {
ConfigKey ReturnVmStatsOnVmList = new ConfigKey<>("Advanced", Boolean.class, "list.vm.default.details.stats", "true",
"Determines whether VM stats should be returned when details are not explicitly specified in listVirtualMachines API request. When false, details default to [group, nics, secgrp, tmpl, servoff, diskoff, backoff, iso, volume, min, affgrp]. When true, all details are returned including 'stats'.", true, ConfigKey.Scope.Global);
- ListResponse searchForUsers(ListUsersCmd cmd) throws PermissionDeniedException;
+ ListResponse searchForUsers(ResponseObject.ResponseView responseView, ListUsersCmd cmd) throws PermissionDeniedException;
ListResponse searchForUsers(Long domainId, boolean recursive) throws PermissionDeniedException;
diff --git a/client/pom.xml b/client/pom.xml
index d89dbbbbe9d..2ef6c910509 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -25,7 +25,7 @@
org.apache.cloudstack
cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
diff --git a/core/pom.xml b/core/pom.xml
index 83cdee8cf4f..25ac46518b3 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
diff --git a/core/src/main/java/com/cloud/agent/api/ConsoleAccessAuthenticationCommand.java b/core/src/main/java/com/cloud/agent/api/ConsoleAccessAuthenticationCommand.java
index 683d4afd5b2..ac6f15ec4c3 100644
--- a/core/src/main/java/com/cloud/agent/api/ConsoleAccessAuthenticationCommand.java
+++ b/core/src/main/java/com/cloud/agent/api/ConsoleAccessAuthenticationCommand.java
@@ -27,6 +27,7 @@ public class ConsoleAccessAuthenticationCommand extends AgentControlCommand {
private String _sid;
private String _ticket;
private String sessionUuid;
+ private String clientAddress;
private boolean _isReauthenticating;
@@ -35,13 +36,14 @@ public class ConsoleAccessAuthenticationCommand extends AgentControlCommand {
}
public ConsoleAccessAuthenticationCommand(String host, String port, String vmId, String sid, String ticket,
- String sessiontkn) {
+ String sessiontkn, String clientAddress) {
_host = host;
_port = port;
_vmId = vmId;
_sid = sid;
_ticket = ticket;
sessionUuid = sessiontkn;
+ this.clientAddress = clientAddress;
}
public String getHost() {
@@ -79,4 +81,12 @@ public class ConsoleAccessAuthenticationCommand extends AgentControlCommand {
public void setSessionUuid(String sessionUuid) {
this.sessionUuid = sessionUuid;
}
+
+ public String getClientAddress() {
+ return clientAddress;
+ }
+
+ public void setClientAddress(String clientAddress) {
+ this.clientAddress = clientAddress;
+ }
}
diff --git a/core/src/main/java/com/cloud/agent/api/ConvertInstanceAnswer.java b/core/src/main/java/com/cloud/agent/api/ConvertInstanceAnswer.java
index 829888570a6..174348f4f18 100644
--- a/core/src/main/java/com/cloud/agent/api/ConvertInstanceAnswer.java
+++ b/core/src/main/java/com/cloud/agent/api/ConvertInstanceAnswer.java
@@ -20,6 +20,8 @@ import org.apache.cloudstack.vm.UnmanagedInstanceTO;
public class ConvertInstanceAnswer extends Answer {
+ private String temporaryConvertUuid;
+
public ConvertInstanceAnswer() {
super();
}
@@ -34,6 +36,15 @@ public class ConvertInstanceAnswer extends Answer {
this.convertedInstance = convertedInstance;
}
+ public ConvertInstanceAnswer(Command command, String temporaryConvertUuid) {
+ super(command, true, "");
+ this.temporaryConvertUuid = temporaryConvertUuid;
+ }
+
+ public String getTemporaryConvertUuid() {
+ return temporaryConvertUuid;
+ }
+
public UnmanagedInstanceTO getConvertedInstance() {
return convertedInstance;
}
diff --git a/core/src/main/java/com/cloud/agent/api/ImportConvertedInstanceAnswer.java b/core/src/main/java/com/cloud/agent/api/ImportConvertedInstanceAnswer.java
new file mode 100644
index 00000000000..2a8f8704e3f
--- /dev/null
+++ b/core/src/main/java/com/cloud/agent/api/ImportConvertedInstanceAnswer.java
@@ -0,0 +1,40 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.agent.api;
+
+import org.apache.cloudstack.vm.UnmanagedInstanceTO;
+
+public class ImportConvertedInstanceAnswer extends Answer {
+
+ public ImportConvertedInstanceAnswer() {
+ super();
+ }
+ private UnmanagedInstanceTO convertedInstance;
+
+ public ImportConvertedInstanceAnswer(Command command, boolean success, String details) {
+ super(command, success, details);
+ }
+
+ public ImportConvertedInstanceAnswer(Command command, UnmanagedInstanceTO convertedInstance) {
+ super(command, true, "");
+ this.convertedInstance = convertedInstance;
+ }
+
+ public UnmanagedInstanceTO getConvertedInstance() {
+ return convertedInstance;
+ }
+}
diff --git a/core/src/main/java/com/cloud/agent/api/ImportConvertedInstanceCommand.java b/core/src/main/java/com/cloud/agent/api/ImportConvertedInstanceCommand.java
new file mode 100644
index 00000000000..9d50e852ced
--- /dev/null
+++ b/core/src/main/java/com/cloud/agent/api/ImportConvertedInstanceCommand.java
@@ -0,0 +1,63 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.agent.api;
+
+import com.cloud.agent.api.to.DataStoreTO;
+import com.cloud.agent.api.to.RemoteInstanceTO;
+
+import java.util.List;
+
+public class ImportConvertedInstanceCommand extends Command {
+
+ private RemoteInstanceTO sourceInstance;
+ private List destinationStoragePools;
+ private DataStoreTO conversionTemporaryLocation;
+ private String temporaryConvertUuid;
+
+ public ImportConvertedInstanceCommand() {
+ }
+
+ public ImportConvertedInstanceCommand(RemoteInstanceTO sourceInstance,
+ List destinationStoragePools,
+ DataStoreTO conversionTemporaryLocation, String temporaryConvertUuid) {
+ this.sourceInstance = sourceInstance;
+ this.destinationStoragePools = destinationStoragePools;
+ this.conversionTemporaryLocation = conversionTemporaryLocation;
+ this.temporaryConvertUuid = temporaryConvertUuid;
+ }
+
+ public RemoteInstanceTO getSourceInstance() {
+ return sourceInstance;
+ }
+
+ public List getDestinationStoragePools() {
+ return destinationStoragePools;
+ }
+
+ public DataStoreTO getConversionTemporaryLocation() {
+ return conversionTemporaryLocation;
+ }
+
+ public String getTemporaryConvertUuid() {
+ return temporaryConvertUuid;
+ }
+
+ @Override
+ public boolean executeInSequence() {
+ return false;
+ }
+}
diff --git a/core/src/main/java/com/cloud/agent/resource/virtualnetwork/facade/SetPortForwardingRulesConfigItem.java b/core/src/main/java/com/cloud/agent/resource/virtualnetwork/facade/SetPortForwardingRulesConfigItem.java
index c9d0e74e2e4..4daef64ed8a 100644
--- a/core/src/main/java/com/cloud/agent/resource/virtualnetwork/facade/SetPortForwardingRulesConfigItem.java
+++ b/core/src/main/java/com/cloud/agent/resource/virtualnetwork/facade/SetPortForwardingRulesConfigItem.java
@@ -41,7 +41,7 @@ public class SetPortForwardingRulesConfigItem extends AbstractConfigItemFacade {
for (final PortForwardingRuleTO rule : command.getRules()) {
final ForwardingRule fwdRule = new ForwardingRule(rule.revoked(), rule.getProtocol().toLowerCase(), rule.getSrcIp(), rule.getStringSrcPortRange(), rule.getDstIp(),
- rule.getStringDstPortRange());
+ rule.getStringDstPortRange(), rule.getSourceCidrListAsString());
rules.add(fwdRule);
}
diff --git a/core/src/main/java/com/cloud/agent/resource/virtualnetwork/model/ForwardingRule.java b/core/src/main/java/com/cloud/agent/resource/virtualnetwork/model/ForwardingRule.java
index cf3e43d1c01..1dc1cc855c4 100644
--- a/core/src/main/java/com/cloud/agent/resource/virtualnetwork/model/ForwardingRule.java
+++ b/core/src/main/java/com/cloud/agent/resource/virtualnetwork/model/ForwardingRule.java
@@ -26,18 +26,21 @@ public class ForwardingRule {
private String sourcePortRange;
private String destinationIpAddress;
private String destinationPortRange;
+ private String sourceCidrList;
public ForwardingRule() {
// Empty constructor for (de)serialization
}
- public ForwardingRule(boolean revoke, String protocol, String sourceIpAddress, String sourcePortRange, String destinationIpAddress, String destinationPortRange) {
+ public ForwardingRule(boolean revoke, String protocol, String sourceIpAddress, String sourcePortRange, String destinationIpAddress, String destinationPortRange,
+ String sourceCidrList) {
this.revoke = revoke;
this.protocol = protocol;
this.sourceIpAddress = sourceIpAddress;
this.sourcePortRange = sourcePortRange;
this.destinationIpAddress = destinationIpAddress;
this.destinationPortRange = destinationPortRange;
+ this.sourceCidrList = sourceCidrList;
}
public boolean isRevoke() {
@@ -88,4 +91,8 @@ public class ForwardingRule {
this.destinationPortRange = destinationPortRange;
}
+ public String getSourceCidrList() {
+ return sourceCidrList;
+ }
+
}
diff --git a/debian/changelog b/debian/changelog
index cbc4fcfdb2d..d17676ef268 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,12 @@
-cloudstack (4.20.0.0-SNAPSHOT) unstable; urgency=low
+cloudstack (4.21.0.0-SNAPSHOT) unstable; urgency=low
- * Update the version to 4.20.0.0-SNAPSHOT
+ * Update the version to 4.21.0.0-SNAPSHOT
+
+ -- the Apache CloudStack project Tue, 19 Nov 2024 08:54:07 -0300
+
+cloudstack (4.21.0.0-SNAPSHOT-SNAPSHOT) unstable; urgency=low
+
+ * Update the version to 4.21.0.0-SNAPSHOT-SNAPSHOT
-- the Apache CloudStack project Mon, 29 Jan 2024 10:21:52 +0530
diff --git a/debian/cloudstack-cli.install b/debian/cloudstack-cli.install
index 978b68af62a..13a83393a91 100644
--- a/debian/cloudstack-cli.install
+++ b/debian/cloudstack-cli.install
@@ -5,9 +5,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
diff --git a/debian/cloudstack-docs.install b/debian/cloudstack-docs.install
index 978b68af62a..13a83393a91 100644
--- a/debian/cloudstack-docs.install
+++ b/debian/cloudstack-docs.install
@@ -5,9 +5,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
diff --git a/debian/control b/debian/control
index ed4f95d8e49..c0cb95af035 100644
--- a/debian/control
+++ b/debian/control
@@ -24,7 +24,7 @@ Description: CloudStack server library
Package: cloudstack-agent
Architecture: all
-Depends: ${python:Depends}, ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), lsb-base (>= 9), openssh-client, qemu-kvm (>= 2.5) | qemu-system-x86 (>= 5.2), libvirt-bin (>= 1.3) | libvirt-daemon-system (>= 3.0), iproute2, ebtables, vlan, ipset, python3-libvirt, ethtool, iptables, cryptsetup, rng-tools, rsync, lsb-release, ufw, apparmor, cpu-checker
+Depends: ${python:Depends}, ${python3:Depends}, openjdk-17-jre-headless | java17-runtime-headless | java17-runtime | zulu-17, cloudstack-common (= ${source:Version}), lsb-base (>= 9), openssh-client, qemu-kvm (>= 2.5) | qemu-system-x86 (>= 5.2), libvirt-bin (>= 1.3) | libvirt-daemon-system (>= 3.0), iproute2, ebtables, vlan, ipset, python3-libvirt, ethtool, iptables, cryptsetup, rng-tools, rsync, lsb-release, ufw, apparmor, cpu-checker, libvirt-daemon-driver-storage-rbd
Recommends: init-system-helpers
Conflicts: cloud-agent, cloud-agent-libs, cloud-agent-deps, cloud-agent-scripts
Description: CloudStack agent
diff --git a/developer/pom.xml b/developer/pom.xml
index b44446ec0a5..c573c03d008 100644
--- a/developer/pom.xml
+++ b/developer/pom.xml
@@ -25,7 +25,7 @@
org.apache.cloudstack
cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
diff --git a/engine/api/pom.xml b/engine/api/pom.xml
index 1112e6eff8b..25aaa1365df 100644
--- a/engine/api/pom.xml
+++ b/engine/api/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/engine/components-api/pom.xml b/engine/components-api/pom.xml
index b06b644d67f..0b30decffda 100644
--- a/engine/components-api/pom.xml
+++ b/engine/components-api/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/engine/components-api/src/main/java/com/cloud/capacity/CapacityManager.java b/engine/components-api/src/main/java/com/cloud/capacity/CapacityManager.java
index 1c3edad886b..e1bb10f5d26 100644
--- a/engine/components-api/src/main/java/com/cloud/capacity/CapacityManager.java
+++ b/engine/components-api/src/main/java/com/cloud/capacity/CapacityManager.java
@@ -40,6 +40,7 @@ public interface CapacityManager {
static final String StorageCapacityDisableThresholdCK = "pool.storage.capacity.disablethreshold";
static final String StorageOverprovisioningFactorCK = "storage.overprovisioning.factor";
static final String StorageAllocatedCapacityDisableThresholdCK = "pool.storage.allocated.capacity.disablethreshold";
+ static final String StorageAllocatedCapacityDisableThresholdForVolumeResizeCK = "pool.storage.allocated.resize.capacity.disablethreshold";
static final ConfigKey CpuOverprovisioningFactor =
new ConfigKey<>(
@@ -118,6 +119,17 @@ public interface CapacityManager {
"Percentage (as a value between 0 and 1) of secondary storage capacity threshold.",
true);
+ static final ConfigKey StorageAllocatedCapacityDisableThresholdForVolumeSize =
+ new ConfigKey<>(
+ ConfigKey.CATEGORY_ALERT,
+ Double.class,
+ StorageAllocatedCapacityDisableThresholdForVolumeResizeCK,
+ "0.90",
+ "Percentage (as a value between 0 and 1) of allocated storage utilization above which allocators will disable using the pool for volume resize. " +
+ "This is applicable only when volume.resize.allowed.beyond.allocation is set to true.",
+ true,
+ ConfigKey.Scope.Zone);
+
public boolean releaseVmCapacity(VirtualMachine vm, boolean moveFromReserved, boolean moveToReservered, Long hostId);
void allocateVmCapacity(VirtualMachine vm, boolean fromLastHost);
diff --git a/engine/components-api/src/main/java/com/cloud/ha/HighAvailabilityManager.java b/engine/components-api/src/main/java/com/cloud/ha/HighAvailabilityManager.java
index ae47b1d76ed..728f5a2b180 100644
--- a/engine/components-api/src/main/java/com/cloud/ha/HighAvailabilityManager.java
+++ b/engine/components-api/src/main/java/com/cloud/ha/HighAvailabilityManager.java
@@ -32,7 +32,7 @@ import java.util.List;
*/
public interface HighAvailabilityManager extends Manager {
- public ConfigKey ForceHA = new ConfigKey<>("Advanced", Boolean.class, "force.ha", "false",
+ ConfigKey ForceHA = new ConfigKey<>("Advanced", Boolean.class, "force.ha", "false",
"Force High-Availability to happen even if the VM says no.", true, Cluster);
ConfigKey HAWorkers = new ConfigKey<>("Advanced", Integer.class, "ha.workers", "5",
@@ -112,7 +112,7 @@ public interface HighAvailabilityManager extends Manager {
void cancelDestroy(VMInstanceVO vm, Long hostId);
- void scheduleDestroy(VMInstanceVO vm, long hostId);
+ boolean scheduleDestroy(VMInstanceVO vm, long hostId);
/**
* Schedule restarts for all vms running on the host.
@@ -143,7 +143,7 @@ public interface HighAvailabilityManager extends Manager {
* @param host host the virtual machine is on.
* @param type which type of stop is requested.
*/
- void scheduleStop(VMInstanceVO vm, long hostId, WorkType type);
+ boolean scheduleStop(VMInstanceVO vm, long hostId, WorkType type);
void cancelScheduledMigrations(HostVO host);
diff --git a/engine/components-api/src/main/java/com/cloud/network/vpc/VpcManager.java b/engine/components-api/src/main/java/com/cloud/network/vpc/VpcManager.java
index a340f49c13f..e7f02e62045 100644
--- a/engine/components-api/src/main/java/com/cloud/network/vpc/VpcManager.java
+++ b/engine/components-api/src/main/java/com/cloud/network/vpc/VpcManager.java
@@ -37,8 +37,26 @@ import com.cloud.network.PhysicalNetwork;
import com.cloud.network.addr.PublicIp;
import com.cloud.offering.NetworkOffering;
import com.cloud.user.Account;
+import org.apache.cloudstack.framework.config.ConfigKey;
public interface VpcManager {
+ ConfigKey VpcTierNamePrepend = new ConfigKey<>(Boolean.class,
+ "vpc.tier.name.prepend",
+ ConfigKey.CATEGORY_NETWORK,
+ "false",
+ "Whether to prepend the VPC name to the VPC tier network name",
+ true,
+ ConfigKey.Scope.Global,
+ null);
+ ConfigKey VpcTierNamePrependDelimiter = new ConfigKey<>(String.class,
+ "vpc.tier.name.prepend.delimiter",
+ ConfigKey.CATEGORY_NETWORK,
+ " ",
+ "Delimiter string to use between the VPC and the VPC tier name",
+ true,
+ ConfigKey.Scope.Global,
+ null);
+
/**
* Returns all the Guest networks that are part of VPC
*
diff --git a/engine/components-api/src/main/java/com/cloud/storage/StorageManager.java b/engine/components-api/src/main/java/com/cloud/storage/StorageManager.java
index c3909bc56b0..b5153668899 100644
--- a/engine/components-api/src/main/java/com/cloud/storage/StorageManager.java
+++ b/engine/components-api/src/main/java/com/cloud/storage/StorageManager.java
@@ -209,6 +209,11 @@ public interface StorageManager extends StorageService {
ConfigKey HEURISTICS_SCRIPT_TIMEOUT = new ConfigKey<>("Advanced", Long.class, "heuristics.script.timeout", "3000",
"The maximum runtime, in milliseconds, to execute the heuristic rule; if it is reached, a timeout will happen.", true);
+ ConfigKey AllowVolumeReSizeBeyondAllocation = new ConfigKey("Advanced", Boolean.class, "volume.resize.allowed.beyond.allocation", "false",
+ "Determines whether volume size can exceed the pool capacity allocation disable threshold (pool.storage.allocated.capacity.disablethreshold) " +
+ "when resize a volume upto resize capacity disable threshold (pool.storage.allocated.resize.capacity.disablethreshold)",
+ true, ConfigKey.Scope.Zone);
+
/**
* should we execute in sequence not involving any storages?
* @return tru if commands should execute in sequence
diff --git a/engine/components-api/src/main/java/com/cloud/vm/snapshot/VMSnapshotManager.java b/engine/components-api/src/main/java/com/cloud/vm/snapshot/VMSnapshotManager.java
index 82456004cc3..a01d4ee5cae 100644
--- a/engine/components-api/src/main/java/com/cloud/vm/snapshot/VMSnapshotManager.java
+++ b/engine/components-api/src/main/java/com/cloud/vm/snapshot/VMSnapshotManager.java
@@ -31,7 +31,7 @@ public interface VMSnapshotManager extends VMSnapshotService, Manager {
static final ConfigKey VMSnapshotExpireInterval = new ConfigKey("Advanced", Integer.class, "vmsnapshot.expire.interval", "-1",
"VM Snapshot expire interval in hours", true, ConfigKey.Scope.Account);
- public static final int VMSNAPSHOTMAX = 10;
+ ConfigKey VMSnapshotMax = new ConfigKey("Advanced", Integer.class, "vmsnapshot.max", "10", "Maximum vm snapshots for a single vm", true, ConfigKey.Scope.Global);
/**
* Delete all VM snapshots belonging to one VM
diff --git a/engine/orchestration/pom.xml b/engine/orchestration/pom.xml
index e4953fc0cbe..bf8ab14c952 100755
--- a/engine/orchestration/pom.xml
+++ b/engine/orchestration/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentAttache.java b/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentAttache.java
index 173fd9fc704..c0f7586aee0 100644
--- a/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentAttache.java
+++ b/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentAttache.java
@@ -47,6 +47,7 @@ import com.cloud.agent.api.CleanupNetworkRulesCmd;
import com.cloud.agent.api.Command;
import com.cloud.agent.api.CreateStoragePoolCommand;
import com.cloud.agent.api.DeleteStoragePoolCommand;
+import com.cloud.agent.api.HandleConfigDriveIsoCommand;
import com.cloud.agent.api.MaintainCommand;
import com.cloud.agent.api.MigrateCommand;
import com.cloud.agent.api.ModifySshKeysCommand;
@@ -122,11 +123,10 @@ public abstract class AgentAttache {
public final static String[] s_commandsAllowedInMaintenanceMode = new String[] { MaintainCommand.class.toString(), MigrateCommand.class.toString(),
StopCommand.class.toString(), CheckVirtualMachineCommand.class.toString(), PingTestCommand.class.toString(), CheckHealthCommand.class.toString(),
- ReadyCommand.class.toString(), ShutdownCommand.class.toString(), SetupCommand.class.toString(),
- CleanupNetworkRulesCmd.class.toString(), CheckNetworkCommand.class.toString(), PvlanSetupCommand.class.toString(), CheckOnHostCommand.class.toString(),
- ModifyTargetsCommand.class.toString(), ModifySshKeysCommand.class.toString(),
- CreateStoragePoolCommand.class.toString(), DeleteStoragePoolCommand.class.toString(), ModifyStoragePoolCommand.class.toString(),
- SetupMSListCommand.class.toString(), RollingMaintenanceCommand.class.toString(), CleanupPersistentNetworkResourceCommand.class.toString()};
+ ReadyCommand.class.toString(), ShutdownCommand.class.toString(), SetupCommand.class.toString(), CleanupNetworkRulesCmd.class.toString(),
+ CheckNetworkCommand.class.toString(), PvlanSetupCommand.class.toString(), CheckOnHostCommand.class.toString(), ModifyTargetsCommand.class.toString(),
+ ModifySshKeysCommand.class.toString(), CreateStoragePoolCommand.class.toString(), DeleteStoragePoolCommand.class.toString(), ModifyStoragePoolCommand.class.toString(),
+ SetupMSListCommand.class.toString(), RollingMaintenanceCommand.class.toString(), CleanupPersistentNetworkResourceCommand.class.toString(), HandleConfigDriveIsoCommand.class.toString()};
protected final static String[] s_commandsNotAllowedInConnectingMode = new String[] { StartCommand.class.toString(), CreateCommand.class.toString() };
static {
Arrays.sort(s_commandsAllowedInMaintenanceMode);
diff --git a/engine/pom.xml b/engine/pom.xml
index 5e52544aeca..1df7d84284f 100644
--- a/engine/pom.xml
+++ b/engine/pom.xml
@@ -25,7 +25,7 @@
org.apache.cloudstack
cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/engine/schema/pom.xml b/engine/schema/pom.xml
index 82120ae70cc..8238da84835 100644
--- a/engine/schema/pom.xml
+++ b/engine/schema/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesCidrsDao.java b/engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesCidrsDao.java
index 55c454860ef..df5b6b5d647 100644
--- a/engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesCidrsDao.java
+++ b/engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesCidrsDao.java
@@ -29,4 +29,6 @@ public interface FirewallRulesCidrsDao extends GenericDao listByFirewallRuleId(long firewallRuleId);
+
+ void updateSourceCidrsForRule(Long firewallRuleId, List sourceCidrList);
}
diff --git a/engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java b/engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
index fdd1e0ec43a..6279289bdfe 100644
--- a/engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
+++ b/engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.List;
+import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Component;
import com.cloud.utils.db.DB;
@@ -45,7 +46,7 @@ public class FirewallRulesCidrsDaoImpl extends GenericDaoBase results = search(sc, null);
- List cidrs = new ArrayList(results.size());
+ List cidrs = new ArrayList<>(results.size());
for (FirewallRulesCidrsVO result : results) {
cidrs.add(result.getCidr());
}
@@ -63,9 +64,27 @@ public class FirewallRulesCidrsDaoImpl extends GenericDaoBase sourceCidrList) {
+ TransactionLegacy txn = TransactionLegacy.currentTxn();
+ txn.start();
+
+ SearchCriteria sc = CidrsSearch.create();
+ sc.setParameters("firewallRuleId", firewallRuleId);
+ remove(sc);
+
+ persist(firewallRuleId, sourceCidrList);
+
+ txn.commit();
+ }
+
@Override
@DB
public void persist(long firewallRuleId, List sourceCidrs) {
+ if (CollectionUtils.isEmpty(sourceCidrs)) {
+ return;
+ }
+
TransactionLegacy txn = TransactionLegacy.currentTxn();
txn.start();
diff --git a/engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesDaoImpl.java b/engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesDaoImpl.java
index 5eaa44ca012..feed641df77 100644
--- a/engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesDaoImpl.java
+++ b/engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesDaoImpl.java
@@ -258,9 +258,6 @@ public class FirewallRulesDaoImpl extends GenericDaoBase i
}
public void saveSourceCidrs(FirewallRuleVO firewallRule, List cidrList) {
- if (cidrList == null) {
- return;
- }
_firewallRulesCidrsDao.persist(firewallRule.getId(), cidrList);
}
diff --git a/engine/schema/src/main/java/com/cloud/network/rules/PortForwardingRuleVO.java b/engine/schema/src/main/java/com/cloud/network/rules/PortForwardingRuleVO.java
index e1a698881f3..576e2f8172e 100644
--- a/engine/schema/src/main/java/com/cloud/network/rules/PortForwardingRuleVO.java
+++ b/engine/schema/src/main/java/com/cloud/network/rules/PortForwardingRuleVO.java
@@ -25,6 +25,7 @@ import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
+import javax.persistence.Transient;
import com.cloud.utils.net.Ip;
@@ -47,21 +48,30 @@ public class PortForwardingRuleVO extends FirewallRuleVO implements PortForwardi
@Column(name = "instance_id")
private long virtualMachineId;
+ @Transient
+ List sourceCidrs;
+
public PortForwardingRuleVO() {
}
public PortForwardingRuleVO(String xId, long srcIpId, int srcPortStart, int srcPortEnd, Ip dstIp, int dstPortStart, int dstPortEnd, String protocol, long networkId,
- long accountId, long domainId, long instanceId) {
- super(xId, srcIpId, srcPortStart, srcPortEnd, protocol, networkId, accountId, domainId, Purpose.PortForwarding, null, null, null, null, null);
+ long accountId, long domainId, long instanceId, List sourceCidrs) {
+ super(xId, srcIpId, srcPortStart, srcPortEnd, protocol, networkId, accountId, domainId, Purpose.PortForwarding, sourceCidrs, null, null, null, null);
this.destinationIpAddress = dstIp;
this.virtualMachineId = instanceId;
this.destinationPortStart = dstPortStart;
this.destinationPortEnd = dstPortEnd;
+ this.sourceCidrs = sourceCidrs;
}
- public PortForwardingRuleVO(String xId, long srcIpId, int srcPort, Ip dstIp, int dstPort, String protocol, List sourceCidrs, long networkId, long accountId,
- long domainId, long instanceId) {
- this(xId, srcIpId, srcPort, srcPort, dstIp, dstPort, dstPort, protocol.toLowerCase(), networkId, accountId, domainId, instanceId);
+ public PortForwardingRuleVO(String xId, long srcIpId, int srcPortStart, int srcPortEnd, Ip dstIp, int dstPortStart, int dstPortEnd, String protocol, long networkId,
+ long accountId, long domainId, long instanceId) {
+ this(xId, srcIpId, srcPortStart, srcPortEnd, dstIp, dstPortStart, dstPortEnd, protocol.toLowerCase(), networkId, accountId, domainId, instanceId, null);
+ }
+
+ public PortForwardingRuleVO(String xId, long srcIpId, int srcPort, Ip dstIp, int dstPort, String protocol, long networkId, long accountId,
+ long domainId, long instanceId) {
+ this(xId, srcIpId, srcPort, srcPort, dstIp, dstPort, dstPort, protocol.toLowerCase(), networkId, accountId, domainId, instanceId, null);
}
@Override
@@ -106,4 +116,13 @@ public class PortForwardingRuleVO extends FirewallRuleVO implements PortForwardi
return null;
}
+ public void setSourceCidrList(List sourceCidrs) {
+ this.sourceCidrs = sourceCidrs;
+ }
+
+ @Override
+ public List getSourceCidrList() {
+ return sourceCidrs;
+ }
+
}
diff --git a/engine/schema/src/main/java/com/cloud/network/rules/dao/PortForwardingRulesDaoImpl.java b/engine/schema/src/main/java/com/cloud/network/rules/dao/PortForwardingRulesDaoImpl.java
index aa46015acff..637f47731b4 100644
--- a/engine/schema/src/main/java/com/cloud/network/rules/dao/PortForwardingRulesDaoImpl.java
+++ b/engine/schema/src/main/java/com/cloud/network/rules/dao/PortForwardingRulesDaoImpl.java
@@ -31,6 +31,9 @@ import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.SearchCriteria.Op;
+import com.cloud.utils.db.Transaction;
+import com.cloud.utils.db.TransactionCallback;
+import com.cloud.utils.db.TransactionLegacy;
@Component
public class PortForwardingRulesDaoImpl extends GenericDaoBase implements PortForwardingRulesDao {
@@ -42,7 +45,7 @@ public class PortForwardingRulesDaoImpl extends GenericDaoBase ActiveRulesSearchByAccount;
@Inject
- protected FirewallRulesCidrsDao _portForwardingRulesCidrsDao;
+ protected FirewallRulesCidrsDao portForwardingRulesCidrsDao;
protected PortForwardingRulesDaoImpl() {
super();
@@ -194,4 +197,43 @@ public class PortForwardingRulesDaoImpl extends GenericDaoBase) transactionStatus -> {
+ PortForwardingRuleVO dbPfRule = super.persist(portForwardingRule);
+
+ portForwardingRulesCidrsDao.persist(portForwardingRule.getId(), portForwardingRule.getSourceCidrList());
+ List cidrList = portForwardingRulesCidrsDao.getSourceCidrs(portForwardingRule.getId());
+ portForwardingRule.setSourceCidrList(cidrList);
+
+ return dbPfRule;
+ });
+
+ }
+
+ @Override
+ public boolean update(Long id, PortForwardingRuleVO entity) {
+ TransactionLegacy txn = TransactionLegacy.currentTxn();
+ txn.start();
+
+ boolean success = super.update(id, entity);
+ if (!success) {
+ return false;
+ }
+
+ portForwardingRulesCidrsDao.updateSourceCidrsForRule(entity.getId(), entity.getSourceCidrList());
+ txn.commit();
+
+ return true;
+ }
+
+ @Override
+ public PortForwardingRuleVO findById(Long id) {
+ PortForwardingRuleVO rule = super.findById(id);
+
+ List sourceCidrList = portForwardingRulesCidrsDao.getSourceCidrs(id);
+ rule.setSourceCidrList(sourceCidrList);
+
+ return rule;
+ }
}
diff --git a/engine/schema/src/main/java/com/cloud/projects/dao/ProjectAccountDao.java b/engine/schema/src/main/java/com/cloud/projects/dao/ProjectAccountDao.java
index 730182a1cb5..f4b2f646002 100644
--- a/engine/schema/src/main/java/com/cloud/projects/dao/ProjectAccountDao.java
+++ b/engine/schema/src/main/java/com/cloud/projects/dao/ProjectAccountDao.java
@@ -47,6 +47,8 @@ public interface ProjectAccountDao extends GenericDao {
void removeAccountFromProjects(long accountId);
+ void removeUserFromProjects(long userId);
+
boolean canUserModifyProject(long projectId, long accountId, long userId);
List listUsersOrAccountsByRole(long id);
diff --git a/engine/schema/src/main/java/com/cloud/projects/dao/ProjectAccountDaoImpl.java b/engine/schema/src/main/java/com/cloud/projects/dao/ProjectAccountDaoImpl.java
index 8947cc600b3..b6eb6d44cea 100644
--- a/engine/schema/src/main/java/com/cloud/projects/dao/ProjectAccountDaoImpl.java
+++ b/engine/schema/src/main/java/com/cloud/projects/dao/ProjectAccountDaoImpl.java
@@ -192,6 +192,17 @@ public class ProjectAccountDaoImpl extends GenericDaoBase sc = AllFieldsSearch.create();
+ sc.setParameters("userId", userId);
+
+ int removedCount = remove(sc);
+ if (removedCount > 0) {
+ logger.debug(String.format("Removed user [%s] from %s project(s).", userId, removedCount));
+ }
+ }
+
@Override
public boolean canUserModifyProject(long projectId, long accountId, long userId) {
SearchCriteria sc = AllFieldsSearch.create();
diff --git a/engine/schema/src/main/java/com/cloud/storage/VolumeVO.java b/engine/schema/src/main/java/com/cloud/storage/VolumeVO.java
index c105acf40b8..ea57ef91237 100644
--- a/engine/schema/src/main/java/com/cloud/storage/VolumeVO.java
+++ b/engine/schema/src/main/java/com/cloud/storage/VolumeVO.java
@@ -48,31 +48,34 @@ public class VolumeVO implements Volume {
@TableGenerator(name = "volume_sq", table = "sequence", pkColumnName = "name", valueColumnName = "value", pkColumnValue = "volume_seq", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.TABLE)
@Column(name = "id")
- long id;
+ private long id;
+
+ @Column(name = "last_id")
+ private long lastId;
@Column(name = "name")
- String name;
+ private String name;
@Column(name = "pool_id")
- Long poolId;
+ private Long poolId;
@Column(name = "last_pool_id")
- Long lastPoolId;
+ private Long lastPoolId;
@Column(name = "account_id")
- long accountId;
+ private long accountId;
@Column(name = "domain_id")
- long domainId;
+ private long domainId;
@Column(name = "instance_id")
- Long instanceId = null;
+ private Long instanceId = null;
@Column(name = "device_id")
- Long deviceId = null;
+ private Long deviceId = null;
@Column(name = "size")
- Long size;
+ private Long size;
@Column(name = "min_iops")
private Long minIops;
@@ -81,50 +84,50 @@ public class VolumeVO implements Volume {
private Long maxIops;
@Column(name = "folder")
- String folder;
+ private String folder;
@Column(name = "path")
- String path;
+ private String path;
@Column(name = "pod_id")
- Long podId;
+ private Long podId;
@Column(name = "created")
- Date created;
+ private Date created;
@Column(name = "attached")
@Temporal(value = TemporalType.TIMESTAMP)
- Date attached;
+ private Date attached;
@Column(name = "data_center_id")
- long dataCenterId;
+ private long dataCenterId;
@Column(name = "host_ip")
- String hostip;
+ private String hostIp;
@Column(name = "disk_offering_id")
- long diskOfferingId;
+ private long diskOfferingId;
@Column(name = "template_id")
- Long templateId;
+ private Long templateId;
@Column(name = "first_snapshot_backup_uuid")
- String firstSnapshotBackupUuid;
+ private String firstSnapshotBackupUuid;
@Column(name = "volume_type")
@Enumerated(EnumType.STRING)
- Type volumeType = Volume.Type.UNKNOWN;
+ private Type volumeType = Volume.Type.UNKNOWN;
@Column(name = "pool_type")
@Convert(converter = StoragePoolTypeConverter.class)
- StoragePoolType poolType;
+ private StoragePoolType poolType;
@Column(name = GenericDao.REMOVED_COLUMN)
- Date removed;
+ private Date removed;
@Column(name = "updated")
@Temporal(value = TemporalType.TIMESTAMP)
- Date updated;
+ private Date updated;
@Column(name = "update_count", updatable = true, nullable = false)
protected long updatedCount; // This field should be updated everytime the
@@ -133,17 +136,17 @@ public class VolumeVO implements Volume {
// dao code.
@Column(name = "recreatable")
- boolean recreatable;
+ private boolean recreatable;
@Column(name = "state")
@Enumerated(value = EnumType.STRING)
private State state;
@Column(name = "chain_info", length = 65535)
- String chainInfo;
+ private String chainInfo;
@Column(name = "uuid")
- String uuid;
+ private String uuid;
@Column(name = "format")
private Storage.ImageFormat format;
@@ -168,7 +171,7 @@ public class VolumeVO implements Volume {
@Transient
// @Column(name="reservation")
- String reservationId;
+ private String reservationId;
@Column(name = "hv_ss_reserve")
private Integer hypervisorSnapshotReserve;
@@ -428,11 +431,11 @@ public class VolumeVO implements Volume {
}
public String getHostIp() {
- return hostip;
+ return hostIp;
}
public void setHostIp(String hostip) {
- this.hostip = hostip;
+ this.hostIp = hostip;
}
public void setPodId(Long podId) {
@@ -690,4 +693,12 @@ public class VolumeVO implements Volume {
public void setDeleteProtection(boolean deleteProtection) {
this.deleteProtection = deleteProtection;
}
+
+ public long getLastId() {
+ return lastId;
+ }
+
+ public void setLastId(long lastId) {
+ this.lastId = lastId;
+ }
}
diff --git a/engine/schema/src/main/java/com/cloud/storage/dao/VolumeStatsDaoImpl.java b/engine/schema/src/main/java/com/cloud/storage/dao/VolumeStatsDaoImpl.java
index d1149e47408..e4c19fd1666 100644
--- a/engine/schema/src/main/java/com/cloud/storage/dao/VolumeStatsDaoImpl.java
+++ b/engine/schema/src/main/java/com/cloud/storage/dao/VolumeStatsDaoImpl.java
@@ -126,14 +126,7 @@ public class VolumeStatsDaoImpl extends GenericDaoBase impl
logger.debug(String.format("Starting to remove all volume_stats rows older than [%s].", limitDate));
- long totalRemoved = 0;
- long removed;
-
- do {
- removed = expunge(sc, limitPerQuery);
- totalRemoved += removed;
- logger.trace(String.format("Removed [%s] volume_stats rows on the last update and a sum of [%s] volume_stats rows older than [%s] until now.", removed, totalRemoved, limitDate));
- } while (limitPerQuery > 0 && removed >= limitPerQuery);
+ long totalRemoved = batchExpunge(sc, limitPerQuery);
logger.info(String.format("Removed a total of [%s] volume_stats rows older than [%s].", totalRemoved, limitDate));
}
diff --git a/engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java b/engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java
index cb219007325..1e3b3a7e5ec 100644
--- a/engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java
+++ b/engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java
@@ -88,6 +88,8 @@ import com.cloud.upgrade.dao.Upgrade41800to41810;
import com.cloud.upgrade.dao.Upgrade41810to41900;
import com.cloud.upgrade.dao.Upgrade41900to41910;
import com.cloud.upgrade.dao.Upgrade41910to42000;
+import com.cloud.upgrade.dao.Upgrade42000to42010;
+import com.cloud.upgrade.dao.Upgrade42010to42100;
import com.cloud.upgrade.dao.Upgrade420to421;
import com.cloud.upgrade.dao.Upgrade421to430;
import com.cloud.upgrade.dao.Upgrade430to440;
@@ -230,6 +232,8 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
.next("4.18.1.0", new Upgrade41810to41900())
.next("4.19.0.0", new Upgrade41900to41910())
.next("4.19.1.0", new Upgrade41910to42000())
+ .next("4.20.0.0", new Upgrade42000to42010())
+ .next("4.20.1.0", new Upgrade42010to42100())
.build();
}
diff --git a/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41910to41920.java b/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41910to41920.java
new file mode 100644
index 00000000000..6215021473e
--- /dev/null
+++ b/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41910to41920.java
@@ -0,0 +1,66 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.upgrade.dao;
+
+import com.cloud.utils.exception.CloudRuntimeException;
+
+import java.io.InputStream;
+import java.sql.Connection;
+
+public class Upgrade41910to41920 implements DbUpgrade {
+
+ @Override
+ public String[] getUpgradableVersionRange() {
+ return new String[]{"4.19.1.0", "4.19.2.0"};
+ }
+
+ @Override
+ public String getUpgradedVersion() {
+ return "4.19.2.0";
+ }
+
+ @Override
+ public boolean supportsRollingUpgrade() {
+ return false;
+ }
+
+ @Override
+ public InputStream[] getPrepareScripts() {
+ final String scriptFile = "META-INF/db/schema-41910to41920.sql";
+ final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find " + scriptFile);
+ }
+
+ return new InputStream[]{script};
+ }
+
+ @Override
+ public void performDataMigration(Connection conn) {
+ }
+
+ @Override
+ public InputStream[] getCleanupScripts() {
+ final String scriptFile = "META-INF/db/schema-41910to41920-cleanup.sql";
+ final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find " + scriptFile);
+ }
+
+ return new InputStream[]{script};
+ }
+}
diff --git a/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42000to42010.java b/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42000to42010.java
new file mode 100644
index 00000000000..197ca1cb34c
--- /dev/null
+++ b/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42000to42010.java
@@ -0,0 +1,83 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.upgrade.dao;
+
+import java.io.InputStream;
+import java.sql.Connection;
+
+import com.cloud.upgrade.SystemVmTemplateRegistration;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+public class Upgrade42000to42010 extends DbUpgradeAbstractImpl implements DbUpgrade, DbUpgradeSystemVmTemplate {
+ private SystemVmTemplateRegistration systemVmTemplateRegistration;
+
+ @Override
+ public String[] getUpgradableVersionRange() {
+ return new String[] {"4.20.0.0", "4.20.1.0"};
+ }
+
+ @Override
+ public String getUpgradedVersion() {
+ return "4.20.1.0";
+ }
+
+ @Override
+ public boolean supportsRollingUpgrade() {
+ return false;
+ }
+
+ @Override
+ public InputStream[] getPrepareScripts() {
+ final String scriptFile = "META-INF/db/schema-42000to42010.sql";
+ final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find " + scriptFile);
+ }
+
+ return new InputStream[] {script};
+ }
+
+ @Override
+ public void performDataMigration(Connection conn) {
+ }
+
+ @Override
+ public InputStream[] getCleanupScripts() {
+ final String scriptFile = "META-INF/db/schema-42000to42010-cleanup.sql";
+ final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find " + scriptFile);
+ }
+
+ return new InputStream[] {script};
+ }
+
+ private void initSystemVmTemplateRegistration() {
+ systemVmTemplateRegistration = new SystemVmTemplateRegistration("");
+ }
+
+ @Override
+ public void updateSystemVmTemplates(Connection conn) {
+ logger.debug("Updating System Vm template IDs");
+ initSystemVmTemplateRegistration();
+ try {
+ systemVmTemplateRegistration.updateSystemVmTemplates(conn);
+ } catch (Exception e) {
+ throw new CloudRuntimeException("Failed to find / register SystemVM template(s)");
+ }
+ }
+}
diff --git a/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42010to42100.java b/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42010to42100.java
new file mode 100644
index 00000000000..06a68ec3d8b
--- /dev/null
+++ b/engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42010to42100.java
@@ -0,0 +1,83 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.upgrade.dao;
+
+import com.cloud.upgrade.SystemVmTemplateRegistration;
+import com.cloud.utils.exception.CloudRuntimeException;
+
+import java.io.InputStream;
+import java.sql.Connection;
+
+public class Upgrade42010to42100 extends DbUpgradeAbstractImpl implements DbUpgrade, DbUpgradeSystemVmTemplate {
+ private SystemVmTemplateRegistration systemVmTemplateRegistration;
+
+ @Override
+ public String[] getUpgradableVersionRange() {
+ return new String[] {"4.20.1.0", "4.21.0.0"};
+ }
+
+ @Override
+ public String getUpgradedVersion() {
+ return "4.21.0.0";
+ }
+
+ @Override
+ public boolean supportsRollingUpgrade() {
+ return false;
+ }
+
+ @Override
+ public InputStream[] getPrepareScripts() {
+ final String scriptFile = "META-INF/db/schema-42010to42100.sql";
+ final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find " + scriptFile);
+ }
+
+ return new InputStream[] {script};
+ }
+
+ @Override
+ public void performDataMigration(Connection conn) {
+ }
+
+ @Override
+ public InputStream[] getCleanupScripts() {
+ final String scriptFile = "META-INF/db/schema-42010to42100-cleanup.sql";
+ final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
+ if (script == null) {
+ throw new CloudRuntimeException("Unable to find " + scriptFile);
+ }
+
+ return new InputStream[] {script};
+ }
+
+ private void initSystemVmTemplateRegistration() {
+ systemVmTemplateRegistration = new SystemVmTemplateRegistration("");
+ }
+
+ @Override
+ public void updateSystemVmTemplates(Connection conn) {
+ logger.debug("Updating System Vm template IDs");
+ initSystemVmTemplateRegistration();
+ try {
+ systemVmTemplateRegistration.updateSystemVmTemplates(conn);
+ } catch (Exception e) {
+ throw new CloudRuntimeException("Failed to find / register SystemVM template(s)");
+ }
+ }
+}
diff --git a/engine/schema/src/main/java/com/cloud/user/AccountVO.java b/engine/schema/src/main/java/com/cloud/user/AccountVO.java
index f04b2bafbde..74a538565d7 100644
--- a/engine/schema/src/main/java/com/cloud/user/AccountVO.java
+++ b/engine/schema/src/main/java/com/cloud/user/AccountVO.java
@@ -77,6 +77,9 @@ public class AccountVO implements Account {
@Column(name = "default")
boolean isDefault;
+ @Column(name = "api_key_access")
+ private Boolean apiKeyAccess;
+
public AccountVO() {
uuid = UUID.randomUUID().toString();
}
@@ -229,4 +232,14 @@ public class AccountVO implements Account {
public String reflectionToString() {
return ReflectionToStringBuilderUtils.reflectOnlySelectedFields(this, "id", "uuid", "accountName", "domainId");
}
+
+ @Override
+ public void setApiKeyAccess(Boolean apiKeyAccess) {
+ this.apiKeyAccess = apiKeyAccess;
+ }
+
+ @Override
+ public Boolean getApiKeyAccess() {
+ return apiKeyAccess;
+ }
}
diff --git a/engine/schema/src/main/java/com/cloud/user/UserVO.java b/engine/schema/src/main/java/com/cloud/user/UserVO.java
index 69970bf2d2c..7dac26429ac 100644
--- a/engine/schema/src/main/java/com/cloud/user/UserVO.java
+++ b/engine/schema/src/main/java/com/cloud/user/UserVO.java
@@ -115,6 +115,9 @@ public class UserVO implements User, Identity, InternalIdentity {
@Column(name = "key_for_2fa")
private String keyFor2fa;
+ @Column(name = "api_key_access")
+ private Boolean apiKeyAccess;
+
public UserVO() {
this.uuid = UUID.randomUUID().toString();
}
@@ -350,4 +353,13 @@ public class UserVO implements User, Identity, InternalIdentity {
this.user2faProvider = user2faProvider;
}
+ @Override
+ public void setApiKeyAccess(Boolean apiKeyAccess) {
+ this.apiKeyAccess = apiKeyAccess;
+ }
+
+ @Override
+ public Boolean getApiKeyAccess() {
+ return apiKeyAccess;
+ }
}
diff --git a/engine/schema/src/main/java/com/cloud/user/dao/AccountDaoImpl.java b/engine/schema/src/main/java/com/cloud/user/dao/AccountDaoImpl.java
index eed5572a0b2..f9ef5c40eba 100644
--- a/engine/schema/src/main/java/com/cloud/user/dao/AccountDaoImpl.java
+++ b/engine/schema/src/main/java/com/cloud/user/dao/AccountDaoImpl.java
@@ -41,8 +41,8 @@ import java.util.List;
@Component
public class AccountDaoImpl extends GenericDaoBase implements AccountDao {
- private static final String FIND_USER_ACCOUNT_BY_API_KEY = "SELECT u.id, u.username, u.account_id, u.secret_key, u.state, "
- + "a.id, a.account_name, a.type, a.role_id, a.domain_id, a.state " + "FROM `cloud`.`user` u, `cloud`.`account` a "
+ private static final String FIND_USER_ACCOUNT_BY_API_KEY = "SELECT u.id, u.username, u.account_id, u.secret_key, u.state, u.api_key_access, "
+ + "a.id, a.account_name, a.type, a.role_id, a.domain_id, a.state, a.api_key_access " + "FROM `cloud`.`user` u, `cloud`.`account` a "
+ "WHERE u.account_id = a.id AND u.api_key = ? and u.removed IS NULL";
protected final SearchBuilder AllFieldsSearch;
@@ -148,13 +148,25 @@ public class AccountDaoImpl extends GenericDaoBase implements A
u.setAccountId(rs.getLong(3));
u.setSecretKey(DBEncryptionUtil.decrypt(rs.getString(4)));
u.setState(State.getValueOf(rs.getString(5)));
+ boolean apiKeyAccess = rs.getBoolean(6);
+ if (rs.wasNull()) {
+ u.setApiKeyAccess(null);
+ } else {
+ u.setApiKeyAccess(apiKeyAccess);
+ }
- AccountVO a = new AccountVO(rs.getLong(6));
- a.setAccountName(rs.getString(7));
- a.setType(Account.Type.getFromValue(rs.getInt(8)));
- a.setRoleId(rs.getLong(9));
- a.setDomainId(rs.getLong(10));
- a.setState(State.getValueOf(rs.getString(11)));
+ AccountVO a = new AccountVO(rs.getLong(7));
+ a.setAccountName(rs.getString(8));
+ a.setType(Account.Type.getFromValue(rs.getInt(9)));
+ a.setRoleId(rs.getLong(10));
+ a.setDomainId(rs.getLong(11));
+ a.setState(State.getValueOf(rs.getString(12)));
+ apiKeyAccess = rs.getBoolean(13);
+ if (rs.wasNull()) {
+ a.setApiKeyAccess(null);
+ } else {
+ a.setApiKeyAccess(apiKeyAccess);
+ }
userAcctPair = new Pair(u, a);
}
diff --git a/engine/schema/src/main/java/com/cloud/vm/ConsoleSessionVO.java b/engine/schema/src/main/java/com/cloud/vm/ConsoleSessionVO.java
index 81a11241e4b..ef777be2de9 100644
--- a/engine/schema/src/main/java/com/cloud/vm/ConsoleSessionVO.java
+++ b/engine/schema/src/main/java/com/cloud/vm/ConsoleSessionVO.java
@@ -64,6 +64,12 @@ public class ConsoleSessionVO {
@Column(name = "removed")
private Date removed;
+ @Column(name = "console_endpoint_creator_address")
+ private String consoleEndpointCreatorAddress;
+
+ @Column(name = "client_address")
+ private String clientAddress;
+
public long getId() {
return id;
}
@@ -135,4 +141,20 @@ public class ConsoleSessionVO {
public void setAcquired(Date acquired) {
this.acquired = acquired;
}
+
+ public String getConsoleEndpointCreatorAddress() {
+ return consoleEndpointCreatorAddress;
+ }
+
+ public void setConsoleEndpointCreatorAddress(String consoleEndpointCreatorAddress) {
+ this.consoleEndpointCreatorAddress = consoleEndpointCreatorAddress;
+ }
+
+ public String getClientAddress() {
+ return clientAddress;
+ }
+
+ public void setClientAddress(String clientAddress) {
+ this.clientAddress = clientAddress;
+ }
}
diff --git a/engine/schema/src/main/java/com/cloud/vm/dao/ConsoleSessionDao.java b/engine/schema/src/main/java/com/cloud/vm/dao/ConsoleSessionDao.java
index 79158dd13b2..95ced889b3d 100644
--- a/engine/schema/src/main/java/com/cloud/vm/dao/ConsoleSessionDao.java
+++ b/engine/schema/src/main/java/com/cloud/vm/dao/ConsoleSessionDao.java
@@ -33,7 +33,7 @@ public interface ConsoleSessionDao extends GenericDao {
int expungeSessionsOlderThanDate(Date date);
- void acquireSession(String sessionUuid);
+ void acquireSession(String sessionUuid, String clientAddress);
int expungeByVmList(List vmIds, Long batchSize);
}
diff --git a/engine/schema/src/main/java/com/cloud/vm/dao/ConsoleSessionDaoImpl.java b/engine/schema/src/main/java/com/cloud/vm/dao/ConsoleSessionDaoImpl.java
index 48709674451..3d117894670 100644
--- a/engine/schema/src/main/java/com/cloud/vm/dao/ConsoleSessionDaoImpl.java
+++ b/engine/schema/src/main/java/com/cloud/vm/dao/ConsoleSessionDaoImpl.java
@@ -62,9 +62,10 @@ public class ConsoleSessionDaoImpl extends GenericDaoBase implements V
logger.debug(String.format("Starting to remove all vm_stats rows older than [%s].", limitDate));
- long totalRemoved = 0;
- long removed;
-
- do {
- removed = expunge(sc, limitPerQuery);
- totalRemoved += removed;
- logger.trace(String.format("Removed [%s] vm_stats rows on the last update and a sum of [%s] vm_stats rows older than [%s] until now.", removed, totalRemoved, limitDate));
- } while (limitPerQuery > 0 && removed >= limitPerQuery);
+ long totalRemoved = batchExpunge(sc, limitPerQuery);
logger.info(String.format("Removed a total of [%s] vm_stats rows older than [%s].", totalRemoved, limitDate));
}
diff --git a/engine/schema/src/main/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml b/engine/schema/src/main/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
index 171685ce413..4f22234d7bf 100644
--- a/engine/schema/src/main/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
+++ b/engine/schema/src/main/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
@@ -117,6 +117,7 @@
+
diff --git a/engine/schema/src/main/resources/META-INF/db/procedures/cloud.idempotent_add_foreign_key.sql b/engine/schema/src/main/resources/META-INF/db/procedures/cloud.idempotent_add_foreign_key.sql
new file mode 100644
index 00000000000..754c02acb93
--- /dev/null
+++ b/engine/schema/src/main/resources/META-INF/db/procedures/cloud.idempotent_add_foreign_key.sql
@@ -0,0 +1,28 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied. See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`;
+
+CREATE PROCEDURE `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY` (
+ IN in_table_name VARCHAR(200)
+ , IN in_key_name VARCHAR(200)
+ , IN in_foreign_key VARCHAR(200)
+ , IN in_references VARCHAR(1000)
+)
+BEGIN
+
+ DECLARE CONTINUE HANDLER FOR 1061 BEGIN END; SET @ddl = CONCAT_WS(' ', 'ALTER TABLE ', in_table_name, ' ADD CONSTRAINT ', in_key_name, ' FOREIGN KEY ', in_foreign_key, ' REFERENCES ', in_references, ' ON DELETE CASCADE'); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt; END;
diff --git a/engine/schema/src/main/resources/META-INF/db/schema-41910to41920-cleanup.sql b/engine/schema/src/main/resources/META-INF/db/schema-41910to41920-cleanup.sql
new file mode 100644
index 00000000000..cb317c69b79
--- /dev/null
+++ b/engine/schema/src/main/resources/META-INF/db/schema-41910to41920-cleanup.sql
@@ -0,0 +1,23 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied. See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+--;
+-- Schema upgrade cleanup from 4.19.1.0 to 4.19.2.0
+--;
+
+-- Delete `project_account` entries for users that were removed
+DELETE FROM `cloud`.`project_account` WHERE `user_id` IN (SELECT `id` FROM `cloud`.`user` WHERE `removed`);
diff --git a/engine/schema/src/main/resources/META-INF/db/schema-41910to41920.sql b/engine/schema/src/main/resources/META-INF/db/schema-41910to41920.sql
new file mode 100644
index 00000000000..2ce8ea99bd1
--- /dev/null
+++ b/engine/schema/src/main/resources/META-INF/db/schema-41910to41920.sql
@@ -0,0 +1,23 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied. See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+--;
+-- Schema upgrade from 4.19.1.0 to 4.19.2.0
+--;
+
+-- Add last_id to the volumes table
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.volumes', 'last_id', 'bigint(20) unsigned DEFAULT NULL');
diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42000to42010-cleanup.sql b/engine/schema/src/main/resources/META-INF/db/schema-42000to42010-cleanup.sql
new file mode 100644
index 00000000000..d187b6fa043
--- /dev/null
+++ b/engine/schema/src/main/resources/META-INF/db/schema-42000to42010-cleanup.sql
@@ -0,0 +1,20 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied. See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+--;
+-- Schema upgrade cleanup from 4.20.0.0 to 4.20.1.0
+--;
diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42000to42010.sql b/engine/schema/src/main/resources/META-INF/db/schema-42000to42010.sql
new file mode 100644
index 00000000000..aef99dd0c7f
--- /dev/null
+++ b/engine/schema/src/main/resources/META-INF/db/schema-42000to42010.sql
@@ -0,0 +1,34 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied. See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+--;
+-- Schema upgrade from 4.20.0.0 to 4.20.1.0
+--;
+
+-- Add column api_key_access to user and account tables
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.user', 'api_key_access', 'boolean DEFAULT NULL COMMENT "is api key access allowed for the user" AFTER `secret_key`');
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.account', 'api_key_access', 'boolean DEFAULT NULL COMMENT "is api key access allowed for the account" ');
+
+-- Modify index for mshost_peer
+DELETE FROM `cloud`.`mshost_peer`;
+CALL `cloud`.`IDEMPOTENT_DROP_FOREIGN_KEY`('cloud.mshost_peer','fk_mshost_peer__owner_mshost');
+CALL `cloud`.`IDEMPOTENT_DROP_INDEX`('i_mshost_peer__owner_peer_runid','mshost_peer');
+CALL `cloud`.`IDEMPOTENT_ADD_UNIQUE_KEY`('cloud.mshost_peer', 'i_mshost_peer__owner_peer', '(owner_mshost, peer_mshost)');
+CALL `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`('cloud.mshost_peer', 'fk_mshost_peer__owner_mshost', '(owner_mshost)', '`mshost`(`id`)');
+
+-- Add last_id to the volumes table
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.volumes', 'last_id', 'bigint(20) unsigned DEFAULT NULL');
diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42010to42100-cleanup.sql b/engine/schema/src/main/resources/META-INF/db/schema-42010to42100-cleanup.sql
new file mode 100644
index 00000000000..5f257f2965b
--- /dev/null
+++ b/engine/schema/src/main/resources/META-INF/db/schema-42010to42100-cleanup.sql
@@ -0,0 +1,20 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied. See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+--;
+-- Schema upgrade cleanup from 4.20.1.0 to 4.21.0.0
+--;
diff --git a/engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql b/engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql
new file mode 100644
index 00000000000..91223bab798
--- /dev/null
+++ b/engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql
@@ -0,0 +1,26 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied. See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+--;
+-- Schema upgrade from 4.20.1.0 to 4.21.0.0
+--;
+
+-- Add console_endpoint_creator_address column to cloud.console_session table
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.console_session', 'console_endpoint_creator_address', 'VARCHAR(45)');
+
+-- Add client_address column to cloud.console_session table
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.console_session', 'client_address', 'VARCHAR(45)');
diff --git a/engine/schema/src/main/resources/META-INF/db/views/cloud.account_view.sql b/engine/schema/src/main/resources/META-INF/db/views/cloud.account_view.sql
index 87546a9d118..dc64380fb57 100644
--- a/engine/schema/src/main/resources/META-INF/db/views/cloud.account_view.sql
+++ b/engine/schema/src/main/resources/META-INF/db/views/cloud.account_view.sql
@@ -31,6 +31,7 @@ select
`account`.`cleanup_needed` AS `cleanup_needed`,
`account`.`network_domain` AS `network_domain` ,
`account`.`default` AS `default`,
+ `account`.`api_key_access` AS `api_key_access`,
`domain`.`id` AS `domain_id`,
`domain`.`uuid` AS `domain_uuid`,
`domain`.`name` AS `domain_name`,
diff --git a/engine/schema/src/main/resources/META-INF/db/views/cloud.mshost_peer_view.sql b/engine/schema/src/main/resources/META-INF/db/views/cloud.mshost_peer_view.sql
new file mode 100644
index 00000000000..5f741449d85
--- /dev/null
+++ b/engine/schema/src/main/resources/META-INF/db/views/cloud.mshost_peer_view.sql
@@ -0,0 +1,44 @@
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements. See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership. The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License. You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing,
+-- software distributed under the License is distributed on an
+-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+-- KIND, either express or implied. See the License for the
+-- specific language governing permissions and limitations
+-- under the License.
+
+
+DROP VIEW IF EXISTS `cloud`.`mshost_peer_view`;
+
+CREATE VIEW `cloud`.`mshost_peer_view` AS
+SELECT
+ `mshost_peer`.`id` AS `id`,
+ `mshost_peer`.`peer_state` AS `peer_state`,
+ `mshost_peer`.`last_update` AS `last_update`,
+ `owner_mshost`.`id` AS `owner_mshost_id`,
+ `owner_mshost`.`msid` AS `owner_mshost_msid`,
+ `owner_mshost`.`runid` AS `owner_mshost_runid`,
+ `owner_mshost`.`name` AS `owner_mshost_name`,
+ `owner_mshost`.`uuid` AS `owner_mshost_uuid`,
+ `owner_mshost`.`state` AS `owner_mshost_state`,
+ `owner_mshost`.`service_ip` AS `owner_mshost_service_ip`,
+ `owner_mshost`.`service_port` AS `owner_mshost_service_port`,
+ `peer_mshost`.`id` AS `peer_mshost_id`,
+ `peer_mshost`.`msid` AS `peer_mshost_msid`,
+ `peer_mshost`.`runid` AS `peer_mshost_runid`,
+ `peer_mshost`.`name` AS `peer_mshost_name`,
+ `peer_mshost`.`uuid` AS `peer_mshost_uuid`,
+ `peer_mshost`.`state` AS `peer_mshost_state`,
+ `peer_mshost`.`service_ip` AS `peer_mshost_service_ip`,
+ `peer_mshost`.`service_port` AS `peer_mshost_service_port`
+FROM `cloud`.`mshost_peer`
+LEFT JOIN `cloud`.`mshost` AS owner_mshost on `mshost_peer`.`owner_mshost` = `owner_mshost`.`id`
+LEFT JOIN `cloud`.`mshost` AS peer_mshost on `mshost_peer`.`peer_mshost` = `peer_mshost`.`id`;
diff --git a/engine/schema/src/main/resources/META-INF/db/views/cloud.user_view.sql b/engine/schema/src/main/resources/META-INF/db/views/cloud.user_view.sql
index 7eedc03712b..340cfa9055f 100644
--- a/engine/schema/src/main/resources/META-INF/db/views/cloud.user_view.sql
+++ b/engine/schema/src/main/resources/META-INF/db/views/cloud.user_view.sql
@@ -39,6 +39,7 @@ select
user.incorrect_login_attempts,
user.source,
user.default,
+ user.api_key_access,
account.id account_id,
account.uuid account_uuid,
account.account_name account_name,
diff --git a/engine/service/pom.xml b/engine/service/pom.xml
index 34221e1001d..83179d2db65 100644
--- a/engine/service/pom.xml
+++ b/engine/service/pom.xml
@@ -22,7 +22,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
cloud-engine-service
war
diff --git a/engine/storage/cache/pom.xml b/engine/storage/cache/pom.xml
index a1b7aff7afd..60822f761bc 100644
--- a/engine/storage/cache/pom.xml
+++ b/engine/storage/cache/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/engine/storage/configdrive/pom.xml b/engine/storage/configdrive/pom.xml
index b14acf10138..e66f38cd6c3 100644
--- a/engine/storage/configdrive/pom.xml
+++ b/engine/storage/configdrive/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/engine/storage/datamotion/pom.xml b/engine/storage/datamotion/pom.xml
index 5620ca8ef70..ff1859a99d8 100644
--- a/engine/storage/datamotion/pom.xml
+++ b/engine/storage/datamotion/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java b/engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
index 07b53842640..3456731ef1c 100644
--- a/engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
+++ b/engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
@@ -1958,25 +1958,26 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
* - Full clones (no backing file): Take snapshot of the VM prior disk creation
* Return this information
*/
- protected void setVolumeMigrationOptions(VolumeInfo srcVolumeInfo, VolumeInfo destVolumeInfo,
- VirtualMachineTO vmTO, Host srcHost, StoragePoolVO destStoragePool) {
- if (!destStoragePool.isManaged()) {
- String srcVolumeBackingFile = getVolumeBackingFile(srcVolumeInfo);
-
- String srcPoolUuid = srcVolumeInfo.getDataStore().getUuid();
- StoragePoolVO srcPool = _storagePoolDao.findById(srcVolumeInfo.getPoolId());
- Storage.StoragePoolType srcPoolType = srcPool.getPoolType();
-
- MigrationOptions migrationOptions;
- if (StringUtils.isNotBlank(srcVolumeBackingFile)) {
- migrationOptions = createLinkedCloneMigrationOptions(srcVolumeInfo, destVolumeInfo,
- srcVolumeBackingFile, srcPoolUuid, srcPoolType);
- } else {
- migrationOptions = createFullCloneMigrationOptions(srcVolumeInfo, vmTO, srcHost, srcPoolUuid, srcPoolType);
- }
- migrationOptions.setTimeout(StorageManager.KvmStorageOnlineMigrationWait.value());
- destVolumeInfo.setMigrationOptions(migrationOptions);
+ protected void setVolumeMigrationOptions(VolumeInfo srcVolumeInfo, VolumeInfo destVolumeInfo, VirtualMachineTO vmTO, Host srcHost, StoragePoolVO destStoragePool,
+ MigrationOptions.Type migrationType) {
+ if (destStoragePool.isManaged()) {
+ return;
}
+
+ String srcVolumeBackingFile = getVolumeBackingFile(srcVolumeInfo);
+
+ String srcPoolUuid = srcVolumeInfo.getDataStore().getUuid();
+ StoragePoolVO srcPool = _storagePoolDao.findById(srcVolumeInfo.getPoolId());
+ Storage.StoragePoolType srcPoolType = srcPool.getPoolType();
+
+ MigrationOptions migrationOptions;
+ if (MigrationOptions.Type.LinkedClone.equals(migrationType)) {
+ migrationOptions = createLinkedCloneMigrationOptions(srcVolumeInfo, destVolumeInfo, srcVolumeBackingFile, srcPoolUuid, srcPoolType);
+ } else {
+ migrationOptions = createFullCloneMigrationOptions(srcVolumeInfo, vmTO, srcHost, srcPoolUuid, srcPoolType);
+ }
+ migrationOptions.setTimeout(StorageManager.KvmStorageOnlineMigrationWait.value());
+ destVolumeInfo.setMigrationOptions(migrationOptions);
}
/**
@@ -2007,6 +2008,7 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
Map srcVolumeInfoToDestVolumeInfo = new HashMap<>();
boolean managedStorageDestination = false;
+ boolean migrateNonSharedInc = false;
for (Map.Entry entry : volumeDataStoreMap.entrySet()) {
VolumeInfo srcVolumeInfo = entry.getKey();
DataStore destDataStore = entry.getValue();
@@ -2024,15 +2026,8 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
continue;
}
- VMTemplateVO vmTemplate = _vmTemplateDao.findById(vmInstance.getTemplateId());
- if (srcVolumeInfo.getTemplateId() != null &&
- Objects.nonNull(vmTemplate) &&
- !Arrays.asList(KVM_VM_IMPORT_DEFAULT_TEMPLATE_NAME, VM_IMPORT_DEFAULT_TEMPLATE_NAME).contains(vmTemplate.getName())) {
- logger.debug(String.format("Copying template [%s] of volume [%s] from source storage pool [%s] to target storage pool [%s].", srcVolumeInfo.getTemplateId(), srcVolumeInfo.getId(), sourceStoragePool.getId(), destStoragePool.getId()));
- copyTemplateToTargetFilesystemStorageIfNeeded(srcVolumeInfo, sourceStoragePool, destDataStore, destStoragePool, destHost);
- } else {
- logger.debug(String.format("Skipping copy template from source storage pool [%s] to target storage pool [%s] before migration due to volume [%s] does not have a template.", sourceStoragePool.getId(), destStoragePool.getId(), srcVolumeInfo.getId()));
- }
+ MigrationOptions.Type migrationType = decideMigrationTypeAndCopyTemplateIfNeeded(destHost, vmInstance, srcVolumeInfo, sourceStoragePool, destStoragePool, destDataStore);
+ migrateNonSharedInc = migrateNonSharedInc || MigrationOptions.Type.LinkedClone.equals(migrationType);
VolumeVO destVolume = duplicateVolumeOnAnotherStorage(srcVolume, destStoragePool);
VolumeInfo destVolumeInfo = _volumeDataFactory.getVolume(destVolume.getId(), destDataStore);
@@ -2044,7 +2039,7 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
// move the volume from Ready to Migrating
destVolumeInfo.processEvent(Event.MigrationRequested);
- setVolumeMigrationOptions(srcVolumeInfo, destVolumeInfo, vmTO, srcHost, destStoragePool);
+ setVolumeMigrationOptions(srcVolumeInfo, destVolumeInfo, vmTO, srcHost, destStoragePool, migrationType);
// create a volume on the destination storage
destDataStore.getDriver().createAsync(destDataStore, destVolumeInfo, null);
@@ -2059,7 +2054,7 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
_volumeDao.update(destVolume.getId(), destVolume);
- postVolumeCreationActions(srcVolumeInfo, destVolumeInfo, vmTO, srcHost);
+ postVolumeCreationActions(srcVolumeInfo, destVolumeInfo);
destVolumeInfo = _volumeDataFactory.getVolume(destVolume.getId(), destDataStore);
@@ -2083,8 +2078,8 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
migrateDiskInfo = configureMigrateDiskInfo(srcVolumeInfo, destPath, backingPath);
migrateDiskInfo.setSourceDiskOnStorageFileSystem(isStoragePoolTypeOfFile(sourceStoragePool));
migrateDiskInfoList.add(migrateDiskInfo);
- prepareDiskWithSecretConsumerDetail(vmTO, srcVolumeInfo, destVolumeInfo.getPath());
}
+ prepareDiskWithSecretConsumerDetail(vmTO, srcVolumeInfo, destVolumeInfo.getPath());
migrateStorage.put(srcVolumeInfo.getPath(), migrateDiskInfo);
@@ -2110,8 +2105,6 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
VMInstanceVO vm = _vmDao.findById(vmTO.getId());
boolean isWindows = _guestOsCategoryDao.findById(_guestOsDao.findById(vm.getGuestOSId()).getCategoryId()).getName().equalsIgnoreCase("Windows");
- boolean migrateNonSharedInc = isSourceAndDestinationPoolTypeOfNfs(volumeDataStoreMap);
-
MigrateCommand migrateCommand = new MigrateCommand(vmTO.getName(), destHost.getPrivateIpAddress(), isWindows, vmTO, true);
migrateCommand.setWait(StorageManager.KvmStorageOnlineMigrationWait.value());
migrateCommand.setMigrateStorage(migrateStorage);
@@ -2161,6 +2154,22 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
}
}
+ private MigrationOptions.Type decideMigrationTypeAndCopyTemplateIfNeeded(Host destHost, VMInstanceVO vmInstance, VolumeInfo srcVolumeInfo, StoragePoolVO sourceStoragePool, StoragePoolVO destStoragePool, DataStore destDataStore) {
+ VMTemplateVO vmTemplate = _vmTemplateDao.findById(vmInstance.getTemplateId());
+ String srcVolumeBackingFile = getVolumeBackingFile(srcVolumeInfo);
+ if (StringUtils.isNotBlank(srcVolumeBackingFile) && supportStoragePoolType(destStoragePool.getPoolType(), StoragePoolType.Filesystem) &&
+ srcVolumeInfo.getTemplateId() != null &&
+ Objects.nonNull(vmTemplate) &&
+ !Arrays.asList(KVM_VM_IMPORT_DEFAULT_TEMPLATE_NAME, VM_IMPORT_DEFAULT_TEMPLATE_NAME).contains(vmTemplate.getName())) {
+ logger.debug(String.format("Copying template [%s] of volume [%s] from source storage pool [%s] to target storage pool [%s].", srcVolumeInfo.getTemplateId(), srcVolumeInfo.getId(), sourceStoragePool.getId(), destStoragePool.getId()));
+ copyTemplateToTargetFilesystemStorageIfNeeded(srcVolumeInfo, sourceStoragePool, destDataStore, destStoragePool, destHost);
+ return MigrationOptions.Type.LinkedClone;
+ }
+ logger.debug(String.format("Skipping copy template from source storage pool [%s] to target storage pool [%s] before migration due to volume [%s] does not have a " +
+ "template or we are doing full clone migration.", sourceStoragePool.getId(), destStoragePool.getId(), srcVolumeInfo.getId()));
+ return MigrationOptions.Type.FullClone;
+ }
+
protected String formatMigrationElementsAsJsonToDisplayOnLog(String objectName, Object object, Object from, Object to){
return String.format("{%s: \"%s\", from: \"%s\", to:\"%s\"}", objectName, object, from, to);
}
@@ -2284,6 +2293,8 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
if (success) {
VolumeVO volumeVO = _volumeDao.findById(destVolumeInfo.getId());
volumeVO.setFormat(ImageFormat.QCOW2);
+ volumeVO.setLastId(srcVolumeInfo.getId());
+
_volumeDao.update(volumeVO.getId(), volumeVO);
_volumeService.copyPoliciesBetweenVolumesAndDestroySourceVolumeAfterMigration(Event.OperationSuccessed, null, srcVolumeInfo, destVolumeInfo, false);
@@ -2422,7 +2433,7 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
/**
* Handle post destination volume creation actions depending on the migrating volume type: full clone or linked clone
*/
- protected void postVolumeCreationActions(VolumeInfo srcVolumeInfo, VolumeInfo destVolumeInfo, VirtualMachineTO vmTO, Host srcHost) {
+ protected void postVolumeCreationActions(VolumeInfo srcVolumeInfo, VolumeInfo destVolumeInfo) {
MigrationOptions migrationOptions = destVolumeInfo.getMigrationOptions();
if (migrationOptions != null) {
if (migrationOptions.getType() == MigrationOptions.Type.LinkedClone && migrationOptions.isCopySrcTemplate()) {
@@ -2470,7 +2481,8 @@ public class StorageSystemDataMotionStrategy implements DataMotionStrategy {
throw new CloudRuntimeException("Destination storage pool with ID " + dataStore.getId() + " was not located.");
}
- if (srcStoragePoolVO.isManaged() && srcStoragePoolVO.getId() != destStoragePoolVO.getId()) {
+ boolean isSrcAndDestPoolPowerFlexStorage = srcStoragePoolVO.getPoolType().equals(Storage.StoragePoolType.PowerFlex) && destStoragePoolVO.getPoolType().equals(Storage.StoragePoolType.PowerFlex);
+ if (srcStoragePoolVO.isManaged() && !isSrcAndDestPoolPowerFlexStorage && srcStoragePoolVO.getId() != destStoragePoolVO.getId()) {
throw new CloudRuntimeException("Migrating a volume online with KVM from managed storage is not currently supported.");
}
diff --git a/engine/storage/image/pom.xml b/engine/storage/image/pom.xml
index 278b3672b2f..c5023e24534 100644
--- a/engine/storage/image/pom.xml
+++ b/engine/storage/image/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateServiceImpl.java b/engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
index 5e21f37f4d5..abc955c2e49 100644
--- a/engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
+++ b/engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
@@ -533,6 +533,11 @@ public class TemplateServiceImpl implements TemplateService {
logger.info("Skip downloading template " + tmplt.getUniqueName() + " since no url is specified.");
continue;
}
+ // if this is private template, skip sync to a new image store
+ if (isSkipTemplateStoreDownload(tmplt, zoneId)) {
+ logger.info("Skip sync downloading private template " + tmplt.getUniqueName() + " to a new image store");
+ continue;
+ }
// if this is a region store, and there is already an DOWNLOADED entry there without install_path information, which
// means that this is a duplicate entry from migration of previous NFS to staging.
diff --git a/engine/storage/integration-test/pom.xml b/engine/storage/integration-test/pom.xml
index a5bc225f4f6..ff0b64f5eaf 100644
--- a/engine/storage/integration-test/pom.xml
+++ b/engine/storage/integration-test/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/engine/storage/object/pom.xml b/engine/storage/object/pom.xml
index 7159a646fbb..97859ec68db 100644
--- a/engine/storage/object/pom.xml
+++ b/engine/storage/object/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/engine/storage/pom.xml b/engine/storage/pom.xml
index e16e88e235d..7588b61eb39 100644
--- a/engine/storage/pom.xml
+++ b/engine/storage/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/engine/storage/snapshot/pom.xml b/engine/storage/snapshot/pom.xml
index f29b43d8de0..db70d53647a 100644
--- a/engine/storage/snapshot/pom.xml
+++ b/engine/storage/snapshot/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java b/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java
index 1d3788a0301..09f569e6f19 100644
--- a/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java
+++ b/engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java
@@ -419,7 +419,7 @@ public class DefaultVMSnapshotStrategy extends ManagerBase implements VMSnapshot
if (answer != null && answer.getDetails() != null)
errMsg = errMsg + " due to " + answer.getDetails();
logger.error(errMsg);
- throw new CloudRuntimeException(errMsg);
+ throw new CloudRuntimeException(String.format("Unable to revert VM %s to snapshot %s.", userVm.getInstanceName(), vmSnapshotVO.getName()));
}
} catch (OperationTimedoutException e) {
logger.debug("Failed to revert vm snapshot", e);
diff --git a/engine/storage/volume/pom.xml b/engine/storage/volume/pom.xml
index a00c3314126..7709a7c2c5b 100644
--- a/engine/storage/volume/pom.xml
+++ b/engine/storage/volume/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java b/engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index 9a3319f79a3..3ca1d9201db 100644
--- a/engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@ -1720,6 +1720,7 @@ public class VolumeServiceImpl implements VolumeService {
newVol.setPassphraseId(volume.getPassphraseId());
newVol.setEncryptFormat(volume.getEncryptFormat());
}
+ newVol.setLastId(volume.getId());
return volDao.persist(newVol);
}
diff --git a/engine/userdata/cloud-init/pom.xml b/engine/userdata/cloud-init/pom.xml
index d4396ba382a..70e2d70f94b 100644
--- a/engine/userdata/cloud-init/pom.xml
+++ b/engine/userdata/cloud-init/pom.xml
@@ -23,7 +23,7 @@
cloud-engine
org.apache.cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/engine/userdata/pom.xml b/engine/userdata/pom.xml
index 038aa18f290..a97a308c1ab 100644
--- a/engine/userdata/pom.xml
+++ b/engine/userdata/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloud-engine
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/framework/agent-lb/pom.xml b/framework/agent-lb/pom.xml
index 50e0bd47b90..14b692d6a45 100644
--- a/framework/agent-lb/pom.xml
+++ b/framework/agent-lb/pom.xml
@@ -24,7 +24,7 @@
cloudstack-framework
org.apache.cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/framework/ca/pom.xml b/framework/ca/pom.xml
index d82389cd008..691e9e3a9da 100644
--- a/framework/ca/pom.xml
+++ b/framework/ca/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/framework/cluster/pom.xml b/framework/cluster/pom.xml
index ef511584ae6..b2e89704c89 100644
--- a/framework/cluster/pom.xml
+++ b/framework/cluster/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/framework/cluster/src/main/java/com/cloud/cluster/ClusterManager.java b/framework/cluster/src/main/java/com/cloud/cluster/ClusterManager.java
index 54f575830e4..7fdaa6f7f77 100644
--- a/framework/cluster/src/main/java/com/cloud/cluster/ClusterManager.java
+++ b/framework/cluster/src/main/java/com/cloud/cluster/ClusterManager.java
@@ -27,9 +27,9 @@ import com.cloud.utils.component.Manager;
public interface ClusterManager extends Manager {
static final String ALERT_SUBJECT = "cluster-alert";
final ConfigKey HeartbeatInterval = new ConfigKey(Integer.class, "cluster.heartbeat.interval", "management-server", "1500",
- "Interval to check for the heart beat between management server nodes", false);
+ "Interval (in milliseconds) to check for the heart beat between management server nodes", false);
final ConfigKey HeartbeatThreshold = new ConfigKey(Integer.class, "cluster.heartbeat.threshold", "management-server", "150000",
- "Threshold before self-fence the management server", true);
+ "Threshold (in milliseconds) before self-fence the management server. The threshold should be larger than management.server.stats.interval", true);
/**
* Adds a new packet to the incoming queue.
diff --git a/framework/cluster/src/main/java/com/cloud/cluster/ClusterManagerImpl.java b/framework/cluster/src/main/java/com/cloud/cluster/ClusterManagerImpl.java
index 32fdf782696..0ec566a4194 100644
--- a/framework/cluster/src/main/java/com/cloud/cluster/ClusterManagerImpl.java
+++ b/framework/cluster/src/main/java/com/cloud/cluster/ClusterManagerImpl.java
@@ -758,21 +758,16 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
}
switch (msg.getMessageType()) {
- case nodeAdded: {
- final List l = msg.getNodes();
- if (l != null && l.size() > 0) {
- for (final ManagementServerHostVO mshost : l) {
- _mshostPeerDao.updatePeerInfo(_mshostId, mshost.getId(), mshost.getRunid(), ManagementServerHost.State.Up);
- }
- }
- }
+ case nodeAdded:
break;
case nodeRemoved: {
final List l = msg.getNodes();
if (l != null && l.size() > 0) {
for (final ManagementServerHostVO mshost : l) {
- _mshostPeerDao.updatePeerInfo(_mshostId, mshost.getId(), mshost.getRunid(), ManagementServerHost.State.Down);
+ if (mshost.getId() != _mshostId) {
+ _mshostPeerDao.updatePeerInfo(_mshostId, mshost.getId(), mshost.getRunid(), ManagementServerHost.State.Down);
+ }
}
}
}
@@ -823,8 +818,9 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
final List downHostList = new ArrayList();
for (final ManagementServerHostVO host : inactiveList) {
- if (!pingManagementNode(host)) {
- logger.warn("Management node " + host.getId() + " is detected inactive by timestamp and also not pingable");
+ // Check if peer state is Up in the period
+ if (!_mshostPeerDao.isPeerUpState(_mshostId, host.getId(), new Date(cutTime.getTime() - HeartbeatThreshold.value()))) {
+ logger.warn("Management node " + host.getId() + " is detected inactive by timestamp and did not send node status to this node");
downHostList.add(host);
}
}
@@ -898,6 +894,44 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
final Profiler profilerInvalidatedNodeList = new Profiler();
profilerInvalidatedNodeList.start();
+ processInvalidatedNodes(invalidatedNodeList);
+ profilerInvalidatedNodeList.stop();
+
+ final Profiler profilerRemovedList = new Profiler();
+ profilerRemovedList.start();
+ processRemovedNodes(cutTime, removedNodeList);
+ profilerRemovedList.stop();
+
+ final Profiler profilerNewList = new Profiler();
+ profilerNewList.start();
+ processNewNodes(cutTime, currentList);
+ profilerNewList.stop();
+
+ final Profiler profilerInactiveList = new Profiler();
+ profilerInactiveList.start();
+ processInactiveNodes(cutTime);
+ profilerInactiveList.stop();
+
+ profiler.stop();
+
+ logger.debug(String.format("Peer scan is finished. profiler: %s , profilerQueryActiveList: %s, " +
+ ", profilerSyncClusterInfo: %s, profilerInvalidatedNodeList: %s, profilerRemovedList: %s," +
+ ", profilerNewList: %s, profilerInactiveList: %s",
+ profiler, profilerQueryActiveList, profilerSyncClusterInfo, profilerInvalidatedNodeList, profilerRemovedList,
+ profilerNewList, profilerInactiveList));
+
+ if (profiler.getDurationInMillis() >= HeartbeatInterval.value()) {
+ if (logger.isDebugEnabled()) {
+ logger.debug(String.format("Peer scan takes too long to finish. profiler: %s , profilerQueryActiveList: %s, " +
+ ", profilerSyncClusterInfo: %s, profilerInvalidatedNodeList: %s, profilerRemovedList: %s," +
+ ", profilerNewList: %s, profilerInactiveList: %s",
+ profiler, profilerQueryActiveList, profilerSyncClusterInfo, profilerInvalidatedNodeList, profilerRemovedList,
+ profilerNewList, profilerInactiveList));
+ }
+ }
+ }
+
+ private void processInvalidatedNodes(List invalidatedNodeList) {
// process invalidated node list
if (invalidatedNodeList.size() > 0) {
for (final ManagementServerHostVO mshost : invalidatedNodeList) {
@@ -911,16 +945,16 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeRemoved, invalidatedNodeList));
}
- profilerInvalidatedNodeList.stop();
+ }
- final Profiler profilerRemovedList = new Profiler();
- profilerRemovedList.start();
+ private void processRemovedNodes(Date cutTime, List removedNodeList) {
// process removed node list
final Iterator it = removedNodeList.iterator();
while (it.hasNext()) {
final ManagementServerHostVO mshost = it.next();
- if (!pingManagementNode(mshost)) {
- logger.warn("Management node " + mshost.getId() + " is detected inactive by timestamp and also not pingable");
+ // Check if peer state is Up in the period
+ if (!_mshostPeerDao.isPeerUpState(_mshostId, mshost.getId(), new Date(cutTime.getTime() - HeartbeatThreshold.value()))) {
+ logger.warn("Management node " + mshost.getId() + " is detected inactive by timestamp and did not send node status to this node");
_activePeers.remove(mshost.getId());
try {
JmxUtil.unregisterMBean("ClusterManager", "Node " + mshost.getId());
@@ -928,7 +962,7 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
logger.warn("Unable to deregiester cluster node from JMX monitoring due to exception " + e.toString());
}
} else {
- logger.info("Management node " + mshost.getId() + " is detected inactive by timestamp but is pingable");
+ logger.info("Management node " + mshost.getId() + " is detected inactive by timestamp but sent node status to this node");
it.remove();
}
}
@@ -936,8 +970,9 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
if (removedNodeList.size() > 0) {
queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeRemoved, removedNodeList));
}
- profilerRemovedList.stop();
+ }
+ private void processNewNodes(Date cutTime, List currentList) {
final List newNodeList = new ArrayList();
for (final ManagementServerHostVO mshost : currentList) {
if (!_activePeers.containsKey(mshost.getId())) {
@@ -959,18 +994,31 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager, C
if (newNodeList.size() > 0) {
queueNotification(new ClusterManagerMessage(ClusterManagerMessage.MessageType.nodeAdded, newNodeList));
}
+ }
- profiler.stop();
-
- if (profiler.getDurationInMillis() >= HeartbeatInterval.value()) {
- if (logger.isDebugEnabled()) {
- logger.debug("Peer scan takes too long to finish. profiler: " + profiler.toString() + ", profilerQueryActiveList: " +
- profilerQueryActiveList.toString() + ", profilerSyncClusterInfo: " + profilerSyncClusterInfo.toString() + ", profilerInvalidatedNodeList: " +
- profilerInvalidatedNodeList.toString() + ", profilerRemovedList: " + profilerRemovedList.toString());
+ private void processInactiveNodes(Date cutTime) {
+ final List inactiveList = _mshostDao.getInactiveList(new Date(cutTime.getTime() - HeartbeatThreshold.value()));
+ if (inactiveList.size() > 0) {
+ if (logger.isInfoEnabled()) {
+ logger.info(String.format("Found %s inactive management server node based on timestamp", inactiveList.size()));
}
+ for (final ManagementServerHostVO host : inactiveList) {
+ logger.info(String.format("management server node msid: %s, name: %s, service ip: %s, version: %s",
+ host.getMsid(), host.getName(), host.getServiceIP(), host.getVersion()));
+ // Check if any peer state is Up in the period
+ if (ManagementServerHost.State.Up.equals(host.getState()) &&
+ !_mshostPeerDao.isPeerUpState(host.getId(), new Date(cutTime.getTime() - HeartbeatThreshold.value()))) {
+ logger.warn("Management node " + host.getId() + " is detected inactive by timestamp and did not send node status to all other nodes");
+ host.setState(ManagementServerHost.State.Down);
+ _mshostDao.update(host.getId(), host);
+ }
+ }
+ } else {
+ logger.info("No inactive management server node found");
}
}
+
private static ManagementServerHostVO getInListById(final Long id, final List l) {
for (final ManagementServerHostVO mshost : l) {
if (mshost.getId() == id) {
diff --git a/framework/cluster/src/main/java/com/cloud/cluster/ManagementServerHostPeerJoinVO.java b/framework/cluster/src/main/java/com/cloud/cluster/ManagementServerHostPeerJoinVO.java
new file mode 100644
index 00000000000..673db160b3c
--- /dev/null
+++ b/framework/cluster/src/main/java/com/cloud/cluster/ManagementServerHostPeerJoinVO.java
@@ -0,0 +1,177 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.cluster;
+
+import java.util.Date;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.apache.cloudstack.management.ManagementServerHost;
+
+@Entity
+@Table(name = "mshost_peer_view")
+public class ManagementServerHostPeerJoinVO {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id")
+ private long id;
+
+ @Column(name = "peer_state")
+ @Enumerated(value = EnumType.STRING)
+ private ManagementServerHost.State peerState;
+
+ @Temporal(TemporalType.TIMESTAMP)
+ @Column(name = "last_update")
+ private Date lastUpdateTime;
+
+ @Column(name = "owner_mshost_id")
+ private long ownerMshostId;
+
+ @Column(name = "owner_mshost_msid")
+ private long ownerMshostMsId;
+
+ @Column(name = "owner_mshost_runid")
+ private long ownerMshostRunId;
+
+ @Column(name = "owner_mshost_name")
+ private String ownerMshostName;
+
+ @Column(name = "owner_mshost_uuid")
+ private String ownerMshostUuid;
+
+ @Column(name = "owner_mshost_state")
+ private String ownerMshostState;
+
+ @Column(name = "owner_mshost_service_ip")
+ private String ownerMshostServiceIp;
+
+ @Column(name = "owner_mshost_service_port")
+ private Integer ownerMshostServicePort;
+
+ @Column(name = "peer_mshost_id")
+ private long peerMshostId;
+
+ @Column(name = "peer_mshost_msid")
+ private long peerMshostMsId;
+
+ @Column(name = "peer_mshost_runid")
+ private long peerMshostRunId;
+
+ @Column(name = "peer_mshost_name")
+ private String peerMshostName;
+
+ @Column(name = "peer_mshost_uuid")
+ private String peerMshostUuid;
+
+ @Column(name = "peer_mshost_state")
+ private String peerMshostState;
+
+ @Column(name = "peer_mshost_service_ip")
+ private String peerMshostServiceIp;
+
+ @Column(name = "peer_mshost_service_port")
+ private Integer peerMshostServicePort;
+
+ public ManagementServerHostPeerJoinVO() {
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public ManagementServerHost.State getPeerState() {
+ return peerState;
+ }
+
+ public Date getLastUpdateTime() {
+ return lastUpdateTime;
+ }
+
+ public long getOwnerMshostId() {
+ return ownerMshostId;
+ }
+
+ public long getOwnerMshostMsId() {
+ return ownerMshostMsId;
+ }
+
+ public long getOwnerMshostRunId() {
+ return ownerMshostRunId;
+ }
+
+ public String getOwnerMshostName() {
+ return ownerMshostName;
+ }
+
+ public String getOwnerMshostUuid() {
+ return ownerMshostUuid;
+ }
+
+ public String getOwnerMshostState() {
+ return ownerMshostState;
+ }
+
+ public String getOwnerMshostServiceIp() {
+ return ownerMshostServiceIp;
+ }
+
+ public Integer getOwnerMshostServicePort() {
+ return ownerMshostServicePort;
+ }
+
+ public long getPeerMshostId() {
+ return peerMshostId;
+ }
+
+ public long getPeerMshostMsId() {
+ return peerMshostMsId;
+ }
+
+ public long getPeerMshostRunId() {
+ return peerMshostRunId;
+ }
+
+ public String getPeerMshostName() {
+ return peerMshostName;
+ }
+
+ public String getPeerMshostUuid() {
+ return peerMshostUuid;
+ }
+
+ public String getPeerMshostState() {
+ return peerMshostState;
+ }
+
+ public String getPeerMshostServiceIp() {
+ return peerMshostServiceIp;
+ }
+
+ public Integer getPeerMshostServicePort() {
+ return peerMshostServicePort;
+ }
+}
diff --git a/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostDaoImpl.java b/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostDaoImpl.java
index 7b69889c853..27b6d52f61b 100644
--- a/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostDaoImpl.java
+++ b/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostDaoImpl.java
@@ -130,7 +130,7 @@ public class ManagementServerHostDaoImpl extends GenericDaoBase {
void clearPeerInfo(long ownerMshost);
void updatePeerInfo(long ownerMshost, long peerMshost, long peerRunid, ManagementServerHost.State peerState);
- int countStateSeenInPeers(long mshost, long runid, ManagementServerHost.State state);
+ int countStateSeenInPeers(long peerMshost, long runid, ManagementServerHost.State state);
+
+ boolean isPeerUpState(long peerMshost, Date cutTime);
+
+ boolean isPeerUpState(long ownerMshost, long peerMshost, Date cutTime);
+
}
diff --git a/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostPeerDaoImpl.java b/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostPeerDaoImpl.java
index 827be4fe299..ec69f5817ac 100644
--- a/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostPeerDaoImpl.java
+++ b/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostPeerDaoImpl.java
@@ -16,10 +16,10 @@
// under the License.
package com.cloud.cluster.dao;
+import java.util.Date;
import java.util.List;
-
import org.apache.cloudstack.management.ManagementServerHost;
import com.cloud.cluster.ManagementServerHostPeerVO;
import com.cloud.utils.db.DB;
@@ -33,10 +33,12 @@ public class ManagementServerHostPeerDaoImpl extends GenericDaoBase ClearPeerSearch;
private final SearchBuilder FindForUpdateSearch;
private final SearchBuilder CountSearch;
+ private final SearchBuilder ActiveSearch;
public ManagementServerHostPeerDaoImpl() {
ClearPeerSearch = createSearchBuilder();
ClearPeerSearch.and("ownerMshost", ClearPeerSearch.entity().getOwnerMshost(), SearchCriteria.Op.EQ);
+ ClearPeerSearch.or("peerMshost", ClearPeerSearch.entity().getPeerMshost(), SearchCriteria.Op.EQ);
ClearPeerSearch.done();
FindForUpdateSearch = createSearchBuilder();
@@ -50,6 +52,13 @@ public class ManagementServerHostPeerDaoImpl extends GenericDaoBase sc = ClearPeerSearch.create();
sc.setParameters("ownerMshost", ownerMshost);
+ sc.setParameters("peerMshost", ownerMshost);
expunge(sc);
}
@@ -71,11 +81,12 @@ public class ManagementServerHostPeerDaoImpl extends GenericDaoBase sc = FindForUpdateSearch.create();
sc.setParameters("ownerMshost", ownerMshost);
sc.setParameters("peerMshost", peerMshost);
- sc.setParameters("peerRunid", peerRunid);
List l = listBy(sc);
if (l.size() == 1) {
ManagementServerHostPeerVO peer = l.get(0);
+ peer.setPeerRunid(peerRunid);
peer.setPeerState(peerState);
+ peer.setLastUpdateTime(new Date());
update(peer.getId(), peer);
} else {
ManagementServerHostPeerVO peer = new ManagementServerHostPeerVO(ownerMshost, peerMshost, peerRunid, peerState);
@@ -90,13 +101,36 @@ public class ManagementServerHostPeerDaoImpl extends GenericDaoBase sc = CountSearch.create();
- sc.setParameters("peerMshost", mshost);
+ sc.setParameters("peerMshost", peerMshost);
sc.setParameters("peerRunid", runid);
sc.setParameters("peerState", state);
List l = listBy(sc);
return l.size();
}
+
+ @Override
+ @DB
+ public boolean isPeerUpState(long peerMshost, Date cutTime) {
+ SearchCriteria sc = ActiveSearch.create();
+ sc.setParameters("peerMshost", peerMshost);
+ sc.setParameters("peerState", ManagementServerHost.State.Up);
+ sc.setParameters("lastUpdateTime", cutTime);
+
+ return listBy(sc).size() > 0;
+ }
+
+ @Override
+ @DB
+ public boolean isPeerUpState(long ownerMshost, long peerMshost, Date cutTime) {
+ SearchCriteria sc = ActiveSearch.create();
+ sc.setParameters("ownerMshost", ownerMshost);
+ sc.setParameters("peerMshost", peerMshost);
+ sc.setParameters("peerState", ManagementServerHost.State.Up);
+ sc.setParameters("lastUpdateTime", cutTime);
+
+ return listBy(sc).size() > 0;
+ }
}
diff --git a/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostPeerJoinDao.java b/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostPeerJoinDao.java
new file mode 100644
index 00000000000..46f87b6484c
--- /dev/null
+++ b/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostPeerJoinDao.java
@@ -0,0 +1,27 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.cluster.dao;
+
+import com.cloud.cluster.ManagementServerHostPeerJoinVO;
+import com.cloud.utils.db.GenericDao;
+
+import java.util.List;
+
+public interface ManagementServerHostPeerJoinDao extends GenericDao {
+
+ List listByOwnerMshostId(long ownerMshostId);
+}
diff --git a/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostPeerJoinDaoImpl.java b/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostPeerJoinDaoImpl.java
new file mode 100644
index 00000000000..16a17863d04
--- /dev/null
+++ b/framework/cluster/src/main/java/com/cloud/cluster/dao/ManagementServerHostPeerJoinDaoImpl.java
@@ -0,0 +1,42 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.cluster.dao;
+
+import java.util.List;
+
+import com.cloud.cluster.ManagementServerHostPeerJoinVO;
+import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+
+public class ManagementServerHostPeerJoinDaoImpl extends GenericDaoBase implements ManagementServerHostPeerJoinDao {
+
+ private final SearchBuilder AllFieldSearch;
+
+ public ManagementServerHostPeerJoinDaoImpl() {
+ AllFieldSearch = createSearchBuilder();
+ AllFieldSearch.and("ownerMshostId", AllFieldSearch.entity().getOwnerMshostId(), SearchCriteria.Op.EQ);
+ AllFieldSearch.done();
+ }
+
+ @Override
+ public List listByOwnerMshostId(long ownerMshostId) {
+ SearchCriteria sc = AllFieldSearch.create();
+ sc.setParameters("ownerMshostId", ownerMshostId);
+ return listBy(sc);
+ }
+}
diff --git a/framework/config/pom.xml b/framework/config/pom.xml
index fc3b14642f1..403429380b6 100644
--- a/framework/config/pom.xml
+++ b/framework/config/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java b/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java
index 36a8050754c..00cf56345c8 100644
--- a/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java
+++ b/framework/config/src/main/java/org/apache/cloudstack/framework/config/ConfigKey.java
@@ -34,6 +34,7 @@ public class ConfigKey {
public static final String CATEGORY_ADVANCED = "Advanced";
public static final String CATEGORY_ALERT = "Alert";
public static final String CATEGORY_NETWORK = "Network";
+ public static final String CATEGORY_SYSTEM = "System";
public enum Scope {
Global, Zone, Cluster, StoragePool, Account, ManagementServer, ImageStore, Domain
diff --git a/framework/db/pom.xml b/framework/db/pom.xml
index 586d72f34f3..db6421a4717 100644
--- a/framework/db/pom.xml
+++ b/framework/db/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/framework/db/src/main/java/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java b/framework/db/src/main/java/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java
index 961c537d0da..e96b0a00894 100644
--- a/framework/db/src/main/java/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java
+++ b/framework/db/src/main/java/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java
@@ -656,7 +656,7 @@ public class EncryptionSecretKeyChanger {
String sqlTemplateDeployAsIsDetails = "SELECT template_deploy_as_is_details.value " +
"FROM template_deploy_as_is_details JOIN vm_instance " +
"WHERE template_deploy_as_is_details.template_id = vm_instance.vm_template_id " +
- "vm_instance.id = %s AND template_deploy_as_is_details.name = '%s' LIMIT 1";
+ "AND vm_instance.id = %s AND template_deploy_as_is_details.name = '%s' LIMIT 1";
try (PreparedStatement selectPstmt = conn.prepareStatement("SELECT id, vm_id, name, value FROM user_vm_deploy_as_is_details");
ResultSet rs = selectPstmt.executeQuery();
PreparedStatement updatePstmt = conn.prepareStatement("UPDATE user_vm_deploy_as_is_details SET value=? WHERE id=?")
diff --git a/framework/db/src/main/java/com/cloud/utils/db/GenericDao.java b/framework/db/src/main/java/com/cloud/utils/db/GenericDao.java
index 84750c2068c..de8838b0999 100644
--- a/framework/db/src/main/java/com/cloud/utils/db/GenericDao.java
+++ b/framework/db/src/main/java/com/cloud/utils/db/GenericDao.java
@@ -247,14 +247,6 @@ public interface GenericDao {
int expungeList(List ids);
- /**
- * Delete the entity beans specified by the search criteria with a given limit
- * @param sc Search criteria
- * @param limit Maximum number of rows that will be affected
- * @return Number of rows deleted
- */
- int expunge(SearchCriteria sc, long limit);
-
/**
* expunge the removed rows.
*/
diff --git a/framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java b/framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java
index 52a6b204ee8..82fea9749ff 100644
--- a/framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java
+++ b/framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java
@@ -1244,13 +1244,6 @@ public abstract class GenericDaoBase extends Compone
}
}
- // FIXME: Does not work for joins.
- @Override
- public int expunge(final SearchCriteria sc, long limit) {
- Filter filter = new Filter(limit);
- return expunge(sc, filter);
- }
-
@Override
public int expunge(final SearchCriteria sc, final Filter filter) {
if (sc == null) {
@@ -1400,22 +1393,39 @@ public abstract class GenericDaoBase extends Compone
onClause.append("?");
joinAttrList.add(join.getFirstAttributes()[i]);
} else {
- onClause.append(joinedTableNames.getOrDefault(join.getFirstAttributes()[i].table, join.getFirstAttributes()[i].table))
- .append(".")
- .append(join.getFirstAttributes()[i].columnName);
- }
- onClause.append("=");
- if (join.getSecondAttribute()[i].getValue() != null) {
- onClause.append("?");
- joinAttrList.add(join.getSecondAttribute()[i]);
- } else {
- if(!joinTableAlias.equals(joinTableName)) {
- onClause.append(joinTableAlias);
+ if ((join.getFirstAttributes()[i].table == null && join.getFirstAttributes()[i].value == null) ||
+ (join.getSecondAttribute()[i].table == null && join.getSecondAttribute()[i].value == null)) {
+ onClause.append(joinedTableNames.getOrDefault(join.getSecondAttribute()[i].table, join.getFirstAttributes()[i].table))
+ .append(".");
+ if (join.getFirstAttributes()[i].table == null && join.getFirstAttributes()[i].value == null) {
+ onClause.append(join.getSecondAttribute()[i].columnName);
+ } else {
+ onClause.append(join.getFirstAttributes()[i].columnName);
+ }
+
} else {
- onClause.append(joinTableName);
+ onClause.append(joinedTableNames.getOrDefault(join.getFirstAttributes()[i].table, join.getFirstAttributes()[i].table))
+ .append(".")
+ .append(join.getFirstAttributes()[i].columnName);
+ }
+ }
+ if ((join.getFirstAttributes()[i].table == null && join.getFirstAttributes()[i].value == null) ||
+ (join.getSecondAttribute()[i].table == null && join.getSecondAttribute()[i].value == null)) {
+ onClause.append(" IS NULL");
+ } else {
+ onClause.append("=");
+ if (join.getSecondAttribute()[i].getValue() != null) {
+ onClause.append("?");
+ joinAttrList.add(join.getSecondAttribute()[i]);
+ } else {
+ if (!joinTableAlias.equals(joinTableName)) {
+ onClause.append(joinTableAlias);
+ } else {
+ onClause.append(joinTableName);
+ }
+ onClause.append(".")
+ .append(join.getSecondAttribute()[i].columnName);
}
- onClause.append(".")
- .append(join.getSecondAttribute()[i].columnName);
}
}
onClause.append(" ");
diff --git a/framework/direct-download/pom.xml b/framework/direct-download/pom.xml
index 1915377f222..eeb6049285a 100644
--- a/framework/direct-download/pom.xml
+++ b/framework/direct-download/pom.xml
@@ -32,7 +32,7 @@
cloudstack-framework
org.apache.cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/framework/events/pom.xml b/framework/events/pom.xml
index 3f457920cc9..20e2a02fd45 100644
--- a/framework/events/pom.xml
+++ b/framework/events/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/framework/ipc/pom.xml b/framework/ipc/pom.xml
index 3c03ed04e28..66812b1051c 100644
--- a/framework/ipc/pom.xml
+++ b/framework/ipc/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/framework/jobs/pom.xml b/framework/jobs/pom.xml
index a82f514635f..a7c8699d0c7 100644
--- a/framework/jobs/pom.xml
+++ b/framework/jobs/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/framework/managed-context/pom.xml b/framework/managed-context/pom.xml
index bc7fa17940b..32c07bc701d 100644
--- a/framework/managed-context/pom.xml
+++ b/framework/managed-context/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/framework/pom.xml b/framework/pom.xml
index 79b1036eae7..77a2710c335 100644
--- a/framework/pom.xml
+++ b/framework/pom.xml
@@ -25,7 +25,7 @@
org.apache.cloudstack
cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
diff --git a/framework/quota/pom.xml b/framework/quota/pom.xml
index 2e608d7a248..a44ac18f2f9 100644
--- a/framework/quota/pom.xml
+++ b/framework/quota/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/framework/quota/src/main/java/org/apache/cloudstack/quota/QuotaManagerImpl.java b/framework/quota/src/main/java/org/apache/cloudstack/quota/QuotaManagerImpl.java
index 226a47bb7df..c9254814f46 100644
--- a/framework/quota/src/main/java/org/apache/cloudstack/quota/QuotaManagerImpl.java
+++ b/framework/quota/src/main/java/org/apache/cloudstack/quota/QuotaManagerImpl.java
@@ -157,7 +157,7 @@ public class QuotaManagerImpl extends ManagerBase implements QuotaManager {
.map(quotaUsageVO -> new Pair<>(quotaUsageVO.getStartDate(), quotaUsageVO.getEndDate()))
.collect(Collectors.toCollection(LinkedHashSet::new));
- logger.info(String.format("Processing quota balance for account[{}] between [{}] and [{}].", accountToString, startDate, lastQuotaUsageEndDate));
+ logger.info("Processing quota balance for account [{}] between [{}] and [{}].", accountToString, startDate, lastQuotaUsageEndDate);
long accountId = accountVo.getAccountId();
long domainId = accountVo.getDomainId();
diff --git a/framework/quota/src/main/java/org/apache/cloudstack/quota/activationrule/presetvariables/PresetVariables.java b/framework/quota/src/main/java/org/apache/cloudstack/quota/activationrule/presetvariables/PresetVariables.java
index b27bf589c16..6dab6604e91 100644
--- a/framework/quota/src/main/java/org/apache/cloudstack/quota/activationrule/presetvariables/PresetVariables.java
+++ b/framework/quota/src/main/java/org/apache/cloudstack/quota/activationrule/presetvariables/PresetVariables.java
@@ -17,6 +17,8 @@
package org.apache.cloudstack.quota.activationrule.presetvariables;
+import java.util.List;
+
public class PresetVariables {
@PresetVariableDefinition(description = "Account owner of the resource.")
@@ -37,6 +39,9 @@ public class PresetVariables {
@PresetVariableDefinition(description = "Zone where the resource is.")
private GenericPresetVariable zone;
+ @PresetVariableDefinition(description = "A list containing the tariffs ordered by the field 'position'.")
+ private List lastTariffs;
+
public Account getAccount() {
return account;
}
@@ -84,4 +89,12 @@ public class PresetVariables {
public void setZone(GenericPresetVariable zone) {
this.zone = zone;
}
+
+ public List getLastTariffs() {
+ return lastTariffs;
+ }
+
+ public void setLastTariffs(List lastTariffs) {
+ this.lastTariffs = lastTariffs;
+ }
}
diff --git a/framework/quota/src/main/java/org/apache/cloudstack/quota/constant/QuotaTypes.java b/framework/quota/src/main/java/org/apache/cloudstack/quota/constant/QuotaTypes.java
index 947183577a8..0da0d6e53f7 100644
--- a/framework/quota/src/main/java/org/apache/cloudstack/quota/constant/QuotaTypes.java
+++ b/framework/quota/src/main/java/org/apache/cloudstack/quota/constant/QuotaTypes.java
@@ -20,9 +20,11 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+import com.cloud.utils.exception.CloudRuntimeException;
import org.apache.cloudstack.usage.UsageTypes;
import org.apache.cloudstack.usage.UsageUnitTypes;
import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils;
+import org.apache.commons.lang3.StringUtils;
public class QuotaTypes extends UsageTypes {
private final Integer quotaType;
@@ -106,6 +108,20 @@ public class QuotaTypes extends UsageTypes {
return quotaTypeMap.get(quotaType);
}
+ static public QuotaTypes getQuotaTypeByName(String name) {
+ if (StringUtils.isBlank(name)) {
+ throw new CloudRuntimeException("Could not retrieve Quota type by name because the value passed as parameter is null, empty, or blank.");
+ }
+
+ for (QuotaTypes type : quotaTypeMap.values()) {
+ if (type.getQuotaName().equals(name)) {
+ return type;
+ }
+ }
+
+ throw new CloudRuntimeException(String.format("Could not find Quota type with name [%s].", name));
+ }
+
@Override
public String toString() {
return ReflectionToStringBuilderUtils.reflectOnlySelectedFields(this, "quotaType", "quotaName");
diff --git a/framework/rest/pom.xml b/framework/rest/pom.xml
index d1ffff3c7bd..37a9791bd38 100644
--- a/framework/rest/pom.xml
+++ b/framework/rest/pom.xml
@@ -22,7 +22,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
cloud-framework-rest
diff --git a/framework/security/pom.xml b/framework/security/pom.xml
index f41d5460bb7..05a108b4d45 100644
--- a/framework/security/pom.xml
+++ b/framework/security/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-framework
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/framework/spring/lifecycle/pom.xml b/framework/spring/lifecycle/pom.xml
index fbdb2e60dc6..7c648d225cf 100644
--- a/framework/spring/lifecycle/pom.xml
+++ b/framework/spring/lifecycle/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../../pom.xml
diff --git a/framework/spring/module/pom.xml b/framework/spring/module/pom.xml
index ea39e3a6141..0a2280bff44 100644
--- a/framework/spring/module/pom.xml
+++ b/framework/spring/module/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../../pom.xml
diff --git a/packaging/el8/cloud.spec b/packaging/el8/cloud.spec
index a88d4b1cbbf..eb03cfe0df4 100644
--- a/packaging/el8/cloud.spec
+++ b/packaging/el8/cloud.spec
@@ -102,6 +102,7 @@ Requires: java-17-openjdk
Requires: tzdata-java
Requires: %{name}-common = %{_ver}
Requires: libvirt
+Requires: libvirt-daemon-driver-storage-rbd
Requires: ebtables
Requires: iptables
Requires: ethtool
@@ -244,6 +245,7 @@ mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/lib
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/setup
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/log/%{name}/management
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management
+mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/systemd/system/%{name}-management.service.d
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/run
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/setup/wheel
@@ -293,6 +295,7 @@ install -D utils/target/cloud-utils-%{_maventag}-bundled.jar ${RPM_BUILD_ROOT}%{
install -D packaging/el8/cloud-ipallocator.rc ${RPM_BUILD_ROOT}%{_initrddir}/%{name}-ipallocator
install -D packaging/el8/cloud.limits ${RPM_BUILD_ROOT}%{_sysconfdir}/security/limits.d/cloud
+install -D packaging/el8/filelimit.conf ${RPM_BUILD_ROOT}%{_sysconfdir}/systemd/system/%{name}-management.service.d
install -D packaging/systemd/cloudstack-management.service ${RPM_BUILD_ROOT}%{_unitdir}/%{name}-management.service
install -D packaging/systemd/cloudstack-management.default ${RPM_BUILD_ROOT}%{_sysconfdir}/default/%{name}-management
install -D server/target/conf/cloudstack-sudoers ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d/%{name}-management
@@ -574,6 +577,7 @@ pip3 install --upgrade /usr/share/cloudstack-marvin/Marvin-*.tar.gz
%config(noreplace) %{_sysconfdir}/default/%{name}-management
%config(noreplace) %{_sysconfdir}/sudoers.d/%{name}-management
%config(noreplace) %{_sysconfdir}/security/limits.d/cloud
+%config(noreplace) %{_sysconfdir}/systemd/system/%{name}-management.service.d
%config(noreplace) %attr(0640,root,cloud) %{_sysconfdir}/%{name}/management/db.properties
%config(noreplace) %attr(0640,root,cloud) %{_sysconfdir}/%{name}/management/server.properties
%config(noreplace) %attr(0640,root,cloud) %{_sysconfdir}/%{name}/management/config.json
diff --git a/packaging/el8/filelimit.conf b/packaging/el8/filelimit.conf
new file mode 100644
index 00000000000..7a8a835e3fe
--- /dev/null
+++ b/packaging/el8/filelimit.conf
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# should go in /etc/systemd/system/cloudstack-management.service.d/
+[Service]
+LimitNPROC=infinity
diff --git a/plugins/acl/dynamic-role-based/pom.xml b/plugins/acl/dynamic-role-based/pom.xml
index b1972a54ba5..15150a26288 100644
--- a/plugins/acl/dynamic-role-based/pom.xml
+++ b/plugins/acl/dynamic-role-based/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/acl/project-role-based/pom.xml b/plugins/acl/project-role-based/pom.xml
index 3f5d64d29a7..4745936fc8b 100644
--- a/plugins/acl/project-role-based/pom.xml
+++ b/plugins/acl/project-role-based/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/acl/static-role-based/pom.xml b/plugins/acl/static-role-based/pom.xml
index 62fb60395e0..158add1395b 100644
--- a/plugins/acl/static-role-based/pom.xml
+++ b/plugins/acl/static-role-based/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/affinity-group-processors/explicit-dedication/pom.xml b/plugins/affinity-group-processors/explicit-dedication/pom.xml
index d6827ee13b6..d7535ba5925 100644
--- a/plugins/affinity-group-processors/explicit-dedication/pom.xml
+++ b/plugins/affinity-group-processors/explicit-dedication/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/affinity-group-processors/host-affinity/pom.xml b/plugins/affinity-group-processors/host-affinity/pom.xml
index bd999288717..68c66c41f39 100644
--- a/plugins/affinity-group-processors/host-affinity/pom.xml
+++ b/plugins/affinity-group-processors/host-affinity/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/affinity-group-processors/host-anti-affinity/pom.xml b/plugins/affinity-group-processors/host-anti-affinity/pom.xml
index b224bbaf34a..ba0dde5949d 100644
--- a/plugins/affinity-group-processors/host-anti-affinity/pom.xml
+++ b/plugins/affinity-group-processors/host-anti-affinity/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/affinity-group-processors/non-strict-host-affinity/pom.xml b/plugins/affinity-group-processors/non-strict-host-affinity/pom.xml
index bf751ca4141..352cf299dd7 100644
--- a/plugins/affinity-group-processors/non-strict-host-affinity/pom.xml
+++ b/plugins/affinity-group-processors/non-strict-host-affinity/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/affinity-group-processors/non-strict-host-anti-affinity/pom.xml b/plugins/affinity-group-processors/non-strict-host-anti-affinity/pom.xml
index 445acfc11d6..8896eba19e7 100644
--- a/plugins/affinity-group-processors/non-strict-host-anti-affinity/pom.xml
+++ b/plugins/affinity-group-processors/non-strict-host-anti-affinity/pom.xml
@@ -32,7 +32,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/alert-handlers/snmp-alerts/pom.xml b/plugins/alert-handlers/snmp-alerts/pom.xml
index fad47d426f2..a64fc56ecbf 100644
--- a/plugins/alert-handlers/snmp-alerts/pom.xml
+++ b/plugins/alert-handlers/snmp-alerts/pom.xml
@@ -24,7 +24,7 @@
cloudstack-plugins
org.apache.cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/alert-handlers/syslog-alerts/pom.xml b/plugins/alert-handlers/syslog-alerts/pom.xml
index 54641bd8a8a..957d99fd522 100644
--- a/plugins/alert-handlers/syslog-alerts/pom.xml
+++ b/plugins/alert-handlers/syslog-alerts/pom.xml
@@ -24,7 +24,7 @@
cloudstack-plugins
org.apache.cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/api/discovery/pom.xml b/plugins/api/discovery/pom.xml
index 6426dcd70a5..e947834c3fa 100644
--- a/plugins/api/discovery/pom.xml
+++ b/plugins/api/discovery/pom.xml
@@ -25,7 +25,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/api/rate-limit/pom.xml b/plugins/api/rate-limit/pom.xml
index 2449a23f2d0..2daba3ff488 100644
--- a/plugins/api/rate-limit/pom.xml
+++ b/plugins/api/rate-limit/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/api/solidfire-intg-test/pom.xml b/plugins/api/solidfire-intg-test/pom.xml
index 907c5f2968d..c2385a705c6 100644
--- a/plugins/api/solidfire-intg-test/pom.xml
+++ b/plugins/api/solidfire-intg-test/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/api/vmware-sioc/pom.xml b/plugins/api/vmware-sioc/pom.xml
index b3c04e603cb..858e7ea69a0 100644
--- a/plugins/api/vmware-sioc/pom.xml
+++ b/plugins/api/vmware-sioc/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/backup/dummy/pom.xml b/plugins/backup/dummy/pom.xml
index 52fbd085eb2..3a3749e50a8 100644
--- a/plugins/backup/dummy/pom.xml
+++ b/plugins/backup/dummy/pom.xml
@@ -23,7 +23,7 @@
cloudstack-plugins
org.apache.cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/backup/nas/pom.xml b/plugins/backup/nas/pom.xml
index 096bf45c67e..8160826e573 100644
--- a/plugins/backup/nas/pom.xml
+++ b/plugins/backup/nas/pom.xml
@@ -25,7 +25,7 @@
cloudstack-plugins
org.apache.cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/backup/networker/pom.xml b/plugins/backup/networker/pom.xml
index 1124d281d2e..fd1247ee58e 100644
--- a/plugins/backup/networker/pom.xml
+++ b/plugins/backup/networker/pom.xml
@@ -25,7 +25,7 @@
cloudstack-plugins
org.apache.cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/backup/veeam/pom.xml b/plugins/backup/veeam/pom.xml
index a317f90388a..0e8f8c708a6 100644
--- a/plugins/backup/veeam/pom.xml
+++ b/plugins/backup/veeam/pom.xml
@@ -23,7 +23,7 @@
cloudstack-plugins
org.apache.cloudstack
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/ca/root-ca/pom.xml b/plugins/ca/root-ca/pom.xml
index fe1fb006302..da42fd9083c 100644
--- a/plugins/ca/root-ca/pom.xml
+++ b/plugins/ca/root-ca/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/database/mysql-ha/pom.xml b/plugins/database/mysql-ha/pom.xml
index 37a07784341..b23719df14f 100644
--- a/plugins/database/mysql-ha/pom.xml
+++ b/plugins/database/mysql-ha/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/database/quota/pom.xml b/plugins/database/quota/pom.xml
index b574b263020..3439f2f855c 100644
--- a/plugins/database/quota/pom.xml
+++ b/plugins/database/quota/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaBalanceCmd.java b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaBalanceCmd.java
index 218e3c2b2f9..628eca56c2d 100644
--- a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaBalanceCmd.java
+++ b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaBalanceCmd.java
@@ -21,6 +21,9 @@ import java.util.List;
import javax.inject.Inject;
+import com.cloud.user.Account;
+
+import org.apache.cloudstack.api.ACL;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
@@ -40,6 +43,7 @@ public class QuotaBalanceCmd extends BaseCmd {
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, required = true, description = "Account Id for which statement needs to be generated")
private String accountName;
+ @ACL
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, required = true, entityType = DomainResponse.class, description = "If domain Id is given and the caller is domain admin then the statement is generated for domain.")
private Long domainId;
@@ -51,6 +55,7 @@ public class QuotaBalanceCmd extends BaseCmd {
ApiConstants.PARAMETER_DESCRIPTION_START_DATE_POSSIBLE_FORMATS)
private Date startDate;
+ @ACL
@Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class, description = "List usage records for the specified account")
private Long accountId;
@@ -104,7 +109,14 @@ public class QuotaBalanceCmd extends BaseCmd {
@Override
public long getEntityOwnerId() {
- return _accountService.getActiveAccountByName(accountName, domainId).getAccountId();
+ if (accountId != null) {
+ return accountId;
+ }
+ Account account = _accountService.getActiveAccountByName(accountName, domainId);
+ if (account != null) {
+ return account.getAccountId();
+ }
+ return Account.ACCOUNT_ID_SYSTEM;
}
@Override
diff --git a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaCreditsCmd.java b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaCreditsCmd.java
index 8ca29f275dd..cfa391291c8 100644
--- a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaCreditsCmd.java
+++ b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaCreditsCmd.java
@@ -18,6 +18,7 @@ package org.apache.cloudstack.api.command;
import com.cloud.user.Account;
+import org.apache.cloudstack.api.ACL;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
@@ -46,6 +47,7 @@ public class QuotaCreditsCmd extends BaseCmd {
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, required = true, description = "Account Id for which quota credits need to be added")
private String accountName;
+ @ACL
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, required = true, entityType = DomainResponse.class, description = "Domain for which quota credits need to be added")
private Long domainId;
@@ -130,6 +132,10 @@ public class QuotaCreditsCmd extends BaseCmd {
@Override
public long getEntityOwnerId() {
+ Account account = _accountService.getActiveAccountByName(accountName, domainId);
+ if (account != null) {
+ return account.getAccountId();
+ }
return Account.ACCOUNT_ID_SYSTEM;
}
diff --git a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaStatementCmd.java b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaStatementCmd.java
index 4fb33f79672..78fa0f7df84 100644
--- a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaStatementCmd.java
+++ b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaStatementCmd.java
@@ -21,6 +21,7 @@ import java.util.List;
import javax.inject.Inject;
+import org.apache.cloudstack.api.ACL;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
@@ -42,6 +43,7 @@ public class QuotaStatementCmd extends BaseCmd {
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, required = true, description = "Optional, Account Id for which statement needs to be generated")
private String accountName;
+ @ACL
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, required = true, entityType = DomainResponse.class, description = "Optional, If domain Id is given and the caller is domain admin then the statement is generated for domain.")
private Long domainId;
@@ -56,6 +58,7 @@ public class QuotaStatementCmd extends BaseCmd {
@Parameter(name = ApiConstants.TYPE, type = CommandType.INTEGER, description = "List quota usage records for the specified usage type")
private Integer usageType;
+ @ACL
@Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class, description = "List usage records for the specified account")
private Long accountId;
@@ -112,6 +115,9 @@ public class QuotaStatementCmd extends BaseCmd {
@Override
public long getEntityOwnerId() {
+ if (accountId != null) {
+ return accountId;
+ }
Account activeAccountByName = _accountService.getActiveAccountByName(accountName, domainId);
if (activeAccountByName != null) {
return activeAccountByName.getAccountId();
diff --git a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaValidateActivationRuleCmd.java b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaValidateActivationRuleCmd.java
new file mode 100644
index 00000000000..a9dc7ea63eb
--- /dev/null
+++ b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaValidateActivationRuleCmd.java
@@ -0,0 +1,70 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements. See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership. The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License. You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied. See the License for the
+//specific language governing permissions and limitations
+//under the License.
+package org.apache.cloudstack.api.command;
+
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.user.Account;
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.response.QuotaResponseBuilder;
+import org.apache.cloudstack.api.response.QuotaValidateActivationRuleResponse;
+import org.apache.cloudstack.quota.constant.QuotaTypes;
+
+import javax.inject.Inject;
+
+@APICommand(name = "quotaValidateActivationRule", responseObject = QuotaValidateActivationRuleResponse.class, description = "Validates if the given activation rule is valid for the informed usage type.", since = "4.20.0", requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
+public class QuotaValidateActivationRuleCmd extends BaseCmd {
+
+ @Inject
+ QuotaResponseBuilder responseBuilder;
+
+ @Parameter(name = ApiConstants.ACTIVATION_RULE, type = CommandType.STRING, required = true, description = "Quota tariff's activation rule to validate. The activation rule is valid if it has no syntax errors and all " +
+ "variables are compatible with the given usage type.", length = 65535)
+ private String activationRule;
+
+ @Parameter(name = ApiConstants.USAGE_TYPE, type = CommandType.INTEGER, required = true, description = "The Quota usage type used to validate the activation rule.")
+ private Integer quotaType;
+
+ @Override
+ public void execute() {
+ QuotaValidateActivationRuleResponse response = responseBuilder.validateActivationRule(this);
+
+ response.setResponseName(getCommandName());
+ setResponseObject(response);
+ }
+
+ @Override
+ public long getEntityOwnerId() {
+ return Account.ACCOUNT_ID_SYSTEM;
+ }
+
+ public String getActivationRule() {
+ return activationRule;
+ }
+
+ public QuotaTypes getQuotaType() {
+ QuotaTypes quotaTypes = QuotaTypes.getQuotaType(quotaType);
+
+ if (quotaTypes == null) {
+ throw new InvalidParameterValueException(String.format("Usage type not found for value [%s].", quotaType));
+ }
+
+ return quotaTypes;
+ }
+}
diff --git a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaResponseBuilder.java b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaResponseBuilder.java
index c635551aeb5..56935a1360c 100644
--- a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaResponseBuilder.java
+++ b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaResponseBuilder.java
@@ -26,6 +26,7 @@ import org.apache.cloudstack.api.command.QuotaStatementCmd;
import org.apache.cloudstack.api.command.QuotaTariffCreateCmd;
import org.apache.cloudstack.api.command.QuotaTariffListCmd;
import org.apache.cloudstack.api.command.QuotaTariffUpdateCmd;
+import org.apache.cloudstack.api.command.QuotaValidateActivationRuleCmd;
import org.apache.cloudstack.quota.vo.QuotaBalanceVO;
import org.apache.cloudstack.quota.vo.QuotaEmailConfigurationVO;
import org.apache.cloudstack.quota.vo.QuotaTariffVO;
@@ -88,4 +89,6 @@ public interface QuotaResponseBuilder {
QuotaConfigureEmailResponse createQuotaConfigureEmailResponse(QuotaEmailConfigurationVO quotaEmailConfigurationVO, Double minBalance, long accountId);
List listEmailConfiguration(long accountId);
+
+ QuotaValidateActivationRuleResponse validateActivationRule(QuotaValidateActivationRuleCmd cmd);
}
diff --git a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java
index 1c486759e43..733f7792356 100644
--- a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java
+++ b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java
@@ -16,6 +16,7 @@
//under the License.
package org.apache.cloudstack.api.response;
+import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
@@ -34,12 +35,15 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
+import java.util.Map;
+import java.util.Set;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import javax.inject.Inject;
import com.cloud.utils.DateUtil;
+import com.cloud.utils.exception.CloudRuntimeException;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.command.QuotaBalanceCmd;
@@ -51,8 +55,10 @@ import org.apache.cloudstack.api.command.QuotaStatementCmd;
import org.apache.cloudstack.api.command.QuotaTariffCreateCmd;
import org.apache.cloudstack.api.command.QuotaTariffListCmd;
import org.apache.cloudstack.api.command.QuotaTariffUpdateCmd;
+import org.apache.cloudstack.api.command.QuotaValidateActivationRuleCmd;
import org.apache.cloudstack.context.CallContext;
import org.apache.cloudstack.discovery.ApiDiscoveryService;
+import org.apache.cloudstack.jsinterpreter.JsInterpreterHelper;
import org.apache.cloudstack.quota.QuotaManager;
import org.apache.cloudstack.quota.QuotaManagerImpl;
import org.apache.cloudstack.quota.QuotaService;
@@ -78,6 +84,7 @@ import org.apache.cloudstack.quota.vo.QuotaEmailConfigurationVO;
import org.apache.cloudstack.quota.vo.QuotaEmailTemplatesVO;
import org.apache.cloudstack.quota.vo.QuotaTariffVO;
import org.apache.cloudstack.quota.vo.QuotaUsageVO;
+import org.apache.cloudstack.utils.jsinterpreter.JsInterpreter;
import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.reflect.FieldUtils;
@@ -133,11 +140,13 @@ public class QuotaResponseBuilderImpl implements QuotaResponseBuilder {
private QuotaManager _quotaManager;
@Inject
private QuotaEmailConfigurationDao quotaEmailConfigurationDao;
+ @Inject
+ private JsInterpreterHelper jsInterpreterHelper;
+ @Inject
+ private ApiDiscoveryService apiDiscoveryService;
private final Class>[] assignableClasses = {GenericPresetVariable.class, ComputingResources.class};
- @Inject
- private ApiDiscoveryService apiDiscoveryService;
@Override
public QuotaTariffResponse createQuotaTariffResponse(QuotaTariffVO tariff, boolean returnActivationRule) {
@@ -789,7 +798,7 @@ public class QuotaResponseBuilderImpl implements QuotaResponseBuilder {
*/
public void filterSupportedTypes(List> variables, QuotaTypes quotaType, PresetVariableDefinition presetVariableDefinitionAnnotation, Class> fieldClass,
String presetVariableName) {
- if (Arrays.stream(presetVariableDefinitionAnnotation.supportedTypes()).noneMatch(supportedType ->
+ if (quotaType != null && Arrays.stream(presetVariableDefinitionAnnotation.supportedTypes()).noneMatch(supportedType ->
supportedType == quotaType.getQuotaType() || supportedType == 0)) {
return;
}
@@ -928,4 +937,82 @@ public class QuotaResponseBuilderImpl implements QuotaResponseBuilder {
return quotaConfigureEmailResponse;
}
+
+ @Override
+ public QuotaValidateActivationRuleResponse validateActivationRule(QuotaValidateActivationRuleCmd cmd) {
+ String message;
+ String activationRule = cmd.getActivationRule();
+ QuotaTypes quotaType = cmd.getQuotaType();
+ String quotaName = quotaType.getQuotaName();
+ List> usageTypeVariablesAndDescriptions = new ArrayList<>();
+
+ addAllPresetVariables(PresetVariables.class, quotaType, usageTypeVariablesAndDescriptions, null);
+ List usageTypeVariables = usageTypeVariablesAndDescriptions.stream().map(Pair::first).collect(Collectors.toList());
+
+ try (JsInterpreter jsInterpreter = new JsInterpreter(QuotaConfig.QuotaActivationRuleTimeout.value())) {
+ Map newVariables = injectUsageTypeVariables(jsInterpreter, usageTypeVariables);
+ String scriptToExecute = jsInterpreterHelper.replaceScriptVariables(activationRule, newVariables);
+ jsInterpreter.executeScript(String.format("new Function(\"%s\")", scriptToExecute.replaceAll("\n", "")));
+ } catch (IOException | CloudRuntimeException e) {
+ logger.error("Unable to execute activation rule due to: [{}].", e.getMessage(), e);
+ message = "Error while executing activation rule. Check if there are no syntax errors and all variables are compatible with the given usage type.";
+ return createValidateActivationRuleResponse(activationRule, quotaName, false, message);
+ }
+
+ Set scriptVariables = jsInterpreterHelper.getScriptVariables(activationRule);
+ if (isScriptVariablesValid(scriptVariables, usageTypeVariables)) {
+ message = "The script has no syntax errors and all variables are compatible with the given usage type.";
+ return createValidateActivationRuleResponse(activationRule, quotaName, true, message);
+ }
+
+ message = "Found variables that are not compatible with the given usage type.";
+ return createValidateActivationRuleResponse(activationRule, quotaName, false, message);
+ }
+
+ /**
+ * Checks whether script variables are compatible with the usage type. First, we remove all script variables that correspond to the script's usage type variables.
+ * Then, returns true if none of the remaining script variables match any usage types variables, and false otherwise.
+ *
+ * @param scriptVariables Script variables.
+ * @param scriptUsageTypeVariables Script usage type variables.
+ * @return True if the script variables are valid, false otherwise.
+ */
+ protected boolean isScriptVariablesValid(Set scriptVariables, List scriptUsageTypeVariables) {
+ List> allUsageTypeVariablesAndDescriptions = new ArrayList<>();
+ addAllPresetVariables(PresetVariables.class, null, allUsageTypeVariablesAndDescriptions, null);
+ List allUsageTypesVariables = allUsageTypeVariablesAndDescriptions.stream().map(Pair::first).collect(Collectors.toList());
+
+ List matchVariables = scriptVariables.stream().filter(scriptUsageTypeVariables::contains).collect(Collectors.toList());
+ matchVariables.forEach(scriptVariables::remove);
+
+ return scriptVariables.stream().noneMatch(allUsageTypesVariables::contains);
+ }
+
+ /**
+ * Injects variables into JavaScript interpreter. It's necessary to remove all dots from the given variables, as the interpreter
+ * does not interpret the variables as attributes of objects.
+ *
+ * @param jsInterpreter the {@link JsInterpreter} which the variables will be injected.
+ * @param variables the {@link List} with variables to format and inject the formatted variables into interpreter.
+ * @return A {@link Map} which has the key as the given variable and the value as the given variable formatted (without dots).
+ */
+ protected Map injectUsageTypeVariables(JsInterpreter jsInterpreter, List variables) {
+ Map formattedVariables = new HashMap<>();
+ for (String variable : variables) {
+ String formattedVariable = variable.replace(".", "");
+ formattedVariables.put(variable, formattedVariable);
+ jsInterpreter.injectVariable(formattedVariable, "false");
+ }
+
+ return formattedVariables;
+ }
+
+ public QuotaValidateActivationRuleResponse createValidateActivationRuleResponse(String activationRule, String quotaType, Boolean isValid, String message) {
+ QuotaValidateActivationRuleResponse response = new QuotaValidateActivationRuleResponse();
+ response.setActivationRule(activationRule);
+ response.setQuotaType(quotaType);
+ response.setValid(isValid);
+ response.setMessage(message);
+ return response;
+ }
}
diff --git a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaValidateActivationRuleResponse.java b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaValidateActivationRuleResponse.java
new file mode 100644
index 00000000000..0726764568f
--- /dev/null
+++ b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaValidateActivationRuleResponse.java
@@ -0,0 +1,76 @@
+//Licensed to the Apache Software Foundation (ASF) under one
+//or more contributor license agreements. See the NOTICE file
+//distributed with this work for additional information
+//regarding copyright ownership. The ASF licenses this file
+//to you under the Apache License, Version 2.0 (the
+//"License"); you may not use this file except in compliance
+//with the License. You may obtain a copy of the License at
+//
+//http://www.apache.org/licenses/LICENSE-2.0
+//
+//Unless required by applicable law or agreed to in writing,
+//software distributed under the License is distributed on an
+//"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//KIND, either express or implied. See the License for the
+//specific language governing permissions and limitations
+//under the License.
+package org.apache.cloudstack.api.response;
+
+import com.cloud.serializer.Param;
+import com.google.gson.annotations.SerializedName;
+import org.apache.cloudstack.api.BaseResponse;
+
+public class QuotaValidateActivationRuleResponse extends BaseResponse {
+
+ @SerializedName("activationrule")
+ @Param(description = "The validated activation rule.")
+ private String activationRule;
+
+ @SerializedName("quotatype")
+ @Param(description = "The Quota usage type used to validate the activation rule.")
+ private String quotaType;
+
+ @SerializedName("isvalid")
+ @Param(description = "Whether the activation rule is valid.")
+ private Boolean isValid;
+
+ @SerializedName("message")
+ @Param(description = "The reason whether the activation rule is valid or not.")
+ private String message;
+
+ public QuotaValidateActivationRuleResponse() {
+ super("validactivationrule");
+ }
+
+ public String getActivationRule() {
+ return activationRule;
+ }
+
+ public void setActivationRule(String activationRule) {
+ this.activationRule = activationRule;
+ }
+
+ public Boolean isValid() {
+ return isValid;
+ }
+
+ public void setValid(Boolean valid) {
+ isValid = valid;
+ }
+
+ public String getQuotaType() {
+ return quotaType;
+ }
+
+ public void setQuotaType(String quotaType) {
+ this.quotaType = quotaType;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
diff --git a/plugins/database/quota/src/main/java/org/apache/cloudstack/quota/QuotaServiceImpl.java b/plugins/database/quota/src/main/java/org/apache/cloudstack/quota/QuotaServiceImpl.java
index 17fa7bd8425..97d77b8aa22 100644
--- a/plugins/database/quota/src/main/java/org/apache/cloudstack/quota/QuotaServiceImpl.java
+++ b/plugins/database/quota/src/main/java/org/apache/cloudstack/quota/QuotaServiceImpl.java
@@ -41,6 +41,7 @@ import org.apache.cloudstack.api.command.QuotaTariffDeleteCmd;
import org.apache.cloudstack.api.command.QuotaTariffListCmd;
import org.apache.cloudstack.api.command.QuotaTariffUpdateCmd;
import org.apache.cloudstack.api.command.QuotaUpdateCmd;
+import org.apache.cloudstack.api.command.QuotaValidateActivationRuleCmd;
import org.apache.cloudstack.api.response.QuotaResponseBuilder;
import org.apache.cloudstack.context.CallContext;
import org.apache.cloudstack.framework.config.ConfigKey;
@@ -121,6 +122,7 @@ public class QuotaServiceImpl extends ManagerBase implements QuotaService, Confi
cmdList.add(QuotaConfigureEmailCmd.class);
cmdList.add(QuotaListEmailConfigurationCmd.class);
cmdList.add(QuotaPresetVariablesListCmd.class);
+ cmdList.add(QuotaValidateActivationRuleCmd.class);
return cmdList;
}
diff --git a/plugins/database/quota/src/test/java/org/apache/cloudstack/api/command/QuotaValidateActivationRuleCmdTest.java b/plugins/database/quota/src/test/java/org/apache/cloudstack/api/command/QuotaValidateActivationRuleCmdTest.java
new file mode 100644
index 00000000000..1d0c0cf7ff6
--- /dev/null
+++ b/plugins/database/quota/src/test/java/org/apache/cloudstack/api/command/QuotaValidateActivationRuleCmdTest.java
@@ -0,0 +1,41 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package org.apache.cloudstack.api.command;
+
+import org.apache.cloudstack.api.response.QuotaResponseBuilder;
+import org.apache.cloudstack.api.response.QuotaValidateActivationRuleResponse;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Mockito;
+import org.mockito.junit.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class QuotaValidateActivationRuleCmdTest {
+ @Mock
+ QuotaResponseBuilder responseBuilderMock;
+
+ @Test
+ public void executeTestVerifyCalls() {
+ QuotaValidateActivationRuleCmd cmd = new QuotaValidateActivationRuleCmd();
+ cmd.responseBuilder = responseBuilderMock;
+ Mockito.doReturn(new QuotaValidateActivationRuleResponse()).when(responseBuilderMock).validateActivationRule(cmd);
+ cmd.execute();
+
+ Mockito.verify(responseBuilderMock).validateActivationRule(cmd);
+ }
+}
diff --git a/plugins/database/quota/src/test/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImplTest.java b/plugins/database/quota/src/test/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImplTest.java
index fd359525893..a26e6c0476d 100644
--- a/plugins/database/quota/src/test/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImplTest.java
+++ b/plugins/database/quota/src/test/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImplTest.java
@@ -25,6 +25,9 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.HashSet;
import java.util.function.Consumer;
import com.cloud.domain.DomainVO;
@@ -34,7 +37,10 @@ import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.command.QuotaConfigureEmailCmd;
import org.apache.cloudstack.api.command.QuotaEmailTemplateListCmd;
import org.apache.cloudstack.api.command.QuotaEmailTemplateUpdateCmd;
+import org.apache.cloudstack.api.command.QuotaValidateActivationRuleCmd;
+import org.apache.cloudstack.discovery.ApiDiscoveryService;
import org.apache.cloudstack.framework.config.ConfigKey;
+import org.apache.cloudstack.jsinterpreter.JsInterpreterHelper;
import org.apache.cloudstack.quota.QuotaService;
import org.apache.cloudstack.quota.QuotaStatement;
import org.apache.cloudstack.quota.activationrule.presetvariables.PresetVariableDefinition;
@@ -55,7 +61,7 @@ import org.apache.cloudstack.quota.vo.QuotaCreditsVO;
import org.apache.cloudstack.quota.vo.QuotaEmailConfigurationVO;
import org.apache.cloudstack.quota.vo.QuotaEmailTemplatesVO;
import org.apache.cloudstack.quota.vo.QuotaTariffVO;
-import org.apache.cloudstack.discovery.ApiDiscoveryService;
+import org.apache.cloudstack.utils.jsinterpreter.JsInterpreter;
import org.apache.commons.lang3.time.DateUtils;
@@ -160,6 +166,12 @@ public class QuotaResponseBuilderImplTest extends TestCase {
return new Calendar[] {calendar, calendar};
}
+ @Mock
+ QuotaValidateActivationRuleCmd quotaValidateActivationRuleCmdMock = Mockito.mock(QuotaValidateActivationRuleCmd.class);
+
+ @Mock
+ JsInterpreterHelper jsInterpreterHelperMock = Mockito.mock(JsInterpreterHelper.class);
+
private QuotaTariffVO makeTariffTestData() {
QuotaTariffVO tariffVO = new QuotaTariffVO();
tariffVO.setUsageType(QuotaTypes.IP_ADDRESS);
@@ -645,4 +657,78 @@ public class QuotaResponseBuilderImplTest extends TestCase {
assertFalse(quotaResponseBuilderSpy.isUserAllowedToSeeActivationRules(userMock));
}
+
+ @Test
+ public void validateActivationRuleTestValidateActivationRuleReturnValidScriptResponse() {
+ Mockito.doReturn("if (account.name == 'test') { true } else { false }").when(quotaValidateActivationRuleCmdMock).getActivationRule();
+ Mockito.doReturn(QuotaTypes.getQuotaType(30)).when(quotaValidateActivationRuleCmdMock).getQuotaType();
+ Mockito.doReturn(quotaValidateActivationRuleCmdMock.getActivationRule()).when(jsInterpreterHelperMock).replaceScriptVariables(Mockito.anyString(), Mockito.any());
+
+ QuotaValidateActivationRuleResponse response = quotaResponseBuilderSpy.validateActivationRule(quotaValidateActivationRuleCmdMock);
+
+ Assert.assertTrue(response.isValid());
+ }
+
+ @Test
+ public void validateActivationRuleTestUsageTypeIncompatibleVariableReturnInvalidScriptResponse() {
+ Mockito.doReturn("if (value.osName == 'test') { true } else { false }").when(quotaValidateActivationRuleCmdMock).getActivationRule();
+ Mockito.doReturn(QuotaTypes.getQuotaType(30)).when(quotaValidateActivationRuleCmdMock).getQuotaType();
+ Mockito.doReturn(quotaValidateActivationRuleCmdMock.getActivationRule()).when(jsInterpreterHelperMock).replaceScriptVariables(Mockito.anyString(), Mockito.any());
+ Mockito.when(jsInterpreterHelperMock.getScriptVariables(quotaValidateActivationRuleCmdMock.getActivationRule())).thenReturn(Set.of("value.osName"));
+
+ QuotaValidateActivationRuleResponse response = quotaResponseBuilderSpy.validateActivationRule(quotaValidateActivationRuleCmdMock);
+
+ Assert.assertFalse(response.isValid());
+ }
+
+ @Test
+ public void validateActivationRuleTestActivationRuleWithSyntaxErrorsReturnInvalidScriptResponse() {
+ Mockito.doReturn("{ if (account.name == 'test') { true } else { false } }}").when(quotaValidateActivationRuleCmdMock).getActivationRule();
+ Mockito.doReturn(QuotaTypes.getQuotaType(1)).when(quotaValidateActivationRuleCmdMock).getQuotaType();
+ Mockito.doReturn(quotaValidateActivationRuleCmdMock.getActivationRule()).when(jsInterpreterHelperMock).replaceScriptVariables(Mockito.anyString(), Mockito.any());
+
+ QuotaValidateActivationRuleResponse response = quotaResponseBuilderSpy.validateActivationRule(quotaValidateActivationRuleCmdMock);
+
+ Assert.assertFalse(response.isValid());
+ }
+
+ @Test
+ public void isScriptVariablesValidTestUnsupportedUsageTypeVariablesReturnFalse() {
+ Set scriptVariables = new HashSet<>(List.of("value.computingResources.cpuNumber", "account.name", "zone.id"));
+ List usageTypeVariables = List.of("value.virtualSize", "account.name", "zone.id");
+
+ boolean isScriptVariablesValid = quotaResponseBuilderSpy.isScriptVariablesValid(scriptVariables, usageTypeVariables);
+
+ Assert.assertFalse(isScriptVariablesValid);
+ }
+
+ @Test
+ public void isScriptVariablesValidTestSupportedUsageTypeVariablesReturnTrue() {
+ Set scriptVariables = new HashSet<>(List.of("value.computingResources.cpuNumber", "account.name", "zone.id"));
+ List usageTypeVariables = List.of("value.computingResources.cpuNumber", "account.name", "zone.id");
+
+ boolean isScriptVariablesValid = quotaResponseBuilderSpy.isScriptVariablesValid(scriptVariables, usageTypeVariables);
+
+ Assert.assertTrue(isScriptVariablesValid);
+ }
+
+ @Test
+ public void isScriptVariablesValidTestVariablesUnrelatedToUsageTypeReturnTrue() {
+ Set scriptVariables = new HashSet<>(List.of("variable1.valid", "variable2.valid.", "variable3.valid"));
+ List usageTypeVariables = List.of("project.name", "account.id", "domain.path");
+
+ boolean isScriptVariablesValid = quotaResponseBuilderSpy.isScriptVariablesValid(scriptVariables, usageTypeVariables);
+
+ Assert.assertTrue(isScriptVariablesValid);
+ }
+
+ @Test
+ public void injectUsageTypeVariablesTestReturnInjectedVariables() {
+ JsInterpreter interpreter = Mockito.mock(JsInterpreter.class);
+
+ Map formattedVariables = quotaResponseBuilderSpy.injectUsageTypeVariables(interpreter, List.of("account.name", "zone.name"));
+
+ Assert.assertTrue(formattedVariables.containsValue("accountname"));
+ Assert.assertTrue(formattedVariables.containsValue("zonename"));
+ }
}
diff --git a/plugins/dedicated-resources/pom.xml b/plugins/dedicated-resources/pom.xml
index 5aeecec818d..cffeddec7a7 100644
--- a/plugins/dedicated-resources/pom.xml
+++ b/plugins/dedicated-resources/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../pom.xml
diff --git a/plugins/deployment-planners/implicit-dedication/pom.xml b/plugins/deployment-planners/implicit-dedication/pom.xml
index b9f8be5d08a..12454d37270 100644
--- a/plugins/deployment-planners/implicit-dedication/pom.xml
+++ b/plugins/deployment-planners/implicit-dedication/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/deployment-planners/user-concentrated-pod/pom.xml b/plugins/deployment-planners/user-concentrated-pod/pom.xml
index 0dcbe3506c6..ad3ac14a5b5 100644
--- a/plugins/deployment-planners/user-concentrated-pod/pom.xml
+++ b/plugins/deployment-planners/user-concentrated-pod/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/deployment-planners/user-dispersing/pom.xml b/plugins/deployment-planners/user-dispersing/pom.xml
index bbd74bf1a7a..a05577ed04b 100644
--- a/plugins/deployment-planners/user-dispersing/pom.xml
+++ b/plugins/deployment-planners/user-dispersing/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/drs/cluster/balanced/pom.xml b/plugins/drs/cluster/balanced/pom.xml
index 743a5f2bc98..4db1bd796f8 100644
--- a/plugins/drs/cluster/balanced/pom.xml
+++ b/plugins/drs/cluster/balanced/pom.xml
@@ -27,7 +27,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../../pom.xml
diff --git a/plugins/drs/cluster/condensed/pom.xml b/plugins/drs/cluster/condensed/pom.xml
index 60b472bccb5..29a8ae2081d 100644
--- a/plugins/drs/cluster/condensed/pom.xml
+++ b/plugins/drs/cluster/condensed/pom.xml
@@ -27,7 +27,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../../pom.xml
diff --git a/plugins/event-bus/inmemory/pom.xml b/plugins/event-bus/inmemory/pom.xml
index be85e8afd8d..d3b389d9b3f 100644
--- a/plugins/event-bus/inmemory/pom.xml
+++ b/plugins/event-bus/inmemory/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/event-bus/kafka/pom.xml b/plugins/event-bus/kafka/pom.xml
index 44014847548..95667c5cc79 100644
--- a/plugins/event-bus/kafka/pom.xml
+++ b/plugins/event-bus/kafka/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/event-bus/rabbitmq/pom.xml b/plugins/event-bus/rabbitmq/pom.xml
index 1e04caf026f..5ccc2a813ed 100644
--- a/plugins/event-bus/rabbitmq/pom.xml
+++ b/plugins/event-bus/rabbitmq/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/event-bus/webhook/pom.xml b/plugins/event-bus/webhook/pom.xml
index 278f4dc0ec5..e9dc24804f5 100644
--- a/plugins/event-bus/webhook/pom.xml
+++ b/plugins/event-bus/webhook/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/ha-planners/skip-heurestics/pom.xml b/plugins/ha-planners/skip-heurestics/pom.xml
index 3dc3989da2c..4f47bf7ee75 100644
--- a/plugins/ha-planners/skip-heurestics/pom.xml
+++ b/plugins/ha-planners/skip-heurestics/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/host-allocators/random/pom.xml b/plugins/host-allocators/random/pom.xml
index f01494914ce..8f04ec9b63b 100644
--- a/plugins/host-allocators/random/pom.xml
+++ b/plugins/host-allocators/random/pom.xml
@@ -24,7 +24,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
diff --git a/plugins/hypervisors/baremetal/pom.xml b/plugins/hypervisors/baremetal/pom.xml
index d866c9b47e2..f75cb4a4b6c 100755
--- a/plugins/hypervisors/baremetal/pom.xml
+++ b/plugins/hypervisors/baremetal/pom.xml
@@ -22,7 +22,7 @@
org.apache.cloudstack
cloudstack-plugins
- 4.20.0.0-SNAPSHOT
+ 4.21.0.0-SNAPSHOT
../../pom.xml
cloud-plugin-hypervisor-baremetal
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.Designer.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.Designer.cs
index 4bf424fa4b9..4b4d8bd121c 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.Designer.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.Designer.cs
@@ -18,7 +18,7 @@ namespace CloudStack.Plugin.AgentShell
{
partial class AgentService
{
- ///
+ ///
/// Required designer variable.
///
private System.ComponentModel.IContainer components = null;
@@ -38,8 +38,8 @@ namespace CloudStack.Plugin.AgentShell
#region Component Designer generated code
- ///
- /// Required method for Designer support - do not modify
+ ///
+ /// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs
index 94b640edd1b..e2fecd52e47 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs
@@ -67,7 +67,7 @@ namespace CloudStack.Plugin.AgentShell
public static void ConfigServerResource()
{
// For simplicity, ServerResource config and settings file are tightly coupled.
- // An alternative is to pass a dictionary to the server resource and let it find
+ // An alternative is to pass a dictionary to the server resource and let it find
// required settings. In contrast, the approach below is strongly typed and makes
// use of VisualStudio settings designer. The designer allows us to avoid
// accessing config using their key strings.
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentSettings.Designer.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentSettings.Designer.cs
index fc3b69af3e8..5e89a18fb2d 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentSettings.Designer.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentSettings.Designer.cs
@@ -16,20 +16,20 @@
// under the License.
namespace CloudStack.Plugin.AgentShell {
-
-
+
+
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
public sealed partial class AgentSettings : global::System.Configuration.ApplicationSettingsBase {
-
+
private static AgentSettings defaultInstance = ((AgentSettings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new AgentSettings())));
-
+
public static AgentSettings Default {
get {
return defaultInstance;
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("8")]
@@ -38,7 +38,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((int)(this["cpus"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Routing")]
@@ -47,7 +47,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((string)(this["type"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("5fe2bad3-d785-394e-9949-89786b8a63d2")]
@@ -56,7 +56,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((global::System.Guid)(this["local_storage_uuid"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("hvm")]
@@ -65,7 +65,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((string)(this["capabilities"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("2130")]
@@ -74,7 +74,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((int)(this["Settingcpuspeed"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("8250")]
@@ -83,7 +83,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((int)(this["port"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("34359738368")]
@@ -92,7 +92,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((long)(this["memory"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("camldonall01.citrite.net")]
@@ -101,7 +101,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((string)(this["host"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1")]
@@ -110,7 +110,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((int)(this["pod"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("10.1.1.1")]
@@ -119,7 +119,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((string)(this["gateway_ip_address"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public global::System.Guid guid {
@@ -127,7 +127,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((global::System.Guid)(this["guid"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("2")]
@@ -136,7 +136,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((int)(this["cluster"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("1")]
@@ -145,7 +145,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((int)(this["zone"]));
}
}
-
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("c:\\Secondary")]
@@ -157,7 +157,7 @@ namespace CloudStack.Plugin.AgentShell {
this["local_secondary_storage_path"] = value;
}
}
-
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("E:\\Disks\\Disks")]
@@ -169,7 +169,7 @@ namespace CloudStack.Plugin.AgentShell {
this["local_storage_path"] = value;
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("5")]
@@ -178,7 +178,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((int)(this["workers"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("255.255.240.0")]
@@ -187,7 +187,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((string)(this["private_ip_netmask"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("4294967296")]
@@ -196,7 +196,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((long)(this["RootDeviceReservedSpaceBytes"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("../../../../../")]
@@ -205,7 +205,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((string)(this["hyperv_plugin_root"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("e:\\")]
@@ -214,7 +214,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((string)(this["RootDeviceName"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("101F742C6B88")]
@@ -247,7 +247,7 @@ namespace CloudStack.Plugin.AgentShell {
this["testLocalStorePath"] = value;
}
}
-
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("testS3Bucket")]
@@ -259,7 +259,7 @@ namespace CloudStack.Plugin.AgentShell {
this["testS3Bucket"] = value;
}
}
-
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("testS3Endpoint")]
@@ -271,7 +271,7 @@ namespace CloudStack.Plugin.AgentShell {
this["testS3Endpoint"] = value;
}
}
-
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("testS3AccessKey")]
@@ -283,7 +283,7 @@ namespace CloudStack.Plugin.AgentShell {
this["testS3AccessKey"] = value;
}
}
-
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("testS3SecretKey")]
@@ -295,7 +295,7 @@ namespace CloudStack.Plugin.AgentShell {
this["testS3SecretKey"] = value;
}
}
-
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("206-2-73592258-559a-3b38-8f66-b667aab143eb")]
@@ -307,7 +307,7 @@ namespace CloudStack.Plugin.AgentShell {
this["testS3TemplateName"] = value;
}
}
-
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("5fe2bad3-d785-394e-9949-89786b8a63d2")]
@@ -319,7 +319,7 @@ namespace CloudStack.Plugin.AgentShell {
this["testLocalStoreUUID"] = value;
}
}
-
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("acton-systemvm-02062012.vhd.bz2")]
@@ -331,7 +331,7 @@ namespace CloudStack.Plugin.AgentShell {
this["testSystemVMTemplateName"] = value;
}
}
-
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("acton-systemvm-02062012")]
@@ -343,7 +343,7 @@ namespace CloudStack.Plugin.AgentShell {
this["testSystemVMTemplateNameNoExt"] = value;
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("2048")]
@@ -352,7 +352,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((ulong)(this["dom0MinMemory"]));
}
}
-
+
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("10.1.1.1")]
@@ -361,7 +361,7 @@ namespace CloudStack.Plugin.AgentShell {
return ((string)(this["private_ip_address"]));
}
}
-
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("cifs://10.1.1.1/secondary?user\\u003dadministrator\\u0026password\\u003d1pass%40w" +
@@ -374,7 +374,7 @@ namespace CloudStack.Plugin.AgentShell {
this["testCifsUrl"] = value;
}
}
-
+
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("template/tmpl/2/201/61d5316a-3cc4-30cf-a557-78691ff5c143.vhd")]
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/ProjectInstaller.Designer.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/ProjectInstaller.Designer.cs
index 2c6ffe24462..3668a592732 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/ProjectInstaller.Designer.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/ProjectInstaller.Designer.cs
@@ -23,7 +23,7 @@ namespace CloudStack.Plugin.AgentShell
///
private System.ComponentModel.IContainer components = null;
- ///
+ ///
/// Clean up any resources being used.
///
/// true if managed resources should be disposed; otherwise, false.
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/Properties/AssemblyInfo.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/Properties/AssemblyInfo.cs
index bd188bb0ef2..1216f9b1fcb 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/Properties/AssemblyInfo.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/Properties/AssemblyInfo.cs
@@ -19,7 +19,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AgentShell")]
@@ -31,8 +31,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@@ -42,11 +42,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-// You can specify all the values or you can default the Build and Revision Numbers
+// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs
index 306bc96f8c9..2e3de19939d 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/CloudStackTypes.cs
@@ -26,7 +26,7 @@ using System.Threading.Tasks;
// C# versions of certain CloudStack types to simplify JSON serialisation.
// Limit to the number of types, because they are written and maintained manually.
// JsonProperty used to identify property name when serialised, which allows
-// later adoption of C# naming conventions if requried.
+// later adoption of C# naming conventions if requried.
namespace HypervResource
{
public class PrimaryDataStoreTO
@@ -474,15 +474,15 @@ namespace HypervResource
///
Filesystem,
///
- /// NFS or CIFS
+ /// NFS or CIFS
///
NetworkFilesystem,
///
- /// shared LUN, with a clusterfs overlay
+ /// shared LUN, with a clusterfs overlay
///
IscsiLUN,
///
- /// for e.g., ZFS Comstar
+ /// for e.g., ZFS Comstar
///
Iscsi,
///
@@ -494,31 +494,31 @@ namespace HypervResource
///
LVM,
///
- ///
+ ///
///
CLVM,
///
- ///
+ ///
///
RBD,
///
- ///
+ ///
///
SharedMountPoint,
///
- /// VMware VMFS storage
+ /// VMware VMFS storage
///
VMFS,
///
- /// for XenServer, Storage Pool is set up by customers.
+ /// for XenServer, Storage Pool is set up by customers.
///
PreSetup,
///
- /// XenServer local EXT SR
+ /// XenServer local EXT SR
///
EXT,
///
- ///
+ ///
///
OCFS2,
///
@@ -662,7 +662,7 @@ namespace HypervResource
}
///
- /// Fully qualified named for a number of types used in CloudStack. Used to specify the intended type for JSON serialised objects.
+ /// Fully qualified named for a number of types used in CloudStack. Used to specify the intended type for JSON serialised objects.
///
public class CloudStackTypes
{
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
index 59397e8fba8..7e31ced3e38 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs
@@ -129,7 +129,7 @@ namespace HypervResource
///
///
/// POST takes dynamic to allow it to receive JSON without concern for what is the underlying object.
- /// E.g. http://stackoverflow.com/questions/14071715/passing-dynamic-json-object-to-web-api-newtonsoft-example
+ /// E.g. http://stackoverflow.com/questions/14071715/passing-dynamic-json-object-to-web-api-newtonsoft-example
/// and http://stackoverflow.com/questions/3142495/deserialize-json-into-c-sharp-dynamic-object
/// Use ActionName attribute to allow multiple POST URLs, one for each supported command
/// E.g. http://stackoverflow.com/a/12703423/939250
@@ -141,7 +141,7 @@ namespace HypervResource
/// Exceptions handled on command by command basis rather than globally to allow details of the command
/// to be reflected in the response. Default error handling is in the catch for Exception, but
/// other exception types may be caught where the feedback would be different.
- /// NB: global alternatives discussed at
+ /// NB: global alternatives discussed at
/// http://weblogs.asp.net/fredriknormen/archive/2012/06/11/asp-net-web-api-exception-handling.aspx
///
///
@@ -174,7 +174,7 @@ namespace HypervResource
}
///
- /// NOP - placeholder for future setup, e.g. delete existing VMs or Network ports
+ /// NOP - placeholder for future setup, e.g. delete existing VMs or Network ports
/// POST api/HypervResource/SetupCommand
///
///
@@ -486,7 +486,7 @@ namespace HypervResource
}
}
-
+
private static JArray ReturnCloudStackTypedJArray(object ansContent, string ansType)
{
JObject ansObj = Utils.CreateCloudStackObject(ansType, ansContent);
@@ -705,7 +705,7 @@ namespace HypervResource
/// +-System.UnauthorizedAccessException
/// +-System.IO.IOException
/// +-System.IO.PathTooLongException
- ///
+ ///
/// Exceptions related to HTTP URIs
/// System.SystemException
/// +-System.InvalidOperationException
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Properties/AssemblyInfo.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Properties/AssemblyInfo.cs
index 7bbc9b55adb..6a05afa8f7f 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Properties/AssemblyInfo.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Properties/AssemblyInfo.cs
@@ -19,7 +19,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HypervResource")]
@@ -31,8 +31,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@@ -42,11 +42,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-// You can specify all the values or you can default the Build and Revision Numbers
+// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
index d385a8e67ab..6f0327845a0 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs
@@ -111,7 +111,7 @@ namespace HypervResource
return vm;
}
-
+
///
/// Returns ComputerSystem lacking any NICs and VOLUMEs
///
@@ -164,7 +164,7 @@ namespace HypervResource
// Obtain controller for Hyper-V networking subsystem
var vmNetMgmtSvc = GetVirtualSwitchManagementService();
- // Create NIC resource by cloning the default NIC
+ // Create NIC resource by cloning the default NIC
var synthNICsSettings = SyntheticEthernetPortSettingData.GetInstances(vmNetMgmtSvc.Scope, "InstanceID LIKE \"%Default\"");
// Assert
@@ -217,7 +217,7 @@ namespace HypervResource
public const string HARDDISK_DISK = "Microsoft:Hyper-V:Virtual Hard Disk"; // For IDE_HARDDISK_DRIVE
///
- /// Create new VM. By default we start it.
+ /// Create new VM. By default we start it.
///
public ComputerSystem DeployVirtualMachine(dynamic jsonObj, string systemVmIso)
{
@@ -351,9 +351,9 @@ namespace HypervResource
break;
case "DATADISK":
break;
- default:
+ default:
// TODO: double check exception type
- errMsg = string.Format("Unknown disk type {0} for disk {1}, vm named {2}",
+ errMsg = string.Format("Unknown disk type {0} for disk {1}, vm named {2}",
string.IsNullOrEmpty(driveType) ? "NULL" : driveType,
string.IsNullOrEmpty(diskName) ? "NULL" : diskName, vmName);
var ex = new WmiException(errMsg);
@@ -452,9 +452,9 @@ namespace HypervResource
SetBandWidthLimit((ulong)networkRateMbps, portSettings);
}
- logger.DebugFormat("Created adapter {0} on port {1}, {2}",
+ logger.DebugFormat("Created adapter {0} on port {1}, {2}",
newAdapter.Path, portSettings.Path, (vlan == null ? "No VLAN" : "VLAN " + vlan));
- // logger.DebugFormat("Created adapter {0} on port {1}, {2}",
+ // logger.DebugFormat("Created adapter {0} on port {1}, {2}",
// newAdapter.Path, portSettings.Path, (vlan == null ? "No VLAN" : "VLAN " + vlan));
}
}
@@ -468,7 +468,7 @@ namespace HypervResource
var vm = GetComputerSystem(vmName);
if (bootArgs != null && !String.IsNullOrEmpty((string)bootArgs))
{
-
+
String bootargs = bootArgs;
AddUserData(vm, bootargs);
}
@@ -576,7 +576,7 @@ namespace HypervResource
}
/// this method is to add a dvd drive and attach the systemvm iso.
- ///
+ ///
public void patchSystemVmIso(String vmName, String systemVmIso)
{
ComputerSystem vmObject = GetComputerSystem(vmName);
@@ -611,7 +611,7 @@ namespace HypervResource
/// IDE_HARDDISK_DRIVE or IDE_ISO_DRIVE
public ManagementPath AddDiskDriveToIdeController(ComputerSystem vm, string vhdfile, string cntrllerAddr, string driveResourceType)
{
- logger.DebugFormat("Creating DISK for VM {0} (GUID {1}) by attaching {2}",
+ logger.DebugFormat("Creating DISK for VM {0} (GUID {1}) by attaching {2}",
vm.ElementName,
vm.Name,
vhdfile);
@@ -622,13 +622,13 @@ namespace HypervResource
case HARDDISK_DRIVE:
diskResourceSubType = HARDDISK_DISK;
break;
- case ISO_DRIVE:
+ case ISO_DRIVE:
diskResourceSubType = ISO_DISK;
break;
default:
var errMsg = string.Format(
"Unrecognised disk drive type {0} for VM {1} (GUID {2})",
- string.IsNullOrEmpty(driveResourceType) ? "NULL": driveResourceType,
+ string.IsNullOrEmpty(driveResourceType) ? "NULL": driveResourceType,
vm.ElementName,
vm.Name);
var ex = new WmiException(errMsg);
@@ -886,7 +886,7 @@ namespace HypervResource
}
///
- /// Create Msvm_StorageAllocationSettingData corresponding to the ISO image, and
+ /// Create Msvm_StorageAllocationSettingData corresponding to the ISO image, and
/// associate this with the VM's DVD drive.
///
private void AttachIso(ComputerSystem vm, string isoPath)
@@ -1191,7 +1191,7 @@ namespace HypervResource
string vmToDestroy = jsonObj.vmName;
DestroyVm(vmToDestroy);
}
-
+
///
/// Remove all VMs and all SwitchPorts with the displayName. VHD gets deleted elsewhere.
///
@@ -1461,7 +1461,7 @@ namespace HypervResource
///
/// Path that uniquely identifies the resource.
/// VM to which the disk image will be attached.
- // Add new
+ // Add new
private void RemoveNetworkResource(ManagementPath resourcePath)
{
var virtSwitchMgmtSvc = GetVirtualSwitchManagementService();
@@ -1523,9 +1523,9 @@ namespace HypervResource
public void SetState(ComputerSystem vm, ushort requiredState)
{
logger.InfoFormat(
- "Changing state of {0} (GUID {1}) to {2}",
- vm.ElementName,
- vm.Name,
+ "Changing state of {0} (GUID {1}) to {2}",
+ vm.ElementName,
+ vm.Name,
RequiredState.ToString(requiredState));
ManagementPath jobPath;
@@ -1555,9 +1555,9 @@ namespace HypervResource
}
logger.InfoFormat(
- "Successfully changed vm state of {0} (GUID {1} to requested state {2}",
- vm.ElementName,
- vm.Name,
+ "Successfully changed vm state of {0} (GUID {1} to requested state {2}",
+ vm.ElementName,
+ vm.Name,
requiredState);
}
@@ -1589,9 +1589,9 @@ namespace HypervResource
public SyntheticEthernetPortSettingData GetSyntheticEthernetPortSettings(EthernetSwitchPort port)
{
- // An ASSOCIATOR object provides the cross reference from the EthernetSwitchPort and the
+ // An ASSOCIATOR object provides the cross reference from the EthernetSwitchPort and the
// SyntheticEthernetPortSettingData, but generated wrappers do not expose a ASSOCIATOR OF query as a method.
- // Instead, we use the System.Management to code the equivalant of
+ // Instead, we use the System.Management to code the equivalant of
// string query = string.Format( "ASSOCIATORS OF {{{0}}} WHERE ResultClass = {1}", vm.path, resultclassName);
//
var wmiObjQuery = new RelatedObjectQuery(port.Path.Path, SyntheticEthernetPortSettingData.CreatedClassName);
@@ -1620,7 +1620,7 @@ namespace HypervResource
/// Msvm_StorageAllocationSettings with HostResource configured with image
/// file and Parent set to a controller associated with the ComputerSystem
/// VM to which the disk image will be attached.
- // Add new
+ // Add new
private ManagementPath[] AddStorageResource(string[] storageSettings, ComputerSystem vm)
{
return AddVirtualResource(storageSettings, vm);
@@ -1697,7 +1697,7 @@ namespace HypervResource
var vmVirtMgmtSvc = GetVirtualisationSystemManagementService();
EthernetSwitchPortVlanSettingData.GetInstances();
- // Create NIC resource by cloning the default NIC
+ // Create NIC resource by cloning the default NIC
var vlanSettings = EthernetSwitchPortVlanSettingData.GetInstances(vmVirtMgmtSvc.Scope, "InstanceID LIKE \"%Default\"");
// Assert
@@ -1783,7 +1783,7 @@ namespace HypervResource
///
/// With V1 API, external ethernet port was attached to the land endpoint, which was attached to the switch.
/// e.g. Msvm_ExternalEthernetPort -> SwitchLANEndpoint -> SwitchPort -> VirtualSwitch
- ///
+ ///
/// With V2 API, there are two kinds of lan endpoint: one on the computer system and one on the switch
/// e.g. Msvm_ExternalEthernetPort -> LANEndpoint -> LANEdnpoint -> EthernetSwitchPort -> VirtualEthernetSwitch
///
@@ -1800,7 +1800,7 @@ namespace HypervResource
logger.Error(errMsg, ex);
throw ex;
}
- foreach(ExternalEthernetPort externNIC in externNICs.OfType()) {
+ foreach(ExternalEthernetPort externNIC in externNICs.OfType()) {
// A sequence of ASSOCIATOR objects need to be traversed to get from external NIC the vswitch.
// We use ManagementObjectSearcher objects to execute this sequence of questions
// NB: default scope of ManagementObjectSearcher is '\\.\root\cimv2', which does not contain
@@ -1822,7 +1822,7 @@ namespace HypervResource
var switchEndpointQuery = new RelatedObjectQuery(adapterEndPoint.Path.Path, LANEndpoint.CreatedClassName);
var switchEndpointSearch = new ManagementObjectSearcher(externNIC.Scope, switchEndpointQuery);
var switchEndpointCollection = new LANEndpoint.LANEndpointCollection(switchEndpointSearch.Get());
-
+
// assert
if (endpointCollection.Count < 1)
{
@@ -1831,12 +1831,12 @@ namespace HypervResource
logger.Error(errMsg, ex);
throw ex;
}
-
+
LANEndpoint switchEndPoint = switchEndpointCollection.OfType().First();
var switchPortQuery = new RelatedObjectQuery(switchEndPoint.Path.Path, EthernetSwitchPort.CreatedClassName);
var switchPortSearch = new ManagementObjectSearcher(switchEndPoint.Scope, switchPortQuery);
var switchPortCollection = new EthernetSwitchPort.EthernetSwitchPortCollection(switchPortSearch.Get());
-
+
// assert
if (switchPortCollection.Count < 1 )
{
@@ -1845,7 +1845,7 @@ namespace HypervResource
logger.Error(errMsg, ex);
throw ex;
}
-
+
EthernetSwitchPort switchPort = switchPortCollection.OfType().First();
var vSwitchQuery = new RelatedObjectQuery(switchPort.Path.Path, VirtualEthernetSwitch.CreatedClassName);
var vSwitchSearch = new ManagementObjectSearcher(externNIC.Scope, vSwitchQuery);
@@ -2001,7 +2001,7 @@ namespace HypervResource
private static ComputerSystem CreateDefaultVm(VirtualSystemManagementService vmMgmtSvc, string name)
{
- // Tweak default settings by basing new VM on default global setting object
+ // Tweak default settings by basing new VM on default global setting object
// with designed display name.
UInt16 startupAction = 2; // Do nothing.
UInt16 stopAction = 4; // Shutdown.
@@ -2142,7 +2142,7 @@ namespace HypervResource
{
// VirtualSystemManagementService is a singleton, most anonymous way of lookup is by asking for the set
// of local instances, which should be size 1.
-
+
var virtSysMgmtSvcCollection = VirtualSystemManagementService.GetInstances();
foreach (VirtualSystemManagementService item in virtSysMgmtSvcCollection)
{
@@ -2192,8 +2192,8 @@ namespace HypervResource
if (jobObj.JobState != JobState.Completed)
{
var errMsg = string.Format(
- "Hyper-V Job failed, Error Code:{0}, Description: {1}",
- jobObj.ErrorCode,
+ "Hyper-V Job failed, Error Code:{0}, Description: {1}",
+ jobObj.ErrorCode,
jobObj.ErrorDescription);
var ex = new WmiException(errMsg);
logger.Error(errMsg, ex);
@@ -2269,18 +2269,18 @@ namespace HypervResource
sockets++;
}
}
-
+
public void GetProcessorUsageInfo(out double cpuUtilization)
{
- PerfFormattedData_Counters_ProcessorInformation.PerfFormattedData_Counters_ProcessorInformationCollection coll =
+ PerfFormattedData_Counters_ProcessorInformation.PerfFormattedData_Counters_ProcessorInformationCollection coll =
PerfFormattedData_Counters_ProcessorInformation.GetInstances("Name=\"_Total\"");
cpuUtilization = 100;
// Use the first one
foreach (PerfFormattedData_Counters_ProcessorInformation procInfo in coll)
{
- // Idle during a given internal
+ // Idle during a given internal
// See http://library.wmifun.net/cimv2/win32_perfformatteddata_counters_processorinformation.html
- cpuUtilization = 100.0 - (double)procInfo.PercentIdleTime;
+ cpuUtilization = 100.0 - (double)procInfo.PercentIdleTime;
}
}
@@ -2308,7 +2308,7 @@ namespace HypervResource
logger.Error(errMsg);
return null;
}
-
+
return defaultVirtualHardDiskPath;
}
@@ -2376,9 +2376,9 @@ namespace HypervResource
public ProcessorSettingData GetProcSettings(VirtualSystemSettingData vmSettings)
{
- // An ASSOCIATOR object provides the cross reference from the VirtualSystemSettingData and the
+ // An ASSOCIATOR object provides the cross reference from the VirtualSystemSettingData and the
// ProcessorSettingData, but generated wrappers do not expose a ASSOCIATOR OF query as a method.
- // Instead, we use the System.Management to code the equivalant of
+ // Instead, we use the System.Management to code the equivalant of
// string query = string.Format( "ASSOCIATORS OF {{{0}}} WHERE ResultClass = {1}", vmSettings.path, resultclassName);
//
var wmiObjQuery = new RelatedObjectQuery(vmSettings.Path.Path, ProcessorSettingData.CreatedClassName);
@@ -2401,9 +2401,9 @@ namespace HypervResource
public MemorySettingData GetMemSettings(VirtualSystemSettingData vmSettings)
{
- // An ASSOCIATOR object provides the cross reference from the VirtualSystemSettingData and the
+ // An ASSOCIATOR object provides the cross reference from the VirtualSystemSettingData and the
// MemorySettingData, but generated wrappers do not expose a ASSOCIATOR OF query as a method.
- // Instead, we use the System.Management to code the equivalant of
+ // Instead, we use the System.Management to code the equivalant of
// string query = string.Format( "ASSOCIATORS OF {{{0}}} WHERE ResultClass = {1}", vmSettings.path, resultclassName);
//
var wmiObjQuery = new RelatedObjectQuery(vmSettings.Path.Path, MemorySettingData.CreatedClassName);
@@ -2431,7 +2431,7 @@ namespace HypervResource
foreach (ResourceAllocationSettingData wmiObj in wmiObjCollection)
{
- // DVD drive is '16', see http://msdn.microsoft.com/en-us/library/hh850200(v=vs.85).aspx
+ // DVD drive is '16', see http://msdn.microsoft.com/en-us/library/hh850200(v=vs.85).aspx
if (wmiObj.ResourceType == 16)
{
return wmiObj;
@@ -2459,8 +2459,8 @@ namespace HypervResource
}
var errMsg = string.Format(
- "Cannot find the Microsoft Emulated IDE Controlle at address {0} in VirtualSystemSettingData {1}",
- cntrllerAddr,
+ "Cannot find the Microsoft Emulated IDE Controlle at address {0} in VirtualSystemSettingData {1}",
+ cntrllerAddr,
vmSettings.Path.Path);
var ex = new WmiException(errMsg);
logger.Error(errMsg, ex);
@@ -2488,8 +2488,8 @@ namespace HypervResource
}
///
- /// VM resources, typically hardware a described by a generic MSVM_ResourceAllocationSettingData object. The hardware type being
- /// described is identified in two ways: in general terms using an enum in the ResourceType field, and in terms of the implementation
+ /// VM resources, typically hardware a described by a generic MSVM_ResourceAllocationSettingData object. The hardware type being
+ /// described is identified in two ways: in general terms using an enum in the ResourceType field, and in terms of the implementation
/// using text in the ResourceSubType field.
/// See http://msdn.microsoft.com/en-us/library/cc136877%28v=vs.85%29.aspx
///
@@ -2497,9 +2497,9 @@ namespace HypervResource
///
public ResourceAllocationSettingData.ResourceAllocationSettingDataCollection GetResourceAllocationSettings(VirtualSystemSettingData vmSettings)
{
- // An ASSOCIATOR object provides the cross reference from the VirtualSystemSettingData and the
+ // An ASSOCIATOR object provides the cross reference from the VirtualSystemSettingData and the
// ResourceAllocationSettingData, but generated wrappers do not expose a ASSOCIATOR OF query as a method.
- // Instead, we use the System.Management to code the equivalant of
+ // Instead, we use the System.Management to code the equivalant of
// string query = string.Format( "ASSOCIATORS OF {{{0}}} WHERE ResultClass = {1}", vmSettings.path, resultclassName);
//
var wmiObjQuery = new RelatedObjectQuery(vmSettings.Path.Path, ResourceAllocationSettingData.CreatedClassName);
@@ -2525,9 +2525,9 @@ namespace HypervResource
// ComputerSystem -> VirtualSystemSettingData -> EthernetPortAllocationSettingData
VirtualSystemSettingData vmSettings = GetVmSettings(vm);
- // An ASSOCIATOR object provides the cross reference from the VirtualSystemSettingData and the
+ // An ASSOCIATOR object provides the cross reference from the VirtualSystemSettingData and the
// EthernetPortAllocationSettingData, but generated wrappers do not expose a ASSOCIATOR OF query as a method.
- // Instead, we use the System.Management to code the equivalant of
+ // Instead, we use the System.Management to code the equivalant of
// string query = string.Format( "ASSOCIATORS OF {{{0}}} WHERE ResultClass = {1}", vmSettings.path, resultclassName);
//
var wmiObjQuery = new RelatedObjectQuery(vmSettings.Path.Path, EthernetPortAllocationSettingData.CreatedClassName);
@@ -2568,9 +2568,9 @@ namespace HypervResource
public EthernetSwitchPortVlanSettingData GetVlanSettings(EthernetPortAllocationSettingData ethernetConnection)
{
- // An ASSOCIATOR object provides the cross reference from the VirtualSystemSettingData and the
+ // An ASSOCIATOR object provides the cross reference from the VirtualSystemSettingData and the
// EthernetPortAllocationSettingData, but generated wrappers do not expose a ASSOCIATOR OF query as a method.
- // Instead, we use the System.Management to code the equivalant of
+ // Instead, we use the System.Management to code the equivalant of
// string query = string.Format( "ASSOCIATORS OF {{{0}}} WHERE ResultClass = {1}", vmSettings.path, resultclassName);
//
var wmiObjQuery = new RelatedObjectQuery(ethernetConnection.Path.Path, EthernetSwitchPortVlanSettingData.CreatedClassName);
@@ -2596,14 +2596,14 @@ namespace HypervResource
return wmiObjCollection.OfType().First();
}
-
+
public SyntheticEthernetPortSettingData[] GetEthernetPortSettings(ComputerSystem vm)
{
- // An ASSOCIATOR object provides the cross reference from the ComputerSettings and the
+ // An ASSOCIATOR object provides the cross reference from the ComputerSettings and the
// SyntheticEthernetPortSettingData, via the VirtualSystemSettingData.
// However, generated wrappers do not expose a ASSOCIATOR OF query as a method.
- // Instead, we use the System.Management to code the equivalant of
+ // Instead, we use the System.Management to code the equivalant of
//
// string query = string.Format( "ASSOCIATORS OF {{{0}}} WHERE ResultClass = {1}", vm.path, resultclassName);
//
@@ -2640,9 +2640,9 @@ namespace HypervResource
public VirtualSystemSettingData GetVmSettings(ComputerSystem vm)
{
- // An ASSOCIATOR object provides the cross reference from the ComputerSettings and the
+ // An ASSOCIATOR object provides the cross reference from the ComputerSettings and the
// VirtualSystemSettingData, but generated wrappers do not expose a ASSOCIATOR OF query as a method.
- // Instead, we use the System.Management to code the equivalant of
+ // Instead, we use the System.Management to code the equivalant of
// string query = string.Format( "ASSOCIATORS OF {{{0}}} WHERE ResultClass = {1}", vm.path, resultclassName);
//
var wmiObjQuery = new RelatedObjectQuery(vm.Path.Path, VirtualSystemSettingData.CreatedClassName);
@@ -2671,9 +2671,9 @@ namespace HypervResource
public KvpExchangeComponentSettingData GetKvpSettings(VirtualSystemSettingData vmSettings)
{
- // An ASSOCIATOR object provides the cross reference from the VirtualSystemSettingData and the
+ // An ASSOCIATOR object provides the cross reference from the VirtualSystemSettingData and the
// KvpExchangeComponentSettingData, but generated wrappers do not expose a ASSOCIATOR OF query as a method.
- // Instead, we use the System.Management to code the equivalant of
+ // Instead, we use the System.Management to code the equivalant of
// string query = string.Format( "ASSOCIATORS OF {{{0}}} WHERE ResultClass = {1}", vmSettings.path, resultclassName);
//
var wmiObjQuery = new RelatedObjectQuery(vmSettings.Path.Path, KvpExchangeComponentSettingData.CreatedClassName);
@@ -2700,7 +2700,7 @@ namespace HypervResource
{
return;
}
- // Process info available from WMI,
+ // Process info available from WMI,
// See http://msdn.microsoft.com/en-us/library/hh850062(v=vs.85).aspx
uint[] requestedInfo = new uint[] { // TODO: correct?
0, // Name
@@ -2887,7 +2887,7 @@ namespace HypervResource
/// http://msdn.microsoft.com/en-us/library/hh850116(v=vs.85).aspx#methods
/// However, the CIM standard has additional possibilities based on the description
/// of EnabledState.
- /// The previous V1 API is described by
+ /// The previous V1 API is described by
/// http://msdn.microsoft.com/en-us/library/cc136822%28v=vs.85%29.aspx
///
public class EnabledState
@@ -2914,27 +2914,27 @@ namespace HypervResource
public const UInt16 Suspended = 32769;
///
/// The VM is starting. This is a transitional state between 3 (Disabled)
- /// or 32769 (Suspended) and 2 (Enabled) initiated by a call to the
+ /// or 32769 (Suspended) and 2 (Enabled) initiated by a call to the
/// RequestStateChange method with a RequestedState parameter of 2 (Enabled).
///
public const UInt16 Starting = 32770;
///
- /// Starting with Windows Server 2008 R2 this value is not supported.
- /// If the VM is performing a snapshot operation, the element at index 1
- /// of the OperationalStatus property array will contain 32768 (Creating Snapshot),
+ /// Starting with Windows Server 2008 R2 this value is not supported.
+ /// If the VM is performing a snapshot operation, the element at index 1
+ /// of the OperationalStatus property array will contain 32768 (Creating Snapshot),
/// 32769 (Applying Snapshot), or 32770 (Deleting Snapshot).
///
public const UInt16 Snapshotting = 32771;
///
/// The VM is saving its state. This is a transitional state between 2 (Enabled)
- /// and 32769 (Suspended) initiated by a call to the RequestStateChange method
+ /// and 32769 (Suspended) initiated by a call to the RequestStateChange method
/// with a RequestedState parameter of 32769 (Suspended).
///
public const UInt16 Saving = 32773;
///
- /// The VM is turning off. This is a transitional state between 2 (Enabled)
- /// and 3 (Disabled) initiated by a call to the RequestStateChange method
- /// with a RequestedState parameter of 3 (Disabled) or a guest operating system
+ /// The VM is turning off. This is a transitional state between 2 (Enabled)
+ /// and 3 (Disabled) initiated by a call to the RequestStateChange method
+ /// with a RequestedState parameter of 3 (Disabled) or a guest operating system
/// initiated power off.
///
public const UInt16 Stopping = 32774;
@@ -2980,7 +2980,7 @@ namespace HypervResource
case Saving: result = "Saving"; break;
case Stopping: result = "Stopping"; break;
case Pausing: result = "Unknown"; break;
- case Resuming: result = "Starting"; break;
+ case Resuming: result = "Starting"; break;
}
return result;
}
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/ServerResource.Tests/HypervResourceController1Test.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/ServerResource.Tests/HypervResourceController1Test.cs
index 91d41e63b9b..91194a1424d 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/ServerResource.Tests/HypervResourceController1Test.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/ServerResource.Tests/HypervResourceController1Test.cs
@@ -66,7 +66,7 @@ namespace ServerResource.Tests
///
/// Test WmiCalls to which incoming HTTP POST requests are dispatched.
- ///
+ ///
/// TODO: revise beyond first approximation
/// First approximation is a quick port of the existing Java tests for Hyper-V server resource.
/// A second approximation would use the AgentShell settings files directly.
@@ -117,10 +117,10 @@ namespace ServerResource.Tests
// Clean up old test files in local storage folder
FileInfo testVolWorks = new FileInfo(Path.Combine(testLocalStorePath, testSampleVolumeWorkingUUID));
- // Assert.True(testVolWorks.Exists, "Create a working virtual disk at " + testVolWorks.FullName);
-
+ // Assert.True(testVolWorks.Exists, "Create a working virtual disk at " + testVolWorks.FullName);
+
testSampleTemplateURLJSON = JsonConvert.SerializeObject(testSampleTemplateUUID);
- s_logger.Info("Created " + testSampleTemplateURLJSON + " in local storage.");
+ s_logger.Info("Created " + testSampleTemplateURLJSON + " in local storage.");
// Capture other JSON encoded paths
@@ -150,7 +150,7 @@ namespace ServerResource.Tests
return JsonConvert.SerializeObject(newFileInfo.FullName);
}
-
+
[Fact]
public void TestCreateCommand()
{
@@ -267,7 +267,7 @@ namespace ServerResource.Tests
Assert.NotNull(startAns[0][CloudStackTypes.StartAnswer]);
Assert.True((bool)startAns[0][CloudStackTypes.StartAnswer].result, "StartCommand did not succeed " + startAns[0][CloudStackTypes.StartAnswer].details);
- Assert.Null((string)startAns[0][CloudStackTypes.StartAnswer].details);
+ Assert.Null((string)startAns[0][CloudStackTypes.StartAnswer].details);
}
[Fact]
@@ -323,7 +323,7 @@ namespace ServerResource.Tests
"\"volumeId\":10," +
// "\"vmName\":\"i-3-5-VM\"," + // TODO: do we have to fill in the vmName?
"\"accountId\":3,\"id\":10}" +
- "}"; // end of destTO
+ "}"; // end of destTO
return sampleVolumeObjectTO;
}
@@ -345,6 +345,6 @@ namespace ServerResource.Tests
"\"broadcastUri\":\"vlan://261\",\"isolationUri\":\"vlan://261\",\"isSecurityGroupEnabled\":false}" +
"]},\"contextMap\":{},\"wait\":0}";
return sample;
- }
+ }
}
}
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/ServerResource.Tests/HypervResourceControllerTest.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/ServerResource.Tests/HypervResourceControllerTest.cs
index 7f03e151253..f8761867b18 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/ServerResource.Tests/HypervResourceControllerTest.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/ServerResource.Tests/HypervResourceControllerTest.cs
@@ -64,7 +64,7 @@ namespace ServerResource.Tests
///
/// Test WmiCalls to which incoming HTTP POST requests are dispatched.
- ///
+ ///
/// TODO: revise beyond first approximation
/// First approximation is a quick port of the existing Java tests for Hyper-V server resource.
/// A second approximation would use the AgentShell settings files directly.
@@ -326,7 +326,7 @@ namespace ServerResource.Tests
"\"volumeId\":10," +
// "\"vmName\":\"i-3-5-VM\"," + // TODO: do we have to fill in the vmName?
"\"accountId\":3,\"id\":10}" +
- "}"; // end of destTO
+ "}"; // end of destTO
return sampleVolumeObjectTO;
}
@@ -443,7 +443,7 @@ namespace ServerResource.Tests
"\"vmName\":\"i-3-5-VM\"," +
"\"accountId\":3," +
"\"id\":10 }" +
- "}," + // end of destTO
+ "}," + // end of destTO
"\"wait\":0}"; // end of Copy Command
#endregion
//"name":"ROOT-8","size":140616708,"volumeId":8,"vmName":"s-8-VM","accountId":1,"id":8}},"contextMap":{},"wait":0}
@@ -562,7 +562,7 @@ namespace ServerResource.Tests
"\"vmName\":\"i-3-5-VM\"," +
"\"accountId\":1," +
"\"id\":10}" +
- "}," + // end of destTO
+ "}," + // end of destTO
"\"wait\":0}"; // end of Copy Command
#endregion
@@ -1117,7 +1117,7 @@ namespace ServerResource.Tests
string strippedExpectedMac = expectedMac.Replace(":", string.Empty);
Assert.Equal(nicSettingsViaVm[0].Address.ToLower(), strippedExpectedMac.ToLower());
- // Assert switchport has correct VLAN
+ // Assert switchport has correct VLAN
var ethernetConnections = wmiCallsV2.GetEthernetConnections(vm);
var vlanSettings = wmiCallsV2.GetVlanSettings(ethernetConnections[0]);
string isolationUri = (string)jsonStartCmd.vm.nics[0].isolationUri;
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/ServerResource.Tests/Properties/AssemblyInfo.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/ServerResource.Tests/Properties/AssemblyInfo.cs
index c8820467b3c..1929739e8f5 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/ServerResource.Tests/Properties/AssemblyInfo.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/ServerResource.Tests/Properties/AssemblyInfo.cs
@@ -19,7 +19,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ServerResource.Tests")]
@@ -31,8 +31,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@@ -42,11 +42,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-// You can specify all the values or you can default the Revision and Build Numbers
+// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/Properties/AssemblyInfo.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/Properties/AssemblyInfo.cs
index 8d12d056411..e3ec242149f 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/Properties/AssemblyInfo.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/Properties/AssemblyInfo.cs
@@ -19,7 +19,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WmiWrappers")]
@@ -31,8 +31,8 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
@@ -42,11 +42,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-// You can specify all the values or you can default the Build and Revision Numbers
+// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.CIMV2.Win32_OperatingSystem.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.CIMV2.Win32_OperatingSystem.cs
index ce1e22ffe9c..a29ede0f0a0 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.CIMV2.Win32_OperatingSystem.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.CIMV2.Win32_OperatingSystem.cs
@@ -23,8 +23,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
using System.Globalization;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
-
-
+
+
// Functions ShouldSerialize are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use IsNull function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
// Functions IsNull() are used to check if a property is NULL.
// Functions Reset are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
@@ -32,58 +32,58 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
// Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
// An Early Bound class generated for the WMI class.Win32_OperatingSystem
public class OperatingSystem0 : System.ComponentModel.Component {
-
+
// Private property to hold the WMI namespace in which the class resides.
private static string CreatedWmiNamespace = "ROOT\\CIMV2";
-
+
// Private property to hold the name of WMI class which created this class.
private static string CreatedClassName = "Win32_OperatingSystem";
-
+
// Private member variable to hold the ManagementScope which is used by the various methods.
private static System.Management.ManagementScope statMgmtScope = null;
-
+
private ManagementSystemProperties PrivateSystemProperties;
-
+
// Underlying lateBound WMI object.
private System.Management.ManagementObject PrivateLateBoundObject;
-
+
// Member variable to store the 'automatic commit' behavior for the class.
private bool AutoCommitProp;
-
+
// Private variable to hold the embedded property representing the instance.
private System.Management.ManagementBaseObject embeddedObj;
-
+
// The current WMI object used
private System.Management.ManagementBaseObject curObj;
-
+
// Flag to indicate if the instance is an embedded object.
private bool isEmbedded;
-
+
// Below are different overloads of constructors to initialize an instance of the class with a WMI object.
public OperatingSystem0() {
this.InitializeObject(null, new System.Management.ManagementPath(OperatingSystem0.ConstructPath()), null);
}
-
+
public OperatingSystem0(System.Management.ManagementScope mgmtScope) {
this.InitializeObject(mgmtScope, new System.Management.ManagementPath(OperatingSystem0.ConstructPath()), null);
}
-
+
public OperatingSystem0(System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(null, new System.Management.ManagementPath(OperatingSystem0.ConstructPath()), getOptions);
}
-
+
public OperatingSystem0(System.Management.ManagementScope mgmtScope, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(mgmtScope, new System.Management.ManagementPath(OperatingSystem0.ConstructPath()), getOptions);
}
-
+
public OperatingSystem0(System.Management.ManagementPath path) {
this.InitializeObject(null, path, null);
}
-
+
public OperatingSystem0(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(mgmtScope, path, getOptions);
}
-
+
public OperatingSystem0(System.Management.ManagementObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -95,7 +95,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
public OperatingSystem0(System.Management.ManagementBaseObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -108,7 +108,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
// Property returns the namespace of the WMI class.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -117,7 +117,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
return "ROOT\\CIMV2";
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ManagementClassName {
@@ -126,7 +126,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
if ((curObj != null)) {
if ((curObj.ClassPath != null)) {
strRet = ((string)(curObj["__CLASS"]));
- if (((strRet == null)
+ if (((strRet == null)
|| (strRet == string.Empty))) {
strRet = CreatedClassName;
}
@@ -135,7 +135,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
return strRet;
}
}
-
+
// Property pointing to an embedded object to get System properties of the WMI object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -144,7 +144,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
return PrivateSystemProperties;
}
}
-
+
// Property returning the underlying lateBound object.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -153,7 +153,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
return curObj;
}
}
-
+
// ManagementScope of the object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -172,7 +172,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
}
}
}
-
+
// Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -184,7 +184,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
AutoCommitProp = value;
}
}
-
+
// The ManagementPath of the underlying WMI object.
[Browsable(true)]
public System.Management.ManagementPath Path {
@@ -205,7 +205,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
}
}
}
-
+
// Public static scope property which is used by the various methods.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -217,7 +217,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
statMgmtScope = value;
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The BootDevice property indicates the name of the disk drive from which the Win32" +
@@ -227,7 +227,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
return ((string)(curObj["BootDevice"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The BuildNumber property indicates the build number of the operating system. It " +
@@ -238,7 +238,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
return ((string)(curObj["BuildNumber"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The BuildType property indicates the type of build used for the operating system." +
@@ -248,7 +248,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
return ((string)(curObj["BuildType"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Caption property is a short textual description (one-line string) of the obje" +
@@ -258,7 +258,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2 {
return ((string)(curObj["Caption"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The CodeSet property indicates the code page value used by the operating system. A code page contains a character table used by the operating system to translate strings for different languages. The American National Standards Institute (ANSI) lists values that represent defined code pages. If the operating system does not use an ANSI code page, this member will be set to 0. The CodeSet string can use up to six characters to define the code page value.
@@ -268,7 +268,7 @@ Example: 1255.")]
return ((string)(curObj["CodeSet"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The CountryCode property indicates the code for the country/regionused by the operating system. Values are based on international phone dialing prefixes (also referred to as IBM country/region codes). The CountryCode string can use up to six characters to define the country/region code value.
@@ -278,7 +278,7 @@ Example: 1 for the United States)")]
return ((string)(curObj["CountryCode"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("CreationClassName indicates the name of the class or the subclass used in the cre" +
@@ -290,7 +290,7 @@ Example: 1 for the United States)")]
return ((string)(curObj["CreationClassName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("CSCreationClassName contains the scoping computer system\'s creation class name.")]
@@ -299,7 +299,7 @@ Example: 1 for the United States)")]
return ((string)(curObj["CSCreationClassName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The CSDVersion property contains a null-terminated string, that indicates the latest Service Pack installed on the computer system. If no Service Pack is installed, the string is NULL. For computer systems running Windows 95, this property contains a null-terminated string that provides arbitrary additional information about the operating system.
@@ -309,7 +309,7 @@ Example: Service Pack 3.")]
return ((string)(curObj["CSDVersion"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("CSName contains the scoping computer system\'s name.")]
@@ -318,7 +318,7 @@ Example: Service Pack 3.")]
return ((string)(curObj["CSName"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsCurrentTimeZoneNull {
@@ -331,7 +331,7 @@ Example: Service Pack 3.")]
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("CurrentTimeZone indicates the number of minutes the operating system is offset fr" +
@@ -345,7 +345,7 @@ Example: Service Pack 3.")]
return ((short)(curObj["CurrentTimeZone"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDataExecutionPrevention_32BitApplicationsNull {
@@ -358,7 +358,7 @@ Example: Service Pack 3.")]
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("If true, indicates that 32-bit applications are running with Data Execution Preve" +
@@ -372,7 +372,7 @@ Example: Service Pack 3.")]
return ((bool)(curObj["DataExecutionPrevention_32BitApplications"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDataExecutionPrevention_AvailableNull {
@@ -385,7 +385,7 @@ Example: Service Pack 3.")]
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"If true, indicates that the hardware supports Windows Data Execution Prevention (DEP) technology. DEP ensures that all memory locations are marked with a non-executable attribute unless the memory location explicitly contains executable code. This can help mitigate certain types of buffer overrun security exploits. If DEP is available, 64-bit applications are automatically protected. To determine if DEP has been enabled for 32-bit applications and drivers, use the DataExecutionPrevention_ properties ")]
@@ -398,7 +398,7 @@ Example: Service Pack 3.")]
return ((bool)(curObj["DataExecutionPrevention_Available"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDataExecutionPrevention_DriversNull {
@@ -411,7 +411,7 @@ Example: Service Pack 3.")]
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("If true, indicates that drivers are running with Data Execution Prevention (DEP) " +
@@ -425,7 +425,7 @@ Example: Service Pack 3.")]
return ((bool)(curObj["DataExecutionPrevention_Drivers"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDataExecutionPrevention_SupportPolicyNull {
@@ -438,7 +438,7 @@ Example: Service Pack 3.")]
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The DataExecutionPrevention_SupportPolicy indicates which one of four Data Execution Prevention (DEP) settings is applied. Each setting varies by the extent to which DEP is applied to 32-bit applications. Note that DEP is always applied to the Windows kernel. Always On (not available in the user interface) indicates that DEP is enabled for all 32-bit applications on the machine with no exceptions. OptOut indicates DEP is on by default for all 32-bit applications and that a user or administrator must explicitly remove support for a 32-bit application by adding to an exceptions list. OptIn indicates DEP is on for a limited number of binaries, the kernel, and all Windows services but it is off by default for all 32-bit applications; a user or administrator must explicitly choose the AlwaysOn (not available in the user interface) or OptOut setting before DEP can be applied to 32-bit applications. AlwaysOff (not available in the user interface) indicates DEP is turned off for all 32-bit applications on the machine. ")]
@@ -451,7 +451,7 @@ Example: Service Pack 3.")]
return ((DataExecutionPrevention_SupportPolicyValues)(System.Convert.ToInt32(curObj["DataExecutionPrevention_SupportPolicy"])));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDebugNull {
@@ -464,7 +464,7 @@ Example: Service Pack 3.")]
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The Debug property indicates whether the operating system is a checked (debug) build. Checked builds provide error checking, argument verification, and system debugging code. Additional code in a checked binary generates a kernel debugger error message and breaks into the debugger. This helps immediately determine the cause and location of the error. Performance suffers in the checked build due to the additional code that is executed.
@@ -478,7 +478,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((bool)(curObj["Debug"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Description property provides a description of the Windows operating system. " +
@@ -490,13 +490,13 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
set {
curObj["Description"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDistributedNull {
@@ -509,7 +509,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Boolean indicating whether the operating system is distributed across several com" +
@@ -523,7 +523,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((bool)(curObj["Distributed"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsEncryptionLevelNull {
@@ -536,7 +536,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The EncryptionLevel property specifies if the encryption level for secure transac" +
@@ -550,7 +550,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((EncryptionLevelValues)(System.Convert.ToInt32(curObj["EncryptionLevel"])));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsForegroundApplicationBoostNull {
@@ -563,7 +563,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The ForegroundApplicationBoost property indicates the increase in priority given to the foreground application. On computer systems running Windows NT 4.0 and Windows 2000, application boost is implemented by giving an application more execution time slices (quantum lengths). A ForegroundApplicationBoost value of 0 indicates the system boosts the quantum length by 6; if 1, then 12; and if 2 then 18. On Windows NT 3.51 and earlier, application boost is implemented by increasing the scheduling priority. For these systems, the scheduling priority is increased by the value of this property. The default value is 2.")]
@@ -582,13 +582,13 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
else {
curObj["ForegroundApplicationBoost"] = value;
}
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsFreePhysicalMemoryNull {
@@ -601,7 +601,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Number of kilobytes of physical memory currently unused and available")]
@@ -614,7 +614,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((ulong)(curObj["FreePhysicalMemory"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsFreeSpaceInPagingFilesNull {
@@ -627,7 +627,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The total number of KBytes that can be mapped into the OperatingSystem\'s paging f" +
@@ -642,7 +642,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((ulong)(curObj["FreeSpaceInPagingFiles"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsFreeVirtualMemoryNull {
@@ -655,7 +655,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Number of kilobytes of virtual memory currently unused and available. For example" +
@@ -671,7 +671,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((ulong)(curObj["FreeVirtualMemory"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsInstallDateNull {
@@ -684,7 +684,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The InstallDate property is datetime value indicating when the object was install" +
@@ -700,7 +700,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLargeSystemCacheNull {
@@ -713,7 +713,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The LargeSystemCache property indicates whether to optimize memory for applicatio" +
@@ -727,7 +727,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((LargeSystemCacheValues)(System.Convert.ToInt32(curObj["LargeSystemCache"])));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLastBootUpTimeNull {
@@ -740,7 +740,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Time when the operating system was last booted")]
@@ -755,7 +755,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLocalDateTimeNull {
@@ -768,7 +768,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Operating system\'s notion of the local date and time of day.")]
@@ -783,7 +783,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The Locale property indicates the language identifier used by the operating system. A language identifier is a standard international numeric abbreviation for a country or region. Each language has a unique language identifier (LANGID), a 16-bit value that consists of a primary language identifier and a secondary language identifier.")]
@@ -792,7 +792,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((string)(curObj["Locale"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Manufacturer property indicates the name of the operating system manufacturer" +
@@ -802,7 +802,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((string)(curObj["Manufacturer"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsMaxNumberOfProcessesNull {
@@ -815,7 +815,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"Maximum number of process contexts the operating system can support. If there is no fixed maximum, the value should be 0. On systems that have a fixed maximum, this object can help diagnose failures that occur when the maximum is reached. If unknown, enter -1.")]
@@ -828,7 +828,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((uint)(curObj["MaxNumberOfProcesses"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsMaxProcessMemorySizeNull {
@@ -841,7 +841,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"Maximum number of kilobytes of memory that can be allocated to a process. For operating systems with no virtual memory, this value is typically equal to the total amount of physical memory minus memory used by the BIOS and OS. For some operating systems, this value may be infinity - in which case, 0 should be entered. In other cases, this value could be a constant - for example, 2G or 4G.")]
@@ -854,7 +854,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((ulong)(curObj["MaxProcessMemorySize"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The MUILanguages property indicates the MUI Languages installed in the system. \n " +
@@ -864,7 +864,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((string[])(curObj["MUILanguages"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Name of the operating system instance within a computer system.")]
@@ -873,7 +873,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((string)(curObj["Name"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsNumberOfLicensedUsersNull {
@@ -886,7 +886,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Number of user licenses for the operating system. If unlimited, enter 0. If unkno" +
@@ -900,7 +900,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((uint)(curObj["NumberOfLicensedUsers"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsNumberOfProcessesNull {
@@ -913,7 +913,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Number of process contexts currently loaded or running on the operating system.")]
@@ -926,7 +926,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((uint)(curObj["NumberOfProcesses"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsNumberOfUsersNull {
@@ -939,7 +939,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Number of user sessions for which the operating system is currently storing state" +
@@ -953,7 +953,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((uint)(curObj["NumberOfUsers"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsOperatingSystemSKUNull {
@@ -966,7 +966,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The OperatingSystemSKU property identifies the SKU of the operating system.")]
@@ -979,7 +979,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((uint)(curObj["OperatingSystemSKU"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Organization property indicates the registered user\'s (of the operating syste" +
@@ -989,7 +989,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((string)(curObj["Organization"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The OSArchitecture property indicates the Architecture of the operating system.Ex" +
@@ -999,7 +999,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((string)(curObj["OSArchitecture"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsOSLanguageNull {
@@ -1012,7 +1012,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The OSLanguage property indicates which language version of the operating system " +
@@ -1026,7 +1026,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((uint)(curObj["OSLanguage"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsOSProductSuiteNull {
@@ -1039,7 +1039,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The OSProductSuite property identifies installed and licensed system product addi" +
@@ -1053,7 +1053,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((OSProductSuiteValues)(System.Convert.ToInt32(curObj["OSProductSuite"])));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsOSTypeNull {
@@ -1066,7 +1066,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("A integer indicating the type of operating system.")]
@@ -1079,7 +1079,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((OSTypeValues)(System.Convert.ToInt32(curObj["OSType"])));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"A string describing the manufacturer and operating system type - used when the operating system property, OSType, is set to 1 (""Other""). The format of the string inserted in OtherTypeDescription should be similar in format to the Values strings defined for OSType. OtherTypeDescription should be set to NULL when OSType is any value other than 1.")]
@@ -1088,7 +1088,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((string)(curObj["OtherTypeDescription"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPAEEnabledNull {
@@ -1101,7 +1101,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1113,7 +1113,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((bool)(curObj["PAEEnabled"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The PlusProductID property contains the product identification number for the Win" +
@@ -1123,7 +1123,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((string)(curObj["PlusProductID"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The PlusVersionNumber property contains the version number of the Windows Plus! o" +
@@ -1133,7 +1133,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
return ((string)(curObj["PlusVersionNumber"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPortableOperatingSystemNull {
@@ -1146,7 +1146,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the debugging version of User.e
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The PortableOperatingSystem property indicates if theOperating System is booting from a supported locally connected storagedevice.
@@ -1161,7 +1161,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((bool)(curObj["PortableOperatingSystem"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPrimaryNull {
@@ -1174,7 +1174,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Primary property determines whether this is the primary operating system.\nVal" +
@@ -1189,7 +1189,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((bool)(curObj["Primary"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsProductTypeNull {
@@ -1202,7 +1202,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The ProductType property indicates additional information about the system. This " +
@@ -1217,7 +1217,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((ProductTypeValues)(System.Convert.ToInt32(curObj["ProductType"])));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The RegisteredUser property indicates the name of the registered user of the oper" +
@@ -1227,7 +1227,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((string)(curObj["RegisteredUser"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The SerialNumber property indicates the operating system product serial identific" +
@@ -1237,7 +1237,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((string)(curObj["SerialNumber"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsServicePackMajorVersionNull {
@@ -1250,7 +1250,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The ServicePackMajorVersion property indicates the major version number of the service pack installed on the computer system. If no service pack has been installed, the value is zero. ServicePackMajorVersion is valid for computers running Windows 2000 and later (NULL otherwise).")]
@@ -1263,7 +1263,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((ushort)(curObj["ServicePackMajorVersion"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsServicePackMinorVersionNull {
@@ -1276,7 +1276,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The ServicePackMinorVersion property indicates the minor version number of the service pack installed on the computer system. If no service pack has been installed, the value is zero. ServicePackMinorVersion is valid for computers running Windows 2000 and later (NULL otherwise).")]
@@ -1289,7 +1289,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((ushort)(curObj["ServicePackMinorVersion"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsSizeStoredInPagingFilesNull {
@@ -1302,7 +1302,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The total number of kilobytes that can be stored in the operating system\'s paging" +
@@ -1317,7 +1317,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((ulong)(curObj["SizeStoredInPagingFiles"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The Status property is a string indicating the current status of the object. Various operational and non-operational statuses can be defined. Operational statuses are ""OK"", ""Degraded"" and ""Pred Fail"". ""Pred Fail"" indicates that an element may be functioning properly but predicting a failure in the near future. An example is a SMART-enabled hard drive. Non-operational statuses can also be specified. These are ""Error"", ""Starting"", ""Stopping"" and ""Service"". The latter, ""Service"", could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is on-line, yet the managed element is neither ""OK"" nor in one of the other states.")]
@@ -1326,7 +1326,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((string)(curObj["Status"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsSuiteMaskNull {
@@ -1339,20 +1339,20 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- [Description(@"The SuiteMask property indicates a set of bit flags that identify the product suites available on the system. This member can be a combination of the following values:
-0 - Windows Server 2003, Small Business Edition
-1 - Windows Server 2003, Enterprise Edition
-2 - Windows Server 2003, Backoffice Edition
-3 - Windows Server 2003, Communications Edition
-4 - Microsoft Terminal Services
-5 - Windows Server 2003, Small Business Edition Restricted
-6 - Windows XP Embedded
-7 - Windows Server 2003, Datacenter Edition
-8 - Single User
-9 - Windows XP Home Edition
+ [Description(@"The SuiteMask property indicates a set of bit flags that identify the product suites available on the system. This member can be a combination of the following values:
+0 - Windows Server 2003, Small Business Edition
+1 - Windows Server 2003, Enterprise Edition
+2 - Windows Server 2003, Backoffice Edition
+3 - Windows Server 2003, Communications Edition
+4 - Microsoft Terminal Services
+5 - Windows Server 2003, Small Business Edition Restricted
+6 - Windows XP Embedded
+7 - Windows Server 2003, Datacenter Edition
+8 - Single User
+9 - Windows XP Home Edition
10 - Windows Server 2003, Web Edition")]
[TypeConverter(typeof(WMIValueTypeConverter))]
public SuiteMaskValues SuiteMask {
@@ -1363,7 +1363,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((SuiteMaskValues)(System.Convert.ToInt32(curObj["SuiteMask"])));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The SystemDevice property indicates the physical disk partition the operating sys" +
@@ -1373,7 +1373,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((string)(curObj["SystemDevice"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The SystemDirectory property indicates the system directory of the operating syst" +
@@ -1383,7 +1383,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((string)(curObj["SystemDirectory"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The SystemDrive property contains the letter of the disk drive that the operating" +
@@ -1393,7 +1393,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((string)(curObj["SystemDrive"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTotalSwapSpaceSizeNull {
@@ -1406,7 +1406,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"Total swap space in kilobytes. This value may be NULL (unspecified) if swap space is not distinguished from page files. However, some operating systems distinguish these concepts. For example, in UNIX, whole processes can be 'swapped out' when the free page list falls and remains below a specified amount.")]
@@ -1419,7 +1419,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((ulong)(curObj["TotalSwapSpaceSize"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTotalVirtualMemorySizeNull {
@@ -1432,7 +1432,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Number of kilobytes of virtual memory. For example, this may be calculated by add" +
@@ -1448,7 +1448,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((ulong)(curObj["TotalVirtualMemorySize"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTotalVisibleMemorySizeNull {
@@ -1461,7 +1461,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The total amount of physical memory (in Kbytes) available to the OperatingSystem." +
@@ -1476,7 +1476,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((ulong)(curObj["TotalVisibleMemorySize"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Version property indicates the version number of the operating system.\nExampl" +
@@ -1486,7 +1486,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((string)(curObj["Version"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The WindowsDirectory property indicates the Windows directory of the operating sy" +
@@ -1496,9 +1496,9 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return ((string)(curObj["WindowsDirectory"]));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions OptionsParam) {
- if (((path != null)
+ if (((path != null)
&& (string.Compare(path.ClassName, this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -1506,9 +1506,9 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return CheckIfProperClass(new System.Management.ManagementObject(mgmtScope, path, OptionsParam));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementBaseObject theObj) {
- if (((theObj != null)
+ if (((theObj != null)
&& (string.Compare(((string)(theObj["__CLASS"])), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -1525,107 +1525,107 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
}
return false;
}
-
+
private bool ShouldSerializeCurrentTimeZone() {
if ((this.IsCurrentTimeZoneNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeDataExecutionPrevention_32BitApplications() {
if ((this.IsDataExecutionPrevention_32BitApplicationsNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeDataExecutionPrevention_Available() {
if ((this.IsDataExecutionPrevention_AvailableNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeDataExecutionPrevention_Drivers() {
if ((this.IsDataExecutionPrevention_DriversNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeDataExecutionPrevention_SupportPolicy() {
if ((this.IsDataExecutionPrevention_SupportPolicyNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeDebug() {
if ((this.IsDebugNull == false)) {
return true;
}
return false;
}
-
+
private void ResetDescription() {
curObj["Description"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private bool ShouldSerializeDistributed() {
if ((this.IsDistributedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeEncryptionLevel() {
if ((this.IsEncryptionLevelNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeForegroundApplicationBoost() {
if ((this.IsForegroundApplicationBoostNull == false)) {
return true;
}
return false;
}
-
+
private void ResetForegroundApplicationBoost() {
curObj["ForegroundApplicationBoost"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private bool ShouldSerializeFreePhysicalMemory() {
if ((this.IsFreePhysicalMemoryNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeFreeSpaceInPagingFiles() {
if ((this.IsFreeSpaceInPagingFilesNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeFreeVirtualMemory() {
if ((this.IsFreeVirtualMemoryNull == false)) {
return true;
}
return false;
}
-
+
// Converts a given datetime in DMTF format to System.DateTime object.
static System.DateTime ToDateTime(string dmtfDate) {
System.DateTime initializer = System.DateTime.MinValue;
@@ -1677,13 +1677,13 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
if (("******" != tempString)) {
ticks = (long.Parse(tempString) * ((long)((System.TimeSpan.TicksPerMillisecond / 1000))));
}
- if (((((((((year < 0)
- || (month < 0))
- || (day < 0))
- || (hour < 0))
- || (minute < 0))
- || (minute < 0))
- || (second < 0))
+ if (((((((((year < 0)
+ || (month < 0))
+ || (day < 0))
+ || (hour < 0))
+ || (minute < 0))
+ || (minute < 0))
+ || (second < 0))
|| (ticks < 0))) {
throw new System.ArgumentOutOfRangeException();
}
@@ -1711,7 +1711,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
}
return datetime;
}
-
+
// Converts a given System.DateTime object to DMTF datetime format.
static string ToDmtfDateTime(System.DateTime date) {
string utcString = string.Empty;
@@ -1738,8 +1738,8 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
dmtfDateTime = string.Concat(dmtfDateTime, ((int)(date.Second)).ToString().PadLeft(2, '0'));
dmtfDateTime = string.Concat(dmtfDateTime, ".");
System.DateTime dtTemp = new System.DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, 0);
- long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
- * 1000)
+ long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
+ * 1000)
/ System.TimeSpan.TicksPerMillisecond)));
string strMicrosec = ((long)(microsec)).ToString();
if ((strMicrosec.Length > 6)) {
@@ -1749,198 +1749,198 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
dmtfDateTime = string.Concat(dmtfDateTime, utcString);
return dmtfDateTime;
}
-
+
private bool ShouldSerializeInstallDate() {
if ((this.IsInstallDateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLargeSystemCache() {
if ((this.IsLargeSystemCacheNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLastBootUpTime() {
if ((this.IsLastBootUpTimeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLocalDateTime() {
if ((this.IsLocalDateTimeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeMaxNumberOfProcesses() {
if ((this.IsMaxNumberOfProcessesNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeMaxProcessMemorySize() {
if ((this.IsMaxProcessMemorySizeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeNumberOfLicensedUsers() {
if ((this.IsNumberOfLicensedUsersNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeNumberOfProcesses() {
if ((this.IsNumberOfProcessesNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeNumberOfUsers() {
if ((this.IsNumberOfUsersNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeOperatingSystemSKU() {
if ((this.IsOperatingSystemSKUNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeOSLanguage() {
if ((this.IsOSLanguageNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeOSProductSuite() {
if ((this.IsOSProductSuiteNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeOSType() {
if ((this.IsOSTypeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePAEEnabled() {
if ((this.IsPAEEnabledNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePortableOperatingSystem() {
if ((this.IsPortableOperatingSystemNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePrimary() {
if ((this.IsPrimaryNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeProductType() {
if ((this.IsProductTypeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeServicePackMajorVersion() {
if ((this.IsServicePackMajorVersionNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeServicePackMinorVersion() {
if ((this.IsServicePackMinorVersionNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeSizeStoredInPagingFiles() {
if ((this.IsSizeStoredInPagingFilesNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeSuiteMask() {
if ((this.IsSuiteMaskNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTotalSwapSpaceSize() {
if ((this.IsTotalSwapSpaceSizeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTotalVirtualMemorySize() {
if ((this.IsTotalVirtualMemorySizeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTotalVisibleMemorySize() {
if ((this.IsTotalVisibleMemorySizeNull == false)) {
return true;
}
return false;
}
-
+
[Browsable(true)]
public void CommitObject() {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put();
}
}
-
+
[Browsable(true)]
public void CommitObject(System.Management.PutOptions putOptions) {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put(putOptions);
}
}
-
+
private void Initialize() {
AutoCommitProp = true;
isEmbedded = false;
}
-
+
private static string ConstructPath() {
return "ROOT\\CIMV2:Win32_OperatingSystem=@";
}
-
+
private void InitializeObject(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
Initialize();
if ((path != null)) {
@@ -1952,7 +1952,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
curObj = PrivateLateBoundObject;
}
-
+
[Browsable(true)]
public static OperatingSystem0 CreateInstance() {
System.Management.ManagementScope mgmtScope = null;
@@ -1967,12 +1967,12 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
System.Management.ManagementClass tmpMgmtClass = new System.Management.ManagementClass(mgmtScope, mgmtPath, null);
return new OperatingSystem0(tmpMgmtClass.CreateInstance());
}
-
+
[Browsable(true)]
public void Delete() {
PrivateLateBoundObject.Delete();
}
-
+
public uint Reboot() {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1986,7 +1986,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return System.Convert.ToUInt32(0);
}
}
-
+
public uint SetDateTime(System.DateTime LocalDateTime) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -2002,7 +2002,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return System.Convert.ToUInt32(0);
}
}
-
+
public uint Shutdown() {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -2016,7 +2016,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return System.Convert.ToUInt32(0);
}
}
-
+
public uint Win32Shutdown(int Flags, int Reserved) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -2033,7 +2033,7 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return System.Convert.ToUInt32(0);
}
}
-
+
public uint Win32ShutdownTracker(string Comment, int Flags, uint ReasonCode, uint Timeout) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -2052,395 +2052,395 @@ Values: TRUE or FALSE, A value of TRUE indicates the OperatingSystem was booted
return System.Convert.ToUInt32(0);
}
}
-
+
public enum DataExecutionPrevention_SupportPolicyValues {
-
+
Always_Off = 0,
-
+
Always_On = 1,
-
+
Opt_In = 2,
-
+
Opt_Out = 3,
-
+
NULL_ENUM_VALUE = 4,
}
-
+
public enum EncryptionLevelValues {
-
+
Val_40_bit = 0,
-
+
Val_128_bit = 1,
-
+
N_bit = 2,
-
+
NULL_ENUM_VALUE = 3,
}
-
+
public enum ForegroundApplicationBoostValues {
-
+
None = 0,
-
+
Minimum = 1,
-
+
Maximum = 2,
-
+
NULL_ENUM_VALUE = 3,
}
-
+
public enum LargeSystemCacheValues {
-
+
Optimize_for_Applications = 0,
-
+
Optimize_for_System_Performance = 1,
-
+
NULL_ENUM_VALUE = 2,
}
-
+
public enum OSProductSuiteValues {
-
+
Small_Business = 1,
-
+
Enterprise = 2,
-
+
BackOffice = 4,
-
+
Communication_Server = 8,
-
+
Terminal_Server = 16,
-
+
Small_Business_Restricted_ = 32,
-
+
Embedded_NT = 64,
-
+
Data_Center = 128,
-
+
NULL_ENUM_VALUE = 256,
}
-
+
public enum OSTypeValues {
-
+
Unknown0 = 0,
-
+
Other0 = 1,
-
+
MACOS = 2,
-
+
ATTUNIX = 3,
-
+
DGUX = 4,
-
+
DECNT = 5,
-
+
Digital_Unix = 6,
-
+
OpenVMS = 7,
-
+
HPUX = 8,
-
+
AIX = 9,
-
+
MVS = 10,
-
+
OS400 = 11,
-
+
OS_2 = 12,
-
+
JavaVM = 13,
-
+
MSDOS = 14,
-
+
WIN3x = 15,
-
+
WIN95 = 16,
-
+
WIN98 = 17,
-
+
WINNT = 18,
-
+
WINCE = 19,
-
+
NCR3000 = 20,
-
+
NetWare = 21,
-
+
OSF = 22,
-
+
DC_OS = 23,
-
+
Reliant_UNIX = 24,
-
+
SCO_UnixWare = 25,
-
+
SCO_OpenServer = 26,
-
+
Sequent = 27,
-
+
IRIX = 28,
-
+
Solaris = 29,
-
+
SunOS = 30,
-
+
U6000 = 31,
-
+
ASERIES = 32,
-
+
TandemNSK = 33,
-
+
TandemNT = 34,
-
+
BS2000 = 35,
-
+
LINUX = 36,
-
+
Lynx = 37,
-
+
XENIX = 38,
-
+
VM_ESA = 39,
-
+
Interactive_UNIX = 40,
-
+
BSDUNIX = 41,
-
+
FreeBSD = 42,
-
+
NetBSD = 43,
-
+
GNU_Hurd = 44,
-
+
OS9 = 45,
-
+
MACH_Kernel = 46,
-
+
Inferno = 47,
-
+
QNX = 48,
-
+
EPOC = 49,
-
+
IxWorks = 50,
-
+
VxWorks = 51,
-
+
MiNT = 52,
-
+
BeOS = 53,
-
+
HP_MPE = 54,
-
+
NextStep = 55,
-
+
PalmPilot = 56,
-
+
Rhapsody = 57,
-
+
Windows_2000 = 58,
-
+
Dedicated = 59,
-
+
OS_390 = 60,
-
+
VSE = 61,
-
+
TPF = 62,
-
+
NULL_ENUM_VALUE = 63,
}
-
+
public enum ProductTypeValues {
-
+
Work_Station = 1,
-
+
Domain_Controller = 2,
-
+
Server = 3,
-
+
NULL_ENUM_VALUE = 0,
}
-
+
public enum SuiteMaskValues {
-
+
Windows_Server_2003_Small_Business_Edition = 0,
-
+
Windows_Server_2003_Enterprise_Edition = 1,
-
+
Windows_Server_2003_Backoffice_Edition = 2,
-
+
Windows_Server_2003_Communications_Edition = 3,
-
+
Microsoft_Terminal_Services = 4,
-
+
Windows_Server_2003_Small_Business_Edition_Restricted = 5,
-
+
Windows_XP_Embedded = 6,
-
+
Windows_Server_2003_Datacenter_Edition = 7,
-
+
Single_User = 8,
-
+
Windows_XP_Home_Edition = 9,
-
+
Windows_Server_2003_Web_Edition = 10,
-
+
NULL_ENUM_VALUE = 20,
}
-
+
// TypeConverter to handle null values for ValueType properties
public class WMIValueTypeConverter : TypeConverter {
-
+
private TypeConverter baseConverter;
-
+
private System.Type baseType;
-
+
public WMIValueTypeConverter(System.Type inBaseType) {
baseConverter = TypeDescriptor.GetConverter(inBaseType);
baseType = inBaseType;
}
-
+
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type srcType) {
return baseConverter.CanConvertFrom(context, srcType);
}
-
+
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) {
return baseConverter.CanConvertTo(context, destinationType);
}
-
+
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
return baseConverter.ConvertFrom(context, culture, value);
}
-
+
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary dictionary) {
return baseConverter.CreateInstance(context, dictionary);
}
-
+
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetCreateInstanceSupported(context);
}
-
+
public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributeVar) {
return baseConverter.GetProperties(context, value, attributeVar);
}
-
+
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetPropertiesSupported(context);
}
-
+
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValues(context);
}
-
+
public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesExclusive(context);
}
-
+
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesSupported(context);
}
-
+
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) {
if ((baseType.BaseType == typeof(System.Enum))) {
if ((value.GetType() == destinationType)) {
return value;
}
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "NULL_ENUM_VALUE" ;
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((baseType == typeof(bool))
+ if (((baseType == typeof(bool))
&& (baseType.BaseType == typeof(System.ValueType)))) {
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((context != null)
+ if (((context != null)
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
}
-
+
// Embedded class to represent WMI system Properties.
[TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class ManagementSystemProperties {
-
+
private System.Management.ManagementBaseObject PrivateLateBoundObject;
-
+
public ManagementSystemProperties(System.Management.ManagementBaseObject ManagedObject) {
PrivateLateBoundObject = ManagedObject;
}
-
+
[Browsable(true)]
public int GENUS {
get {
return ((int)(PrivateLateBoundObject["__GENUS"]));
}
}
-
+
[Browsable(true)]
public string CLASS {
get {
return ((string)(PrivateLateBoundObject["__CLASS"]));
}
}
-
+
[Browsable(true)]
public string SUPERCLASS {
get {
return ((string)(PrivateLateBoundObject["__SUPERCLASS"]));
}
}
-
+
[Browsable(true)]
public string DYNASTY {
get {
return ((string)(PrivateLateBoundObject["__DYNASTY"]));
}
}
-
+
[Browsable(true)]
public string RELPATH {
get {
return ((string)(PrivateLateBoundObject["__RELPATH"]));
}
}
-
+
[Browsable(true)]
public int PROPERTY_COUNT {
get {
return ((int)(PrivateLateBoundObject["__PROPERTY_COUNT"]));
}
}
-
+
[Browsable(true)]
public string[] DERIVATION {
get {
return ((string[])(PrivateLateBoundObject["__DERIVATION"]));
}
}
-
+
[Browsable(true)]
public string SERVER {
get {
return ((string)(PrivateLateBoundObject["__SERVER"]));
}
}
-
+
[Browsable(true)]
public string NAMESPACE {
get {
return ((string)(PrivateLateBoundObject["__NAMESPACE"]));
}
}
-
+
[Browsable(true)]
public string PATH {
get {
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.CIMV2.Win32_Processor.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.CIMV2.Win32_Processor.cs
index 09ef22b4288..48e7ecec50a 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.CIMV2.Win32_Processor.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.CIMV2.Win32_Processor.cs
@@ -24,8 +24,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
using System.Globalization;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
-
-
+
+
// Functions ShouldSerialize are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use IsNull function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
// Functions IsNull() are used to check if a property is NULL.
// Functions Reset are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
@@ -33,62 +33,62 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
// Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
// An Early Bound class generated for the WMI class.Win32_Processor
public class Processor : System.ComponentModel.Component {
-
+
// Private property to hold the WMI namespace in which the class resides.
private static string CreatedWmiNamespace = "ROOT\\CIMV2";
-
+
// Private property to hold the name of WMI class which created this class.
private static string CreatedClassName = "Win32_Processor";
-
+
// Private member variable to hold the ManagementScope which is used by the various methods.
private static System.Management.ManagementScope statMgmtScope = null;
-
+
private ManagementSystemProperties PrivateSystemProperties;
-
+
// Underlying lateBound WMI object.
private System.Management.ManagementObject PrivateLateBoundObject;
-
+
// Member variable to store the 'automatic commit' behavior for the class.
private bool AutoCommitProp;
-
+
// Private variable to hold the embedded property representing the instance.
private System.Management.ManagementBaseObject embeddedObj;
-
+
// The current WMI object used
private System.Management.ManagementBaseObject curObj;
-
+
// Flag to indicate if the instance is an embedded object.
private bool isEmbedded;
-
+
// Below are different overloads of constructors to initialize an instance of the class with a WMI object.
public Processor() {
this.InitializeObject(null, null, null);
}
-
+
public Processor(string keyDeviceID) {
this.InitializeObject(null, new System.Management.ManagementPath(Processor.ConstructPath(keyDeviceID)), null);
}
-
+
public Processor(System.Management.ManagementScope mgmtScope, string keyDeviceID) {
this.InitializeObject(((System.Management.ManagementScope)(mgmtScope)), new System.Management.ManagementPath(Processor.ConstructPath(keyDeviceID)), null);
}
-
+
public Processor(System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(null, path, getOptions);
}
-
+
public Processor(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path) {
this.InitializeObject(mgmtScope, path, null);
}
-
+
public Processor(System.Management.ManagementPath path) {
this.InitializeObject(null, path, null);
}
-
+
public Processor(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(mgmtScope, path, getOptions);
}
-
+
public Processor(System.Management.ManagementObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -100,7 +100,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
public Processor(System.Management.ManagementBaseObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -113,7 +113,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
// Property returns the namespace of the WMI class.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -122,7 +122,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
return "ROOT\\CIMV2";
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ManagementClassName {
@@ -131,7 +131,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
if ((curObj != null)) {
if ((curObj.ClassPath != null)) {
strRet = ((string)(curObj["__CLASS"]));
- if (((strRet == null)
+ if (((strRet == null)
|| (strRet == string.Empty))) {
strRet = CreatedClassName;
}
@@ -140,7 +140,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
return strRet;
}
}
-
+
// Property pointing to an embedded object to get System properties of the WMI object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -149,7 +149,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
return PrivateSystemProperties;
}
}
-
+
// Property returning the underlying lateBound object.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -158,7 +158,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
return curObj;
}
}
-
+
// ManagementScope of the object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -177,7 +177,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
}
}
}
-
+
// Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -189,7 +189,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
AutoCommitProp = value;
}
}
-
+
// The ManagementPath of the underlying WMI object.
[Browsable(true)]
public System.Management.ManagementPath Path {
@@ -210,7 +210,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
}
}
}
-
+
// Public static scope property which is used by the various methods.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -222,7 +222,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
statMgmtScope = value;
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsAddressWidthNull {
@@ -235,7 +235,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Processor address width in bits.")]
@@ -248,7 +248,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
return ((ushort)(curObj["AddressWidth"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsArchitectureNull {
@@ -261,7 +261,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Architecture property specifies the processor architecture used by this platf" +
@@ -276,7 +276,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
return ((ArchitectureValues)(System.Convert.ToInt32(curObj["Architecture"])));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsAvailabilityNull {
@@ -289,7 +289,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The availability and status of the device. For example, the Availability property indicates that the device is running and has full power (value=3), or is in a warning (4), test (5), degraded (10) or power save state (values 13-15 and 17). Regarding the power saving states, these are defined as follows: Value 13 (""Power Save - Unknown"") indicates that the device is known to be in a power save mode, but its exact status in this mode is unknown; 14 (""Power Save - Low Power Mode"") indicates that the device is in a power save state but still functioning, and may exhibit degraded performance; 15 (""Power Save - Standby"") describes that the device is not functioning but could be brought to full power 'quickly'; and value 17 (""Power Save - Warning"") indicates that the device is in a warning state, though also in a power save mode.")]
@@ -302,7 +302,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
return ((AvailabilityValues)(System.Convert.ToInt32(curObj["Availability"])));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Caption property is a short textual description (one-line string) of the obje" +
@@ -312,7 +312,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
return ((string)(curObj["Caption"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsConfigManagerErrorCodeNull {
@@ -325,7 +325,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Indicates the Win32 Configuration Manager error code. The following values may b" +
@@ -367,7 +367,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
return ((ConfigManagerErrorCodeValues)(System.Convert.ToInt32(curObj["ConfigManagerErrorCode"])));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsConfigManagerUserConfigNull {
@@ -380,7 +380,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Indicates whether the device is using a user-defined configuration.")]
@@ -393,7 +393,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
return ((bool)(curObj["ConfigManagerUserConfig"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsCpuStatusNull {
@@ -406,7 +406,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The CpuStatus property specifies the current status of the processor. Changes in " +
@@ -420,7 +420,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
return ((CpuStatusValues)(System.Convert.ToInt32(curObj["CpuStatus"])));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("CreationClassName indicates the name of the class or the subclass used in the cre" +
@@ -432,7 +432,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
return ((string)(curObj["CreationClassName"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsCurrentClockSpeedNull {
@@ -445,7 +445,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The current speed (in MHz) of this processor.")]
@@ -458,7 +458,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
return ((uint)(curObj["CurrentClockSpeed"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsCurrentVoltageNull {
@@ -471,7 +471,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.CIMV2
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The CurrentVoltage specifies the voltage of the processor. bits 0-6 of the field contain the processor's current voltage times 10. This value is only set when SMBIOS designates a voltage value. For specific values, see VoltageCaps.
@@ -485,7 +485,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((ushort)(curObj["CurrentVoltage"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDataWidthNull {
@@ -498,7 +498,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Processor data width in bits.")]
@@ -511,7 +511,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((ushort)(curObj["DataWidth"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Description property provides a textual description of the object. ")]
@@ -520,7 +520,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["Description"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The DeviceID property contains a string uniquely identifying the processor with o" +
@@ -530,7 +530,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["DeviceID"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsErrorClearedNull {
@@ -543,7 +543,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("ErrorCleared is a boolean property indicating that the error reported in LastErro" +
@@ -557,7 +557,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((bool)(curObj["ErrorCleared"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("ErrorDescription is a free-form string supplying more information about the error" +
@@ -568,7 +568,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["ErrorDescription"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsExtClockNull {
@@ -581,7 +581,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The ExtClock property specifies the external clock frequency. If the frequency is" +
@@ -595,7 +595,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((uint)(curObj["ExtClock"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsFamilyNull {
@@ -608,7 +608,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The processor family type. For example, values include \"Pentium(R) processor with" +
@@ -622,7 +622,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((FamilyValues)(System.Convert.ToInt32(curObj["Family"])));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsInstallDateNull {
@@ -635,7 +635,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The InstallDate property is datetime value indicating when the object was install" +
@@ -651,7 +651,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsL2CacheSizeNull {
@@ -664,7 +664,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The L2CacheSize property specifies the size of the processor\'s Level 2 cache. A L" +
@@ -679,7 +679,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((uint)(curObj["L2CacheSize"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsL2CacheSpeedNull {
@@ -692,7 +692,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The L2CacheSpeed property specifies the clockspeed of the processor\'s Level 2 cac" +
@@ -707,7 +707,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((uint)(curObj["L2CacheSpeed"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsL3CacheSizeNull {
@@ -720,7 +720,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The L3CacheSize property specifies the size of the processor\'s Level 3 cache. A L" +
@@ -735,7 +735,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((uint)(curObj["L3CacheSize"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsL3CacheSpeedNull {
@@ -748,7 +748,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The L3CacheSpeed property specifies the clockspeed of the processor\'s Level 3 cac" +
@@ -763,7 +763,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((uint)(curObj["L3CacheSpeed"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLastErrorCodeNull {
@@ -776,7 +776,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("LastErrorCode captures the last error code reported by the logical device.")]
@@ -789,7 +789,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((uint)(curObj["LastErrorCode"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLevelNull {
@@ -802,7 +802,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Level property further defines the processor type. The value depends on the " +
@@ -816,7 +816,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((ushort)(curObj["Level"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLoadPercentageNull {
@@ -829,7 +829,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The LoadPercentage property specifies each processor\'s load capacity averaged ove" +
@@ -844,7 +844,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((ushort)(curObj["LoadPercentage"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Manufacturer property specifies the name of the processor\'s manufacturer.\nExa" +
@@ -854,7 +854,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["Manufacturer"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsMaxClockSpeedNull {
@@ -867,7 +867,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The maximum speed (in MHz) of this processor.")]
@@ -880,7 +880,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((uint)(curObj["MaxClockSpeed"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Name property defines the label by which the object is known. When subclassed" +
@@ -890,7 +890,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["Name"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsNumberOfCoresNull {
@@ -903,7 +903,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The NumberOfCores property contains a Processor\'s total number of cores. e.g dual" +
@@ -917,7 +917,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((uint)(curObj["NumberOfCores"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsNumberOfLogicalProcessorsNull {
@@ -930,7 +930,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The NumberOfLogicalProcessors property specifies the total number of logical proc" +
@@ -944,7 +944,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((uint)(curObj["NumberOfLogicalProcessors"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("A string describing the processor family type - used when the family property is " +
@@ -955,7 +955,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["OtherFamilyDescription"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Indicates the Win32 Plug and Play device ID of the logical device. Example: *PNP" +
@@ -965,7 +965,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["PNPDeviceID"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"Indicates the specific power-related capabilities of the logical device. The array values, 0=""Unknown"", 1=""Not Supported"" and 2=""Disabled"" are self-explanatory. The value, 3=""Enabled"" indicates that the power management features are currently enabled but the exact feature set is unknown or the information is unavailable. ""Power Saving Modes Entered Automatically"" (4) describes that a device can change its power state based on usage or other criteria. ""Power State Settable"" (5) indicates that the SetPowerState method is supported. ""Power Cycling Supported"" (6) indicates that the SetPowerState method can be invoked with the PowerState input variable set to 5 (""Power Cycle""). ""Timed Power On Supported"" (7) indicates that the SetPowerState method can be invoked with the PowerState input variable set to 5 (""Power Cycle"") and the Time parameter set to a specific date and time, or interval, for power-on.")]
@@ -980,7 +980,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return enumToRet;
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPowerManagementSupportedNull {
@@ -993,7 +993,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"Boolean indicating that the Device can be power managed - ie, put into a power save state. This boolean does not indicate that power management features are currently enabled, or if enabled, what features are supported. Refer to the PowerManagementCapabilities array for this information. If this boolean is false, the integer value 1, for the string, ""Not Supported"", should be the only entry in the PowerManagementCapabilities array.")]
@@ -1006,7 +1006,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((bool)(curObj["PowerManagementSupported"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The ProcessorId property contains processor-specific information that describes the processor's features. For x86 class CPUs, the field's format depends on the processor's support of the CPUID instruction. If the instruction is supported, the ProcessorId property contains two DWORD-formatted values. The first (offsets 08h-0Bh) is the EAX value returned by a CPUID instruction with input EAX set to 1. The second (offsets 0Ch-0Fh) is the EDX value returned by that instruction. Only the first two bytes of the ProcessorID property are significant (all others are set to 0) and contain (in WORD-format) the contents of the DX register at CPU reset.")]
@@ -1015,7 +1015,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["ProcessorId"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsProcessorTypeNull {
@@ -1028,7 +1028,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The ProcessorType property specifies the processor\'s primary function.")]
@@ -1041,7 +1041,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((ProcessorTypeValues)(System.Convert.ToInt32(curObj["ProcessorType"])));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsRevisionNull {
@@ -1054,7 +1054,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Revision property specifies the system\'s architecture-dependent revision leve" +
@@ -1069,7 +1069,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((ushort)(curObj["Revision"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("A free form string describing the role of the processor - for example, \"Central P" +
@@ -1079,7 +1079,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["Role"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsSecondLevelAddressTranslationExtensionsNull {
@@ -1092,7 +1092,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The SecondLevelAddressTranslationExtensions property determines whether the proce" +
@@ -1106,7 +1106,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((bool)(curObj["SecondLevelAddressTranslationExtensions"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The SocketDesignation property contains the type of chip socket used on the circu" +
@@ -1116,7 +1116,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["SocketDesignation"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The Status property is a string indicating the current status of the object. Various operational and non-operational statuses can be defined. Operational statuses are ""OK"", ""Degraded"" and ""Pred Fail"". ""Pred Fail"" indicates that an element may be functioning properly but predicting a failure in the near future. An example is a SMART-enabled hard drive. Non-operational statuses can also be specified. These are ""Error"", ""Starting"", ""Stopping"" and ""Service"". The latter, ""Service"", could apply during mirror-resilvering of a disk, reload of a user permissions list, or other administrative work. Not all such work is on-line, yet the managed element is neither ""OK"" nor in one of the other states.")]
@@ -1125,7 +1125,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["Status"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsStatusInfoNull {
@@ -1138,7 +1138,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("StatusInfo is a string indicating whether the logical device is in an enabled (va" +
@@ -1154,7 +1154,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((StatusInfoValues)(System.Convert.ToInt32(curObj["StatusInfo"])));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Stepping is a free-form string indicating the revision level of the processor wit" +
@@ -1164,7 +1164,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["Stepping"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The scoping System\'s CreationClassName.")]
@@ -1173,7 +1173,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["SystemCreationClassName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The scoping System\'s Name.")]
@@ -1182,7 +1182,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["SystemName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("A globally unique identifier for the processor. This identifier may only be uniq" +
@@ -1192,7 +1192,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["UniqueId"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsUpgradeMethodNull {
@@ -1205,7 +1205,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("CPU socket information including data on how this Processor can be upgraded (if u" +
@@ -1219,7 +1219,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((UpgradeMethodValues)(System.Convert.ToInt32(curObj["UpgradeMethod"])));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The Version property specifies an architecture-dependent processor revision numbe" +
@@ -1229,7 +1229,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((string)(curObj["Version"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsVirtualizationFirmwareEnabledNull {
@@ -1242,7 +1242,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The VirtualizationFirmwareEnabled property determines whether the Firmware has en" +
@@ -1256,7 +1256,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((bool)(curObj["VirtualizationFirmwareEnabled"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsVMMonitorModeExtensionsNull {
@@ -1269,7 +1269,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The VMMonitorModeExtensions property determines whether the processor supports In" +
@@ -1283,7 +1283,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((bool)(curObj["VMMonitorModeExtensions"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsVoltageCapsNull {
@@ -1296,7 +1296,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The VoltageCaps property specifies the voltage capabilities of the processor. Bits 0-3 of the field represent specific voltages that the processor socket can accept. All other bits should be set to zero. The socket is configurable if multiple bits are being set. For a range of voltages see CurrentVoltage. If the property is NULL, then the voltage capabilities are unknown.")]
@@ -1309,9 +1309,9 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return ((VoltageCapsValues)(System.Convert.ToInt32(curObj["VoltageCaps"])));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions OptionsParam) {
- if (((path != null)
+ if (((path != null)
&& (string.Compare(path.ClassName, this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -1319,9 +1319,9 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return CheckIfProperClass(new System.Management.ManagementObject(mgmtScope, path, OptionsParam));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementBaseObject theObj) {
- if (((theObj != null)
+ if (((theObj != null)
&& (string.Compare(((string)(theObj["__CLASS"])), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -1338,91 +1338,91 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
return false;
}
-
+
private bool ShouldSerializeAddressWidth() {
if ((this.IsAddressWidthNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeArchitecture() {
if ((this.IsArchitectureNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeAvailability() {
if ((this.IsAvailabilityNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeConfigManagerErrorCode() {
if ((this.IsConfigManagerErrorCodeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeConfigManagerUserConfig() {
if ((this.IsConfigManagerUserConfigNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeCpuStatus() {
if ((this.IsCpuStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeCurrentClockSpeed() {
if ((this.IsCurrentClockSpeedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeCurrentVoltage() {
if ((this.IsCurrentVoltageNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeDataWidth() {
if ((this.IsDataWidthNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeErrorCleared() {
if ((this.IsErrorClearedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeExtClock() {
if ((this.IsExtClockNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeFamily() {
if ((this.IsFamilyNull == false)) {
return true;
}
return false;
}
-
+
// Converts a given datetime in DMTF format to System.DateTime object.
static System.DateTime ToDateTime(string dmtfDate) {
System.DateTime initializer = System.DateTime.MinValue;
@@ -1474,13 +1474,13 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
if (("******" != tempString)) {
ticks = (long.Parse(tempString) * ((long)((System.TimeSpan.TicksPerMillisecond / 1000))));
}
- if (((((((((year < 0)
- || (month < 0))
- || (day < 0))
- || (hour < 0))
- || (minute < 0))
- || (minute < 0))
- || (second < 0))
+ if (((((((((year < 0)
+ || (month < 0))
+ || (day < 0))
+ || (hour < 0))
+ || (minute < 0))
+ || (minute < 0))
+ || (second < 0))
|| (ticks < 0))) {
throw new System.ArgumentOutOfRangeException();
}
@@ -1508,7 +1508,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
return datetime;
}
-
+
// Converts a given System.DateTime object to DMTF datetime format.
static string ToDmtfDateTime(System.DateTime date) {
string utcString = string.Empty;
@@ -1535,8 +1535,8 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
dmtfDateTime = string.Concat(dmtfDateTime, ((int)(date.Second)).ToString().PadLeft(2, '0'));
dmtfDateTime = string.Concat(dmtfDateTime, ".");
System.DateTime dtTemp = new System.DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, 0);
- long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
- * 1000)
+ long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
+ * 1000)
/ System.TimeSpan.TicksPerMillisecond)));
string strMicrosec = ((long)(microsec)).ToString();
if ((strMicrosec.Length > 6)) {
@@ -1546,172 +1546,172 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
dmtfDateTime = string.Concat(dmtfDateTime, utcString);
return dmtfDateTime;
}
-
+
private bool ShouldSerializeInstallDate() {
if ((this.IsInstallDateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeL2CacheSize() {
if ((this.IsL2CacheSizeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeL2CacheSpeed() {
if ((this.IsL2CacheSpeedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeL3CacheSize() {
if ((this.IsL3CacheSizeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeL3CacheSpeed() {
if ((this.IsL3CacheSpeedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLastErrorCode() {
if ((this.IsLastErrorCodeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLevel() {
if ((this.IsLevelNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLoadPercentage() {
if ((this.IsLoadPercentageNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeMaxClockSpeed() {
if ((this.IsMaxClockSpeedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeNumberOfCores() {
if ((this.IsNumberOfCoresNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeNumberOfLogicalProcessors() {
if ((this.IsNumberOfLogicalProcessorsNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePowerManagementSupported() {
if ((this.IsPowerManagementSupportedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeProcessorType() {
if ((this.IsProcessorTypeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeRevision() {
if ((this.IsRevisionNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeSecondLevelAddressTranslationExtensions() {
if ((this.IsSecondLevelAddressTranslationExtensionsNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeStatusInfo() {
if ((this.IsStatusInfoNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeUpgradeMethod() {
if ((this.IsUpgradeMethodNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeVirtualizationFirmwareEnabled() {
if ((this.IsVirtualizationFirmwareEnabledNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeVMMonitorModeExtensions() {
if ((this.IsVMMonitorModeExtensionsNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeVoltageCaps() {
if ((this.IsVoltageCapsNull == false)) {
return true;
}
return false;
}
-
+
[Browsable(true)]
public void CommitObject() {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put();
}
}
-
+
[Browsable(true)]
public void CommitObject(System.Management.PutOptions putOptions) {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put(putOptions);
}
}
-
+
private void Initialize() {
AutoCommitProp = true;
isEmbedded = false;
}
-
+
private static string ConstructPath(string keyDeviceID) {
string strPath = "ROOT\\CIMV2:Win32_Processor";
strPath = string.Concat(strPath, string.Concat(".DeviceID=", string.Concat("\"", string.Concat(keyDeviceID, "\""))));
return strPath;
}
-
+
private void InitializeObject(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
Initialize();
if ((path != null)) {
@@ -1723,24 +1723,24 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
curObj = PrivateLateBoundObject;
}
-
+
// Different overloads of GetInstances() help in enumerating instances of the WMI class.
public static ProcessorCollection GetInstances() {
return GetInstances(null, null, null);
}
-
+
public static ProcessorCollection GetInstances(string condition) {
return GetInstances(null, condition, null);
}
-
+
public static ProcessorCollection GetInstances(string[] selectedProperties) {
return GetInstances(null, null, selectedProperties);
}
-
+
public static ProcessorCollection GetInstances(string condition, string[] selectedProperties) {
return GetInstances(null, condition, selectedProperties);
}
-
+
public static ProcessorCollection GetInstances(System.Management.ManagementScope mgmtScope, System.Management.EnumerationOptions enumOptions) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -1761,15 +1761,15 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
}
return new ProcessorCollection(clsObject.GetInstances(enumOptions));
}
-
+
public static ProcessorCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition) {
return GetInstances(mgmtScope, condition, null);
}
-
+
public static ProcessorCollection GetInstances(System.Management.ManagementScope mgmtScope, string[] selectedProperties) {
return GetInstances(mgmtScope, null, selectedProperties);
}
-
+
public static ProcessorCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition, string[] selectedProperties) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -1786,7 +1786,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
ObjectSearcher.Options = enumOptions;
return new ProcessorCollection(ObjectSearcher.Get());
}
-
+
[Browsable(true)]
public static Processor CreateInstance() {
System.Management.ManagementScope mgmtScope = null;
@@ -1801,12 +1801,12 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
System.Management.ManagementClass tmpMgmtClass = new System.Management.ManagementClass(mgmtScope, mgmtPath, null);
return new Processor(tmpMgmtClass.CreateInstance());
}
-
+
[Browsable(true)]
public void Delete() {
PrivateLateBoundObject.Delete();
}
-
+
public uint Reset() {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1817,7 +1817,7 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return System.Convert.ToUInt32(0);
}
}
-
+
public uint SetPowerState(ushort PowerState, System.DateTime Time) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1831,514 +1831,514 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
return System.Convert.ToUInt32(0);
}
}
-
+
public enum ArchitectureValues {
-
+
X86 = 0,
-
+
MIPS = 1,
-
+
Alpha = 2,
-
+
PowerPC = 3,
-
+
Ia64 = 6,
-
+
X64 = 9,
-
+
NULL_ENUM_VALUE = 10,
}
-
+
public enum AvailabilityValues {
-
+
Other0 = 1,
-
+
Unknown0 = 2,
-
+
Running_Full_Power = 3,
-
+
Warning = 4,
-
+
In_Test = 5,
-
+
Not_Applicable = 6,
-
+
Power_Off = 7,
-
+
Off_Line = 8,
-
+
Off_Duty = 9,
-
+
Degraded = 10,
-
+
Not_Installed = 11,
-
+
Install_Error = 12,
-
+
Power_Save_Unknown = 13,
-
+
Power_Save_Low_Power_Mode = 14,
-
+
Power_Save_Standby = 15,
-
+
Power_Cycle = 16,
-
+
Power_Save_Warning = 17,
-
+
Paused = 18,
-
+
Not_Ready = 19,
-
+
Not_Configured = 20,
-
+
Quiesced = 21,
-
+
NULL_ENUM_VALUE = 0,
}
-
+
public enum ConfigManagerErrorCodeValues {
-
+
This_device_is_working_properly_ = 0,
-
+
This_device_is_not_configured_correctly_ = 1,
-
+
Windows_cannot_load_the_driver_for_this_device_ = 2,
-
+
The_driver_for_this_device_might_be_corrupted_or_your_system_may_be_running_low_on_memory_or_other_resources_ = 3,
-
+
This_device_is_not_working_properly_One_of_its_drivers_or_your_registry_might_be_corrupted_ = 4,
-
+
The_driver_for_this_device_needs_a_resource_that_Windows_cannot_manage_ = 5,
-
+
The_boot_configuration_for_this_device_conflicts_with_other_devices_ = 6,
-
+
Cannot_filter_ = 7,
-
+
The_driver_loader_for_the_device_is_missing_ = 8,
-
+
This_device_is_not_working_properly_because_the_controlling_firmware_is_reporting_the_resources_for_the_device_incorrectly_ = 9,
-
+
This_device_cannot_start_ = 10,
-
+
This_device_failed_ = 11,
-
+
This_device_cannot_find_enough_free_resources_that_it_can_use_ = 12,
-
+
Windows_cannot_verify_this_device_s_resources_ = 13,
-
+
This_device_cannot_work_properly_until_you_restart_your_computer_ = 14,
-
+
This_device_is_not_working_properly_because_there_is_probably_a_re_enumeration_problem_ = 15,
-
+
Windows_cannot_identify_all_the_resources_this_device_uses_ = 16,
-
+
This_device_is_asking_for_an_unknown_resource_type_ = 17,
-
+
Reinstall_the_drivers_for_this_device_ = 18,
-
+
Failure_using_the_VxD_loader_ = 19,
-
+
Your_registry_might_be_corrupted_ = 20,
-
+
System_failure_Try_changing_the_driver_for_this_device_If_that_does_not_work_see_your_hardware_documentation_Windows_is_removing_this_device_ = 21,
-
+
This_device_is_disabled_ = 22,
-
+
System_failure_Try_changing_the_driver_for_this_device_If_that_doesn_t_work_see_your_hardware_documentation_ = 23,
-
+
This_device_is_not_present_is_not_working_properly_or_does_not_have_all_its_drivers_installed_ = 24,
-
+
Windows_is_still_setting_up_this_device_ = 25,
-
+
Windows_is_still_setting_up_this_device_0 = 26,
-
+
This_device_does_not_have_valid_log_configuration_ = 27,
-
+
The_drivers_for_this_device_are_not_installed_ = 28,
-
+
This_device_is_disabled_because_the_firmware_of_the_device_did_not_give_it_the_required_resources_ = 29,
-
+
This_device_is_using_an_Interrupt_Request_IRQ_resource_that_another_device_is_using_ = 30,
-
+
This_device_is_not_working_properly_because_Windows_cannot_load_the_drivers_required_for_this_device_ = 31,
-
+
NULL_ENUM_VALUE = 32,
}
-
+
public enum CpuStatusValues {
-
+
Unknown0 = 0,
-
+
CPU_Enabled = 1,
-
+
CPU_Disabled_by_User_via_BIOS_Setup = 2,
-
+
CPU_Disabled_By_BIOS_POST_Error_ = 3,
-
+
CPU_is_Idle = 4,
-
+
Reserved = 5,
-
+
Reserved0 = 6,
-
+
Other0 = 7,
-
+
NULL_ENUM_VALUE = 8,
}
-
+
public enum FamilyValues {
-
+
Other0 = 1,
-
+
Unknown0 = 2,
-
+
Val_8086 = 3,
-
+
Val_80286 = 4,
-
+
Val_80386 = 5,
-
+
Val_80486 = 6,
-
+
Val_8087 = 7,
-
+
Val_80287 = 8,
-
+
Val_80387 = 9,
-
+
Val_80487 = 10,
-
+
Pentium_R_brand = 11,
-
+
Pentium_R_Pro = 12,
-
+
Pentium_R_II = 13,
-
+
Pentium_R_processor_with_MMX_TM_technology = 14,
-
+
Celeron_TM_ = 15,
-
+
Pentium_R_II_Xeon_TM_ = 16,
-
+
Pentium_R_III = 17,
-
+
M1_Family = 18,
-
+
M2_Family = 19,
-
+
K5_Family = 24,
-
+
K6_Family = 25,
-
+
K6_2 = 26,
-
+
K6_3 = 27,
-
+
AMD_Athlon_TM_Processor_Family = 28,
-
+
AMD_R_Duron_TM_Processor = 29,
-
+
AMD29000_Family = 30,
-
+
K6_2_ = 31,
-
+
Power_PC_Family = 32,
-
+
Power_PC_601 = 33,
-
+
Power_PC_603 = 34,
-
+
Power_PC_603_ = 35,
-
+
Power_PC_604 = 36,
-
+
Power_PC_620 = 37,
-
+
Power_PC_X704 = 38,
-
+
Power_PC_750 = 39,
-
+
Alpha_Family = 48,
-
+
Alpha_21064 = 49,
-
+
Alpha_21066 = 50,
-
+
Alpha_21164 = 51,
-
+
Alpha_21164PC = 52,
-
+
Alpha_21164a = 53,
-
+
Alpha_21264 = 54,
-
+
Alpha_21364 = 55,
-
+
MIPS_Family = 64,
-
+
MIPS_R4000 = 65,
-
+
MIPS_R4200 = 66,
-
+
MIPS_R4400 = 67,
-
+
MIPS_R4600 = 68,
-
+
MIPS_R10000 = 69,
-
+
SPARC_Family = 80,
-
+
SuperSPARC = 81,
-
+
MicroSPARC_II = 82,
-
+
MicroSPARC_IIep = 83,
-
+
UltraSPARC = 84,
-
+
UltraSPARC_II = 85,
-
+
UltraSPARC_IIi = 86,
-
+
UltraSPARC_III0 = 87,
-
+
UltraSPARC_IIIi = 88,
-
+
Val_68040 = 96,
-
+
Val_68xxx_Family = 97,
-
+
Val_68000 = 98,
-
+
Val_68010 = 99,
-
+
Val_68020 = 100,
-
+
Val_68030 = 101,
-
+
Hobbit_Family = 112,
-
+
Crusoe_TM_TM5000_Family = 120,
-
+
Crusoe_TM_TM3000_Family = 121,
-
+
Efficeon_TM_TM8000_Family = 122,
-
+
Weitek = 128,
-
+
Itanium_TM_Processor = 130,
-
+
AMD_Athlon_TM_64_Processor_Family = 131,
-
+
AMD_Opteron_TM_Family = 132,
-
+
PA_RISC_Family = 144,
-
+
PA_RISC_8500 = 145,
-
+
PA_RISC_8000 = 146,
-
+
PA_RISC_7300LC = 147,
-
+
PA_RISC_7200 = 148,
-
+
PA_RISC_7100LC = 149,
-
+
PA_RISC_7100 = 150,
-
+
V30_Family = 160,
-
+
Pentium_R_III_Xeon_TM_ = 176,
-
+
Pentium_R_III_Processor_with_Intel_R_SpeedStep_TM_Technology = 177,
-
+
Pentium_R_4 = 178,
-
+
Intel_R_Xeon_TM_ = 179,
-
+
AS400_Family = 180,
-
+
Intel_R_Xeon_TM_processor_MP = 181,
-
+
AMD_AthlonXP_TM_Family = 182,
-
+
AMD_AthlonMP_TM_Family = 183,
-
+
Intel_R_Itanium_R_2 = 184,
-
+
Intel_Pentium_M_Processor = 185,
-
+
K7 = 190,
-
+
IBM390_Family = 200,
-
+
G4 = 201,
-
+
G5 = 202,
-
+
G6 = 203,
-
+
Z_Architecture_base = 204,
-
+
I860 = 250,
-
+
I960 = 251,
-
+
SH_3 = 260,
-
+
SH_4 = 261,
-
+
ARM = 280,
-
+
StrongARM = 281,
-
+
Val_6x86 = 300,
-
+
MediaGX = 301,
-
+
MII = 302,
-
+
WinChip = 320,
-
+
DSP = 350,
-
+
Video_Processor = 500,
-
+
NULL_ENUM_VALUE = 0,
}
-
+
public enum PowerManagementCapabilitiesValues {
-
+
Unknown0 = 0,
-
+
Not_Supported = 1,
-
+
Disabled = 2,
-
+
Enabled = 3,
-
+
Power_Saving_Modes_Entered_Automatically = 4,
-
+
Power_State_Settable = 5,
-
+
Power_Cycling_Supported = 6,
-
+
Timed_Power_On_Supported = 7,
-
+
NULL_ENUM_VALUE = 8,
}
-
+
public enum ProcessorTypeValues {
-
+
Other0 = 1,
-
+
Unknown0 = 2,
-
+
Central_Processor = 3,
-
+
Math_Processor = 4,
-
+
DSP_Processor = 5,
-
+
Video_Processor = 6,
-
+
NULL_ENUM_VALUE = 0,
}
-
+
public enum StatusInfoValues {
-
+
Other0 = 1,
-
+
Unknown0 = 2,
-
+
Enabled = 3,
-
+
Disabled = 4,
-
+
Not_Applicable = 5,
-
+
NULL_ENUM_VALUE = 0,
}
-
+
public enum UpgradeMethodValues {
-
+
Other0 = 1,
-
+
Unknown0 = 2,
-
+
Daughter_Board = 3,
-
+
ZIF_Socket = 4,
-
+
Replacement_Piggy_Back = 5,
-
+
None = 6,
-
+
LIF_Socket = 7,
-
+
Slot_1 = 8,
-
+
Slot_2 = 9,
-
+
Val_370_Pin_Socket = 10,
-
+
Slot_A = 11,
-
+
Slot_M = 12,
-
+
Socket_423 = 13,
-
+
Socket_A_Socket_462_ = 14,
-
+
Socket_478 = 15,
-
+
Socket_754 = 16,
-
+
Socket_940 = 17,
-
+
Socket_939 = 18,
-
+
NULL_ENUM_VALUE = 0,
}
-
+
public enum VoltageCapsValues {
-
+
Val_5 = 1,
-
+
Val_3_3 = 2,
-
+
Val_2_9 = 4,
-
+
NULL_ENUM_VALUE = 8,
}
-
+
// Enumerator implementation for enumerating instances of the class.
public class ProcessorCollection : object, ICollection {
-
+
private ManagementObjectCollection privColObj;
-
+
public ProcessorCollection(ManagementObjectCollection objCollection) {
privColObj = objCollection;
}
-
+
public virtual int Count {
get {
return privColObj.Count;
}
}
-
+
public virtual bool IsSynchronized {
get {
return privColObj.IsSynchronized;
}
}
-
+
public virtual object SyncRoot {
get {
return this;
}
}
-
+
public virtual void CopyTo(System.Array array, int index) {
privColObj.CopyTo(array, index);
int nCtr;
@@ -2346,189 +2346,189 @@ Example: field value for a processor voltage of 1.8 volts would be 92h = 80h + (
array.SetValue(new Processor(((System.Management.ManagementObject)(array.GetValue(nCtr)))), nCtr);
}
}
-
+
public virtual System.Collections.IEnumerator GetEnumerator() {
return new ProcessorEnumerator(privColObj.GetEnumerator());
}
-
+
public class ProcessorEnumerator : object, System.Collections.IEnumerator {
-
+
private ManagementObjectCollection.ManagementObjectEnumerator privObjEnum;
-
+
public ProcessorEnumerator(ManagementObjectCollection.ManagementObjectEnumerator objEnum) {
privObjEnum = objEnum;
}
-
+
public virtual object Current {
get {
return new Processor(((System.Management.ManagementObject)(privObjEnum.Current)));
}
}
-
+
public virtual bool MoveNext() {
return privObjEnum.MoveNext();
}
-
+
public virtual void Reset() {
privObjEnum.Reset();
}
}
}
-
+
// TypeConverter to handle null values for ValueType properties
public class WMIValueTypeConverter : TypeConverter {
-
+
private TypeConverter baseConverter;
-
+
private System.Type baseType;
-
+
public WMIValueTypeConverter(System.Type inBaseType) {
baseConverter = TypeDescriptor.GetConverter(inBaseType);
baseType = inBaseType;
}
-
+
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type srcType) {
return baseConverter.CanConvertFrom(context, srcType);
}
-
+
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) {
return baseConverter.CanConvertTo(context, destinationType);
}
-
+
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
return baseConverter.ConvertFrom(context, culture, value);
}
-
+
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary dictionary) {
return baseConverter.CreateInstance(context, dictionary);
}
-
+
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetCreateInstanceSupported(context);
}
-
+
public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributeVar) {
return baseConverter.GetProperties(context, value, attributeVar);
}
-
+
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetPropertiesSupported(context);
}
-
+
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValues(context);
}
-
+
public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesExclusive(context);
}
-
+
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesSupported(context);
}
-
+
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) {
if ((baseType.BaseType == typeof(System.Enum))) {
if ((value.GetType() == destinationType)) {
return value;
}
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "NULL_ENUM_VALUE" ;
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((baseType == typeof(bool))
+ if (((baseType == typeof(bool))
&& (baseType.BaseType == typeof(System.ValueType)))) {
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((context != null)
+ if (((context != null)
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
}
-
+
// Embedded class to represent WMI system Properties.
[TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class ManagementSystemProperties {
-
+
private System.Management.ManagementBaseObject PrivateLateBoundObject;
-
+
public ManagementSystemProperties(System.Management.ManagementBaseObject ManagedObject) {
PrivateLateBoundObject = ManagedObject;
}
-
+
[Browsable(true)]
public int GENUS {
get {
return ((int)(PrivateLateBoundObject["__GENUS"]));
}
}
-
+
[Browsable(true)]
public string CLASS {
get {
return ((string)(PrivateLateBoundObject["__CLASS"]));
}
}
-
+
[Browsable(true)]
public string SUPERCLASS {
get {
return ((string)(PrivateLateBoundObject["__SUPERCLASS"]));
}
}
-
+
[Browsable(true)]
public string DYNASTY {
get {
return ((string)(PrivateLateBoundObject["__DYNASTY"]));
}
}
-
+
[Browsable(true)]
public string RELPATH {
get {
return ((string)(PrivateLateBoundObject["__RELPATH"]));
}
}
-
+
[Browsable(true)]
public int PROPERTY_COUNT {
get {
return ((int)(PrivateLateBoundObject["__PROPERTY_COUNT"]));
}
}
-
+
[Browsable(true)]
public string[] DERIVATION {
get {
return ((string[])(PrivateLateBoundObject["__DERIVATION"]));
}
}
-
+
[Browsable(true)]
public string SERVER {
get {
return ((string)(PrivateLateBoundObject["__SERVER"]));
}
}
-
+
[Browsable(true)]
public string NAMESPACE {
get {
return ((string)(PrivateLateBoundObject["__NAMESPACE"]));
}
}
-
+
[Browsable(true)]
public string PATH {
get {
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ComputerSystem.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ComputerSystem.cs
index 76057138f71..012b33bc67f 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ComputerSystem.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ComputerSystem.cs
@@ -23,8 +23,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
using System.Globalization;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
-
-
+
+
// Functions ShouldSerialize are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use IsNull function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
// Functions IsNull() are used to check if a property is NULL.
// Functions Reset are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
@@ -32,62 +32,62 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
// Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
// An Early Bound class generated for the WMI class.Msvm_ComputerSystem
public class ComputerSystem : System.ComponentModel.Component {
-
+
// Private property to hold the WMI namespace in which the class resides.
private static string CreatedWmiNamespace = "ROOT\\virtualization\\v2";
-
+
// Private property to hold the name of WMI class which created this class.
private static string CreatedClassName = "Msvm_ComputerSystem";
-
+
// Private member variable to hold the ManagementScope which is used by the various methods.
private static System.Management.ManagementScope statMgmtScope = null;
-
+
private ManagementSystemProperties PrivateSystemProperties;
-
+
// Underlying lateBound WMI object.
private System.Management.ManagementObject PrivateLateBoundObject;
-
+
// Member variable to store the 'automatic commit' behavior for the class.
private bool AutoCommitProp;
-
+
// Private variable to hold the embedded property representing the instance.
private System.Management.ManagementBaseObject embeddedObj;
-
+
// The current WMI object used
private System.Management.ManagementBaseObject curObj;
-
+
// Flag to indicate if the instance is an embedded object.
private bool isEmbedded;
-
+
// Below are different overloads of constructors to initialize an instance of the class with a WMI object.
public ComputerSystem() {
this.InitializeObject(null, null, null);
}
-
+
public ComputerSystem(string keyCreationClassName, string keyName) {
this.InitializeObject(null, new System.Management.ManagementPath(ComputerSystem.ConstructPath(keyCreationClassName, keyName)), null);
}
-
+
public ComputerSystem(System.Management.ManagementScope mgmtScope, string keyCreationClassName, string keyName) {
this.InitializeObject(((System.Management.ManagementScope)(mgmtScope)), new System.Management.ManagementPath(ComputerSystem.ConstructPath(keyCreationClassName, keyName)), null);
}
-
+
public ComputerSystem(System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(null, path, getOptions);
}
-
+
public ComputerSystem(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path) {
this.InitializeObject(mgmtScope, path, null);
}
-
+
public ComputerSystem(System.Management.ManagementPath path) {
this.InitializeObject(null, path, null);
}
-
+
public ComputerSystem(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(mgmtScope, path, getOptions);
}
-
+
public ComputerSystem(System.Management.ManagementObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -99,7 +99,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
public ComputerSystem(System.Management.ManagementBaseObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -112,7 +112,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
// Property returns the namespace of the WMI class.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -121,7 +121,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return "ROOT\\virtualization\\v2";
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ManagementClassName {
@@ -130,7 +130,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
if ((curObj != null)) {
if ((curObj.ClassPath != null)) {
strRet = ((string)(curObj["__CLASS"]));
- if (((strRet == null)
+ if (((strRet == null)
|| (strRet == string.Empty))) {
strRet = CreatedClassName;
}
@@ -139,7 +139,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return strRet;
}
}
-
+
// Property pointing to an embedded object to get System properties of the WMI object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -148,7 +148,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return PrivateSystemProperties;
}
}
-
+
// Property returning the underlying lateBound object.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -157,7 +157,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return curObj;
}
}
-
+
// ManagementScope of the object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -176,7 +176,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -188,7 +188,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
AutoCommitProp = value;
}
}
-
+
// The ManagementPath of the underlying WMI object.
[Browsable(true)]
public System.Management.ManagementPath Path {
@@ -209,7 +209,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Public static scope property which is used by the various methods.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -221,7 +221,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
statMgmtScope = value;
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] AvailableRequestedStates {
@@ -229,7 +229,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["AvailableRequestedStates"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Caption {
@@ -237,7 +237,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Caption"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsCommunicationStatusNull {
@@ -250,7 +250,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -262,7 +262,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["CommunicationStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string CreationClassName {
@@ -270,7 +270,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["CreationClassName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] Dedicated {
@@ -278,7 +278,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["Dedicated"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Description {
@@ -286,7 +286,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Description"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDetailedStatusNull {
@@ -299,7 +299,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -311,7 +311,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["DetailedStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ElementName {
@@ -319,7 +319,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["ElementName"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsEnabledDefaultNull {
@@ -332,7 +332,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -344,7 +344,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["EnabledDefault"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsEnabledStateNull {
@@ -357,7 +357,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -369,7 +369,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["EnabledState"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsFailedOverReplicationTypeNull {
@@ -382,7 +382,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Type of failover that was performed for the virtual machine.")]
@@ -395,7 +395,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((FailedOverReplicationTypeValues)(System.Convert.ToInt32(curObj["FailedOverReplicationType"])));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsHealthStateNull {
@@ -408,7 +408,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -420,7 +420,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["HealthState"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] IdentifyingDescriptions {
@@ -428,7 +428,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["IdentifyingDescriptions"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsInstallDateNull {
@@ -441,7 +441,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -455,7 +455,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string InstanceID {
@@ -463,7 +463,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["InstanceID"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLastApplicationConsistentReplicationTimeNull {
@@ -476,7 +476,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The time at which the last application consistent replication is received on reco" +
@@ -492,7 +492,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLastReplicationTimeNull {
@@ -505,7 +505,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The time at which the last replication is received on recovery for the virtual ma" +
@@ -521,7 +521,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLastReplicationTypeNull {
@@ -534,7 +534,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Type of the last replication that was received for the virtual machine.")]
@@ -547,7 +547,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((LastReplicationTypeValues)(System.Convert.ToInt32(curObj["LastReplicationType"])));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLastSuccessfulBackupTimeNull {
@@ -560,7 +560,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The time at which the last successful backup has completed for the virtual machin" +
@@ -576,7 +576,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Name {
@@ -584,7 +584,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Name"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string NameFormat {
@@ -592,7 +592,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["NameFormat"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsNumberOfNumaNodesNull {
@@ -605,7 +605,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"The number of non-uniform memory access (NUMA) nodes of the computer system. When Msvm_ComputerSystem represents the hosting computer system, this property contains the count of physical NUMA nodes. When Msvm_ComputerSystem represents a virtual computer system, this property contains the number of virtual NUMA nodes that are presented to the guest OS through the ACPI System Resource Affinity Table (SRAT).")]
@@ -618,7 +618,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["NumberOfNumaNodes"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsOnTimeInMillisecondsNull {
@@ -631,7 +631,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"For the virtual system, this property describes the total up time, in milliseconds, since the machine was last turned on, reset, or restored. This time excludes the time the virtual system was in the paused state. For the host system, this property is set to NULL.")]
@@ -644,7 +644,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["OnTimeInMilliseconds"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsOperatingStatusNull {
@@ -657,7 +657,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -669,7 +669,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["OperatingStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] OperationalStatus {
@@ -677,7 +677,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["OperationalStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] OtherDedicatedDescriptions {
@@ -685,7 +685,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["OtherDedicatedDescriptions"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OtherEnabledState {
@@ -693,7 +693,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["OtherEnabledState"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] OtherIdentifyingInfo {
@@ -701,7 +701,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["OtherIdentifyingInfo"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] PowerManagementCapabilities {
@@ -709,7 +709,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["PowerManagementCapabilities"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string PrimaryOwnerContact {
@@ -717,7 +717,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["PrimaryOwnerContact"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string PrimaryOwnerName {
@@ -725,7 +725,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["PrimaryOwnerName"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPrimaryStatusNull {
@@ -738,7 +738,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -750,7 +750,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["PrimaryStatus"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsProcessIDNull {
@@ -763,7 +763,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The identifier of the process under which this virtual machine is running. This v" +
@@ -778,7 +778,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((uint)(curObj["ProcessID"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsReplicationHealthNull {
@@ -791,7 +791,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Replication health for the virtual machine.")]
@@ -804,7 +804,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ReplicationHealthValues)(System.Convert.ToInt32(curObj["ReplicationHealth"])));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsReplicationModeNull {
@@ -817,7 +817,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Identifies replication type for the virtual machine.")]
@@ -830,7 +830,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ReplicationModeValues)(System.Convert.ToInt32(curObj["ReplicationMode"])));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsReplicationStateNull {
@@ -843,7 +843,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Replication state for the virtual machine.")]
@@ -856,7 +856,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ReplicationStateValues)(System.Convert.ToInt32(curObj["ReplicationState"])));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsRequestedStateNull {
@@ -869,7 +869,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -881,7 +881,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["RequestedState"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsResetCapabilityNull {
@@ -894,7 +894,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -906,7 +906,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["ResetCapability"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] Roles {
@@ -914,7 +914,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["Roles"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Status {
@@ -922,7 +922,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Status"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] StatusDescriptions {
@@ -930,7 +930,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["StatusDescriptions"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTimeOfLastConfigurationChangeNull {
@@ -943,7 +943,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The date and time when the virtual machine configuration file was last modified. " +
@@ -961,7 +961,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTimeOfLastStateChangeNull {
@@ -974,7 +974,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -988,7 +988,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTransitioningToStateNull {
@@ -1001,7 +1001,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1013,9 +1013,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["TransitioningToState"]));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions OptionsParam) {
- if (((path != null)
+ if (((path != null)
&& (string.Compare(path.ClassName, this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -1023,9 +1023,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return CheckIfProperClass(new System.Management.ManagementObject(mgmtScope, path, OptionsParam));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementBaseObject theObj) {
- if (((theObj != null)
+ if (((theObj != null)
&& (string.Compare(((string)(theObj["__CLASS"])), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -1042,49 +1042,49 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return false;
}
-
+
private bool ShouldSerializeCommunicationStatus() {
if ((this.IsCommunicationStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeDetailedStatus() {
if ((this.IsDetailedStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeEnabledDefault() {
if ((this.IsEnabledDefaultNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeEnabledState() {
if ((this.IsEnabledStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeFailedOverReplicationType() {
if ((this.IsFailedOverReplicationTypeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeHealthState() {
if ((this.IsHealthStateNull == false)) {
return true;
}
return false;
}
-
+
// Converts a given datetime in DMTF format to System.DateTime object.
static System.DateTime ToDateTime(string dmtfDate) {
System.DateTime initializer = System.DateTime.MinValue;
@@ -1136,13 +1136,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
if (("******" != tempString)) {
ticks = (long.Parse(tempString) * ((long)((System.TimeSpan.TicksPerMillisecond / 1000))));
}
- if (((((((((year < 0)
- || (month < 0))
- || (day < 0))
- || (hour < 0))
- || (minute < 0))
- || (minute < 0))
- || (second < 0))
+ if (((((((((year < 0)
+ || (month < 0))
+ || (day < 0))
+ || (hour < 0))
+ || (minute < 0))
+ || (minute < 0))
+ || (second < 0))
|| (ticks < 0))) {
throw new System.ArgumentOutOfRangeException();
}
@@ -1170,7 +1170,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return datetime;
}
-
+
// Converts a given System.DateTime object to DMTF datetime format.
static string ToDmtfDateTime(System.DateTime date) {
string utcString = string.Empty;
@@ -1197,8 +1197,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
dmtfDateTime = string.Concat(dmtfDateTime, ((int)(date.Second)).ToString().PadLeft(2, '0'));
dmtfDateTime = string.Concat(dmtfDateTime, ".");
System.DateTime dtTemp = new System.DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, 0);
- long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
- * 1000)
+ long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
+ * 1000)
/ System.TimeSpan.TicksPerMillisecond)));
string strMicrosec = ((long)(microsec)).ToString();
if ((strMicrosec.Length > 6)) {
@@ -1208,159 +1208,159 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
dmtfDateTime = string.Concat(dmtfDateTime, utcString);
return dmtfDateTime;
}
-
+
private bool ShouldSerializeInstallDate() {
if ((this.IsInstallDateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLastApplicationConsistentReplicationTime() {
if ((this.IsLastApplicationConsistentReplicationTimeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLastReplicationTime() {
if ((this.IsLastReplicationTimeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLastReplicationType() {
if ((this.IsLastReplicationTypeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLastSuccessfulBackupTime() {
if ((this.IsLastSuccessfulBackupTimeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeNumberOfNumaNodes() {
if ((this.IsNumberOfNumaNodesNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeOnTimeInMilliseconds() {
if ((this.IsOnTimeInMillisecondsNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeOperatingStatus() {
if ((this.IsOperatingStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePrimaryStatus() {
if ((this.IsPrimaryStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeProcessID() {
if ((this.IsProcessIDNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeReplicationHealth() {
if ((this.IsReplicationHealthNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeReplicationMode() {
if ((this.IsReplicationModeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeReplicationState() {
if ((this.IsReplicationStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeRequestedState() {
if ((this.IsRequestedStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeResetCapability() {
if ((this.IsResetCapabilityNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTimeOfLastConfigurationChange() {
if ((this.IsTimeOfLastConfigurationChangeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTimeOfLastStateChange() {
if ((this.IsTimeOfLastStateChangeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTransitioningToState() {
if ((this.IsTransitioningToStateNull == false)) {
return true;
}
return false;
}
-
+
[Browsable(true)]
public void CommitObject() {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put();
}
}
-
+
[Browsable(true)]
public void CommitObject(System.Management.PutOptions putOptions) {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put(putOptions);
}
}
-
+
private void Initialize() {
AutoCommitProp = true;
isEmbedded = false;
}
-
+
private static string ConstructPath(string keyCreationClassName, string keyName) {
string strPath = "ROOT\\virtualization\\v2:Msvm_ComputerSystem";
strPath = string.Concat(strPath, string.Concat(".CreationClassName=", string.Concat("\"", string.Concat(keyCreationClassName, "\""))));
strPath = string.Concat(strPath, string.Concat(",Name=", string.Concat("\"", string.Concat(keyName, "\""))));
return strPath;
}
-
+
private void InitializeObject(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
Initialize();
if ((path != null)) {
@@ -1372,24 +1372,24 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
curObj = PrivateLateBoundObject;
}
-
+
// Different overloads of GetInstances() help in enumerating instances of the WMI class.
public static ComputerSystemCollection GetInstances() {
return GetInstances(null, null, null);
}
-
+
public static ComputerSystemCollection GetInstances(string condition) {
return GetInstances(null, condition, null);
}
-
+
public static ComputerSystemCollection GetInstances(string[] selectedProperties) {
return GetInstances(null, null, selectedProperties);
}
-
+
public static ComputerSystemCollection GetInstances(string condition, string[] selectedProperties) {
return GetInstances(null, condition, selectedProperties);
}
-
+
public static ComputerSystemCollection GetInstances(System.Management.ManagementScope mgmtScope, System.Management.EnumerationOptions enumOptions) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -1410,15 +1410,15 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return new ComputerSystemCollection(clsObject.GetInstances(enumOptions));
}
-
+
public static ComputerSystemCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition) {
return GetInstances(mgmtScope, condition, null);
}
-
+
public static ComputerSystemCollection GetInstances(System.Management.ManagementScope mgmtScope, string[] selectedProperties) {
return GetInstances(mgmtScope, null, selectedProperties);
}
-
+
public static ComputerSystemCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition, string[] selectedProperties) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -1435,7 +1435,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
ObjectSearcher.Options = enumOptions;
return new ComputerSystemCollection(ObjectSearcher.Get());
}
-
+
[Browsable(true)]
public static ComputerSystem CreateInstance() {
System.Management.ManagementScope mgmtScope = null;
@@ -1450,12 +1450,12 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
System.Management.ManagementClass tmpMgmtClass = new System.Management.ManagementClass(mgmtScope, mgmtPath, null);
return new ComputerSystem(tmpMgmtClass.CreateInstance());
}
-
+
[Browsable(true)]
public void Delete() {
PrivateLateBoundObject.Delete();
}
-
+
public uint RequestReplicationStateChange(ushort RequestedState, System.DateTime TimeoutPeriod, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1474,7 +1474,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint RequestStateChange(ushort RequestedState, System.DateTime TimeoutPeriod, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1494,7 +1494,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint SetPowerState(uint PowerState, System.DateTime Time) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1508,115 +1508,115 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public enum FailedOverReplicationTypeValues {
-
+
None = 0,
-
+
Regular = 1,
-
+
Application_consistent = 2,
-
+
Planned = 3,
-
+
NULL_ENUM_VALUE = 4,
}
-
+
public enum LastReplicationTypeValues {
-
+
None = 0,
-
+
Regular = 1,
-
+
Application_consistent = 2,
-
+
Planned = 3,
-
+
NULL_ENUM_VALUE = 4,
}
-
+
public enum ReplicationHealthValues {
-
+
Not_applicable = 0,
-
+
Ok = 1,
-
+
Warning = 2,
-
+
Critical = 3,
-
+
NULL_ENUM_VALUE = 4,
}
-
+
public enum ReplicationModeValues {
-
+
None = 0,
-
+
Primary = 1,
-
+
Recovery = 2,
-
+
Test_Replica = 3,
-
+
NULL_ENUM_VALUE = 4,
}
-
+
public enum ReplicationStateValues {
-
+
Disabled = 0,
-
+
Ready_for_replication = 1,
-
+
Waiting_to_complete_initial_replication = 2,
-
+
Replicating = 3,
-
+
Synced_replication_complete = 4,
-
+
Recovered = 5,
-
+
Committed = 6,
-
+
Suspended = 7,
-
+
Critical = 8,
-
+
Waiting_to_start_resynchronization = 9,
-
+
Resynchronizing = 10,
-
+
Resynchronization_suspended = 11,
-
+
NULL_ENUM_VALUE = 12,
}
-
+
// Enumerator implementation for enumerating instances of the class.
public class ComputerSystemCollection : object, ICollection {
-
+
private ManagementObjectCollection privColObj;
-
+
public ComputerSystemCollection(ManagementObjectCollection objCollection) {
privColObj = objCollection;
}
-
+
public virtual int Count {
get {
return privColObj.Count;
}
}
-
+
public virtual bool IsSynchronized {
get {
return privColObj.IsSynchronized;
}
}
-
+
public virtual object SyncRoot {
get {
return this;
}
}
-
+
public virtual void CopyTo(System.Array array, int index) {
privColObj.CopyTo(array, index);
int nCtr;
@@ -1624,189 +1624,189 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
array.SetValue(new ComputerSystem(((System.Management.ManagementObject)(array.GetValue(nCtr)))), nCtr);
}
}
-
+
public virtual System.Collections.IEnumerator GetEnumerator() {
return new ComputerSystemEnumerator(privColObj.GetEnumerator());
}
-
+
public class ComputerSystemEnumerator : object, System.Collections.IEnumerator {
-
+
private ManagementObjectCollection.ManagementObjectEnumerator privObjEnum;
-
+
public ComputerSystemEnumerator(ManagementObjectCollection.ManagementObjectEnumerator objEnum) {
privObjEnum = objEnum;
}
-
+
public virtual object Current {
get {
return new ComputerSystem(((System.Management.ManagementObject)(privObjEnum.Current)));
}
}
-
+
public virtual bool MoveNext() {
return privObjEnum.MoveNext();
}
-
+
public virtual void Reset() {
privObjEnum.Reset();
}
}
}
-
+
// TypeConverter to handle null values for ValueType properties
public class WMIValueTypeConverter : TypeConverter {
-
+
private TypeConverter baseConverter;
-
+
private System.Type baseType;
-
+
public WMIValueTypeConverter(System.Type inBaseType) {
baseConverter = TypeDescriptor.GetConverter(inBaseType);
baseType = inBaseType;
}
-
+
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type srcType) {
return baseConverter.CanConvertFrom(context, srcType);
}
-
+
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) {
return baseConverter.CanConvertTo(context, destinationType);
}
-
+
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
return baseConverter.ConvertFrom(context, culture, value);
}
-
+
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary dictionary) {
return baseConverter.CreateInstance(context, dictionary);
}
-
+
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetCreateInstanceSupported(context);
}
-
+
public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributeVar) {
return baseConverter.GetProperties(context, value, attributeVar);
}
-
+
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetPropertiesSupported(context);
}
-
+
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValues(context);
}
-
+
public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesExclusive(context);
}
-
+
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesSupported(context);
}
-
+
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) {
if ((baseType.BaseType == typeof(System.Enum))) {
if ((value.GetType() == destinationType)) {
return value;
}
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "NULL_ENUM_VALUE" ;
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((baseType == typeof(bool))
+ if (((baseType == typeof(bool))
&& (baseType.BaseType == typeof(System.ValueType)))) {
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((context != null)
+ if (((context != null)
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
}
-
+
// Embedded class to represent WMI system Properties.
[TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class ManagementSystemProperties {
-
+
private System.Management.ManagementBaseObject PrivateLateBoundObject;
-
+
public ManagementSystemProperties(System.Management.ManagementBaseObject ManagedObject) {
PrivateLateBoundObject = ManagedObject;
}
-
+
[Browsable(true)]
public int GENUS {
get {
return ((int)(PrivateLateBoundObject["__GENUS"]));
}
}
-
+
[Browsable(true)]
public string CLASS {
get {
return ((string)(PrivateLateBoundObject["__CLASS"]));
}
}
-
+
[Browsable(true)]
public string SUPERCLASS {
get {
return ((string)(PrivateLateBoundObject["__SUPERCLASS"]));
}
}
-
+
[Browsable(true)]
public string DYNASTY {
get {
return ((string)(PrivateLateBoundObject["__DYNASTY"]));
}
}
-
+
[Browsable(true)]
public string RELPATH {
get {
return ((string)(PrivateLateBoundObject["__RELPATH"]));
}
}
-
+
[Browsable(true)]
public int PROPERTY_COUNT {
get {
return ((int)(PrivateLateBoundObject["__PROPERTY_COUNT"]));
}
}
-
+
[Browsable(true)]
public string[] DERIVATION {
get {
return ((string[])(PrivateLateBoundObject["__DERIVATION"]));
}
}
-
+
[Browsable(true)]
public string SERVER {
get {
return ((string)(PrivateLateBoundObject["__SERVER"]));
}
}
-
+
[Browsable(true)]
public string NAMESPACE {
get {
return ((string)(PrivateLateBoundObject["__NAMESPACE"]));
}
}
-
+
[Browsable(true)]
public string PATH {
get {
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ConcreteJob.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ConcreteJob.cs
index 823e41482bc..931d7a648eb 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ConcreteJob.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ConcreteJob.cs
@@ -23,8 +23,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
using System.Globalization;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
-
-
+
+
// Functions ShouldSerialize are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use IsNull function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
// Functions IsNull() are used to check if a property is NULL.
// Functions Reset are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
@@ -33,62 +33,62 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
// Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
// An Early Bound class generated for the WMI class.Msvm_ConcreteJob
public class ConcreteJob : System.ComponentModel.Component {
-
+
// Private property to hold the WMI namespace in which the class resides.
private static string CreatedWmiNamespace = "ROOT\\virtualization\\v2";
-
+
// Private property to hold the name of WMI class which created this class.
private static string CreatedClassName = "Msvm_ConcreteJob";
-
+
// Private member variable to hold the ManagementScope which is used by the various methods.
private static System.Management.ManagementScope statMgmtScope = null;
-
+
private ManagementSystemProperties PrivateSystemProperties;
-
+
// Underlying lateBound WMI object.
private System.Management.ManagementObject PrivateLateBoundObject;
-
+
// Member variable to store the 'automatic commit' behavior for the class.
private bool AutoCommitProp;
-
+
// Private variable to hold the embedded property representing the instance.
private System.Management.ManagementBaseObject embeddedObj;
-
+
// The current WMI object used
private System.Management.ManagementBaseObject curObj;
-
+
// Flag to indicate if the instance is an embedded object.
private bool isEmbedded;
-
+
// Below are different overloads of constructors to initialize an instance of the class with a WMI object.
public ConcreteJob() {
this.InitializeObject(null, null, null);
}
-
+
public ConcreteJob(string keyInstanceID) {
this.InitializeObject(null, new System.Management.ManagementPath(ConcreteJob.ConstructPath(keyInstanceID)), null);
}
-
+
public ConcreteJob(System.Management.ManagementScope mgmtScope, string keyInstanceID) {
this.InitializeObject(((System.Management.ManagementScope)(mgmtScope)), new System.Management.ManagementPath(ConcreteJob.ConstructPath(keyInstanceID)), null);
}
-
+
public ConcreteJob(System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(null, path, getOptions);
}
-
+
public ConcreteJob(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path) {
this.InitializeObject(mgmtScope, path, null);
}
-
+
public ConcreteJob(System.Management.ManagementPath path) {
this.InitializeObject(null, path, null);
}
-
+
public ConcreteJob(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(mgmtScope, path, getOptions);
}
-
+
public ConcreteJob(System.Management.ManagementObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -100,7 +100,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
public ConcreteJob(System.Management.ManagementBaseObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -113,7 +113,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
// Property returns the namespace of the WMI class.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -122,7 +122,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return "ROOT\\virtualization\\v2";
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ManagementClassName {
@@ -131,7 +131,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
if ((curObj != null)) {
if ((curObj.ClassPath != null)) {
strRet = ((string)(curObj["__CLASS"]));
- if (((strRet == null)
+ if (((strRet == null)
|| (strRet == string.Empty))) {
strRet = CreatedClassName;
}
@@ -140,7 +140,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return strRet;
}
}
-
+
// Property pointing to an embedded object to get System properties of the WMI object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -149,7 +149,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return PrivateSystemProperties;
}
}
-
+
// Property returning the underlying lateBound object.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -158,7 +158,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return curObj;
}
}
-
+
// ManagementScope of the object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -177,7 +177,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -189,7 +189,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
AutoCommitProp = value;
}
}
-
+
// The ManagementPath of the underlying WMI object.
[Browsable(true)]
public System.Management.ManagementPath Path {
@@ -210,7 +210,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Public static scope property which is used by the various methods.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -222,7 +222,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
statMgmtScope = value;
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsCancellableNull {
@@ -235,7 +235,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Indicates whether the job can be cancelled. The value of this property does not g" +
@@ -249,7 +249,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["Cancellable"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Caption {
@@ -257,7 +257,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Caption"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsCommunicationStatusNull {
@@ -270,7 +270,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -282,7 +282,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["CommunicationStatus"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDeleteOnCompletionNull {
@@ -295,7 +295,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -307,7 +307,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["DeleteOnCompletion"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Description {
@@ -315,7 +315,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Description"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDetailedStatusNull {
@@ -328,7 +328,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -340,7 +340,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["DetailedStatus"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsElapsedTimeNull {
@@ -353,7 +353,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -367,7 +367,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ElementName {
@@ -375,7 +375,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["ElementName"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsErrorCodeNull {
@@ -388,7 +388,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -400,7 +400,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["ErrorCode"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ErrorDescription {
@@ -408,7 +408,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["ErrorDescription"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ErrorSummaryDescription {
@@ -416,7 +416,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["ErrorSummaryDescription"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsHealthStateNull {
@@ -429,7 +429,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -441,7 +441,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["HealthState"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsInstallDateNull {
@@ -454,7 +454,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -468,7 +468,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string InstanceID {
@@ -476,7 +476,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["InstanceID"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsJobRunTimesNull {
@@ -489,7 +489,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -501,7 +501,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((uint)(curObj["JobRunTimes"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsJobStateNull {
@@ -514,7 +514,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -526,7 +526,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["JobState"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string JobStatus {
@@ -534,7 +534,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["JobStatus"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsJobTypeNull {
@@ -547,7 +547,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("Indicates the type of Job being tracked by this object.")]
@@ -560,7 +560,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["JobType"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLocalOrUtcTimeNull {
@@ -573,7 +573,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -585,7 +585,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["LocalOrUtcTime"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Name {
@@ -593,7 +593,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Name"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Notify {
@@ -601,7 +601,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Notify"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsOperatingStatusNull {
@@ -614,7 +614,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -626,7 +626,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["OperatingStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] OperationalStatus {
@@ -634,7 +634,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["OperationalStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OtherRecoveryAction {
@@ -642,7 +642,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["OtherRecoveryAction"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Owner {
@@ -650,7 +650,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Owner"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPercentCompleteNull {
@@ -663,7 +663,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -675,7 +675,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["PercentComplete"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPrimaryStatusNull {
@@ -688,7 +688,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -700,7 +700,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["PrimaryStatus"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPriorityNull {
@@ -713,7 +713,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -725,7 +725,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((uint)(curObj["Priority"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsRecoveryActionNull {
@@ -738,7 +738,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -750,7 +750,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["RecoveryAction"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsRunDayNull {
@@ -763,7 +763,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -775,7 +775,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((sbyte)(curObj["RunDay"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsRunDayOfWeekNull {
@@ -788,7 +788,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -800,7 +800,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((sbyte)(curObj["RunDayOfWeek"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsRunMonthNull {
@@ -813,7 +813,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -825,7 +825,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((byte)(curObj["RunMonth"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsRunStartIntervalNull {
@@ -838,7 +838,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -852,7 +852,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsScheduledStartTimeNull {
@@ -865,7 +865,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -879,7 +879,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsStartTimeNull {
@@ -892,7 +892,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -906,7 +906,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Status {
@@ -914,7 +914,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Status"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] StatusDescriptions {
@@ -922,7 +922,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["StatusDescriptions"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTimeBeforeRemovalNull {
@@ -935,7 +935,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -949,7 +949,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTimeOfLastStateChangeNull {
@@ -962,7 +962,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -976,7 +976,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTimeSubmittedNull {
@@ -989,7 +989,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1003,7 +1003,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsUntilTimeNull {
@@ -1016,7 +1016,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1030,9 +1030,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions OptionsParam) {
- if (((path != null)
+ if (((path != null)
&& (string.Compare(path.ClassName, this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -1040,9 +1040,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return CheckIfProperClass(new System.Management.ManagementObject(mgmtScope, path, OptionsParam));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementBaseObject theObj) {
- if (((theObj != null)
+ if (((theObj != null)
&& (string.Compare(((string)(theObj["__CLASS"])), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -1059,21 +1059,21 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return false;
}
-
+
private bool ShouldSerializeCancellable() {
if ((this.IsCancellableNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeCommunicationStatus() {
if ((this.IsCommunicationStatusNull == false)) {
return true;
}
return false;
}
-
+
// Converts a given time interval in DMTF format to System.TimeSpan object.
static System.TimeSpan ToTimeSpan(string dmtfTimespan) {
int days = 0;
@@ -1114,7 +1114,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
timespan = timespan.Add(tsTemp);
return timespan;
}
-
+
// Converts a given System.TimeSpan object to DMTF Time interval format.
static string ToDmtfTimeInterval(System.TimeSpan timespan) {
string dmtftimespan = ((int)(timespan.Days)).ToString().PadLeft(8, '0');
@@ -1131,8 +1131,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
dmtftimespan = string.Concat(dmtftimespan, ((int)(timespan.Seconds)).ToString().PadLeft(2, '0'));
dmtftimespan = string.Concat(dmtftimespan, ".");
System.TimeSpan tsTemp = new System.TimeSpan(timespan.Days, timespan.Hours, timespan.Minutes, timespan.Seconds, 0);
- long microsec = ((long)((((timespan.Ticks - tsTemp.Ticks)
- * 1000)
+ long microsec = ((long)((((timespan.Ticks - tsTemp.Ticks)
+ * 1000)
/ System.TimeSpan.TicksPerMillisecond)));
string strMicroSec = ((long)(microsec)).ToString();
if ((strMicroSec.Length > 6)) {
@@ -1142,21 +1142,21 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
dmtftimespan = string.Concat(dmtftimespan, ":000");
return dmtftimespan;
}
-
+
private bool ShouldSerializeDeleteOnCompletion() {
if ((this.IsDeleteOnCompletionNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeDetailedStatus() {
if ((this.IsDetailedStatusNull == false)) {
return true;
}
return false;
}
-
+
// Converts a given datetime in DMTF format to System.DateTime object.
static System.DateTime ToDateTime(string dmtfDate) {
System.DateTime initializer = System.DateTime.MinValue;
@@ -1208,13 +1208,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
if (("******" != tempString)) {
ticks = (long.Parse(tempString) * ((long)((System.TimeSpan.TicksPerMillisecond / 1000))));
}
- if (((((((((year < 0)
- || (month < 0))
- || (day < 0))
- || (hour < 0))
- || (minute < 0))
- || (minute < 0))
- || (second < 0))
+ if (((((((((year < 0)
+ || (month < 0))
+ || (day < 0))
+ || (hour < 0))
+ || (minute < 0))
+ || (minute < 0))
+ || (second < 0))
|| (ticks < 0))) {
throw new System.ArgumentOutOfRangeException();
}
@@ -1242,7 +1242,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return datetime;
}
-
+
// Converts a given System.DateTime object to DMTF datetime format.
static string ToDmtfDateTime(System.DateTime date) {
string utcString = string.Empty;
@@ -1269,8 +1269,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
dmtfDateTime = string.Concat(dmtfDateTime, ((int)(date.Second)).ToString().PadLeft(2, '0'));
dmtfDateTime = string.Concat(dmtfDateTime, ".");
System.DateTime dtTemp = new System.DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, 0);
- long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
- * 1000)
+ long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
+ * 1000)
/ System.TimeSpan.TicksPerMillisecond)));
string strMicrosec = ((long)(microsec)).ToString();
if ((strMicrosec.Length > 6)) {
@@ -1280,193 +1280,193 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
dmtfDateTime = string.Concat(dmtfDateTime, utcString);
return dmtfDateTime;
}
-
+
private bool ShouldSerializeElapsedTime() {
if ((this.IsElapsedTimeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeErrorCode() {
if ((this.IsErrorCodeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeHealthState() {
if ((this.IsHealthStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeInstallDate() {
if ((this.IsInstallDateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeJobRunTimes() {
if ((this.IsJobRunTimesNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeJobState() {
if ((this.IsJobStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeJobType() {
if ((this.IsJobTypeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLocalOrUtcTime() {
if ((this.IsLocalOrUtcTimeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeOperatingStatus() {
if ((this.IsOperatingStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePercentComplete() {
if ((this.IsPercentCompleteNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePrimaryStatus() {
if ((this.IsPrimaryStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePriority() {
if ((this.IsPriorityNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeRecoveryAction() {
if ((this.IsRecoveryActionNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeRunDay() {
if ((this.IsRunDayNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeRunDayOfWeek() {
if ((this.IsRunDayOfWeekNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeRunMonth() {
if ((this.IsRunMonthNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeRunStartInterval() {
if ((this.IsRunStartIntervalNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeScheduledStartTime() {
if ((this.IsScheduledStartTimeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeStartTime() {
if ((this.IsStartTimeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTimeBeforeRemoval() {
if ((this.IsTimeBeforeRemovalNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTimeOfLastStateChange() {
if ((this.IsTimeOfLastStateChangeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTimeSubmitted() {
if ((this.IsTimeSubmittedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeUntilTime() {
if ((this.IsUntilTimeNull == false)) {
return true;
}
return false;
}
-
+
[Browsable(true)]
public void CommitObject() {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put();
}
}
-
+
[Browsable(true)]
public void CommitObject(System.Management.PutOptions putOptions) {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put(putOptions);
}
}
-
+
private void Initialize() {
AutoCommitProp = true;
isEmbedded = false;
}
-
+
private static string ConstructPath(string keyInstanceID) {
string strPath = "ROOT\\virtualization\\v2:Msvm_ConcreteJob";
strPath = string.Concat(strPath, string.Concat(".InstanceID=", string.Concat("\"", string.Concat(keyInstanceID, "\""))));
return strPath;
}
-
+
private void InitializeObject(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
Initialize();
if ((path != null)) {
@@ -1478,24 +1478,24 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
curObj = PrivateLateBoundObject;
}
-
+
// Different overloads of GetInstances() help in enumerating instances of the WMI class.
public static ConcreteJobCollection GetInstances() {
return GetInstances(null, null, null);
}
-
+
public static ConcreteJobCollection GetInstances(string condition) {
return GetInstances(null, condition, null);
}
-
+
public static ConcreteJobCollection GetInstances(string[] selectedProperties) {
return GetInstances(null, null, selectedProperties);
}
-
+
public static ConcreteJobCollection GetInstances(string condition, string[] selectedProperties) {
return GetInstances(null, condition, selectedProperties);
}
-
+
public static ConcreteJobCollection GetInstances(System.Management.ManagementScope mgmtScope, System.Management.EnumerationOptions enumOptions) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -1516,15 +1516,15 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return new ConcreteJobCollection(clsObject.GetInstances(enumOptions));
}
-
+
public static ConcreteJobCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition) {
return GetInstances(mgmtScope, condition, null);
}
-
+
public static ConcreteJobCollection GetInstances(System.Management.ManagementScope mgmtScope, string[] selectedProperties) {
return GetInstances(mgmtScope, null, selectedProperties);
}
-
+
public static ConcreteJobCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition, string[] selectedProperties) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -1541,7 +1541,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
ObjectSearcher.Options = enumOptions;
return new ConcreteJobCollection(ObjectSearcher.Get());
}
-
+
[Browsable(true)]
public static ConcreteJob CreateInstance() {
System.Management.ManagementScope mgmtScope = null;
@@ -1556,12 +1556,12 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
System.Management.ManagementClass tmpMgmtClass = new System.Management.ManagementClass(mgmtScope, mgmtPath, null);
return new ConcreteJob(tmpMgmtClass.CreateInstance());
}
-
+
[Browsable(true)]
public void Delete() {
PrivateLateBoundObject.Delete();
}
-
+
public uint GetError(out string Error) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1574,7 +1574,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint GetErrorEx(out string[] Errors) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1587,7 +1587,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint KillJob(bool DeleteOnKill) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1600,7 +1600,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint RequestStateChange(ushort RequestedState, System.TimeSpan TimeoutPeriod) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1614,34 +1614,34 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
// Enumerator implementation for enumerating instances of the class.
public class ConcreteJobCollection : object, ICollection {
-
+
private ManagementObjectCollection privColObj;
-
+
public ConcreteJobCollection(ManagementObjectCollection objCollection) {
privColObj = objCollection;
}
-
+
public virtual int Count {
get {
return privColObj.Count;
}
}
-
+
public virtual bool IsSynchronized {
get {
return privColObj.IsSynchronized;
}
}
-
+
public virtual object SyncRoot {
get {
return this;
}
}
-
+
public virtual void CopyTo(System.Array array, int index) {
privColObj.CopyTo(array, index);
int nCtr;
@@ -1649,189 +1649,189 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
array.SetValue(new ConcreteJob(((System.Management.ManagementObject)(array.GetValue(nCtr)))), nCtr);
}
}
-
+
public virtual System.Collections.IEnumerator GetEnumerator() {
return new ConcreteJobEnumerator(privColObj.GetEnumerator());
}
-
+
public class ConcreteJobEnumerator : object, System.Collections.IEnumerator {
-
+
private ManagementObjectCollection.ManagementObjectEnumerator privObjEnum;
-
+
public ConcreteJobEnumerator(ManagementObjectCollection.ManagementObjectEnumerator objEnum) {
privObjEnum = objEnum;
}
-
+
public virtual object Current {
get {
return new ConcreteJob(((System.Management.ManagementObject)(privObjEnum.Current)));
}
}
-
+
public virtual bool MoveNext() {
return privObjEnum.MoveNext();
}
-
+
public virtual void Reset() {
privObjEnum.Reset();
}
}
}
-
+
// TypeConverter to handle null values for ValueType properties
public class WMIValueTypeConverter : TypeConverter {
-
+
private TypeConverter baseConverter;
-
+
private System.Type baseType;
-
+
public WMIValueTypeConverter(System.Type inBaseType) {
baseConverter = TypeDescriptor.GetConverter(inBaseType);
baseType = inBaseType;
}
-
+
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type srcType) {
return baseConverter.CanConvertFrom(context, srcType);
}
-
+
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) {
return baseConverter.CanConvertTo(context, destinationType);
}
-
+
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
return baseConverter.ConvertFrom(context, culture, value);
}
-
+
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary dictionary) {
return baseConverter.CreateInstance(context, dictionary);
}
-
+
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetCreateInstanceSupported(context);
}
-
+
public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributeVar) {
return baseConverter.GetProperties(context, value, attributeVar);
}
-
+
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetPropertiesSupported(context);
}
-
+
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValues(context);
}
-
+
public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesExclusive(context);
}
-
+
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesSupported(context);
}
-
+
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) {
if ((baseType.BaseType == typeof(System.Enum))) {
if ((value.GetType() == destinationType)) {
return value;
}
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "NULL_ENUM_VALUE" ;
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((baseType == typeof(bool))
+ if (((baseType == typeof(bool))
&& (baseType.BaseType == typeof(System.ValueType)))) {
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((context != null)
+ if (((context != null)
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
}
-
+
// Embedded class to represent WMI system Properties.
[TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class ManagementSystemProperties {
-
+
private System.Management.ManagementBaseObject PrivateLateBoundObject;
-
+
public ManagementSystemProperties(System.Management.ManagementBaseObject ManagedObject) {
PrivateLateBoundObject = ManagedObject;
}
-
+
[Browsable(true)]
public int GENUS {
get {
return ((int)(PrivateLateBoundObject["__GENUS"]));
}
}
-
+
[Browsable(true)]
public string CLASS {
get {
return ((string)(PrivateLateBoundObject["__CLASS"]));
}
}
-
+
[Browsable(true)]
public string SUPERCLASS {
get {
return ((string)(PrivateLateBoundObject["__SUPERCLASS"]));
}
}
-
+
[Browsable(true)]
public string DYNASTY {
get {
return ((string)(PrivateLateBoundObject["__DYNASTY"]));
}
}
-
+
[Browsable(true)]
public string RELPATH {
get {
return ((string)(PrivateLateBoundObject["__RELPATH"]));
}
}
-
+
[Browsable(true)]
public int PROPERTY_COUNT {
get {
return ((int)(PrivateLateBoundObject["__PROPERTY_COUNT"]));
}
}
-
+
[Browsable(true)]
public string[] DERIVATION {
get {
return ((string[])(PrivateLateBoundObject["__DERIVATION"]));
}
}
-
+
[Browsable(true)]
public string SERVER {
get {
return ((string)(PrivateLateBoundObject["__SERVER"]));
}
}
-
+
[Browsable(true)]
public string NAMESPACE {
get {
return ((string)(PrivateLateBoundObject["__NAMESPACE"]));
}
}
-
+
[Browsable(true)]
public string PATH {
get {
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetPortAllocationSettingData.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetPortAllocationSettingData.cs
index f281def4b10..680a57f53c3 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetPortAllocationSettingData.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetPortAllocationSettingData.cs
@@ -23,70 +23,70 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
using System.Globalization;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
-
-
+
+
// Functions ShouldSerialize are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use IsNull function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
// Functions IsNull() are used to check if a property is NULL.
// Functions Reset are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
// Every property added to the class for WMI property has attributes set to define its behavior in Visual Studio designer and also to define a TypeConverter to be used.
// An Early Bound class generated for the WMI class.Msvm_EthernetPortAllocationSettingData
public class EthernetPortAllocationSettingData : System.ComponentModel.Component {
-
+
// Private property to hold the WMI namespace in which the class resides.
private static string CreatedWmiNamespace = "ROOT\\virtualization\\v2";
-
+
// Private property to hold the name of WMI class which created this class.
public static string CreatedClassName = "Msvm_EthernetPortAllocationSettingData";
-
+
// Private member variable to hold the ManagementScope which is used by the various methods.
private static System.Management.ManagementScope statMgmtScope = null;
-
+
private ManagementSystemProperties PrivateSystemProperties;
-
+
// Underlying lateBound WMI object.
private System.Management.ManagementObject PrivateLateBoundObject;
-
+
// Member variable to store the 'automatic commit' behavior for the class.
private bool AutoCommitProp;
-
+
// Private variable to hold the embedded property representing the instance.
private System.Management.ManagementBaseObject embeddedObj;
-
+
// The current WMI object used
private System.Management.ManagementBaseObject curObj;
-
+
// Flag to indicate if the instance is an embedded object.
private bool isEmbedded;
-
+
// Below are different overloads of constructors to initialize an instance of the class with a WMI object.
public EthernetPortAllocationSettingData() {
this.InitializeObject(null, null, null);
}
-
+
public EthernetPortAllocationSettingData(string keyInstanceID) {
this.InitializeObject(null, new System.Management.ManagementPath(EthernetPortAllocationSettingData.ConstructPath(keyInstanceID)), null);
}
-
+
public EthernetPortAllocationSettingData(System.Management.ManagementScope mgmtScope, string keyInstanceID) {
this.InitializeObject(((System.Management.ManagementScope)(mgmtScope)), new System.Management.ManagementPath(EthernetPortAllocationSettingData.ConstructPath(keyInstanceID)), null);
}
-
+
public EthernetPortAllocationSettingData(System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(null, path, getOptions);
}
-
+
public EthernetPortAllocationSettingData(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path) {
this.InitializeObject(mgmtScope, path, null);
}
-
+
public EthernetPortAllocationSettingData(System.Management.ManagementPath path) {
this.InitializeObject(null, path, null);
}
-
+
public EthernetPortAllocationSettingData(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(mgmtScope, path, getOptions);
}
-
+
public EthernetPortAllocationSettingData(System.Management.ManagementObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -98,7 +98,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
public EthernetPortAllocationSettingData(System.Management.ManagementBaseObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -111,7 +111,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
// Property returns the namespace of the WMI class.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -120,7 +120,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return "ROOT\\virtualization\\v2";
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ManagementClassName {
@@ -129,7 +129,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
if ((curObj != null)) {
if ((curObj.ClassPath != null)) {
strRet = ((string)(curObj["__CLASS"]));
- if (((strRet == null)
+ if (((strRet == null)
|| (strRet == string.Empty))) {
strRet = CreatedClassName;
}
@@ -138,7 +138,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return strRet;
}
}
-
+
// Property pointing to an embedded object to get System properties of the WMI object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -147,7 +147,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return PrivateSystemProperties;
}
}
-
+
// Property returning the underlying lateBound object.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -156,7 +156,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return curObj;
}
}
-
+
// ManagementScope of the object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -175,7 +175,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -187,7 +187,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
AutoCommitProp = value;
}
}
-
+
// The ManagementPath of the underlying WMI object.
[Browsable(true)]
public System.Management.ManagementPath Path {
@@ -208,7 +208,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Public static scope property which is used by the various methods.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -220,7 +220,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
statMgmtScope = value;
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Address {
@@ -228,7 +228,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Address"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string AddressOnParent {
@@ -236,7 +236,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["AddressOnParent"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string AllocationUnits {
@@ -244,7 +244,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["AllocationUnits"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsAutomaticAllocationNull {
@@ -257,7 +257,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -269,7 +269,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["AutomaticAllocation"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsAutomaticDeallocationNull {
@@ -282,7 +282,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -294,7 +294,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["AutomaticDeallocation"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Caption {
@@ -302,7 +302,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Caption"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] Connection {
@@ -310,7 +310,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["Connection"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsConsumerVisibilityNull {
@@ -323,7 +323,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -335,7 +335,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["ConsumerVisibility"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Description {
@@ -343,7 +343,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Description"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDesiredVLANEndpointModeNull {
@@ -356,7 +356,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -368,7 +368,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["DesiredVLANEndpointMode"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ElementName {
@@ -376,7 +376,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["ElementName"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsEnabledStateNull {
@@ -389,7 +389,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description(@"EnabledState is an integer enumeration that indicates whether the allocation request is enabled or disabled. When an allocation request is marked as Disabled (3), then the allocation is not processed. The EnabledState for an active configuration is always marked as Enabled (2).")]
@@ -402,7 +402,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((EnabledStateValues)(System.Convert.ToInt32(curObj["EnabledState"])));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] HostResource {
@@ -410,7 +410,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["HostResource"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string InstanceID {
@@ -418,7 +418,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["InstanceID"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLimitNull {
@@ -431,7 +431,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -443,7 +443,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["Limit"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsMappingBehaviorNull {
@@ -456,7 +456,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -468,7 +468,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["MappingBehavior"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OtherEndpointMode {
@@ -476,7 +476,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["OtherEndpointMode"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OtherResourceType {
@@ -484,7 +484,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["OtherResourceType"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Parent {
@@ -492,7 +492,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Parent"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string PoolID {
@@ -500,7 +500,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["PoolID"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The list of friendly names corresponding to each entry in the RequiredFeatures.")]
@@ -509,7 +509,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["RequiredFeatureHints"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The list of feature identifers representing all the features that are required fo" +
@@ -520,13 +520,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["RequiredFeatures"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsReservationNull {
@@ -539,7 +539,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -551,7 +551,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["Reservation"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ResourceSubType {
@@ -559,7 +559,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["ResourceSubType"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsResourceTypeNull {
@@ -572,7 +572,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -584,7 +584,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["ResourceType"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("This property specifies the network resource pool from which a connection will be" +
@@ -595,13 +595,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["TestReplicaPoolID"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("This property specifies the friendly name of the virtual network switch to which " +
@@ -612,13 +612,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["TestReplicaSwitchName"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsVirtualQuantityNull {
@@ -631,7 +631,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -643,7 +643,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["VirtualQuantity"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string VirtualQuantityUnits {
@@ -651,7 +651,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["VirtualQuantityUnits"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsWeightNull {
@@ -664,7 +664,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -676,9 +676,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((uint)(curObj["Weight"]));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions OptionsParam) {
- if (((path != null)
+ if (((path != null)
&& (string.Compare(path.ClassName, this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -686,9 +686,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return CheckIfProperClass(new System.Management.ManagementObject(mgmtScope, path, OptionsParam));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementBaseObject theObj) {
- if (((theObj != null)
+ if (((theObj != null)
&& (string.Compare(((string)(theObj["__CLASS"])), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -705,133 +705,133 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return false;
}
-
+
private bool ShouldSerializeAutomaticAllocation() {
if ((this.IsAutomaticAllocationNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeAutomaticDeallocation() {
if ((this.IsAutomaticDeallocationNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeConsumerVisibility() {
if ((this.IsConsumerVisibilityNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeDesiredVLANEndpointMode() {
if ((this.IsDesiredVLANEndpointModeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeEnabledState() {
if ((this.IsEnabledStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLimit() {
if ((this.IsLimitNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeMappingBehavior() {
if ((this.IsMappingBehaviorNull == false)) {
return true;
}
return false;
}
-
+
private void ResetRequiredFeatures() {
curObj["RequiredFeatures"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private bool ShouldSerializeReservation() {
if ((this.IsReservationNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeResourceType() {
if ((this.IsResourceTypeNull == false)) {
return true;
}
return false;
}
-
+
private void ResetTestReplicaPoolID() {
curObj["TestReplicaPoolID"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private void ResetTestReplicaSwitchName() {
curObj["TestReplicaSwitchName"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private bool ShouldSerializeVirtualQuantity() {
if ((this.IsVirtualQuantityNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeWeight() {
if ((this.IsWeightNull == false)) {
return true;
}
return false;
}
-
+
[Browsable(true)]
public void CommitObject() {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put();
}
}
-
+
[Browsable(true)]
public void CommitObject(System.Management.PutOptions putOptions) {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put(putOptions);
}
}
-
+
private void Initialize() {
AutoCommitProp = true;
isEmbedded = false;
}
-
+
private static string ConstructPath(string keyInstanceID) {
string strPath = "ROOT\\virtualization\\v2:Msvm_EthernetPortAllocationSettingData";
strPath = string.Concat(strPath, string.Concat(".InstanceID=", string.Concat("\"", string.Concat(keyInstanceID, "\""))));
return strPath;
}
-
+
private void InitializeObject(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
Initialize();
if ((path != null)) {
@@ -843,24 +843,24 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
curObj = PrivateLateBoundObject;
}
-
+
// Different overloads of GetInstances() help in enumerating instances of the WMI class.
public static EthernetPortAllocationSettingDataCollection GetInstances() {
return GetInstances(null, null, null);
}
-
+
public static EthernetPortAllocationSettingDataCollection GetInstances(string condition) {
return GetInstances(null, condition, null);
}
-
+
public static EthernetPortAllocationSettingDataCollection GetInstances(string[] selectedProperties) {
return GetInstances(null, null, selectedProperties);
}
-
+
public static EthernetPortAllocationSettingDataCollection GetInstances(string condition, string[] selectedProperties) {
return GetInstances(null, condition, selectedProperties);
}
-
+
public static EthernetPortAllocationSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, System.Management.EnumerationOptions enumOptions) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -881,15 +881,15 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return new EthernetPortAllocationSettingDataCollection(clsObject.GetInstances(enumOptions));
}
-
+
public static EthernetPortAllocationSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition) {
return GetInstances(mgmtScope, condition, null);
}
-
+
public static EthernetPortAllocationSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string[] selectedProperties) {
return GetInstances(mgmtScope, null, selectedProperties);
}
-
+
public static EthernetPortAllocationSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition, string[] selectedProperties) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -906,7 +906,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
ObjectSearcher.Options = enumOptions;
return new EthernetPortAllocationSettingDataCollection(ObjectSearcher.Get());
}
-
+
[Browsable(true)]
public static EthernetPortAllocationSettingData CreateInstance() {
System.Management.ManagementScope mgmtScope = null;
@@ -921,48 +921,48 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
System.Management.ManagementClass tmpMgmtClass = new System.Management.ManagementClass(mgmtScope, mgmtPath, null);
return new EthernetPortAllocationSettingData(tmpMgmtClass.CreateInstance());
}
-
+
[Browsable(true)]
public void Delete() {
PrivateLateBoundObject.Delete();
}
-
+
public enum EnabledStateValues {
-
+
Enabled = 2,
-
+
Disabled = 3,
-
+
NULL_ENUM_VALUE = 0,
}
-
+
// Enumerator implementation for enumerating instances of the class.
public class EthernetPortAllocationSettingDataCollection : object, ICollection {
-
+
private ManagementObjectCollection privColObj;
-
+
public EthernetPortAllocationSettingDataCollection(ManagementObjectCollection objCollection) {
privColObj = objCollection;
}
-
+
public virtual int Count {
get {
return privColObj.Count;
}
}
-
+
public virtual bool IsSynchronized {
get {
return privColObj.IsSynchronized;
}
}
-
+
public virtual object SyncRoot {
get {
return this;
}
}
-
+
public virtual void CopyTo(System.Array array, int index) {
privColObj.CopyTo(array, index);
int nCtr;
@@ -970,189 +970,189 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
array.SetValue(new EthernetPortAllocationSettingData(((System.Management.ManagementObject)(array.GetValue(nCtr)))), nCtr);
}
}
-
+
public virtual System.Collections.IEnumerator GetEnumerator() {
return new EthernetPortAllocationSettingDataEnumerator(privColObj.GetEnumerator());
}
-
+
public class EthernetPortAllocationSettingDataEnumerator : object, System.Collections.IEnumerator {
-
+
private ManagementObjectCollection.ManagementObjectEnumerator privObjEnum;
-
+
public EthernetPortAllocationSettingDataEnumerator(ManagementObjectCollection.ManagementObjectEnumerator objEnum) {
privObjEnum = objEnum;
}
-
+
public virtual object Current {
get {
return new EthernetPortAllocationSettingData(((System.Management.ManagementObject)(privObjEnum.Current)));
}
}
-
+
public virtual bool MoveNext() {
return privObjEnum.MoveNext();
}
-
+
public virtual void Reset() {
privObjEnum.Reset();
}
}
}
-
+
// TypeConverter to handle null values for ValueType properties
public class WMIValueTypeConverter : TypeConverter {
-
+
private TypeConverter baseConverter;
-
+
private System.Type baseType;
-
+
public WMIValueTypeConverter(System.Type inBaseType) {
baseConverter = TypeDescriptor.GetConverter(inBaseType);
baseType = inBaseType;
}
-
+
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type srcType) {
return baseConverter.CanConvertFrom(context, srcType);
}
-
+
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) {
return baseConverter.CanConvertTo(context, destinationType);
}
-
+
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
return baseConverter.ConvertFrom(context, culture, value);
}
-
+
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary dictionary) {
return baseConverter.CreateInstance(context, dictionary);
}
-
+
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetCreateInstanceSupported(context);
}
-
+
public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributeVar) {
return baseConverter.GetProperties(context, value, attributeVar);
}
-
+
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetPropertiesSupported(context);
}
-
+
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValues(context);
}
-
+
public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesExclusive(context);
}
-
+
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesSupported(context);
}
-
+
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) {
if ((baseType.BaseType == typeof(System.Enum))) {
if ((value.GetType() == destinationType)) {
return value;
}
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "NULL_ENUM_VALUE" ;
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((baseType == typeof(bool))
+ if (((baseType == typeof(bool))
&& (baseType.BaseType == typeof(System.ValueType)))) {
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((context != null)
+ if (((context != null)
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
}
-
+
// Embedded class to represent WMI system Properties.
[TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class ManagementSystemProperties {
-
+
private System.Management.ManagementBaseObject PrivateLateBoundObject;
-
+
public ManagementSystemProperties(System.Management.ManagementBaseObject ManagedObject) {
PrivateLateBoundObject = ManagedObject;
}
-
+
[Browsable(true)]
public int GENUS {
get {
return ((int)(PrivateLateBoundObject["__GENUS"]));
}
}
-
+
[Browsable(true)]
public string CLASS {
get {
return ((string)(PrivateLateBoundObject["__CLASS"]));
}
}
-
+
[Browsable(true)]
public string SUPERCLASS {
get {
return ((string)(PrivateLateBoundObject["__SUPERCLASS"]));
}
}
-
+
[Browsable(true)]
public string DYNASTY {
get {
return ((string)(PrivateLateBoundObject["__DYNASTY"]));
}
}
-
+
[Browsable(true)]
public string RELPATH {
get {
return ((string)(PrivateLateBoundObject["__RELPATH"]));
}
}
-
+
[Browsable(true)]
public int PROPERTY_COUNT {
get {
return ((int)(PrivateLateBoundObject["__PROPERTY_COUNT"]));
}
}
-
+
[Browsable(true)]
public string[] DERIVATION {
get {
return ((string[])(PrivateLateBoundObject["__DERIVATION"]));
}
}
-
+
[Browsable(true)]
public string SERVER {
get {
return ((string)(PrivateLateBoundObject["__SERVER"]));
}
}
-
+
[Browsable(true)]
public string NAMESPACE {
get {
return ((string)(PrivateLateBoundObject["__NAMESPACE"]));
}
}
-
+
[Browsable(true)]
public string PATH {
get {
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetSwitchPort.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetSwitchPort.cs
index 5bc97f864bb..b33b3a5890a 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetSwitchPort.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetSwitchPort.cs
@@ -23,8 +23,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
using System.Globalization;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
-
-
+
+
// Functions ShouldSerialize are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use IsNull function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
// Functions IsNull() are used to check if a property is NULL.
// Functions Reset are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
@@ -32,62 +32,62 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
// Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
// An Early Bound class generated for the WMI class.Msvm_EthernetSwitchPort
public class EthernetSwitchPort : System.ComponentModel.Component {
-
+
// Private property to hold the WMI namespace in which the class resides.
private static string CreatedWmiNamespace = "ROOT\\virtualization\\v2";
-
+
// Private property to hold the name of WMI class which created this class.
public static string CreatedClassName = "Msvm_EthernetSwitchPort";
-
+
// Private member variable to hold the ManagementScope which is used by the various methods.
private static System.Management.ManagementScope statMgmtScope = null;
-
+
private ManagementSystemProperties PrivateSystemProperties;
-
+
// Underlying lateBound WMI object.
private System.Management.ManagementObject PrivateLateBoundObject;
-
+
// Member variable to store the 'automatic commit' behavior for the class.
private bool AutoCommitProp;
-
+
// Private variable to hold the embedded property representing the instance.
private System.Management.ManagementBaseObject embeddedObj;
-
+
// The current WMI object used
private System.Management.ManagementBaseObject curObj;
-
+
// Flag to indicate if the instance is an embedded object.
private bool isEmbedded;
-
+
// Below are different overloads of constructors to initialize an instance of the class with a WMI object.
public EthernetSwitchPort() {
this.InitializeObject(null, null, null);
}
-
+
public EthernetSwitchPort(string keyCreationClassName, string keyDeviceID, string keySystemCreationClassName, string keySystemName) {
this.InitializeObject(null, new System.Management.ManagementPath(EthernetSwitchPort.ConstructPath(keyCreationClassName, keyDeviceID, keySystemCreationClassName, keySystemName)), null);
}
-
+
public EthernetSwitchPort(System.Management.ManagementScope mgmtScope, string keyCreationClassName, string keyDeviceID, string keySystemCreationClassName, string keySystemName) {
this.InitializeObject(((System.Management.ManagementScope)(mgmtScope)), new System.Management.ManagementPath(EthernetSwitchPort.ConstructPath(keyCreationClassName, keyDeviceID, keySystemCreationClassName, keySystemName)), null);
}
-
+
public EthernetSwitchPort(System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(null, path, getOptions);
}
-
+
public EthernetSwitchPort(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path) {
this.InitializeObject(mgmtScope, path, null);
}
-
+
public EthernetSwitchPort(System.Management.ManagementPath path) {
this.InitializeObject(null, path, null);
}
-
+
public EthernetSwitchPort(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(mgmtScope, path, getOptions);
}
-
+
public EthernetSwitchPort(System.Management.ManagementObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -99,7 +99,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
public EthernetSwitchPort(System.Management.ManagementBaseObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -112,7 +112,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
// Property returns the namespace of the WMI class.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -121,7 +121,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return "ROOT\\virtualization\\v2";
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ManagementClassName {
@@ -130,7 +130,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
if ((curObj != null)) {
if ((curObj.ClassPath != null)) {
strRet = ((string)(curObj["__CLASS"]));
- if (((strRet == null)
+ if (((strRet == null)
|| (strRet == string.Empty))) {
strRet = CreatedClassName;
}
@@ -139,7 +139,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return strRet;
}
}
-
+
// Property pointing to an embedded object to get System properties of the WMI object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -148,7 +148,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return PrivateSystemProperties;
}
}
-
+
// Property returning the underlying lateBound object.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -157,7 +157,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return curObj;
}
}
-
+
// ManagementScope of the object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -176,7 +176,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -188,7 +188,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
AutoCommitProp = value;
}
}
-
+
// The ManagementPath of the underlying WMI object.
[Browsable(true)]
public System.Management.ManagementPath Path {
@@ -209,7 +209,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Public static scope property which is used by the various methods.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -221,7 +221,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
statMgmtScope = value;
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsActiveMaximumTransmissionUnitNull {
@@ -234,7 +234,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -246,7 +246,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["ActiveMaximumTransmissionUnit"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] AdditionalAvailability {
@@ -254,7 +254,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["AdditionalAvailability"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsAutoSenseNull {
@@ -267,7 +267,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -279,7 +279,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["AutoSense"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsAvailabilityNull {
@@ -292,7 +292,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -304,7 +304,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["Availability"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] AvailableRequestedStates {
@@ -312,7 +312,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["AvailableRequestedStates"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] Capabilities {
@@ -320,7 +320,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["Capabilities"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] CapabilityDescriptions {
@@ -328,7 +328,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["CapabilityDescriptions"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Caption {
@@ -336,7 +336,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Caption"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsCommunicationStatusNull {
@@ -349,7 +349,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -361,7 +361,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["CommunicationStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string CreationClassName {
@@ -369,7 +369,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["CreationClassName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Description {
@@ -377,7 +377,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Description"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDetailedStatusNull {
@@ -390,7 +390,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -402,7 +402,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["DetailedStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string DeviceID {
@@ -410,7 +410,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["DeviceID"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ElementName {
@@ -418,7 +418,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["ElementName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] EnabledCapabilities {
@@ -426,7 +426,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["EnabledCapabilities"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsEnabledDefaultNull {
@@ -439,7 +439,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -451,7 +451,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["EnabledDefault"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsEnabledStateNull {
@@ -464,7 +464,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -476,7 +476,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["EnabledState"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsErrorClearedNull {
@@ -489,7 +489,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -501,7 +501,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["ErrorCleared"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ErrorDescription {
@@ -509,7 +509,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["ErrorDescription"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsFullDuplexNull {
@@ -522,7 +522,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -534,7 +534,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["FullDuplex"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsHealthStateNull {
@@ -547,7 +547,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -559,7 +559,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["HealthState"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] IdentifyingDescriptions {
@@ -567,7 +567,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["IdentifyingDescriptions"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsInstallDateNull {
@@ -580,7 +580,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -594,7 +594,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string InstanceID {
@@ -602,7 +602,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["InstanceID"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsIOVOffloadUsageNull {
@@ -615,7 +615,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The current I/O virtualization (IOV) offload usage on this port. The usage is the" +
@@ -629,7 +629,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((uint)(curObj["IOVOffloadUsage"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLastErrorCodeNull {
@@ -642,7 +642,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -654,7 +654,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((uint)(curObj["LastErrorCode"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLinkTechnologyNull {
@@ -667,7 +667,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -679,7 +679,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["LinkTechnology"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsMaxDataSizeNull {
@@ -692,7 +692,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -704,7 +704,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((uint)(curObj["MaxDataSize"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsMaxQuiesceTimeNull {
@@ -717,7 +717,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -729,7 +729,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["MaxQuiesceTime"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsMaxSpeedNull {
@@ -742,7 +742,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -754,7 +754,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["MaxSpeed"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Name {
@@ -762,7 +762,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Name"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] NetworkAddresses {
@@ -770,7 +770,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["NetworkAddresses"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsOperatingStatusNull {
@@ -783,7 +783,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -795,7 +795,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["OperatingStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] OperationalStatus {
@@ -803,7 +803,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["OperationalStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] OtherEnabledCapabilities {
@@ -811,7 +811,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["OtherEnabledCapabilities"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OtherEnabledState {
@@ -819,7 +819,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["OtherEnabledState"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] OtherIdentifyingInfo {
@@ -827,7 +827,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["OtherIdentifyingInfo"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OtherLinkTechnology {
@@ -835,7 +835,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["OtherLinkTechnology"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OtherNetworkPortType {
@@ -843,7 +843,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["OtherNetworkPortType"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OtherPortType {
@@ -851,7 +851,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["OtherPortType"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string PermanentAddress {
@@ -859,7 +859,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["PermanentAddress"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPortNumberNull {
@@ -872,7 +872,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -884,7 +884,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["PortNumber"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPortTypeNull {
@@ -897,7 +897,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -909,7 +909,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["PortType"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] PowerManagementCapabilities {
@@ -917,7 +917,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["PowerManagementCapabilities"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPowerManagementSupportedNull {
@@ -930,7 +930,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -942,7 +942,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["PowerManagementSupported"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPowerOnHoursNull {
@@ -955,7 +955,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -967,7 +967,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["PowerOnHours"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPrimaryStatusNull {
@@ -980,7 +980,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -992,7 +992,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["PrimaryStatus"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsRequestedSpeedNull {
@@ -1005,7 +1005,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1017,7 +1017,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["RequestedSpeed"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsRequestedStateNull {
@@ -1030,7 +1030,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1042,7 +1042,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["RequestedState"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsSpeedNull {
@@ -1055,7 +1055,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1067,7 +1067,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["Speed"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Status {
@@ -1075,7 +1075,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Status"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] StatusDescriptions {
@@ -1083,7 +1083,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["StatusDescriptions"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsStatusInfoNull {
@@ -1096,7 +1096,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1108,7 +1108,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["StatusInfo"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsSupportedMaximumTransmissionUnitNull {
@@ -1121,7 +1121,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1133,7 +1133,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["SupportedMaximumTransmissionUnit"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string SystemCreationClassName {
@@ -1141,7 +1141,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["SystemCreationClassName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string SystemName {
@@ -1149,7 +1149,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["SystemName"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTimeOfLastStateChangeNull {
@@ -1162,7 +1162,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1176,7 +1176,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTotalPowerOnHoursNull {
@@ -1189,7 +1189,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1201,7 +1201,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["TotalPowerOnHours"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTransitioningToStateNull {
@@ -1214,7 +1214,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1226,7 +1226,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["TransitioningToState"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsUsageRestrictionNull {
@@ -1239,7 +1239,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1251,7 +1251,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["UsageRestriction"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsVMQOffloadUsageNull {
@@ -1264,7 +1264,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The current VMQ offloading usage on this port. The usage is the amount of VMQ res" +
@@ -1278,9 +1278,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((uint)(curObj["VMQOffloadUsage"]));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions OptionsParam) {
- if (((path != null)
+ if (((path != null)
&& (string.Compare(path.ClassName, this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -1288,9 +1288,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return CheckIfProperClass(new System.Management.ManagementObject(mgmtScope, path, OptionsParam));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementBaseObject theObj) {
- if (((theObj != null)
+ if (((theObj != null)
&& (string.Compare(((string)(theObj["__CLASS"])), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -1307,77 +1307,77 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return false;
}
-
+
private bool ShouldSerializeActiveMaximumTransmissionUnit() {
if ((this.IsActiveMaximumTransmissionUnitNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeAutoSense() {
if ((this.IsAutoSenseNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeAvailability() {
if ((this.IsAvailabilityNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeCommunicationStatus() {
if ((this.IsCommunicationStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeDetailedStatus() {
if ((this.IsDetailedStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeEnabledDefault() {
if ((this.IsEnabledDefaultNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeEnabledState() {
if ((this.IsEnabledStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeErrorCleared() {
if ((this.IsErrorClearedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeFullDuplex() {
if ((this.IsFullDuplexNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeHealthState() {
if ((this.IsHealthStateNull == false)) {
return true;
}
return false;
}
-
+
// Converts a given datetime in DMTF format to System.DateTime object.
static System.DateTime ToDateTime(string dmtfDate) {
System.DateTime initializer = System.DateTime.MinValue;
@@ -1429,13 +1429,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
if (("******" != tempString)) {
ticks = (long.Parse(tempString) * ((long)((System.TimeSpan.TicksPerMillisecond / 1000))));
}
- if (((((((((year < 0)
- || (month < 0))
- || (day < 0))
- || (hour < 0))
- || (minute < 0))
- || (minute < 0))
- || (second < 0))
+ if (((((((((year < 0)
+ || (month < 0))
+ || (day < 0))
+ || (hour < 0))
+ || (minute < 0))
+ || (minute < 0))
+ || (second < 0))
|| (ticks < 0))) {
throw new System.ArgumentOutOfRangeException();
}
@@ -1463,7 +1463,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return datetime;
}
-
+
// Converts a given System.DateTime object to DMTF datetime format.
static string ToDmtfDateTime(System.DateTime date) {
string utcString = string.Empty;
@@ -1490,8 +1490,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
dmtfDateTime = string.Concat(dmtfDateTime, ((int)(date.Second)).ToString().PadLeft(2, '0'));
dmtfDateTime = string.Concat(dmtfDateTime, ".");
System.DateTime dtTemp = new System.DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, 0);
- long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
- * 1000)
+ long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
+ * 1000)
/ System.TimeSpan.TicksPerMillisecond)));
string strMicrosec = ((long)(microsec)).ToString();
if ((strMicrosec.Length > 6)) {
@@ -1501,187 +1501,187 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
dmtfDateTime = string.Concat(dmtfDateTime, utcString);
return dmtfDateTime;
}
-
+
private bool ShouldSerializeInstallDate() {
if ((this.IsInstallDateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeIOVOffloadUsage() {
if ((this.IsIOVOffloadUsageNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLastErrorCode() {
if ((this.IsLastErrorCodeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLinkTechnology() {
if ((this.IsLinkTechnologyNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeMaxDataSize() {
if ((this.IsMaxDataSizeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeMaxQuiesceTime() {
if ((this.IsMaxQuiesceTimeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeMaxSpeed() {
if ((this.IsMaxSpeedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeOperatingStatus() {
if ((this.IsOperatingStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePortNumber() {
if ((this.IsPortNumberNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePortType() {
if ((this.IsPortTypeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePowerManagementSupported() {
if ((this.IsPowerManagementSupportedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePowerOnHours() {
if ((this.IsPowerOnHoursNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePrimaryStatus() {
if ((this.IsPrimaryStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeRequestedSpeed() {
if ((this.IsRequestedSpeedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeRequestedState() {
if ((this.IsRequestedStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeSpeed() {
if ((this.IsSpeedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeStatusInfo() {
if ((this.IsStatusInfoNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeSupportedMaximumTransmissionUnit() {
if ((this.IsSupportedMaximumTransmissionUnitNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTimeOfLastStateChange() {
if ((this.IsTimeOfLastStateChangeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTotalPowerOnHours() {
if ((this.IsTotalPowerOnHoursNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTransitioningToState() {
if ((this.IsTransitioningToStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeUsageRestriction() {
if ((this.IsUsageRestrictionNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeVMQOffloadUsage() {
if ((this.IsVMQOffloadUsageNull == false)) {
return true;
}
return false;
}
-
+
[Browsable(true)]
public void CommitObject() {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put();
}
}
-
+
[Browsable(true)]
public void CommitObject(System.Management.PutOptions putOptions) {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put(putOptions);
}
}
-
+
private void Initialize() {
AutoCommitProp = true;
isEmbedded = false;
}
-
+
private static string ConstructPath(string keyCreationClassName, string keyDeviceID, string keySystemCreationClassName, string keySystemName) {
string strPath = "ROOT\\virtualization\\v2:Msvm_EthernetSwitchPort";
strPath = string.Concat(strPath, string.Concat(".CreationClassName=", string.Concat("\"", string.Concat(keyCreationClassName, "\""))));
@@ -1690,7 +1690,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
strPath = string.Concat(strPath, string.Concat(",SystemName=", string.Concat("\"", string.Concat(keySystemName, "\""))));
return strPath;
}
-
+
private void InitializeObject(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
Initialize();
if ((path != null)) {
@@ -1702,24 +1702,24 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
curObj = PrivateLateBoundObject;
}
-
+
// Different overloads of GetInstances() help in enumerating instances of the WMI class.
public static EthernetSwitchPortCollection GetInstances() {
return GetInstances(null, null, null);
}
-
+
public static EthernetSwitchPortCollection GetInstances(string condition) {
return GetInstances(null, condition, null);
}
-
+
public static EthernetSwitchPortCollection GetInstances(string[] selectedProperties) {
return GetInstances(null, null, selectedProperties);
}
-
+
public static EthernetSwitchPortCollection GetInstances(string condition, string[] selectedProperties) {
return GetInstances(null, condition, selectedProperties);
}
-
+
public static EthernetSwitchPortCollection GetInstances(System.Management.ManagementScope mgmtScope, System.Management.EnumerationOptions enumOptions) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -1740,15 +1740,15 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return new EthernetSwitchPortCollection(clsObject.GetInstances(enumOptions));
}
-
+
public static EthernetSwitchPortCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition) {
return GetInstances(mgmtScope, condition, null);
}
-
+
public static EthernetSwitchPortCollection GetInstances(System.Management.ManagementScope mgmtScope, string[] selectedProperties) {
return GetInstances(mgmtScope, null, selectedProperties);
}
-
+
public static EthernetSwitchPortCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition, string[] selectedProperties) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -1765,7 +1765,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
ObjectSearcher.Options = enumOptions;
return new EthernetSwitchPortCollection(ObjectSearcher.Get());
}
-
+
[Browsable(true)]
public static EthernetSwitchPort CreateInstance() {
System.Management.ManagementScope mgmtScope = null;
@@ -1780,12 +1780,12 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
System.Management.ManagementClass tmpMgmtClass = new System.Management.ManagementClass(mgmtScope, mgmtPath, null);
return new EthernetSwitchPort(tmpMgmtClass.CreateInstance());
}
-
+
[Browsable(true)]
public void Delete() {
PrivateLateBoundObject.Delete();
}
-
+
public uint EnableDevice(bool Enabled) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1798,7 +1798,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint OnlineDevice(bool Online) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1811,7 +1811,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint QuiesceDevice(bool Quiesce) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1824,7 +1824,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint RequestStateChange(ushort RequestedState, System.DateTime TimeoutPeriod, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1843,7 +1843,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint Reset() {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1854,7 +1854,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint RestoreProperties() {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1865,7 +1865,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint SaveProperties() {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1876,7 +1876,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint SetPowerState(ushort PowerState, System.DateTime Time) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1890,34 +1890,34 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
// Enumerator implementation for enumerating instances of the class.
public class EthernetSwitchPortCollection : object, ICollection {
-
+
private ManagementObjectCollection privColObj;
-
+
public EthernetSwitchPortCollection(ManagementObjectCollection objCollection) {
privColObj = objCollection;
}
-
+
public virtual int Count {
get {
return privColObj.Count;
}
}
-
+
public virtual bool IsSynchronized {
get {
return privColObj.IsSynchronized;
}
}
-
+
public virtual object SyncRoot {
get {
return this;
}
}
-
+
public virtual void CopyTo(System.Array array, int index) {
privColObj.CopyTo(array, index);
int nCtr;
@@ -1925,189 +1925,189 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
array.SetValue(new EthernetSwitchPort(((System.Management.ManagementObject)(array.GetValue(nCtr)))), nCtr);
}
}
-
+
public virtual System.Collections.IEnumerator GetEnumerator() {
return new EthernetSwitchPortEnumerator(privColObj.GetEnumerator());
}
-
+
public class EthernetSwitchPortEnumerator : object, System.Collections.IEnumerator {
-
+
private ManagementObjectCollection.ManagementObjectEnumerator privObjEnum;
-
+
public EthernetSwitchPortEnumerator(ManagementObjectCollection.ManagementObjectEnumerator objEnum) {
privObjEnum = objEnum;
}
-
+
public virtual object Current {
get {
return new EthernetSwitchPort(((System.Management.ManagementObject)(privObjEnum.Current)));
}
}
-
+
public virtual bool MoveNext() {
return privObjEnum.MoveNext();
}
-
+
public virtual void Reset() {
privObjEnum.Reset();
}
}
}
-
+
// TypeConverter to handle null values for ValueType properties
public class WMIValueTypeConverter : TypeConverter {
-
+
private TypeConverter baseConverter;
-
+
private System.Type baseType;
-
+
public WMIValueTypeConverter(System.Type inBaseType) {
baseConverter = TypeDescriptor.GetConverter(inBaseType);
baseType = inBaseType;
}
-
+
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type srcType) {
return baseConverter.CanConvertFrom(context, srcType);
}
-
+
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) {
return baseConverter.CanConvertTo(context, destinationType);
}
-
+
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
return baseConverter.ConvertFrom(context, culture, value);
}
-
+
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary dictionary) {
return baseConverter.CreateInstance(context, dictionary);
}
-
+
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetCreateInstanceSupported(context);
}
-
+
public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributeVar) {
return baseConverter.GetProperties(context, value, attributeVar);
}
-
+
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetPropertiesSupported(context);
}
-
+
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValues(context);
}
-
+
public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesExclusive(context);
}
-
+
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesSupported(context);
}
-
+
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) {
if ((baseType.BaseType == typeof(System.Enum))) {
if ((value.GetType() == destinationType)) {
return value;
}
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "NULL_ENUM_VALUE" ;
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((baseType == typeof(bool))
+ if (((baseType == typeof(bool))
&& (baseType.BaseType == typeof(System.ValueType)))) {
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((context != null)
+ if (((context != null)
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
}
-
+
// Embedded class to represent WMI system Properties.
[TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class ManagementSystemProperties {
-
+
private System.Management.ManagementBaseObject PrivateLateBoundObject;
-
+
public ManagementSystemProperties(System.Management.ManagementBaseObject ManagedObject) {
PrivateLateBoundObject = ManagedObject;
}
-
+
[Browsable(true)]
public int GENUS {
get {
return ((int)(PrivateLateBoundObject["__GENUS"]));
}
}
-
+
[Browsable(true)]
public string CLASS {
get {
return ((string)(PrivateLateBoundObject["__CLASS"]));
}
}
-
+
[Browsable(true)]
public string SUPERCLASS {
get {
return ((string)(PrivateLateBoundObject["__SUPERCLASS"]));
}
}
-
+
[Browsable(true)]
public string DYNASTY {
get {
return ((string)(PrivateLateBoundObject["__DYNASTY"]));
}
}
-
+
[Browsable(true)]
public string RELPATH {
get {
return ((string)(PrivateLateBoundObject["__RELPATH"]));
}
}
-
+
[Browsable(true)]
public int PROPERTY_COUNT {
get {
return ((int)(PrivateLateBoundObject["__PROPERTY_COUNT"]));
}
}
-
+
[Browsable(true)]
public string[] DERIVATION {
get {
return ((string[])(PrivateLateBoundObject["__DERIVATION"]));
}
}
-
+
[Browsable(true)]
public string SERVER {
get {
return ((string)(PrivateLateBoundObject["__SERVER"]));
}
}
-
+
[Browsable(true)]
public string NAMESPACE {
get {
return ((string)(PrivateLateBoundObject["__NAMESPACE"]));
}
}
-
+
[Browsable(true)]
public string PATH {
get {
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetSwitchPortBandwidthSettingData.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetSwitchPortBandwidthSettingData.cs
index 482c4d2fa86..6085ac5aecc 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetSwitchPortBandwidthSettingData.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetSwitchPortBandwidthSettingData.cs
@@ -23,70 +23,70 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
using System.Globalization;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
-
-
+
+
// Functions ShouldSerialize are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use IsNull function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
// Functions IsNull() are used to check if a property is NULL.
// Functions Reset are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
// Every property added to the class for WMI property has attributes set to define its behavior in Visual Studio designer and also to define a TypeConverter to be used.
// An Early Bound class generated for the WMI class.Msvm_EthernetSwitchPortBandwidthSettingData
public class EthernetSwitchPortBandwidthSettingData : System.ComponentModel.Component {
-
+
// Private property to hold the WMI namespace in which the class resides.
private static string CreatedWmiNamespace = "ROOT\\virtualization\\v2";
-
+
// Private property to hold the name of WMI class which created this class.
private static string CreatedClassName = "Msvm_EthernetSwitchPortBandwidthSettingData";
-
+
// Private member variable to hold the ManagementScope which is used by the various methods.
private static System.Management.ManagementScope statMgmtScope = null;
-
+
private ManagementSystemProperties PrivateSystemProperties;
-
+
// Underlying lateBound WMI object.
private System.Management.ManagementObject PrivateLateBoundObject;
-
+
// Member variable to store the 'automatic commit' behavior for the class.
private bool AutoCommitProp;
-
+
// Private variable to hold the embedded property representing the instance.
private System.Management.ManagementBaseObject embeddedObj;
-
+
// The current WMI object used
private System.Management.ManagementBaseObject curObj;
-
+
// Flag to indicate if the instance is an embedded object.
private bool isEmbedded;
-
+
// Below are different overloads of constructors to initialize an instance of the class with a WMI object.
public EthernetSwitchPortBandwidthSettingData() {
this.InitializeObject(null, null, null);
}
-
+
public EthernetSwitchPortBandwidthSettingData(string keyInstanceID) {
this.InitializeObject(null, new System.Management.ManagementPath(EthernetSwitchPortBandwidthSettingData.ConstructPath(keyInstanceID)), null);
}
-
+
public EthernetSwitchPortBandwidthSettingData(System.Management.ManagementScope mgmtScope, string keyInstanceID) {
this.InitializeObject(((System.Management.ManagementScope)(mgmtScope)), new System.Management.ManagementPath(EthernetSwitchPortBandwidthSettingData.ConstructPath(keyInstanceID)), null);
}
-
+
public EthernetSwitchPortBandwidthSettingData(System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(null, path, getOptions);
}
-
+
public EthernetSwitchPortBandwidthSettingData(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path) {
this.InitializeObject(mgmtScope, path, null);
}
-
+
public EthernetSwitchPortBandwidthSettingData(System.Management.ManagementPath path) {
this.InitializeObject(null, path, null);
}
-
+
public EthernetSwitchPortBandwidthSettingData(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(mgmtScope, path, getOptions);
}
-
+
public EthernetSwitchPortBandwidthSettingData(System.Management.ManagementObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -98,7 +98,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
public EthernetSwitchPortBandwidthSettingData(System.Management.ManagementBaseObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -111,7 +111,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
// Property returns the namespace of the WMI class.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -120,7 +120,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return "ROOT\\virtualization\\v2";
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ManagementClassName {
@@ -129,7 +129,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
if ((curObj != null)) {
if ((curObj.ClassPath != null)) {
strRet = ((string)(curObj["__CLASS"]));
- if (((strRet == null)
+ if (((strRet == null)
|| (strRet == string.Empty))) {
strRet = CreatedClassName;
}
@@ -138,7 +138,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return strRet;
}
}
-
+
// Property pointing to an embedded object to get System properties of the WMI object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -147,7 +147,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return PrivateSystemProperties;
}
}
-
+
// Property returning the underlying lateBound object.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -156,7 +156,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return curObj;
}
}
-
+
// ManagementScope of the object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -175,7 +175,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -187,7 +187,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
AutoCommitProp = value;
}
}
-
+
// The ManagementPath of the underlying WMI object.
[Browsable(true)]
public System.Management.ManagementPath Path {
@@ -208,7 +208,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Public static scope property which is used by the various methods.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -220,7 +220,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
statMgmtScope = value;
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsBurstLimitNull {
@@ -233,7 +233,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The peak bandwidth allowed from the port during bursts.")]
@@ -247,13 +247,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["BurstLimit"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsBurstSizeNull {
@@ -266,7 +266,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The maximum burst size allowed.")]
@@ -280,13 +280,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["BurstSize"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Caption {
@@ -294,7 +294,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Caption"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Description {
@@ -302,7 +302,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Description"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ElementName {
@@ -310,7 +310,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["ElementName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string InstanceID {
@@ -318,7 +318,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["InstanceID"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLimitNull {
@@ -331,7 +331,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The bandwidth limit allowed for the port.")]
@@ -345,13 +345,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["Limit"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsReservationNull {
@@ -364,7 +364,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The minimum absolute bandwidth guaranteed for the port.")]
@@ -378,13 +378,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["Reservation"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsWeightNull {
@@ -397,7 +397,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The minimum bandwidth in weight guaranteed for the port.")]
@@ -411,15 +411,15 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["Weight"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions OptionsParam) {
- if (((path != null)
+ if (((path != null)
&& (string.Compare(path.ClassName, this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -427,9 +427,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return CheckIfProperClass(new System.Management.ManagementObject(mgmtScope, path, OptionsParam));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementBaseObject theObj) {
- if (((theObj != null)
+ if (((theObj != null)
&& (string.Compare(((string)(theObj["__CLASS"])), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -446,107 +446,107 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return false;
}
-
+
private bool ShouldSerializeBurstLimit() {
if ((this.IsBurstLimitNull == false)) {
return true;
}
return false;
}
-
+
private void ResetBurstLimit() {
curObj["BurstLimit"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private bool ShouldSerializeBurstSize() {
if ((this.IsBurstSizeNull == false)) {
return true;
}
return false;
}
-
+
private void ResetBurstSize() {
curObj["BurstSize"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private bool ShouldSerializeLimit() {
if ((this.IsLimitNull == false)) {
return true;
}
return false;
}
-
+
private void ResetLimit() {
curObj["Limit"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private bool ShouldSerializeReservation() {
if ((this.IsReservationNull == false)) {
return true;
}
return false;
}
-
+
private void ResetReservation() {
curObj["Reservation"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private bool ShouldSerializeWeight() {
if ((this.IsWeightNull == false)) {
return true;
}
return false;
}
-
+
private void ResetWeight() {
curObj["Weight"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
[Browsable(true)]
public void CommitObject() {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put();
}
}
-
+
[Browsable(true)]
public void CommitObject(System.Management.PutOptions putOptions) {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put(putOptions);
}
}
-
+
private void Initialize() {
AutoCommitProp = true;
isEmbedded = false;
}
-
+
private static string ConstructPath(string keyInstanceID) {
string strPath = "ROOT\\virtualization\\v2:Msvm_EthernetSwitchPortBandwidthSettingData";
strPath = string.Concat(strPath, string.Concat(".InstanceID=", string.Concat("\"", string.Concat(keyInstanceID, "\""))));
return strPath;
}
-
+
private void InitializeObject(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
Initialize();
if ((path != null)) {
@@ -558,24 +558,24 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
curObj = PrivateLateBoundObject;
}
-
+
// Different overloads of GetInstances() help in enumerating instances of the WMI class.
public static EthernetSwitchPortBandwidthSettingDataCollection GetInstances() {
return GetInstances(null, null, null);
}
-
+
public static EthernetSwitchPortBandwidthSettingDataCollection GetInstances(string condition) {
return GetInstances(null, condition, null);
}
-
+
public static EthernetSwitchPortBandwidthSettingDataCollection GetInstances(string[] selectedProperties) {
return GetInstances(null, null, selectedProperties);
}
-
+
public static EthernetSwitchPortBandwidthSettingDataCollection GetInstances(string condition, string[] selectedProperties) {
return GetInstances(null, condition, selectedProperties);
}
-
+
public static EthernetSwitchPortBandwidthSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, System.Management.EnumerationOptions enumOptions) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -596,15 +596,15 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return new EthernetSwitchPortBandwidthSettingDataCollection(clsObject.GetInstances(enumOptions));
}
-
+
public static EthernetSwitchPortBandwidthSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition) {
return GetInstances(mgmtScope, condition, null);
}
-
+
public static EthernetSwitchPortBandwidthSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string[] selectedProperties) {
return GetInstances(mgmtScope, null, selectedProperties);
}
-
+
public static EthernetSwitchPortBandwidthSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition, string[] selectedProperties) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -621,7 +621,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
ObjectSearcher.Options = enumOptions;
return new EthernetSwitchPortBandwidthSettingDataCollection(ObjectSearcher.Get());
}
-
+
[Browsable(true)]
public static EthernetSwitchPortBandwidthSettingData CreateInstance() {
System.Management.ManagementScope mgmtScope = null;
@@ -636,39 +636,39 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
System.Management.ManagementClass tmpMgmtClass = new System.Management.ManagementClass(mgmtScope, mgmtPath, null);
return new EthernetSwitchPortBandwidthSettingData(tmpMgmtClass.CreateInstance());
}
-
+
[Browsable(true)]
public void Delete() {
PrivateLateBoundObject.Delete();
}
-
+
// Enumerator implementation for enumerating instances of the class.
public class EthernetSwitchPortBandwidthSettingDataCollection : object, ICollection {
-
+
private ManagementObjectCollection privColObj;
-
+
public EthernetSwitchPortBandwidthSettingDataCollection(ManagementObjectCollection objCollection) {
privColObj = objCollection;
}
-
+
public virtual int Count {
get {
return privColObj.Count;
}
}
-
+
public virtual bool IsSynchronized {
get {
return privColObj.IsSynchronized;
}
}
-
+
public virtual object SyncRoot {
get {
return this;
}
}
-
+
public virtual void CopyTo(System.Array array, int index) {
privColObj.CopyTo(array, index);
int nCtr;
@@ -676,189 +676,189 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
array.SetValue(new EthernetSwitchPortBandwidthSettingData(((System.Management.ManagementObject)(array.GetValue(nCtr)))), nCtr);
}
}
-
+
public virtual System.Collections.IEnumerator GetEnumerator() {
return new EthernetSwitchPortBandwidthSettingDataEnumerator(privColObj.GetEnumerator());
}
-
+
public class EthernetSwitchPortBandwidthSettingDataEnumerator : object, System.Collections.IEnumerator {
-
+
private ManagementObjectCollection.ManagementObjectEnumerator privObjEnum;
-
+
public EthernetSwitchPortBandwidthSettingDataEnumerator(ManagementObjectCollection.ManagementObjectEnumerator objEnum) {
privObjEnum = objEnum;
}
-
+
public virtual object Current {
get {
return new EthernetSwitchPortBandwidthSettingData(((System.Management.ManagementObject)(privObjEnum.Current)));
}
}
-
+
public virtual bool MoveNext() {
return privObjEnum.MoveNext();
}
-
+
public virtual void Reset() {
privObjEnum.Reset();
}
}
}
-
+
// TypeConverter to handle null values for ValueType properties
public class WMIValueTypeConverter : TypeConverter {
-
+
private TypeConverter baseConverter;
-
+
private System.Type baseType;
-
+
public WMIValueTypeConverter(System.Type inBaseType) {
baseConverter = TypeDescriptor.GetConverter(inBaseType);
baseType = inBaseType;
}
-
+
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type srcType) {
return baseConverter.CanConvertFrom(context, srcType);
}
-
+
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) {
return baseConverter.CanConvertTo(context, destinationType);
}
-
+
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
return baseConverter.ConvertFrom(context, culture, value);
}
-
+
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary dictionary) {
return baseConverter.CreateInstance(context, dictionary);
}
-
+
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetCreateInstanceSupported(context);
}
-
+
public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributeVar) {
return baseConverter.GetProperties(context, value, attributeVar);
}
-
+
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetPropertiesSupported(context);
}
-
+
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValues(context);
}
-
+
public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesExclusive(context);
}
-
+
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesSupported(context);
}
-
+
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) {
if ((baseType.BaseType == typeof(System.Enum))) {
if ((value.GetType() == destinationType)) {
return value;
}
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "NULL_ENUM_VALUE" ;
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((baseType == typeof(bool))
+ if (((baseType == typeof(bool))
&& (baseType.BaseType == typeof(System.ValueType)))) {
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((context != null)
+ if (((context != null)
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
}
-
+
// Embedded class to represent WMI system Properties.
[TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class ManagementSystemProperties {
-
+
private System.Management.ManagementBaseObject PrivateLateBoundObject;
-
+
public ManagementSystemProperties(System.Management.ManagementBaseObject ManagedObject) {
PrivateLateBoundObject = ManagedObject;
}
-
+
[Browsable(true)]
public int GENUS {
get {
return ((int)(PrivateLateBoundObject["__GENUS"]));
}
}
-
+
[Browsable(true)]
public string CLASS {
get {
return ((string)(PrivateLateBoundObject["__CLASS"]));
}
}
-
+
[Browsable(true)]
public string SUPERCLASS {
get {
return ((string)(PrivateLateBoundObject["__SUPERCLASS"]));
}
}
-
+
[Browsable(true)]
public string DYNASTY {
get {
return ((string)(PrivateLateBoundObject["__DYNASTY"]));
}
}
-
+
[Browsable(true)]
public string RELPATH {
get {
return ((string)(PrivateLateBoundObject["__RELPATH"]));
}
}
-
+
[Browsable(true)]
public int PROPERTY_COUNT {
get {
return ((int)(PrivateLateBoundObject["__PROPERTY_COUNT"]));
}
}
-
+
[Browsable(true)]
public string[] DERIVATION {
get {
return ((string[])(PrivateLateBoundObject["__DERIVATION"]));
}
}
-
+
[Browsable(true)]
public string SERVER {
get {
return ((string)(PrivateLateBoundObject["__SERVER"]));
}
}
-
+
[Browsable(true)]
public string NAMESPACE {
get {
return ((string)(PrivateLateBoundObject["__NAMESPACE"]));
}
}
-
+
[Browsable(true)]
public string PATH {
get {
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetSwitchPortVlanSettingData.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetSwitchPortVlanSettingData.cs
index f95567cf954..e936f9e00dd 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetSwitchPortVlanSettingData.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_EthernetSwitchPortVlanSettingData.cs
@@ -23,70 +23,70 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
using System.Globalization;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
-
-
+
+
// Functions ShouldSerialize are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use IsNull function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
// Functions IsNull() are used to check if a property is NULL.
// Functions Reset are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
// Every property added to the class for WMI property has attributes set to define its behavior in Visual Studio designer and also to define a TypeConverter to be used.
// An Early Bound class generated for the WMI class.Msvm_EthernetSwitchPortVlanSettingData
public class EthernetSwitchPortVlanSettingData : System.ComponentModel.Component {
-
+
// Private property to hold the WMI namespace in which the class resides.
private static string CreatedWmiNamespace = "ROOT\\virtualization\\v2";
-
+
// Private property to hold the name of WMI class which created this class.
public static string CreatedClassName = "Msvm_EthernetSwitchPortVlanSettingData";
-
+
// Private member variable to hold the ManagementScope which is used by the various methods.
private static System.Management.ManagementScope statMgmtScope = null;
-
+
private ManagementSystemProperties PrivateSystemProperties;
-
+
// Underlying lateBound WMI object.
private System.Management.ManagementObject PrivateLateBoundObject;
-
+
// Member variable to store the 'automatic commit' behavior for the class.
private bool AutoCommitProp;
-
+
// Private variable to hold the embedded property representing the instance.
private System.Management.ManagementBaseObject embeddedObj;
-
+
// The current WMI object used
private System.Management.ManagementBaseObject curObj;
-
+
// Flag to indicate if the instance is an embedded object.
private bool isEmbedded;
-
+
// Below are different overloads of constructors to initialize an instance of the class with a WMI object.
public EthernetSwitchPortVlanSettingData() {
this.InitializeObject(null, null, null);
}
-
+
public EthernetSwitchPortVlanSettingData(string keyInstanceID) {
this.InitializeObject(null, new System.Management.ManagementPath(EthernetSwitchPortVlanSettingData.ConstructPath(keyInstanceID)), null);
}
-
+
public EthernetSwitchPortVlanSettingData(System.Management.ManagementScope mgmtScope, string keyInstanceID) {
this.InitializeObject(((System.Management.ManagementScope)(mgmtScope)), new System.Management.ManagementPath(EthernetSwitchPortVlanSettingData.ConstructPath(keyInstanceID)), null);
}
-
+
public EthernetSwitchPortVlanSettingData(System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(null, path, getOptions);
}
-
+
public EthernetSwitchPortVlanSettingData(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path) {
this.InitializeObject(mgmtScope, path, null);
}
-
+
public EthernetSwitchPortVlanSettingData(System.Management.ManagementPath path) {
this.InitializeObject(null, path, null);
}
-
+
public EthernetSwitchPortVlanSettingData(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(mgmtScope, path, getOptions);
}
-
+
public EthernetSwitchPortVlanSettingData(System.Management.ManagementObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -98,7 +98,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
public EthernetSwitchPortVlanSettingData(System.Management.ManagementBaseObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -111,7 +111,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
// Property returns the namespace of the WMI class.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -120,7 +120,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return "ROOT\\virtualization\\v2";
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ManagementClassName {
@@ -129,7 +129,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
if ((curObj != null)) {
if ((curObj.ClassPath != null)) {
strRet = ((string)(curObj["__CLASS"]));
- if (((strRet == null)
+ if (((strRet == null)
|| (strRet == string.Empty))) {
strRet = CreatedClassName;
}
@@ -138,7 +138,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return strRet;
}
}
-
+
// Property pointing to an embedded object to get System properties of the WMI object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -147,7 +147,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return PrivateSystemProperties;
}
}
-
+
// Property returning the underlying lateBound object.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -156,7 +156,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return curObj;
}
}
-
+
// ManagementScope of the object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -175,7 +175,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -187,7 +187,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
AutoCommitProp = value;
}
}
-
+
// The ManagementPath of the underlying WMI object.
[Browsable(true)]
public System.Management.ManagementPath Path {
@@ -208,7 +208,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Public static scope property which is used by the various methods.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -220,7 +220,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
statMgmtScope = value;
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsAccessVlanIdNull {
@@ -233,7 +233,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The vlan ID in access mode.")]
@@ -247,13 +247,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["AccessVlanId"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Caption {
@@ -261,7 +261,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Caption"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Description {
@@ -269,7 +269,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Description"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ElementName {
@@ -277,7 +277,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["ElementName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string InstanceID {
@@ -285,7 +285,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["InstanceID"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsNativeVlanIdNull {
@@ -298,7 +298,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The vlan ID in trunk mode.")]
@@ -312,13 +312,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["NativeVlanId"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsOperationModeNull {
@@ -331,7 +331,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The vlan operation modes.")]
@@ -350,13 +350,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
else {
curObj["OperationMode"] = value;
}
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPrimaryVlanIdNull {
@@ -369,7 +369,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The primary vlan ID in private mode.")]
@@ -383,13 +383,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["PrimaryVlanId"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The prune vlan ID bitmap in trunk mode.")]
@@ -399,13 +399,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["PruneVlanIdArray"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPvlanModeNull {
@@ -418,7 +418,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The private vlan modes.")]
@@ -437,13 +437,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
else {
curObj["PvlanMode"] = value;
}
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsSecondaryVlanIdNull {
@@ -456,7 +456,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The secondary vlan ID in private mode.")]
@@ -470,13 +470,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["SecondaryVlanId"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The secondary vlan ID bitmap in private mode.")]
@@ -486,13 +486,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["SecondaryVlanIdArray"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("The trunk vlan ID bitmap in trunk mode.")]
@@ -502,15 +502,15 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
set {
curObj["TrunkVlanIdArray"] = value;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions OptionsParam) {
- if (((path != null)
+ if (((path != null)
&& (string.Compare(path.ClassName, this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -518,9 +518,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return CheckIfProperClass(new System.Management.ManagementObject(mgmtScope, path, OptionsParam));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementBaseObject theObj) {
- if (((theObj != null)
+ if (((theObj != null)
&& (string.Compare(((string)(theObj["__CLASS"])), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -537,146 +537,146 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return false;
}
-
+
private bool ShouldSerializeAccessVlanId() {
if ((this.IsAccessVlanIdNull == false)) {
return true;
}
return false;
}
-
+
private void ResetAccessVlanId() {
curObj["AccessVlanId"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private bool ShouldSerializeNativeVlanId() {
if ((this.IsNativeVlanIdNull == false)) {
return true;
}
return false;
}
-
+
private void ResetNativeVlanId() {
curObj["NativeVlanId"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private bool ShouldSerializeOperationMode() {
if ((this.IsOperationModeNull == false)) {
return true;
}
return false;
}
-
+
private void ResetOperationMode() {
curObj["OperationMode"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private bool ShouldSerializePrimaryVlanId() {
if ((this.IsPrimaryVlanIdNull == false)) {
return true;
}
return false;
}
-
+
private void ResetPrimaryVlanId() {
curObj["PrimaryVlanId"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private void ResetPruneVlanIdArray() {
curObj["PruneVlanIdArray"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private bool ShouldSerializePvlanMode() {
if ((this.IsPvlanModeNull == false)) {
return true;
}
return false;
}
-
+
private void ResetPvlanMode() {
curObj["PvlanMode"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private bool ShouldSerializeSecondaryVlanId() {
if ((this.IsSecondaryVlanIdNull == false)) {
return true;
}
return false;
}
-
+
private void ResetSecondaryVlanId() {
curObj["SecondaryVlanId"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private void ResetSecondaryVlanIdArray() {
curObj["SecondaryVlanIdArray"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
private void ResetTrunkVlanIdArray() {
curObj["TrunkVlanIdArray"] = null;
- if (((isEmbedded == false)
+ if (((isEmbedded == false)
&& (AutoCommitProp == true))) {
PrivateLateBoundObject.Put();
}
}
-
+
[Browsable(true)]
public void CommitObject() {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put();
}
}
-
+
[Browsable(true)]
public void CommitObject(System.Management.PutOptions putOptions) {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put(putOptions);
}
}
-
+
private void Initialize() {
AutoCommitProp = true;
isEmbedded = false;
}
-
+
private static string ConstructPath(string keyInstanceID) {
string strPath = "ROOT\\virtualization\\v2:Msvm_EthernetSwitchPortVlanSettingData";
strPath = string.Concat(strPath, string.Concat(".InstanceID=", string.Concat("\"", string.Concat(keyInstanceID, "\""))));
return strPath;
}
-
+
private void InitializeObject(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
Initialize();
if ((path != null)) {
@@ -688,24 +688,24 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
curObj = PrivateLateBoundObject;
}
-
+
// Different overloads of GetInstances() help in enumerating instances of the WMI class.
public static EthernetSwitchPortVlanSettingDataCollection GetInstances() {
return GetInstances(null, null, null);
}
-
+
public static EthernetSwitchPortVlanSettingDataCollection GetInstances(string condition) {
return GetInstances(null, condition, null);
}
-
+
public static EthernetSwitchPortVlanSettingDataCollection GetInstances(string[] selectedProperties) {
return GetInstances(null, null, selectedProperties);
}
-
+
public static EthernetSwitchPortVlanSettingDataCollection GetInstances(string condition, string[] selectedProperties) {
return GetInstances(null, condition, selectedProperties);
}
-
+
public static EthernetSwitchPortVlanSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, System.Management.EnumerationOptions enumOptions) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -726,15 +726,15 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return new EthernetSwitchPortVlanSettingDataCollection(clsObject.GetInstances(enumOptions));
}
-
+
public static EthernetSwitchPortVlanSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition) {
return GetInstances(mgmtScope, condition, null);
}
-
+
public static EthernetSwitchPortVlanSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string[] selectedProperties) {
return GetInstances(mgmtScope, null, selectedProperties);
}
-
+
public static EthernetSwitchPortVlanSettingDataCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition, string[] selectedProperties) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -751,7 +751,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
ObjectSearcher.Options = enumOptions;
return new EthernetSwitchPortVlanSettingDataCollection(ObjectSearcher.Get());
}
-
+
[Browsable(true)]
public static EthernetSwitchPortVlanSettingData CreateInstance() {
System.Management.ManagementScope mgmtScope = null;
@@ -766,61 +766,61 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
System.Management.ManagementClass tmpMgmtClass = new System.Management.ManagementClass(mgmtScope, mgmtPath, null);
return new EthernetSwitchPortVlanSettingData(tmpMgmtClass.CreateInstance());
}
-
+
[Browsable(true)]
public void Delete() {
PrivateLateBoundObject.Delete();
}
-
+
public enum OperationModeValues {
-
+
Access = 1,
-
+
Trunk = 2,
-
+
Private = 3,
-
+
NULL_ENUM_VALUE = 0,
}
-
+
public enum PvlanModeValues {
-
+
Isolated = 1,
-
+
Community = 2,
-
+
Promiscuous = 3,
-
+
NULL_ENUM_VALUE = 0,
}
-
+
// Enumerator implementation for enumerating instances of the class.
public class EthernetSwitchPortVlanSettingDataCollection : object, ICollection {
-
+
private ManagementObjectCollection privColObj;
-
+
public EthernetSwitchPortVlanSettingDataCollection(ManagementObjectCollection objCollection) {
privColObj = objCollection;
}
-
+
public virtual int Count {
get {
return privColObj.Count;
}
}
-
+
public virtual bool IsSynchronized {
get {
return privColObj.IsSynchronized;
}
}
-
+
public virtual object SyncRoot {
get {
return this;
}
}
-
+
public virtual void CopyTo(System.Array array, int index) {
privColObj.CopyTo(array, index);
int nCtr;
@@ -828,189 +828,189 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
array.SetValue(new EthernetSwitchPortVlanSettingData(((System.Management.ManagementObject)(array.GetValue(nCtr)))), nCtr);
}
}
-
+
public virtual System.Collections.IEnumerator GetEnumerator() {
return new EthernetSwitchPortVlanSettingDataEnumerator(privColObj.GetEnumerator());
}
-
+
public class EthernetSwitchPortVlanSettingDataEnumerator : object, System.Collections.IEnumerator {
-
+
private ManagementObjectCollection.ManagementObjectEnumerator privObjEnum;
-
+
public EthernetSwitchPortVlanSettingDataEnumerator(ManagementObjectCollection.ManagementObjectEnumerator objEnum) {
privObjEnum = objEnum;
}
-
+
public virtual object Current {
get {
return new EthernetSwitchPortVlanSettingData(((System.Management.ManagementObject)(privObjEnum.Current)));
}
}
-
+
public virtual bool MoveNext() {
return privObjEnum.MoveNext();
}
-
+
public virtual void Reset() {
privObjEnum.Reset();
}
}
}
-
+
// TypeConverter to handle null values for ValueType properties
public class WMIValueTypeConverter : TypeConverter {
-
+
private TypeConverter baseConverter;
-
+
private System.Type baseType;
-
+
public WMIValueTypeConverter(System.Type inBaseType) {
baseConverter = TypeDescriptor.GetConverter(inBaseType);
baseType = inBaseType;
}
-
+
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type srcType) {
return baseConverter.CanConvertFrom(context, srcType);
}
-
+
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) {
return baseConverter.CanConvertTo(context, destinationType);
}
-
+
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
return baseConverter.ConvertFrom(context, culture, value);
}
-
+
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary dictionary) {
return baseConverter.CreateInstance(context, dictionary);
}
-
+
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetCreateInstanceSupported(context);
}
-
+
public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributeVar) {
return baseConverter.GetProperties(context, value, attributeVar);
}
-
+
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetPropertiesSupported(context);
}
-
+
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValues(context);
}
-
+
public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesExclusive(context);
}
-
+
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesSupported(context);
}
-
+
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) {
if ((baseType.BaseType == typeof(System.Enum))) {
if ((value.GetType() == destinationType)) {
return value;
}
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "NULL_ENUM_VALUE" ;
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((baseType == typeof(bool))
+ if (((baseType == typeof(bool))
&& (baseType.BaseType == typeof(System.ValueType)))) {
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((context != null)
+ if (((context != null)
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
}
-
+
// Embedded class to represent WMI system Properties.
[TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class ManagementSystemProperties {
-
+
private System.Management.ManagementBaseObject PrivateLateBoundObject;
-
+
public ManagementSystemProperties(System.Management.ManagementBaseObject ManagedObject) {
PrivateLateBoundObject = ManagedObject;
}
-
+
[Browsable(true)]
public int GENUS {
get {
return ((int)(PrivateLateBoundObject["__GENUS"]));
}
}
-
+
[Browsable(true)]
public string CLASS {
get {
return ((string)(PrivateLateBoundObject["__CLASS"]));
}
}
-
+
[Browsable(true)]
public string SUPERCLASS {
get {
return ((string)(PrivateLateBoundObject["__SUPERCLASS"]));
}
}
-
+
[Browsable(true)]
public string DYNASTY {
get {
return ((string)(PrivateLateBoundObject["__DYNASTY"]));
}
}
-
+
[Browsable(true)]
public string RELPATH {
get {
return ((string)(PrivateLateBoundObject["__RELPATH"]));
}
}
-
+
[Browsable(true)]
public int PROPERTY_COUNT {
get {
return ((int)(PrivateLateBoundObject["__PROPERTY_COUNT"]));
}
}
-
+
[Browsable(true)]
public string[] DERIVATION {
get {
return ((string[])(PrivateLateBoundObject["__DERIVATION"]));
}
}
-
+
[Browsable(true)]
public string SERVER {
get {
return ((string)(PrivateLateBoundObject["__SERVER"]));
}
}
-
+
[Browsable(true)]
public string NAMESPACE {
get {
return ((string)(PrivateLateBoundObject["__NAMESPACE"]));
}
}
-
+
[Browsable(true)]
public string PATH {
get {
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ExternalEthernetPort.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ExternalEthernetPort.cs
index 1b6828621d0..e4b2fda9d48 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ExternalEthernetPort.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ExternalEthernetPort.cs
@@ -23,8 +23,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
using System.Globalization;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
-
-
+
+
// Functions ShouldSerialize are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use IsNull function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
// Functions IsNull() are used to check if a property is NULL.
// Functions Reset are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
@@ -32,62 +32,62 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
// Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
// An Early Bound class generated for the WMI class.Msvm_ExternalEthernetPort
public class ExternalEthernetPort : System.ComponentModel.Component {
-
+
// Private property to hold the WMI namespace in which the class resides.
private static string CreatedWmiNamespace = "ROOT\\virtualization\\v2";
-
+
// Private property to hold the name of WMI class which created this class.
private static string CreatedClassName = "Msvm_ExternalEthernetPort";
-
+
// Private member variable to hold the ManagementScope which is used by the various methods.
private static System.Management.ManagementScope statMgmtScope = null;
-
+
private ManagementSystemProperties PrivateSystemProperties;
-
+
// Underlying lateBound WMI object.
private System.Management.ManagementObject PrivateLateBoundObject;
-
+
// Member variable to store the 'automatic commit' behavior for the class.
private bool AutoCommitProp;
-
+
// Private variable to hold the embedded property representing the instance.
private System.Management.ManagementBaseObject embeddedObj;
-
+
// The current WMI object used
private System.Management.ManagementBaseObject curObj;
-
+
// Flag to indicate if the instance is an embedded object.
private bool isEmbedded;
-
+
// Below are different overloads of constructors to initialize an instance of the class with a WMI object.
public ExternalEthernetPort() {
this.InitializeObject(null, null, null);
}
-
+
public ExternalEthernetPort(string keyCreationClassName, string keyDeviceID, string keySystemCreationClassName, string keySystemName) {
this.InitializeObject(null, new System.Management.ManagementPath(ExternalEthernetPort.ConstructPath(keyCreationClassName, keyDeviceID, keySystemCreationClassName, keySystemName)), null);
}
-
+
public ExternalEthernetPort(System.Management.ManagementScope mgmtScope, string keyCreationClassName, string keyDeviceID, string keySystemCreationClassName, string keySystemName) {
this.InitializeObject(((System.Management.ManagementScope)(mgmtScope)), new System.Management.ManagementPath(ExternalEthernetPort.ConstructPath(keyCreationClassName, keyDeviceID, keySystemCreationClassName, keySystemName)), null);
}
-
+
public ExternalEthernetPort(System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(null, path, getOptions);
}
-
+
public ExternalEthernetPort(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path) {
this.InitializeObject(mgmtScope, path, null);
}
-
+
public ExternalEthernetPort(System.Management.ManagementPath path) {
this.InitializeObject(null, path, null);
}
-
+
public ExternalEthernetPort(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(mgmtScope, path, getOptions);
}
-
+
public ExternalEthernetPort(System.Management.ManagementObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -99,7 +99,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
public ExternalEthernetPort(System.Management.ManagementBaseObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -112,7 +112,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
// Property returns the namespace of the WMI class.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -121,7 +121,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return "ROOT\\virtualization\\v2";
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ManagementClassName {
@@ -130,7 +130,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
if ((curObj != null)) {
if ((curObj.ClassPath != null)) {
strRet = ((string)(curObj["__CLASS"]));
- if (((strRet == null)
+ if (((strRet == null)
|| (strRet == string.Empty))) {
strRet = CreatedClassName;
}
@@ -139,7 +139,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return strRet;
}
}
-
+
// Property pointing to an embedded object to get System properties of the WMI object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -148,7 +148,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return PrivateSystemProperties;
}
}
-
+
// Property returning the underlying lateBound object.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -157,7 +157,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return curObj;
}
}
-
+
// ManagementScope of the object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -176,7 +176,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -188,7 +188,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
AutoCommitProp = value;
}
}
-
+
// The ManagementPath of the underlying WMI object.
[Browsable(true)]
public System.Management.ManagementPath Path {
@@ -209,7 +209,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Public static scope property which is used by the various methods.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -221,7 +221,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
statMgmtScope = value;
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsActiveMaximumTransmissionUnitNull {
@@ -234,7 +234,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -246,7 +246,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["ActiveMaximumTransmissionUnit"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] AdditionalAvailability {
@@ -254,7 +254,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["AdditionalAvailability"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsAutoSenseNull {
@@ -267,7 +267,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -279,7 +279,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["AutoSense"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsAvailabilityNull {
@@ -292,7 +292,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -304,7 +304,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["Availability"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] AvailableRequestedStates {
@@ -312,7 +312,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["AvailableRequestedStates"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] Capabilities {
@@ -320,7 +320,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["Capabilities"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] CapabilityDescriptions {
@@ -328,7 +328,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["CapabilityDescriptions"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Caption {
@@ -336,7 +336,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Caption"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsCommunicationStatusNull {
@@ -349,7 +349,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -361,7 +361,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["CommunicationStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string CreationClassName {
@@ -369,7 +369,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["CreationClassName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Description {
@@ -377,7 +377,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Description"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDetailedStatusNull {
@@ -390,7 +390,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -402,7 +402,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["DetailedStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string DeviceID {
@@ -410,7 +410,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["DeviceID"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ElementName {
@@ -418,7 +418,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["ElementName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] EnabledCapabilities {
@@ -426,7 +426,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["EnabledCapabilities"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsEnabledDefaultNull {
@@ -439,7 +439,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -451,7 +451,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["EnabledDefault"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsEnabledStateNull {
@@ -464,7 +464,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -476,7 +476,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["EnabledState"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsErrorClearedNull {
@@ -489,7 +489,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -501,7 +501,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["ErrorCleared"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ErrorDescription {
@@ -509,7 +509,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["ErrorDescription"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsFullDuplexNull {
@@ -522,7 +522,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -534,7 +534,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["FullDuplex"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsHealthStateNull {
@@ -547,7 +547,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -559,7 +559,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["HealthState"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] IdentifyingDescriptions {
@@ -567,7 +567,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["IdentifyingDescriptions"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsInstallDateNull {
@@ -580,7 +580,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -594,7 +594,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string InstanceID {
@@ -602,7 +602,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["InstanceID"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsIsBoundNull {
@@ -615,7 +615,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[Description("If this property is true, then this Ethernet port can be connected to the switche" +
@@ -631,7 +631,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["IsBound"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLastErrorCodeNull {
@@ -644,7 +644,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -656,7 +656,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((uint)(curObj["LastErrorCode"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsLinkTechnologyNull {
@@ -669,7 +669,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -681,7 +681,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["LinkTechnology"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsMaxDataSizeNull {
@@ -694,7 +694,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -706,7 +706,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((uint)(curObj["MaxDataSize"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsMaxQuiesceTimeNull {
@@ -719,7 +719,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -731,7 +731,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["MaxQuiesceTime"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsMaxSpeedNull {
@@ -744,7 +744,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -756,7 +756,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["MaxSpeed"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Name {
@@ -764,7 +764,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Name"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] NetworkAddresses {
@@ -772,7 +772,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["NetworkAddresses"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsOperatingStatusNull {
@@ -785,7 +785,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -797,7 +797,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["OperatingStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] OperationalStatus {
@@ -805,7 +805,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["OperationalStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] OtherEnabledCapabilities {
@@ -813,7 +813,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["OtherEnabledCapabilities"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OtherEnabledState {
@@ -821,7 +821,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["OtherEnabledState"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] OtherIdentifyingInfo {
@@ -829,7 +829,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["OtherIdentifyingInfo"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OtherLinkTechnology {
@@ -837,7 +837,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["OtherLinkTechnology"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OtherNetworkPortType {
@@ -845,7 +845,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["OtherNetworkPortType"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OtherPortType {
@@ -853,7 +853,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["OtherPortType"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string PermanentAddress {
@@ -861,7 +861,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["PermanentAddress"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPortNumberNull {
@@ -874,7 +874,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -886,7 +886,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["PortNumber"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPortTypeNull {
@@ -899,7 +899,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -911,7 +911,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["PortType"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] PowerManagementCapabilities {
@@ -919,7 +919,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["PowerManagementCapabilities"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPowerManagementSupportedNull {
@@ -932,7 +932,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -944,7 +944,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["PowerManagementSupported"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPowerOnHoursNull {
@@ -957,7 +957,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -969,7 +969,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["PowerOnHours"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPrimaryStatusNull {
@@ -982,7 +982,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -994,7 +994,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["PrimaryStatus"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsRequestedSpeedNull {
@@ -1007,7 +1007,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1019,7 +1019,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["RequestedSpeed"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsRequestedStateNull {
@@ -1032,7 +1032,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1044,7 +1044,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["RequestedState"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsSpeedNull {
@@ -1057,7 +1057,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1069,7 +1069,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["Speed"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Status {
@@ -1077,7 +1077,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Status"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] StatusDescriptions {
@@ -1085,7 +1085,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["StatusDescriptions"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsStatusInfoNull {
@@ -1098,7 +1098,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1110,7 +1110,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["StatusInfo"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsSupportedMaximumTransmissionUnitNull {
@@ -1123,7 +1123,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1135,7 +1135,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["SupportedMaximumTransmissionUnit"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string SystemCreationClassName {
@@ -1143,7 +1143,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["SystemCreationClassName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string SystemName {
@@ -1151,7 +1151,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["SystemName"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTimeOfLastStateChangeNull {
@@ -1164,7 +1164,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1178,7 +1178,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTotalPowerOnHoursNull {
@@ -1191,7 +1191,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1203,7 +1203,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ulong)(curObj["TotalPowerOnHours"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTransitioningToStateNull {
@@ -1216,7 +1216,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1228,7 +1228,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["TransitioningToState"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsUsageRestrictionNull {
@@ -1241,7 +1241,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -1253,9 +1253,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["UsageRestriction"]));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions OptionsParam) {
- if (((path != null)
+ if (((path != null)
&& (string.Compare(path.ClassName, this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -1263,9 +1263,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return CheckIfProperClass(new System.Management.ManagementObject(mgmtScope, path, OptionsParam));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementBaseObject theObj) {
- if (((theObj != null)
+ if (((theObj != null)
&& (string.Compare(((string)(theObj["__CLASS"])), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -1282,77 +1282,77 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return false;
}
-
+
private bool ShouldSerializeActiveMaximumTransmissionUnit() {
if ((this.IsActiveMaximumTransmissionUnitNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeAutoSense() {
if ((this.IsAutoSenseNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeAvailability() {
if ((this.IsAvailabilityNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeCommunicationStatus() {
if ((this.IsCommunicationStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeDetailedStatus() {
if ((this.IsDetailedStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeEnabledDefault() {
if ((this.IsEnabledDefaultNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeEnabledState() {
if ((this.IsEnabledStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeErrorCleared() {
if ((this.IsErrorClearedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeFullDuplex() {
if ((this.IsFullDuplexNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeHealthState() {
if ((this.IsHealthStateNull == false)) {
return true;
}
return false;
}
-
+
// Converts a given datetime in DMTF format to System.DateTime object.
static System.DateTime ToDateTime(string dmtfDate) {
System.DateTime initializer = System.DateTime.MinValue;
@@ -1404,13 +1404,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
if (("******" != tempString)) {
ticks = (long.Parse(tempString) * ((long)((System.TimeSpan.TicksPerMillisecond / 1000))));
}
- if (((((((((year < 0)
- || (month < 0))
- || (day < 0))
- || (hour < 0))
- || (minute < 0))
- || (minute < 0))
- || (second < 0))
+ if (((((((((year < 0)
+ || (month < 0))
+ || (day < 0))
+ || (hour < 0))
+ || (minute < 0))
+ || (minute < 0))
+ || (second < 0))
|| (ticks < 0))) {
throw new System.ArgumentOutOfRangeException();
}
@@ -1438,7 +1438,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return datetime;
}
-
+
// Converts a given System.DateTime object to DMTF datetime format.
static string ToDmtfDateTime(System.DateTime date) {
string utcString = string.Empty;
@@ -1465,8 +1465,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
dmtfDateTime = string.Concat(dmtfDateTime, ((int)(date.Second)).ToString().PadLeft(2, '0'));
dmtfDateTime = string.Concat(dmtfDateTime, ".");
System.DateTime dtTemp = new System.DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, 0);
- long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
- * 1000)
+ long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
+ * 1000)
/ System.TimeSpan.TicksPerMillisecond)));
string strMicrosec = ((long)(microsec)).ToString();
if ((strMicrosec.Length > 6)) {
@@ -1476,180 +1476,180 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
dmtfDateTime = string.Concat(dmtfDateTime, utcString);
return dmtfDateTime;
}
-
+
private bool ShouldSerializeInstallDate() {
if ((this.IsInstallDateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeIsBound() {
if ((this.IsIsBoundNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLastErrorCode() {
if ((this.IsLastErrorCodeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeLinkTechnology() {
if ((this.IsLinkTechnologyNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeMaxDataSize() {
if ((this.IsMaxDataSizeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeMaxQuiesceTime() {
if ((this.IsMaxQuiesceTimeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeMaxSpeed() {
if ((this.IsMaxSpeedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeOperatingStatus() {
if ((this.IsOperatingStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePortNumber() {
if ((this.IsPortNumberNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePortType() {
if ((this.IsPortTypeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePowerManagementSupported() {
if ((this.IsPowerManagementSupportedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePowerOnHours() {
if ((this.IsPowerOnHoursNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePrimaryStatus() {
if ((this.IsPrimaryStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeRequestedSpeed() {
if ((this.IsRequestedSpeedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeRequestedState() {
if ((this.IsRequestedStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeSpeed() {
if ((this.IsSpeedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeStatusInfo() {
if ((this.IsStatusInfoNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeSupportedMaximumTransmissionUnit() {
if ((this.IsSupportedMaximumTransmissionUnitNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTimeOfLastStateChange() {
if ((this.IsTimeOfLastStateChangeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTotalPowerOnHours() {
if ((this.IsTotalPowerOnHoursNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTransitioningToState() {
if ((this.IsTransitioningToStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeUsageRestriction() {
if ((this.IsUsageRestrictionNull == false)) {
return true;
}
return false;
}
-
+
[Browsable(true)]
public void CommitObject() {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put();
}
}
-
+
[Browsable(true)]
public void CommitObject(System.Management.PutOptions putOptions) {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put(putOptions);
}
}
-
+
private void Initialize() {
AutoCommitProp = true;
isEmbedded = false;
}
-
+
private static string ConstructPath(string keyCreationClassName, string keyDeviceID, string keySystemCreationClassName, string keySystemName) {
string strPath = "ROOT\\virtualization\\v2:Msvm_ExternalEthernetPort";
strPath = string.Concat(strPath, string.Concat(".CreationClassName=", string.Concat("\"", string.Concat(keyCreationClassName, "\""))));
@@ -1658,7 +1658,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
strPath = string.Concat(strPath, string.Concat(",SystemName=", string.Concat("\"", string.Concat(keySystemName, "\""))));
return strPath;
}
-
+
private void InitializeObject(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
Initialize();
if ((path != null)) {
@@ -1670,24 +1670,24 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
curObj = PrivateLateBoundObject;
}
-
+
// Different overloads of GetInstances() help in enumerating instances of the WMI class.
public static ExternalEthernetPortCollection GetInstances() {
return GetInstances(null, null, null);
}
-
+
public static ExternalEthernetPortCollection GetInstances(string condition) {
return GetInstances(null, condition, null);
}
-
+
public static ExternalEthernetPortCollection GetInstances(string[] selectedProperties) {
return GetInstances(null, null, selectedProperties);
}
-
+
public static ExternalEthernetPortCollection GetInstances(string condition, string[] selectedProperties) {
return GetInstances(null, condition, selectedProperties);
}
-
+
public static ExternalEthernetPortCollection GetInstances(System.Management.ManagementScope mgmtScope, System.Management.EnumerationOptions enumOptions) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -1708,15 +1708,15 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return new ExternalEthernetPortCollection(clsObject.GetInstances(enumOptions));
}
-
+
public static ExternalEthernetPortCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition) {
return GetInstances(mgmtScope, condition, null);
}
-
+
public static ExternalEthernetPortCollection GetInstances(System.Management.ManagementScope mgmtScope, string[] selectedProperties) {
return GetInstances(mgmtScope, null, selectedProperties);
}
-
+
public static ExternalEthernetPortCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition, string[] selectedProperties) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -1733,7 +1733,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
ObjectSearcher.Options = enumOptions;
return new ExternalEthernetPortCollection(ObjectSearcher.Get());
}
-
+
[Browsable(true)]
public static ExternalEthernetPort CreateInstance() {
System.Management.ManagementScope mgmtScope = null;
@@ -1748,12 +1748,12 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
System.Management.ManagementClass tmpMgmtClass = new System.Management.ManagementClass(mgmtScope, mgmtPath, null);
return new ExternalEthernetPort(tmpMgmtClass.CreateInstance());
}
-
+
[Browsable(true)]
public void Delete() {
PrivateLateBoundObject.Delete();
}
-
+
public uint EnableDevice(bool Enabled) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1766,7 +1766,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint OnlineDevice(bool Online) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1779,7 +1779,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint QuiesceDevice(bool Quiesce) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1792,7 +1792,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint RequestStateChange(ushort RequestedState, System.DateTime TimeoutPeriod, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1811,7 +1811,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint Reset() {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1822,7 +1822,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint RestoreProperties() {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1833,7 +1833,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint SaveProperties() {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1844,7 +1844,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint SetPowerState(ushort PowerState, System.DateTime Time) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1858,34 +1858,34 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
// Enumerator implementation for enumerating instances of the class.
public class ExternalEthernetPortCollection : object, ICollection {
-
+
private ManagementObjectCollection privColObj;
-
+
public ExternalEthernetPortCollection(ManagementObjectCollection objCollection) {
privColObj = objCollection;
}
-
+
public virtual int Count {
get {
return privColObj.Count;
}
}
-
+
public virtual bool IsSynchronized {
get {
return privColObj.IsSynchronized;
}
}
-
+
public virtual object SyncRoot {
get {
return this;
}
}
-
+
public virtual void CopyTo(System.Array array, int index) {
privColObj.CopyTo(array, index);
int nCtr;
@@ -1893,189 +1893,189 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
array.SetValue(new ExternalEthernetPort(((System.Management.ManagementObject)(array.GetValue(nCtr)))), nCtr);
}
}
-
+
public virtual System.Collections.IEnumerator GetEnumerator() {
return new ExternalEthernetPortEnumerator(privColObj.GetEnumerator());
}
-
+
public class ExternalEthernetPortEnumerator : object, System.Collections.IEnumerator {
-
+
private ManagementObjectCollection.ManagementObjectEnumerator privObjEnum;
-
+
public ExternalEthernetPortEnumerator(ManagementObjectCollection.ManagementObjectEnumerator objEnum) {
privObjEnum = objEnum;
}
-
+
public virtual object Current {
get {
return new ExternalEthernetPort(((System.Management.ManagementObject)(privObjEnum.Current)));
}
}
-
+
public virtual bool MoveNext() {
return privObjEnum.MoveNext();
}
-
+
public virtual void Reset() {
privObjEnum.Reset();
}
}
}
-
+
// TypeConverter to handle null values for ValueType properties
public class WMIValueTypeConverter : TypeConverter {
-
+
private TypeConverter baseConverter;
-
+
private System.Type baseType;
-
+
public WMIValueTypeConverter(System.Type inBaseType) {
baseConverter = TypeDescriptor.GetConverter(inBaseType);
baseType = inBaseType;
}
-
+
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type srcType) {
return baseConverter.CanConvertFrom(context, srcType);
}
-
+
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) {
return baseConverter.CanConvertTo(context, destinationType);
}
-
+
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
return baseConverter.ConvertFrom(context, culture, value);
}
-
+
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary dictionary) {
return baseConverter.CreateInstance(context, dictionary);
}
-
+
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetCreateInstanceSupported(context);
}
-
+
public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributeVar) {
return baseConverter.GetProperties(context, value, attributeVar);
}
-
+
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetPropertiesSupported(context);
}
-
+
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValues(context);
}
-
+
public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesExclusive(context);
}
-
+
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesSupported(context);
}
-
+
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) {
if ((baseType.BaseType == typeof(System.Enum))) {
if ((value.GetType() == destinationType)) {
return value;
}
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "NULL_ENUM_VALUE" ;
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((baseType == typeof(bool))
+ if (((baseType == typeof(bool))
&& (baseType.BaseType == typeof(System.ValueType)))) {
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((context != null)
+ if (((context != null)
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
}
-
+
// Embedded class to represent WMI system Properties.
[TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class ManagementSystemProperties {
-
+
private System.Management.ManagementBaseObject PrivateLateBoundObject;
-
+
public ManagementSystemProperties(System.Management.ManagementBaseObject ManagedObject) {
PrivateLateBoundObject = ManagedObject;
}
-
+
[Browsable(true)]
public int GENUS {
get {
return ((int)(PrivateLateBoundObject["__GENUS"]));
}
}
-
+
[Browsable(true)]
public string CLASS {
get {
return ((string)(PrivateLateBoundObject["__CLASS"]));
}
}
-
+
[Browsable(true)]
public string SUPERCLASS {
get {
return ((string)(PrivateLateBoundObject["__SUPERCLASS"]));
}
}
-
+
[Browsable(true)]
public string DYNASTY {
get {
return ((string)(PrivateLateBoundObject["__DYNASTY"]));
}
}
-
+
[Browsable(true)]
public string RELPATH {
get {
return ((string)(PrivateLateBoundObject["__RELPATH"]));
}
}
-
+
[Browsable(true)]
public int PROPERTY_COUNT {
get {
return ((int)(PrivateLateBoundObject["__PROPERTY_COUNT"]));
}
}
-
+
[Browsable(true)]
public string[] DERIVATION {
get {
return ((string[])(PrivateLateBoundObject["__DERIVATION"]));
}
}
-
+
[Browsable(true)]
public string SERVER {
get {
return ((string)(PrivateLateBoundObject["__SERVER"]));
}
}
-
+
[Browsable(true)]
public string NAMESPACE {
get {
return ((string)(PrivateLateBoundObject["__NAMESPACE"]));
}
}
-
+
[Browsable(true)]
public string PATH {
get {
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ImageManagementService.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ImageManagementService.cs
index 1ebbeb00f91..5b3b781748b 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ImageManagementService.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_ImageManagementService.cs
@@ -23,8 +23,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
using System.Globalization;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
-
-
+
+
// Functions ShouldSerialize are functions used by VS property browser to check if a particular property has to be serialized. These functions are added for all ValueType properties ( properties of type Int32, BOOL etc.. which cannot be set to null). These functions use IsNull function. These functions are also used in the TypeConverter implementation for the properties to check for NULL value of property so that an empty value can be shown in Property browser in case of Drag and Drop in Visual studio.
// Functions IsNull() are used to check if a property is NULL.
// Functions Reset are added for Nullable Read/Write properties. These functions are used by VS designer in property browser to set a property to NULL.
@@ -32,62 +32,62 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
// Datetime conversion functions ToDateTime and ToDmtfDateTime are added to the class to convert DMTF datetime to System.DateTime and vice-versa.
// An Early Bound class generated for the WMI class.Msvm_ImageManagementService
public class ImageManagementService : System.ComponentModel.Component {
-
+
// Private property to hold the WMI namespace in which the class resides.
private static string CreatedWmiNamespace = "ROOT\\virtualization\\v2";
-
+
// Private property to hold the name of WMI class which created this class.
private static string CreatedClassName = "Msvm_ImageManagementService";
-
+
// Private member variable to hold the ManagementScope which is used by the various methods.
private static System.Management.ManagementScope statMgmtScope = null;
-
+
private ManagementSystemProperties PrivateSystemProperties;
-
+
// Underlying lateBound WMI object.
private System.Management.ManagementObject PrivateLateBoundObject;
-
+
// Member variable to store the 'automatic commit' behavior for the class.
private bool AutoCommitProp;
-
+
// Private variable to hold the embedded property representing the instance.
private System.Management.ManagementBaseObject embeddedObj;
-
+
// The current WMI object used
private System.Management.ManagementBaseObject curObj;
-
+
// Flag to indicate if the instance is an embedded object.
private bool isEmbedded;
-
+
// Below are different overloads of constructors to initialize an instance of the class with a WMI object.
public ImageManagementService() {
this.InitializeObject(null, null, null);
}
-
+
public ImageManagementService(string keyCreationClassName, string keyName, string keySystemCreationClassName, string keySystemName) {
this.InitializeObject(null, new System.Management.ManagementPath(ImageManagementService.ConstructPath(keyCreationClassName, keyName, keySystemCreationClassName, keySystemName)), null);
}
-
+
public ImageManagementService(System.Management.ManagementScope mgmtScope, string keyCreationClassName, string keyName, string keySystemCreationClassName, string keySystemName) {
this.InitializeObject(((System.Management.ManagementScope)(mgmtScope)), new System.Management.ManagementPath(ImageManagementService.ConstructPath(keyCreationClassName, keyName, keySystemCreationClassName, keySystemName)), null);
}
-
+
public ImageManagementService(System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(null, path, getOptions);
}
-
+
public ImageManagementService(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path) {
this.InitializeObject(mgmtScope, path, null);
}
-
+
public ImageManagementService(System.Management.ManagementPath path) {
this.InitializeObject(null, path, null);
}
-
+
public ImageManagementService(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
this.InitializeObject(mgmtScope, path, getOptions);
}
-
+
public ImageManagementService(System.Management.ManagementObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -99,7 +99,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
public ImageManagementService(System.Management.ManagementBaseObject theObject) {
Initialize();
if ((CheckIfProperClass(theObject) == true)) {
@@ -112,7 +112,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
throw new System.ArgumentException("Class name does not match.");
}
}
-
+
// Property returns the namespace of the WMI class.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -121,7 +121,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return "ROOT\\virtualization\\v2";
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ManagementClassName {
@@ -130,7 +130,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
if ((curObj != null)) {
if ((curObj.ClassPath != null)) {
strRet = ((string)(curObj["__CLASS"]));
- if (((strRet == null)
+ if (((strRet == null)
|| (strRet == string.Empty))) {
strRet = CreatedClassName;
}
@@ -139,7 +139,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return strRet;
}
}
-
+
// Property pointing to an embedded object to get System properties of the WMI object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -148,7 +148,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return PrivateSystemProperties;
}
}
-
+
// Property returning the underlying lateBound object.
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -157,7 +157,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return curObj;
}
}
-
+
// ManagementScope of the object.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -176,7 +176,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Property to show the commit behavior for the WMI object. If true, WMI object will be automatically saved after each property modification.(ie. Put() is called after modification of a property).
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -188,7 +188,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
AutoCommitProp = value;
}
}
-
+
// The ManagementPath of the underlying WMI object.
[Browsable(true)]
public System.Management.ManagementPath Path {
@@ -209,7 +209,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
// Public static scope property which is used by the various methods.
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@@ -221,7 +221,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
statMgmtScope = value;
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] AvailableRequestedStates {
@@ -229,7 +229,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["AvailableRequestedStates"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Caption {
@@ -237,7 +237,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Caption"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsCommunicationStatusNull {
@@ -250,7 +250,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -262,7 +262,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["CommunicationStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string CreationClassName {
@@ -270,7 +270,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["CreationClassName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Description {
@@ -278,7 +278,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Description"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsDetailedStatusNull {
@@ -291,7 +291,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -303,7 +303,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["DetailedStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string ElementName {
@@ -311,7 +311,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["ElementName"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsEnabledDefaultNull {
@@ -324,7 +324,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -336,7 +336,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["EnabledDefault"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsEnabledStateNull {
@@ -349,7 +349,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -361,7 +361,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["EnabledState"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsHealthStateNull {
@@ -374,7 +374,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -386,7 +386,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["HealthState"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsInstallDateNull {
@@ -399,7 +399,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -413,7 +413,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string InstanceID {
@@ -421,7 +421,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["InstanceID"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Name {
@@ -429,7 +429,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Name"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsOperatingStatusNull {
@@ -442,7 +442,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -454,7 +454,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["OperatingStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public ushort[] OperationalStatus {
@@ -462,7 +462,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort[])(curObj["OperationalStatus"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OtherEnabledState {
@@ -470,7 +470,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["OtherEnabledState"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string PrimaryOwnerContact {
@@ -478,7 +478,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["PrimaryOwnerContact"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string PrimaryOwnerName {
@@ -486,7 +486,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["PrimaryOwnerName"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsPrimaryStatusNull {
@@ -499,7 +499,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -511,7 +511,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["PrimaryStatus"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsRequestedStateNull {
@@ -524,7 +524,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -536,7 +536,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["RequestedState"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsStartedNull {
@@ -549,7 +549,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -561,7 +561,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((bool)(curObj["Started"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string StartMode {
@@ -569,7 +569,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["StartMode"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Status {
@@ -577,7 +577,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["Status"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] StatusDescriptions {
@@ -585,7 +585,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string[])(curObj["StatusDescriptions"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string SystemCreationClassName {
@@ -593,7 +593,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["SystemCreationClassName"]));
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string SystemName {
@@ -601,7 +601,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((string)(curObj["SystemName"]));
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTimeOfLastStateChangeNull {
@@ -614,7 +614,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -628,7 +628,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool IsTransitioningToStateNull {
@@ -641,7 +641,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
}
}
-
+
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
[TypeConverter(typeof(WMIValueTypeConverter))]
@@ -653,9 +653,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return ((ushort)(curObj["TransitioningToState"]));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions OptionsParam) {
- if (((path != null)
+ if (((path != null)
&& (string.Compare(path.ClassName, this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -663,9 +663,9 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return CheckIfProperClass(new System.Management.ManagementObject(mgmtScope, path, OptionsParam));
}
}
-
+
private bool CheckIfProperClass(System.Management.ManagementBaseObject theObj) {
- if (((theObj != null)
+ if (((theObj != null)
&& (string.Compare(((string)(theObj["__CLASS"])), this.ManagementClassName, true, System.Globalization.CultureInfo.InvariantCulture) == 0))) {
return true;
}
@@ -682,42 +682,42 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return false;
}
-
+
private bool ShouldSerializeCommunicationStatus() {
if ((this.IsCommunicationStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeDetailedStatus() {
if ((this.IsDetailedStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeEnabledDefault() {
if ((this.IsEnabledDefaultNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeEnabledState() {
if ((this.IsEnabledStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeHealthState() {
if ((this.IsHealthStateNull == false)) {
return true;
}
return false;
}
-
+
// Converts a given datetime in DMTF format to System.DateTime object.
static System.DateTime ToDateTime(string dmtfDate) {
System.DateTime initializer = System.DateTime.MinValue;
@@ -769,13 +769,13 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
if (("******" != tempString)) {
ticks = (long.Parse(tempString) * ((long)((System.TimeSpan.TicksPerMillisecond / 1000))));
}
- if (((((((((year < 0)
- || (month < 0))
- || (day < 0))
- || (hour < 0))
- || (minute < 0))
- || (minute < 0))
- || (second < 0))
+ if (((((((((year < 0)
+ || (month < 0))
+ || (day < 0))
+ || (hour < 0))
+ || (minute < 0))
+ || (minute < 0))
+ || (second < 0))
|| (ticks < 0))) {
throw new System.ArgumentOutOfRangeException();
}
@@ -803,7 +803,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return datetime;
}
-
+
// Converts a given System.DateTime object to DMTF datetime format.
static string ToDmtfDateTime(System.DateTime date) {
string utcString = string.Empty;
@@ -830,8 +830,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
dmtfDateTime = string.Concat(dmtfDateTime, ((int)(date.Second)).ToString().PadLeft(2, '0'));
dmtfDateTime = string.Concat(dmtfDateTime, ".");
System.DateTime dtTemp = new System.DateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, 0);
- long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
- * 1000)
+ long microsec = ((long)((((date.Ticks - dtTemp.Ticks)
+ * 1000)
/ System.TimeSpan.TicksPerMillisecond)));
string strMicrosec = ((long)(microsec)).ToString();
if ((strMicrosec.Length > 6)) {
@@ -841,75 +841,75 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
dmtfDateTime = string.Concat(dmtfDateTime, utcString);
return dmtfDateTime;
}
-
+
private bool ShouldSerializeInstallDate() {
if ((this.IsInstallDateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeOperatingStatus() {
if ((this.IsOperatingStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializePrimaryStatus() {
if ((this.IsPrimaryStatusNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeRequestedState() {
if ((this.IsRequestedStateNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeStarted() {
if ((this.IsStartedNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTimeOfLastStateChange() {
if ((this.IsTimeOfLastStateChangeNull == false)) {
return true;
}
return false;
}
-
+
private bool ShouldSerializeTransitioningToState() {
if ((this.IsTransitioningToStateNull == false)) {
return true;
}
return false;
}
-
+
[Browsable(true)]
public void CommitObject() {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put();
}
}
-
+
[Browsable(true)]
public void CommitObject(System.Management.PutOptions putOptions) {
if ((isEmbedded == false)) {
PrivateLateBoundObject.Put(putOptions);
}
}
-
+
private void Initialize() {
AutoCommitProp = true;
isEmbedded = false;
}
-
+
private static string ConstructPath(string keyCreationClassName, string keyName, string keySystemCreationClassName, string keySystemName) {
string strPath = "ROOT\\virtualization\\v2:Msvm_ImageManagementService";
strPath = string.Concat(strPath, string.Concat(".CreationClassName=", string.Concat("\"", string.Concat(keyCreationClassName, "\""))));
@@ -918,7 +918,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
strPath = string.Concat(strPath, string.Concat(",SystemName=", string.Concat("\"", string.Concat(keySystemName, "\""))));
return strPath;
}
-
+
private void InitializeObject(System.Management.ManagementScope mgmtScope, System.Management.ManagementPath path, System.Management.ObjectGetOptions getOptions) {
Initialize();
if ((path != null)) {
@@ -930,24 +930,24 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
PrivateSystemProperties = new ManagementSystemProperties(PrivateLateBoundObject);
curObj = PrivateLateBoundObject;
}
-
+
// Different overloads of GetInstances() help in enumerating instances of the WMI class.
public static ImageManagementServiceCollection GetInstances() {
return GetInstances(null, null, null);
}
-
+
public static ImageManagementServiceCollection GetInstances(string condition) {
return GetInstances(null, condition, null);
}
-
+
public static ImageManagementServiceCollection GetInstances(string[] selectedProperties) {
return GetInstances(null, null, selectedProperties);
}
-
+
public static ImageManagementServiceCollection GetInstances(string condition, string[] selectedProperties) {
return GetInstances(null, condition, selectedProperties);
}
-
+
public static ImageManagementServiceCollection GetInstances(System.Management.ManagementScope mgmtScope, System.Management.EnumerationOptions enumOptions) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -968,15 +968,15 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
}
return new ImageManagementServiceCollection(clsObject.GetInstances(enumOptions));
}
-
+
public static ImageManagementServiceCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition) {
return GetInstances(mgmtScope, condition, null);
}
-
+
public static ImageManagementServiceCollection GetInstances(System.Management.ManagementScope mgmtScope, string[] selectedProperties) {
return GetInstances(mgmtScope, null, selectedProperties);
}
-
+
public static ImageManagementServiceCollection GetInstances(System.Management.ManagementScope mgmtScope, string condition, string[] selectedProperties) {
if ((mgmtScope == null)) {
if ((statMgmtScope == null)) {
@@ -993,7 +993,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
ObjectSearcher.Options = enumOptions;
return new ImageManagementServiceCollection(ObjectSearcher.Get());
}
-
+
[Browsable(true)]
public static ImageManagementService CreateInstance() {
System.Management.ManagementScope mgmtScope = null;
@@ -1008,12 +1008,12 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
System.Management.ManagementClass tmpMgmtClass = new System.Management.ManagementClass(mgmtScope, mgmtPath, null);
return new ImageManagementService(tmpMgmtClass.CreateInstance());
}
-
+
[Browsable(true)]
public void Delete() {
PrivateLateBoundObject.Delete();
}
-
+
public uint AttachVirtualHardDisk(bool AssignDriveLetter, string Path, bool ReadOnly, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1034,7 +1034,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint CompactVirtualHardDisk(ushort Mode, string Path, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1054,7 +1054,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint ConvertVirtualHardDisk(string SourcePath, string VirtualDiskSettingData, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1074,7 +1074,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint CreateVirtualFloppyDisk(string Path, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1093,7 +1093,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint CreateVirtualHardDisk(string VirtualDiskSettingData, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1112,7 +1112,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint GetVirtualHardDiskSettingData(string Path, out System.Management.ManagementPath Job, out string SettingData) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1133,7 +1133,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint GetVirtualHardDiskState(string Path, out System.Management.ManagementPath Job, out string State) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1154,7 +1154,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint MergeVirtualHardDisk(string DestinationPath, string SourcePath, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1174,7 +1174,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint RequestStateChange(ushort RequestedState, System.DateTime TimeoutPeriod, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1194,7 +1194,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint ResizeVirtualHardDisk(ulong MaxInternalSize, string Path, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1214,7 +1214,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint SetParentVirtualHardDisk(string ChildPath, bool IgnoreIDMismatch, string LeafPath, string ParentPath, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1236,7 +1236,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint SetVirtualHardDiskSettingData(string VirtualDiskSettingData, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1255,7 +1255,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint StartService() {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1266,7 +1266,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint StopService() {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1277,7 +1277,7 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
public uint ValidateVirtualHardDisk(string Path, out System.Management.ManagementPath Job) {
if ((isEmbedded == false)) {
System.Management.ManagementBaseObject inParams = null;
@@ -1296,34 +1296,34 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
return System.Convert.ToUInt32(0);
}
}
-
+
// Enumerator implementation for enumerating instances of the class.
public class ImageManagementServiceCollection : object, ICollection {
-
+
private ManagementObjectCollection privColObj;
-
+
public ImageManagementServiceCollection(ManagementObjectCollection objCollection) {
privColObj = objCollection;
}
-
+
public virtual int Count {
get {
return privColObj.Count;
}
}
-
+
public virtual bool IsSynchronized {
get {
return privColObj.IsSynchronized;
}
}
-
+
public virtual object SyncRoot {
get {
return this;
}
}
-
+
public virtual void CopyTo(System.Array array, int index) {
privColObj.CopyTo(array, index);
int nCtr;
@@ -1331,189 +1331,189 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2 {
array.SetValue(new ImageManagementService(((System.Management.ManagementObject)(array.GetValue(nCtr)))), nCtr);
}
}
-
+
public virtual System.Collections.IEnumerator GetEnumerator() {
return new ImageManagementServiceEnumerator(privColObj.GetEnumerator());
}
-
+
public class ImageManagementServiceEnumerator : object, System.Collections.IEnumerator {
-
+
private ManagementObjectCollection.ManagementObjectEnumerator privObjEnum;
-
+
public ImageManagementServiceEnumerator(ManagementObjectCollection.ManagementObjectEnumerator objEnum) {
privObjEnum = objEnum;
}
-
+
public virtual object Current {
get {
return new ImageManagementService(((System.Management.ManagementObject)(privObjEnum.Current)));
}
}
-
+
public virtual bool MoveNext() {
return privObjEnum.MoveNext();
}
-
+
public virtual void Reset() {
privObjEnum.Reset();
}
}
}
-
+
// TypeConverter to handle null values for ValueType properties
public class WMIValueTypeConverter : TypeConverter {
-
+
private TypeConverter baseConverter;
-
+
private System.Type baseType;
-
+
public WMIValueTypeConverter(System.Type inBaseType) {
baseConverter = TypeDescriptor.GetConverter(inBaseType);
baseType = inBaseType;
}
-
+
public override bool CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type srcType) {
return baseConverter.CanConvertFrom(context, srcType);
}
-
+
public override bool CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) {
return baseConverter.CanConvertTo(context, destinationType);
}
-
+
public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) {
return baseConverter.ConvertFrom(context, culture, value);
}
-
+
public override object CreateInstance(System.ComponentModel.ITypeDescriptorContext context, System.Collections.IDictionary dictionary) {
return baseConverter.CreateInstance(context, dictionary);
}
-
+
public override bool GetCreateInstanceSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetCreateInstanceSupported(context);
}
-
+
public override PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, System.Attribute[] attributeVar) {
return baseConverter.GetProperties(context, value, attributeVar);
}
-
+
public override bool GetPropertiesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetPropertiesSupported(context);
}
-
+
public override System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValues(context);
}
-
+
public override bool GetStandardValuesExclusive(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesExclusive(context);
}
-
+
public override bool GetStandardValuesSupported(System.ComponentModel.ITypeDescriptorContext context) {
return baseConverter.GetStandardValuesSupported(context);
}
-
+
public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) {
if ((baseType.BaseType == typeof(System.Enum))) {
if ((value.GetType() == destinationType)) {
return value;
}
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "NULL_ENUM_VALUE" ;
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((baseType == typeof(bool))
+ if (((baseType == typeof(bool))
&& (baseType.BaseType == typeof(System.ValueType)))) {
- if ((((value == null)
- && (context != null))
+ if ((((value == null)
+ && (context != null))
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
- if (((context != null)
+ if (((context != null)
&& (context.PropertyDescriptor.ShouldSerializeValue(context.Instance) == false))) {
return "";
}
return baseConverter.ConvertTo(context, culture, value, destinationType);
}
}
-
+
// Embedded class to represent WMI system Properties.
[TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class ManagementSystemProperties {
-
+
private System.Management.ManagementBaseObject PrivateLateBoundObject;
-
+
public ManagementSystemProperties(System.Management.ManagementBaseObject ManagedObject) {
PrivateLateBoundObject = ManagedObject;
}
-
+
[Browsable(true)]
public int GENUS {
get {
return ((int)(PrivateLateBoundObject["__GENUS"]));
}
}
-
+
[Browsable(true)]
public string CLASS {
get {
return ((string)(PrivateLateBoundObject["__CLASS"]));
}
}
-
+
[Browsable(true)]
public string SUPERCLASS {
get {
return ((string)(PrivateLateBoundObject["__SUPERCLASS"]));
}
}
-
+
[Browsable(true)]
public string DYNASTY {
get {
return ((string)(PrivateLateBoundObject["__DYNASTY"]));
}
}
-
+
[Browsable(true)]
public string RELPATH {
get {
return ((string)(PrivateLateBoundObject["__RELPATH"]));
}
}
-
+
[Browsable(true)]
public int PROPERTY_COUNT {
get {
return ((int)(PrivateLateBoundObject["__PROPERTY_COUNT"]));
}
}
-
+
[Browsable(true)]
public string[] DERIVATION {
get {
return ((string[])(PrivateLateBoundObject["__DERIVATION"]));
}
}
-
+
[Browsable(true)]
public string SERVER {
get {
return ((string)(PrivateLateBoundObject["__SERVER"]));
}
}
-
+
[Browsable(true)]
public string NAMESPACE {
get {
return ((string)(PrivateLateBoundObject["__NAMESPACE"]));
}
}
-
+
[Browsable(true)]
public string PATH {
get {
diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_KvpExchangeComponent.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_KvpExchangeComponent.cs
index 976da28136f..016ad188574 100644
--- a/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_KvpExchangeComponent.cs
+++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/WmiWrappers/ROOT.virtualization.v2.Msvm_KvpExchangeComponent.cs
@@ -24,8 +24,8 @@ namespace CloudStack.Plugin.WmiWrappers.ROOT.VIRTUALIZATION.V2
using System.Globalization;
using System.ComponentModel.Design.Serialization;
using System.Reflection;
-
-
+
+
// Functions ShouldSerialize