本文整理汇总了Java中jetbrains.buildServer.clouds.CloudClientEx类的典型用法代码示例。如果您正苦于以下问题:Java CloudClientEx类的具体用法?Java CloudClientEx怎么用?Java CloudClientEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CloudClientEx类属于jetbrains.buildServer.clouds包,在下文中一共展示了CloudClientEx类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doHandle
import jetbrains.buildServer.clouds.CloudClientEx; //导入依赖的package包/类
@Nullable
@Override
protected ModelAndView doHandle(@NotNull HttpServletRequest httpServletRequest, @NotNull HttpServletResponse httpServletResponse) throws Exception {
String projectId = httpServletRequest.getParameter("projectId");
String profileId = httpServletRequest.getParameter("profileId");
String imageId = httpServletRequest.getParameter("imageId");
if(StringUtil.isEmpty(imageId)) return null;
final CloudClientEx client = myCloudManager.getClientIfExistsByProjectExtId(projectId, profileId);
CloudImage image = client.findImageById(imageId);
if(isGet(httpServletRequest)){
ModelAndView modelAndView = new ModelAndView(myPluginDescriptor.getPluginResourcesPath("deleteImageDialog.jsp"));
modelAndView.getModelMap().put("instances", image == null ? Collections.emptyList() : image.getInstances());
return modelAndView;
} else if(isPost(httpServletRequest) && image != null){
for (CloudInstance instance : image.getInstances()){
client.terminateInstance(instance);
}
}
return null;
}
示例2: addImageForBuildType
import jetbrains.buildServer.clouds.CloudClientEx; //导入依赖的package包/类
private void addImageForBuildType(@NotNull SBuildType buildType) {
Collection<SBuildFeatureDescriptor> featureDescriptors = buildType.getBuildFeaturesOfType(RunInContainerCloudConstants.TYPE);
// There is either zero or one feature
Optional<SBuildFeatureDescriptor> feature = featureDescriptors.stream().findAny();
// If there is no RunInContainerCloudFeature, do nothing
if (!feature.isPresent()) {
return;
}
// There is a feature, so get the parameters
Map<String, String> parameters = feature.get().getParameters();
String profileId = parameters.get(RunInContainerCloudConstants.ParameterName_CloudProfile);
CloudClientEx clientEx = cloudManager.getClientIfExists(profileId);
if (clientEx == null || !(clientEx instanceof ContainerCloudClient)) {
LOG.warn("BuildType " + buildType.getConfigId() + " has a RunInContainerCloud feature indicating profile " + profileId + ", but there is no such cloud client registered");
return;
}
LOG.info("Adding image " + parameters.get(RunInContainerCloudConstants.ParameterName_Image) + " to profile " + profileId);
ContainerCloudClient containerClient = (ContainerCloudClient) clientEx;
containerClient.addImage(parameters.get(RunInContainerCloudConstants.ParameterName_Image));
}
开发者ID:carlpett,项目名称:teamcity-container-cloud,代码行数:24,代码来源:RunInContainerCloudBuildQueuedListener.java
示例3: getClientIfExists
import jetbrains.buildServer.clouds.CloudClientEx; //导入依赖的package包/类
@Nullable
@Override
public CloudClientEx getClientIfExists(final String projectId, @NotNull final String profileId) {
throw new UnsupportedOperationException("DummyCloudManagerBase.getClientIfExists");
//return null;
}
示例4: getClient
import jetbrains.buildServer.clouds.CloudClientEx; //导入依赖的package包/类
@NotNull
@Override
public CloudClientEx getClient(final String projectId, @NotNull final String profileId) {
throw new UnsupportedOperationException("DummyCloudManagerBase.getClient");
//return null;
}
示例5: getClientIfExistsByProjectExtId
import jetbrains.buildServer.clouds.CloudClientEx; //导入依赖的package包/类
@Override
public CloudClientEx getClientIfExistsByProjectExtId(final String projectExtId, @NotNull final String profileId) {
throw new UnsupportedOperationException("DummyCloudManagerBase.getClientIfExistsByProjectExtId");
//return null;
}