UNPKG

@axway/axway-central-cli

Version:

Manage APIs, services and publish to the Amplify Marketplace

75 lines (70 loc) 2.71 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.graylogHelmOverrideTemplate = exports.GraylogAgentValues = void 0; var _types = require("../../../../common/types"); function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /** * @description Parameters to provide to the Graylog handlebars templates. */ class GraylogAgentValues { constructor() { _defineProperty(this, "namespace", void 0); _defineProperty(this, "url", void 0); _defineProperty(this, "graylogSecret", void 0); _defineProperty(this, "agentKeysSecret", void 0); _defineProperty(this, "userName", void 0); _defineProperty(this, "password", void 0); _defineProperty(this, "basePathSegmentLen", void 0); _defineProperty(this, "centralConfig", void 0); _defineProperty(this, "traceabilityConfig", void 0); this.namespace = { name: '', isNew: false }; this.url = ''; this.graylogSecret = ''; this.agentKeysSecret = ''; this.userName = ''; this.password = ''; this.basePathSegmentLen = 2; this.centralConfig = new _types.CentralAgentConfig(); this.traceabilityConfig = new _types.TraceabilityConfig(); } } /** * @description Generates the helm override file for the Amplify Graylog Agent. */ exports.GraylogAgentValues = GraylogAgentValues; const graylogHelmOverrideTemplate = () => { return `--- # Graylog Agent image overrides # image: # fullPath: # registry: docker.repository.axway.com # repository: ampc-beano-docker-prod/1.1 # name: graylog-agent # tag: # pullPolicy: IfNotPresent # pullSecret: graylog: url: {{url}} basePathSegmentLen: {{basePathSegmentLen}} secrets: graylog: name: {{graylogSecret}} agent: name: {{agentKeysSecret}} env: CENTRAL_REGION: {{centralConfig.region}} CENTRAL_ORGANIZATIONID: "{{centralConfig.orgId}}" CENTRAL_TEAM: {{centralConfig.ampcTeamName}} CENTRAL_ENVIRONMENT: {{centralConfig.environment}} CENTRAL_AGENTNAME: {{centralConfig.caAgentName}} CENTRAL_AUTH_CLIENTID: {{centralConfig.dosaAccount.clientId}} `; }; exports.graylogHelmOverrideTemplate = graylogHelmOverrideTemplate;