|
25 | 25 | 1. [Upgrade Start](#upgrade-start) |
26 | 26 | 2. [Upgrade Status](#upgrade-status) |
27 | 27 | 3. [Upgrade History](#upgrade-history) |
28 | | -10. [Global Options](#global-options) |
29 | | -11. [Examples](#examples) |
| 28 | +10. [Connections](#connection) |
| 29 | + 1. [Add Connection](#add-connection) |
| 30 | + 2. [Update Connection](#update-connection) |
| 31 | + 3. [Connection Status](#connection-status) |
| 32 | + 4. [List Connections][#list-connections] |
| 33 | + 5. [Delete Connection](#delete-connection) |
| 34 | +11. [Global Options](#global-options) |
| 35 | +12. [Examples](#examples) |
30 | 36 | 1. [Bucket Commands Examples](#bucket-commands-examples) |
31 | 37 | 2. [Account Commands Examples](#account-commands-examples) |
32 | 38 | 3. [White List Server IP Command Example](#white-list-server-ip-command-example) |
@@ -525,6 +531,109 @@ The available history information is an array of upgrade information - upgrade s |
525 | 531 | noobaa-cli upgrade history |
526 | 532 | ``` |
527 | 533 |
|
| 534 | +## Managing Connections |
| 535 | + |
| 536 | +A connection file holds information needed to send out a notification to an external server. |
| 537 | +The connection files is specified in each notification configuration of the bucket. |
| 538 | + |
| 539 | +- **[Add Connection](#add-connection)**: Create new connections with customizable options. |
| 540 | +- **[Update Connection](#update-connection)**: Modify the settings and configurations of existing connections. |
| 541 | +- **[Connection Status](#connection-status)**: Retrieve the current status and detailed information about a specific connection. |
| 542 | +- **[List Connections](#list-connections)**: Display a list of all existing connections. |
| 543 | +- **[Delete Connection](#delete-connection)**: Remove unwanted or obsolete connections from the system. |
| 544 | + |
| 545 | +### Add Connection |
| 546 | + |
| 547 | +The `connection add` command is used to create a new connection with customizable options. |
| 548 | + |
| 549 | +#### Usage |
| 550 | +```sh |
| 551 | +noobaa-cli connection add --from_file |
| 552 | +``` |
| 553 | +#### Flags - |
| 554 | + |
| 555 | +- `name` (Required) |
| 556 | + - Type: String |
| 557 | + - Description: A name to identify the connection. |
| 558 | + |
| 559 | +- `notification_protocol` (Required) |
| 560 | + - Type: String |
| 561 | + - Enum: http | https | kafka |
| 562 | + - Description - Target external server's protocol. |
| 563 | + |
| 564 | +- `agent_request_object` |
| 565 | + - Type: Object |
| 566 | + - Description: An object given as options to node http(s) agent. |
| 567 | + |
| 568 | +- `request_options_object` |
| 569 | + - Type: Object |
| 570 | + - Description: An object given as options to node http(s) request. If "auth" field is specified, it's value is encrypted. |
| 571 | + |
| 572 | +- `from_file` |
| 573 | + - Type: String |
| 574 | + - Description: Path to a JSON file which includes connection properties. When using `from_file` flag the connection details must only appear inside the options JSON file. See example below. |
| 575 | + |
| 576 | +### Update Connection |
| 577 | + |
| 578 | +The `connection update` command is used to update an existing bucket with customizable options. |
| 579 | + |
| 580 | +#### Usage |
| 581 | +```sh |
| 582 | +noobaa-cli connection update --name <connection_name> --key [--value] [--remove_key] |
| 583 | +``` |
| 584 | +#### Flags - |
| 585 | +- `name` (Required) |
| 586 | + - Type: String |
| 587 | + - Description: Specifies the name of the updated connection. |
| 588 | + |
| 589 | +- `key` (Required) |
| 590 | + - Type: String |
| 591 | + - Description: Specifies the key to be updated. |
| 592 | + |
| 593 | +- `value` |
| 594 | + - Type: String |
| 595 | + - Description: Specifies the new value of the specified key. |
| 596 | + |
| 597 | +- `remove_key` |
| 598 | + - Type: Boolean |
| 599 | + - Description: Specifies that the specified key should be removed. |
| 600 | + |
| 601 | +### Connection Status |
| 602 | + |
| 603 | +The `connection status` command is used to print the status of the connection. |
| 604 | + |
| 605 | +#### Usage |
| 606 | +```sh |
| 607 | +noobaa-cli connection status --name <connection_name> |
| 608 | +``` |
| 609 | +#### Flags - |
| 610 | +- `name` (Required) |
| 611 | + - Type: String |
| 612 | + - Description: Specifies the name of the connection. |
| 613 | + |
| 614 | +### List Connections |
| 615 | + |
| 616 | +The `connection list` command is used to display a list of all existing connections. |
| 617 | + |
| 618 | + |
| 619 | +#### Usage |
| 620 | +```sh |
| 621 | +noobaa-cli connection list |
| 622 | +``` |
| 623 | + |
| 624 | +### Delete Connection |
| 625 | + |
| 626 | +The `connection delete` command is used to delete an existing connection. |
| 627 | + |
| 628 | +#### Usage |
| 629 | +```sh |
| 630 | +noobaa-cli connection delete --name <connection_name> |
| 631 | +``` |
| 632 | +#### Flags - |
| 633 | +- `name` (Required) |
| 634 | + - Type: String |
| 635 | + - Description: Specifies the name of the connection to be deleted. |
| 636 | + |
528 | 637 | ## Global Options |
529 | 638 |
|
530 | 639 | Global options used by the CLI to define the config directory settings. |
@@ -658,7 +767,21 @@ sudo noobaa-cli bucket delete --name bucket1 2>/dev/null |
658 | 767 | ``` |
659 | 768 |
|
660 | 769 | ----- |
| 770 | +### Connection Commands Examples |
| 771 | + |
| 772 | +#### Create Connection in CLI |
| 773 | + |
| 774 | +```sh |
| 775 | +sudo noobaa-cli connection add --name conn1 --notification_protocol http --request_options_object '{"auth": "user:passw"}' |
| 776 | +``` |
661 | 777 |
|
| 778 | +#### Update Connection Field |
| 779 | + |
| 780 | +```sh |
| 781 | +sudo noobaa-cli connection update --name conn1 --key request_options_object --value '{"auth":"user2:pw2"}' |
| 782 | +``` |
| 783 | + |
| 784 | +----- |
662 | 785 | #### `--from-file` flag usage example |
663 | 786 |
|
664 | 787 | Using `from_file` flag: |
@@ -695,6 +818,21 @@ sudo noobaa-cli account add --from_file <options_account_JSON_file_path> |
695 | 818 | sudo noobaa-cli bucket add --from_file <options_bucket_JSON_file_path> |
696 | 819 | ``` |
697 | 820 |
|
| 821 | +##### 2. Create JSON file for connection: |
| 822 | + |
| 823 | +```json |
| 824 | +{ |
| 825 | + "name": "http_conn", |
| 826 | + "notification_protocol": "http", |
| 827 | + "agent_request_object": {"host": "localhost", "port": 9999, "timeout": 100}, |
| 828 | + "request_options_object": {"auth": "user:passw", "path": "/query"} |
| 829 | +} |
| 830 | +``` |
| 831 | + |
| 832 | +```bash |
| 833 | +sudo noobaa-cli connection add --from_file <options_connection_JSON_file_path> |
| 834 | +``` |
| 835 | + |
698 | 836 | ------ |
699 | 837 |
|
700 | 838 | ### White List Server IP command example |
|
0 commit comments