1
0
mirror of https://github.com/gluster/glusterd2.git synced 2026-02-05 21:45:43 +01:00

17 Commits

Author SHA1 Message Date
Madhu Rajanna
3c9ca8411b log errors with log.WithError()
during error logging we should log
with WithError()

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-08-09 14:29:28 +05:30
Prashanth Pai
ef7280ed7b api: Fix godoc links for plugins
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-07-26 11:53:42 +05:30
Prashanth Pai
4b7c2cd906 plugins: Prefix plugin name to the rest routes
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-07-26 11:53:42 +05:30
Prashanth Pai
4f7c8135bf plugins: Create 'api' package for each plugin
In Go, every directory is a distinct package. There is no such thing as
a subpackage. Having `api` is a separate package as a subdirectory in
each plugin ensures that we will not run into cyclic dependency issues.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-07-26 11:53:42 +05:30
Madhu Rajanna
2039f6fb85 implement webhook push handler
implement handler function to send
events to registered webhook

registered handle function will get
called when the events happen.
check origin UUID, if it is same as the peer ID
send events to the registered webhook

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-07-13 13:52:59 +05:30
Madhu Rajanna
0b99b82c35 Implemented webhook/test rest API in glusterd2
Implemented wehook/test rest API in glusterd2
which will be called by clients to test webhook
connections between all peers in glusterd2
and webhook URL

added rest client code to call webhook/test API

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-07-13 13:52:59 +05:30
Madhu Rajanna
d6a72cf4d6 Do not return plaintext in response body
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-07-12 13:58:25 +05:30
Madhu Rajanna
035fb8b4d7 added request and response type
for event routes

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-06-25 14:05:17 +05:30
Madhu Rajanna
3b261357d4 Delete webhook: webhook delete request body should
expect only URL which is required to delete webhook

earlier we use to pass same request body for both
webhook create and webhook delete,we store URL in
ETCD to add webhook, so to delete webhook we
require only URL, made code changes to accept
URL in request body for webhook delete

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-06-25 14:05:17 +05:30
Madhu Rajanna
59d7601c46 return 204 HTTP StatusNocontent for delete
operations

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-06-07 11:53:31 +05:30
Madhu Rajanna
9ca09fe0d2 updated code to use wrapper functions
for store Get,Put and Delete operations

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-06-06 16:55:39 +05:30
Aravinda VK
e23e718fb3 plugins: Remove SunRPC pluggability
None of the plugins exposed sunrpc programs using plugin interface.

Removing unused part from the Plugin interface.

Signed-off-by: Aravinda VK <avishwan@redhat.com>
2018-04-23 10:27:20 +05:30
root
46f5d66013 Return 400(Bad Request) instead of 422(unprocessable entity)
whenever json parsing fails.

Signed-off-by: Vishal Pandey <vpandey@redhat.com>
2018-04-18 06:49:52 -04:00
Aravinda VK
620d6b5d4a events: Expose API to view the Events
- Increased the TTL to 10 minutes and made configurable.
- Exposed the new API to view Events
- Added Geo-replication Events
- `GET /v1/events` now returns list of events in sorted order

Updates: #418
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2018-03-27 14:59:29 +05:30
Prashanth Pai
2dd9b85c48 Simplify SendHTTPError()
* Remove having to specify default error code. It is made implicit
  instead. This removes some of the code clutter.
* Support returning multiple errors in a single API response.
  Although this will be rarely used, introducing the provision in API
  right now is better than later.
* Allow callers to pass both string and error types.
* Introduce a error code map which maps error codes (integers) to their
  brief textual description.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-03-21 20:16:53 +05:30
Prashanth Pai
23e5a679c5 Import sunrpc into pkg
This is an as-is import of sunrpc codec without introducing any
functional code changes. There are few opportunities for cleanup and
optimizations and that'll be done in future.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-02-09 11:17:36 +05:30
Darshan N
af473de006 Adds event listener and related APIs to glusterd
This patch adds a new server for listening to udp messages
sent by other glusterfs components. It process this message
and posts it to all the registered webhooks.

Also it the following API endpoints to glusterd via
events plugin to register/unregister/list webhooks:

* Add webhook:
POST request on "/v1/events/webhook" with body
{
    "url": "http://192.168.122.100:9000/listen",
    "token": "<token_for_webhook>"
}

* List webhook:
GET request on "/v1/events/webhook". The response is
list of webhook URLs.
sample response:
[
    "http://192.168.122.100:9000/listen",
    "http://192.168.122.188:9000/listen",
    "http://192.168.122.202:9000/listen"
]

* Delete webhook:
DELETE request on "/v1/events/webhook" with body
{
    "url": "http://192.168.122.100:9000/listen"
}

Issue: https://github.com/gluster/glusterd2/issues/418
Signed-off-by: Darshan N <darshan.n.2024@gmail.com>
2018-01-30 11:42:08 +05:30