本文整理汇总了TypeScript中core/serverGroup/serverGroupReader.service.ServerGroupReader类的典型用法代码示例。如果您正苦于以下问题:TypeScript service.ServerGroupReader类的具体用法?TypeScript service.ServerGroupReader怎么用?TypeScript service.ServerGroupReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了service.ServerGroupReader类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: 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
示例2: 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
注:本文中的core/serverGroup/serverGroupReader.service.ServerGroupReader类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论