@Path(value="flags") @Singleton public class FeatureFlagsServlet extends EndpointServlet
objectMappers| Constructor and Description |
|---|
FeatureFlagsServlet(FeatureFlagRegistry flags,
ObjectMappersSuite objectMappers)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
getFeatureFlagStatus(String flagName,
String format,
javax.ws.rs.core.UriInfo uriInfo)
Get the status of a specific feature flag.
|
javax.ws.rs.core.Response |
getFeatureFlagStatusAll(String perPage,
String page,
String format,
javax.ws.rs.core.UriInfo uriInfo)
Get the status of all feature flags.
|
formatResponse@Inject public FeatureFlagsServlet(FeatureFlagRegistry flags, ObjectMappersSuite objectMappers)
flags - Feature Flags to know aboutobjectMappers - JSON tools@GET
@Timed
public javax.ws.rs.core.Response getFeatureFlagStatusAll(@DefaultValue(value="") @NotNull @QueryParam(value="perPage")
String perPage,
@DefaultValue(value="") @NotNull @QueryParam(value="page")
String page,
@QueryParam(value="format")
String format,
@Context
javax.ws.rs.core.UriInfo uriInfo)
perPage - the number per page to returnpage - the page to start fromformat - the format to useuriInfo - the injected UriInfo
{
"feature flags": [
{
"name": "feature flag name",
"value": <true | false>
},
...
]
}
@GET
@Timed
@Produces(value="application/json")
@Path(value="/{flagName}")
public javax.ws.rs.core.Response getFeatureFlagStatus(@PathParam(value="flagName")
String flagName,
@QueryParam(value="format")
String format,
@Context
javax.ws.rs.core.UriInfo uriInfo)
flagName - The feature flagformat - The format to return results inuriInfo - The injected UriInfo
{
"feature flags": [
"name": "feature flag name",
"value": <true | false>
]
}
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.