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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62f28ee8445bbe0c3aa2372e5cae7f20c8c93402
4
- data.tar.gz: 4b9f1ca3662c50d2ecff3f51717586ccfc3e601e
3
+ metadata.gz: df59bad35b5c60caa96296cabcfa96e71b7214b4
4
+ data.tar.gz: 4fe45d83e7e99236c32be28833c79f1018494564
5
5
  SHA512:
6
- metadata.gz: bbdc67e9dddf6359ad9c59a4a1e9f068d30957fdefe39f9372bf1ecaabaa9685f81673d685447081092245c5d98d9f94586511cd2194bb3444d4b67fe54eae50
7
- data.tar.gz: 951e99a736c2233b090395f803a1a8aed2380829f6404fdea36ec777520b309baa36eab3f868ae79f944dddfbed38f27acf5e8891809da1ac0181ed203f47478
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: vpsfreectl [options] <resource> <action> [objects ids] [-- [parameters]]
23
- -a, --api URL API URL
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-resources VERSION List all resource in API version
26
- --list-actions VERSION List all resources and actions in API version
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
- -u, --username USER User name
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 -u yourlogin
46
+ vpsfreectl vps list
38
47
 
39
48
  List OS templates:
40
49
 
41
- vpsfreectl os_template list -u yourlogin
50
+ vpsfreectl os_template list
42
51
 
43
52
  Create VPS:
44
53
 
45
- vpsfreectl vps create -u yourlogin -- --hostname myvps --os-template-id 26
54
+ vpsfreectl vps create -- --hostname myvps --os-template-id 26
46
55
 
47
56
  Delete VPS #1000:
48
57
 
49
- vpsfreectl vps delete 1000 -u yourlogin
58
+ vpsfreectl vps delete 1000
50
59
 
51
60
  List IP addresses:
52
61
 
53
- vpsfreectl vps.ip_address list -u yourlogin
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
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'vpsfree/cli'
3
+ require 'vpsfree/client/cli'
4
4
 
5
- Vpsfree::Cli.run
5
+ Vpsfree::Client::Cli.run
@@ -1,9 +1,11 @@
1
1
  require 'haveapi/client'
2
2
 
3
3
  module Vpsfree
4
- class Client < HaveAPI::Client::Client
5
- def initialize(v=nil)
6
- super('https://api.vpsfree.cz', v)
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
@@ -0,0 +1,12 @@
1
+ require 'haveapi/cli'
2
+
3
+ module Vpsfree
4
+ module Client
5
+ class Cli < HaveAPI::CLI::Cli
6
+ protected
7
+ def default_url
8
+ 'https://api.vpsfree.cz'
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ module Vpsfree
2
+ module Client
3
+ VERSION = '0.2.0'
4
+ end
5
+ end
@@ -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.1.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: 2014-05-19 00:00:00.000000000 Z
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: '0'
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: '0'
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/version.rb
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.1.11
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
@@ -1,5 +0,0 @@
1
- require 'vpsfree/version'
2
-
3
- module Vpsfree
4
-
5
- end
data/lib/vpsfree/cli.rb DELETED
@@ -1,10 +0,0 @@
1
- require 'haveapi/cli'
2
-
3
- module Vpsfree
4
- class Cli < HaveAPI::CLI::Cli
5
- protected
6
- def default_url
7
- 'https://api.vpsfree.cz'
8
- end
9
- end
10
- end
@@ -1,3 +0,0 @@
1
- module Vpsfree
2
- VERSION = '0.1.0'
3
- end