Browse Source

Add basic usage examples and link to tutorial.

Andrew Starr-Bochicchio 2 years ago
parent
commit
eb3f2c2d71
1 changed files with 28 additions and 0 deletions
  1. 28
    0
      README.md

+ 28
- 0
README.md View File

@@ -53,6 +53,34 @@ Example:
53 53
 }
54 54
 ```
55 55
 
56
+## Examples
57
+
58
+`doctl` is able to interact will all of your DigitalOcean resources. Below are a few common usage examples. To learn more about the features available, see [the full tutorial on the DigitalOcean community site](https://www.digitalocean.com/community/tutorials/how-to-use-doctl-the-official-digitalocean-command-line-client).
59
+
60
+* List all Droplets on your account:
61
+
62
+    `doctl compute droplet list`
63
+
64
+* Create a Droplet:
65
+
66
+    `doctl compute droplet create <name> --region <region-slug> --image <image-slug> --size <size-slug>`
67
+
68
+* Assign a Floating IP to a Droplet:
69
+
70
+    `doctl compute floating-ip-action assign <ip-addr> <droplet-id>`
71
+
72
+* Create a new A record for an existing domain:
73
+
74
+    `doctl compute domain records create --record-type A --record-name www --record-data <ip-addr> <domain-name>`
75
+
76
+`doctl` also simplifies actions without an API endpoint. For instance, it allows you to SSH to your Droplet by name:
77
+
78
+    doctl compute ssh <droplet-name>
79
+
80
+By default, it assumes you are using the `root` user. If you want to SSH as a specific user, you can do that as well:
81
+
82
+    doctl compute ssh <user>@<droplet-name>
83
+
56 84
 ## Building and dependencies
57 85
 
58 86
 `doctl`'s dependencies are managed by [gvt](https://github.com/FiloSottile/gvt). To add dependencies, use `gvt fetch`.