-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathturing-blueprint.yaml
142 lines (126 loc) · 4.08 KB
/
turing-blueprint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
tosca_definitions_version: cloudify_dsl_1_3
imports:
- types/turing-yttc-generated.yaml
inputs:
netconf_ip:
type: string
description: >
netconf server ip
default: 127.0.0.1
netconf_user:
type: string
description: >
netconf server user
default: netconf
netconf_password:
type: string
description: >
netconf server user password
default: netconf
netconf_key_content:
type: string
description: >
netconf server user rsa key content, can be used instead password
default: ""
node_templates:
turing-machine-update-config-impl:
type: turing-machine
properties:
netconf_auth:
user: { get_input: netconf_user }
password: { get_input: netconf_user }
ip: { get_input: netconf_ip }
key_content: { get_input: netconf_key_content }
rpc:
initialize:
tape-content: 101010101
rfc6020@get-config:
rfc6020@source:
rfc6020@running: {}
rfc6020@edit-config:
rfc6020@error-option: rollback-on-error
rfc6020@target:
rfc6020@running: {}
rfc6020@config:
turing@turing-machine:
turing@transition-function:
turing@delta:
- turing@label: 1
turing@input:
turing@symbol: 0
turing@state: 0
turing@output:
turing@symbol: {}
turing@state: 1
turing@head-move: right
- turing@label: 2
turing@input:
turing@symbol: 0
turing@state: 1
turing@output:
turing@symbol: 0
turing@state: 1
turing@head-move: right
interfaces:
cloudify.interfaces.lifecycle:
create:
inputs:
calls:
- action: rfc6020@get-config
payload: { get_property: [ turing-machine-update-config-impl, rfc6020@get-config ] }
# save all results to saved-config
save_to: saved-config
configure:
inputs:
calls:
- action: rfc6020@lock
payload:
target:
running: {}
- action: rfc6020@edit-config
payload: { get_property: [ turing-machine-update-config-impl, rfc6020@edit-config ] }
- action: rfc6020@unlock
payload:
target:
running: {}
start:
inputs:
calls:
- action: turing@initialize
payload: { get_property: [ turing-machine-update-config-impl, rpc, initialize ] }
turing-machine-run-impl:
type: turing-machine
properties:
netconf_auth: { get_property: [ turing-machine-update-config-impl, netconf_auth ] }
interfaces:
cloudify.interfaces.lifecycle:
create:
inputs:
calls:
- action: turing@run
payload: { get_property: [ turing-machine-run-impl, rpc, run ] }
configure:
inputs:
calls:
- action: rfc6020@get
# save all results to saved-config
save_to: new-config
payload:
source:
running: {}
filter:
_@@type: subtree
turing@turing-machine:
turing@transition-function: {}
relationships:
- type: cloudify.relationships.contained_in
target: turing-machine-update-config-impl
outputs:
config:
description: Last config
value:
config: { get_attribute: [ turing-machine-update-config-impl, saved-config ] }
#prefix ns - will be added automaticly
config_ns: { get_attribute: [ turing-machine-update-config-impl, saved-config_ns ] }
new-config: { get_attribute: [ turing-machine-run-impl, new-config ] }
new-config_ns: { get_attribute: [ turing-machine-run-impl, new-config_ns ] }