本文整理汇总了TypeScript中@spinnaker/core.API.one方法的典型用法代码示例。如果您正苦于以下问题:TypeScript API.one方法的具体用法?TypeScript API.one怎么用?TypeScript API.one使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@spinnaker/core.API
的用法示例。
在下文中一共展示了API.one方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getImage
public getImage(amiName: string, region: string, credentials: string): IPromise<IAmazonImage> {
return API.one('images')
.one(credentials)
.one(region)
.one(amiName)
.withParams({ provider: 'aws' })
.get()
.then((results: any[]) => (results && results.length ? results[0] : null))
.catch(() => null as IAmazonImage);
}
示例2: findImages
public findImages(params: { q: string; region?: string }): IPromise<IAmazonImage[]> {
if (!params.q || params.q.length < 3) {
return $q.when([{ message: 'Please enter at least 3 characters...', disabled: true }]) as any;
}
return API.one('images/find')
.withParams(params)
.get()
.catch(() => [] as IAmazonImage[]);
}
示例3: findImages
public static findImages(account: string): IPromise<ICloudFoundryCluster[]> {
return API.one('images/find')
.withParams({
account,
provider: 'cloudfoundry',
})
.get()
.then(function(results: any) {
return results;
})
.catch((): any[] => []);
}
示例4: getEvents
public static getEvents(serverGroup: IServerGroup): IPromise<IEventDescription[]> {
return API.one('applications')
.one(serverGroup.app)
.one('serverGroups')
.all(serverGroup.account)
.one(serverGroup.name)
.all('events')
.withParams({
region: serverGroup.region,
provider: serverGroup.cloudProvider,
})
.getList()
.catch((error: any): any[] => {
$log.error(error, 'error retrieving events');
return [];
});
}
示例5: getConfig
public getConfig(clusterName: string): IPromise<IClusterConfig> {
return API.one('configbin', 'cloudwatch-forwarding', clusterName).get();
}
示例6: getPubsubSubscriptions
public static getPubsubSubscriptions(): IPromise<IPubsubSubscription[]> {
return API.one('pubsub')
.one('subscriptions')
.get();
}
示例7: getOidcConfigsByApp
public static getOidcConfigsByApp(app: string): IPromise<IAuthenticateOidcActionConfig[]> {
return API.one('oidcConfigs')
.withParams({ app })
.getList();
}