Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions bin/openapi2apigee
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ program
.option('-t, --token <token>', 'Apigee Edge Auth Token to Deploy')
.option('-U, --backendurl <backendurl>','Specify the target backend url')
.option('-O, --oauth <oauth>','Apigee enable oauth')
.option('-T, --target-server <targetserver>', 'Apigee existing target server')

.description('Generates Apigee API Bundle')
.action(function(apiProxy, options) {
Expand Down
10 changes: 9 additions & 1 deletion lib/commands/generateApi/generateTargetEndPoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@ module.exports = function generateTargetEndPoint (apiProxy, options, api, cb) {

if (options.backendurl) {
httpTargetConn.ele('URL', {}, options.backendurl)
} else {
}
else if (options.targetServer) {
httpTargetConn.ele('LoadBalancer')
.ele('Server', {'name': options.targetServer})
if (options.basepath) {
httpTargetConn.ele('Path', {}, options.basepath)
}
}
else {
if (api.openapi) {
httpTargetConn.ele('URL', {}, api.servers[0].url)
} else {
Expand Down