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


TypeScript api.API類代碼示例

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


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

示例1: getSnapshotHistory

 public static getSnapshotHistory(application: string, account: string, params = {}): IPromise<ISnapshot[]> {
   return API.one('applications')
     .one(application)
     .one('snapshots')
     .one(account)
     .one('history')
     .withParams(params)
     .getList();
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:9,代碼來源:SnapshotReader.ts

示例2: getApplicationAttributes

 public static getApplicationAttributes(name: string): IPromise<any> {
   return API.one('applications', name)
     .withParams({ expand: false })
     .get()
     .then((fromServer: Application) => {
       this.splitAttributes(fromServer.attributes, ['accounts', 'cloudProviders']);
       return fromServer.attributes;
     });
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:9,代碼來源:ApplicationReader.ts

示例3: getApplication

 public static getApplication(name: string, expand = true): IPromise<Application> {
   return API.one('applications', name)
     .withParams({ expand: expand })
     .get()
     .then((fromServer: Application) => {
       const configs: IDataSourceConfig[] = ApplicationDataSourceRegistry.getDataSources();
       const application: Application = new Application(fromServer.name, SchedulerFactory.createScheduler(), configs);
       application.attributes = fromServer.attributes;
       this.splitAttributes(application.attributes, ['accounts', 'cloudProviders']);
       this.setDisabledDataSources(application);
       application.refresh();
       return application;
     });
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:14,代碼來源:ApplicationReader.ts

示例4: listApplications

 public static listApplications(): IPromise<IApplicationSummary[]> {
   return API.all('applications')
     .useCache()
     .getList();
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:5,代碼來源:ApplicationReader.ts

示例5: listProjects

 public static listProjects(): IPromise<IProject[]> {
   return API.all('projects').getList();
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:3,代碼來源:ProjectReader.ts

示例6: getProjectClusters

 public static getProjectClusters(projectName: string): IPromise<IProjectCluster[]> {
   return API.one('projects', projectName)
     .all('clusters')
     .getList();
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:5,代碼來源:ProjectReader.ts

示例7: getProjectConfig

 public static getProjectConfig(projectName: string): IPromise<IProject> {
   return API.one('projects', projectName).get();
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:3,代碼來源:ProjectReader.ts

示例8: getPubsubSubscriptions

 public static getPubsubSubscriptions(): IPromise<IPubsubSubscription[]> {
   return API.one('pubsub')
     .one('subscriptions')
     .get();
 }
開發者ID:emjburns,項目名稱:deck,代碼行數:5,代碼來源:PubsubSubscriptionReader.ts


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