Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3 from bosondata/feature/improve
Browse files Browse the repository at this point in the history
Optimize
  • Loading branch information
Gestalt LUR authored Apr 4, 2017
2 parents fc5d9fa + b9317b6 commit 916c8f8
Show file tree
Hide file tree
Showing 8 changed files with 279 additions and 126 deletions.
25 changes: 25 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
sudo: false
language: rust
addons:
apt:
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- binutils-dev
rust:
- stable
- beta
- nightly

matrix:
allow_failures:
- rust: beta
- rust: nightly

before_script:
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH

script:
- travis-cargo build
- travis-cargo test
78 changes: 74 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 16 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
[package]
authors = ["Gestalt LUR <[email protected]>"]
name = "ali_ecs_ctl"
name = "ali-ecs-ctl"
version = "0.2.0"

[dependencies]
base64 = "0.4"
chrono = "0.3"
clap = "~2.22.2"
clap = "2.22"
hyper = "0.10"
reqwest = "0.5.0"
rustc-serialize = "0.3"
sha1 = "0.2.0"
url = "1.4.0"
reqwest = "0.5"
serde = "0.9"
serde_derive = "0.9"
serde_json = "0.9"
sha1 = "0.2"
url = "1.4"

[dependencies.uuid]
features = ["serde", "v4"]
features = ["v4"]
version = "0.4"

[dev-dependencies]
hex = "0.2"

[features]
unstable = []
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,31 @@ export ALIYUN_SECRET=<ALIYUN-SECRET>
### List instances

```bash
$ ali_ecs_ctl list
$ ali-ecs-ctl list
```

### Reboot instances

Reboot instances if ssh timeout:
```bash
$ ali_ecs_ctl reboot -c ssh
$ ali-ecs-ctl reboot -c ssh
```

Reboot instances if ping timeout:
```bash
$ ali_ecs_ctl reboot -c ping
$ ali-ecs-ctl reboot -c ping
```

Reboot single instances by ip:
```bash
$ ali_ecs_ctl reboot --ip <instance_public_ip_address>
$ ali-ecs-ctl reboot --ip <instance_public_ip_address>
```


### Reboot ALL instances!

```bash
$ ali_ecs_ctl rebootall
$ ali-ecs-ctl rebootall
```


Expand All @@ -75,4 +75,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
1 change: 0 additions & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
max_width = 120
ideal_width = 100
write_mode = "Overwrite"
7 changes: 2 additions & 5 deletions src/hmac_sha1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,13 @@ pub fn hmac_sha1(key: &[u8], message: &[u8]) -> [u8; SHA1_DIGEST_BYTES] {
}


#[cfg(test)]
extern crate rustc_serialize;
#[cfg(test)]
mod tests {
extern crate hex;
use self::hex::ToHex;

use hmac_sha1;

use rustc_serialize::hex::ToHex;


#[test]
fn test_vector1() {
// tuples of (data, key, expected hex string)
Expand Down
Loading

0 comments on commit 916c8f8

Please sign in to comment.