aboutsummaryrefslogtreecommitdiffstats
path: root/xds-service/xds-service-apidef.h
blob: 5d53d891ec8cf563529edba4a65bff46e0cbd5ab (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
static const char _afb_description_v2_xds_service[] =
    "{\"openapi\":\"3.0.0\",\"$schema\":\"http://iot.bzh/download/openapi/sch"
    "ema-3.0/default-schema.json\",\"info\":{\"description\":\"TBD - TODO\",\""
    "title\":\"xds-service\",\"version\":\"4.0\",\"x-binding-c-generator\":{\""
    "api\":\"xds-service\",\"version\":2,\"prefix\":\"\",\"postfix\":\"\",\"s"
    "tart\":null,\"onevent\":\"xds_event_cb\",\"init\":\"init\",\"scope\":\"\""
    ",\"private\":false}},\"servers\":[{}],\"components\":{\"schemas\":{\"afb"
    "-reply\":{\"$ref\":\"#/components/schemas/afb-reply-v2\"},\"afb-event\":"
    "{\"$ref\":\"#/components/schemas/afb-event-v2\"},\"afb-reply-v2\":{\"tit"
    "le\":\"Generic response.\",\"type\":\"object\",\"required\":[\"jtype\",\""
    "request\"],\"properties\":{\"jtype\":{\"type\":\"string\",\"const\":\"af"
    "b-reply\"},\"request\":{\"type\":\"object\",\"required\":[\"status\"],\""
    "properties\":{\"status\":{\"type\":\"string\"},\"info\":{\"type\":\"stri"
    "ng\"},\"token\":{\"type\":\"string\"},\"uuid\":{\"type\":\"string\"},\"r"
    "eqid\":{\"type\":\"string\"}}},\"response\":{\"type\":\"object\"}}},\"af"
    "b-event-v2\":{\"type\":\"object\",\"required\":[\"jtype\",\"event\"],\"p"
    "roperties\":{\"jtype\":{\"type\":\"string\",\"const\":\"afb-event\"},\"e"
    "vent\":{\"type\":\"string\"},\"data\":{\"type\":\"object\"}}}},\"x-permi"
    "ssions\":{\"list\":{\"permission\":\"urn:AGL:permission::platform:can:li"
    "st \"},\"trace\":{\"permission\":\"urn:AGL:permission::platform:can:trac"
    "e \"}},\"responses\":{\"200\":{\"description\":\"A complex object array "
    "response\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/c"
    "omponents/schemas/afb-reply\"}}}}}},\"paths\":{\"/auth\":{\"description\""
    ":\"Authenticate session to raise Level Of Assurance of the session\",\"g"
    "et\":{\"x-permissions\":{\"$ref\":\"#/components/x-permissions/list\"},\""
    "responses\":{\"200\":{\"$ref\":\"#/components/responses/200\"}}}},\"/lis"
    "t\":{\"description\":\"list \",\"get\":{\"x-permissions\":{\"LOA\":1},\""
    "parameters\":[],\"responses\":{\"200\":{\"$ref\":\"#/components/response"
    "s/200\"}}}},\"/trace\":{\"description\":\"trace \",\"get\":{\"x-permissi"
    "ons\":{\"LOA\":1},\"parameters\":[{\"in\":\"query\",\"name\":\"ws\",\"re"
    "quired\":true,\"schema\":{\"type\":\"string\"}}],\"responses\":{\"200\":"
    "{\"$ref\":\"#/components/responses/200\"}}}}}}"
;

static const struct afb_auth _afb_auths_v2_xds_service[] = {
	{ .type = afb_auth_Permission, .text = "urn:AGL:permission::platform:can:list " }
};

 void auth(struct afb_req req);
 void list(struct afb_req req);
 void trace(struct afb_req req);

static const struct afb_verb_v2 _afb_verbs_v2_xds_service[] = {
    {
        .verb = "auth",
        .callback = auth,
        .auth = &_afb_auths_v2_xds_service[0],
        .info = "Authenticate session to raise Level Of Assurance of the session",
        .session = AFB_SESSION_NONE_V2
    },
    {
        .verb = "list",
        .callback = list,
        .auth = NULL,
        .info = "list ",
        .session = AFB_SESSION_LOA_1_V2
    },
    {
        .verb = "trace",
        .callback = trace,
        .auth = NULL,
        .info = "trace ",
        .session = AFB_SESSION_LOA_1_V2
    },
    {
        .verb = NULL,
        .callback = NULL,
        .auth = NULL,
        .info = NULL,
        .session = 0
	}
};

const struct afb_binding_v2 afbBindingV2 = {
    .api = "xds-service",
    .specification = _afb_description_v2_xds_service,
    .info = "TBD - TODO",
    .verbs = _afb_verbs_v2_xds_service,
    .preinit = NULL,
    .init = init,
    .onevent = xds_event_cb,
    .noconcurrency = 0
};