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


TypeScript api.service.Api類代碼示例

本文整理匯總了TypeScript中core/api/api.service.Api的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.Api類的具體用法?TypeScript service.Api怎麽用?TypeScript service.Api使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了service.Api類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getStrategiesForApplication

 public getStrategiesForApplication(applicationName: string): IPromise<IPipeline[]> {
   return this.API.one('applications').one(applicationName).all('strategyConfigs').getList()
     .then((pipelines: IPipeline[]) => {
     pipelines.forEach(p => p.stages = p.stages || []);
     return this.sortPipelines(pipelines);
   });
 }
開發者ID:jcwest,項目名稱:deck,代碼行數:7,代碼來源:pipelineConfig.service.ts

示例2: cancelTask

 public cancelTask(applicationName: string, taskId: string): IPromise<void> {
   return this.API.one('applications', applicationName).all('tasks').one(taskId, 'cancel').put().then(() =>
     this.taskReader.getTask(taskId).then((task) =>
       this.taskReader.waitUntilTaskMatches(task, (updatedTask) => updatedTask.status === 'CANCELED')
     )
   );
 }
開發者ID:jcwest,項目名稱:deck,代碼行數:7,代碼來源:task.write.service.ts

示例3: triggerPipeline

 public triggerPipeline(applicationName: string, pipelineName: string, body: any = {}): IPromise<string> {
   body.user = this.authenticationService.getAuthenticatedUser().name;
   return this.API.one('pipelines').one(applicationName).one(pipelineName).data(body).post()
     .then((result: ITriggerPipelineResponse) => {
       return result.ref.split('/').pop();
   });
 }
開發者ID:jcwest,項目名稱:deck,代碼行數:7,代碼來源:pipelineConfig.service.ts

示例4: getAllSecurityGroups

 public getAllSecurityGroups(): IPromise<ISecurityGroupsByAccountSourceData> {
   // Because these are cached in local storage, we unfortunately need to remove the moniker, as it triples the size
   // of the object being stored, which blows out our LS quota for a sufficiently large footprint
   const cache = this.infrastructureCaches.get('securityGroups');
   const cached = !!cache ? cache.get('allGroups') : null;
   if (cached) {
     return this.$q.resolve(cached);
   }
   return this.API.one('securityGroups').useCache().get()
     .then((groupsByAccount: ISecurityGroupsByAccountSourceData) => {
         Object.keys(groupsByAccount).forEach(account => {
           Object.keys(groupsByAccount[account]).forEach(provider => {
             Object.keys(groupsByAccount[account][provider]).forEach(region => {
               groupsByAccount[account][provider][region].forEach(group => {
                 delete group.moniker;
               })
             })
           })
         });
       if (cache) {
         cache.put('allGroups', groupsByAccount);
       }
       return groupsByAccount;
     });
 }
開發者ID:robfletcher,項目名稱:deck,代碼行數:25,代碼來源:securityGroupReader.service.ts

示例5: loadLoadBalancers

 public loadLoadBalancers(applicationName: string): IPromise<ILoadBalancerSourceData[]> {
   return this.API.one('applications', applicationName).all('loadBalancers').getList()
     .then((loadBalancers: ILoadBalancerSourceData[]) => {
       loadBalancers = this.loadBalancerTransformer.normalizeLoadBalancerSet(loadBalancers);
       return this.$q.all(loadBalancers.map(lb => this.normalizeLoadBalancer(lb)));
     });
 }
開發者ID:jcwest,項目名稱:deck,代碼行數:7,代碼來源:loadBalancer.read.service.ts

示例6: getServiceAccounts

 public getServiceAccounts(): ng.IPromise<string[]> {
   if (!this.settings.feature.fiatEnabled) {
     return this.$q.resolve([]);
   } else {
     return this.API.one('auth').one('user').one('serviceAccounts').get();
   }
 }
開發者ID:jtk54,項目名稱:deck,代碼行數:7,代碼來源:serviceAccount.service.ts

示例7: getPipelineTemplateFromSourceUrl

 public getPipelineTemplateFromSourceUrl(source: string, executionId?: String, pipelineConfigId?: string): IPromise<IPipelineTemplate> {
   return this.API.one('pipelineTemplates').one('resolve').withParams({ source, executionId, pipelineConfigId }).get()
     .then((template: IPipelineTemplate) => {
       template.selfLink = source;
       return template;
     });
 }
開發者ID:robfletcher,項目名稱:deck,代碼行數:7,代碼來源:pipelineTemplate.service.ts

示例8: listAllAccounts

 public listAllAccounts(provider: string = null, providerVersion: string = null): IPromise<IAccountDetails[]> {
   return this.API.one('credentials')
     .useCache()
     .withParams({ expand: true })
     .get()
     .then((accounts: IAccountDetails[]) => accounts.filter(account => !provider || account.type === provider))
     .then((accounts: IAccountDetails[]) => accounts.filter(account => !providerVersion || account.providerVersion === providerVersion));
 }
開發者ID:robfletcher,項目名稱:deck,代碼行數:8,代碼來源:account.service.ts

示例9: listAccounts

  public listAccounts(provider: string = null): ng.IPromise<IAccount[]> {

    let result: ng.IPromise<IAccount[]> = this.API.one('credentials').useCache().get();
    if (provider) {
      result = result.then((accounts: IAccount[]) => accounts.filter((account: IAccount) => account.type === provider));
    }

    return result;
  }
開發者ID:jtk54,項目名稱:deck,代碼行數:9,代碼來源:account.service.ts

示例10: getManifest

 public getManifest(account: string,
                    location: string,
                    name: string): IPromise<IManifest> {
   return this.API.all('manifests')
     .all(account)
     .all(location)
     .one(name)
     .get();
 }
開發者ID:robfletcher,項目名稱:deck,代碼行數:9,代碼來源:manifestReader.service.ts


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