Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zowelog zss format handler #160

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions c/datasetService.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

#ifdef __ZOWE_OS_ZOS
static int serveDatasetMetadata(HttpService *service, HttpResponse *response) {
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);
HttpRequest *request = response->request;
if (!strcmp(request->method, methodGET)) {
if (service->userPointer == NULL){
Expand All @@ -54,7 +54,7 @@ static int serveDatasetMetadata(HttpService *service, HttpResponse *response) {
}

char *l1 = stringListPrint(request->parsedFile, 1, 1, "/", 0); //expect name or hlq
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "l1=%s\n", l1);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_INFO, "l1=%s\n", l1);
if (!strcmp(l1, "name")){
respondWithDatasetMetadata(response);
}
Expand All @@ -81,20 +81,20 @@ static int serveDatasetMetadata(HttpService *service, HttpResponse *response) {
finishResponse(response);
}

zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG2, "end %s\n", __FUNCTION__);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_DEBUG2, "end %s\n", __FUNCTION__);
return 0;
}

static int serveDatasetContents(HttpService *service, HttpResponse *response){
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);
HttpRequest *request = response->request;

if (!strcmp(request->method, methodGET)) {
char *l1 = stringListPrint(request->parsedFile, 1, 1, "/", 0);
char *percentDecoded = cleanURLParamValue(response->slh, l1);
char *filenamep1 = stringConcatenate(response->slh, "//'", percentDecoded);
char *filename = stringConcatenate(response->slh, filenamep1, "'");
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "Serving: %s\n", filename);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_INFO, "Serving: %s\n", filename);
fflush(stdout);
respondWithDataset(response, filename, TRUE);
}
Expand All @@ -103,7 +103,7 @@ static int serveDatasetContents(HttpService *service, HttpResponse *response){
char *percentDecoded = cleanURLParamValue(response->slh, l1);
char *filenamep1 = stringConcatenate(response->slh, "//'", percentDecoded);
char *filename = stringConcatenate(response->slh, filenamep1, "'");
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "Updating if exists: %s\n", filename);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_INFO, "Updating if exists: %s\n", filename);
fflush(stdout);
updateDataset(response, filename, TRUE);

Expand All @@ -113,7 +113,7 @@ static int serveDatasetContents(HttpService *service, HttpResponse *response){
char *percentDecoded = cleanURLParamValue(response->slh, l1);
char *filenamep1 = stringConcatenate(response->slh, "//'", percentDecoded);
char *filename = stringConcatenate(response->slh, filenamep1, "'");
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "Deleting if exists: %s\n", filename);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_INFO, "Deleting if exists: %s\n", filename);
fflush(stdout);
deleteDatasetOrMember(response, filename);
}
Expand All @@ -132,24 +132,24 @@ static int serveDatasetContents(HttpService *service, HttpResponse *response){

finishResponse(response);
}
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG2, "end %s\n", __FUNCTION__);
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "Returning from servedatasetcontents\n");
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_DEBUG2, "end %s\n", __FUNCTION__);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_INFO, "Returning from servedatasetcontents\n");
return 0;
}

static int serveVSAMDatasetContents(HttpService *service, HttpResponse *response){
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);
HttpRequest *request = response->request;
serveVSAMCache *cache = (serveVSAMCache *)service->userPointer;
if (!strcmp(request->method, methodGET)) {
char *filename = stringListPrint(request->parsedFile, 1, 1, "/", 0);
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "Serving: %s\n", filename);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_INFO, "Serving: %s\n", filename);
fflush(stdout);
respondWithVSAMDataset(response, filename, cache->acbTable, TRUE);
}
else if (!strcmp(request->method, methodPOST)){
char *filename = stringListPrint(request->parsedFile, 1, 1, "/", 0);
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "Updating if exists: %s\n", filename);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_INFO, "Updating if exists: %s\n", filename);
fflush(stdout);
updateVSAMDataset(response, filename, cache->acbTable, TRUE);
}
Expand All @@ -158,7 +158,7 @@ static int serveVSAMDatasetContents(HttpService *service, HttpResponse *response
char *percentDecoded = cleanURLParamValue(response->slh, l1);
char *filenamep1 = stringConcatenate(response->slh, "//'", percentDecoded);
char *filename = stringConcatenate(response->slh, filenamep1, "'");
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "Deleting if exists: %s\n", filename);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_INFO, "Deleting if exists: %s\n", filename);
fflush(stdout);
deleteVSAMDataset(response, filename);
}
Expand All @@ -177,14 +177,14 @@ static int serveVSAMDatasetContents(HttpService *service, HttpResponse *response

finishResponse(response);
}
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG2, "end %s\n", __FUNCTION__);
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "Returning from serveVSAMdatasetcontents\n");
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_DEBUG2, "end %s\n", __FUNCTION__);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_INFO, "Returning from serveVSAMdatasetcontents\n");
return 0;
}

