How to use the yarn.protocol function in yarn

To help you get started, we’ve selected a few yarn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apache / ambari / contrib / views / tez / src / main / resources / ui / ambari-scripts / init-view.js View on Github external
"//" +
      window.location.hostname +
      (window.location.port ? ':' + window.location.port: ''),
      urlParts = getViewInfoFromPathname(),
      // .replace() call is necessary to work properly behind the proxy
      resourcesPrefix = '/api/v1/views/%@/versions/%@/instances/%@/resources/'.replace(/^\//, '').fmt(
        urlParts[0],
        urlParts[1],
        urlParts[2]
      );

  parameters = parameters || {};

  return {
    host: host,
    yarnProtocol: parameters["yarn.protocol"],
    resourcesPrefix: resourcesPrefix,
    namespaces: {
      webService: {
        timeline: '%@atsproxy/ws/v1/timeline'.fmt(resourcesPrefix),
        appHistory: '%@atsproxy/ws/v1/applicationhistory'.fmt(resourcesPrefix),
        rm: '%@rmproxy/ws/v1/cluster'.fmt(resourcesPrefix),
        am: '%@rmproxy/proxy/{app_id}/ws/v{version:2}/tez'.fmt(resourcesPrefix)
      },
      web: {
        rm: '%@rmredirect/cluster'.fmt(resourcesPrefix)
      },
    }
  };
}
github apache / ambari / contrib / views / tez / src / main / resources / ui / scripts / init-ambari-view.js View on Github external
(window.location.port ? ':' + window.location.port: ''),
      urlParts = location.pathname.split('/'),
      resourcesPrefix = 'api/v1/views/%@/versions/%@/instances/%@/resources/'.fmt(
        urlParts[2],
        urlParts[3],
        urlParts[4]
      );

  parameters = parameters || {};

  $.extend(true, App.Configs, {
    envDefaults: {
      isStandalone: false,
      timelineBaseUrl: host,
      RMWebUrl: host,
      yarnProtocol: parameters["yarn.protocol"]
    },
    restNamespace: {
      timeline: '%@atsproxy/ws/v1/timeline'.fmt(resourcesPrefix),
      applicationHistory: '%@atsproxy/ws/v1/applicationhistory'.fmt(resourcesPrefix),

      aminfo: '%@rmproxy/proxy/__app_id__/ws/v1/tez'.fmt(resourcesPrefix),
      aminfoV2: '%@rmproxy/proxy/__app_id__/ws/v2/tez'.fmt(resourcesPrefix),
      cluster: '%@rmproxy/ws/v1/cluster'.fmt(resourcesPrefix)
    },
    otherNamespace: {
      cluster: '%@rmredirect/cluster'.fmt(resourcesPrefix)
    }
  });

  App.TimelineRESTAdapter.reopen({
    namespace: App.Configs.restNamespace.timeline