-
Notifications
You must be signed in to change notification settings - Fork 134
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
Reuse unbound routes #1223
Merged
Merged
Reuse unbound routes #1223
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
fc20731
Add tabs to add route modal
KlapTrap bf7ab40
Add getUnboundRoute method to route model and small tidy ups
KlapTrap dd49d12
List existing routes on add route modal
KlapTrap c1c6142
Tidy up route fetch code
KlapTrap 3848e51
Check validilty of add route modal depending on what tab is selected
KlapTrap 266e76e
Allow users to assign existing route to application
KlapTrap aaffa29
Fix undefined form validation exception
KlapTrap 8db1280
Actually use the st-table directive and filtering
KlapTrap 9d44456
Update resue route tab styling
KlapTrap e241aef
Don't show existing routes tab if no existing routes can be found
KlapTrap 536b2a4
More styling changes for the existing routes tab
KlapTrap de2f3fc
Override nav styles on route modal
KlapTrap fda03ad
Added 'load all' option to route table
KlapTrap 0a40c93
Remove uneeded application id from routes request
KlapTrap 26bb49c
Fixed and added test for route add modal
KlapTrap c10498a
Merge branch 'master' into reuse-unbound-routes
KlapTrap bc7c790
Minor changes after review
KlapTrap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,8 @@ | |
*/ | ||
function Route(apiManager, modelUtils) { | ||
|
||
var routesApi = apiManager.retrieve('cloud-foundry.api.Routes'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've had some issues in the past where the apiManager/modelManager cannot retrieve the objects when their host function is run first, so will grab them when needed. It's probably best to leave these as is. |
||
|
||
var model = { | ||
route: {}, | ||
checkRouteExists: checkRouteExists, | ||
|
@@ -52,7 +54,7 @@ | |
* @public | ||
*/ | ||
function checkRouteExists(cnsiGuid, domainGuid, host, path, port) { | ||
return apiManager.retrieve('cloud-foundry.api.Routes') | ||
return routesApi | ||
.CheckRouteExists(domainGuid, host, path || '', port || '', {}, modelUtils.makeHttpConfig(cnsiGuid)) | ||
.then(function (response) { | ||
return response.data; | ||
|
@@ -70,7 +72,7 @@ | |
* @public | ||
*/ | ||
function associateAppWithRoute(cnsiGuid, guid, appGuid) { | ||
return apiManager.retrieve('cloud-foundry.api.Routes') | ||
return routesApi | ||
.AssociateAppWithRoute(guid, appGuid, {}, modelUtils.makeHttpConfig(cnsiGuid)); | ||
} | ||
|
||
|
@@ -85,13 +87,13 @@ | |
* @public | ||
*/ | ||
function removeAppFromRoute(cnsiGuid, guid, appGuid) { | ||
return apiManager.retrieve('cloud-foundry.api.Routes') | ||
return routesApi | ||
.RemoveAppFromRoute(guid, appGuid, {}, modelUtils.makeHttpConfig(cnsiGuid)); | ||
} | ||
|
||
function createRoute(cnsiGuid, routeSpec, params) { | ||
var routeParams = params || {}; | ||
return apiManager.retrieve('cloud-foundry.api.Routes') | ||
return routesApi | ||
.CreateRoute(routeSpec, routeParams, modelUtils.makeHttpConfig(cnsiGuid)) | ||
.then(function (response) { | ||
return response.data; | ||
|
@@ -109,7 +111,7 @@ | |
* @public | ||
*/ | ||
function deleteRoute(cnsiGuid, guid, recursive) { | ||
return apiManager.retrieve('cloud-foundry.api.Routes') | ||
return routesApi | ||
.DeleteRoute(guid, recursive, {}, modelUtils.makeHttpConfig(cnsiGuid)); | ||
} | ||
|
||
|
@@ -126,7 +128,7 @@ | |
* @public | ||
*/ | ||
function listAllAppsForRoute(cnsiGuid, guid, params, paginate) { | ||
return apiManager.retrieve('cloud-foundry.api.Routes') | ||
return routesApi | ||
.ListAllAppsForRoute(guid, params, modelUtils.makeHttpConfig(cnsiGuid)) | ||
.then(function (response) { | ||
if (paginate) { | ||
|
@@ -163,7 +165,7 @@ | |
* @public | ||
*/ | ||
function listAllAppsForRouteWithoutStore(cnsiGuid, guid, params, paginate) { | ||
return apiManager.retrieve('cloud-foundry.api.Routes') | ||
return routesApi | ||
.ListAllAppsForRoute(guid, params, modelUtils.makeHttpConfig(cnsiGuid)) | ||
.then(function (response) { | ||
if (paginate) { | ||
|
@@ -195,7 +197,7 @@ | |
* @public | ||
*/ | ||
function listAllRouteMappingsForRoute(cnsiGuid, guid, params, paginate) { | ||
return apiManager.retrieve('cloud-foundry.api.Routes') | ||
return routesApi | ||
.ListAllRouteMappingsForRoute(guid, params, modelUtils.makeHttpConfig(cnsiGuid)) | ||
.then(function (response) { | ||
if (!paginate) { | ||
|
@@ -204,7 +206,5 @@ | |
return response.data.resources; | ||
}); | ||
} | ||
|
||
} | ||
|
||
})(); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the past we've avoided making changes to 'api' files as they were originally auto-generated. Going forward I don't think there's much harm in re-factoring but we need to bear in mind we might auto-generate these files for v3 of the cf api.