diff --git a/README.md b/README.md index 800a7dc..52248c0 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,71 @@ Homebrew: ```bash brew tap serverscom/serverscom brew install srvctl -``` \ No newline at end of file +``` + +## Usage + +We need to define the context for your credentials, and global settings before we start using `srvctl`. +In order to initiate CLI usage, we have to define the context, that will be used by the CLI. + +It's done by using `srvctl login ` command. For the example below, we're using `default` context. + +```bash +$ srvctl login default #prompts to enter your API token. +Enter API token: .... + +Successfully logged in with context "default" +Context "default" set as default +``` + +Config file will be located in `$XDG_CONFIG_HOME/srvctl/config.yaml`, if XDG_CONFIG_HOME exists. +Otherwise it will rely on `$HOME/.config/srvctl/config.yaml`. +Additionally, you can define a custom path `SRVCTL_CONFIG_PATH`. + +Config file supports multiple context options, allowing you to use various configs for each of them: + +```yaml +globalConfig: {} +defaultContext: default +contexts: + - name: default + endpoint: https://api.servers.com/v1 + token: + config: {} + - name: different-context + endpoint: https://api.servers.com/v2 + token: <2ND_API_TOKEN> + config: { + proxy: "", + http-timeout: 30, + verbose: true, /* (true|false) */ + output: "json" /* (text|json|yaml) */ + } +``` + +You can adjust the context later on: + +```bash +# changing the context name +srvctl context update --name= + +# setting context to act as default +srvctl context update --default + +# delete specific context +srvctl context delete +``` + +## Documentation + +Documentation is accessible via `man` or via `--help` flag, for example: + +```bash +# man option +$ man srvctl-hosts-ds-list + +# help option, short command help +$ srvctl hosts ds list --help +``` + +Man pages are based on the documentation info located in `/docs` directory. diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..6cfa21f --- /dev/null +++ b/docs/index.md @@ -0,0 +1,30 @@ +# CLI Documentation + +## Table of Contents + +| Command | Type | Description | +|---------|------|-------------| +| [srvctl hosts](srvctl-hosts/description.md) | Hosts | A host is a bare metal-based service that includes dedicated servers, Kubernetes bare metal nodes and scalable bare metal. (ds, kbm, sbm) | +| [srvctl hosts ds](srvctl-hosts-ds/description.md) | Hosts / Dedicated Servers | This command allows to manage dedicated servers (Enterprise bare metal). | +| [srvctl hosts ds abort-release](srvctl-hosts-ds-abort-release/description.md) | Hosts / Dedicated Servers | This command cancels the scheduled release for the selected dedicated server. | +| [srvctl hosts ds add](srvctl-hosts-ds-add/description.md) | Hosts / Dedicated Servers | A command to create a dedicated server. | +| [srvctl hosts ds add-network](srvctl-hosts-ds-add-network/description.md) | Hosts / Dedicated Servers | This command adds a network to the selected server. | +| [srvctl hosts ds add-ptr](srvctl-hosts-ds-add-ptr/description.md) | Hosts / Dedicated Servers | This command adds a PTR record to the selected server. | +| [srvctl hosts ds delete-network](srvctl-hosts-ds-delete-network/description.md) | Hosts / Dedicated Servers | This command deletes a specified network for the selected server. | +| [srvctl hosts ds delete-ptr](srvctl-hosts-ds-delete-ptr/description.md) | Hosts / Dedicated Servers | This command deletes a specified PTR record for the selected server. | +| [srvctl hosts ds get](srvctl-hosts-ds-get/description.md) | Hosts / Dedicated Servers | This command provides information for the selected server. | +| [srvctl hosts ds get-network](srvctl-hosts-ds-get-network/description.md) | Hosts / Dedicated Servers | This command provides information about a specified network of the selected server. | +| [srvctl hosts ds get-oob-credentials](srvctl-hosts-ds-get-oob-credentials/description.md) | Hosts / Dedicated Servers | This command provides OOB credentials for the selected server. | +| [srvctl hosts ds list-connections](srvctl-hosts-ds-list-connections/description.md) | Hosts / Dedicated Servers | This command lists connections for the selected dedicated server. | +| [srvctl hosts ds list-drive-slots](srvctl-hosts-ds-list-drive-slots/description.md) | Hosts / Dedicated Servers | This command lists drive slots for the selected dedicated server. | +| [srvctl hosts ds list-features](srvctl-hosts-ds-list-features/description.md) | Hosts / Dedicated Servers | This command lists features for the selected dedicated server. | +| [srvctl hosts ds list-networks](srvctl-hosts-ds-list-networks/description.md) | Hosts / Dedicated Servers | This command lists networks for the selected dedicated server. | +| [srvctl hosts ds list-power-feeds](srvctl-hosts-ds-list-power-feeds/description.md) | Hosts / Dedicated Servers | This command lists power feeds for the selected dedicated server. | +| [srvctl hosts ds list-ptr](srvctl-hosts-ds-list-ptr/description.md) | Hosts / Dedicated Servers | This command lists PTR records for the selected dedicated server. | +| [srvctl hosts ds list-services](srvctl-hosts-ds-list-services/description.md) | Hosts / Dedicated Servers | This command lists services for the selected dedicated server. | +| [srvctl hosts ds ls](srvctl-hosts-ds-ls/description.md) | Hosts / Dedicated Servers | This command lists dedicated servers of the account. | +| [srvctl hosts ds power](srvctl-hosts-ds-power/description.md) | Hosts / Dedicated Servers | This command manages power operations for the selected dedicated server. | +| [srvctl hosts ds reinstall](srvctl-hosts-ds-reinstall/description.md) | Hosts / Dedicated Servers | This command reinstalls an operating system for the selected dedicated server. | +| [srvctl hosts ds schedule-release](srvctl-hosts-ds-schedule-release/description.md) | Hosts / Dedicated Servers | This command schedules release on YYYY-MM-DDTHH:MM:SS+HH:MM (dateTtime+time zone from UTC) for the selected dedicated server. | +| [srvctl hosts ds update](srvctl-hosts-ds-update/description.md) | Hosts / Dedicated Servers | This command updates parameters and labels for the selected dedicated server. | +