当前位置: 首页>>代码示例>>Java>>正文


Java CloudClientEx类代码示例

本文整理汇总了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;
}
 
开发者ID:JetBrains,项目名称:teamcity-kubernetes-plugin,代码行数:23,代码来源:KubeDeleteImageDialogController.java

示例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;
}
 
开发者ID:JetBrains,项目名称:teamcity-vmware-plugin,代码行数:8,代码来源:DummyCloudManagerBase.java

示例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;
}
 
开发者ID:JetBrains,项目名称:teamcity-vmware-plugin,代码行数:8,代码来源:DummyCloudManagerBase.java

示例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;
}
 
开发者ID:JetBrains,项目名称:teamcity-vmware-plugin,代码行数:7,代码来源:DummyCloudManagerBase.java


注:本文中的jetbrains.buildServer.clouds.CloudClientEx类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。