cloulu 0.6.6 → 0.7.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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTU0OThhZDZmY2IzNzEwYzBiMjU0YTJiYzIzYWI5MTAzMWVjYTZjMA==
4
+ OTg2NWMxYmI2Yzk1MjU2N2FhNTRkNTFjZmM1ZWNkMTg0N2FlYTNhMQ==
5
5
  data.tar.gz: !binary |-
6
- MTliNmQ1NzQ5MjA1NDNjZjQ4NjM5YjcwNGFkNzNmZDRkNGM0NTU1OQ==
6
+ MzUxMDliOGY4OGU0OTg2OTcxOGQxNWIzMTI3YzE3ZGRmMjY2ZmM4NQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzlhMTlmMWRkMjUyMjNmNmQxMGEzZTA0ZDJkZjFhYWMxMTJiMWVlMjE4MTlj
10
- YzU1NDRjYjc2OGZjOTIxZWMwYWE1ZTg1YTA5YTk4NjAyMWZiMTRlZjA1ZTgy
11
- ZjBkNDFlZDY3OGQyYjAwYWMwNThjZjdiODBjZjQ4ODQ4ZmVlMDc=
9
+ ODNmMTZmYmExNjFlN2QxMGJlNjIwZDdkY2Q2NWFiZWJiODhjZmE2MDA2M2Fj
10
+ NDk3NDkxN2VhNzM0ODc0YTE2MGI1Yzg3MmRjNGYwZjBkZDZmNWEyYWYyNzIy
11
+ NjIwN2QwNWQ4M2NmYTU2YjVkNjJiOGQ2ODZkY2IxNzhmMjc4YTY=
12
12
  data.tar.gz: !binary |-
13
- ZGZjNjZmOThkYjg4NmIyNDlkNTFlZmI1NDZjYzk1NTBhZDFjOGNjMmRiYmQx
14
- NWI3YzJlMjg4NWM5OTJkYmMzMWVmNzhmNDJiYmRjMWM4ODJkNGEzN2RmZDM2
15
- YzhkOTM1YWUzZGI4N2NiOWI0ZDU4ZDYyYjMyNmZlYzQ2ZDM1YTM=
13
+ ZTM1ODhkYTcxM2MzNDAxMmE4NzJjN2Y1ODY2MTRiODFkMDRjZGYzMDU4NmRm
14
+ ZTJmYzlkOTViMWM2NjYyYjRkMmJhZDdhY2VjOTI1ZDc4ZTE3N2IzYmVlN2Rh
15
+ M2RlNDk3M2Q2NWM5MzEzMzgxZGEzNzg5MDdlNThiM2FmMzdmOGE=
@@ -13,6 +13,7 @@ module CFoundry::V1
13
13
  attribute :version, :string
14
14
  attribute :tier, :string
15
15
  attribute :properties, :hash
16
+ attribute :options, :hash
16
17
 
17
18
  define_client_methods
18
19
 
@@ -11,6 +11,7 @@ module VMC::Service
11
11
  input :offering, :desc => "What kind of service (e.g. redis, mysql)",
12
12
  :argument => :optional, :from_given => offerings_from_label
13
13
  input :name, :desc => "Name for your service", :argument => :optional
14
+ input :options, :desc => "Service options", :argument => :optional
14
15
  input :plan, :desc => "Service plan",
15
16
  :from_given => find_by_name_insensitive("plan"),
16
17
  :default => proc { |plans|
@@ -72,6 +73,17 @@ module VMC::Service
72
73
  service.tier = v1_service_tier(offering)
73
74
  end
74
75
 
76
+ if service.name.start_with?("user_provided")
77
+ keys, values = input[:options, service.type]
78
+
79
+ plan_option = {}
80
+ keys.each_index do |index|
81
+ plan_option[keys[index]] = values[index]
82
+ end
83
+
84
+ service.options = {:plan_option => plan_option}
85
+ end
86
+
75
87
  with_progress("Creating service #{c(service.name, :name)}") do
76
88
  service.create!
77
89
  end
@@ -102,6 +114,17 @@ module VMC::Service
102
114
  ask "Name?", :default => "#{offering.label}-#{random}"
103
115
  end
104
116
 
117
+ def ask_options(offering)
118
+ begin
119
+ keys = ask "Option keys? (with out empty space)" , :default => "host,name,passwd"
120
+ keys = keys.sub(" ","").split(",")
121
+ values = ask "Option values? (with out empty space)" , :default => "127.0.0.1,service_name,service_passwd"
122
+ values = values.sub(" ","").split(",")
123
+ err "Keys and Values are not correct. input again.\n" if keys.length != values.length
124
+ end while keys.length != values.length
125
+ return keys, values
126
+ end
127
+
105
128
  def ask_plan(plans, default_plan = nil)
106
129
  ask "Which plan?",
107
130
  :choices => plans.sort_by(&:name),
data/lib/vmc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module VMC
2
- VERSION = "0.6.6".freeze
2
+ VERSION = "0.7.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloulu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SKPlanet Cloulu Team