Skip to content

Add functionality to pull latest windows and linux stacks for webapps from the live service #684

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

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.management.appservice;

import com.microsoft.azure.management.apigeneration.Beta;
import com.microsoft.azure.management.apigeneration.Fluent;

import java.util.Set;

/**
* Endpoints and credentials for publishing to a web app.
*/
@Fluent(ContainerName = "/Microsoft.Azure.Management.AppService.Fluent")
@Beta
public interface AppServiceStacks {
/**
* @return the latest Windows application service stacks.
*/
WindowsAppServiceStacks getLatestWindowsStacks();

/**
* @return the latest Linux application service stacks.
*/
Set<RuntimeStack> listLatestLinuxStacks();
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@

package com.microsoft.azure.management.appservice;

import com.microsoft.azure.management.resources.fluentcore.arm.ExpandableStringEnum;

import java.util.Collection;

/**
* Defines values for Java versions.
*/
public final class JavaVersion extends ExpandableStringEnum<JavaVersion> {
public final class JavaVersion extends RuntimeVersion<JavaVersion> {
/**
* Name of the component.
*/
public static final String COMPONENT_NAME = "java";

/** Static value 'Off' for JavaVersion. */
public static final JavaVersion OFF = fromString("null");

Expand Down Expand Up @@ -65,4 +68,48 @@ public static JavaVersion fromString(String name) {
public static Collection<JavaVersion> values() {
return values(JavaVersion.class);
}

/**
* @return the component name.
*/
@Override
public String getRuntimeName() {
return COMPONENT_NAME;
}

/**
* @param version the version to check.
* @return Check if the version is present in the enum.
*/
@Override
public boolean containsVersion(String version) {
for (JavaVersion ver : values()) {
if (ver.toString().equalsIgnoreCase(version)) {
return true;
}
}

return false;
}

/**
* @return true. We process minor versions for this runtime.
*/
@Override
protected boolean shouldProcessMinorVersions() {
return true;
}

/**
* Create a version enum from the passed in values if one does not already exist.
* @param name name of the framweork
* @param displayVersion display version of the runtime
* @param runtimeVersion runtime versin of the runtime
*/
@Override
protected void createEnumFromVersionInformation(String name, String displayVersion, String runtimeVersion) {
if (COMPONENT_NAME.equalsIgnoreCase(name)) {
fromString(runtimeVersion);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/

package com.microsoft.azure.management.appservice;

import org.apache.commons.lang3.NotImplementedException;

import java.util.Collection;

/**
* Defines values for .NET framework version.
*/
public final class LinuxStackVersion extends RuntimeVersion<LinuxStackVersion> {
/**
* Name of the component.
*/
public static final String COMPONENT_NAME = "linux";

/**
* Netframework Off setting.
*/
public static final LinuxStackVersion OFF = LinuxStackVersion.fromString("null");

/**
* Finds or creates a .NET Framework version based on the name.
* @param name a name
* @return an instance of NetFrameworkVersion
*/
public static LinuxStackVersion fromString(String name) {
return fromString(name, LinuxStackVersion.class);
}

/**
* @return known .NET framework versions
*/
public static Collection<LinuxStackVersion> values() {
return values(LinuxStackVersion.class);
}

/**
* @return The runtime name.
*/
@Override
public String getRuntimeName() {
return COMPONENT_NAME;
}

/**
* @param version the version to check.
* @return true if the version present in the enum, false otherwise.
*/
@Override
public boolean containsVersion(String version) {
for (LinuxStackVersion ver : values()) {
if (ver.toString().equalsIgnoreCase(version)) {
return true;
}
}

return false;
}

/**
* This entry point should never be used.
*
* @param name name of the framweork
* @param displayVersion display version of the runtime
* @param runtimeVersion runtime version of the runtime
*/
@Override
protected void createEnumFromVersionInformation(String name, String displayVersion, String runtimeVersion) {
throw new NotImplementedException("Do not use this function to add new enums of type LinuxStackVersion, use RuntimeStack.fromStackNameAndVersionString");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@

import java.util.Collection;

import com.microsoft.azure.management.resources.fluentcore.arm.ExpandableStringEnum;

/**
* Defines values for .NET framework version.
*/
public final class NetFrameworkVersion extends ExpandableStringEnum<NetFrameworkVersion> {
public final class NetFrameworkVersion extends RuntimeVersion<NetFrameworkVersion> {
/**
* Name of the component.
*/
public static final String COMPONENT_NAME = "aspnet";

/**
* Netframework Off setting.
*/
public static final NetFrameworkVersion OFF = NetFrameworkVersion.fromString("null");

/** Static value v3.5 for NetFrameworkVersion. */
public static final NetFrameworkVersion V3_0 = NetFrameworkVersion.fromString("v3.0");

Expand All @@ -35,4 +43,41 @@ public static NetFrameworkVersion fromString(String name) {
public static Collection<NetFrameworkVersion> values() {
return values(NetFrameworkVersion.class);
}

/**
* @return The runtime name.
*/
@Override
public String getRuntimeName() {
return COMPONENT_NAME;
}

/**
* @param version the version to check.
* @return true if the version present in the enum, false otherwise.
*/
@Override
public boolean containsVersion(String version) {
for (NetFrameworkVersion ver : values()) {
if (ver.toString().equalsIgnoreCase(version)) {
return true;
}
}

return false;
}

/**
* Create the enum fomr the passed in values if it does not already exist.
*
* @param name name of the framweork
* @param displayVersion display version of the runtime
* @param runtimeVersion runtime version of the runtime
*/
@Override
protected void createEnumFromVersionInformation(String name, String displayVersion, String runtimeVersion) {
if (COMPONENT_NAME.equalsIgnoreCase(name)) {
fromString(displayVersion);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/

package com.microsoft.azure.management.appservice;

import java.util.Collection;

/**
* Defines values for PHP version.
*/
public final class NodeVersion extends RuntimeVersion<NodeVersion> {
/**
* Name of the component.
*/
public static final String COMPONENT_NAME = "node";
/** Static value 'Off' for NodeVersion. */
public static final NodeVersion OFF = NodeVersion.fromString("null");

/** Static value 0.6 for NodeVersion. */
public static final NodeVersion NODE0_6 = NodeVersion.fromString("0.6");

/** Static value 0.8 for NodeVersion. */
public static final NodeVersion NODE0_8 = NodeVersion.fromString("0.8");

/** Static value 0.10 for NodeVersion. */
public static final NodeVersion NODE0_10 = NodeVersion.fromString("0.10");

/** Static value 0.12 for NodeVersion. */
public static final NodeVersion NODE0_12 = NodeVersion.fromString("0.12");

/** Static value 4.8 for NodeVersion. */
public static final NodeVersion NODE4_8 = NodeVersion.fromString("4.8");

/** Static value 6.5 for NodeVersion. */
public static final NodeVersion NODE6_5 = NodeVersion.fromString("6.5");

/** Static value 6.9 for NodeVersion. */
public static final NodeVersion NODE6_9 = NodeVersion.fromString("6.9");

/** Static value 6.12 for NodeVersion. */
public static final NodeVersion NODE6_12 = NodeVersion.fromString("6.12");

/** Static value 7.10 for NodeVersion. */
public static final NodeVersion NODE7_10 = NodeVersion.fromString("7.10");

/** Static value 8.1 for NodeVersion. */
public static final NodeVersion NODE8_1 = NodeVersion.fromString("8.1");

/** Static value 8.4 for NodeVersion. */
public static final NodeVersion NODE8_4 = NodeVersion.fromString("8.4");

/** Static value 8.5 for NodeVersion. */
public static final NodeVersion NODE8_5 = NodeVersion.fromString("8.5");

/** Static value 8.9 for NodeVersion. */
public static final NodeVersion NODE8_9 = NodeVersion.fromString("8.9");

/** Static value 8.10 for NodeVersion. */
public static final NodeVersion NODE8_10 = NodeVersion.fromString("8.10");

/** Static value 8.11 for NodeVersion. */
public static final NodeVersion NODE8_11 = NodeVersion.fromString("8.11");

/** Static value 10.0 for NodeVersion. */
public static final NodeVersion NODE10_0 = NodeVersion.fromString("10.0");

/** Static value 10.6 for NodeVersion. */
public static final NodeVersion NODE10_6 = NodeVersion.fromString("10.6");

/**
* Finds or creates a PHP version based on the specified name.
* @param name a name
* @return a PhpVersion instance
*/
public static NodeVersion fromString(String name) {
return fromString(name, NodeVersion.class);
}

/**
* @return known PHP versions
*/
public static Collection<NodeVersion> values() {
return values(NodeVersion.class);
}

/**
* @return the name of the component.
*/
@Override
public String getRuntimeName() {
return COMPONENT_NAME;
}

/**
* @param version the version to check
* @return true if the version is present in the enum, false otherwise.
*/
@Override
public boolean containsVersion(String version) {
for (NodeVersion ver : values()) {
if (ver.toString().equalsIgnoreCase(version)) {
return true;
}
}

return false;
}

/**
* Vreate a new version enum form the passed in values if one does not exist already.
* @param name name of the framweork
* @param displayVersion display version of the runtime
* @param runtimeVersion runtime versin of the runtime
*/
@Override
protected void createEnumFromVersionInformation(String name, String displayVersion, String runtimeVersion) {
if (COMPONENT_NAME.equalsIgnoreCase(name)) {
fromString(runtimeVersion);
}
}
}
Loading