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

110 Commits

Author SHA1 Message Date
Aravinda VK
bebbc65052 Support for loopback bricks
Register the Bricks hosting directory using,

```
glustercli device add <peerid> <path> --provisioner loop
```

Example:

```
glustercli device add 70d79c3f-e7af-43f6-8b65-05dff2423da1 \
	   /exports --provisioner loop
```

Now create the volume using,

```
glustercli volume create gv1 --size 1G \
	   --provisioner loop \
	   --replica 3
```

Fixes: #1418
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2019-02-14 10:49:17 +05:30
Sridhar Seshasayee
ec25ca6619 Tracing: Implement glustercli command to disable the trace configuration
Implement glustercli command to disable and delete the current tracing
configuration on the cluster. The changes include gd2 transaction that
first deletes the trace configuration from the store on one node and then
a subsequent step clears the in-memory trace configuration on all nodes.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Sridhar Seshasayee
219ce69b48 Tracing: Implement glustercli command to update the trace configuration
Implement glustercli command to update the current tracing status on the
cluster. All trace config options are passed as flags to the command. If
any option is not passed, the existing value for that option will be
retained.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Sridhar Seshasayee
4c65b6f95a Tracing: Implement glustercli command to get current tracing status
Implement glustercli command to get the current tracing status on the
cluster. The tracing info is read from the store and presented to the
user in table format with info like Status, Jaeger Endpoints, Sampler
type and sample fraction. For e.g.,

+------------------------+----------------------------+
|      TRACE OPTION      |           VALUE            |
+------------------------+----------------------------+
| Status                 | enabled                    |
| Jaeger Endpoint        | http://192.168.122.1:14268 |
| Jaeger Agent Endpoint  | http://192.168.122.1:6831  |
| Jaeger Sampler         | 2 (Probabilistic)          |
| Jaeger Sample Fraction | 0.99                       |
+------------------------+----------------------------+

Add "trace enable" e2e test cases. The tests also exercise the
"trace status" request.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Sridhar Seshasayee
6158f4a040 Tracing: Implement glustercli command to enable tracing
Implement glustercli command to enable tracing. The rest client performs
basic checks of the tracing options prior to sending the request.

closes #1368

Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
2019-02-12 08:08:00 +05:30
Kotresh HR
f4692484ae Fix restclient api gluster virtblock
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2019-01-21 10:23:42 +05:30
Poornima G
4103a89b66 Add resclient api for block volume
Signed-off-by: Poornima G <pgurusid@redhat.com>
2019-01-16 15:22:15 +05:30
rishubhjain
8a52b23d84 Replace brick api 2018-12-07 19:04:19 +05:30
Aravinda VK
931b7a2e80 Refactor Device management
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2018-12-05 11:21:29 +05:30
rishubhjain
3d9707a63a Edit device API 2018-12-05 09:09:14 +05:30
Vishal Pandey
933aa93c8f split brain operations API and CLI
Signed-off-by: Vishal Pandey <vpandey@redhat.com>
2018-11-23 19:46:46 +05:30
vpandey-RH
e6ce7cfd90 Volume profile info API + CLI
Signed-off-by: Vishal Pandey <vpandey@redhat.com>
2018-11-16 18:52:23 +05:30
Prashanth Pai
edda2c5063 Refactor cluster options package
* Merge 'glusterd2/cluster' package into `glusterd2/options` package.
* Rename 'glusterd2/commands/global' to 'glusterd2/commands/options'.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-10-11 16:26:30 +05:30
Redhat
fe29991a2a Fixed GeorepStatusList response
Signed-off-by: Sidharth Anupkrishnan <sanupkri@redhat.com>
2018-10-11 16:17:50 +05:30
Jose A. Rivera
cecb83bc7c Add Version() to REST client
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
2018-10-08 09:39:40 +05:30
Oshank Kumar
a1e31747e5 restclient: added debug wrapper for debugging resclient calls.
A DebugWrapper will be helpful in debugging
restclient calls. To enable debugging we
need to pass `--loglevel` flag in glustercli
as debug
For Example, glustercli peer list --loglevel=debug

