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/05/29 09:05:18 UTC
[incubator-dlab] 27/29: [DLAB-642]: added endpoint creation service
support
This is an automated email from the ASF dual-hosted git repository.
ankovalyshyn pushed a commit to branch feature/projects
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git
commit 9e4f5e79321cc869bee48d856d292cd35d8c8e9c
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Tue May 28 17:15:14 2019 +0300
[DLAB-642]: added endpoint creation service support
---
.../services/applicationServiceFacade.service.ts | 40 ++++++++--------------
.../src/app/core/services/endpoint.service.ts | 8 +++++
2 files changed, 22 insertions(+), 26 deletions(-)
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 ad1734b..9039f20 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,9 +18,8 @@
*/
import { Injectable } from '@angular/core';
-import { Http, Response, RequestOptions, RequestMethod, Headers } from '@angular/http';
+import { RequestMethod } from '@angular/http';
import { Observable } from 'rxjs';
-
import { HttpClient } from '@angular/common/http';
import { Dictionary } from '../collections';
@@ -81,8 +80,7 @@ export class ApplicationServiceFacade {
return this.buildRequest(RequestMethod.Post,
this.requestRegistry.Item(ApplicationServiceFacade.LOGIN),
body,
- { responseType: 'text', observe: 'response' }
- );
+ { responseType: 'text', observe: 'response' });
}
public buildLogoutRequest(): Observable<any> {
@@ -454,43 +452,37 @@ export class ApplicationServiceFacade {
public buildSetupNewGroup(data): Observable<any> {
return this.buildRequest(RequestMethod.Post,
this.requestRegistry.Item(ApplicationServiceFacade.GROUPS),
- data,
- this.getRequestOptions(false, true));
+ data);
}
public buildUpdateGroupData(data): Observable<any> {
return this.buildRequest(RequestMethod.Put,
this.requestRegistry.Item(ApplicationServiceFacade.GROUPS),
- data,
- this.getRequestOptions(false, true));
+ data);
}
public buildSetupRolesForGroup(data): Observable<any> {
return this.buildRequest(RequestMethod.Put,
this.requestRegistry.Item(ApplicationServiceFacade.GROUP_ROLE),
- data,
- this.getRequestOptions(false, true));
+ data);
}
public buildSetupUsersForGroup(data): Observable<any> {
return this.buildRequest(RequestMethod.Put,
this.requestRegistry.Item(ApplicationServiceFacade.GROUP_USER),
- data,
- this.getRequestOptions(false, true));
+ data);
}
public buildRemoveUsersForGroup(data): Observable<any> {
return this.buildRequest(RequestMethod.Delete,
this.requestRegistry.Item(ApplicationServiceFacade.GROUP_USER),
- data,
- this.getRequestOptions(false, true));
+ data);
}
public buildRemoveGroupById(data): Observable<any> {
return this.buildRequest(RequestMethod.Delete,
this.requestRegistry.Item(ApplicationServiceFacade.GROUPS),
- data,
- this.getRequestOptions(false, true));
+ data);
}
public buildGetClusterConfiguration(param): Observable<any> {
@@ -553,6 +545,12 @@ export class ApplicationServiceFacade {
null);
}
+ public buildCreateEndpoint(data): Observable<any> {
+ return this.buildRequest(RequestMethod.Post,
+ this.requestRegistry.Item(ApplicationServiceFacade.ENDPOINT),
+ data);
+ }
+
private setupRegistry(): void {
this.requestRegistry = new Dictionary<string>();
@@ -640,14 +638,4 @@ export class ApplicationServiceFacade {
return this.http.put(url, body, opt);
} else return this.http.get(body ? (url + body) : url, opt);
}
-
- private getRequestOptions(json: boolean, auth: boolean) {
- // const headers = new Headers();
- // if (json)
- // headers.append('Content-type', 'application/json; charset=utf-8');
- // if (auth)
- // headers.append('Authorization', 'Bearer ' + localStorage.getItem(this.accessTokenKey));
- // const reqOpt = new RequestOptions({ headers: headers });
- // return reqOpt;
- }
}
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/services/endpoint.service.ts b/services/self-service/src/main/resources/webapp/src/app/core/services/endpoint.service.ts
index 91caed7..970956e 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/services/endpoint.service.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/services/endpoint.service.ts
@@ -38,5 +38,13 @@ export class EndpointService {
map(response => response),
catchError(ErrorUtils.handleServiceError));
}
+
+ public createEndpoint(data): Observable<any> {
+ return this.applicationServiceFacade
+ .buildCreateEndpoint(data)
+ .pipe(
+ map(response => response),
+ catchError(ErrorUtils.handleServiceError));
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org