Skip to content

Commit

Permalink
[ep-ext] support for custom compute profiles UI
Browse files Browse the repository at this point in the history
Testing Done: junit, manual

Change-Id: I9fd661364abce339b69b1444b5aebf258c407177
Reviewed-on: http://bellevue-ci.eng.vmware.com:8080/12928
Compute-Verified: jenkins <[email protected]>
Reviewed-by: George P Dimitrov <[email protected]>
Upgrade-Verified: jenkins <[email protected]>
Closures-Verified: jenkins <[email protected]>
Bellevue-Verified: jenkins <[email protected]>
CS-Verified: jenkins <[email protected]>
  • Loading branch information
Boris Savov committed Jul 7, 2017
1 parent aae024b commit 146ffeb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,15 @@ private DeferredResult<String> getEndpointType(FetchDataRequest fetchDataRequest
case EndpointType: {
return DeferredResult.completed(fetchDataRequest.entityId);
}
case Endpoint: {
String entityId = fetchDataRequest.entityId;
AssertUtil.assertNotNull(entityId, "'fetchDataRequest.entityId' must be set.");
return getEndpointType(entityId);
}
case ResourceDetails:
case ResourceOperation: {
String entityId = fetchDataRequest.entityId;
AssertUtil.assertNotNull(entityId, "'entityId.requestType' must be set.");
AssertUtil.assertNotNull(entityId, "'fetchDataRequest.entityId' must be set.");
return sendWithDeferredResult(Operation.createGet(this, entityId),
EndpointLinkAware.class)
.thenCompose(epla -> getEndpointType(epla.endpointLink));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@ public void testGetByResource() {
});
}

@Test
public void testGetByEndpoint() {
testGetByXXX(false, false,
(ept, d) -> {
EndpointState endpointState = registerEndpoint(ept);
FetchDataRequest request = new FetchDataRequest();
request.entityId = endpointState.documentSelfLink;
request.requestType = RequestType.Endpoint;
request.data = d;
return request;
});
}

private void testGetByXXX(boolean withHost, boolean withWrongPath,
BiFunction<String, Object, FetchDataRequest> config) {

Expand Down
2 changes: 1 addition & 1 deletion ui/app/src/js/components/profiles/ProfileEditView.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export default Vue.component('profile-edit-view', {
function(url, body) {
return {
requestType: 'Endpoint',
entityId: _this.endpoint,
entityId: _this.endpoint.documentSelfLink,
data: body
};
});
Expand Down

0 comments on commit 146ffeb

Please sign in to comment.