It will dump each outgoing request in
its HTTP/1.x wire representation and also It will
dump the received response in its HTTP/1.x wire
representation.

Signed-off-by: Oshank Kumar <okumar@redhat.com>
2018-09-07 17:59:09 +05:30
Mohammed Rafi KC
13968bea50 snapshot: Make snapshot base url unique
All snapshot urls now start "v1/snapshots". This was done
to keep all rest api as uniform

Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
2018-09-03 21:23:37 +05:30
Oshank Kumar
1641c9f794 restclient: applying tlsconfig to existing client Transport
applying tlsconfig to existing http.Client instead of
creating a new one.

Signed-off-by: Oshank Kumar <okumar@redhat.com>
2018-08-31 16:09:48 +05:30
Oshank Kumar
38d20ee280 restclient: refactor some of the rest client code .
added separate method to create http.Request.
Initializing underlying http.Client while initializing
GlusterD rest client

Signed-off-by: Oshank Kumar <okumar@redhat.com>
2018-08-14 18:28:18 +05:30
Prashanth Pai
a257ffda9f plugins: Return 200 OK instead of 201 Created
...in cases where no new uniquely identifiable resource was created.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-08-08 13:27:10 +05:30
Madhu Rajanna
312ae58167 add QSH to the jwt token to avoid URL tampering
A query string hash (QSH) is an important technique
to prevent URL tampering and secure HTTP requests,
When a Client makes a request without a QSH claim,
or with a bad QSH claim (one that doesn’t match
the request), then the glusterd2 will respond with
HTTP status 401 Unauthorized

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-08-06 17:14:06 +05:30
Oshank Kumar
82704c75d4 Fixed panic caused by stopping liveness watcher
If liveness watcher has not been started then a call to stop liveness watcher was causing panic.
Root Cause : closing a closed chan will result in panic.
This will fix issue #1092

Signed-off-by: Oshank Kumar <okumar@redhat.com>

fixed merge conflicts

Signed-off-by: Oshank Kumar <okumar@redhat.com>

changed chan chan err to chan chan struct{}

Signed-off-by: Oshank Kumar <okumar@redhat.com>

added synchronization

Signed-off-by: Oshank Kumar <okumar@redhat.com>

added waitgroup for sync

Signed-off-by: Oshank Kumar <okumar@redhat.com>

group std go package

Signed-off-by: Oshank Kumar <okumar@redhat.com>
2018-08-01 12:23:44 +05:30
Prashanth Pai
a19b8ae856 restclient: Refactor error response handling
* Simplify the do() method. Abstract creation of HTTP error.
* Save the last error response received from the server in the
  restclient.Client instance which can be accessed using the
  LastErrorResponse() method.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-07-30 09:13:19 +05:30
Prashanth Pai
8d5b37d85a cli/restclient: Make client timeout configurable
The client timeout is now configurable at the restclient layer and also
in the CLI. The client timeout defaults to 30 seconds in both restclient
and CLI.

Timeout can be configured in:
  * restclient using SetTimeout() API.
  * CLI using --timeout command line flag.

This client timeout is the overall timeout which includes the time taken
from setting up TCP connection till client finishes reading the response
body from glusterd2.

Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-07-19 12:10:27 +05:30
Aravinda VK
5bf8c09ffd Merge Smartvol API into regular Volume Create
Example:

    curl -XPOST http://localhost:24007/v1/volumes \
        -d '{"name": "gv1", "size": 1000, "replica": 3}'

Where size is in Mb.

CLI usage is unchanged

    glustercli volume create --name gv1 --size 1G --replica 3

