本文整理汇总了TypeScript中core/api.API.one方法的典型用法代码示例。如果您正苦于以下问题:TypeScript API.one方法的具体用法?TypeScript API.one怎么用?TypeScript API.one使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core/api.API
的用法示例。
在下文中一共展示了API.one方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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;
});
}
示例2: 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();
}
示例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;
});
}
示例4: getProjectClusters
public static getProjectClusters(projectName: string): IPromise<IProjectCluster[]> {
return API.one('projects', projectName)
.all('clusters')
.getList();
}
示例5: getProjectConfig
public static getProjectConfig(projectName: string): IPromise<IProject> {
return API.one('projects', projectName).get();
}
示例6: getPubsubSubscriptions
public static getPubsubSubscriptions(): IPromise<IPubsubSubscription[]> {
return API.one('pubsub')
.one('subscriptions')
.get();
}