megam_api 1.51.1 → 1.51.2

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: c2afc461d43099c104e1cd1813fdd26cff88e711
4
- data.tar.gz: ca93548ae3234452ce409a6541b54a53b2bfd580
3
+ metadata.gz: e8108e8ffae469db22fcae29c263284f063f3dc2
4
+ data.tar.gz: fd581139ef609f19a59b823bc90b16e2df7f0faf
5
5
  SHA512:
6
- metadata.gz: '0359c16ed5d6548b715aea6b227793cecba4926be466d89ef03f5fe7410d3efe5ed091fe4ec1b52692b3caecb33853234071aae81484532256f75bb8750cea52'
7
- data.tar.gz: fb5f6d8eb09058a76ae69ee7ca53f57fa94f8c5e2b39096089e463db313b861921ef6e722227a262d4796f7201c945ded88f2ab8607ab0d7b991f1eaa2bb40a6
6
+ metadata.gz: b7ed44caa61e520e1799b6eb3bc13c67e0d67af81a7e1b1572c76782ade7a277f16bab424f1dd243c8501e4b643b4618a761b8849345b4bd506e139127ea4f35
7
+ data.tar.gz: 783517922a53d514a0b5df8630aad917f5e1be082c547c0510a4ed9ae5dce56803e773d88d1faa61a279c4fe3c47fd5085db3abca4f337df5aee7c75a4ece8e8
@@ -1,5 +1,5 @@
1
1
  module Megam
2
2
  class API
3
- VERSION = "1.51.1"
3
+ VERSION = "1.51.2"
4
4
  end
5
5
  end
@@ -6,6 +6,9 @@ module Megam
6
6
  class Mixins
7
7
  class Assembly
8
8
  attr_reader :id, :name, :components, :policies, :outputs, :envs, :mixins
9
+ DEFAULT_VERTICE_PREFIX = 'vertice'.freeze
10
+ DEFAULT_DOCKER_PREFIX = 'docker'.freeze
11
+ TORPEDO = 'TORPEDO'.freeze
9
12
  def initialize(params)
10
13
  params = Hash[params.map { |k, v| [k.to_sym, v] }]
11
14
  @id = params[:id] || params[:assemblyID] || ''
@@ -13,6 +16,7 @@ module Megam
13
16
  @mixins = CommonDeployable.new(params)
14
17
  @outputs = Outputs.new(params)
15
18
  @components = add_components(params)
19
+ @tosca_type = add_assembly_tosca_type(params)
16
20
  @policies = []
17
21
  end
18
22
 
@@ -23,6 +27,7 @@ module Megam
23
27
  result[:components] = @components if @components
24
28
  result[:outputs] = @outputs.to_array if @outputs
25
29
  result[:policies] = @policies if @policies
30
+ result[:tosca_type] = @tosca_type if @tosca_type
26
31
  result
27
32
  end
28
33
 
@@ -40,6 +45,15 @@ module Megam
40
45
  @components = []
41
46
  end
42
47
  end
48
+
49
+ def add_assembly_tosca_type(params)
50
+ if params[:scm_name] == DEFAULT_DOCKER_PREFIX
51
+ @tosca_type = params[:scm_name] + ".#{TORPEDO.downcase}.#{params[:os_name].downcase}" if params[:os_name] != nil
52
+ else
53
+ @tosca_type = DEFAULT_VERTICE_PREFIX + ".#{TORPEDO.downcase}.#{params[:os_name].downcase}" if params[:os_name] != nil
54
+ end
55
+ end
56
+
43
57
  end
44
58
  end
45
59
  end
@@ -4,14 +4,8 @@ module Megam
4
4
  class Mixins
5
5
  class CommonDeployable
6
6
  include Nilavu::MegamAttributes
7
- attr_reader :status, :state, :inputs, :tosca_type
8
-
9
- DEFAULT_VERTICE_PREFIX = 'vertice'.freeze
10
- DEFAULT_BITNAMI_PREFIX = 'bitnami'.freeze
11
- DEFAULT_DOCKER_PREFIX = 'docker'.freeze
12
-
7
+ attr_reader :status, :state, :inputs
13
8
  ATTRIBUTES = [
14
- :tosca_type,
15
9
  :status,
16
10
  :state,
17
11
  :inputs]
@@ -21,10 +15,8 @@ module Megam
21
15
  end
22
16
 
23
17
  def initialize(params)
24
- @tosca_type = ''
25
18
  @status = 'initialized'
