Package com.vmware.bdd.apitypes

Examples of com.vmware.bdd.apitypes.DatastoreAdd


         @CliOption(key = { "regex" }, mandatory = false, specifiedDefaultValue = "true", unspecifiedDefaultValue = "false",
               help = "Whether use regular expression for the datastore name(s) in vsphere") final boolean regex) {

      //build DatastoreAdd object
      try {
         DatastoreAdd datastoreAdd = new DatastoreAdd();
         datastoreAdd.setName(name);

         if (CommandsUtils.inputsConvert(spec).isEmpty()) {
            CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_DATASTORE,
                  name, Constants.OUTPUT_OP_ADD,
                  Constants.OUTPUT_OP_RESULT_FAIL, Constants.INPUT_SPEC_PARAM
                        + Constants.MULTI_INPUTS_CHECK);
         } else {
            datastoreAdd.setSpec(CommandsUtils.inputsConvert(spec));
            datastoreAdd.setType(DatastoreType.valueOf(type.toUpperCase()));
            if (regex) {
               datastoreAdd.setRegex(true);
            }

            restClient.add(datastoreAdd);
            CommandsUtils.printCmdSuccess(Constants.OUTPUT_OBJECT_DATASTORE,
                  name, Constants.OUTPUT_OP_RESULT_ADD);
View Full Code Here

TOP

Related Classes of com.vmware.bdd.apitypes.DatastoreAdd

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.