當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript cloudProvider.CloudProviderRegistry類代碼示例

本文整理匯總了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');
  });
開發者ID:mizzy,項目名稱:deck,代碼行數:13,代碼來源:providerSelection.service.spec.ts

示例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');
  });
開發者ID:spinnaker,項目名稱:deck,代碼行數:14,代碼來源:ProviderSelectionService.spec.ts

示例3:

 accountDetails.forEach(accountDetail => {
   if (CloudProviderRegistry.getValue(accountDetail.cloudProvider, 'snapshotsEnabled')) {
     jobs.push({
       type: 'saveSnapshot',
       credentials: accountDetail.name,
       applicationName: app.name,
       cloudProvider: accountDetail.cloudProvider,
     });
   }
 });
開發者ID:emjburns,項目名稱:deck,代碼行數:10,代碼來源:SnapshotWriter.ts

示例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;
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:13,代碼來源:SnapshotWriter.ts


注:本文中的core/cloudProvider.CloudProviderRegistry類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。