當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。