You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/09/24 09:47:22 UTC

[incubator-dlab] 03/03: request methods mapping

This is an automated email from the ASF dual-hosted git repository.

ankovalyshyn pushed a commit to branch DLAB-1056
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit ce2cc0027b2437bb61f61f906cc82d90f3afe113
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Tue Sep 24 12:40:12 2019 +0300

    request methods mapping
---
 .../resources/webapp/src/app/core/core.module.ts   |   2 +-
 .../services/applicationServiceFacade.service.ts   | 158 ++++++++++-----------
 .../webapp/src/app/core/util/http-methods.ts       |  11 ++
 .../webapp/src/app/core/util/http-status-codes.ts  | 106 +++++++-------
 .../resources/webapp/src/app/core/util/index.ts    |   1 +
 5 files changed, 145 insertions(+), 133 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts b/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts
index 9e3baba..49720ef 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts
@@ -47,7 +47,7 @@ import { HttpTokenInterceptor } from './interceptors/http.token.interceptor';
 import { NoCacheInterceptor } from './interceptors/nocache.interceptor';
 import { ErrorInterceptor } from './interceptors/error.interceptor';
 
-import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
+import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
 
 @NgModule({
   imports: [CommonModule],
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
index addc5c5..b3730da 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/applicationServiceFacade.service.ts
@@ -18,13 +18,13 @@
  */
 
 import { Injectable } from '@angular/core';
-import { RequestMethod } from '@angular/http';
 import { Observable } from 'rxjs';
 import { HttpClient } from '@angular/common/http';
 
 import { Dictionary } from '../collections';
 
 import { environment } from '../../../environments/environment';
+import { HTTPMethod } from '../util';
 
 // we can now access environment.apiUrl
 const API_URL = environment.apiUrl;
@@ -83,21 +83,21 @@ export class ApplicationServiceFacade {
   }
 
   public buildLoginRequest(body: any): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.LOGIN),
       body,
       { responseType: 'text', observe: 'response' });
   }
 
   public buildLogoutRequest(): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.LOGOUT),
       '',
       { observe: 'response' });
   }
 
   public buildAuthorizeRequest(body: any): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.AUTHORIZE),
       body,
       {
@@ -108,35 +108,35 @@ export class ApplicationServiceFacade {
   }
 
   public buildGetAuthToken(body: any): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.OAUTH),
       body,
       { observe: 'response' });
   }
 
   public buildCheckUserAccessKeyRequest(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.ACCESS_KEY),
       null,
       { observe: 'response' });
   }
 
   public buildGenerateAccessKey(): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.PROJECT_KEY_GENERATE),
       null,
       { observe: 'response', responseType: 'text' });
   }
 
   public buildRegenerateAccessKey(option): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.PROJECT_KEY_GENERATE) + option,
       null,
       { observe: 'response', responseType: 'text' });
   }
 
   public buildUploadUserAccessKeyRequest(body: any): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.ACCESS_KEY),
       body,
       {
@@ -146,7 +146,7 @@ export class ApplicationServiceFacade {
   }
 
   public buildReuploadUserAccessKeyRequest(body: any, option: string): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.ACCESS_KEY) + option,
       body,
       {
@@ -156,241 +156,241 @@ export class ApplicationServiceFacade {
   }
 
   public buildGetUserProvisionedResourcesRequest(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.PROVISIONED_RESOURCES),
       null);
   }
 
   public buildGetTemplatesRequest(params): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.TEMPLATES) + params,
       null);
   }
 
   public buildCreateExploratoryEnvironmentRequest(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Put,
+    return this.buildRequest(HTTPMethod.PUT,
       this.requestRegistry.Item(ApplicationServiceFacade.EXPLORATORY_ENVIRONMENT),
       data,
       { responseType: 'text', observe: 'response' });
   }
 
   public buildRunExploratoryEnvironmentRequest(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.EXPLORATORY_ENVIRONMENT),
       data,
       { responseType: 'text', observe: 'response' });
   }
 
   public buildSuspendExploratoryEnvironmentRequest(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Delete,
+    return this.buildRequest(HTTPMethod.DELETE,
       this.requestRegistry.Item(ApplicationServiceFacade.EXPLORATORY_ENVIRONMENT),
       data, { responseType: 'text', observe: 'response' });
   }
 
   public buildCreateComputationalResources_DataengineServiceRequest(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Put,
+    return this.buildRequest(HTTPMethod.PUT,
       this.requestRegistry.Item(ApplicationServiceFacade.COMPUTATIONAL_RESOURCES_DATAENGINESERVICE),
       data,
       { observe: 'response' });
   }
 
   public buildCreateComputationalResources_DataengineRequest(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Put,
+    return this.buildRequest(HTTPMethod.PUT,
       this.requestRegistry.Item(ApplicationServiceFacade.COMPUTATIONAL_RESOURCES_DATAENGINE),
       data,
       { observe: 'response' });
   }
 
   public buildDeleteComputationalResourcesRequest(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Delete,
+    return this.buildRequest(HTTPMethod.DELETE,
       this.requestRegistry.Item(ApplicationServiceFacade.COMPUTATIONAL_RESOURCES),
       data);
   }
 
   public buildStopSparkClusterAction(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Delete,
+    return this.buildRequest(HTTPMethod.DELETE,
       this.requestRegistry.Item(ApplicationServiceFacade.COMPUTATIONAL_RESOURCES),
       data);
   }
 
   public buildStartSparkClusterAction(params): Observable<any> {
-    return this.buildRequest(RequestMethod.Put,
+    return this.buildRequest(HTTPMethod.PUT,
       this.requestRegistry.Item(ApplicationServiceFacade.COMPUTATIONAL_RESOURCES) + params,
       null);
   }
 
   public buildGetUserPreferences(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.USER_PREFERENCES),
       null);
   }
 
   public buildUpdateUserPreferences(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.USER_PREFERENCES),
       data);
   }
 
   public buildGetEnvironmentHealthStatus(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.ENVIRONMENT_HEALTH_STATUS),
       null,
       { observe: 'response' });
   }
 
   public buildGetEnvironmentStatuses(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.ENVIRONMENT_HEALTH_STATUS),
       data);
   }
 
   public buildRunEdgeNodeRequest(): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.EDGE_NODE_START),
       null,
       { responseType: 'text' });
   }
 
   public buildSuspendEdgeNodeRequest(): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.EDGE_NODE_STOP),
       null,
       { responseType: 'text', observe: 'response' });
   }
 
   public buildRecreateEdgeNodeRequest(): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.EDGE_NODE_RECREATE),
       null,
       { responseType: 'text' });
   }
 
   public buildGetGroupsList(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.LIB_GROUPS),
       data);
   }
 
   public buildGetAvailableLibrariesList(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.LIB_LIST),
       data);
   }
 
   public buildGetAvailableDependenciest(params): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.LIB_LIST) + params,
       null);
   }
 
   public buildInstallLibraries(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.LIB_INSTALL),
       data,
       { observe: 'response', responseType: 'text' });
   }
 
   public buildGetInstalledLibrariesList(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.INSTALLED_LIBS_FORMAT),
       data);
   }
 
   public buildGetInstalledLibsByResource(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.INSTALLED_LIBS),
       data);
   }
 
   public buildGetGitCreds(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.GIT_CREDS),
       null);
   }
 
   public buildUpdateGitCredentials(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Put,
+    return this.buildRequest(HTTPMethod.PUT,
       this.requestRegistry.Item(ApplicationServiceFacade.GIT_CREDS),
       data);
   }
 
   public buildGetGeneralBillingData(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.BILLING),
       data);
   }
 
   public buildDownloadReportData(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.DOWNLOAD_REPORT),
       data,
       { observe: 'response', responseType: 'text' });
   }
 
   public buildCreateBackupRequest(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.BACKUP),
       data,
       { responseType: 'text', observe: 'response' });
   }
   public buildGetBackupStatusRequest(uuid): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.BACKUP),
       uuid);
   }
 
   public buildGetUserImages(image): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.IMAGE),
       image);
   }
 
   public buildGetImagesList(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.IMAGE),
       null);
   }
 
   public buildCreateAMI(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.IMAGE),
       data,
       { observe: 'response', responseType: 'text' });
   }
 
   public buildGetExploratorySchedule(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.SCHEDULER),
       data);
   }
 
   public buildSetExploratorySchedule(param, data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.SCHEDULER) + param,
       data,
       { observe: 'response' });
   }
 
   public buildResetScheduleSettings(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Delete,
+    return this.buildRequest(HTTPMethod.DELETE,
       this.requestRegistry.Item(ApplicationServiceFacade.SCHEDULER),
       data);
   }
 
   public BuildGetActiveSchcedulersData(param): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.SCHEDULER) + param,
       null);
   }
 
   public buildGetActiveUsers(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.ACTIVE_LIST),
       null);
   }
 
   public buildManageEnvironment(action, data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.ENV) + action,
       data,
       {
@@ -400,13 +400,13 @@ export class ApplicationServiceFacade {
   }
 
   public buildGetAllEnvironmentData(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.FULL_ACTIVE_LIST),
       null);
   }
 
   public buildEnvironmentManagement(param, data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.ENV) + param,
       data,
       {
@@ -416,13 +416,13 @@ export class ApplicationServiceFacade {
   }
 
   public buildGetSsnMonitorData(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.SNN_MONITOR),
       null);
   }
 
   public buildGetTotalBudgetData(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.SETTINGS),
       null);
   }
