diff --git a/docs/srvctl-hosts-ds-abort-release/description.md b/docs/srvctl-hosts-ds-abort-release/description.md new file mode 100644 index 0000000..fbf8c24 --- /dev/null +++ b/docs/srvctl-hosts-ds-abort-release/description.md @@ -0,0 +1 @@ +This command cancels the scheduled release for the selected dedicated server. diff --git a/docs/srvctl-hosts-ds-abort-release/examples.md b/docs/srvctl-hosts-ds-abort-release/examples.md new file mode 100644 index 0000000..0cb5a0b --- /dev/null +++ b/docs/srvctl-hosts-ds-abort-release/examples.md @@ -0,0 +1,5 @@ +A comand to cancel the scheduled release for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds abort-release ex4mp1eID +``` diff --git a/docs/srvctl-hosts-ds-add-network/description.md b/docs/srvctl-hosts-ds-add-network/description.md new file mode 100644 index 0000000..8964a5b --- /dev/null +++ b/docs/srvctl-hosts-ds-add-network/description.md @@ -0,0 +1 @@ +This command adds a network to the selected server. diff --git a/docs/srvctl-hosts-ds-add-network/examples.md b/docs/srvctl-hosts-ds-add-network/examples.md new file mode 100644 index 0000000..10dade9 --- /dev/null +++ b/docs/srvctl-hosts-ds-add-network/examples.md @@ -0,0 +1,5 @@ +A command to add a network to the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds add-network ex4mp1eID --distribution-method route --mask 32 --type private +``` diff --git a/docs/srvctl-hosts-ds-add-ptr/description.md b/docs/srvctl-hosts-ds-add-ptr/description.md new file mode 100644 index 0000000..e7dc88a --- /dev/null +++ b/docs/srvctl-hosts-ds-add-ptr/description.md @@ -0,0 +1 @@ +This command adds a PTR record to the selected server. diff --git a/docs/srvctl-hosts-ds-add-ptr/examples.md b/docs/srvctl-hosts-ds-add-ptr/examples.md new file mode 100644 index 0000000..d799f8b --- /dev/null +++ b/docs/srvctl-hosts-ds-add-ptr/examples.md @@ -0,0 +1,5 @@ +A commands to add a PTR record for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds add-ptr ex4mp1eID --domain example.com --ip X.X.X.X --priority 1 --ttl 360 +``` diff --git a/docs/srvctl-hosts-ds-add/description.md b/docs/srvctl-hosts-ds-add/description.md new file mode 100644 index 0000000..49a4e75 --- /dev/null +++ b/docs/srvctl-hosts-ds-add/description.md @@ -0,0 +1,5 @@ +A command to create a dedicated server. It allows to pass parameters of a server in two ways: + +- Input - server parameters are described in a file, a path to the file is specified via the `-i` or `–input` flag. The path can be absolute or relative to the srvctl file. Parameters should be described as a request body of the [Public API request](https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/CreateADedicatedServer). There is also an option to use standard input (stdin) when specifying the flag this way: `--input -` + +- Flags - parameters are specified via flags inside the command and hostnames are listed as position arguments. As many arguments, as many servers of this configuration will be created. The only available authentication method is password. An SSH key can be added only via the input process. diff --git a/docs/srvctl-hosts-ds-add/examples.md b/docs/srvctl-hosts-ds-add/examples.md new file mode 100644 index 0000000..3371ac2 --- /dev/null +++ b/docs/srvctl-hosts-ds-add/examples.md @@ -0,0 +1,98 @@ +#### Create server via input + +An example of a command for a file in the same directory with srvctl: +``` +srvctl hosts ds add --input +``` + +An example of the file's content: +``` +{ + "server_model_id": 10515, + "location_id": 2, + "ram_size": 32, + "uplink_models": { + "public": { + "id": 10198, + "bandwidth_model_id": 13744 + }, + "private": { + "id": 10201 + } + }, + "drives": { + "slots": [ + { + "position": 0, + "drive_model_id": 10306 + }, + { + "position": 1, + "drive_model_id": 10306 + } + ], + "layout": [ + { + "slot_positions": [ + 0, + 1 + ], + "raid": 1, + "partitions": [ + { + "target": "/", + "size": 10240, + "fill": false, + "fs": "ext4" + }, + { + "target": "/boot", + "size": 1024, + "fill": false, + "fs": "ext4" + }, + { + "target": "/home", + "size": 1, + "fill": true, + "fs": "ext4" + } + ] + } + ] + }, + "ipv6": false, + "hosts": [ + { + "hostname": "" + } + ], + "operating_system_id": 62, + "ssh_key_fingerprints": [ + "" + ] +} +``` + +#### Create server via flags + +This is an example of a command to create a dedicated server via flags: +``` +srvctl hosts ds add \ + --location-id 2 \ + --server-model-id 10515 \ + --ram-size 32 \ + --operating-system-id 62 \ + --public-uplink-id 10198 \ + --public-bandwidth-id 13744 \ + --private-uplink-id 10201 \ + --drive-slots 1=10306 \ + --drive-slots 2=10306 \ + --layout=slot=0,slot=1,raid=1 \ + --partition=slot=0,slot=1,target=/,fs=ext4,size=10240,fill=false \ + --partition=slot=0,slot=1,target=/boot,fs=ext4,size=1024,fill=false \ + --partition=slot=0,slot=1,target=/home,fs=ext4,size=1,fill=true \ + --feature no_private_ip \ + --ipv6 \ + +``` diff --git a/docs/srvctl-hosts-ds-delete-network/description.md b/docs/srvctl-hosts-ds-delete-network/description.md new file mode 100644 index 0000000..19b9cff --- /dev/null +++ b/docs/srvctl-hosts-ds-delete-network/description.md @@ -0,0 +1 @@ +This command deletes a specified network for the selected server. diff --git a/docs/srvctl-hosts-ds-delete-network/examples.md b/docs/srvctl-hosts-ds-delete-network/examples.md new file mode 100644 index 0000000..f5062da --- /dev/null +++ b/docs/srvctl-hosts-ds-delete-network/examples.md @@ -0,0 +1,5 @@ +A command that deletes a network for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds delete-network ex4mp1eID_server --network-id ex4mp1eID_network +``` diff --git a/docs/srvctl-hosts-ds-delete-ptr/description.md b/docs/srvctl-hosts-ds-delete-ptr/description.md new file mode 100644 index 0000000..44cc86f --- /dev/null +++ b/docs/srvctl-hosts-ds-delete-ptr/description.md @@ -0,0 +1 @@ +This command deletes a specified PTR record for the selected server. diff --git a/docs/srvctl-hosts-ds-delete-ptr/examples.md b/docs/srvctl-hosts-ds-delete-ptr/examples.md new file mode 100644 index 0000000..7cea1b0 --- /dev/null +++ b/docs/srvctl-hosts-ds-delete-ptr/examples.md @@ -0,0 +1,5 @@ +A command to delete a PTR record for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds delete-ptr ex4mp1eID_server --ptr-id ex4mp1eID_ptr +``` diff --git a/docs/srvctl-hosts-ds-get-network/description.md b/docs/srvctl-hosts-ds-get-network/description.md new file mode 100644 index 0000000..bc05e96 --- /dev/null +++ b/docs/srvctl-hosts-ds-get-network/description.md @@ -0,0 +1 @@ +This command provides information about a specified network of the selected server. diff --git a/docs/srvctl-hosts-ds-get-network/examples.md b/docs/srvctl-hosts-ds-get-network/examples.md new file mode 100644 index 0000000..7742a60 --- /dev/null +++ b/docs/srvctl-hosts-ds-get-network/examples.md @@ -0,0 +1,5 @@ +A command to get information about a network for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds get-network ex4mp1eID_server --network-id ex4mp1eID_network +``` diff --git a/docs/srvctl-hosts-ds-get-oob-credentials/description.md b/docs/srvctl-hosts-ds-get-oob-credentials/description.md new file mode 100644 index 0000000..f4edd13 --- /dev/null +++ b/docs/srvctl-hosts-ds-get-oob-credentials/description.md @@ -0,0 +1 @@ +This command provides OOB credentials for the selected server. A GPG key fingerprint is needed. diff --git a/docs/srvctl-hosts-ds-get-oob-credentials/examples.md b/docs/srvctl-hosts-ds-get-oob-credentials/examples.md new file mode 100644 index 0000000..2be0275 --- /dev/null +++ b/docs/srvctl-hosts-ds-get-oob-credentials/examples.md @@ -0,0 +1,5 @@ +A command to get OOB credentials for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds get-oob-credentials ex4mp1eID --fingerprint GPGKEYEX4MP1E +``` diff --git a/docs/srvctl-hosts-ds-get/description.md b/docs/srvctl-hosts-ds-get/description.md new file mode 100644 index 0000000..328603c --- /dev/null +++ b/docs/srvctl-hosts-ds-get/description.md @@ -0,0 +1 @@ +This command provides information for the selected server. diff --git a/docs/srvctl-hosts-ds-get/examples.md b/docs/srvctl-hosts-ds-get/examples.md new file mode 100644 index 0000000..60fea61 --- /dev/null +++ b/docs/srvctl-hosts-ds-get/examples.md @@ -0,0 +1,4 @@ +A command to get information for the server with the "ex4mp1eID" ID. +``` +srvctl hosts ds get ex4mp1eID +``` diff --git a/docs/srvctl-hosts-ds-list-connections/description.md b/docs/srvctl-hosts-ds-list-connections/description.md new file mode 100644 index 0000000..6ea274d --- /dev/null +++ b/docs/srvctl-hosts-ds-list-connections/description.md @@ -0,0 +1 @@ +This command lists connections for the selected dedicated server. Use `--help` to see available flags. diff --git a/docs/srvctl-hosts-ds-list-connections/examples.md b/docs/srvctl-hosts-ds-list-connections/examples.md new file mode 100644 index 0000000..b73e88c --- /dev/null +++ b/docs/srvctl-hosts-ds-list-connections/examples.md @@ -0,0 +1,5 @@ +A command to list connections for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds list-connections ex4mp1eID +``` diff --git a/docs/srvctl-hosts-ds-list-drive-slots/description.md b/docs/srvctl-hosts-ds-list-drive-slots/description.md new file mode 100644 index 0000000..56f1702 --- /dev/null +++ b/docs/srvctl-hosts-ds-list-drive-slots/description.md @@ -0,0 +1 @@ +This command lists drive slots for the selected dedicated server. Use `--help` to see available flags. diff --git a/docs/srvctl-hosts-ds-list-drive-slots/examples.md b/docs/srvctl-hosts-ds-list-drive-slots/examples.md new file mode 100644 index 0000000..7442c6a --- /dev/null +++ b/docs/srvctl-hosts-ds-list-drive-slots/examples.md @@ -0,0 +1,5 @@ +A command to list drive slots for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds list-drive-slots ex4mp1eID +``` diff --git a/docs/srvctl-hosts-ds-list-features/description.md b/docs/srvctl-hosts-ds-list-features/description.md new file mode 100644 index 0000000..ed0bc1e --- /dev/null +++ b/docs/srvctl-hosts-ds-list-features/description.md @@ -0,0 +1 @@ +This command lists features for the selected dedicated server. Use `--help` to see available flags. diff --git a/docs/srvctl-hosts-ds-list-features/examples.md b/docs/srvctl-hosts-ds-list-features/examples.md new file mode 100644 index 0000000..694327c --- /dev/null +++ b/docs/srvctl-hosts-ds-list-features/examples.md @@ -0,0 +1,5 @@ +A command to list features for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds list-features ex4mp1eID +``` diff --git a/docs/srvctl-hosts-ds-list-networks/description.md b/docs/srvctl-hosts-ds-list-networks/description.md new file mode 100644 index 0000000..c07864c --- /dev/null +++ b/docs/srvctl-hosts-ds-list-networks/description.md @@ -0,0 +1 @@ +This command lists networks for the selected dedicated server. Use `--help` to see available flags. diff --git a/docs/srvctl-hosts-ds-list-networks/examples.md b/docs/srvctl-hosts-ds-list-networks/examples.md new file mode 100644 index 0000000..0285599 --- /dev/null +++ b/docs/srvctl-hosts-ds-list-networks/examples.md @@ -0,0 +1,5 @@ +A command to list networks for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds list-networks ex4mp1eID +``` diff --git a/docs/srvctl-hosts-ds-list-power-feeds/description.md b/docs/srvctl-hosts-ds-list-power-feeds/description.md new file mode 100644 index 0000000..fe30d98 --- /dev/null +++ b/docs/srvctl-hosts-ds-list-power-feeds/description.md @@ -0,0 +1 @@ +This command lists power feeds for the selected dedicated server. diff --git a/docs/srvctl-hosts-ds-list-power-feeds/examples.md b/docs/srvctl-hosts-ds-list-power-feeds/examples.md new file mode 100644 index 0000000..48eb61b --- /dev/null +++ b/docs/srvctl-hosts-ds-list-power-feeds/examples.md @@ -0,0 +1,5 @@ +A command to list power feeds for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds list-power-feeds ex4mp1eID +``` diff --git a/docs/srvctl-hosts-ds-list-ptr/description.md b/docs/srvctl-hosts-ds-list-ptr/description.md new file mode 100644 index 0000000..e707781 --- /dev/null +++ b/docs/srvctl-hosts-ds-list-ptr/description.md @@ -0,0 +1 @@ +This command lists PTR records for the selected dedicated server. Use `--help` to see available flags. diff --git a/docs/srvctl-hosts-ds-list-ptr/examples.md b/docs/srvctl-hosts-ds-list-ptr/examples.md new file mode 100644 index 0000000..53c2ed7 --- /dev/null +++ b/docs/srvctl-hosts-ds-list-ptr/examples.md @@ -0,0 +1,5 @@ +A command to list PTR records for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds list-ptr ex4mp1eID +``` diff --git a/docs/srvctl-hosts-ds-list-services/description.md b/docs/srvctl-hosts-ds-list-services/description.md new file mode 100644 index 0000000..ec32754 --- /dev/null +++ b/docs/srvctl-hosts-ds-list-services/description.md @@ -0,0 +1 @@ +This command lists services for the selected dedicated server. diff --git a/docs/srvctl-hosts-ds-list-services/examples.md b/docs/srvctl-hosts-ds-list-services/examples.md new file mode 100644 index 0000000..317e9e4 --- /dev/null +++ b/docs/srvctl-hosts-ds-list-services/examples.md @@ -0,0 +1,5 @@ +A command to list services for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds list-services ex4mp1eID +``` diff --git a/docs/srvctl-hosts-ds-ls/description.md b/docs/srvctl-hosts-ds-ls/description.md new file mode 100644 index 0000000..9cd0891 --- /dev/null +++ b/docs/srvctl-hosts-ds-ls/description.md @@ -0,0 +1 @@ +This command lists dedicated servers of the account. Use `--help` to see available flags. diff --git a/docs/srvctl-hosts-ds-ls/examples.md b/docs/srvctl-hosts-ds-ls/examples.md new file mode 100644 index 0000000..0b47f14 --- /dev/null +++ b/docs/srvctl-hosts-ds-ls/examples.md @@ -0,0 +1,5 @@ +A command to list all dedicated servers for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds list ex4mp1eID --all +``` diff --git a/docs/srvctl-hosts-ds-power/description.md b/docs/srvctl-hosts-ds-power/description.md new file mode 100644 index 0000000..5ac9dc0 --- /dev/null +++ b/docs/srvctl-hosts-ds-power/description.md @@ -0,0 +1,5 @@ +This command manages power operations for the selected dedicated server. + +- `--command off` - a flag to power off a server. +- `--command on` - a flag to power on a server. +- `--command cycle` - a flag for the power cycle command. diff --git a/docs/srvctl-hosts-ds-power/examples.md b/docs/srvctl-hosts-ds-power/examples.md new file mode 100644 index 0000000..7eae918 --- /dev/null +++ b/docs/srvctl-hosts-ds-power/examples.md @@ -0,0 +1,5 @@ +A command to switch off the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds power ex4mp1eID --command off +``` diff --git a/docs/srvctl-hosts-ds-reinstall/description.md b/docs/srvctl-hosts-ds-reinstall/description.md new file mode 100644 index 0000000..2da8c72 --- /dev/null +++ b/docs/srvctl-hosts-ds-reinstall/description.md @@ -0,0 +1,3 @@ +This command reinstalls an operating system for the selected dedicated server. The `-i`, `--input` allows to provide parameters of a created server in a local file. Parameters should be described as a request body of the [Public API request](https://developers.servers.com/api-documentation/v1/#tag/Dedicated-Server/operation/CreateADedicatedServer). + +There is also an option to use standard input (stdin) when specifying the flag this way: `--input -` diff --git a/docs/srvctl-hosts-ds-reinstall/examples.md b/docs/srvctl-hosts-ds-reinstall/examples.md new file mode 100644 index 0000000..1ba6ef6 --- /dev/null +++ b/docs/srvctl-hosts-ds-reinstall/examples.md @@ -0,0 +1,54 @@ +An example of a command for the server with the "ex4mp1eID" ID to reinstall OS using a file in the same directory with srvctl: + +``` +srvctl hosts ds reinstall ex4mp1eID --input +``` + +An example of the file's content: +``` +{ + "hostname": "", + "drives": { + "slots": [ + { + "position": 0, + "drive_model_id": 10306 + }, + { + "position": 1, + "drive_model_id": 10306 + } + ], + "layout": [ + { + "slot_positions": [ + 0, + 1 + ], + "raid": 1, + "partitions": [ + { + "target": "/", + "size": 10240, + "fill": false, + "fs": "ext4" + }, + { + "target": "/boot", + "size": 1024, + "fill": false, + "fs": "ext4" + }, + { + "target": "/home", + "size": 1, + "fill": true, + "fs": "ext4" + } + ] + } + ] + }, + "operating_system_id": 49 +} +``` diff --git a/docs/srvctl-hosts-ds-schedule-release/description.md b/docs/srvctl-hosts-ds-schedule-release/description.md new file mode 100644 index 0000000..9ad62b7 --- /dev/null +++ b/docs/srvctl-hosts-ds-schedule-release/description.md @@ -0,0 +1 @@ +This command schedules release on YYYY-MM-DDTHH:MM:SS+HH:MM (dateTtime+time zone from UTC) for the selected dedicated server. diff --git a/docs/srvctl-hosts-ds-schedule-release/examples.md b/docs/srvctl-hosts-ds-schedule-release/examples.md new file mode 100644 index 0000000..69f3c33 --- /dev/null +++ b/docs/srvctl-hosts-ds-schedule-release/examples.md @@ -0,0 +1,5 @@ +A command to schedule release for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds schedule-release ex4mp1eID --release-after 2022-05-24T12:48:00+03:00 +``` diff --git a/docs/srvctl-hosts-ds-update/description.md b/docs/srvctl-hosts-ds-update/description.md new file mode 100644 index 0000000..cbbf272 --- /dev/null +++ b/docs/srvctl-hosts-ds-update/description.md @@ -0,0 +1 @@ +This command updates parameters and labels for the selected dedicated server. diff --git a/docs/srvctl-hosts-ds-update/examples.md b/docs/srvctl-hosts-ds-update/examples.md new file mode 100644 index 0000000..ea7fc02 --- /dev/null +++ b/docs/srvctl-hosts-ds-update/examples.md @@ -0,0 +1,5 @@ +A command to assign labels for the server with the "ex4mp1eID" ID. + +``` +srvctl hosts ds update ex4mp1eID --label environment=production --label team=frontend +``` diff --git a/docs/srvctl-hosts-ds/description.md b/docs/srvctl-hosts-ds/description.md new file mode 100644 index 0000000..1eb663d --- /dev/null +++ b/docs/srvctl-hosts-ds/description.md @@ -0,0 +1 @@ +This command allows to manage dedicated servers (Enterprise bare metal). diff --git a/docs/srvctl-hosts-ds/examples.md b/docs/srvctl-hosts-ds/examples.md new file mode 100644 index 0000000..917fcae --- /dev/null +++ b/docs/srvctl-hosts-ds/examples.md @@ -0,0 +1,5 @@ +A command to list all dedicated servers for the account: + +``` +srvctl hosts ds list --all +``` diff --git a/docs/srvctl-hosts/description.md b/docs/srvctl-hosts/description.md new file mode 100644 index 0000000..63a1d2d --- /dev/null +++ b/docs/srvctl-hosts/description.md @@ -0,0 +1 @@ +A host is a bare metal-based service that includes dedicated servers, Kubernetes bare metal nodes and scalable bare metal. It has subcommands for each specific service. diff --git a/docs/srvctl-hosts/examples.md b/docs/srvctl-hosts/examples.md new file mode 100644 index 0000000..efad6f2 --- /dev/null +++ b/docs/srvctl-hosts/examples.md @@ -0,0 +1,4 @@ +A command to list all account hosts showing their ID, Title and Status: +``` +srvctl hosts list -f ID -f Title -f Status --all +``` diff --git a/docs/srvctl/description.md b/docs/srvctl/description.md new file mode 100644 index 0000000..1ad62e6 --- /dev/null +++ b/docs/srvctl/description.md @@ -0,0 +1,31 @@ +srvctl is a Command Line Interface to manage Servers.com services. + +## Getting started + +1) Get a Public API token from the Servers.com [Customer Portal](https://portal.servers.com/iam/api-tokens). + +2) Open terminal and perform commands that are described below. + +3) Log in to the context: + +``` +srvctl login +``` + +There is no context yet; so, this operation will create a context and give it a name that you entered within this command. + +4) Enter your Public API token and confirm. + +The newly created context will be setup as default. + +5) When a context is successfully created, it will be shown by the listing contexts command: + +``` +srvctl context list +``` + +6) Use the help command to explore other possibilities of the agent: + +``` +srvctl help +``` diff --git a/docs/srvctl/examples.md b/docs/srvctl/examples.md new file mode 100644 index 0000000..e79ec31 --- /dev/null +++ b/docs/srvctl/examples.md @@ -0,0 +1,5 @@ +An example of the help command: + +``` +srvctl --help +```