Hide last authors
Achraf El Kari 1.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
Outhman Moustaghfir 1.2 5 = Introduction =
Achraf El Kari 1.1 6
Achraf El Kari 7.1 7 We will go through all endpoints needed to manage the Tracking type entity.
Achraf El Kari 1.1 8
Outhman Moustaghfir 1.4 9 = Endpoints =
10
Achraf El Kari 9.2 11 **PS:** __//For all those endpoints, the env params are mandatory on the header, otherwise you got an error 400 (BAD PARAMS).//__
Achraf El Kari 7.3 12
13
Achraf El Kari 9.2 14 |(% style="width:202px" %)**URL [method]**|(% style="width:126px" %)**Description**|(% style="width:250px" %)**Input example**|(% style="width:449px" %)**Output example**
15 |(% style="width:202px" %)(((
Achraf El Kari 7.2 16 /rest/trackingType [GET]
17
18
19 hedear : Authorization + env => Mandatory
Achraf El Kari 7.4 20
Achraf El Kari 9.2 21 )))|(% style="width:126px" %)(((
22 get **all **tracking Types of the giving environment ==>
Achraf El Kari 7.4 23
24 order, orderLine...
Achraf El Kari 9.2 25 )))|(% style="width:250px" %)(no input required)|(% style="width:449px" %)[[attach:TrackingTypes.json||target="_blank"]]
26 |(% style="width:202px" %)/rest/trackingType [POST]|(% style="width:126px" %)Insert or update new TrackingType|(% style="width:250px" %){{code language="json"}}{
27   "alias": "order",
28   "env": "iXPath",
29   "label": {
30     "fr": "Commande de Merde",
31     "en": "Order"
32   },
33   "dataTypes": [
34     {
35       "alias": "orderNumber",
36       "label": {
37         "fr": "Numéro de commande",
38         "en": "Order Number"
39       },
40     {
41       "alias": "orderLine",
42       "label": {
43         "fr": "Ligne de commande",
44         "en": "Order Lines"
45       },
46       "type": "TRACKING",
47       "trackingType": "orderLine",
48       "mandatory": true,
49       "isList": false
50     }
51   ]
52 }{{/code}}|(% style="width:449px" %){{code language="JSON"}}{
Outhman Moustaghfir 1.8 53 "timestamp": 1620217014704,
54 "status": "200",
55 "data": [
56 {
57 "date": "Tue May 04 16:37:49 GMT+01:00 2021",
58 "current": "true",
59 "author": "person1232",
60 "id": "11e8707eb50e25c00a62e4efedb5f6071ec7e27e",
61 "message": "version 2"
62 },
63 {
64 "date": "Tue May 04 13:28:12 GMT+01:00 2021",
65 "current": "false",
66 "author": "person1",
67 "id": "4b64d02451f47d9cb91d08faa986c941deef0f5c",
68 "message": "version 1"
69 }
70 ]
71 }{{/code}}
Achraf El Kari 9.2 72 |(% style="width:202px" %)/rest/git/commit [POST]|(% style="width:126px" %)commit changes in files with a message|(% style="width:250px" %){{code language="JSON"}}{
Outhman Moustaghfir 1.10 73 "files":
74 [
75 {"fileName" : "newFile.xml"},
76 {"fileName" : "/dir/modifiedFile.pdf"}
77 ],
78 "message": "this is a commit message"
Outhman Moustaghfir 1.13 79 }{{/code}}|(% style="width:449px" %)(((
Outhman Moustaghfir 1.10 80 it returns a String with the commit message meaning that the commit has passed successfully.
Outhman Moustaghfir 1.4 81
Outhman Moustaghfir 1.10 82 eg :
83
Outhman Moustaghfir 1.11 84 {{code language="JSON"}}{
85 "timestamp": 1620217700570,
86 "status": "200",
87 "data": "this is a commit message"
88 }{{/code}}
Outhman Moustaghfir 1.10 89 )))
Achraf El Kari 9.2 90 |(% style="width:202px" %)(((
Outhman Moustaghfir 1.13 91 /rest/git/switchComit/{id}
Outhman Moustaghfir 1.10 92
Outhman Moustaghfir 1.13 93 [GET]
Achraf El Kari 9.2 94 )))|(% style="width:126px" %)(((
Outhman Moustaghfir 1.15 95 switch to a certain version and return the history of all commits.
96
Outhman Moustaghfir 1.26 97 **__NB __**: if there are some modified files in the current version, these files will be moved to a new directory called :
Outhman Moustaghfir 1.16 98
99 .../archive/git-{timestamp}
Achraf El Kari 9.2 100 )))|(% style="width:250px" %)(((
101
Outhman Moustaghfir 1.13 102
Outhman Moustaghfir 1.17 103
Outhman Moustaghfir 1.30 104 )))|(% style="width:449px" %)(((
105 {{code language="JSON"}}
106 {
Outhman Moustaghfir 1.15 107 "timestamp": 1620217014704,
108 "status": "200",
109 "data": [
110 {
111 "date": "Tue May 04 16:37:49 GMT+01:00 2021",
112 "current": "false",
113 "author": "person1232",
114 "id": "11e8707eb50e25c00a62e4efedb5f6071ec7e27e",
115 "message": "version 2"
116 },
117 {
118 "date": "Tue May 04 13:28:12 GMT+01:00 2021",
119 "current": "true",
120 "author": "person1",
121 "id": "4b64d02451f47d9cb91d08faa986c941deef0f5c",
122 "message": "version 1"
123 }
124 ]
Outhman Moustaghfir 1.30 125 }
126 {{/code}}
127 )))
Achraf El Kari 9.2 128 |(% style="width:202px" %)/rest/git/update [GET]|(% style="width:126px" %)(((
Outhman Moustaghfir 1.25 129 Integrates and pulls changes from a remote repository into the current branch.
Achraf El Kari 9.2 130 )))|(% style="width:250px" %)(no input required)|(% style="width:449px" %)(((
Outhman Moustaghfir 1.26 131 it returns a success message.
Outhman Moustaghfir 1.14 132
Outhman Moustaghfir 1.26 133 eg :
134
135 {{code language="JSON"}}
136 {
137 "timestamp": 1620219625637,
138 "status": "200",
139 "data": "branch is now updated"
140 }
141 {{/code}}
142 )))
Achraf El Kari 9.2 143 |(% style="width:202px" %)/rest/environment/init [POST]|(% style="width:126px" %)(((
Outhman Moustaghfir 1.28 144 Clone a git repository into the directory of the current environment,
Outhman Moustaghfir 1.26 145
Outhman Moustaghfir 1.29 146 if it doesn't exist it creates a new directory and initialize the repo,
Outhman Moustaghfir 1.28 147
Outhman Moustaghfir 5.4 148 if the directory exists, the endpoint renames the directory and creates a new one and clones the repository.
Achraf El Kari 9.2 149 )))|(% style="width:250px" %)(no input required)|(% style="width:449px" %)(((
Outhman Moustaghfir 1.29 150 it returns a "success" message :
151
152 eg :
153
Outhman Moustaghfir 1.30 154 {{code language="JSON"}}
155 {
156 "timestamp": 1620229625932,
157 "status": "200",
Outhman Moustaghfir 5.2 158 "data": "Repository initialized successfully !"
Outhman Moustaghfir 1.30 159 }
160 {{/code}}
Outhman Moustaghfir 1.29 161 )))
Achraf El Kari 9.2 162 |(% style="width:202px" %)/rest/git/checkout/{branch} [POST]|(% style="width:126px" %)switch to a certain branch|(% style="width:250px" %)(((
Outhman Moustaghfir 4.1 163 the {branch} must be replaced by the name of the branch destination.
Outhman Moustaghfir 1.29 164
Outhman Moustaghfir 4.1 165 eg : /rest/git/checkout/master
166
167 /rest/git/checkout/develop
168 )))|(% style="width:449px" %)(((
169 it returns a "success" message of checkout branch.
170
171 eg :
172
173 {{code language="JSON"}}
174 {
175 "timestamp": 1620229625932,
176 "status": "200",
177 "data": "switched to branch : master"
178 }
179 {{/code}}
180 )))
Achraf El Kari 9.2 181 |(% style="width:202px" %)(((
Outhman Moustaghfir 4.1 182 /rest/git/newbranch/{branch}
183
184 [POST]
Achraf El Kari 9.2 185 )))|(% style="width:126px" %)create and switch to a new branch |(% style="width:250px" %)(((
Outhman Moustaghfir 4.1 186 the {branch} must be replaced by the name of the branch destination.
187
188 eg :
189
190 /rest/git/checkout/newBranch
191 )))|(% style="width:449px" %)(((
192 it returns a "success" message of the branch creation.
193
194 eg :
195
196 {{code language="JSON"}}
197 {
198 "timestamp": 1620229625932,
199 "status": "200",
200 "data": "new branch has been created : newBranch"
201 }
202 {{/code}}
203 )))
Achraf El Kari 9.2 204 |(% style="width:202px" %)/rest/git/revert [POST]|(% style="width:126px" %)switch the modified file to the initial head version. |(% style="width:250px" %) |(% style="width:449px" %)(((
Outhman Moustaghfir 5.2 205 it returns a "success" message.
Outhman Moustaghfir 4.1 206
Outhman Moustaghfir 5.2 207 eg :
208
209 {{code language="JSON"}}
210 {
211 "timestamp": 1620229625932,
212 "status": "200",
213 "data": "the selected files has been synchronized to HEAD successfully !"
214 }
215 {{/code}}
216 )))
217
Outhman Moustaghfir 5.1 218 = Errors =
219
220 below, you can find an example of technical and functional errors :
221
222 {{code language="JSON"}}
223 {
224 "timestamp": 1620221672951,
225 "status": "500",
226 "error": "JSON file is not valid",
227 "thechnicalError": "JSONObject[\"fileName\"] not found."
228 }
229 {{/code}}
230
231 the functional error is shown with the JSON key "error", while technical error is stored in the "thechnicalError" key.
232
233
Outhman Moustaghfir 3.1 234 == ==
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian