本文整理匯總了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;
}