diff --git a/config/zluxserver.json b/config/zluxserver.json index 897ef86a0..18fce3957 100644 --- a/config/zluxserver.json +++ b/config/zluxserver.json @@ -9,6 +9,14 @@ "http": { "port": 8543 }, + "mediationLayer": { + "server": { + "hostname": "localhost", + "port": 10011, + "isHttps": false + }, + "enabled": false + }, "childProcesses": [ { "path": "../bin/zssServer.sh", diff --git a/doc/swagger/fileapi.json b/doc/swagger/fileapi.json new file mode 100644 index 000000000..ae31d6e75 --- /dev/null +++ b/doc/swagger/fileapi.json @@ -0,0 +1,595 @@ +{ + "swagger": "2.0", + "info": { + "description": "This service describes some of the operations involved with commands at the root", + "version": "1.0.0", + "title": "TBD" + }, + "host": "localhost", + "basePath": "/", + "schemes": [ + "http", + "https" + ], + "tags": [ + { + "name": "basic", + "description": "Basic Application Information" + }, + { + "name": "swagger", + "description": "Zoe plugin swagger documentation" + }, + { + "name": "api", + "description": "Raw JSON catalog" + } + ], + "paths": { + "/datasetMetadata/hlq": { + "get": { + "summary": "Returns JSON array of the system's high level qualifiers and metadata parameters", + "description": "HLQ and metadata parameters", + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "updateCache", + "in": "query", + "description": "Cache results for future", + "required": false, + "type": "boolean" + }, + { + "name": "types", + "in": "query", + "description": "Overrides defaults for CSI types to be scanned for", + "required": false, + "type": "string" + }, + { + "name": "workAreaSize", + "in": "query", + "description": "Sets buffer size for CSI result", + "required": false, + "type": "integer" + }, + { + "name": "resumeName", + "in": "query", + "description": "Resume from when response.hasMore != 0", + "required": false, + "type": "string" + }, + { + "name": "resumeCatalogName", + "in": "query", + "description": "Resume from when hasMore != 0", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Metadata" + } + }, + "400": { + "description": "Invalid status value" + } + } + } + }, + "/datasetMetadata/name/{dataset}": { + "get": { + "summary": "Retrieves info about datasets", + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "dataset", + "in": "path", + "description": "Cache results for future", + "required": true, + "type": "string" + }, + { + "name": "detail", + "in": "query", + "description": "Used to provide the details of each dataset rather than a summary of which were found. Defaults to retrieve name, type, volser", + "required": false, + "type": "boolean" + }, + { + "name": "types", + "in": "query", + "description": "csi entry type to search, Overrides defaults for the CSI types to be scanned for", + "required": false, + "type": "string" + }, + { + "name": "listMembers", + "in": "query", + "description": "Omits or includes PDS member scanning", + "required": false, + "type": "boolean" + }, + { + "name": "workAreaSize", + "in": "query", + "description": "Sets buffer size for CSI result", + "required": false, + "type": "integer" + }, + { + "name": "includeMigrated", + "in": "query", + "description": "Include migrated datasets", + "required": false, + "type": "boolean" + }, + { + "name": "includeUnprintable", + "in": "query", + "description": "Include PDS member listing for PDS members with exceptional names", + "required": false, + "type": "boolean" + }, + { + "name": "resumeName", + "in": "query", + "description": "Resume from when response.hasMore != 0", + "required": false, + "type": "string" + }, + { + "name": "resumeCatalogName", + "in": "query", + "description": "Resume from when hasMore != 0", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "$ref": "#/definitions/Metadata" + } + }, + "400": { + "description": "Have only one of resumename, resumecatalogname or if either longer than 44 or invalid dataset" + } + } + } + }, + "/datasetContents/{dataset}": { + "get": { + "summary": "Get contents of a dataset via QSAM as a series of records", + "parameters": [ + { + "name": "dataset", + "in": "path", + "description": "Cache results for future", + "required": true, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "object", + "properties": { + "records": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "404": { + "description": "File could not be opened or does not exist" + } + } + }, + "post": { + "summary": "Updates contents of dataset", + "parameters": [ + { + "name": "dataset", + "in": "path", + "description": "Cache results for future", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "records": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "text/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "File could not be opened or does not exist" + } + } + } + }, + "/VSAMdatasetContents/{dataset}": { + "get": { + "summary": "Get a VSAM dataset", + "parameters": [ + { + "name": "dataset", + "in": "path", + "description": "Cache results for future", + "required": true, + "type": "string" + }, + { + "name": "closeAfter", + "in": "query", + "description": "retain pointer for VSAM dataset", + "required": false, + "type": "boolean" + } + ], + "produces": [ + "application/plain" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "object", + "properties": { + "records": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "404": { + "description": "File could not be opened or does not exist" + } + } + }, + "post": { + "summary": "Updates contents of dataset", + "parameters": [ + { + "name": "dataset", + "in": "path", + "description": "Cache results for future", + "required": true, + "type": "string" + }, + { + "name": "closeAfter", + "in": "query", + "description": "retain pointer for VSAM dataset", + "required": false, + "type": "boolean" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "records": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "text/plain" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "File could not be opened or does not exist" + } + } + } + }, + "/unixFileContents/{path}": { + "get": { + "summary": "returns directory listing if exists", + "parameters": [ + { + "name": "path", + "in": "path", + "description": "Path for file or directory", + "required": true, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "object", + "properties": { + "entries": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "directory": { + "type": "boolean" + }, + "size": { + "type": "integer" + }, + "ccsid": { + "type": "integer" + }, + "createdAt": { + "type": "integer" + }, + "mode": { + "type": "integer" + } + } + } + } + } + } + }, + "404": { + "description": "file not found", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + } + } + } + } + }, + "/unixFileContents/{directory}/{file}": { + "get": { + "summary": "returns file if exists", + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "directory", + "in": "path", + "description": "Directory where file is located", + "required": true, + "type": "string" + }, + { + "name": "file", + "in": "path", + "description": "file name", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "successful operation", + "schema": { + "type": "string" + } + }, + "404": { + "description": "file not found", + "schema": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + } + } + } + }, + "post": { + "summary": "Creates file", + "parameters": [ + { + "name": "user", + "in": "path", + "description": "username", + "required": true, + "type": "string" + }, + { + "name": "file", + "in": "path", + "description": "specefic file to create", + "required": true, + "type": "string" + } + ], + "consumes": [ + "text/plain" + ], + "responses": { + "200": { + "description": "file created" + }, + "404": { + "description": "file could not be opened or does not exist" + } + } + }, + "put": { + "summary": "Updates contents of file", + "parameters": [ + { + "name": "user", + "in": "path", + "description": "user", + "required": true, + "type": "string" + }, + { + "name": "file", + "in": "path", + "description": "existing file to update", + "required": true, + "type": "string" + } + ], + "consumes": [ + "text/plain" + ], + "responses": { + "200": { + "description": "file updated" + }, + "404": { + "description": "file could not be opened or does not exist" + } + } + } + } + }, + "definitions": { + "Metadata": { + "type": "object", + "properties": { + "_objectType": { + "type": "string" + }, + "_metadataVersion": { + "type": "string" + }, + "hasMore": { + "type": "integer" + }, + "datasets": { + "type": "array", + "items": { + "$ref": "#/definitions/Dataset" + } + } + } + }, + "Dataset": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "csiEntryType": { + "type": "string" + }, + "volser": { + "type": "string" + }, + "recfm": { + "type": "object", + "properties": { + "recordLength": { + "type": "string" + }, + "isBlocked": { + "type": "boolean" + }, + "carriageControl": { + "type": "string" + } + } + }, + "dsorg": { + "type": "object", + "properties": { + "organization": { + "type": "string" + }, + "isPDSDir": { + "type": "boolean" + }, + "maxRecordLen": { + "type": "integer" + }, + "totalBlockSize": { + "type": "integer" + } + } + }, + "members": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/js/zluxArgs.js b/js/zluxArgs.js index f56e1b380..4a3ef79bf 100644 --- a/js/zluxArgs.js +++ b/js/zluxArgs.js @@ -73,6 +73,10 @@ const DEFAULT_CONFIG = { "node": { "http": { "port": 8543 + }, + "eureka": { + "hostname": "localhost", + "port": 10011 } }, "dataserviceAuthentication": { @@ -96,6 +100,8 @@ const MVD_ARGS = [ new argParser.CLIArgument('noChild', null, argParser.constants.ARG_TYPE_FLAG), new argParser.CLIArgument('allowInvalidTLSProxy', null, argParser.constants.ARG_TYPE_VALUE), + new argParser.CLIArgument('mlUser', 'mu', argParser.constants.ARG_TYPE_VALUE), + new argParser.CLIArgument('mlPass', 'mp', argParser.constants.ARG_TYPE_VALUE) ]; var config; @@ -104,6 +110,7 @@ var commandArgs = process.argv.slice(2); var argumentParser = argParser.createParser(MVD_ARGS); var userInput = argumentParser.parse(commandArgs); var noPrompt = false; + if (userInput.noPrompt) { noPrompt = true; } @@ -118,6 +125,13 @@ for (const attribute in userConfig) { configJSON[attribute] = userConfig[attribute]; } let hostPort = userInput.hostPort; +let eUser = userInput.mlUser; +let ePass = userInput.mlPass; +if(eUser && ePass){ + configJSON.node.mediationLayer.enabled = true; + configJSON.node.mediationLayer.instance.instanceId = `${configJSON.node.mediationLayer.instance.app}:${Math.floor(Math.random() * 9999)}`; + configJSON.node.mediationLayer.eureka.serviceUrls.default = [`http://${eUser}:${ePass}@${configJSON.node.mediationLayer.server.hostname}:${configJSON.node.mediationLayer.server.port}/eureka/apps/`]; +} if (!hostPort) { hostPort = configJSON.zssPort; }