本文整理汇总了Java中com.microsoft.azure.management.appservice.FunctionApp类的典型用法代码示例。如果您正苦于以下问题:Java FunctionApp类的具体用法?Java FunctionApp怎么用?Java FunctionApp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FunctionApp类属于com.microsoft.azure.management.appservice包,在下文中一共展示了FunctionApp类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: publish
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
@Override
public void publish() throws Exception {
final FTPUploader uploader = getUploader();
final FunctionApp app = mojo.getFunctionApp();
final PublishingProfile profile = app.getPublishingProfile();
final String serverUrl = profile.ftpUrl().split("/", 2)[0];
uploader.uploadDirectoryWithRetries(
serverUrl,
profile.ftpUsername(),
profile.ftpPassword(),
mojo.getDeploymentStageDirectory(),
DEFAULT_FUNCTION_ROOT,
DEFAULT_MAX_RETRY_TIMES);
app.syncTriggers();
}
示例2: doExecute
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
@Test
public void doExecute() throws Exception {
final DeployMojo mojo = getMojoFromPom();
final DeployMojo mojoSpy = spy(mojo);
doCallRealMethod().when(mojoSpy).getLog();
final ArtifactHandler handler = mock(ArtifactHandler.class);
doReturn(handler).when(mojoSpy).getArtifactHandler();
doCallRealMethod().when(mojoSpy).createOrUpdateFunctionApp();
doCallRealMethod().when(mojoSpy).getAppName();
final FunctionApp app = mock(FunctionApp.class);
doReturn(app).when(mojoSpy).getFunctionApp();
doNothing().when(mojoSpy).updateFunctionApp(app);
mojoSpy.doExecute();
verify(mojoSpy, times(1)).createOrUpdateFunctionApp();
verify(mojoSpy, times(1)).doExecute();
verify(mojoSpy, times(1)).updateFunctionApp(any(FunctionApp.class));
verify(handler, times(1)).publish();
verifyNoMoreInteractions(handler);
}
示例3: getCloudStorageAccountWithException
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
@Test
public void getCloudStorageAccountWithException() throws Exception {
final MSDeployArtifactHandlerImpl handler = new MSDeployArtifactHandlerImpl(mojo);
final FunctionApp app = mock(FunctionApp.class);
final Map appSettings = mock(Map.class);
doReturn(appSettings).when(app).appSettings();
doReturn(null).when(appSettings).get(anyString());
String exceptionMessage = null;
try {
handler.getCloudStorageAccount(app);
} catch (Exception e) {
exceptionMessage = e.getMessage();
} finally {
assertEquals(INTERNAL_STORAGE_NOT_FOUND, exceptionMessage);
}
}
示例4: deployWithPackageUri
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
@Test
public void deployWithPackageUri() throws Exception {
final MSDeployArtifactHandlerImpl handler = new MSDeployArtifactHandlerImpl(mojo);
final FunctionApp app = mock(FunctionApp.class);
final WithPackageUri withPackageUri = mock(WithPackageUri.class);
doReturn(withPackageUri).when(app).deploy();
final WithExecute withExecute = mock(WithExecute.class);
doReturn(withExecute).when(withPackageUri).withPackageUri(anyString());
doReturn(withExecute).when(withExecute).withExistingDeploymentsDeleted(false);
final Runnable runnable = mock(Runnable.class);
handler.deployWithPackageUri(app, "uri", runnable);
verify(withExecute, times(1)).execute();
verify(runnable, times(1)).run();
}
示例5: FunctionAppsImpl
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
FunctionAppsImpl(final AppServiceManager manager) {
super(manager.inner().webApps(), manager);
converter = new PagedListConverter<SiteInner, FunctionApp>() {
@Override
public Observable<FunctionApp> typeConvertAsync(final SiteInner siteInner) {
return manager.inner().webApps().getConfigurationAsync(siteInner.resourceGroup(), siteInner.name())
.subscribeOn(SdkContext.getRxScheduler())
.map(new Func1<SiteConfigResourceInner, FunctionApp>() {
@Override
public FunctionApp call(SiteConfigResourceInner siteConfigResourceInner) {
return wrapModel(siteInner, siteConfigResourceInner);
}
});
}
@Override
protected boolean filter(SiteInner inner) {
return "functionapp".equalsIgnoreCase(inner.kind());
}
};
}
示例6: getFunctionApp
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
public FunctionApp getFunctionApp() throws AzureAuthFailureException {
try {
return getAzureClient().appServices().functionApps().getByResourceGroup(getResourceGroup(), getAppName());
} catch (AzureAuthFailureException authEx) {
throw authEx;
} catch (Exception ex) {
// Swallow exception for non-existing function app
}
return null;
}
示例7: getCloudStorageAccount
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
protected CloudStorageAccount getCloudStorageAccount(final FunctionApp app) throws Exception {
final AppSetting internalStorageSetting = app.appSettings().get(INTERNAL_STORAGE_KEY);
if (internalStorageSetting == null || StringUtils.isEmpty(internalStorageSetting.value())) {
logError(INTERNAL_STORAGE_NOT_FOUND);
throw new Exception(INTERNAL_STORAGE_NOT_FOUND);
}
logDebug(INTERNAL_STORAGE_CONNECTION_STRING + internalStorageSetting.value());
return CloudStorageAccount.parse(internalStorageSetting.value());
}
示例8: deployWithPackageUri
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
protected void deployWithPackageUri(final FunctionApp app, final String packageUri, Runnable onDeployFinish) {
try {
logInfo("");
logInfo(DEPLOY_PACKAGE_START);
app.deploy()
.withPackageUri(packageUri)
.withExistingDeploymentsDeleted(false)
.execute();
logInfo(DEPLOY_PACKAGE_DONE);
} finally {
onDeployFinish.run();
}
}
示例9: createOrUpdateFunctionApp
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
protected void createOrUpdateFunctionApp() throws Exception {
final FunctionApp app = getFunctionApp();
if (app == null) {
createFunctionApp();
} else {
updateFunctionApp(app);
}
}
示例10: updateFunctionApp
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
protected void updateFunctionApp(final FunctionApp app) {
info(FUNCTION_APP_UPDATE);
// Work around of https://github.com/Azure/azure-sdk-for-java/issues/1755
app.inner().withTags(null);
final Update update = app.update();
configureAppSettings(update::withAppSettings, getAppSettings());
update.apply();
info(FUNCTION_APP_UPDATE_DONE + getAppName());
}
示例11: updateFunctionApp
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
@Test
public void updateFunctionApp() throws Exception {
final DeployMojo mojo = getMojoFromPom();
final DeployMojo mojoSpy = spy(mojo);
final FunctionApp app = mock(FunctionApp.class);
final SiteInner siteInner = mock(SiteInner.class);
doReturn(siteInner).when(app).inner();
final Update update = mock(Update.class);
doReturn(update).when(app).update();
doNothing().when(mojoSpy).configureAppSettings(any(Consumer.class), anyMap());
mojoSpy.updateFunctionApp(app);
verify(update, times(1)).apply();
}
示例12: publish
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
@Test
public void publish() throws Exception {
final String ftpUrl = "ftp.azurewebsites.net/site/wwwroot";
final PublishingProfile profile = mock(PublishingProfile.class);
when(profile.ftpUrl()).thenReturn(ftpUrl);
final FunctionApp app = mock(FunctionApp.class);
when(app.getPublishingProfile()).thenReturn(profile);
final DeployMojo mojo = mock(DeployMojo.class);
when(mojo.getFunctionApp()).thenReturn(app);
final FTPUploader uploader = mock(FTPUploader.class);
final FTPArtifactHandlerImpl handler = new FTPArtifactHandlerImpl(mojo);
final FTPArtifactHandlerImpl handlerSpy = spy(handler);
doReturn(uploader).when(handlerSpy).getUploader();
handlerSpy.publish();
verify(handlerSpy, times(1)).getUploader();
verify(handlerSpy, times(1)).publish();
verifyNoMoreInteractions(handlerSpy);
verify(mojo, times(1)).getFunctionApp();
verify(mojo, times(1)).getDeploymentStageDirectory();
verifyNoMoreInteractions(mojo);
verify(app, times(1)).getPublishingProfile();
verify(app, times(1)).syncTriggers();
verifyNoMoreInteractions(app);
verify(profile, times(1)).ftpUrl();
verify(profile, times(1)).ftpUsername();
verify(profile, times(1)).ftpPassword();
verifyNoMoreInteractions(profile);
verify(uploader, times(1))
.uploadDirectoryWithRetries(anyString(), isNull(), isNull(), isNull(), anyString(), anyInt());
verifyNoMoreInteractions(uploader);
}
示例13: getCloudStorageAccount
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
@Test
public void getCloudStorageAccount() throws Exception {
final String storageConnection =
"DefaultEndpointsProtocol=https;AccountName=123456;AccountKey=12345678;EndpointSuffix=core.windows.net";
final MSDeployArtifactHandlerImpl handler = new MSDeployArtifactHandlerImpl(mojo);
final FunctionApp app = mock(FunctionApp.class);
final Map appSettings = mock(Map.class);
doReturn(appSettings).when(app).appSettings();
final AppSetting storageSetting = mock(AppSetting.class);
doReturn(storageSetting).when(appSettings).get(anyString());
doReturn(storageConnection).when(storageSetting).value();
final CloudStorageAccount storageAccount = handler.getCloudStorageAccount(app);
assertNotNull(storageAccount);
}
示例14: getByResourceGroup
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
@Override
public FunctionApp getByResourceGroup(String groupName, String name) {
SiteInner siteInner = this.inner().getByResourceGroup(groupName, name);
if (siteInner == null) {
return null;
}
return wrapModel(siteInner, this.inner().getConfiguration(groupName, name));
}
示例15: parent
import com.microsoft.azure.management.appservice.FunctionApp; //导入依赖的package包/类
@Override
public FunctionApp parent() {
return this.parent;
}