sfrest 0.0.12 → 0.0.13

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: 9e5a68209a45ec0dc81e36535e276889ff2f86b6
4
- data.tar.gz: 02797d6219680639b0f6669a57af3ffec251839c
3
+ metadata.gz: edf073b0cb0a501406818044613d07af0f2105b2
4
+ data.tar.gz: b47e8e4f6d1c59ad1f5bd13eadfa675d032500dc
5
5
  SHA512:
6
- metadata.gz: 447e1cf3621ca1f9d343a773a2e3ac8a701bdbd0de352421399b859c7388f3fc68c3e5d6f7e0575ddb024faef73ef07056b17b17429c3307b5171981d82a55a7
7
- data.tar.gz: f860b23a28e13c26faa939b2b6f44b088a4508d35e5efefd07f81946a8e1413187995b49db57a6c8ec6125d142cb24c6333b59d108d1249fead3b65335f2f47e
6
+ metadata.gz: c2835b20da38d1762f099504dd5e7c97e39ee69d29fa3caddd6f1dccdf62ac0c77499e866af7c266752a15a9df3289d002248415b0886f9576c7f0e986e25312
7
+ data.tar.gz: 27c5cb395231d07733a9cb26e1379a0e8a0972de6fd7827be9e6cf2daba76f3d9b4253ddc30226a52b1bb8434bb0e5b5bff7352e856fa78c9d738025d2ffd342
@@ -0,0 +1,16 @@
1
+ module SFRest
2
+ # List codebases on the factory.
3
+ class Codebase
4
+ # @param [SFRest::Connection] conn
5
+ def initialize(conn)
6
+ @conn = conn
7
+ end
8
+
9
+ # Lists the codebases
10
+ # @return [Hash] A hash of codebases configured for the factory.
11
+ # { "stacks" => { 1 => "abcde", 2 => 'fghij' } }
12
+ def list
13
+ @conn.get('/api/v1/stacks')
14
+ end
15
+ end
16
+ end
@@ -166,6 +166,7 @@ module SFRest
166
166
  # NOTE: accessor == Class_name.to_lower
167
167
  REST_METHODS = %w(audit
168
168
  backup
169
+ codebase
169
170
  collection
170
171
  domains
171
172
  group
data/lib/sfrest/site.rb CHANGED
@@ -80,16 +80,33 @@ module SFRest
80
80
  end
81
81
 
82
82
  # Creates a site.
83
- # @param [String] sitename The name of the site to create
84
- # @param [Integer] group_id The Id of the group the site is to be a member of
85
- # @param [String] install_profile The install profile to use when creating the site
86
- def create_site(sitename, group_id, install_profile = nil)
83
+ # @param [String] sitename The name of the site to create.
84
+ # @param [Integer] group_id The Id of the group the site is to be a member of.
85
+ # @param [String] install_profile The install profile to use when creating the site.
86
+ # @param [Integer] codebase The codebase index to use in installs.
87
+ def create_site(sitename, group_id, install_profile = nil, codebase = nil)
87
88
  current_path = '/api/v1/sites'
88
89
  payload = { 'site_name' => sitename, 'group_ids' => [group_id],
89
- 'install_profile' => install_profile }.to_json
90
+ 'install_profile' => install_profile, 'codebase' => codebase }.to_json
90
91
  @conn.post(current_path, payload)
91
92
  end
92
93
 
94
+ # Creates a site.
95
+ # Alias for create_site
96
+ # @param [String] sitename The name of the site to create
97
+ # @param [Integer] group_id The Id of the group the site is to be a member of
98
+ # @param [String] install_profile The install profile to use when creating the site
99
+ # @param [Integer] codebase The codebase index to use in installs.
100
+ alias create create_site
101
+
102
+ # Deletes a site.
103
+ # @param [Integer] site_id The id of the stie to be deleted
104
+ # @return [Hash]
105
+ def delete(site_id)
106
+ current_path = '/api/v1/sites/' + site_id.to_s
107
+ @conn.delete current_path
108
+ end
109
+
93
110
  # accessors for backups/restore
94
111
  # so that you can do site.backup.list_backups
95
112
  def backup
@@ -1,4 +1,4 @@
1
1
  module SFRest
2
2
  # Just tracks the version of sfrest.
3
- VERSION = '0.0.12'.freeze
3
+ VERSION = '0.0.13'.freeze
4
4
  end
data/lib/sfrest.rb CHANGED
@@ -8,6 +8,7 @@ require 'json'
8
8
 
9
9
  require 'sfrest/audit'
10
10
  require 'sfrest/backup'
11
+ require 'sfrest/codebase'
11
12
  require 'sfrest/collection'
12
13
  require 'sfrest/connection'
13
14
  require 'sfrest/domains'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sfrest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - ACSF Engineering
@@ -103,6 +103,7 @@ files:
103
103
  - lib/sfrest.rb
104
104
  - lib/sfrest/audit.rb
105
105
  - lib/sfrest/backup.rb
106
+ - lib/sfrest/codebase.rb
106
107
  - lib/sfrest/collection.rb
107
108
  - lib/sfrest/connection.rb
108
109
  - lib/sfrest/domains.rb
@@ -140,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
140
141
  version: '0'
141
142
  requirements: []
142
143
  rubyforge_project:
143
- rubygems_version: 2.6.12
144
+ rubygems_version: 2.6.13
144
145
  signing_key:
145
146
  specification_version: 4
146
147
  summary: Acquia Site Factory Rest API.