Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
56f1a365
Commit
56f1a365
authored
Dec 08, 2014
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add /hosts/appName and renamed misspelled bootstrapyml
parent
2545a015
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
SidecarController.java
...ingframework/cloud/netflix/sidecar/SidecarController.java
+8
-2
application.yml
...-cloud-netflix-sidecar/src/test/resources/application.yml
+3
-0
bootstrap.yml
...ng-cloud-netflix-sidecar/src/test/resources/bootstrap.yml
+7
-0
No files found.
spring-cloud-netflix-sidecar/src/main/java/org/springframework/cloud/netflix/sidecar/SidecarController.java
View file @
56f1a365
...
...
@@ -4,6 +4,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cloud.client.ServiceInstance
;
import
org.springframework.cloud.client.discovery.DiscoveryClient
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -27,8 +28,13 @@ public class SidecarController {
return
"OK"
;
}
@RequestMapping
(
"/hosts/{appName}"
)
public
List
<
ServiceInstance
>
hosts
(
@PathVariable
(
"appName"
)
String
appName
)
{
return
hosts2
(
appName
);
}
@RequestMapping
(
"/hosts"
)
public
List
<
ServiceInstance
>
hosts
(
@RequestParam
(
"appName"
)
String
appName
)
{
public
List
<
ServiceInstance
>
hosts
2
(
@RequestParam
(
"appName"
)
String
appName
)
{
List
<
ServiceInstance
>
instances
=
discovery
.
getInstances
(
appName
);
return
instances
;
}
...
...
@@ -38,7 +44,7 @@ public class SidecarController {
return
"<head><title>Sidecar</title></head><body>\n"
+
"<a href='/ping'>ping</a><br/>\n"
+
"<a href='/health'>health</a><br/>\n"
+
"<a href='/hosts
?appName="
+
appName
+
"'>hosts?appName=
"
+
appName
+
"</a><br/>\n"
+
"<a href='/hosts
/"
+
appName
+
"'>hosts/
"
+
appName
+
"</a><br/>\n"
+
"</body>"
;
}
}
spring-cloud-netflix-sidecar/src/test/resources/application.yml
View file @
56f1a365
...
...
@@ -15,6 +15,9 @@ eureka:
serviceUrl
:
defaultZone
:
http://user:password@localhost:8761/eureka/
ribbon
:
ServerListRefreshInterval
:
5000
endpoints
:
refresh
:
enabled
:
true
...
...
spring-cloud-netflix-sidecar/src/test/resources/bootstrap.yml
0 → 100644
View file @
56f1a365
spring
:
#application:
# name: sideCarTest
cloud
:
config
:
username
:
user
password
:
password
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment