本文整理汇总了TypeScript中core/cloudProvider.CloudProviderRegistry类的典型用法代码示例。如果您正苦于以下问题:TypeScript CloudProviderRegistry类的具体用法?TypeScript CloudProviderRegistry怎么用?TypeScript CloudProviderRegistry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CloudProviderRegistry类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should use the specified provider from the configuration', () => {
let provider = '';
hasValue = true;
accounts = [fakeAccount('aws'), fakeAccount('titus')];
CloudProviderRegistry.registerProvider('aws', { securityGroup: {} } as any);
CloudProviderRegistry.registerProvider('titus', { securityGroup: { useProvider: 'aws' } } as any);
providerService.selectProvider(application, 'securityGroup').then(_provider => {
provider = _provider;
});
$scope.$digest();
expect(provider).toBe('aws');
});
示例2: it
it('should use the provider "selected" from the "modal"', () => {
let provider = '';
hasValue = true;
accounts = [fakeAccount('aws'), fakeAccount('titus'), fakeAccount('testProvider')];
CloudProviderRegistry.registerProvider('aws', { securityGroup: {} } as any);
CloudProviderRegistry.registerProvider('titus', { securityGroup: { useProvider: 'aws' } } as any);
CloudProviderRegistry.registerProvider('testProvider', config);
ProviderSelectionService.selectProvider(application, 'securityGroup').then(_provider => {
provider = _provider;
});
$scope.$digest();
expect(provider).toBe('modalProvider');
});
示例3:
accountDetails.forEach(accountDetail => {
if (CloudProviderRegistry.getValue(accountDetail.cloudProvider, 'snapshotsEnabled')) {
jobs.push({
type: 'saveSnapshot',
credentials: accountDetail.name,
applicationName: app.name,
cloudProvider: accountDetail.cloudProvider,
});
}
});
示例4: buildRestoreSnapshotJob
private static buildRestoreSnapshotJob(app: Application, accountDetail: IAccountDetails, timestamp: number) {
const jobs: IJob[] = [];
if (CloudProviderRegistry.getValue(accountDetail.cloudProvider, 'snapshotsEnabled')) {
jobs.push({
type: 'restoreSnapshot',
credentials: accountDetail.name,
applicationName: app.name,
snapshotTimestamp: timestamp,
cloudProvider: accountDetail.cloudProvider,
});
}
return jobs;
}