openstack_activeresource 0.3.2 → 0.3.3
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.
- data/VERSION +1 -1
- data/lib/open_stack/keystone/admin/tenant.rb +8 -3
- data/lib/open_stack/keystone/admin/user.rb +14 -7
- data/lib/open_stack/keystone/public/auth.rb +6 -2
- data/lib/open_stack/nova/compute/flavor.rb +16 -5
- data/lib/open_stack/nova/compute/network.rb +9 -4
- data/lib/open_stack/nova/compute/security_group.rb +4 -2
- data/lib/open_stack/nova/compute/server.rb +8 -3
- data/lib/open_stack/nova/compute/volume_attachment.rb +8 -4
- data/lib/open_stack/nova/volume/volume.rb +7 -2
- data/openstack_activeresource.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.3
|
@@ -33,9 +33,14 @@ module OpenStack
|
|
33
33
|
attribute :description, :string
|
34
34
|
end
|
35
35
|
|
36
|
-
validates :enabled,
|
37
|
-
|
38
|
-
|
36
|
+
validates :enabled,
|
37
|
+
:presence => true,
|
38
|
+
:inclusion => {:in => [true, false], :allow_blank => true}
|
39
|
+
validates :name,
|
40
|
+
:presence => true,
|
41
|
+
:format => {:with => /\A\w[\w\s]+\w\Z/, :allow_blank => true}
|
42
|
+
validates :description,
|
43
|
+
:format => {:with => /\A[\w\s\.\-:@+,'"]+\Z/, :allow_blank => true}
|
39
44
|
|
40
45
|
def initialize(params = {}, persisted = false) #:notnew:
|
41
46
|
super(params, persisted)
|
@@ -37,13 +37,20 @@ module OpenStack
|
|
37
37
|
attribute :tenant_id, :string
|
38
38
|
end
|
39
39
|
|
40
|
-
validates :name,
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
40
|
+
validates :name,
|
41
|
+
:presence => true,
|
42
|
+
:length => {:minimum => 4, :allow_blank => true},
|
43
|
+
:format => {:with => /\A[0-9a-z_]+\Z/i, :allow_blank => true}
|
44
|
+
validates :password,
|
45
|
+
:presence => true,
|
46
|
+
:format => {:with => /(?=.*[\d\W])/, :message => :must_contain_at_least_one_digit_or_one_special_character, :allow_blank => true},
|
47
|
+
:length => {:minimum => 8, :allow_blank => true}
|
48
|
+
validates :email,
|
49
|
+
:presence => true,
|
50
|
+
:formate => {:with => /\A[-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}\Z/i, :allow_blank => true}
|
51
|
+
validates :enabled,
|
52
|
+
:presence => true,
|
53
|
+
:inclusion => {:in => [true, false], :allow_blank => true}
|
47
54
|
|
48
55
|
def initialize(attributes = {}, persisted = false) #:notnew:
|
49
56
|
attributes = attributes.with_indifferent_access
|
@@ -29,8 +29,12 @@ module OpenStack
|
|
29
29
|
attribute :tenant_id, :string
|
30
30
|
end
|
31
31
|
|
32
|
-
validates :username,
|
33
|
-
|
32
|
+
validates :username,
|
33
|
+
:presence => true,
|
34
|
+
:unless => Proc.new { token.present? }
|
35
|
+
validates :password,
|
36
|
+
:presence => true,
|
37
|
+
:unless => Proc.new { token.present? }
|
34
38
|
|
35
39
|
def initialize(attributes = {}, persisted = false) #:notnew:
|
36
40
|
attributes[:username] ||= ""
|
@@ -39,11 +39,22 @@ module OpenStack
|
|
39
39
|
attribute :ephemeral_disk, :integer
|
40
40
|
end
|
41
41
|
|
42
|
-
validates :name,
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
validates :
|
42
|
+
validates :name,
|
43
|
+
:presence => true,
|
44
|
+
:format => {:with => /\A[\w\.\-]+\Z/, :allow_blank => true},
|
45
|
+
:length => {:minimum => 2, :maximum => 255, :allow_blank => true}
|
46
|
+
validates :ram,
|
47
|
+
:presence => true,
|
48
|
+
:numericality => {:greater_than_or_equal_to => 1, :only_integer => true, :allow_blank => true}
|
49
|
+
validates :vcpus,
|
50
|
+
:presence => true,
|
51
|
+
:numericality => {:greater_than_or_equal_to => 1, :only_integer => true, :allow_blank => true}
|
52
|
+
validates :disk,
|
53
|
+
:presence => true,
|
54
|
+
:numericality => {:greater_than_or_equal_to => 10, :only_integer => true, :allow_blank => true}
|
55
|
+
validates :ephemeral_disk,
|
56
|
+
:presence => false,
|
57
|
+
:numericality => {:greater_than_or_equal_to => 10, :only_integer => true}
|
47
58
|
|
48
59
|
# Returns a list of Flavor for a given name
|
49
60
|
#
|
@@ -42,11 +42,16 @@ module OpenStack
|
|
42
42
|
attribute :project_id, :string
|
43
43
|
end
|
44
44
|
|
45
|
-
validates :bridge,
|
46
|
-
|
45
|
+
validates :bridge,
|
46
|
+
:format => {:with => /\A[a-z][a-z0-9]{1,8}\Z/i}
|
47
|
+
validates :bridge_interface,
|
48
|
+
:format => {:with => /\A[a-z]{1,5}[a-z0-9]{1,5}(\.[0-9]{1,4})?\Z/i}
|
47
49
|
validates :cidr, :presence => true
|
48
|
-
validates :label, :presence => true,
|
49
|
-
|
50
|
+
validates :label, :presence => true,
|
51
|
+
:format => {:with => /\A[\w\s\d]{1,20}\Z/i}
|
52
|
+
validates :vlan,
|
53
|
+
:presence => true,
|
54
|
+
:numericality => {:greater_than_or_equal_to => 2, :less_than_or_equal_to => 4096, :allow_blank => true}
|
50
55
|
|
51
56
|
end
|
52
57
|
|
@@ -52,9 +52,14 @@ module OpenStack
|
|
52
52
|
attribute :key_pair_id, :string
|
53
53
|
end
|
54
54
|
|
55
|
-
validates :name,
|
56
|
-
|
57
|
-
|
55
|
+
validates :name,
|
56
|
+
:presence => true,
|
57
|
+
:format => {:with => /\A[\w\.\-\_]{2,}\Z/, :allow_blank => true},
|
58
|
+
:length => {:maximum => 255}
|
59
|
+
validates :image,
|
60
|
+
:presence => true
|
61
|
+
validates :flavor,
|
62
|
+
:presence => true
|
58
63
|
|
59
64
|
# Return the list of server for a given tenant
|
60
65
|
#
|
@@ -34,9 +34,13 @@ module OpenStack
|
|
34
34
|
attribute :server_id, :string
|
35
35
|
end
|
36
36
|
|
37
|
-
validates :device,
|
38
|
-
|
39
|
-
|
37
|
+
validates :device,
|
38
|
+
:presence => true,
|
39
|
+
:format => {:with => /\A[\/\\a-zA-Z0-9]+\Z/, :allow_blank => true}
|
40
|
+
validates :volume,
|
41
|
+
:presence => true
|
42
|
+
validates :server,
|
43
|
+
:presence => true
|
40
44
|
|
41
45
|
def initialize(attributes = {}, persisted = false) #:notnew:
|
42
46
|
attributes = attributes.with_indifferent_access
|
@@ -65,7 +69,7 @@ module OpenStack
|
|
65
69
|
|
66
70
|
# Overloads ActiveRecord::encode method
|
67
71
|
def encode(options={}) #:nodoc:
|
68
|
-
|
72
|
+
# Custom encoding to deal with openstack API
|
69
73
|
to_encode = {
|
70
74
|
VolumeAttachment.element_name => {
|
71
75
|
:device => device,
|
@@ -43,8 +43,13 @@ module OpenStack
|
|
43
43
|
|
44
44
|
alias_attribute :name, :display_name
|
45
45
|
|
46
|
-
validates :display_name,
|
47
|
-
|
46
|
+
validates :display_name,
|
47
|
+
:presence => true,
|
48
|
+
:format => {:with => /\A[\w\.\-]+\Z/, :allow_blank => true},
|
49
|
+
:length => {:minimum => 2, :maximum => 255, :allow_blank => true}
|
50
|
+
validates :size,
|
51
|
+
:presence => true,
|
52
|
+
:numericality => {:greater_than_or_equal_to => 1, :only_integer => true, :allow_blank => true}
|
48
53
|
|
49
54
|
def initialize(attributes = {}, persisted = false) #:notnew:
|
50
55
|
attributes = attributes.with_indifferent_access
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "openstack_activeresource"
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Davide Guerri"]
|
12
|
-
s.date = "2013-02-
|
12
|
+
s.date = "2013-02-18"
|
13
13
|
s.description = "OpenStack Ruby and RoR bindings implemented with ActiveResource - See also http://www.unicloud.it"
|
14
14
|
s.email = "d.guerri@rd.unidata.it"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openstack_activeresource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
12
|
+
date: 2013-02-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -228,7 +228,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
228
228
|
version: '0'
|
229
229
|
segments:
|
230
230
|
- 0
|
231
|
-
hash:
|
231
|
+
hash: -4030906719901189313
|
232
232
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
233
233
|
none: false
|
234
234
|
requirements:
|