<
From version < 3.1 >
edited by Outhman Moustaghfir
on 2021/05/05 15:19
To version < 7.3 >
edited by Achraf El Kari
on 2021/11/23 11:35
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -GIT endpoints
1 +Tracking Type
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.omoustaghfir
1 +XWiki.aelkari
Content
... ... @@ -4,13 +4,21 @@
4 4  
5 5  = Introduction =
6 6  
7 -Git endpoints take advantage of all git commands known and needed to create versions of files.
7 +We will go through all endpoints needed to manage the Tracking type entity.
8 8  
9 9  = Endpoints =
10 10  
11 -|(% style="width:166px" %)**URL [method]**|(% style="width:189px" %)**Description**|(% style="width:383px" %)**Input example**|(% style="width:449px" %)**Output example**
12 -|(% style="width:166px" %)/rest/git/getstatus [GET]|(% style="width:189px" %)get all files that have been modified or untracked|(% style="width:383px" %)(no input required)|(% style="width:449px" %){{code language="JSON"}}
13 -{
11 +**PS :** __//For all those endpoints, the env params is andatory on the header, otherwise you got an error 400 (BAD PARAMS).//__
12 +
13 +
14 +|(% style="width:166px" %)**URL [method]**|(% style="width:238px" %)**Description**|(% style="width:599px" %)**Input example**|(% style="width:449px" %)**Output example**
15 +|(% style="width:166px" %)(((
16 +/rest/trackingType [GET]
17 +
18 +
19 +hedear : Authorization + env => Mandatory
20 +\\PS :** If the env does not exist on the header, you got an error 400 (bad params)**
21 +)))|(% style="width:238px" %)get all tracking Type of the giving environment|(% style="width:599px" %)(no input required)|(% style="width:449px" %){{code language="JSON"}}{
14 14   "timestamp": 1620216790744,
15 15   "status": "200",
16 16   "data": [
... ... @@ -24,7 +24,7 @@
24 24   }
25 25   ]
26 26  }{{/code}}
27 -|(% style="width:166px" %)/rest/git/history [GET]|(% style="width:189px" %)get all commits history, with their IDs ,authors ,messages, dates and if considired as current version or not |(% style="width:383px" %)(no input required)|(% style="width:449px" %){{code language="JSON"}}{
35 +|(% style="width:166px" %)/rest/git/history [GET]|(% style="width:238px" %)get all commits history, with their IDs ,authors ,messages, dates and if considired as current version or not |(% style="width:599px" %)(no input required)|(% style="width:449px" %){{code language="JSON"}}{
28 28   "timestamp": 1620217014704,
29 29   "status": "200",
30 30   "data": [
... ... @@ -44,7 +44,7 @@
44 44   }
45 45   ]
46 46  }{{/code}}
47 -|(% style="width:166px" %)/rest/git/commit [POST]|(% style="width:189px" %)commit changes in files with a message|(% style="width:383px" %){{code language="JSON"}}{
55 +|(% style="width:166px" %)/rest/git/commit [POST]|(% style="width:238px" %)commit changes in files with a message|(% style="width:599px" %){{code language="JSON"}}{
48 48  "files":
49 49  [
50 50  {"fileName" : "newFile.xml"},
... ... @@ -66,13 +66,13 @@
66 66  /rest/git/switchComit/{id}
67 67  
68 68  [GET]
69 -)))|(% style="width:189px" %)(((
77 +)))|(% style="width:238px" %)(((
70 70  switch to a certain version and return the history of all commits.
71 71  
72 72  **__NB __**: if there are some modified files in the current version, these files will be moved to a new directory called :
73 73  
74 74  .../archive/git-{timestamp}
75 -)))|(% style="width:383px" %)(((
83 +)))|(% style="width:599px" %)(((
76 76  the {id} in the URL should be replaced by the id of the wanted commit.
77 77  
78 78  eg :
... ... @@ -104,9 +104,9 @@
104 104  }
105 105  {{/code}}
106 106  )))
107 -|(% style="width:166px" %)/rest/git/update [GET]|(% style="width:189px" %)(((
115 +|(% style="width:166px" %)/rest/git/update [GET]|(% style="width:238px" %)(((
108 108  Integrates and pulls changes from a remote repository into the current branch.
109 -)))|(% style="width:383px" %)(no input required)|(% style="width:449px" %)(((
117 +)))|(% style="width:599px" %)(no input required)|(% style="width:449px" %)(((
110 110  it returns a success message.
111 111  
112 112  eg :
... ... @@ -119,13 +119,13 @@
119 119  }
120 120  {{/code}}
121 121  )))
122 -|(% style="width:166px" %)/rest/environment/init [POST]|(% style="width:189px" %)(((
130 +|(% style="width:166px" %)/rest/environment/init [POST]|(% style="width:238px" %)(((
123 123  Clone a git repository into the directory of the current environment,
124 124  
125 125  if it doesn't exist it creates a new directory and initialize the repo,
126 126  
127 -if the directory exists, the endpoint rename the directory with and create a new one and clone the repository.
128 -)))|(% style="width:383px" %)(no input required)|(% style="width:449px" %)(((
135 +if the directory exists, the endpoint renames the directory and creates a new one and clones the repository.
136 +)))|(% style="width:599px" %)(no input required)|(% style="width:449px" %)(((
129 129  it returns a "success" message :
130 130  
131 131  eg :
... ... @@ -134,9 +134,86 @@
134 134  {
135 135   "timestamp": 1620229625932,
136 136   "status": "200",
137 - "data": "ok"
145 + "data": "Repository initialized successfully !"
138 138  }
139 139  {{/code}}
140 140  )))
149 +|(% style="width:166px" %)/rest/git/checkout/{branch} [POST]|(% style="width:238px" %)switch to a certain branch|(% style="width:599px" %)(((
150 +the {branch} must be replaced by the name of the branch destination.
141 141  
152 +eg : /rest/git/checkout/master
153 +
154 + /rest/git/checkout/develop
155 +)))|(% style="width:449px" %)(((
156 +it returns a "success" message of checkout branch.
157 +
158 +eg :
159 +
160 +{{code language="JSON"}}
161 +{
162 + "timestamp": 1620229625932,
163 + "status": "200",
164 + "data": "switched to branch : master"
165 +}
166 +{{/code}}
167 +)))
168 +|(% style="width:166px" %)(((
169 +/rest/git/newbranch/{branch}
170 +
171 +[POST]
172 +)))|(% style="width:238px" %)create and switch to a new branch |(% style="width:599px" %)(((
173 +the {branch} must be replaced by the name of the branch destination.
174 +
175 +eg :
176 +
177 + /rest/git/checkout/newBranch
178 +)))|(% style="width:449px" %)(((
179 +it returns a "success" message of the branch creation.
180 +
181 +eg :
182 +
183 +{{code language="JSON"}}
184 +{
185 + "timestamp": 1620229625932,
186 + "status": "200",
187 + "data": "new branch has been created : newBranch"
188 +}
189 +{{/code}}
190 +)))
191 +|(% style="width:166px" %)/rest/git/revert [POST]|(% style="width:238px" %)switch the modified file to the initial head version. |(% style="width:599px" %){{code language="JSON"}}{
192 +"files":
193 +[
194 +{"fileName" : "newFile.xml"},
195 +{"fileName" : "/dir/modifiedFile.pdf"}
196 +]
197 +}{{/code}}|(% style="width:449px" %)(((
198 +it returns a "success" message.
199 +
200 +eg :
201 +
202 +{{code language="JSON"}}
203 +{
204 + "timestamp": 1620229625932,
205 + "status": "200",
206 + "data": "the selected files has been synchronized to HEAD successfully !"
207 +}
208 +{{/code}}
209 +)))
210 +
211 += Errors =
212 +
213 +below, you can find an example of technical and functional errors :
214 +
215 +{{code language="JSON"}}
216 +{
217 + "timestamp": 1620221672951,
218 + "status": "500",
219 + "error": "JSON file is not valid",
220 + "thechnicalError": "JSONObject[\"fileName\"] not found."
221 +}
222 +{{/code}}
223 +
224 +the functional error is shown with the JSON key "error", while technical error is stored in the "thechnicalError" key.
225 +
226 +
142 142  == ==
This wiki is hosted and managed by iXPath
Powered by XWiki 13.3 debian