blob: 45e9f0cfed7524b0ab0802ab62ee276f27f21597 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.configserver;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.yahoo.vespa.flags.json.wire.WireFlagData;
import com.yahoo.vespa.flags.json.wire.WireFlagDataList;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import java.util.List;
import java.util.Map;
/**
* @author hakonhall
*/
@Path("")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface FlagsV1Api {
@PUT
@Path("/data/{flagId}")
void putFlagData(@PathParam("flagId") String flagId, @QueryParam("force") Boolean force, WireFlagData flagData);
@GET
@Path("/data/{flagId}")
WireFlagData getFlagData(@PathParam("flagId") String flagId, @QueryParam("force") Boolean force);
@DELETE
@Path("/data/{flagId}")
void deleteFlagData(@PathParam("flagId") String flagId, @QueryParam("force") Boolean force);
@GET
@Path("/data")
WireFlagDataList listFlagData(@QueryParam("recursive") Boolean recursive);
@GET
@Path("/defined")
Map<String, WireFlagDefinition> listFlagDefinition();
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
class WireFlagDefinition {
@JsonProperty("owners") public List<String> owners;
@JsonProperty("expiresAt") public String expiresAt;
}
}
|