Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change version of yavijava that we fetch from 6.0.03 to 6.0.04. #46

Merged
merged 2 commits into from Sep 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -75,7 +75,7 @@
<dependency>
<groupId>com.toastcoders</groupId>
<artifactId>yavijava</artifactId>
<version>6.0.03</version>
<version>6.0.04</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/jenkinsci/plugins/vSphereCloud.java
Expand Up @@ -389,6 +389,11 @@ public boolean configure(StaplerRequest req, JSONObject o)

/**
* For UI.
* @param vsHost From UI.
* @param vsDescription From UI.
* @param credentialsId From UI.
* @param maxOnlineSlaves From UI.
* @return Result of the validation.
*/
public FormValidation doTestConnection(@QueryParameter String vsHost,
@QueryParameter String vsDescription,
Expand Down
Expand Up @@ -20,13 +20,10 @@
import hudson.Launcher;
import hudson.model.*;

import jenkins.tasks.SimpleBuildStep;
import org.jenkinsci.plugins.vSphereCloud;
import org.jenkinsci.plugins.vsphere.builders.Messages;
import org.jenkinsci.plugins.vsphere.tools.VSphere;
import org.jenkinsci.plugins.vsphere.tools.VSphereException;
import org.jenkinsci.plugins.workflow.steps.AbstractStepExecutionImpl;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;

import javax.annotation.Nonnull;
import java.io.IOException;
Expand Down
Expand Up @@ -41,7 +41,7 @@

/**
*
* @author Oleg Nenashev <o.v.nenashev@gmail.com>
* @author Oleg Nenashev &lt;o.v.nenashev@gmail.com&gt;
*/
public class VSphereConnectionConfig extends AbstractDescribableImpl<VSphereConnectionConfig> {

Expand Down
57 changes: 30 additions & 27 deletions src/main/java/org/jenkinsci/plugins/vsphere/tools/VSphere.java
Expand Up @@ -74,7 +74,10 @@ private ServiceInstance getServiceInstance() throws RemoteException, MalformedUR
/**
* Initiates Connection to vSphere Server
* @param server Server URL
* @throws VSphereException
* @param user Username.
* @param pw Password.
* @throws VSphereException If an error occurred.
* @return A connected instance.
*/
public static VSphere connect(@Nonnull String server, @Nonnull String user, @CheckForNull String pw) throws VSphereException {
return new VSphere(server, user, pw);
Expand Down Expand Up @@ -104,7 +107,9 @@ public static String vSphereOutput(String msg){
* @param resourcePoolName - resource pool to use
* @param cluster - ComputeClusterResource to use
* @param datastoreName - Datastore to use
* @throws VSphereException
* @param powerOn - If true the VM will be powered on.
* @param jLogger - Where to log to.
* @throws VSphereException If an error occurred.
*/
public void deployVm(String cloneName, String sourceName, boolean linkedClone, String resourcePoolName, String cluster, String datastoreName, boolean powerOn, PrintStream jLogger) throws VSphereException {
boolean DO_NOT_USE_SNAPSHOTS = false;
Expand All @@ -121,7 +126,9 @@ public void deployVm(String cloneName, String sourceName, boolean linkedClone, S
* @param resourcePoolName - resource pool to use
* @param cluster - ComputeClusterResource to use
* @param datastoreName - Datastore to use
* @throws VSphereException
* @param powerOn - If true the VM will be powered on.
* @param jLogger - Where to log to.
* @throws VSphereException If an error occurred.
*/
public void cloneVm(String cloneName, String sourceName, boolean linkedClone, String resourcePoolName, String cluster, String datastoreName, boolean powerOn, PrintStream jLogger) throws VSphereException {
boolean DO_USE_SNAPSHOTS = true;
Expand Down Expand Up @@ -240,7 +247,8 @@ public void reconfigureVm(String name, VirtualMachineConfigSpec spec) throws VSp

/**
* @param name - Name of VM to start
* @throws VSphereException
* @param timeoutInSeconds How long to wait for the VM to be running.
* @throws VSphereException If an error occurred.
*/
public void startVm(String name, int timeoutInSeconds) throws VSphereException {

Expand Down Expand Up @@ -436,11 +444,12 @@ public void markAsVm(String name, String resourcePool, String cluster) throws VS
}

/**
* Shortcut
* Asks vSphere for the IP address used by a VM.
*
* @param vm - VirtualMachine name of which IP is returned
* @return - String containing IP address
* @throws VSphereException
* @param vm VirtualMachine name whose IP is to be returned.
* @param timeout How long to wait (in seconds) for the IP address to known to vSphere.
* @return String containing IP address.
* @throws VSphereException If an error occurred.
*/
public String getIp(VirtualMachine vm, int timeout) throws VSphereException {

Expand Down Expand Up @@ -477,11 +486,7 @@ public String getIp(VirtualMachine vm, int timeout) throws VSphereException {
/**
* @param vmName - name of VM object to retrieve
* @return - VirtualMachine object
* @throws InvalidProperty
* @throws RuntimeFault
* @throws RemoteException
* @throws MalformedURLException
* @throws VSphereException
* @throws VSphereException If an error occurred.
*/
public VirtualMachine getVmByName(String vmName) throws VSphereException {
try {
Expand Down Expand Up @@ -548,11 +553,7 @@ private Datastore getDatastoreByName(final String datastoreName, ManagedEntity r

/**
* @return - ManagedEntity array of Datastore
* @throws InvalidProperty
* @throws RuntimeFault
* @throws RemoteException
* @throws MalformedURLException
* @throws VSphereException
* @throws VSphereException If an error occurred.
*/
public ManagedEntity[] getDatastores() throws VSphereException {
try {
Expand Down Expand Up @@ -615,7 +616,8 @@ private ClusterComputeResource getClusterByName(final String clusterName) throws
/**
* Detroys the VM in vSphere
* @param name - VM object to destroy
* @throws VSphereException
* @param failOnNoExist If true and the VM does not exist then a VSphereException will be thrown.
* @throws VSphereException If an error occurred.
*/
public void destroyVm(String name, boolean failOnNoExist) throws VSphereException{
try{
Expand Down Expand Up @@ -649,10 +651,11 @@ public void destroyVm(String name, boolean failOnNoExist) throws VSphereExceptio

/**
* Renames a VM Snapshot
* @param oldName the current name of the vm
* @param newName the new name of the vm
* @param newDescription the new description of the vm
* @throws VSphereException
* @param vmName the name of the VM whose snapshot is being renamed.
* @param oldName the current name of the VM's snapshot.
* @param newName the new name of the VM's snapshot.
* @param newDescription the new description of the VM's snapshot.
* @throws VSphereException If an error occurred.
*/
public void renameVmSnapshot(String vmName, String oldName, String newName, String newDescription) throws VSphereException{
try{
Expand All @@ -678,7 +681,7 @@ public void renameVmSnapshot(String vmName, String oldName, String newName, Stri
* Renames the VM vSphere
* @param oldName the current name of the vm
* @param newName the new name of the vm
* @throws VSphereException
* @throws VSphereException If an error occurred.
*/
public void renameVm(String oldName, String newName) throws VSphereException{
try{
Expand Down Expand Up @@ -812,7 +815,7 @@ private Datacenter getDataCenter(ManagedEntity managedEntity)
* @param virtualMachine - VM object
* @param name - the name of the Port Group
* @return returns DistributedVirtualPortgroup object for the provided vDS PortGroup
* @throws VSphereException
* @throws VSphereException If an error occurred.
*/
public Network getNetworkPortGroupByName(VirtualMachine virtualMachine,
String name) throws VSphereException
Expand All @@ -838,7 +841,7 @@ public Network getNetworkPortGroupByName(VirtualMachine virtualMachine,
* @param virtualMachine - VM object
* @param name - the name of the Port Group
* @return returns DistributedVirtualPortgroup object for the provided vDS PortGroup
* @throws VSphereException
* @throws VSphereException If an error occurred.
*/
public DistributedVirtualPortgroup getDistributedVirtualPortGroupByName(VirtualMachine virtualMachine,
String name) throws VSphereException
Expand All @@ -863,7 +866,7 @@ public DistributedVirtualPortgroup getDistributedVirtualPortGroupByName(VirtualM
* Find Distributed Virtual Switch from the provided Distributed Virtual Portgroup
* @param distributedVirtualPortgroup - DistributedVirtualPortgroup object for the provided vDS PortGroup
* @return returns DistributedVirtualSwitch object that represents the vDS Switch
* @throws VSphereException
* @throws VSphereException If an error occurred.
*/
public DistributedVirtualSwitch getDistributedVirtualSwitchByPortGroup(
DistributedVirtualPortgroup distributedVirtualPortgroup) throws VSphereException
Expand Down
Expand Up @@ -22,7 +22,8 @@ public class VSphereLogger {
* This is simply a wrapper method to clean up this class. This method
* checks the verboseOutput flag and writes to the logger as appropriate.
*
* @param logger - logger that should receive the information
* @param logger - logger that should receive the information
* @param str - The text to be logged.
*/
public static void vsLogger(PrintStream logger, String str){
if(logger!=null){
Expand Down