Wiki source code of Environment endpoints

Last modified by Outhman Moustaghfir on 2022/06/13 13:17

Hide last authors
Outhman Moustaghfir 1.1 1 = Introduction : =
2
3 This section will describe in detail how to manage the Environment entity.
4
5 = Endpoints : =
6
Outhman Moustaghfir 1.2 7 |(% style="width:294px" %)**URL [method]**|(% style="width:539px" %)**Description**|(% style="width:322px" %)**Input example**|(% style="width:495px" %)**Output example**
Outhman Moustaghfir 1.4 8 |(% style="width:294px" %)/rest/environments [GET]|(% style="width:539px" %)Get a list that contains the current environment and its sub-environments. |(% style="width:322px" %)(no input required)|(% style="width:495px" %){{code language="JSON"}}{
Outhman Moustaghfir 1.2 9 "timestamp": 1637580872193,
10 "status": "200",
11 "data": [
12 {
13 "envid": 20,
14 "parent": 19,
15 "alias": "TestEnv1",
16 "code": "",
17 "sendurl": false,
18 "active": true,
19 "timezone": "GMT",
20 "gitRepository": ""
21 },
22 {
23 "envid": 19,
24 "parent": 1,
25 "alias": "greatEnv",
26 "code": "122",
27 "sendurl": false,
28 "active": true,
29 "timezone": "GMT",
30 "gitRepository": ""
31 },
32 {
33 "envid": 1,
34 "parent": 1,
35 "alias": "iXPath",
36 "code": "",
37 "sendurl": false,
38 "active": true,
39 "timezone": "Europe/Paris",
40 "gitRepository": ""
41 },
42 {
43 "envid": 25,
44 "parent": 1,
45 "alias": "PAR",
46 "code": "",
47 "sendurl": false,
48 "active": true,
49 "timezone": "GMT",
50 "gitRepository": ""
51 },
52 {
53 "envid": 26,
54 "parent": 25,
55 "alias": "PARR",
56 "code": "",
57 "sendurl": false,
58 "active": true,
59 "timezone": "GMT",
60 "gitRepository": ""
61 }
62 ]
63 }{{/code}}
Outhman Moustaghfir 1.4 64 |(% style="width:294px" %)/rest/environments/{id} [GET] |(% style="width:539px" %)__Get __an environment object by __id.__|(% style="width:322px" %)The {id} bracket should be replaced by the environment's ID|(% style="width:495px" %){{code language="JSON"}}{
65 "timestamp": 1637587579297,
66 "status": "200",
67 "data": {
68 "envid": 1,
69 "parent": 1,
70 "alias": "iXPath",
71 "code": "",
72 "sendurl": false,
73 "active": true,
74 "timezone": "Europe/Paris",
75 "gitRepository": ""
76 }
77 }{{/code}}
78 |(% style="width:294px" %)/rest/environments/byAlias/{alias} [GET] |(% style="width:539px" %)__Get __an environment object by __alias.__|(% style="width:322px" %)The {alias} bracket should be replaced by the environment's alias.|(% style="width:495px" %){{code language="JSON" layout="LINENUMBERS"}}{
79 "timestamp": 1637587579297,
80 "status": "200",
81 "data": {
82 "envid": 1,
83 "parent": 1,
84 "alias": "iXPath",
85 "code": "",
86 "sendurl": false,
87 "active": true,
88 "timezone": "Europe/Paris",
89 "gitRepository": ""
90 }
91 }{{/code}}
92 |(% style="width:294px" %)/rest/environments/childs/{id} [GET] |(% style="width:539px" %)Get children list of a certain environment by ID.|(% style="width:322px" %)The {id} bracket should be replaced by the environment's id|(% style="width:495px" %)(((
93 if by example, the env "iXPath" with EnvID=1 has 2 children : "greatEnv" and "PAR" , the returned object will beĀ  :
94
95 {{code language="JSON"}}
96 {
97 "timestamp": 1637587991054,
98 "status": "200",
99 "data": [
100 {
101 "envid": 19,
102 "parent": 1,
103 "alias": "greatEnv",
104 "code": "122",
105 "sendurl": false,
106 "active": true,
107 "timezone": "GMT",
108 "gitRepository": ""
109 },
110 {
111 "envid": 25,
112 "parent": 1,
113 "alias": "PAR",
114 "code": "",
115 "sendurl": false,
116 "active": true,
117 "timezone": "GMT",
118 "gitRepository": ""
119 }
120 ]
121 }
122 {{/code}}
123 )))
Outhman Moustaghfir 1.5 124 |(% style="width:294px" %)/rest/environments/folder/{alias} [GET]|(% style="width:539px" %)__Create__ all folders needed for the environment. |(% style="width:322px" %)The {alias} bracket should be replaced by the environment's alias.|(% style="width:495px" %){{code language="JSON"}} {
Outhman Moustaghfir 1.4 125 "timestamp": 1637587991054,
126 "status": "200",
127 "data": "OK"
128 }{{/code}}
Outhman Moustaghfir 1.5 129 |(% style="width:294px" %)/rest/environments [POST]|(% style="width:539px" %)__Create__ a new environment in the database|(% style="width:322px" %){{code language="json"}} {
130 "alias" : "eud",
131 "parent" : 1,
132 "active" : true,
133 "code" : "ADE",
134 "sendurl" : true,
135 "timezone" : "GMT",
136 "gitRepository" : null
137 }{{/code}}(((
138
139
Outhman Moustaghfir 1.8 140 NB: **"alias"**, **"parent"** and **"active" **are mandatory fields.
Outhman Moustaghfir 1.5 141
142
143 )))|(% style="width:495px" %){{code language="json"}}{
144 "timestamp": 1637590549094,
145 "status": "200",
146 "data": {
147 "envid": 37,
148 "parent": 1,
149 "alias": "eud",
150 "code": "ADE",
151 "sendurl": true,
152 "active": true,
153 "timezone": "GMT",
154 "gitRepository": null
155 }
156 }{{/code}}
Outhman Moustaghfir 1.10 157 |(% style="width:294px" %)/rest/environments/parents/{id}|(% style="width:539px" %)Get the ascendant hierarchy of a certain environment by id.|(% style="width:322px" %)The {id} bracket should be replaced by the environment's ID|(% style="width:495px" %)(((
Outhman Moustaghfir 2.1 158 suppose that we have an env with EnvID=27, and its hasĀ EnvID = 26, the returned response will look like below :
Outhman Moustaghfir 1.1 159
160 {{code language="json"}}{
161 "timestamp": 1637591546553,
162 "status": "200",
163 "data": [
164 {
165 "envid": 26,
166 "parent": 25,
167 "alias": "PARR",
168 "code": "",
169 "sendurl": false,
170 "active": true,
171 "timezone": "GMT",
172 "gitRepository": ""
173 },
174 {
175 "envid": 25,
176 "parent": 1,
177 "alias": "PAR",
178 "code": "",
179 "sendurl": false,
180 "active": true,
181 "timezone": "GMT",
182 "gitRepository": ""
183 }
184 ]
185 }{{/code}}
186
187
188 )))
189
190
191
192
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian