vpsfree-client 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -12
- data/bin/vpsfreectl +2 -2
- data/lib/vpsfree/client.rb +5 -3
- data/lib/vpsfree/client/cli.rb +12 -0
- data/lib/vpsfree/client/version.rb +5 -0
- data/vpsfree-client.gemspec +3 -3
- metadata +9 -10
- data/lib/vpsfree.rb +0 -5
- data/lib/vpsfree/cli.rb +0 -10
- data/lib/vpsfree/version.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df59bad35b5c60caa96296cabcfa96e71b7214b4
|
4
|
+
data.tar.gz: 4fe45d83e7e99236c32be28833c79f1018494564
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f02691e2cfc00a679eaafbd8f303cd4f7a63a72079cc4cdb670659f9ab0f6374627e38a7a9501c6a9949e6234e05638b2663d081825c88c4c1ad38dad054117b
|
7
|
+
data.tar.gz: 682fcba2c810258bd665dcf90fc7ffb77907c9dfb67eaa15a8b704219eb84d8aac516540f1a4a27b2ec4485036c39284318433acfa125bf3439fff8e02b99096
|
data/README.md
CHANGED
@@ -19,45 +19,54 @@ Or install it yourself as:
|
|
19
19
|
## Usage
|
20
20
|
### CLI
|
21
21
|
$ vpsfreectl -h
|
22
|
-
Usage:
|
23
|
-
-
|
22
|
+
Usage: haveapi-cli [options] <resource> <action> [objects ids] [-- [parameters]]
|
23
|
+
-u, --api URL API URL
|
24
|
+
-a, --auth METHOD Authentication method
|
24
25
|
--list-versions List all available API versions
|
25
|
-
--list-
|
26
|
-
|
26
|
+
--list-auth-methods [VERSION]
|
27
|
+
List available authentication methods
|
28
|
+
--list-resources [VERSION] List all resource in API version
|
29
|
+
--list-actions [VERSION] List all resources and actions in API version
|
27
30
|
-r, --raw Print raw response as is
|
28
|
-
-
|
29
|
-
-p, --password PASSWORD Password
|
31
|
+
-s, --save Save credentials to config file for later use
|
30
32
|
-v, --[no-]verbose Run verbosely
|
31
33
|
-h, --help Show this message
|
32
34
|
|
33
35
|
#### Examples
|
36
|
+
Authenticate using token and save it to config for later use:
|
37
|
+
|
38
|
+
vpsfreectl --auth token --save vps list
|
39
|
+
|
40
|
+
Show action parameters:
|
41
|
+
|
42
|
+
vpsfreectl vps create -h
|
34
43
|
|
35
44
|
List VPS:
|
36
45
|
|
37
|
-
vpsfreectl vps list
|
46
|
+
vpsfreectl vps list
|
38
47
|
|
39
48
|
List OS templates:
|
40
49
|
|
41
|
-
vpsfreectl os_template list
|
50
|
+
vpsfreectl os_template list
|
42
51
|
|
43
52
|
Create VPS:
|
44
53
|
|
45
|
-
vpsfreectl vps create
|
54
|
+
vpsfreectl vps create -- --hostname myvps --os-template-id 26
|
46
55
|
|
47
56
|
Delete VPS #1000:
|
48
57
|
|
49
|
-
vpsfreectl vps delete 1000
|
58
|
+
vpsfreectl vps delete 1000
|
50
59
|
|
51
60
|
List IP addresses:
|
52
61
|
|
53
|
-
vpsfreectl vps.ip_address list
|
62
|
+
vpsfreectl vps.ip_address list
|
54
63
|
|
55
64
|
### Client library
|
56
65
|
```ruby
|
57
66
|
require 'vpsfree/client'
|
58
67
|
|
59
68
|
api = Vpsfree::Client.new
|
60
|
-
api.login('yourname', 'yourpassword')
|
69
|
+
api.login(:basic, user: 'yourname', password: 'yourpassword')
|
61
70
|
|
62
71
|
response = api.vps.index
|
63
72
|
p response.ok?
|
data/bin/vpsfreectl
CHANGED
data/lib/vpsfree/client.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
require 'haveapi/client'
|
2
2
|
|
3
3
|
module Vpsfree
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
module Client
|
5
|
+
class Client < HaveAPI::Client::Client
|
6
|
+
def initialize(v=nil)
|
7
|
+
super('https://api.vpsfree.cz', v)
|
8
|
+
end
|
7
9
|
end
|
8
10
|
end
|
9
11
|
end
|
data/vpsfree-client.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'vpsfree/version'
|
4
|
+
require 'vpsfree/client/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'vpsfree-client'
|
8
|
-
spec.version = Vpsfree::VERSION
|
8
|
+
spec.version = Vpsfree::Client::VERSION
|
9
9
|
spec.authors = ['Jakub Skokan']
|
10
10
|
spec.email = ['jakub.skokan@vpsfree.cz']
|
11
11
|
spec.summary =
|
@@ -21,5 +21,5 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_development_dependency 'bundler', '~> 1.6'
|
22
22
|
spec.add_development_dependency 'rake'
|
23
23
|
|
24
|
-
spec.add_runtime_dependency 'haveapi-client'
|
24
|
+
spec.add_runtime_dependency 'haveapi-client', '~> 0.3.0'
|
25
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vpsfree-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Skokan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: haveapi-client
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.3.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.3.0
|
55
55
|
description: Ruby API and CLI for vpsFree.cz API
|
56
56
|
email:
|
57
57
|
- jakub.skokan@vpsfree.cz
|
@@ -66,10 +66,9 @@ files:
|
|
66
66
|
- README.md
|
67
67
|
- Rakefile
|
68
68
|
- bin/vpsfreectl
|
69
|
-
- lib/vpsfree.rb
|
70
|
-
- lib/vpsfree/cli.rb
|
71
69
|
- lib/vpsfree/client.rb
|
72
|
-
- lib/vpsfree/
|
70
|
+
- lib/vpsfree/client/cli.rb
|
71
|
+
- lib/vpsfree/client/version.rb
|
73
72
|
- vpsfree-client.gemspec
|
74
73
|
homepage: ''
|
75
74
|
licenses:
|
@@ -91,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
90
|
version: '0'
|
92
91
|
requirements: []
|
93
92
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.
|
93
|
+
rubygems_version: 2.2.5
|
95
94
|
signing_key:
|
96
95
|
specification_version: 4
|
97
96
|
summary: Ruby API and CLI for vpsFree.cz API
|
data/lib/vpsfree.rb
DELETED
data/lib/vpsfree/cli.rb
DELETED
data/lib/vpsfree/version.rb
DELETED