void installDatasetContentsService(HttpServer *server) {
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "Installing dataset contents service\n");
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_INFO, "Installing dataset contents service\n");
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);

HttpService *httpService = makeGeneratedService("datasetContents", "/datasetContents/**");
httpService->authType = SERVICE_AUTH_NATIVE_WITH_SESSION_TOKEN;
Expand All @@ -195,8 +195,8 @@ void installDatasetContentsService(HttpServer *server) {
}

void installVSAMDatasetContentsService(HttpServer *server) {
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "Installing VSAM dataset contents service\n");
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_INFO, "Installing VSAM dataset contents service\n");
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);

HttpService *httpService = makeGeneratedService("VSAMdatasetContents", "/VSAMdatasetContents/**");
httpService->authType = SERVICE_AUTH_NATIVE_WITH_SESSION_TOKEN;
Expand All @@ -212,8 +212,8 @@ void installVSAMDatasetContentsService(HttpServer *server) {
}

void installDatasetMetadataService(HttpServer *server) {
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "Installing dataset metadata service\n");
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_INFO, "Installing dataset metadata service\n");
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);


HttpService *httpService = makeGeneratedService("datasetMetadata", "/datasetMetadata/**");
Expand Down
10 changes: 5 additions & 5 deletions c/rasService.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ static int serveRASData(HttpService *service, HttpResponse *response) {

char *command = stringListPrint(request->parsedFile, 1, 1, "/", 0);
if (command == NULL) {
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_WARNING, "httpserver: error - RAS command not provided\n");
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_WARNING, "httpserver: error - RAS command not provided\n");
respondWithError(response, HTTP_STATUS_BAD_REQUEST, "RAS command not provided");
return 0;
}

if (strcmp(command, "traceLevel")) {
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_WARNING, "httpserver: error - unsupported RAS command, %s\n", command);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_WARNING, "httpserver: error - unsupported RAS command, %s\n", command);
respondWithError(response, HTTP_STATUS_BAD_REQUEST, "unsupported RAS command");
return 0;
}
Expand All @@ -150,7 +150,7 @@ static int serveRASData(HttpService *service, HttpResponse *response) {
return 0;
}

zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_INFO, "%s: componentID=0x%016llX\n", __FUNCTION__, componentID);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_INFO, "%s: componentID=0x%016llX\n", __FUNCTION__, componentID);

if (!strcmp(request->method, methodPUT)) {

Expand Down Expand Up @@ -223,7 +223,7 @@ static int serveRASData(HttpService *service, HttpResponse *response) {
}

int installRASService(HttpServer *server) {
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__);
HttpService *httpService = makeGeneratedService("RAS service", "/ras/**");
httpService->serviceFunction = serveRASData;
httpService->runInSubtask = FALSE;
Expand All @@ -233,7 +233,7 @@ int installRASService(HttpServer *server) {
makeIntParamSpec("level", SERVICE_ARG_OPTIONAL, 0, 0, 0, 0,
NULL));
registerHttpService(server, httpService);
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG2, "end %s\n", __FUNCTION__);
zowelog(NULL, LOG_COMP_ID_ZSS, ZOWE_LOG_DEBUG2, "end %s\n", __FUNCTION__);
return 0;
}

Expand Down
Loading