liquidweb / liquidweb-cli Goto Github PK
View Code? Open in Web Editor NEWOfficial command line interface for the LiquidWeb API
License: Apache License 2.0
Official command line interface for the LiquidWeb API
License: Apache License 2.0
ssullivan@data2 ~ $ lw cloud network public list --uniq-id 2T79JD
IP Assignments for 2T79JD:
IP: 50.28.34.90
Id: 1210289
Gateway: 50.28.32.1
Broadcast: 50.28.35.255
Netmask: 255.255.252.0
Network: 255.255.252.0
IP: 10.30.200.62
Id: 1210650
Gateway: 10.30.200.1
Broadcast: 10.30.207.255
Netmask: 255.255.248.0
Network: 255.255.248.0
IP: 50.28.34.72
Id: 1210855
Gateway: 50.28.32.1
Broadcast: 50.28.35.255
Netmask: 255.255.252.0
Network: 255.255.252.0
ssullivan@data2 ~ $
remove 'cloud inventory' cmds, favor 'list' cmd in normal entry point instead. For example, cloud inventory server list
should become cloud server list
auth add-context
doesnt work if config file doesnt yet exist. Instead you have to either create the file as empty, or run auth init
to generate your config interactively.
A fatal error has occurred:
Config File ".liquidweb-cli" Not Found in "[/home/dburke]"
we should fix this situation
We need network loadbalancer
commands implemented for the Cloud LoadBalancer.
Here's the api documentation for the loadbalancer methods:
https://cart.liquidweb.com/storm/api/docs/bleed/Network/LoadBalancer.html#method_addNode
Looks like at a minimum we would probably want these commands:
network loadbalancer create
network loadbalancer delete
network loadbalancer update
network loadbalancer details
network loadbalancer list
network loadbalancer addnode
network loadbalancer removenode
network loadbalancer addservice
network loadbalancer removeservice
we might also want to put the data in methods like bleed/Network/LoadBalancer/strategies
in the details/list commands.
A user defined plan is defined as a saved set of commands (and their accompanying flags) to run in a specific order.
For example, this would empower users to do things like execute a plan automatically, to:
1.) Create 2 webserver nodes from a custom image named "web server"
2.) Create a loadbalancer pointing it at the 2 new nodes
3.) Create a database server from custom image "database server"
4.) Attach the 3 new servers to a private network
which for example, this could be orchestrated by running:
lw plan apply /path/to/plan.yaml
We should make it more clear what the default choices are for questions like shown below when interacting in auth init
examples:
API URL (hit enter for default): >
Insecure SSL Validation (yes/no) (hit enter for default): >
API timeout (hit enter for default): > 30
Make current context? (yes/no) > yes
Add another context? (yes/no): > no
more examples, more detail... detail all fields, and note required ones... touch more on the template variables... they can be used ANYWHERE in the yaml, including the "if/else" logic to add or remove fields
Currently passing mulitiple uniq ids to the private networking attach and detach results in a fatal error.
`A fatal error has occurred:
validation failed for input field a uniq_id must be 6 characters long`
I realize it's probably the top one all the time, but there's no indication, and I tried to remove it but got an error
create a auth update-context
command. This way users can modify specific settings in their context, such as timeout for example, without having to manually edit the config file or deleting and then recreating the context with remove-context
and then add-context
i.e. 401 is unauthorized... atm it just says there was an error...
polly:~/repos/liquidweb-cli(master)$ ./_exe/liquidweb-cli cloud server status
A fatal error has occurred:
Bad HTTP response code [401] from [https://api.liquidweb.com/bleed/storm/server/list]
think we should look into adding tab completion like you said though, its totally doable with cobra
https://github.com/spf13/cobra/blob/master/bash_completions.md
rename the binary from liquidweb-cli to lw as that sounds much easier to work with less typing
Implement the network vpn
commands.
https://cart.liquidweb.com/storm/api/docs/bleed/VPN.html#method_addUser
support optional api token instead of only the pw for an auth context.
reimage server from template
api: storm/template/restore
thinking maybe would be more useful if you changed the output of the create Check status with 'cloud server status --uniq_id 2HUSP1' to Check status with 'liquidweb-cli cloud server status --uniq_id 2HUSP1'
so you can just copy paste assuming the cli is in your path. or like remove the '' from the output to get a cleaner oneliner you can just copy
ssullivan 1:03 PM
or make it print filepath.Base(os.Args[0]) perhaps in place (edited)ssullivan 1:04 PM
package main
import (
"fmt"
"os"
"path/filepath"
)
func main() {
fmt.Println(filepath.Base(os.Args[0]))
}
Add ability to save default flag values on a global basis. For example, one should be able to save a default value for zone
or template
, and any command that requires those flags, should use the global default if one wasn't passed.
Add a global --use-context flag. This would enable running commands as "one offs" in specific contexts, without changing your current context. For example:
lw cloud server status --use-context=context1
dweb-cli(master)$ ./_exe/liquidweb-cli cloud server destroy --uniq_id 0NAP0T,J95ZYX,0HS1TM,L4WYMH,6UZ9CT,
destroyed: 0NAP0T
destroyed: J95ZYX
destroyed: 0HS1TM
destroyed: L4WYMH
destroyed: 6UZ9CT
A fatal error has occurred:
LW::Exception::Input::Multiple: The following input errors occurred:
The required field 'uniq_id' was missing a value.
hash pw in config
cloud server create
cloud server update
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.