Signed-off-by: Aravinda VK <avishwan@redhat.com>
2018-07-18 10:21:56 +05:30
rishubhjain
e2b0a603fd Fix typos reported by misspell tool 2018-07-17 11:23:27 +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
Mohammed Rafi KC
e22c0e07dc snapshot:clone Implement snapshot clone
This PR includes functional changes, client api changes,
Test cases.

Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
2018-07-13 13:06:10 +05:30
Mohammed Rafi KC
f0381c6329 snapshot:restore implement snapshot restore
This include functionality changes, test cases, cli
and other improvements.

Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
2018-07-13 13:06:10 +05:30
Mohammed Rafi KC
e85bb81ad5 snapshot/status: implement snapshot status
This PR includes test functionality change, cli and test cases

Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
2018-07-13 13:06:10 +05:30
Mohammed Rafi KC
a55da3f232 snapshot/list: Change snapshot list to param based rest url
snapshot list will now take volume as the key in url to list all
snapshots of a volume

Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
2018-07-13 13:06:10 +05:30
Mohammed Rafi KC
4a8a31b022 snapshot:implement delete command
Patchset include -->
*Functional changes for snapshot delete
*cli implemetation for snapshot delete
*Test case for snapshot delete

Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
2018-07-13 13:06:10 +05:30
vpandey-RH
94b631c2f7 Index/Full Heal API and CLI 2018-07-12 21:12:15 +05:30
vpandey-RH
5e17004eec Volume reset CLI command and support for resetting all options
at once.

Signed-off-by: Vishal Pandey <vpandey@redhat.com>
2018-07-10 16:20:52 +05:30
Samikshan Bairagya
a2996ffce2 Add support to get volume options via CLI.
Usage:
      glustercli volume get <volname> <optname|all>

If all is used instead of optname, all volume options are listed.

Signed-off-by: Samikshan Bairagya <samikshan@gmail.com>
2018-07-04 12:51:19 +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
cfbb8641a6 events: rest client api for list gluster events
list gluster events was missed in rest client
api, added rest api to cover the e2e test cases
for list gluster events

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-06-25 11:25:08 +05:30
Madhu Rajanna
f59fe46a15 Peers: added get peer info api in rest client
Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-06-22 09:50:59 +05:30
Prashanth Pai
467a018919 Merge branch 'master' into fix_scrubstatus 2018-06-11 14:54:57 +05:30
Madhu Rajanna
b30dc3b662 return HTTP StatusCreated instead on StatusOK
for adding device

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-06-11 14:24:21 +05:30
Madhu Rajanna
63b70fc812 updated function comment in rest api
for get bitrot scrub status

Signed-off-by: Madhu Rajanna <mrajanna@redhat.com>
2018-06-11 14:03:23 +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
Prashanth Pai
7b84ef8757 txn: Add CLI support to parse txn error
Signed-off-by: Prashanth Pai <ppai@redhat.com>
2018-06-06 21:37:02 +05:30
Aravinda VK
45d8d420b4 Intelligent Volume Provisioning
Updates: #466
Signed-off-by: Aravinda VK <avishwan@redhat.com>
2018-05-31 19:42:40 +05:30
root
3af0c8dbda Modify isActionStepRequired and heal info resp
Signed-off-by: Vishal Pandey <vpandey@redhat.com>
2018-05-29 22:42:36 +05:30
root
cca49d2fa6 Implement SHD enable/disable and add selfheal-info
Signed-off-by: root <root@dhcp41-154.lab.eng.blr.redhat.com>
2018-05-29 21:20:40 +05:30
Kaushal M
2a3599bd27 Merge branch 'master' into snapshot1 2018-05-29 17:37:42 +05:30
rishubhjain
38693af6e0 Formating go code 2018-05-25 12:20:03 -04:00
Prashanth Pai
e2469feec2 Merge branch 'master' into filtering-peers-on-metadata 2018-05-25 21:21:09 +05:30
root
d6f862bdd5 Filter peers on basis of metadata either by metadata key/value/key+value
Signed-off-by: Vishal Pandey <vpandey@redhat.com>
2018-05-25 17:15:36 +05:30