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


TypeScript service.ServerGroupReader.getServerGroup方法代码示例

本文整理汇总了TypeScript中core/serverGroup/serverGroupReader.service.ServerGroupReader.getServerGroup方法的典型用法代码示例。如果您正苦于以下问题:TypeScript service.ServerGroupReader.getServerGroup方法的具体用法?TypeScript service.ServerGroupReader.getServerGroup怎么用?TypeScript service.ServerGroupReader.getServerGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core/serverGroup/serverGroupReader.service.ServerGroupReader的用法示例。


在下文中一共展示了service.ServerGroupReader.getServerGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: applyCommandToStage

  private applyCommandToStage(command: any): void {
    // Push the cluster config into the list of clusters
    const cluster = this.awsServerGroupTransformer.convertServerGroupCommandToDeployConfiguration(command);
    this.stage.clusters.push(cluster);

    // If the ASG we are cloning has a VIP, generate the new VIP
    if (command.source && command.source.asgName && command.source.region && command.source.account) {
      this.serverGroupReader.getServerGroup(command.application, command.source.account, command.source.region, command.source.asgName).then((asgDetails: ServerGroup) => {
        const newOverride: IVipOverride = {
          oldVip: undefined,
          newVip: undefined,
          oldSecureVip: undefined,
          newSecureVip: undefined
        };
        if (asgDetails) {
          const discoveryHealth = filter(flatten(map(asgDetails.instances, 'health')), { type: 'Discovery' });

          each(discoveryHealth, (health: any) => {
            newOverride.oldVip = newOverride.oldVip || health.vipAddress;
            newOverride.oldSecureVip = newOverride.oldSecureVip || health.secureVipAddress;
          });

          newOverride.newVip = this.generateNewVip(newOverride.oldVip, command.freeFormDetails);
          newOverride.newSecureVip = this.generateNewVip(newOverride.oldSecureVip, command.freeFormDetails);
        }
        this.stage.vipOverrides[this.getClusterId(cluster)] = newOverride;
      });
    }
  }
开发者ID:brujoand,项目名称:deck,代码行数:29,代码来源:isolatedTestingTargetStage.ts

示例2: terminateInstanceAndShrinkServerGroup

  public terminateInstanceAndShrinkServerGroup(
    instance: IInstance,
    application: Application,
    params: any = {},
  ): IPromise<ITask> {
    return ServerGroupReader.getServerGroup(
      application.name,
      instance.account,
      instance.region,
      instance.serverGroup,
    ).then((serverGroup: IServerGroup) => {
      params.type = 'terminateInstanceAndDecrementServerGroup';
      params.instance = instance.id;
      params.serverGroupName = instance.serverGroup;
      params.asgName = instance.serverGroup; // still needed on the backend
      params.region = instance.region;
      params.credentials = instance.account;
      params.cloudProvider = instance.cloudProvider;
      params.adjustMinIfNecessary = true;
      params.setMaxToNewDesired = serverGroup.asg.minSize === serverGroup.asg.maxSize;

      return TaskExecutor.executeTask({
        job: [params],
        application,
        description: `Terminate instance ${instance.id} and shrink ${instance.serverGroup}`,
      });
    });
  }
开发者ID:mizzy,项目名称:deck,代码行数:28,代码来源:instance.write.service.ts


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