@Path(value="/")
@Produces(value={"application/json","text/plain"})
public class ConfigurationResource
extends Object
| Constructor and Description |
|---|
ConfigurationResource(String scope) |
| Modifier and Type | Method and Description |
|---|---|
String |
deleteConfig(String key) |
String |
deleteEtcdConfig(String key) |
long |
getDeleteCounter() |
long |
getReadCounter() |
long |
getWriteCounter() |
String |
readConfig(Boolean recursive)
This models a etcd2 compliant access point for getting a property value.
|
String |
readConfig(String key,
Boolean recursive)
This models a etcd2 compliant access point for getting a property value.
|
String |
readEtcdConfig(Boolean recursive) |
String |
readEtcdConfig(String key,
Boolean recursive)
This models a etcd2 compliant access point for getting a property value.
|
String |
version() |
String |
writeConfig(String key,
String value,
Integer ttl)
This models a etcd2 compliant access point for setting a property value:
{
"action": "set",
"node": {
"createdIndex": 3,
"key": "/message",
"modifiedIndex": 3,
"value": "Hello etcd"
},
"prevNode": {
"createdIndex": 2,
"key": "/message",
"value": "Hello world",
"modifiedIndex": 2
}
}
|
String |
writeEtcdConfig(String key,
String value,
Integer ttl) |
public ConfigurationResource(String scope)
@GET
@Path(value="/version")
@Produces(value={"application/json","text/plain"})
public String version()
@GET @Path(value="/v2/keys") public String readEtcdConfig(@QueryParam(value="recursive") Boolean recursive)
@GET @Path(value="/keys") public String readConfig(@QueryParam(value="recursive") Boolean recursive)
recursive - NOT YET IMPLEMENTED!@GET
@Path(value="/v2/keys/{key}")
public String readEtcdConfig(@PathParam(value="key")
String key,
@QueryParam(value="recursive")
Boolean recursive)
key - name of the key to showrecursive - NOT YET IMPLEMENTED!@GET
@Path(value="/keys/{key}")
public String readConfig(@PathParam(value="key")
String key,
@QueryParam(value="recursive")
Boolean recursive)
key - name of the key to showrecursive - NOT YET IMPLEMENTED!@PUT
@Path(value="/v2/keys/{key}")
public String writeEtcdConfig(@PathParam(value="key")
String key,
@FormParam(value="value")
String value,
@FormParam(value="ttl")
Integer ttl)
@PUT
@Path(value="/keys/{key}")
public String writeConfig(@PathParam(value="key")
String key,
@FormParam(value="value")
String value,
@FormParam(value="ttl")
Integer ttl)
{
"action": "set",
"node": {
"createdIndex": 3,
"key": "/message",
"modifiedIndex": 3,
"value": "Hello etcd"
},
"prevNode": {
"createdIndex": 2,
"key": "/message",
"value": "Hello world",
"modifiedIndex": 2
}
}
key - name of the key to showvalue - configuration value for the given keyttl - time to live@DELETE
@Path(value="/v2/keys/{key}")
public String deleteEtcdConfig(@PathParam(value="key")
String key)
@DELETE
@Path(value="/keys/{key}")
public String deleteConfig(@PathParam(value="key")
String key)
public long getDeleteCounter()
public long getReadCounter()
public long getWriteCounter()
Copyright © 2014–2016 Apache Software Foundation. All rights reserved.