@@ -436,140 +436,140 @@ export class ApplicationServiceFacade {
   }
 
   public buildGetGroupsData(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.GROUPS),
       null);
   }
 
   public buildGetRolesData(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.ROLES),
       null);
   }
 
   public buildSetupNewGroup(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.GROUPS),
       data);
   }
 
   public buildUpdateGroupData(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Put,
+    return this.buildRequest(HTTPMethod.PUT,
       this.requestRegistry.Item(ApplicationServiceFacade.GROUPS),
       data);
   }
 
   public buildSetupRolesForGroup(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Put,
+    return this.buildRequest(HTTPMethod.PUT,
       this.requestRegistry.Item(ApplicationServiceFacade.GROUP_ROLE),
       data);
   }
 
   public buildSetupUsersForGroup(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Put,
+    return this.buildRequest(HTTPMethod.PUT,
       this.requestRegistry.Item(ApplicationServiceFacade.GROUP_USER),
       data);
   }
 
   public buildRemoveUsersForGroup(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Delete,
+    return this.buildRequest(HTTPMethod.DELETE,
       this.requestRegistry.Item(ApplicationServiceFacade.GROUP_USER),
       data);
   }
 
   public buildRemoveGroupById(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Delete,
+    return this.buildRequest(HTTPMethod.DELETE,
       this.requestRegistry.Item(ApplicationServiceFacade.GROUPS),
       data);
   }
 
   public buildGetClusterConfiguration(param): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.COMPUTATIONAL_RESOURCES) + param,
       null);
   }
 
   public buildEditClusterConfiguration(param, data): Observable<any> {
-    return this.buildRequest(RequestMethod.Put,
+    return this.buildRequest(HTTPMethod.PUT,
       this.requestRegistry.Item(ApplicationServiceFacade.COMPUTATIONAL_RESOURCES) + param,
       data);
   }
 
   public buildGetExploratorySparkConfiguration(param): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.EXPLORATORY_ENVIRONMENT) + param,
       null);
   }
 
   public buildEditExploratorySparkConfiguration(param, data): Observable<any> {
-    return this.buildRequest(RequestMethod.Put,
+    return this.buildRequest(HTTPMethod.PUT,
       this.requestRegistry.Item(ApplicationServiceFacade.EXPLORATORY_ENVIRONMENT) + param,
       data);
   }
 
   public buildGetAppMetaData(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.META_DATA),
       null);
   }
 
   public buildCreateProject(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.PROJECT),
       data);
   }
 
   public buildUpdateProject(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Put,
+    return this.buildRequest(HTTPMethod.PUT,
       this.requestRegistry.Item(ApplicationServiceFacade.PROJECT),
       data);
   }
 
   public buildGetProjectsList(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.PROJECT),
       null);
   }
 
   public buildGetUserProjectsList(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.USER_PROJECT),
       null);
   }
 
   public buildDeleteProject(param): Observable<any> {
-    return this.buildRequest(RequestMethod.Delete,
+    return this.buildRequest(HTTPMethod.DELETE,
       this.requestRegistry.Item(ApplicationServiceFacade.PROJECT) + param,
       null);
   }
 
   public buildToggleProjectStatus(param, data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.PROJECT) + param,
       data);
   }
 
   public buildUpdateProjectsBudget(param, data): Observable<any> {
-    return this.buildRequest(RequestMethod.Put,
+    return this.buildRequest(HTTPMethod.PUT,
       this.requestRegistry.Item(ApplicationServiceFacade.PROJECT) + param,
       data,
       { observe: 'response' });
   }
 
   public buildGetEndpointsData(): Observable<any> {
-    return this.buildRequest(RequestMethod.Get,
+    return this.buildRequest(HTTPMethod.GET,
       this.requestRegistry.Item(ApplicationServiceFacade.ENDPOINT),
       null);
   }
 
   public buildCreateEndpoint(data): Observable<any> {
-    return this.buildRequest(RequestMethod.Post,
+    return this.buildRequest(HTTPMethod.POST,
       this.requestRegistry.Item(ApplicationServiceFacade.ENDPOINT),
       data);
   }
 
   public buildDeleteEndpoint(param): Observable<any> {
-    return this.buildRequest(RequestMethod.Delete,
+    return this.buildRequest(HTTPMethod.DELETE,
       this.requestRegistry.Item(ApplicationServiceFacade.ENDPOINT) + param,
       null);
   }
@@ -653,15 +653,15 @@ export class ApplicationServiceFacade {
     this.requestRegistry.Add(ApplicationServiceFacade.USER_PROJECT, '/api/project/me');
   }
 
-  private buildRequest(method: RequestMethod, url_path: string, body: any, opt?) {
+  private buildRequest(method: HTTPMethod, url_path: string, body: any, opt?) {
     // added to simplify development process
     const url = environment.production ? url_path : API_URL + url_path;
 
-    if (method === RequestMethod.Post) {
+    if (method === HTTPMethod.POST) {
       return this.http.post(url, body, opt);
-    } else if (method === RequestMethod.Delete) {
+    } else if (method === HTTPMethod.DELETE) {
       return this.http.delete(body ? url + JSON.parse(body) : url, opt);
-    } else if (method === RequestMethod.Put) {
+    } else if (method === HTTPMethod.PUT) {
       return this.http.put(url, body, opt);
     } else return this.http.get(body ? (url + body) : url, opt);
   }
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/util/http-methods.ts b/services/self-service/src/main/resources/webapp/src/app/core/util/http-methods.ts
new file mode 100644
index 0000000..048130c
--- /dev/null
+++ b/services/self-service/src/main/resources/webapp/src/app/core/util/http-methods.ts
@@ -0,0 +1,11 @@
+
+export enum HTTPMethod {
+  GET = 0,
+  POST = 1,
+  PUT = 2,
+  DELETE = 3,
+  OPTIONS = 4,
+  HEAD = 5,
+  PATCH = 6
+}
+export default HTTPMethod;
\ No newline at end of file
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/util/http-status-codes.ts b/services/self-service/src/main/resources/webapp/src/app/core/util/http-status-codes.ts
index b59afa3..d2323e7 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/util/http-status-codes.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/util/http-status-codes.ts
@@ -18,57 +18,57 @@
  */
 
 export class HTTP_STATUS_CODES {
-    public static readonly ACCEPTED                           = 202;
-    public static readonly BAD_GATEWAY                        = 502;
-    public static readonly BAD_REQUEST                        = 400;
-    public static readonly CONFLICT                           = 409;
-    public static readonly CONTINUE                           = 100;
-    public static readonly CREATED                            = 201;
-    public static readonly EXPECTATION_FAILED                 = 417;
-    public static readonly FAILED_DEPENDENCY                  = 424;
-    public static readonly FORBIDDEN                          = 403;
-    public static readonly GATEWAY_TIMEOUT                    = 504;
-    public static readonly GONE                               = 410;
-    public static readonly HTTP_VERSION_NOT_SUPPORTED         = 505;
-    public static readonly INSUFFICIENT_SPACE_ON_RESOURCE     = 419;
-    public static readonly INSUFFICIENT_STORAGE               = 507;
-    public static readonly INTERNAL_SERVER_ERROR              = 500;
-    public static readonly LENGTH_REQUIRED                    = 411;
-    public static readonly LOCKED                             = 423;
-    public static readonly METHOD_FAILURE                     = 420;
-    public static readonly METHOD_NOT_ALLOWED                 = 405;
-    public static readonly MOVED_PERMANENTLY                  = 301;
-    public static readonly MOVED_TEMPORARILY                  = 302;
-    public static readonly MULTI_STATUS                       = 207;
-    public static readonly MULTIPLE_CHOICES                   = 300;
-    public static readonly NETWORK_AUTHENTICATION_REQUIRED    = 511;
-    public static readonly NO_CONTENT                         = 204;
-    public static readonly NON_AUTHORITATIVE_INFORMATION      = 203;
-    public static readonly NOT_ACCEPTABLE                     = 406;
-    public static readonly NOT_FOUND                          = 404;
-    public static readonly NOT_IMPLEMENTED                    = 501;
-    public static readonly NOT_MODIFIED                       = 304;
-    public static readonly OK                                 = 200;
-    public static readonly PARTIAL_CONTENT                    = 206;
-    public static readonly PAYMENT_REQUIRED                   = 402;
-    public static readonly PERMANENT_REDIRECT                 = 308;
-    public static readonly PRECONDITION_FAILED                = 412;
-    public static readonly PRECONDITION_REQUIRED              = 428;
-    public static readonly PROCESSING                         = 102;
-    public static readonly PROXY_AUTHENTICATION_REQUIRED      = 407;
-    public static readonly REQUEST_HEADER_FIELDS_TOO_LARGE    = 431;
-    public static readonly REQUEST_TIMEOUT                    = 408;
-    public static readonly REQUEST_TOO_LONG                   = 413;
-    public static readonly REQUEST_URI_TOO_LONG               = 414;
-    public static readonly REQUESTED_RANGE_NOT_SATISFIABLE    = 416;
-    public static readonly RESET_CONTENT                      = 205;
-    public static readonly SEE_OTHER                          = 303;
-    public static readonly SERVICE_UNAVAILABLE                = 503;
-    public static readonly SWITCHING_PROTOCOLS                = 101;
-    public static readonly TEMPORARY_REDIRECT                 = 307;
-    public static readonly TOO_MANY_REQUESTS                  = 429;
-    public static readonly UNAUTHORIZED                       = 401;
-    public static readonly UNPROCESSABLE_ENTITY               = 422;
-    public static readonly UNSUPPORTED_MEDIA_TYPE             = 415;
-    public static readonly USE_PROXY                          = 305;
+    public static readonly ACCEPTED = 202;
+    public static readonly BAD_GATEWAY = 502;
+    public static readonly BAD_REQUEST = 400;
+    public static readonly CONFLICT = 409;
+    public static readonly CONTINUE = 100;
+    public static readonly CREATED = 201;
+    public static readonly EXPECTATION_FAILED = 417;
+    public static readonly FAILED_DEPENDENCY = 424;
+    public static readonly FORBIDDEN = 403;
+    public static readonly GATEWAY_TIMEOUT = 504;
+    public static readonly GONE = 410;
+    public static readonly HTTP_VERSION_NOT_SUPPORTED = 505;
+    public static readonly INSUFFICIENT_SPACE_ON_RESOURCE = 419;
+    public static readonly INSUFFICIENT_STORAGE = 507;
+    public static readonly INTERNAL_SERVER_ERROR = 500;
+    public static readonly LENGTH_REQUIRED = 411;
+    public static readonly LOCKED = 423;
+    public static readonly METHOD_FAILURE = 420;
+    public static readonly METHOD_NOT_ALLOWED = 405;
+    public static readonly MOVED_PERMANENTLY = 301;
+    public static readonly MOVED_TEMPORARILY = 302;
+    public static readonly MULTI_STATUS = 207;
+    public static readonly MULTIPLE_CHOICES = 300;
+    public static readonly NETWORK_AUTHENTICATION_REQUIRED = 511;
+    public static readonly NO_CONTENT = 204;
+    public static readonly NON_AUTHORITATIVE_INFORMATION = 203;
+    public static readonly NOT_ACCEPTABLE = 406;
+    public static readonly NOT_FOUND = 404;
+    public static readonly NOT_IMPLEMENTED = 501;
+    public static readonly NOT_MODIFIED = 304;
+    public static readonly OK = 200;
+    public static readonly PARTIAL_CONTENT = 206;
+    public static readonly PAYMENT_REQUIRED = 402;
+    public static readonly PERMANENT_REDIRECT = 308;
+    public static readonly PRECONDITION_FAILED = 412;
+    public static readonly PRECONDITION_REQUIRED = 428;
+    public static readonly PROCESSING = 102;
+    public static readonly PROXY_AUTHENTICATION_REQUIRED = 407;
+    public static readonly REQUEST_HEADER_FIELDS_TOO_LARGE = 431;
+    public static readonly REQUEST_TIMEOUT = 408;
+    public static readonly REQUEST_TOO_LONG = 413;
+    public static readonly REQUEST_URI_TOO_LONG = 414;
+    public static readonly REQUESTED_RANGE_NOT_SATISFIABLE = 416;
+    public static readonly RESET_CONTENT = 205;
+    public static readonly SEE_OTHER = 303;
+    public static readonly SERVICE_UNAVAILABLE = 503;
+    public static readonly SWITCHING_PROTOCOLS = 101;
+    public static readonly TEMPORARY_REDIRECT = 307;
+    public static readonly TOO_MANY_REQUESTS = 429;
+    public static readonly UNAUTHORIZED = 401;
+    public static readonly UNPROCESSABLE_ENTITY = 422;
+    public static readonly UNSUPPORTED_MEDIA_TYPE = 415;
+    public static readonly USE_PROXY = 305;
 }
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/util/index.ts b/services/self-service/src/main/resources/webapp/src/app/core/util/index.ts
index afef07e..0799d07 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/util/index.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/util/index.ts
@@ -24,3 +24,4 @@ export * from './dateUtils';
 export * from './fileUtils';
 export * from './checkUtils';
 export * from './patterns';
+export * from './http-methods';


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org