本文整理汇总了TypeScript中@spinnaker/core.API类的典型用法代码示例。如果您正苦于以下问题:TypeScript API类的具体用法?TypeScript API怎么用?TypeScript API使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了API类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: getImage
public static getImage(imageName: string, region: string, credentials: string): IPromise<IDockerImage> {
return API.all('images')
.one(credentials)
.one(region)
.one(imageName)
.withParams({ provider: 'docker' })
.get()
.then((results: IDockerImage[]) => (results && results.length ? results[0] : null))
.catch((): IDockerImage => null);
}
示例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: 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);
}
示例4: 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[] => []);
}
示例5: 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 [];
});
}
示例6:
() => API.all('images/tags').getList(params),
示例7: listSecrets
public listSecrets(): ng.IPromise<ISecretDescriptor[]> {
return API.all('ecs')
.all('secrets')
.getList();
}
示例8: getConfig
public getConfig(clusterName: string): IPromise<IClusterConfig> {
return API.one('configbin', 'cloudwatch-forwarding', clusterName).get();
}
示例9: listKeyPairs
public static listKeyPairs(): IPromise<IKeyPair[]> {
return API.all('keyPairs')
.useCache()
.getList()
.then((keyPairs: IKeyPair[]) => keyPairs.sort((a, b) => a.keyName.localeCompare(b.keyName)));
}