当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript root.Root类代码示例

本文整理汇总了TypeScript中src/core/server/root.Root的典型用法代码示例。如果您正苦于以下问题:TypeScript Root类的具体用法?TypeScript Root怎么用?TypeScript Root使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Root类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: startNonCodeNodeKibana

 async function startNonCodeNodeKibana() {
   const setting = {
     server: {
       port: nonCodePort,
       uuid: nonodeNodeUuid,
     },
     plugins: { paths: [pluginPaths] },
     xpack: {
       ...xpackOption,
       code: { codeNodeUrl: `http://localhost:${codePort}` },
     },
   };
   nonCodeNode = createRootWithCorePlugins(setting);
   await nonCodeNode.setup();
   await nonCodeNode.start();
 }
开发者ID:elastic,项目名称:kibana,代码行数:16,代码来源:multi_node.ts

示例2: async

  before: async () => {
    await es.start();

    rootServer = kbnTestServer.createRootWithCorePlugins({
      server: { maxPayloadBytes: 100 },
    });

    await rootServer.start();
    legacyServer = kbnTestServer.getKbnServer(rootServer);
    return await legacyServer.plugins.elasticsearch.waitUntilReady();
  },
开发者ID:gingerwizard,项目名称:kibana,代码行数:11,代码来源:kibana.test.ts

示例3: describe

describe('code in multiple nodes', () => {
  const codeNodeUuid = 'c4add484-0cba-4e05-86fe-4baa112d9e53';
  const nonodeNodeUuid = '22b75e04-0e50-4647-9643-6b1b1d88beaf';
  let codePort: number;
  let nonCodePort: number;
  let nonCodeNode: Root;
  let servers: any;
  const pluginPaths = resolve(__dirname, '../../../../../x-pack');

  async function startServers() {
    servers = await startTestServers({
      adjustTimeout: t => {
        // @ts-ignore
        this.timeout(t);
      },
      settings: {
        kbn: {
          server: {
            uuid: codeNodeUuid,
            port: codePort,
          },
          plugins: { paths: [pluginPaths] },
          xpack: xpackOption,
        },
      },
    });

    await getKbnServer(servers.root).server.plugins.elasticsearch.waitUntilReady();
  }

  async function startNonCodeNodeKibana() {
    const setting = {
      server: {
        port: nonCodePort,
        uuid: nonodeNodeUuid,
      },
      plugins: { paths: [pluginPaths] },
      xpack: {
        ...xpackOption,
        code: { codeNodeUrl: `http://localhost:${codePort}` },
      },
    };
    nonCodeNode = createRootWithCorePlugins(setting);
    await nonCodeNode.setup();
    await nonCodeNode.start();
  }

  // @ts-ignore
  before(async function() {
    nonCodePort = await getPort();
    codePort = await getPort();

    // @ts-ignore
    await startServers.bind(this)();
    await startNonCodeNodeKibana();
  });

  // @ts-ignore
  after(async function() {
    await nonCodeNode.shutdown();
    await servers.stop();
  });

  it('Code node setup should be ok', async () => {
    await request.get(servers.root, '/api/code/setup').expect(200);
  });

  it('Non-code node setup should be ok', async () => {
    await request.get(nonCodeNode, '/api/code/setup').expect(200);
  });

  it('Non-code node setup should fail if code node is shutdown', async () => {
    await servers.root.shutdown();
    await request.get(nonCodeNode, '/api/code/setup').expect(502);

    // TODO restart root clearly is hard to do during platform migration
    // A clear way is to createEsCluster individually and not reuse the
    // same root

    // @ts-ignore
  }).timeout(20000);
});
开发者ID:elastic,项目名称:kibana,代码行数:82,代码来源:multi_node.ts

示例4: after

 after(async function() {
   await nonCodeNode.shutdown();
   await servers.stop();
 });
开发者ID:elastic,项目名称:kibana,代码行数:4,代码来源:multi_node.ts


注:本文中的src/core/server/root.Root类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。