本文整理汇总了TypeScript中@spinnaker/core.TaskExecutor.executeTask方法的典型用法代码示例。如果您正苦于以下问题:TypeScript TaskExecutor.executeTask方法的具体用法?TypeScript TaskExecutor.executeTask怎么用?TypeScript TaskExecutor.executeTask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@spinnaker/core.TaskExecutor
的用法示例。
在下文中一共展示了TaskExecutor.executeTask方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: upsertScalingPolicy
public static upsertScalingPolicy(application: Application, command: IUpsertScalingPolicyCommand): IPromise<ITask> {
command.type = command.type || 'upsertScalingPolicy';
return TaskExecutor.executeTask({
application,
description: 'Upsert scaling policy ' + (command.name || command.serverGroupName),
job: [command],
});
}
示例2: registerInstancesWithTargetGroup
public registerInstancesWithTargetGroup(instanceGroups: IMultiInstanceGroup[], application: Application, targetGroupNames: string[]) {
const jobs = this.buildMultiInstanceJob(instanceGroups, 'registerInstancesWithLoadBalancer') as IAmazonMultiInstanceJob[];
jobs.forEach((job) => job.targetGroupNames = targetGroupNames);
const descriptor = this.buildMultiInstanceDescriptor(jobs, 'Register', `with ${targetGroupNames.join(' and ')}`);
return this.taskExecutor.executeTask({
job: jobs,
application: application,
description: descriptor,
});
}
示例3: stopServerGroup
public stopServerGroup(serverGroup: IAppengineServerGroup, application: Application): ng.IPromise<ITask> {
const job = this.buildJob(serverGroup, application, 'stopAppEngineServerGroup');
const command: ITaskCommand = {
job: [job],
application,
description: `Stop Server Group: ${serverGroup.name}`,
};
return TaskExecutor.executeTask(command);
}
示例4: registerInstanceWithTargetGroup
public registerInstanceWithTargetGroup(instance: IAmazonInstance, application: Application, params: any = {}): IPromise<ITask> {
params.type = 'registerInstancesWithLoadBalancer';
params.instanceIds = [instance.id];
params.targetGroupNames = instance.targetGroups;
params.region = instance.region;
params.credentials = instance.account;
params.cloudProvider = instance.cloudProvider;
return this.taskExecutor.executeTask({
job: [params],
application: application,
description: `Register instance: ${instance.id}`
});
}
示例5: deleteScalingPolicy
public deleteScalingPolicy(application: Application, serverGroup: IServerGroup, scalingPolicy: IScalingPolicy): IPromise<ITask> {
return this.taskExecutor.executeTask({
application,
description: 'Delete scaling policy ' + scalingPolicy.policyName,
job: [
{
type: 'deleteScalingPolicy',
cloudProvider: 'aws',
credentials: serverGroup.account,
region: serverGroup.region,
policyName: scalingPolicy.policyName,
serverGroupName: serverGroup.name,
}
]
});
}
示例6: deregisterInstancesFromTargetGroup
public deregisterInstancesFromTargetGroup(
instanceGroups: IMultiInstanceGroup[],
application: Application,
targetGroupNames: string[],
): IPromise<ITask> {
const jobs = this.buildMultiInstanceJob(
instanceGroups,
'deregisterInstancesFromLoadBalancer',
) as IAmazonMultiInstanceJob[];
jobs.forEach(job => (job.targetGroupNames = targetGroupNames));
const descriptor = this.buildMultiInstanceDescriptor(jobs, 'Deregister', `from ${targetGroupNames.join(' and ')}`);
return TaskExecutor.executeTask({
job: jobs,
application,
description: descriptor,
});
}