github.com/scaleway/scaleway-cli@v1.11.1/README.md (about) 1 # Scaleway CLI 2 3 Interact with Scaleway API from the command line. 4 5 [](https://travis-ci.org/scaleway/scaleway-cli) 6 [](https://godoc.org/github.com/scaleway/scaleway-cli) 7 [](https://packager.io/gh/scaleway/scaleway-cli/install) 8  9  10 [](https://www.irccloud.com/invite?channel=%23scaleway&hostname=irc.online.net&port=6697&ssl=1) 11 [](https://goreportcard.com/report/github.com/scaleway/scaleway-cli) 12 13  14 15 #### Quick look 16 17  18 19 Read the [blog post](https://blog.scaleway.com/2015/05/20/manage-baremetal-servers-with-scaleway-cli/). 20 21 #### Table of Contents 22 23 1. [Overview](#overview) 24 2. [Setup](#setup) 25 * [Requirements](#requirements) 26 * [Run in Docker](#run-in-docker) 27 3. [Use in Golang](#use-in-golang) 28 4. [Usage](#usage) 29 * [Quick Start](#quick-start) 30 * [Workflows](#workflows) 31 * [Commands](#commands) 32 * [`help [COMMAND]`](#scw-help) 33 * [`attach [OPTIONS] SERVER`](#scw-attach) 34 * [`commit [OPTIONS] SERVER [NAME]`](#scw-commit) 35 * [`cp [OPTIONS] SERVER:PATH|HOSTPATH|- SERVER:PATH|HOSTPATH|-`](#scw-cp) 36 * [`create [OPTIONS] IMAGE`](#scw-create) 37 * [`events [OPTIONS]`](#scw-events) 38 * [`exec [OPTIONS] SERVER [COMMAND] [ARGS...]`](#scw-exec) 39 * [`history [OPTIONS] IMAGE`](#scw-history) 40 * [`images [OPTIONS]`](#scw-images) 41 * [`info [OPTIONS]`](#scw-info) 42 * [`inspect [OPTIONS] IDENTIFIER [IDENTIFIER...]`](#scw-inspect) 43 * [`kill [OPTIONS] SERVER`](#scw-kill) 44 * [`login [OPTIONS]`](#scw-login) 45 * [`logout [OPTIONS]`](#scw-logout) 46 * [`logs [OPTIONS] SERVER`](#scw-logs) 47 * [`port [OPTIONS] SERVER [PRIVATE_PORT[/PROTO]]`](#scw-port) 48 * [`ps [OPTIONS]`](#scw-ps) 49 * [`rename [OPTIONS] SERVER NEW_NAME`](#scw-rename) 50 * [`restart [OPTIONS] SERVER [SERVER...]`](#scw-restart) 51 * [`rm [OPTIONS] SERVER [SERVER...]`](#scw-rm) 52 * [`rmi [OPTIONS] IMAGE [IMAGE...]`](#scw-rmi) 53 * [`run [OPTIONS] IMAGE [COMMAND] [ARGS...]`](#scw-run) 54 * [`search [OPTIONS] TERM`](#scw-search) 55 * [`start [OPTIONS] SERVER [SERVER...]`](#scw-start) 56 * [`stop [OPTIONS] SERVER [SERVER...]`](#scw-stop) 57 * [`tag [OPTIONS] SNAPSHOT NAME`](#scw-tag) 58 * [`top [OPTIONS] SERVER`](#scw-top) 59 * [`version [OPTIONS]`](#scw-version) 60 * [`wait [OPTIONS] SERVER [SERVER...]`](#scw-wait) 61 * [Examples](#examples) 62 5. [Changelog](#changelog) 63 6. [Development](#development) 64 * [Hack](#hack) 65 7. [License](#license) 66 67 ## Overview 68 69 A command-line tool to manage Scaleway servers **à-la-Docker**. 70 71 For node version, check out [scaleway-cli-node](https://github.com/moul/scaleway-cli-node). 72 73 ## Setup 74 75 We recommend to use the latest version, using: 76 77 :warning: Ensure you have a go version `>= 1.5` 78 79 ```shell 80 GO15VENDOREXPERIMENT=1 go get -u github.com/scaleway/scaleway-cli/cmd/scw 81 ``` 82 83 or 84 85 ```shell 86 brew tap scaleway/scaleway 87 brew install scaleway/scaleway/scw --HEAD 88 ``` 89 90 --- 91 92 To install a release, checkout the [latest release page](https://github.com/scaleway/scaleway-cli/releases/latest). 93 94 Install the latest stable release on Mac OS X using [Homebrew](http://brew.sh): 95 96 ```bash 97 brew install scw 98 ``` 99 100 Install the latest stable release on Mac OS X manually: 101 102 ```bash 103 # prepare for first install and upgrade 104 mkdir -p /usr/local/bin 105 mv /usr/local/bin/scw /tmp/scw.old 106 107 # get latest release 108 wget "https://github.com/scaleway/scaleway-cli/releases/download/v1.11.0/scw_1.11.0_darwin_amd64.zip" -O /tmp/scw.zip 109 unzip /tmp/scw.zip \*/scw -d /tmp 110 mv /tmp/scw_*/scw /usr/local/bin 111 rm -rf /tmp/scw.zip /tmp/scw_*_darwin_amd64 112 113 # test 114 scw version 115 ``` 116 117 Install the latest release on Linux: 118 119 ```bash 120 # get latest release 121 export ARCH=amd64 # can be 'i386', 'amd64' or 'armhf' 122 wget "https://github.com/scaleway/scaleway-cli/releases/download/v1.11.0/scw_1.11.0_${ARCH}.deb" -O /tmp/scw.deb 123 dpkg -i /tmp/scw.deb && rm -f /tmp/scw.deb 124 125 # test 126 scw version 127 ``` 128 129 130 ### Requirements 131 132 By using the [static-compiled release binaries](https://github.com/scaleway/scaleway-cli/releases/latest), you only needs to have one of the following platform+architecture : 133 134 Platform | Architecture 135 ------------------|------------------------------------------- 136 Darwin (Mac OS X) | `i386`, `x86_64` 137 FreeBSD | `arm`, `i386`, `x86_64` 138 Linux | `arm`, `armv7`, `armv7`, `i386`, `x86_64` 139 Windows | `x86_64` 140 141 142 ### Run in Docker 143 144 You can run scaleway-cli in a sandboxed way using Docker. 145 146 :warning: caching is disabled 147 148 ```console 149 $ docker run -it --rm --volume=$HOME/.scwrc:/.scwrc scaleway/cli ps 150 ``` 151 152 ### Manual build 153 154 1. [Install go](https://golang.org/doc/install) a version `>= 1.5` 155 2. Ensure you have `$GOPATH` and `$PATH` well configured, something like: 156 * `export GOPATH=$HOME/go` 157 * `export PATH=$PATH:$GOPATH/bin` 158 * `export GO15VENDOREXPERIMENT=1` 159 3. Install the project: `go get github.com/scaleway/scaleway-cli/...` 160 4. Run: `scw` 161 162 ## Use in Golang 163 164 Scaleway-cli is written in Go, the code is splitted across multiple `go-get`able [packages](https://github.com/scaleway/scaleway-cli/tree/master/pkg) 165 166 * [Scaleway API Go client](https://github.com/scaleway/scaleway-cli/tree/master/pkg/api) 167 168 ## Usage 169 170 Usage inspired by [Docker CLI](https://docs.docker.com/engine/reference/commandline/cli/) 171 172 ```console 173 $ scw 174 Usage: scw [OPTIONS] COMMAND [arg...] 175 176 Interact with Scaleway from the command line. 177 178 Options: 179 -h, --help=false Print usage 180 -D, --debug=false Enable debug mode 181 -V, --verbose=false Enable verbose mode 182 -q, --quiet=false Enable quiet mode 183 --sensitive=false Show sensitive data in outputs, i.e. API Token/Organization 184 -v, --version=false Print version information and quit 185 --region=par1 Change the default region (e.g. ams1) 186 187 Commands: 188 help help of the scw command line 189 attach Attach to a server serial console 190 commit Create a new snapshot from a server's volume 191 cp Copy files/folders from a PATH on the server to a HOSTDIR on the host 192 create Create a new server but do not start it 193 events Get real time events from the API 194 exec Run a command on a running server 195 history Show the history of an image 196 images List images 197 info Display system-wide information 198 inspect Return low-level information on a server, image, snapshot, volume or bootscript 199 kill Kill a running server 200 login Log in to Scaleway API 201 logout Log out from the Scaleway API 202 logs Fetch the logs of a server 203 port Lookup the public-facing port that is NAT-ed to PRIVATE_PORT 204 ps List servers 205 rename Rename a server 206 restart Restart a running server 207 rm Remove one or more servers 208 rmi Remove one or more image(s)/volume(s)/snapshot(s) 209 run Run a command in a new server 210 search Search the Scaleway Hub for images 211 start Start a stopped server 212 stop Stop a running server 213 tag Tag a snapshot into an image 214 top Lookup the running processes of a server 215 version Show the version information 216 wait Block until a server stops 217 218 Run 'scw COMMAND --help' for more information on a command. 219 ``` 220 221 ### Quick start 222 223 Login 224 225 ```console 226 $ scw login 227 Login (cloud.scaleway.com): xxxx@xx.xx 228 Password: 229 $ 230 ``` 231 232 Run a new server `my-ubuntu` 233 234 ```console 235 $ scw run --name=my-ubuntu ubuntu-trusty bash 236 [...] wait about a minute for the first boot 237 root@my-ubuntu:~# 238 ``` 239 240 ### Workflows 241 242 See [./examples/](https://github.com/scaleway/scaleway-cli/tree/master/examples) directory 243 244 245 ### Commands 246 247 #### `scw attach` 248 249 ```console 250 Usage: scw attach [OPTIONS] SERVER 251 252 Attach to a running server serial console. 253 254 Options: 255 256 -h, --help=false Print usage 257 --no-stdin=false Do not attach stdin 258 259 Examples: 260 261 $ scw attach my-running-server 262 $ scw attach $(scw start my-stopped-server) 263 $ scw attach $(scw start $(scw create ubuntu-vivid)) 264 ``` 265 266 267 #### `scw commit` 268 269 ```console 270 Usage: scw commit [OPTIONS] SERVER [NAME] 271 272 Create a new snapshot from a server's volume. 273 274 Options: 275 276 -h, --help=false Print usage 277 -v, --volume=0 Volume slot 278 279 Examples: 280 281 $ scw commit my-stopped-server 282 $ scw commit -v 1 my-stopped-server 283 ``` 284 285 286 #### `scw cp` 287 288 ```console 289 Usage: scw cp [OPTIONS] SERVER:PATH|HOSTPATH|- SERVER:PATH|HOSTPATH|- 290 291 Copy files/folders from a PATH on the server to a HOSTDIR on the host 292 running the command. Use '-' to write the data as a tar file to STDOUT. 293 294 Options: 295 296 -g, --gateway="" Use a SSH gateway 297 -h, --help=false Print usage 298 --p, --port=22 Specify SSH port 299 --user=root Specify SSH user 300 301 Examples: 302 303 $ scw cp path/to/my/local/file myserver:path 304 $ scw cp --gateway=myotherserver path/to/my/local/file myserver:path 305 $ scw cp myserver:path/to/file path/to/my/local/dir 306 $ scw cp myserver:path/to/file myserver2:path/to/dir 307 $ scw cp myserver:path/to/file - > myserver-pathtofile-backup.tar 308 $ scw cp myserver:path/to/file - | tar -tvf - 309 $ scw cp path/to/my/local/dir myserver:path 310 $ scw cp myserver:path/to/dir path/to/my/local/dir 311 $ scw cp myserver:path/to/dir myserver2:path/to/dir 312 $ scw cp myserver:path/to/dir - > myserver-pathtodir-backup.tar 313 $ scw cp myserver:path/to/dir - | tar -tvf - 314 $ cat archive.tar | scw cp - myserver:/path 315 $ tar -cvf - . | scw cp - myserver:path 316 ``` 317 318 319 #### `scw create` 320 321 ```console 322 Usage: scw create [OPTIONS] IMAGE 323 324 Create a new server but do not start it. 325 326 Options: 327 328 --bootscript="" Assign a bootscript 329 --commercial-type=VC1S Create a server with specific commercial-type C1, VC1[S|M|L], C2[S|M|L] 330 -e, --env="" Provide metadata tags passed to initrd (i.e., boot=rescue INITRD_DEBUG=1) 331 -h, --help=false Print usage 332 --ip-address=dynamic Assign a reserved public IP, a 'dynamic' one or 'none' 333 --name="" Assign a name 334 --tmp-ssh-key=false Access your server without uploading your SSH key to your account 335 -v, --volume="" Attach additional volume (i.e., 50G) 336 337 Examples: 338 339 $ scw create docker 340 $ scw create 10GB 341 $ scw create --bootscript=3.2.34 --env="boot=live rescue_image=http://j.mp/scaleway-ubuntu-trusty-tarball" 50GB 342 $ scw inspect $(scw create 1GB --bootscript=rescue --volume=50GB) 343 $ scw create $(scw tag my-snapshot my-image) 344 $ scw create --tmp-ssh-key 10GB 345 ``` 346 347 348 #### `scw events` 349 350 ```console 351 Usage: scw events [OPTIONS] 352 353 Get real time events from the API. 354 355 Options: 356 357 -h, --help=false Print usage 358 ``` 359 360 361 #### `scw exec` 362 363 ```console 364 Usage: scw exec [OPTIONS] SERVER [COMMAND] [ARGS...] 365 366 Run a command on a running server. 367 368 Options: 369 370 -g, --gateway="" Use a SSH gateway 371 -h, --help=false Print usage 372 --p, --port=22 Specify SSH port 373 -T, --timeout=0 Set timeout values to seconds 374 --user=root Specify SSH user 375 -w, --wait=false Wait for SSH to be ready 376 377 Examples: 378 379 $ scw exec myserver 380 $ scw exec myserver bash 381 $ scw exec --gateway=myotherserver myserver bash 382 $ scw exec myserver 'tmux a -t joe || tmux new -s joe || bash' 383 $ SCW_SECURE_EXEC=1 scw exec myserver bash 384 $ scw exec -w $(scw start $(scw create ubuntu-trusty)) bash 385 $ scw exec $(scw start -w $(scw create ubuntu-trusty)) bash 386 $ scw exec myserver tmux new -d sleep 10 387 $ scw exec myserver ls -la | grep password 388 $ cat local-file | scw exec myserver 'cat > remote/path' 389 ``` 390 391 392 #### `scw help` 393 394 ```console 395 Usage: scw help [COMMAND] 396 397 398 Help prints help information about scw and its commands. 399 400 By default, help lists available commands with a short description. 401 When invoked with a command name, it prints the usage and the help of 402 the command. 403 404 405 Options: 406 407 -h, --help=false Print usage 408 ``` 409 410 411 #### `scw history` 412 413 ```console 414 Usage: scw history [OPTIONS] IMAGE 415 416 Show the history of an image. 417 418 Options: 419 420 --arch=* Specify architecture 421 -h, --help=false Print usage 422 --no-trunc=false Don't truncate output 423 -q, --quiet=false Only show numeric IDs 424 ``` 425 426 427 #### `scw images` 428 429 ```console 430 Usage: scw images [OPTIONS] 431 432 List images. 433 434 Options: 435 436 -a, --all=false Show all images 437 -f, --filter="" Filter output based on conditions provided 438 -h, --help=false Print usage 439 --no-trunc=false Don't truncate output 440 -q, --quiet=false Only show numeric IDs 441 442 Examples: 443 444 $ scw images 445 $ scw images -a 446 $ scw images -q 447 $ scw images --no-trunc 448 $ scw images -f organization=me 449 $ scw images -f organization=official-distribs 450 $ scw images -f organization=official-apps 451 $ scw images -f organization=UUIDOFORGANIZATION 452 $ scw images -f name=ubuntu 453 $ scw images -f type=image 454 $ scw images -f type=bootscript 455 $ scw images -f type=snapshot 456 $ scw images -f type=volume 457 $ scw images -f public=true 458 $ scw images -f public=false 459 $ scw images -f "organization=me type=volume" -qsc 460 ``` 461 462 463 #### `scw info` 464 465 ```console 466 Usage: scw info [OPTIONS] 467 468 Display system-wide information. 469 470 Options: 471 472 -h, --help=false Print usage 473 ``` 474 475 476 #### `scw inspect` 477 478 ```console 479 Usage: scw inspect [OPTIONS] IDENTIFIER [IDENTIFIER...] 480 481 Return low-level information on a server, image, snapshot, volume or bootscript. 482 483 Options: 484 485 --arch=* Specify architecture 486 -b, --browser=false Inspect object in browser 487 -f, --format="" Format the output using the given go template 488 -h, --help=false Print usage 489 490 Examples: 491 492 $ scw inspect my-server 493 $ scw inspect server:my-server 494 $ scw inspect --browser my-server 495 $ scw inspect a-public-image 496 $ scw inspect image:a-public-image 497 $ scw inspect my-snapshot 498 $ scw inspect snapshot:my-snapshot 499 $ scw inspect my-volume 500 $ scw inspect volume:my-volume 501 $ scw inspect my-image 502 $ scw inspect image:my-image 503 $ scw inspect my-server | jq '.[0].public_ip.address' 504 $ scw inspect $(scw inspect my-image | jq '.[0].root_volume.id') 505 $ scw inspect -f "{{ .PublicAddress.IP }}" my-server 506 $ scw --sensitive inspect my-server 507 ``` 508 509 510 #### `scw kill` 511 512 ```console 513 Usage: scw kill [OPTIONS] SERVER 514 515 Kill a running server. 516 517 Options: 518 519 -g, --gateway="" Use a SSH gateway 520 -h, --help=false Print usage 521 ``` 522 523 524 #### `scw login` 525 526 ```console 527 Usage: scw login [OPTIONS] 528 529 Generates a configuration file in '/home/$USER/.scwrc' 530 containing credentials used to interact with the Scaleway API. This 531 configuration file is automatically used by the 'scw' commands. 532 533 You can get your credentials on https://cloud.scaleway.com/#/credentials 534 535 536 Options: 537 538 -h, --help=false Print usage 539 -o, --organization="" Organization 540 -s, --skip-ssh-key=false Don't ask to upload an SSH Key 541 -t, --token="" Token 542 ``` 543 544 545 #### `scw logout` 546 547 ```console 548 Usage: scw logout [OPTIONS] 549 550 Log out from the Scaleway API. 551 552 Options: 553 554 -h, --help=false Print usage 555 ``` 556 557 558 #### `scw logs` 559 560 ```console 561 Usage: scw logs [OPTIONS] SERVER 562 563 Fetch the logs of a server. 564 565 Options: 566 567 -g, --gateway="" Use a SSH gateway 568 -h, --help=false Print usage 569 --p, --port=22 Specify SSH port 570 --user=root Specify SSH user 571 ``` 572 573 574 #### `scw port` 575 576 ```console 577 Usage: scw port [OPTIONS] SERVER [PRIVATE_PORT[/PROTO]] 578 579 List port mappings for the SERVER, or lookup the public-facing port that is NAT-ed to the PRIVATE_PORT 580 581 Options: 582 583 -g, --gateway="" Use a SSH gateway 584 -h, --help=false Print usage 585 --p, --port=22 Specify SSH port 586 --user=root Specify SSH user 587 ``` 588 589 590 #### `scw ps` 591 592 ```console 593 Usage: scw ps [OPTIONS] 594 595 List servers. By default, only running servers are displayed. 596 597 Options: 598 599 -a, --all=false Show all servers. Only running servers are shown by default 600 -f, --filter="" Filter output based on conditions provided 601 -h, --help=false Print usage 602 -l, --latest=false Show only the latest created server, include non-running ones 603 -n=0 Show n last created servers, include non-running ones 604 --no-trunc=false Don't truncate output 605 -q, --quiet=false Only display numeric IDs 606 607 Examples: 608 609 $ scw ps 610 $ scw ps -a 611 $ scw ps -l 612 $ scw ps -n=10 613 $ scw ps -q 614 $ scw ps --no-trunc 615 $ scw ps -f state=booted 616 $ scw ps -f state=running 617 $ scw ps -f state=stopped 618 $ scw ps -f ip=212.47.229.26 619 $ scw ps -f tags=prod 620 $ scw ps -f tags=boot=live 621 $ scw ps -f image=docker 622 $ scw ps -f image=alpine 623 $ scw ps -f image=UUIDOFIMAGE 624 $ scw ps -f arch=ARCH 625 $ scw ps -f server-type=COMMERCIALTYPE 626 $ scw ps -f "state=booted image=docker tags=prod" 627 ``` 628 629 630 #### `scw rename` 631 632 ```console 633 Usage: scw rename [OPTIONS] SERVER NEW_NAME 634 635 Rename a server. 636 637 Options: 638 639 -h, --help=false Print usage 640 ``` 641 642 643 #### `scw restart` 644 645 ```console 646 Usage: scw restart [OPTIONS] SERVER [SERVER...] 647 648 Restart a running server. 649 650 Options: 651 652 -h, --help=false Print usage 653 -T, --timeout=0 Set timeout values to seconds 654 -w, --wait=false Synchronous restart. Wait for SSH to be ready 655 ``` 656 657 658 #### `scw rm` 659 660 ```console 661 Usage: scw rm [OPTIONS] SERVER [SERVER...] 662 663 Remove one or more servers. 664 665 Options: 666 667 -f, --force=false Force the removal of a server 668 -h, --help=false Print usage 669 670 Examples: 671 672 $ scw rm myserver 673 $ scw rm -f myserver 674 $ scw rm my-stopped-server my-second-stopped-server 675 $ scw rm $(scw ps -q) 676 $ scw rm $(scw ps | grep mysql | awk '{print $1}') 677 ``` 678 679 680 #### `scw rmi` 681 682 ```console 683 Usage: scw rmi [OPTIONS] IDENTIFIER [IDENTIFIER...] 684 685 Remove one or more image(s)/volume(s)/snapshot(s) 686 687 Options: 688 689 -h, --help=false Print usage 690 691 Examples: 692 693 $ scw rmi myimage 694 $ scw rmi mysnapshot 695 $ scw rmi myvolume 696 $ scw rmi $(scw images -q) 697 ``` 698 699 700 #### `scw run` 701 702 ```console 703 Usage: scw run [OPTIONS] IMAGE [COMMAND] [ARG...] 704 705 Run a command in a new server. 706 707 Options: 708 709 -a, --attach=false Attach to serial console 710 --bootscript="" Assign a bootscript 711 --commercial-type=VC1S Start a server with specific commercial-type C1, VC1[S|M|L], C2[S|M|L] 712 -d, --detach=false Run server in background and print server ID 713 -e, --env="" Provide metadata tags passed to initrd (i.e., boot=rescue INITRD_DEBUG=1) 714 -g, --gateway="" Use a SSH gateway 715 -h, --help=false Print usage 716 --ip-address="" Assign a reserved public IP, a 'dynamic' one or 'none' (default to 'none' if gateway specified, 'dynamic' otherwise) 717 --ipv6=false Enable IPV6 718 --name="" Assign a name 719 --p, --port=22 Specify SSH port 720 --rm=false Automatically remove the server when it exits 721 --show-boot=false Allows to show the boot 722 -T, --timeout=0 Set timeout value to seconds 723 --tmp-ssh-key=false Access your server without uploading your SSH key to your account 724 -u, --userdata="" Start a server with userdata predefined 725 --user=root Specify SSH User 726 -v, --volume="" Attach additional volume (i.e., 50G) 727 728 Examples: 729 730 $ scw run ubuntu-trusty 731 $ scw run --commercial-type=C2S ubuntu-trusty 732 $ scw run --show-boot --commercial-type=C2S ubuntu-trusty 733 $ scw run --rm ubuntu-trusty 734 $ scw run -a --rm ubuntu-trusty 735 $ scw run --gateway=myotherserver ubuntu-trusty 736 $ scw run ubuntu-trusty bash 737 $ scw run --name=mydocker docker docker run moul/nyancat:armhf 738 $ scw run --bootscript=3.2.34 --env="boot=live rescue_image=http://j.mp/scaleway-ubuntu-trusty-tarball" 50GB bash 739 $ scw run --attach alpine 740 $ scw run --detach alpine 741 $ scw run --tmp-ssh-key alpine 742 $ scw run --userdata="FOO=BAR FILE=@/tmp/file" alpine 743 ``` 744 745 --- 746 747 ``` 748 ┌ ─ ─ ─ ─ ─ scw run docker ─ ─ ─ ─ ┐ 749 750 │ ┌───────────────────────────┐ │ 751 │server=$(scw create docker)│ 752 │ └───────────────────────────┘ │ 753 + 754 │ ┌─────────────────┐ │ 755 │scw start $SERVER│ 756 │ └─────────────────┘ │ 757 + 758 │┌─────────────────────────────────┐│ 759 │scw exec --wait $SERVER /bin/bash│ 760 │└─────────────────────────────────┘│ 761 ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ 762 ``` 763 764 #### `scw search` 765 766 ```console 767 Usage: scw search [OPTIONS] TERM 768 769 Search the Scaleway Hub for images. 770 771 Options: 772 773 -h, --help=false Print usage 774 --no-trunc=false Don't truncate output 775 ``` 776 777 778 #### `scw start` 779 780 ```console 781 Usage: scw start [OPTIONS] SERVER [SERVER...] 782 783 Start a stopped server. 784 785 Options: 786 787 -h, --help=false Print usage 788 -T, --timeout=0 Set timeout values to seconds 789 -w, --wait=false Synchronous start. Wait for SSH to be ready 790 ``` 791 792 793 #### `scw stop` 794 795 ```console 796 ➜ scaleway-cli git:(master) ✗ clear; scw help stop 797 Usage: scw stop [OPTIONS] SERVER [SERVER...] 798 799 Stop a running server. 800 801 Options: 802 803 -h, --help=false Print usage 804 -t, --terminate=false Stop and trash a server with its volumes 805 -w, --wait=false Synchronous stop. Wait for SSH to be ready 806 807 Examples: 808 809 $ scw stop my-running-server my-second-running-server 810 $ scw stop -t my-running-server my-second-running-server 811 $ scw stop $(scw ps -q) 812 $ scw stop $(scw ps | grep mysql | awk '{print $1}') 813 $ scw stop server && stop wait server 814 $ scw stop -w server 815 ``` 816 817 818 #### `scw tag` 819 820 ```console 821 Usage: scw tag [OPTIONS] SNAPSHOT NAME 822 823 Tag a snapshot into an image. 824 825 Options: 826 827 -h, --help=false Print usage 828 --bootscript="" Assign a bootscript 829 ``` 830 831 832 #### `scw top` 833 834 ```console 835 Usage: scw top [OPTIONS] SERVER 836 837 Lookup the running processes of a server. 838 839 Options: 840 841 -g, --gateway="" Use a SSH gateway 842 -h, --help=false Print usage 843 --p, --port=22 Specify SSH port 844 --user=root Specify SSH user 845 ``` 846 847 848 #### `scw version` 849 850 ```console 851 Usage: scw version [OPTIONS] 852 853 Show the version information. 854 855 Options: 856 857 -h, --help=false Print usage 858 ``` 859 860 861 #### `scw wait` 862 863 ```console 864 ➜ scaleway-cli git:(master) ✗ clear; scw help wait 865 Usage: scw wait [OPTIONS] SERVER [SERVER...] 866 867 Block until a server stops. 868 869 Options: 870 871 -h, --help=false Print usage 872 ``` 873 874 875 --- 876 877 ### Examples 878 879 Create a server with Ubuntu Trusty image and 3.2.34 bootscript 880 881 ```console 882 $ scw create --bootscript=3.2.34 trusty 883 df271f73-60ce-47fd-bd7b-37b5f698d8b2 884 ``` 885 886 887 Create a server with Fedora 21 image 888 889 ```console 890 $ scw create 1f164079 891 7313af22-62bf-4df1-9dc2-c4ffb4cb2d83 892 ``` 893 894 895 Create a server with an empty disc of 20G and rescue bootscript 896 897 ```console 898 $ scw create --bootscript=rescue 20G 899 5cf8058e-a0df-4fc3-a772-8d44e6daf582 900 ``` 901 902 903 Run a stopped server 904 905 ```console 906 $ scw start 7313af22 907 7313af22-62bf-4df1-9dc2-c4ffb4cb2d83 908 ``` 909 910 911 Run a stopped server and wait for SSH to be ready 912 913 ```console 914 $ scw start --wait myserver 915 myserver 916 $ scw exec myserver /bin/bash 917 [root@noname ~]# 918 ``` 919 920 Run a stopped server and wait for SSH to be ready (inline version) 921 922 ```console 923 $ scw exec $(scw start --wait myserver) /bin/bash 924 [root@noname ~]# 925 ``` 926 927 928 Create, start and ssh to a new server (inline version) 929 930 ```console 931 $ scw exec $(scw start --wait $(scw create ubuntu-trusty)) /bin/bash 932 [root@noname ~]# 933 ``` 934 935 or 936 937 ```console 938 $ scw exec --wait $(scw start $(scw create ubuntu-trusty)) /bin/bash 939 [root@noname ~]# 940 ``` 941 942 943 Wait for a server to be available, then execute a command 944 945 ```console 946 $ scw exec --wait myserver /bin/bash 947 [root@noname ~]# 948 ``` 949 950 Run a command in background 951 952 ```console 953 $ scw exec alpine tmux new -d "sleep 10" 954 ``` 955 956 Run a stopped server and wait for SSH to be ready with a global timeout of 150 seconds 957 958 ```console 959 $ scw start --wait --timeout=150 myserver 960 global execution... failed: Operation timed out. 961 ``` 962 963 964 Wait for a server to be in 'stopped' state 965 966 ```console 967 $ scw wait 7313af22 968 [...] some seconds later 969 0 970 ``` 971 972 973 Attach to server serial port 974 975 ```console 976 $ scw attach 7313af22 977 [RET] 978 Ubuntu Vivid Vervet (development branch) nfs-server ttyS0 979 my-server login: 980 ^C 981 $ 982 ``` 983 984 985 Create a server with Fedora 21 image and start it 986 987 ```console 988 $ scw start `scw create 1f164079` 989 5cf8058e-a0df-4fc3-a772-8d44e6daf582 990 ``` 991 992 993 Execute a 'ls -la' on a server (via SSH) 994 995 ```console 996 $ scw exec myserver ls -la 997 total 40 998 drwx------. 4 root root 4096 Mar 26 05:56 . 999 drwxr-xr-x. 18 root root 4096 Mar 26 05:56 .. 1000 -rw-r--r--. 1 root root 18 Jun 8 2014 .bash_logout 1001 -rw-r--r--. 1 root root 176 Jun 8 2014 .bash_profile 1002 -rw-r--r--. 1 root root 176 Jun 8 2014 .bashrc 1003 -rw-r--r--. 1 root root 100 Jun 8 2014 .cshrc 1004 drwxr-----. 3 root root 4096 Mar 16 06:31 .pki 1005 -rw-rw-r--. 1 root root 1240 Mar 12 08:16 .s3cfg.sample 1006 drwx------. 2 root root 4096 Mar 26 05:56 .ssh 1007 -rw-r--r--. 1 root root 129 Jun 8 2014 .tcshrc 1008 ``` 1009 1010 1011 Run a shell on a server (via SSH) 1012 1013 ```console 1014 $ scw exec 5cf8058e /bin/bash 1015 [root@noname ~]# 1016 ``` 1017 1018 1019 List public images and my images 1020 1021 ```console 1022 $ scw images 1023 REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE 1024 user/Alpine_Linux_3_1 latest 854eef72 10 days ago 50 GB 1025 Debian_Wheezy_7_8 latest cd66fa55 2 months ago 20 GB 1026 Ubuntu_Utopic_14_10 latest 1a702a4e 4 months ago 20 GB 1027 ... 1028 ``` 1029 1030 1031 List public images, my images and my snapshots 1032 1033 ```console 1034 $ scw images -a 1035 REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE 1036 noname-snapshot <none> 54df92d1 a minute ago 50 GB 1037 cool-snapshot <none> 0dbbc64c 11 hours ago 20 GB 1038 user/Alpine_Linux_3_1 latest 854eef72 10 days ago 50 GB 1039 Debian_Wheezy_7_8 latest cd66fa55 2 months ago 20 GB 1040 Ubuntu_Utopic_14_10 latest 1a702a4e 4 months ago 20 GB 1041 ``` 1042 1043 1044 List running servers 1045 1046 ```console 1047 $ scw ps 1048 SERVER ID IMAGE COMMAND CREATED STATUS PORTS NAME 1049 7313af22 user/Alpine_Linux_3_1 13 minutes ago running noname 1050 32070fa4 Ubuntu_Utopic_14_10 36 minutes ago running labs-8fe556 1051 ``` 1052 1053 1054 List all servers 1055 1056 ```console 1057 $ scw ps -a 1058 SERVER ID IMAGE COMMAND CREATED STATUS PORTS NAME 1059 7313af22 user/Alpine_Linux_3_1 13 minutes ago running noname 1060 32070fa4 Ubuntu_Utopic_14_10 36 minutes ago running labs-8fe556 1061 7fc76a15 Ubuntu_Utopic_14_10 11 hours ago stopped backup 1062 ``` 1063 1064 1065 Stop a running server 1066 1067 ```console 1068 $ scw stop 5cf8058e 1069 5cf8058e 1070 ``` 1071 1072 1073 Stop multiple running servers 1074 1075 ```console 1076 $ scw stop myserver myotherserver 1077 901d082d-9155-4046-a49d-94355344246b 1078 a0320ec6-141f-4e99-bf33-9e1a9de34171 1079 ``` 1080 1081 1082 Terminate a running server 1083 1084 ```console 1085 $ scw stop -t myserver 1086 901d082d-9155-4046-a49d-94355344246b 1087 ``` 1088 1089 1090 Stop all running servers matching 'mysql' 1091 1092 ```console 1093 $ scw stop $(scw ps | grep mysql | awk '{print $1}') 1094 901d082d-9155-4046-a49d-94355344246b 1095 a0320ec6-141f-4e99-bf33-9e1a9de34171 1096 36756e6e-3146-4b89-8248-abb060fc5b61 1097 ``` 1098 1099 1100 Create a snapshot of the root volume of a server 1101 1102 ```console 1103 $ scw commit 5cf8058e 1104 54df92d1 1105 ``` 1106 1107 1108 Delete a stopped server 1109 1110 ```console 1111 $ scw rm 5cf8 1112 5cf8082d-9155-4046-a49d-94355344246b 1113 ``` 1114 1115 1116 Delete multiple stopped servers 1117 1118 ```console 1119 $ scw rm myserver myotherserver 1120 901d082d-9155-4046-a49d-94355344246b 1121 a0320ec6-141f-4e99-bf33-9e1a9de34171 1122 ``` 1123 1124 1125 Delete all stopped servers matching 'mysql' 1126 1127 ```console 1128 $ scw rm $(scw ps -a | grep mysql | awk '{print $1}') 1129 901d082d-9155-4046-a49d-94355344246b 1130 a0320ec6-141f-4e99-bf33-9e1a9de34171 1131 36756e6e-3146-4b89-8248-abb060fc5b61 1132 ``` 1133 1134 1135 Create a snapshot of nbd1 1136 1137 ```console 1138 $ scw commit 5cf8058e -v 1 1139 f1851f99 1140 ``` 1141 1142 1143 Create an image based on a snapshot 1144 1145 ```console 1146 $ scw tag 87f4526b my_image 1147 46689419 1148 ``` 1149 1150 1151 Delete an image 1152 1153 ```console 1154 $ scw rmi 46689419 1155 ``` 1156 1157 1158 Send a 'halt' command via SSH 1159 1160 ```console 1161 $ scw kill 5cf8058e 1162 5cf8058e 1163 ``` 1164 1165 1166 Inspect a server 1167 1168 ```console 1169 $ scw inspect 90074de6 1170 [ 1171 { 1172 "server": { 1173 "dynamic_ip_required": true, 1174 "name": "My server", 1175 "modification_date": "2015-03-26T09:01:07.691774+00:00", 1176 "tags": [ 1177 "web", 1178 "production" 1179 ], 1180 "state_detail": "booted", 1181 "public_ip": { 1182 "dynamic": true, 1183 "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 1184 "address": "212.47.xxx.yyy" 1185 }, 1186 "state": "running", 1187 } 1188 ] 1189 ``` 1190 1191 1192 Show public ip address of a server 1193 1194 ```console 1195 $ scw inspect myserver | jq '.[0].public_ip.address' 1196 212.47.xxx.yyy 1197 ``` 1198 1199 1200 --- 1201 1202 ## Changelog 1203 1204 ### v1.11.1 (2016-11-17) 1205 1206 * API: try to connect trough the gateway when nc doesn't work 1207 * API: hotfix region with user images 1208 * API: fix filter on paginate page 1209 1210 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.11...v1.11.1) 1211 1212 ### v1.11 (2016-10-27) 1213 1214 * new Compute URL `api.scaleway.com` -> `cp-par1.scaleway.com` 1215 * new TTY URL `tty.scaleway.com/v2` -> `tty-par1.scaleway.com/v2` 1216 * Region: add `ams1`, you can start a server at Amsterdam with `scw --region="ams1" run yakkety` 1217 * API: Support multi-zone 1218 * API: Add ZoneID field in server location 1219 * `scw image -a -f type=volume` fix unmarshal error on size field 1220 * `scw ps` do not display empty server with --filter 1221 1222 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.10.1...v1.11) 1223 1224 ### v1.10.1 (2016-10-24) 1225 1226 * `scw login` fix CheckCredentials ([418](https://github.com/scaleway/scaleway-cli/issues/418)) 1227 1228 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.10...v1.10.1) 1229 1230 ### v1.10 (2016-10-24) 1231 1232 * API rename `deleteServerSafe` -> `deleteServerForce` 1233 * API support paginate 1234 * API more verbose with `-V` 1235 * Better handling of secondary volumes size ([361](https://github.com/scaleway/scaleway-cli/issues/361)) 1236 * Add a global flag, `--region` to change the defaut region 1237 * `scw exec --gateway` remove hardcoded 30 seconds sleep ([#254](https://github.com/scaleway/scaleway-cli/issues/254)) 1238 * `ScalewayServer` add DNS fields ([#157](https://github.com/scaleway/scaleway-cli/issues/157)) 1239 * `scw [logs|exec|cp|port|run|top]` add `--user` && `--port` ([#396](https://github.com/scaleway/scaleway-cli/issues/396)) 1240 * `scw ps` sort the servers by CreationDate ([#391](https://github.com/scaleway/scaleway-cli/issues/391)) 1241 * Fix regression on bootscript ([#387](https://github.com/scaleway/scaleway-cli/issues/387)) 1242 * `scw [run|start]` Add `--set-state` flag 1243 * `scw login` Add motd when you are already logged ([#371](https://github.com/scaleway/scaleway-cli/issues/371)) 1244 * `scw _ips` add --detach flag 1245 * API add DetachIP method ([@nicolai86](https://github.com/scaleway/scaleway-cli/pull/378)) 1246 * Cache remove log dependency 1247 * Fix error message with `--commercial-type=c2m` ([#374](https://github.com/scaleway/scaleway-cli/issues/374)) 1248 * Add Logger Interface to avoid multiples dependencies in the API, thank you [@nicolai86](https://github.com/nicolai86) ([#369](https://github.com/scaleway/scaleway-cli/pull/369)) 1249 * `scw run` handle `--ipv6` flag 1250 * `scw create` handle `--ipv6` flag 1251 * Fix panic when the commercial-type is lower than 2 characters ([#365](https://github.com/scaleway/scaleway-cli/issues/365)) 1252 * gotty-client enable ProxyFromEnviromnent ([#363](https://github.com/scaleway/scaleway-cli/pull/363)) ([@debovema](https://github.com/debovema)) 1253 * `scw inspect` fix panic ([#353](https://github.com/scaleway/scaleway-cli/issues/353)) 1254 * Clear cache between the releases ([#329](https://github.com/scaleway/scaleway-cli/issues/329)) 1255 * Fix `scw _patch bootscript` nil dereference 1256 * Fix `scw images` bad error message ([#336](https://github.com/scaleway/scaleway-cli/issues/337)) 1257 * Fix sshExecCommand with Windows ([#338](https://github.com/scaleway/scaleway-cli/issues/338)) 1258 * Fix `scw login` with Windows ([#341](https://github.com/scaleway/scaleway-cli/issues/341)) 1259 * Add `enable_ipv6` field ([#334](https://github.com/scaleway/scaleway-cli/issues/334)) 1260 * `scw _patch` handles ipv6=[true|false] 1261 * Add `ScalewayIPV6Definition` 1262 * Add marketplace alias in the cache to resolve image ([#330](https://github.com/scaleway/scaleway-cli/issues/330)) 1263 * `scw _userdata` handles `@~/path/to/file` ([#321](https://github.com/scaleway/scaleway-cli/issues/321)) 1264 * Update `scw _billing` for new instance types ([#293](https://github.com/scaleway/scaleway-cli/issues/293)) 1265 1266 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.9.0...v1.10) 1267 1268 ### v1.9.0 (2016-04-01) 1269 1270 * Fix bug when using SCW_COMMERCIAL_TYPE variable 1271 * Switch to VC1S 1272 1273 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.8.1...v1.9.0) 1274 1275 ### v1.8.1 (2016-03-29) 1276 1277 * Fix `ScalewayBootscript` structure 1278 * `scw _userdata` fix bug when we have multiple '=' in the value ([#320](https://github.com/scaleway/scaleway-cli/issues/320)) 1279 * GetBootscriptID doesn't try to resolve when we pass an UUID 1280 * Add location fields for VPS 1281 * `scw ps` add commercial-type column 1282 * Use `SCW_SECURE_EXEC` instead of `exec_exec` 1283 * Remove `scaleway_api_endpoint` environment variable 1284 * brew remove cache after install 1285 * `scw login` don't ask to upload ssh key when there is no keys 1286 1287 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.8.0...v1.8.1) 1288 1289 ### v1.8.0 (2016-03-17) 1290 1291 * Use VC1 by default 1292 * `scw exec` Add warning to try to clean the cache when an error occurred 1293 * Add `SCW_[COMPUTE|ACCOUNT|METADATA|MARKETPLACE]_API` environment variable 1294 * Remove --api-endpoint 1295 * Fix uploading SSH key with `scw login` 1296 * Use markerplace API in GetImages() 1297 * Add `_markerplace` 1298 * `scw rename` fix nil dereference ([#289](https://github.com/scaleway/scaleway-cli/issues/289)) 1299 * Support of `scw [run|create] --ip-address=[none|dynamic]` ([#283](https://github.com/scaleway/scaleway-cli/pull/283)) ([@ElNounch](https://github.com/ElNounch)) 1300 * Support of `scw ps -f server-type=COMMERCIALTYPE` ([#280](https://github.com/scaleway/scaleway-cli/issues/280)) 1301 * Support of `scw ps -f arch=XXX` ([#278](https://github.com/scaleway/scaleway-cli/issues/278)) 1302 * `scw info` Use json fingerprint field exposed by API 1303 * Allow to override Region and Architecture when using the helpers to create a new volume from a human size 1304 * Do not check permissions on config file under Windows ([#282](https://github.com/scaleway/scaleway-cli/pull/282)) ([@ElNounch](https://github.com/ElNounch)) 1305 * Update pricing ([#294](https://github.com/scaleway/scaleway-cli/issues/294)) 1306 * create-image-from-http.sh: using VPS instead of C1 ([#301](https://github.com/scaleway/scaleway-cli/issues/301)) 1307 1308 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.7.1...v1.8.0) 1309 1310 ### v1.7.1 (2016-01-29) 1311 1312 * Configure User-Agent ([#269](https://github.com/scaleway/scaleway-cli/issues/269)) 1313 * Daily check for new scw version ([#268](https://github.com/scaleway/scaleway-cli/issues/268)) 1314 1315 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.7.0...v1.7.1) 1316 1317 ### v1.7.0 (2016-01-27) 1318 1319 * SCALEWAY_VERBOSE_API is now SCW_VERBOSE_API 1320 * SCALEWAY_TLSVERIFY is now SCW_TLSVERIFY 1321 * Add a warn message when using `ssh exec` on host without public ip nor gateway ([#171](https://github.com/scaleway/scaleway-cli/issues/171)) 1322 * Display `ssh-host-fingerprints` when it's available ([#194](https://github.com/scaleway/scaleway-cli/issues/194)) 1323 * Support of `scw rmi` snapshot|volume ([#258](https://github.com/scaleway/scaleway-cli/issues/258)) 1324 * Match bootscript/image with the good architecture ([#255](https://github.com/scaleway/scaleway-cli/issues/255)) 1325 * Support of region/owner/arch in the cache file ([#255](https://github.com/scaleway/scaleway-cli/issues/255)) 1326 * Remove some `fatal` and `Exit` 1327 * Use rfc4716 (openSSH) to generate the fingerprints ([#151](https://github.com/scaleway/scaleway-cli/issues/151)) 1328 * Switch from `Party` to `Godep` 1329 * create-image-from-http.sh: Support HTTP proxy ([#249](https://github.com/scaleway/scaleway-cli/issues/249)) 1330 * Support of `scw run --userdata=...` ([#202](https://github.com/scaleway/scaleway-cli/issues/202)) 1331 * Refactor of `scw _security-groups` ([#197](https://github.com/scaleway/scaleway-cli/issues/197)) 1332 * Support of `scw tag --arch=XXX` 1333 * Support of `scw run --timeout=X` ([#239](https://github.com/scaleway/scaleway-cli/issues/239)) 1334 * Check the "stopped" state for `scw run | exec -w`([#229](https://github.com/scaleway/scaleway-cli/issues/229)) 1335 * Basic support of Server.CommercialType 1336 * Support of `SCW_GOTTY_URL` environment variable 1337 1338 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.6.0...v1.7.0) 1339 1340 ### v1.6.0 (2015-11-18) 1341 1342 * Support of `scw create|run --ip-address` ([#235](https://github.com/scaleway/scaleway-cli/issues/235)) 1343 * Update gotty-client to 1.3.0 1344 * Support of `scw run --show-boot` option ([#156](https://github.com/scaleway/scaleway-cli/issues/156)) 1345 * Remove go1.[34] support 1346 * Improve _cs format ([#223](https://github.com/scaleway/scaleway-cli/issues/223)) 1347 * Use `gotty-client` instead of `termjs-cli` 1348 * Fix: bad detection of server already started when starting a server ([#224](https://github.com/scaleway/scaleway-cli/pull/224)) - [@arianvp](https://github.com/arianvp) 1349 * Added _cs ([#180](https://github.com/scaleway/scaleway-cli/issues/180)) 1350 * Report **quotas** in `scw info` ([#130](https://github.com/scaleway/scaleway-cli/issues/130)) 1351 * Added `SCALEWAY_VERBOSE_API` to make the API more verbose 1352 * Support of `scw _ips` command ... ([#196](https://github.com/scaleway/scaleway-cli/pull/196)) 1353 * Report **permissions** in `scw info` ([#191](https://github.com/scaleway/scaleway-cli/issues/191)) 1354 * Report **dashboard** statistics in `scw info` ([#177](https://github.com/scaleway/scaleway-cli/issues/177)) 1355 * Support of `scw _userdata name VAR=@/path/to/file` ([#183](https://github.com/scaleway/scaleway-cli/issues/183)) 1356 * Support of `scw restart -w` ([#185](https://github.com/scaleway/scaleway-cli/issues/185)) 1357 * Restarting multiple servers in parallel ([#185](https://github.com/scaleway/scaleway-cli/issues/185)) 1358 * Added _security-groups ([#179](https://github.com/scaleway/scaleway-cli/issues/179)) 1359 * Reflect server location in `scw inspect` ([#204](https://github.com/scaleway/scaleway-cli/issues/204)) 1360 1361 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.5.0...v1.6.0) 1362 1363 ### v1.5.0 (2015-09-11) 1364 1365 * Support of `scw tag --bootscript=""` option ([#149](https://github.com/scaleway/scaleway-cli/issues/149)) 1366 * `scw info` now prints user/organization info from the API ([#130](https://github.com/scaleway/scaleway-cli/issues/130)) 1367 * Added helpers to manipulate new `user_data` API ([#150](https://github.com/scaleway/scaleway-cli/issues/150)) 1368 * Renamed `create-image-from-s3.sh` example and now auto-filling image metadata (title and bootscript) based on the Makefile configuration 1369 * Support of `scw rm -f/--force` option ([#158](https://github.com/scaleway/scaleway-cli/issues/158)) 1370 * Added `scw _userdata local ...` option which interacts with the Metadata API without authentication ([#166](https://github.com/scaleway/scaleway-cli/issues/166)) 1371 * Initial version of `scw _billing` (price estimation tool) ([#118](https://github.com/scaleway/scaleway-cli/issues/118)) 1372 * Fix: debian-package installation 1373 * Fix: nil pointer dereference ([#155](https://github.com/scaleway/scaleway-cli/pull/155)) ([@ebfe](https://github.com/ebfe)) 1374 * Fix: regression on scw create ([#142](https://github.com/scaleway/scaleway-cli/issues/142)) 1375 * Stability improvements 1376 1377 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.4.0...v1.5.0) 1378 1379 --- 1380 1381 ### v1.4.0 (2015-08-28) 1382 1383 #### Features 1384 1385 * `-D,--debug` mode shows ready to copy-paste `curl` commands when using the API (must be used with `--sensitive` to unhide private token) 1386 * Support of `_patch SERVER tags="tag1 tag2=value2 tag3"` 1387 * `scw -D login` displays a fake password 1388 * Support --skip-ssh-key `scw login` ([#129](https://github.com/scaleway/scaleway-cli/issues/129)) 1389 * Now `scw login` ask your login/password, you can also pass token and organization with -o and -t ([#59](https://github.com/scaleway/scaleway-cli/issues/59)) 1390 * Support of `scw images --filter` option *(type, organization, name, public)* ([#134](https://github.com/scaleway/scaleway-cli/issues/134)) 1391 * Support of `scw {ps,images} --filter` option *(images: type,organization,name,public; ps:state,ip,tags,image)* ([#134](https://github.com/scaleway/scaleway-cli/issues/134)) 1392 * Syncing cache to disk after server creation when running `scw run` in a non-detached mode 1393 * Bump to Golang 1.5 1394 * Support --tmp-ssh-key `scw {run,create}` option ([#99](https://github.com/scaleway/scaleway-cli/issues/99)) 1395 * Support of `scw run --rm` option ([#117](https://github.com/scaleway/scaleway-cli/issues/117)) 1396 * Support of `--gateway=login@host` ([#110](https://github.com/scaleway/scaleway-cli/issues/110)) 1397 * Upload local ssh key to scaleway account on `scw login` ([#100](https://github.com/scaleway/scaleway-cli/issues/100)) 1398 * Add a 'running indicator' for `scw run`, can be disabled with the new flag `--quiet` 1399 * Support of `scw -V/--verbose` option ([#83](https://github.com/scaleway/scaleway-cli/issues/83)) 1400 * Support of `scw inspect --browser` option 1401 * Support of `scw _flush-cache` internal command 1402 * `scw run --gateway ...` or `SCW_GATEWAY="..." scw run ...` now creates a server without public ip address ([#74](https://github.com/scaleway/scaleway-cli/issues/74)) 1403 * `scw inspect TYPE:xxx TYPE:yyy` will only refresh cache for `TYPE` 1404 * Sorting cache search by Levenshtein distance ([#87](https://github.com/scaleway/scaleway-cli/issues/87)) 1405 * Allow set up api endpoint using the environment variable $scaleway_api_endpoint 1406 * Use TLS and verify can now be disabled using `SCALEWAY_TLSVERIFY=0` env var ([#115](https://github.com/scaleway/scaleway-cli/issues/115)) 1407 * Switched to `goxc` for releases 1408 1409 #### Fixes 1410 1411 * Moved ssh command generation code to dedicated package 1412 * Global refactor to improve Golang library usage, allow chaining of commands and ease the writing of unit tests ([#80](https://github.com/scaleway/scaleway-cli/issues/80)) 1413 * `scw search TERM` was not restricting results based on `TERM` 1414 * Bumped dependencies 1415 * Hiding more sensitive data ([#77](https://github.com/scaleway/scaleway-cli/issues/77)) 1416 * Fixed "Run in Docker" usage ([#90](https://github.com/scaleway/scaleway-cli/issues/90)) 1417 * Improved `-D/--debug` outputs 1418 1419 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.3.0...v1.4.0) 1420 1421 --- 1422 1423 ### 1.3.0 (2015-07-20) 1424 1425 #### Features 1426 1427 * Switched from [Godep](https://godoc.org/github.com/tools/godep) to [Party](https://godoc.org/github.com/mjibson/party) 1428 * Support of `-g` option ([#70](https://github.com/scaleway/scaleway-cli/issues/70)) 1429 1430 #### Fixes 1431 1432 * Issue with `scw top`'s usage 1433 * Minor code improvements 1434 1435 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.2.1...v1.3.0) 1436 1437 --- 1438 1439 ### 1.2.1 (2015-07-01) 1440 1441 #### Features 1442 1443 * Support of `scw run -d` option ([#69](https://github.com/scaleway/scaleway-cli/issues/69)) 1444 1445 #### Fixes 1446 1447 * Version vendor source code (Godeps) 1448 1449 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.2.0...v1.2.1) 1450 1451 --- 1452 1453 ### 1.2.0 (2015-06-29) 1454 1455 #### Features 1456 1457 * Support of `_patch SERVER security_group` and `_patch SERVER bootscript` 1458 * Improved resolver behavior when matching multiple results, now displaying more info too help choosing candidates ([#47](https://github.com/scaleway/scaleway-cli/issues/47)) 1459 * `scw exec SERVER [COMMAND] [ARGS...]`, *COMMAND* is now optional 1460 * Showing the server MOTD when calling `scw run <image> [COMMAND]` without *COMMAND* 1461 * Support of `scw attach --no-stdin` option 1462 * Hiding sensitive data by default on `scw inspect` ([#64](https://github.com/scaleway/scaleway-cli/issues/64)) 1463 * Support of `scw --sensitive` option ([#64](https://github.com/scaleway/scaleway-cli/issues/64)) 1464 * Support of `scw run --attach` option ([#65](https://github.com/scaleway/scaleway-cli/issues/65)) 1465 * `scw {create,run}`, prefixing root-volume with the server hostname ([#63](https://github.com/scaleway/scaleway-cli/issues/63)) 1466 * `scw {create,run} IMAGE`, *IMAGE* can be a snapshot ([#19](https://github.com/scaleway/scaleway-cli/issues/19)) 1467 * Support of `scw stop -w, --wait` option 1468 * Identifiers can be prefixed with the type of the resource, i.e: `scw inspect my-server` == `scw inspect server:my-server` 1469 It may be useful if you have the same name in a server and a volume 1470 * Improved support of zsh completion 1471 1472 #### Fixes 1473 1474 * `scw inspect -f` was always exiting 0 1475 * `scw images -a` does not prefix snapshots, volumes and bootscripts (only images) 1476 * `scw run ...` waits for 30 seconds before polling the API 1477 * `scw stop server1 server2` doesn't exit on first stopping failure 1478 * `scw run IMAGE [COMMAND]`, default *COMMAND* is now `if [ -x /bin/bash ]; then exec /bin/bash; else exec /bin/sh; fi` 1479 * `scw run|create SNAPSHOT`, raised an error if snapshot does not have base volume 1480 * `scw stop -t` removes server entry from cache 1481 1482 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.1.0...v1.2.0) 1483 1484 --- 1485 1486 ### 1.1.0 (2015-06-12) 1487 1488 #### Features 1489 1490 * Support of `scw cp` from {server-path,local-path,stdin} to {server-path,local-path,stdout} ([#56](https://github.com/scaleway/scaleway-cli/issues/56)) 1491 * Support of `scw logout` command 1492 * Support of `_patch` experimental command ([#57](https://github.com/scaleway/scaleway-cli/issues/57)) 1493 * Support of `_completion` command (shell completion helper) ([#45](https://github.com/scaleway/scaleway-cli/issues/45)) 1494 * Returning more resource fields on `scw inspect` ([#50](https://github.com/scaleway/scaleway-cli/issues/50)) 1495 * Show public ip address in PORTS field in `scw ps` ([#54](https://github.com/scaleway/scaleway-cli/issues/54)) 1496 * Support of `inspect --format` option 1497 * Support of `exec --timeout` option ([#31](https://github.com/scaleway/scaleway-cli/issues/31)) 1498 * Support of volumes in `images -a` and `inspect` ([#49](https://github.com/scaleway/scaleway-cli/issues/49)) 1499 * Tuned `~/.scwrc` unix permissions + added a warning if the file is too open ([#48](https://github.com/scaleway/scaleway-cli/pull/48)) 1500 1501 #### Fixes 1502 1503 * The project is now `go get`-able and splitted into packages 1504 * Added timeout when polling SSH TCP port for `scw start -w` and `scw exec -w` ([#46](https://github.com/scaleway/scaleway-cli/issues/46)) 1505 * Improved resolver behavior for exact matching ([#53](https://github.com/scaleway/scaleway-cli/issues/53), [#55](https://github.com/scaleway/scaleway-cli/issues/55)) 1506 * Verbose error message when `scw exec` fails ([#42](https://github.com/scaleway/scaleway-cli/issues/42)) 1507 * Fixed `scw login` parameters parsing 1508 * Speed and stability improvements 1509 1510 View full [commits list](https://github.com/scaleway/scaleway-cli/compare/v1.0.0...v1.1.0) 1511 1512 --- 1513 1514 ### 1.0.0 (2015-06-05) 1515 1516 First Golang version. 1517 For previous Node.js versions, see [scaleway-cli-node](https://github.com/moul/scaleway-cli-node). 1518 1519 #### Features 1520 1521 * Support of `attach` command 1522 * Support of `commit` command 1523 * Support of `commit -v, --volume` option 1524 * Support of `cp` command 1525 * Support of `create` command 1526 * Support of `create --bootscript` option 1527 * Support of `create -e, --env` option 1528 * Support of `create --name` option 1529 * Support of `create -v, --volume` option 1530 * Support of `events` command 1531 * Support of `exec` command 1532 * Support of `exec -w, --wait` option 1533 * Support of `help` command 1534 * Support of `history` command 1535 * Support of `history --no-trunc` option 1536 * Support of `history -q, --quiet` option 1537 * Support of `images` command 1538 * Support of `images -a, --all` option 1539 * Support of `images --no-trunc` option 1540 * Support of `images -q, --quiet` option 1541 * Support of `info` command 1542 * Support of `inspect` command 1543 * Support of `kill` command 1544 * Support of `login` command 1545 * Support of `logs` command 1546 * Support of `port` command 1547 * Support of `ps` command 1548 * Support of `ps -a, --all` option 1549 * Support of `ps -n` option 1550 * Support of `ps -l, --latest` option 1551 * Support of `ps --no-trunc` option 1552 * Support of `ps -q, --quiet` option 1553 * Support of `rename` command 1554 * Support of `restart` command 1555 * Support of `rm` command 1556 * Support of `rmi` command 1557 * Support of `run` command 1558 * Support of `run --bootscript` option 1559 * Support of `run -e, --env` option 1560 * Support of `run --name` option 1561 * Support of `run -v, --volume` option 1562 * Support of `search` command 1563 * Support of `search --no-trunc` option 1564 * Support of `start` command 1565 * Support of `start -w, --wait` option 1566 * Support of `start -T, --timeout` option 1567 * Support of `stop` command 1568 * Support of `stop -t, --terminate` option 1569 * Support of `tag` command 1570 * Support of `top` command 1571 * Support of `version` command 1572 * Support of `wait` command 1573 1574 [gopkg.in/scaleway/scaleway-cli.v1](http://gopkg.in/scaleway/scaleway-cli.v1) 1575 1576 --- 1577 1578 ### POC (2015-03-20) 1579 1580 First [Node.js version](https://github.com/moul/scaleway-cli-node) 1581 1582 --- 1583 1584 ## Development 1585 1586 Feel free to contribute :smiley::beers: 1587 1588 1589 ### Hack 1590 1591 1. [Install go](https://golang.org/doc/install) 1592 2. Ensure you have `$GOPATH` and `$PATH` well configured, something like: 1593 * `export GOPATH=$HOME/go` 1594 * `export PATH=$PATH:$GOPATH/bin` 1595 3. Fetch the project: `go get -d github.com/scaleway/scaleway-cli/...` 1596 4. Go to scaleway-cli directory: `cd $GOPATH/src/github.com/scaleway/scaleway-cli` 1597 5. Hack: `emacs` 1598 6. Build: `make` 1599 7. Run: `./scw` 1600 1601 ## License 1602 1603 [MIT](https://github.com/scaleway/scaleway-cli/blob/master/LICENSE.md)