Search in sources :

Example 11 with AzureVMAgentTemplate

use of com.microsoft.azure.vmagent.AzureVMAgentTemplate in project azure-vm-agents-plugin by jenkinsci.

the class AzureVMTemplateBuilder method build.

public AzureVMAgentTemplate build() {
    AzureVMAgentTemplate azureVMAgentTemplate = new AzureVMAgentTemplate(fluent.getName(), fluent.getDescription(), fluent.getLabels(), fluent.getLocation(), new AzureVMAgentTemplate.AvailabilityTypeClass(fluent.getAvailability().getAvailabilitySet()), fluent.getVirtualMachineSize(), fluent.getStorageAccountNameReferenceType(), fluent.getStorageAccountType(), fluent.getNewStorageAccountName(), fluent.getExistingStorageAccountName(), fluent.getDiskType(), fluent.getAdvancedImage().getNoOfParallelJobs(), fluent.getUsageMode(), fluent.getAdvancedImage().getOsType(), fluent.getImageTopLevelType(), new AzureVMAgentTemplate.ImageReferenceTypeClass(fluent.getAdvancedImage().getImage(), fluent.getAdvancedImage().getImageId(), fluent.getAdvancedImage().getImagePublisher(), fluent.getAdvancedImage().getImageOffer(), fluent.getAdvancedImage().getImageSku(), fluent.getAdvancedImage().getImageVersion(), fluent.getAdvancedImage().getGalleryName(), fluent.getAdvancedImage().getGalleryImageDefinition(), fluent.getAdvancedImage().getGalleryImageVersion(), fluent.getAdvancedImage().getGallerySubscriptionId(), fluent.getAdvancedImage().getGalleryResourceGroup()), fluent.getAdvancedImage().getAgentLaunchMethod(), fluent.getAdvancedImage().getInitScript(), fluent.getAdvancedImage().getTerminateScript(), fluent.getCredentialsId(), fluent.getAdvancedImage().getVirtualNetworkName(), fluent.getAdvancedImage().getVirtualNetworkResourceGroupName(), fluent.getAdvancedImage().getSubnetName(), fluent.getAdvancedImage().getNsgName(), fluent.getWorkspace(), fluent.getAdvancedImage().getJvmOptions(), fluent.getRetentionStrategy(), fluent.getAdvancedImage().isExecuteInitScriptAsRoot(), fluent.getAdvancedImage().isDoNotUseMachineIfInitFails());
    azureVMAgentTemplate.setShutdownOnIdle(fluent.isShutdownOnIdle());
    azureVMAgentTemplate.setEphemeralOSDisk(fluent.isEphemeralOSDisk());
    azureVMAgentTemplate.setOsDiskSize(fluent.getOsDiskSize());
    azureVMAgentTemplate.setTemplateDisabled(fluent.getAdvancedImage().isTemplateDisabled());
    azureVMAgentTemplate.setBuiltInImage(fluent.getBuiltInImage().getBuiltInImage());
    azureVMAgentTemplate.setInstallGit(fluent.getBuiltInImage().isInstallGit());
    azureVMAgentTemplate.setInstallMaven(fluent.getBuiltInImage().isInstallMaven());
    azureVMAgentTemplate.setInstallDocker(fluent.getBuiltInImage().isInstallDocker());
    azureVMAgentTemplate.setUsePrivateIP(fluent.getAdvancedImage().isUsePrivateIP());
    azureVMAgentTemplate.setEnableMSI(fluent.getAdvancedImage().isEnableMSI());
    azureVMAgentTemplate.setEnableUAMI(fluent.getAdvancedImage().isEnableUAMI());
    azureVMAgentTemplate.setUamiID(fluent.getAdvancedImage().getUamiID());
    azureVMAgentTemplate.setPreInstallSsh(fluent.getAdvancedImage().isPreInstallSsh());
    azureVMAgentTemplate.setTags(fluent.getCloudTags());
    azureVMAgentTemplate.getImageReference().setGalleryImageSpecialized(fluent.getAdvancedImage().getGalleryImageSpecialized());
    return azureVMAgentTemplate;
}
Also used : AzureVMAgentTemplate(com.microsoft.azure.vmagent.AzureVMAgentTemplate)

Aggregations

AzureVMAgentTemplate (com.microsoft.azure.vmagent.AzureVMAgentTemplate)11 AzureVMCloud (com.microsoft.azure.vmagent.AzureVMCloud)10 Test (org.junit.Test)7 AzureCloudException (com.microsoft.azure.vmagent.exceptions.AzureCloudException)6 ManagementException (com.azure.core.management.exception.ManagementException)4 AzureVMAgent (com.microsoft.azure.vmagent.AzureVMAgent)4 AzureVMDeploymentInfo (com.microsoft.azure.vmagent.AzureVMDeploymentInfo)4 IOException (java.io.IOException)4 PublicIpAddress (com.azure.resourcemanager.network.models.PublicIpAddress)2 AzureTagPair (com.microsoft.azure.vmagent.AzureTagPair)2 AzureVMCloudRetensionStrategy (com.microsoft.azure.vmagent.AzureVMCloudRetensionStrategy)2 ProvisioningActivity (org.jenkinsci.plugins.cloudstats.ProvisioningActivity)2 StandardUsernamePasswordCredentials (com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials)1 Node (hudson.model.Node)1 Secret (hudson.util.Secret)1 ArrayList (java.util.ArrayList)1 Jenkins (jenkins.model.Jenkins)1 Ignore (org.junit.Ignore)1 LocalData (org.jvnet.hudson.test.recipes.LocalData)1