26
19
  @state = 'initialized'
27
- bld_toscatype(params)
28
20
  set_attributes(params)
29
21
  @inputs = InputGroupData.new(params)
30
22
 
@@ -34,22 +26,9 @@ module Megam
34
26
  h = {
35
27
  status: status,
36
28
  state: state,
37
- tosca_type: tosca_type,
38
29
  inputs: inputs.to_hash
39
30
  }
40
31
  end
41
-
42
- def bld_toscatype(params)
43
- case params[:scm_name]
44
- when DEFAULT_BITNAMI_PREFIX
45
- @tosca_type = DEFAULT_BITNAMI_PREFIX + ".#{params[:cattype].downcase}.#{params[:mkp_name].downcase}" if params[:cattype] != nil && params[:mkp_name] != nil
46
- when DEFAULT_DOCKER_PREFIX
47
- @tosca_type = DEFAULT_DOCKER_PREFIX + ".#{params[:cattype].downcase}.#{params[:mkp_name].downcase}" if params[:cattype] != nil && params[:mkp_name] != nil
48
- else
49
- @tosca_type = DEFAULT_VERTICE_PREFIX + ".#{params[:cattype].downcase}.#{params[:mkp_name].downcase}" if params[:cattype] != nil && params[:mkp_name] != nil
50
- end
51
-
52
- end
53
32
  end
54
33
 
55
34
  class InputGroupData
@@ -92,7 +71,7 @@ module Megam
92
71
  :vm_ram_cost_per_hour,
93
72
  :vm_disk_cost_per_hour,
94
73
  :container_cpu_cost_per_hour,
95
- :container_memory_cost_per_hour]
74
+ :container_memory_cost_per_hour]
96
75
 
97
76
  def attributes
98
77
  ATTRIBUTES
@@ -5,7 +5,8 @@ require File.expand_path("#{File.dirname(__FILE__)}/outputs")
5
5
  module Megam
6
6
  class Mixins
7
7
  class Components
8
- attr_reader :mixins, :name, :repo, :related_components, :operations, :artifacts, :envs, :outputs, :id
8
+ attr_reader :mixins, :name, :repo, :related_components, :operations, :artifacts, :envs, :outputs, :id, :tosca_type
9
+ DEFAULT_VERTICE_PREFIX = 'vertice'.freeze
9
10
  def initialize(params)
10
11
  @mixins = CommonDeployable.new(params)
11
12
  @id = params[:id] if params[:id]
@@ -16,6 +17,7 @@ module Megam
16
17
  @artifacts = add_artifacts(params)
17
18
  @repo = add_repo(params)
18
19
  @envs = params[:envs]
20
+ @tosca_type = add_components_tosca_type(params)
19
21
  end
20
22
 
21
23
  def to_hash
@@ -28,6 +30,7 @@ module Megam
28
30
  result[:outputs] = @outputs.to_array if @outputs
29
31
  result[:related_components] = @related_components if @related_components
30
32
  result[:envs] = @envs if @envs
33
+ result[:tosca_type] = @tosca_type if @tosca_type
31
34
  result.to_hash
32
35
  end
33
36
 
@@ -60,6 +63,15 @@ module Megam
60
63
  def add_artifacts(params)
61
64
  Artifacts.new(params).tohash
62
65
  end
66
+
67
+ def add_components_tosca_type(params)
68
+ if params[:scm_name] !=nil
69
+ @tosca_type = params[:scm_name] + ".#{params[:cattype].downcase}.#{params[:mkp_name].downcase}" if params[:cattype] != nil && params[:mkp_name] != nil
70
+ else
71
+ @tosca_type = DEFAULT_VERTICE_PREFIX + ".#{params[:cattype].downcase}.#{params[:mkp_name].downcase}" if params[:cattype] != nil && params[:mkp_name] != nil
72
+ end
73
+ end
74
+
63
75
  end
64
76
 
65
77
  class Repo
@@ -70,7 +82,7 @@ module Megam
70
82
  :source,
71
83
  :oneclick,
72
84
  :url,
73
- :branch]
85
+ :branch]
74
86
 
75
87
  def attributes
76
88
  ATTRIBUTES
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: megam_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.51.1
4
+ version: 1.51.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajthilak, Kishorekumar Neelamegam, Ranjitha R, Vinodhini V, Rathish VBR, Rajesh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-03-07 00:00:00.000000000 Z
12
+ date: 2017-03-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: excon