You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: wiki/markdown/add-subscription.md
+32-28Lines changed: 32 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,9 @@ description of the elements available on this form.
8
8
</kbd>
9
9
10
10
## Load Subscription Template
11
-
In this dropdown list, options are given to
12
-
select a specific template for the subscription form. Currently, the following
13
-
options are listed: Jenkins Pipeline Parametrized Job Trigger, REST POST and
14
-
Mail Trigger.
11
+
In this dropdown list, options are given to select a specific template for
12
+
the subscription. Currently, the following options are listed:
13
+
Jenkins Pipeline Parametrized Job Trigger, REST POST and Mail Trigger.
15
14
16
15
## SubscriptionName
17
16
A field to give a name to the current subscription. Only
@@ -22,28 +21,30 @@ letters, underscore and numbers are allowed in this field.
22
21
</kbd>
23
22
24
23
## NotificationType
25
-
There are two options: REST POST and
26
-
Mail Trigger, depending on how a subscriber want to be notified when a
27
-
subscription is fulfilled. If Notification type MAIL is selected an email
28
-
subject may be entered, but it is optional.
24
+
When the subscription is fulfilled there are two types of notifications:
25
+
REST POST and mail notification. If Notification type MAIL is selected an
26
+
email subject may be entered, but it is optional. Eiffel Intelligence will
27
+
use the configured email subject from Eiffel Intelligence back-end
28
+
application.properties if nothing is specified in the subscription.
29
29
30
30
## RestPostMediaType
31
-
Options for selecting a
32
-
specific form content type. The options available in the list depends on the
33
-
selected template type.
31
+
Options for selecting a specific form content type. This is only when the
32
+
notification type REST POST is selected. The options available are:
33
+
'application/json' and 'application/x-www-form-urlencoded'.
34
34
35
35
## NotificationMessage
36
-
It is used to send a message to a specific client. The
37
-
format of the message depends on the options selected in the NotificationMessage
36
+
It is used to send a message to a specific client. The format of the
37
+
message depends on the options selected in the NotificationMessage
38
38
and RestPostMediaType. A button, “Add Key/Value pair”, in this field may be
39
-
used to add more messages, if the selected RestPostBodyMediaType is FORM/POST
40
-
parameters.
39
+
used to add more parameters, if the selected RestPostBodyMediaType is
40
+
'application/x-www-form-urlencoded'. If the RestPostBodyMediaType is
41
+
'application/json' only one json object is allowed in the notificationMessage.
41
42
42
43
## NotificationMeta
43
-
Is the selected subscriber to notify when a subscription
44
-
is triggered. It could be an email address such as `example@mail.com` or a url
45
-
like `host.com/endpoint`. If you wish to trigger Jenkins job when a subscription
46
-
is fulfilled then the url for the job could be set as the notificationMeta.
44
+
Is the selected subscriber to notify when a subscription is fulfilled. It
45
+
could be an email address such as `example@mail.com` or a url like
46
+
`host.com/endpoint`. If you wish to trigger a Jenkins job when a
47
+
subscription is fulfilled then the url for the job could be set as the notificationMeta.
47
48
Parameters such as a Jenkins job-token can be included in this field.
48
49
**Note**: The job-token should not be mistaken for the API token that is
49
50
used as a password for authentication against the entire jenkins instance.
@@ -53,7 +54,9 @@ used as a password for authentication against the entire jenkins instance.
53
54
</kbd>
54
55
55
56
## Authentication
56
-
A list to select authentication type.
57
+
A list to select authentication type. These credentials should be used by
58
+
Eiffel Intelligence to perform the HTTP POST notification towards an external
59
+
API.
57
60
* NO_AUTH: _No Authentication used_
58
61
* BASIC_AUTH: _Username and password will be Base 64 encoded_
59
62
* BASIC_AUTH_JENKINS_CSRF: Jenkins CSRF Protection (crumb), _Username and password will
@@ -72,12 +75,13 @@ the notification will be triggered only the first time when requirements are
72
75
fulfilled. It doesn't matter if you have multiple requirements, it will only be triggered once.
73
76
74
77
## Requirement and Conditions
75
-
It is used to add a requirement, which need to
76
-
be fulfilled before a subscription is triggered. Requirement is added in the form
77
-
of a condition (with a specific format). More than one conditions may be added
78
-
under one requirement by using “Add Condition” button. It should be noted
79
-
that conditions under one requirement are connected by logical “AND”.
80
-
Thus all conditions udder one requirement need to be satisfied before a subscription
81
-
is triggered. More than one requirements may be added by “Add Requirement” button.
82
-
Requirements are connected by logical “OR”.
78
+
It is used to add requirements and conditions, which need to be fulfilled.
79
+
A requirement should contain at least one condition (with a specific format).
80
+
More than one conditions may be added under one requirement by using the
81
+
“Add Condition” button. It should be noted that conditions under one
82
+
requirement are connected by a logical “AND”. Thus all conditions under
83
+
one requirement need to be satisfied before a subscription is fulfilled.
84
+
More than one requirements may be added with the “Add Requirement” button.
85
+
Requirements are connected by a logical “OR”.
86
+
83
87
**_More information about how to write Requirement and Conditions can be found [here](https://github.com/eiffel-community/eiffel-intelligence/blob/master/wiki/markdown/subscriptions.md#writing-requirements-and-conditions)._**
Copy file name to clipboardExpand all lines: wiki/markdown/curl-examples.md
+42-32Lines changed: 42 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,12 @@
2
2
3
3
## Introduction
4
4
5
-
The front-end has a bridge functionality that is built in as a part of the front-end's web server and handles requests coming from the web GUI towards any of the back-ends configured.
6
-
The `/backends` endpoint is the only additional endpoint which does not exist in [Eiffel Intelligence backend](https://github.com/eiffel-community/eiffel-intelligence).
7
-
The front-end may also be used by other tools such as CURL or any kind of program that can make HTTP(S) requests.
8
-
Below are some examples of using CURL towards different endpoints, together with example responses.
9
-
Most endpoints are also documented in the [Eiffel Intelligence backend repository](https://github.com/eiffel-community/eiffel-intelligence/tree/master/wiki/markdown)
5
+
The front-end has a bridge functionality that is built in as a part of the front-end's web server
6
+
and handles requests coming from the web GUI towards any of the configured Eiffel Intelligence back-ends.
7
+
The `/backends` endpoint is the only additional endpoint which does not exist in [Eiffel Intelligence back-end](https://github.com/eiffel-community/eiffel-intelligence).
8
+
The front-end may also be used by other tools such as CURL or any kind of program that can make HTTP(S)
9
+
requests. Below are some examples of using CURL towards different endpoints, together with example
10
+
responses. Most endpoints are also documented in the [Eiffel Intelligence back-end repository](https://github.com/eiffel-community/eiffel-intelligence/tree/master/wiki/markdown)
10
11
11
12
**Note**: If you have multiple url parameters, you need to add quotation mark around the entire query. For example:
12
13
@@ -24,21 +25,23 @@ Most endpoints are also documented in the [Eiffel Intelligence backend repositor
24
25
*[/subscriptions](#subscriptions)
25
26
26
27
#### Specified back-end
27
-
As a user of the front-end you may want to specify your own back-end URL if you do not want to use the default back-end.
28
-
This is possible to do by injecting the back-end URL as a query parameter.
29
-
The parameters key should be `backendurl` then enter the full HTTP URL you wish to use. This back-end instance does not have to be specified in the list of available instances.
30
-
31
-
An example of a way to add such parameter is examplified below, note that the "?" indicates that parameters has been added to the front-end url.
32
-
`localhost:8080` is the front-end url, and we want to access the context path /authentication but on URL `http://127.0.0.1:8090/` that is the back-end we wish to use.
28
+
As a user of the front-end you may want to specify your own back-end URL if you do not want to use the
29
+
default back-end. This is possible to do by injecting the back-end URL as a query parameter. The
30
+
parameters key should be `backendurl` then enter the full HTTP URL you wish to use. This back-end
31
+
instance does not have to be specified in the list of available instances.
33
32
33
+
An example of a way to add such parameter is exemplified below, note that the "?" indicates that
34
+
parameters has been added to the front-end url.`localhost:8080` is the front-end url, and we want to
35
+
access the context path /authentication but on URL `http://127.0.0.1:8090/` that is the back-end we wish to use.
34
36
35
37
curl -X GET http://localhost:8080/authentication?backendurl="http://127.0.0.1:8090/"
36
38
37
-
Example with Tomcat:
39
+
Example with Eiffel Intelligence front-end deployed with Tomcat, and the
40
+
context path /eifrontend/:
38
41
39
42
curl -X GET http://localhost:8080/eifrontend/authentication?backendurl="http://127.0.0.1:8090/eibackend/"
40
43
41
-
This way of entering the `backendurl` may be the easiest way. It works with GET, POST and PUT requests. Currently entering just a back-end name is not supported.
44
+
This way of entering the `backendurl` may be the easiest way. It works with all CRUD operations.
42
45
43
46
**Note: It is not possible to add the `backendurl` parameter as a JSON parameter.**
44
47
@@ -67,7 +70,7 @@ This way of entering the `backendurl` may be the easiest way. It works with GET,
67
70
</tr>
68
71
</table>
69
72
70
-
A curl call with the command:
73
+
A curl request with the command:
71
74
72
75
curl -X GET http://localhost:8080/authentication
73
76
@@ -119,14 +122,17 @@ This command would return a JSON object containing the status of the back-end an
119
122
</tr>
120
123
</table>
121
124
122
-
While the web GUI may use the back-end instances list and select different back-ends in an easy way, a user that uses the front-end without the included web GUI may need to specify a back-end URL. This may be done by adding a `backendurl` parameter to the request.
125
+
While the web GUI may use the back-end instances list and select different back-ends in an easy way,
126
+
a user that uses the front-end without the included web GUI may need to specify a back-end URL. This
127
+
may be done by adding a `backendurl` parameter to the request.
123
128
124
-
Note that for users where the front-end and back-end is running with the help of Tomcat there will be context paths used.
129
+
Note that for users where the front-end and back-end is deployed with Tomcat there will be context paths used.
125
130
126
131
#### Default back-end
127
132
128
-
The front-end can be configured to use a default back-end, this means that if no back-end is specified when making a HTTP request to the front-end the default back-end will be used.
129
-
If you want to see a list of back-ends and see if there is a default back-end set, you may use the command:
133
+
The front-end can be configured to use a default back-end, this means that if no back-end is specified
134
+
when making a HTTP request to the front-end the default back-end will be used. If you want to see a
135
+
list of back-ends and see if there is a default back-end set, you may use the command:
130
136
131
137
###### Example GET request using curl:
132
138
@@ -140,12 +146,15 @@ If you want to see a list of back-ends and see if there is a default back-end se
140
146
141
147
curl -X GET http://localhost:8080/backends
142
148
143
-
The default back-end should have the key `defaultBackend` set to `true`. If the JSON list ends up empty there are no back-ends specified in the front-end. If there is no JSON object with the key set to true there is no default back-end.
149
+
The default back-end should have the key `defaultBackend` set to `true`. If the JSON list ends up
150
+
empty there are no back-ends specified in the front-end. If there is no JSON object with the key set
151
+
to true there is no default back-end.
144
152
145
153
__Note:__`name` must be unique.
146
154
147
-
Only one back-end instance can be added at a time.
148
-
Even with different names all elements must be unique, you may not have two or more elements with the same `host`, `port`, `contextPath` or `https` value, one of these three keys must be different. Only the `contextPath` key may be left empty.
155
+
Only one back-end instance can be added at a time. Even with different names all elements must be
156
+
unique, you may not have two or more elements with the same `host`, `port`, `contextPath` or `https`
157
+
value, one of these three keys must be different. Only the `contextPath` key may be left empty.
149
158
150
159
###### Example of __valid__ back-end list:
151
160
@@ -158,7 +167,8 @@ Even with different names all elements must be unique, you may not have two or m
158
167
]
159
168
160
169
All entries has different `names`.
161
-
Second entry has different `host`, third entry has different `port`, third entry has different `contextPath`, fifth entry has `https` changed to true.
170
+
Second entry has different `host`, third entry has different `port`, third entry has different `contextPath`,
171
+
fifth entry has `https` changed to true.
162
172
163
173
###### Example of __invalid__ back-end list:
164
174
@@ -168,7 +178,8 @@ Second entry has different `host`, third entry has different `port`, third entry
The second entry is invalid due to having the same name as the first entry. The third entry is invalid due to having the same value in all fields as the first entry.
181
+
The second entry is invalid due to having the same name as the first entry. The third entry is invalid
182
+
due to having the same value in all fields as the first entry.
172
183
173
184
## <aid="templates" />/templates
174
185
@@ -195,7 +206,8 @@ The second entry is invalid due to having the same name as the first entry. The
195
206
</tr>
196
207
</table>
197
208
198
-
The Eiffel Intelligence front-end supports these endpoints. More information can be found in the [Eiffel Intelligence back-end documentation](https://github.com/eiffel-community/eiffel-intelligence/blob/master/wiki/markdown/templates.md)
209
+
The Eiffel Intelligence front-end supports these endpoints. More information can be found in the
@@ -207,7 +219,8 @@ This command returns a list of predefined template events.
207
219
208
220
curl -X GET -H "Content-type: application/json" http://localhost:8080/templates/events
209
221
210
-
This command returns a list of several subscriptions. It is also possible to specify a file in which to save the downloaded objects in to.
222
+
This command returns a list of several subscriptions. It is also possible to specify a file in which
223
+
to save the downloaded objects to.
211
224
212
225
curl -X GET -H "Content-type: application/json" localhost:8080/templates/subscriptions --output myFile.json
213
226
@@ -352,19 +365,20 @@ Example curl commands to these endpoints [can be found here](https://github.com/
352
365
</table>
353
366
354
367
The `/subscriptions` endpoint can be called with `GET`, `POST`, `PUT` and `DELETE`.
355
-
More information, and examples, on the `/subscriptions` API can be found [here](https://github.com/eiffel-community/eiffel-intelligence/tree/master/wiki/markdown/subscription-API.md).
368
+
More information, and examples, on the `/subscriptions` API can be found in the [Eiffel Intelligence back-end documentation](https://github.com/eiffel-community/eiffel-intelligence/tree/master/wiki/markdown/subscription-API.md).
356
369
357
370
A `POST` request with subscriptions in a file may look as the following example.
358
371
359
372
curl -X POST -d @file_containing_list_of_json_objects -H "Content-Type: application/json" \
Here is an example using this endpoint and the result it gives in case we have the templated subscriptions added.
375
+
Here is an example using this endpoint and the result it gives if template subscriptions exists.
363
376
The `backendurl` parameters is passed in to use a specified instance instead of the default back-end instance.
364
377
365
378
curl -X GET http://localhost:8080/subscriptions?backendurl="http://127.0.0.1:8090/"
366
379
367
-
The back-end used is running on localhost and port 8080. EI front-end forwards the request to 127.0.0.1 and port 8090 as requested in the query parameters and the result is as follows:
380
+
The back-end used is running on localhost and port 8080. EI front-end forwards the request to 127.0.0.1
381
+
and port 8090 as requested in the query parameters and the result is a list of existing subscriptions:
368
382
369
383
[
370
384
{
@@ -393,7 +407,6 @@ The back-end used is running on localhost and port 8080. EI front-end forwards t
393
407
"userName":"functionalUser",
394
408
"password":"",
395
409
"ldapUserName":"",
396
-
"notificationMessageKeyValuesAuth":[],
397
410
"_id":{
398
411
"$oid":"5c012117aeb9d61aed160a2c"
399
412
},
@@ -424,7 +437,6 @@ The back-end used is running on localhost and port 8080. EI front-end forwards t
424
437
"subscriptionName":"Subscription2",
425
438
"password":"",
426
439
"ldapUserName":"",
427
-
"notificationMessageKeyValuesAuth":[],
428
440
"_id":{
429
441
"$oid":"5c012117aeb9d61aed160a2d"
430
442
},
@@ -455,11 +467,9 @@ The back-end used is running on localhost and port 8080. EI front-end forwards t
0 commit comments