-
Notifications
You must be signed in to change notification settings - Fork 98
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
support deployment status on web app #1339
Conversation
azure-mgmt-appservice/src/main/java/com/microsoft/azure/management/appservice/WebApp.java
Outdated
Show resolved
Hide resolved
...mt-appservice/src/test/java/com/microsoft/azure/management/appservice/LinuxWebAppsTests.java
Outdated
Show resolved
Hide resolved
import com.microsoft.rest.serializer.JsonFlatten; | ||
|
||
@JsonFlatten | ||
public class DeploymentStatus extends ProxyResource { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Response class for deploymentStatus
. Note this will get changed after swagger updated by service.
* Asynchronous deploys a ZIP file onto the Azure specialized Java SE image on this web app. | ||
* | ||
* @see #getDeploymentStatusAsync(String) | ||
* @param zipFile the ZIP file to upload | ||
* @return the result of the deployment, which contains the deployment ID for query on the deployment status. | ||
*/ | ||
Observable<AsyncDeploymentResult> pushZipDeployAsync(File zipFile); | ||
|
||
/** | ||
* Asynchronous deploys a ZIP file onto the Azure specialized Java SE image on this web app. | ||
* | ||
* @see #getDeploymentStatusAsync(String) | ||
* @param zipFile the ZIP file to upload | ||
* @return the result of the deployment, which contains the deployment ID for query on the deployment status. | ||
*/ | ||
AsyncDeploymentResult pushZipDeploy(File zipFile); | ||
|
||
/** | ||
* Asynchronous deploys a ZIP file onto the Azure specialized Java SE image on this web app. | ||
* | ||
* @see #getDeploymentStatus(String) | ||
* @param zipFile the ZIP file to upload | ||
* @return the result of the deployment, which contains the deployment ID for query on the deployment status. | ||
*/ | ||
AsyncDeploymentResult pushZipDeploy(InputStream zipFile); | ||
|
||
/** | ||
* Asynchronous deploys a ZIP file onto the Azure specialized Java SE image on this web app. | ||
* | ||
* @see #getDeploymentStatusAsync(String) | ||
* @param zipFile the ZIP file to upload | ||
* @return the result of the deployment, which contains the deployment ID for query on the deployment status. | ||
*/ | ||
Observable<AsyncDeploymentResult> pushZipDeployAsync(InputStream zipFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API to do async ZipDeploy.
* Gets the deployment status of the web app. | ||
* | ||
* @param deploymentId the deployment ID of the web app. | ||
* @return the deployment status. | ||
*/ | ||
Observable<DeploymentStatus> getDeploymentStatusAsync(String deploymentId); | ||
|
||
/** | ||
* Gets the deployment status of the web app. | ||
* | ||
* @param deploymentId the deployment ID of the web app. | ||
* @return the deployment status. | ||
*/ | ||
DeploymentStatus getDeploymentStatus(String deploymentId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API to get deployment status. It will get changed after swagger updated.
public void canGetDeploymentStatus() throws InterruptedException { | ||
WebApp wa = appServiceManager.webApps().getByResourceGroup("rg-weidxu", "wa1weidxu"); | ||
AsyncDeploymentResult result = wa.pushZipDeploy(new File("C:/github/app.zip")); | ||
DeploymentStatus status = wa.getDeploymentStatus(result.getDeploymentId()); | ||
while (status == null) { | ||
System.out.println("status not ready"); | ||
Thread.sleep(10 * 1000); | ||
// try again | ||
status = wa.getDeploymentStatus(result.getDeploymentId()); | ||
} | ||
BuildStatus buildStatus = status.buildStatus(); | ||
System.out.println("build status: " + buildStatus); | ||
while (buildStatus != BuildStatus.BUILD_SUCCESSFUL) { | ||
Thread.sleep(10 * 1000); | ||
// poll again | ||
status = wa.getDeploymentStatus(result.getDeploymentId()); | ||
buildStatus = status.buildStatus(); | ||
System.out.println("build status: " + buildStatus); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sample code for client.
…re/azure-libraries-for-java into appservice-deployment-status
fix #1338