arukas 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3d34e78199d3f9915776073ee4bf3035ea15aa775e264d7c9c7f6d6c95892b7
4
- data.tar.gz: 5adb85b7f184b6a37fadec977c3a0beb970a6d84c20b8a486442afe24109592f
3
+ metadata.gz: 56476a0f83a693f227daf8b9da15864b48be2ce1baa24afa91f75faeab31037d
4
+ data.tar.gz: c31ebe7185749e32a20de86795fd4e48f0fc34b52f27d79f5fae195fe51d272e
5
5
  SHA512:
6
- metadata.gz: a132c849bf1fc5ec74eca52c7b4b7113d70bd3cfeb07439108eb1cf73c9a39e2be2ed259612f59ed61bd0d0352d424672d0c8d4192f330711ede0af5ae75f2be
7
- data.tar.gz: 7e922a6835fd2dc95ab0db40244fe9d8be8d29aa6be63906f0060817b449cf0140f29e30f0aa3c83c73985a6f70c34ec0a8072557d899d76282f5b73ab3897cc
6
+ metadata.gz: 2e0c70df9bb7717e271ce0f590e0dd0805c38621dbdb789568f19c1b435e78a4983948f55bab41438ba516ca0b7224042f8b21cf090f3afe6546d83fb82e436d
7
+ data.tar.gz: 7ee318479c5c1c030556dcf9fb3430b92b0dbdc82a386b6f089a40a71313eef1c501e3f68fe7fcb73660f3ef8000208d1b5ecf39ed10eb9d84a3f27a2688301a
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = "Arukas Ruby Client"
13
13
  spec.description = "Arukas Ruby Client"
14
- spec.homepage = "https://github.com/S-H-GAMELINKS"
14
+ spec.homepage = "https://github.com/S-H-GAMELINKS/arukas"
15
15
 
16
16
  # Specify which files should be added to the gem when it is released.
17
17
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -4,23 +4,43 @@ require "json"
4
4
  module Arukas
5
5
  class API
6
6
  def initialize(token, secret)
7
- @url = "https://#{token}:#{secret}@app.arukas.io/api/apps/"
7
+ @url = "https://#{token}:#{secret}@app.arukas.io/api/"
8
8
  end
9
9
 
10
10
  def get_apps
11
- RestClient.get @url
11
+ RestClient.get @url + "apps/"
12
12
  end
13
13
 
14
14
  def create_apps(params)
15
- RestClient.post @url, payload=params, {:content_type => :json}
15
+ RestClient.post @url + "apps/", payload=params, {:content_type => :json}
16
16
  end
17
17
 
18
18
  def get_app(id)
19
- RestClient.get @url + "#{id}"
19
+ RestClient.get @url + "apps/#{id}"
20
20
  end
21
21
 
22
22
  def delete_app(id)
23
- RestClient.delete @url + "#{id}"
23
+ RestClient.delete @url + "apps/#{id}"
24
+ end
25
+
26
+ def get_services
27
+ RestClient.get @url + "services/"
28
+ end
29
+
30
+ def get_service(id)
31
+ RestClient.get @url + "services/#{id}"
32
+ end
33
+
34
+ def patch_service(id, params)
35
+ RestClient.patch @url + "services/#{id}", payload=params.to_json, {:content_type => :json, :accept => :json}
36
+ end
37
+
38
+ def power_on_service(id)
39
+ RestClient.post @url + "services/#{id}/power", payload="", {:content_type => :json}
40
+ end
41
+
42
+ def power_off_service(id)
43
+ RestClient.delete @url + "services/#{id}/power"
24
44
  end
25
45
  end
26
46
  end
@@ -1,3 +1,3 @@
1
1
  module Arukas
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -0,0 +1,33 @@
1
+ {
2
+ "data": {
3
+ "id": "18db92c4-3984-466e-89bd-b49f924a7210",
4
+ "type": "services",
5
+ "attributes": {
6
+ "app-id": "97335e05-6cd0-42f5-a502-daca5f7b6d89",
7
+ "image": "wordpress",
8
+ "command": null,
9
+ "instances": 3,
10
+ "environment": null,
11
+ "ports": [
12
+ {
13
+ "protocol": "tcp",
14
+ "number": 80
15
+ }
16
+ ]
17
+ },
18
+ "relationships": {
19
+ "app": {
20
+ "data": {
21
+ "id": "97335e05-6cd0-42f5-a502-daca5f7b6d89",
22
+ "type": "apps"
23
+ }
24
+ },
25
+ "service-plan": {
26
+ "data": {
27
+ "id": "jp-develop/standard-1",
28
+ "type": "service-plans"
29
+ }
30
+ }
31
+ }
32
+ }
33
+ }
data/test.json CHANGED
@@ -42,7 +42,7 @@
42
42
  "service-plan": {
43
43
  "data": {
44
44
  "type": "service-plans",
45
- "id": "jp-tokyo/hobby"
45
+ "id": "jp-tokyo/free"
46
46
  }
47
47
  }
48
48
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arukas
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
  - S.H.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-13 00:00:00.000000000 Z
11
+ date: 2019-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -72,8 +72,9 @@ files:
72
72
  - lib/arukas.rb
73
73
  - lib/arukas/api.rb
74
74
  - lib/arukas/version.rb
75
+ - patch.json
75
76
  - test.json
76
- homepage: https://github.com/S-H-GAMELINKS
77
+ homepage: https://github.com/S-H-GAMELINKS/arukas
77
78
  licenses: []
78
79
  metadata: {}
79
80
  post_install_message: