本文整理汇总了TypeScript中core/application.ApplicationModelBuilder.createApplication方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ApplicationModelBuilder.createApplication方法的具体用法?TypeScript ApplicationModelBuilder.createApplication怎么用?TypeScript ApplicationModelBuilder.createApplication使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core/application.ApplicationModelBuilder
的用法示例。
在下文中一共展示了ApplicationModelBuilder.createApplication方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("scrapes application load balancers' server groups to determine skin if possible", () => {
const app = appBuilder.createApplication('myApp', [
{
key: 'loadBalancers',
data: [
{
name: 'myLoadBalancer',
account: 'v2-k8s-account',
cloudProvider: 'kubernetes',
instances: [],
serverGroups: [
{
isDisabled: true,
instances: [{ id: 'my-instance-id' }],
},
],
},
],
},
{
key: 'serverGroups',
data: [],
},
]);
SkinService.getInstanceSkin('kubernetes', 'my-instance-id', app).then(skin => {
expect(skin).toEqual('v2');
});
scope.$digest();
});
示例2: it
it('scrapes application load balancers to determine provider version if possible', () => {
const app = appBuilder.createApplication('myApp', [
{
key: 'loadBalancers',
data: [
{
name: 'myLoadBalancer',
account: 'v2-k8s-account',
cloudProvider: 'kubernetes',
instances: [
{ id: 'my-instance-id' },
]
}
]
},
{
key: 'serverGroups',
data: [],
},
]);
service.getInstanceProviderVersion('kubernetes', 'my-instance-id', app).then(providerVersion => {
expect(providerVersion).toEqual('v2');
});
scope.$digest();
});
示例3: it
it('creates separate template options for each account and region of a cluster', () => {
application = applicationModelBuilder.createApplication('app', { key: 'serverGroups', lazy: true });
application.getDataSource('serverGroups').data = [
{
name: 'sg1',
cluster: 'cluster1',
account: 'test',
region: 'us-east-1',
cloudProvider: 'aws',
category: 'serverGroup',
},
{
name: 'sg2',
cluster: 'cluster1',
account: 'prod',
region: 'us-east-1',
cloudProvider: 'aws',
category: 'serverGroup',
},
{
name: 'sg2',
cluster: 'cluster1',
account: 'prod',
region: 'us-east-1',
cloudProvider: 'aws',
category: 'serverGroup',
},
];
initialize();
const templates = ctrl.templates;
expect(templates.length).toBe(3);
// first template is always "None"
expect(templates[0].label).toBe('None');
expect(templates[1].cluster).toBe('cluster1');
expect(templates[1].cluster).toBe('cluster1');
expect(templates[2].cluster).toBe('cluster1');
});