diff options
Diffstat (limited to 'azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar')
8 files changed, 845 insertions, 0 deletions
diff --git a/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/inputs.yaml b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/inputs.yaml new file mode 100644 index 0000000..37ab9ea --- /dev/null +++ b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/inputs.yaml @@ -0,0 +1,3 @@ +openstack_credential: + user: username + token: password diff --git a/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/node-cellar.yaml b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/node-cellar.yaml new file mode 100644 index 0000000..260f0bf --- /dev/null +++ b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/node-cellar.yaml @@ -0,0 +1,357 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NFV is not used here, but we are using it just to validate the imports +tosca_definitions_version: tosca_simple_profile_for_nfv_1_0 +#tosca_definitions_version: tosca_simple_yaml_1_0 + +description: >- + Node Cellar TOSCA blueprint. + Here is some Unicode: 中國. + +metadata: + template_name: node-cellar + template_author: ARIA + template_version: '1.0.0' + aria_version: '0.0' + +imports: + - types/openstack.yaml + - types/nodejs.yaml + - types/mongodb.yaml + - types/nginx.yaml + - aria-1.0 + +dsl_definitions: + + default_openstack_credential: &DEFAULT_OPENSTACK_CREDENTIAL + user: openstackadmin + token: { concat: [ openstack, 123 ] } + +repositories: + + node_cellar: + description: >- + The repository for the Node Cellar application and its dependencies. + url: https://github.com/ccoenraets/nodecellar/archive/ + credential: + user: guest + token: '' + +interface_types: + + Maintenance: + derived_from: tosca.interfaces.Root + inputs: + mode: + type: string + default: immediate + constraints: + - valid_values: [ immediate, eventual ] + description: >- + The mode in which maintenance mode is enabled/disabled. + enable: + description: >- + Enable maintenance mode. + disable: + description: >- + Disable maintenance mode. + +node_types: + + NodeMongoApplication: + derived_from: nodejs.Application + interfaces: + Maintenance: + type: Maintenance + requirements: + - database: + capability: tosca.capabilities.Endpoint.Database + node: mongodb.Database + +topology_template: + + inputs: + openstack_credential: + type: openstack.Credential + value: *DEFAULT_OPENSTACK_CREDENTIAL + + node_templates: + + # Application + + node_cellar: + description: >- + Node Cellar Node.js web application. + type: NodeMongoApplication + artifacts: + node_cellar: + description: >- + The Node Cellar application package. + type: os.Archive + file: master.zip + repository: node_cellar + deploy_path: /opt/nodejs/applications/node-cellar + properties: + unpack_credential: + user: gigaspaces + token: { get_attribute: [ SELF, tosca_id ] } + #token: { get_property: [ SELF, app_endpoint, protocol ] } + #token: { get_property: [ HOST, flavor_name ] } + #token: { token: [ { get_property: [ HOST, flavor_name ] }, '.', 1 ] } + #token: { token: [ 'zero.one|two-three', '.|-', 3 ] } + interfaces: + Maintenance: + inputs: + mode: eventual + enable: maintenance_node_cellar.sh + disable: maintenance_node_cellar.sh + Standard: + create: + implementation: + primary: create_node_cellar.sh + dependencies: + - "process.args.1 > { get_attribute: [ SELF, tosca_id ] }" + - "process.args.2 > { get_property: [ HOST, flavor_name ] }" + - ssh.user > admin + - ssh.password > '1234' + - ssh.use_sudo > true + requirements: + - database: node_cellar_database + capabilities: + app_endpoint: + properties: + protocol: udp + url_path: /nodecellar + + node_cellar_database: + description: >- + Node Cellar MongoDB database. + type: mongodb.Database + properties: + name: node_cellar + artifacts: + initial: + description: >- + The Node Cellar initial database. + type: mongodb.DatabaseDump + file: node-cellar.json + repository: node_cellar + + # Server software + + nodejs: + description: >- + Node.js instance. + type: nodejs.Server + requirements: + - host: application_host + capabilities: + data_endpoint: + properties: + url_path: /app + node_filter: # cannot be validated + properties: + #- flavor_name: { valid_values: [ {concat:[m1,.,small]} ] } # won't work because not validated :/ + - flavor_name: { valid_values: [ m1.small ] } + capabilities: + - scalable: + properties: + - max_instances: { greater_or_equal: 5 } + + mongodb: + description: >- + MongoDB instance. + type: mongodb.Server + requirements: + - host: + node: openstack.Instance + node_filter: + properties: + - flavor_name: { valid_values: [ m1.medium, { concat: [ { concat: [ m1, . ] }, large ] } ] } + #- flavor_name: { valid_values: [ m1.medium, m1.large ] } + capabilities: + - scalable: + properties: + - max_instances: { greater_or_equal: 5 } + relationship: + interfaces: + Configure: + target_changed: changed.sh + + nginx: + type: nginx.Nginx + requirements: + - host: loadbalancer_host + - feature: loadbalancer + + # Features + + loadbalancer: + type: nginx.LoadBalancer + properties: + algorithm: round-robin + + # Hosts + + loadbalancer_host: + description: >- + Host for the loadbalancer. + type: openstack.Instance + properties: + flavor_name: m1.small + os_users: # map of os.UserInfo + root: + password: admin123 + interfaces: + Standard: + inputs: + openstack_credential: { get_input: openstack_credential } + configure: + implementation: + primary: juju > run_charm + dependencies: + - charm > loadbalancer + + application_host: + copy: loadbalancer_host + description: >- + Host for applications. + properties: + flavor_name: m1.small + os_users: # map of os.UserInfo + nodejs: + password: nodejs123 + groups: + - www-data + capabilities: + scalable: + properties: + max_instances: 5 # overrides the policy + + data_host: + copy: loadbalancer_host + description: >- + Host for data. + properties: + flavor_name: m1.large + flavor_id: 5d62e82c-924e-4fa9-b1e4-c133867596f7 + os_users: # map of os.UserInfo + mongodb: + password: mongo123 + requirements: + - local_storage: + node: data_volume + relationship: + properties: + location: /mnt/volume + capabilities: + scalable: + properties: + max_instances: 6 # overrides the policy + + data_volume: + type: openstack.Volume + properties: + size: 10 GB + interfaces: + Standard: + inputs: + openstack_credential: { get_input: openstack_credential } + create: create_data_volume.sh + + groups: + + node_cellar_group: + type: openstack.Secured + members: + - loadbalancer + - application_host + - data_host + interfaces: + Standard: + inputs: + openstack_credential: { get_input: openstack_credential } + + policies: + + app_scaling: + type: aria.Scaling + properties: + max_instances: 10 + default_instances: 2 + targets: + - node_cellar + - nodejs + + host_scaling: + type: openstack.Scaling + properties: + bandwidth_threshold: 2 GB + max_instances: 10 + default_instances: 2 + targets: # node templates or groups + - node_cellar_group + + juju: + description: >- + Juju plugin executes charms. + type: aria.Plugin + properties: + version: 1.0 + enabled: false + + maintenance_on: + type: MaintenanceWorkflow + properties: + enabled: true + + maintenance_off: + type: MaintenanceWorkflow + properties: + enabled: false + + substitution_mappings: + + node_type: tosca.nodes.WebApplication + requirements: + host: [ node_cellar, host ] # doesn't really make sense; just for testing + capabilities: + app_endpoint: [ loadbalancer, client ] + + outputs: + + endpoint: + description: >- + The application endpoint. + type: string + value: { get_property: [ nodejs, data_endpoint, url_path ] } + +policy_types: + + MaintenanceWorkflow: + description: >- + Workflow to put all nodes in/out of maintenance mode. For web servers, this will show a "this + site is under maintenance and we'll be back soon" web page. Database nodes will then close all + client connections cleanly and shut down services. + derived_from: aria.Workflow + properties: + implementation: + type: string + default: workflows.maintenance + enabled: + description: >- + Whether to turn maintenance mode on or off. + type: boolean diff --git a/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/mongodb.yaml b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/mongodb.yaml new file mode 100644 index 0000000..7031252 --- /dev/null +++ b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/mongodb.yaml @@ -0,0 +1,72 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +imports: + - os.yaml + +node_types: + + mongodb.Server: + description: >- + MongoDB server application. + derived_from: tosca.nodes.DBMS + properties: + root_password: # @override + type: string + default: admin + port: # @override + type: integer + default: 27017 + artifacts: + mongodb: + description: >- + MongoDB application package. + type: os.Archive + file: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-3.2.8.tgz + deploy_path: /opt/mongodb + capabilities: + host: # @override + type: tosca.capabilities.Container + valid_source_types: [ mongodb.Database ] + + mongodb.Database: + description: >- + MongoDB database. + + Supports importing database data if a mongodb.DatabaseDump is provided. + derived_from: tosca.nodes.Database + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + create: + implementation: + primary: mongodb/create_and_import_database.sh + dependencies: + - mongodb/utils/api.sh + - utils/os.sh + requirements: + - host: # @override + capability: tosca.capabilities.Container + node: mongodb.Server + relationship: tosca.relationships.HostedOn + +artifact_types: + + mongodb.DatabaseDump: + description: >- + Dump of a MongoDB database. + derived_from: tosca.artifacts.Root + file_ext: + - json diff --git a/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/nginx.yaml b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/nginx.yaml new file mode 100644 index 0000000..3621360 --- /dev/null +++ b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/nginx.yaml @@ -0,0 +1,29 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +node_types: + + nginx.Nginx: + description: >- + Nginx instance. + derived_from: tosca.nodes.SoftwareComponent + requirements: + - feature: + capability: tosca.capabilities.Node + + nginx.LoadBalancer: + description: >- + Nginx loadbalancer feature. + derived_from: tosca.nodes.LoadBalancer diff --git a/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/nodejs.yaml b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/nodejs.yaml new file mode 100644 index 0000000..2b4d451 --- /dev/null +++ b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/nodejs.yaml @@ -0,0 +1,69 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +imports: + - os.yaml + +node_types: + + nodejs.Server: + description: >- + Node.js server application. + derived_from: tosca.nodes.WebServer + artifacts: + nodejs: + description: >- + Node.js application package. + type: os.Archive + file: https://nodejs.org/dist/v4.4.7/node-v4.4.7-linux-x64.tar.xz + deploy_path: /opt/nodejs + capabilities: + data_endpoint: # @override + type: tosca.capabilities.Endpoint + properties: + port: + type: tosca.datatypes.network.PortDef + default: 8080 + url_path: + type: string + default: / + admin_endpoint: # @override + type: tosca.capabilities.Endpoint.Admin + properties: + port: + type: tosca.datatypes.network.PortDef + default: 8080 + url_path: + type: string + default: /admin + host: # @override + type: tosca.capabilities.Container + valid_source_types: [ nodejs.Application ] + occurrences: [ 0, 1 ] + + nodejs.Application: + derived_from: tosca.nodes.WebApplication + capabilities: + app_endpoint: # @override + type: tosca.capabilities.Endpoint + properties: + port: + type: tosca.datatypes.network.PortDef + default: 8080 + requirements: + - host: # @override + capability: tosca.capabilities.Container + node: nodejs.Server + relationship: tosca.relationships.HostedOn diff --git a/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/openstack.yaml b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/openstack.yaml new file mode 100644 index 0000000..6941c1a --- /dev/null +++ b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/openstack.yaml @@ -0,0 +1,201 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +imports: + - os.yaml + - aria-1.0 + +dsl_definitions: + + openstack: + uuid_constraints: &OPENSTACK_UUID_CONSTRAINTS + - pattern: '^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$' + +node_types: + + openstack.Instance: + description: >- + OpenStack instance. + + You may assign an image_id or attach an openstack.Image artifact (the artifact + will take precedence). + + You may assign either flavor_id or flavor_name (flavor_id will take precedence). + If neither are assigned, flavor_name has a default value. + derived_from: tosca.nodes.Compute + properties: + image_id: + description: >- + See: https://s3itwiki.uzh.ch/display/clouddoc/Supported+Images + type: openstack.UUID + default: 5d62e82c-924e-4fa9-b1e4-c133867596f7 + flavor_id: + type: openstack.UUID + required: false + flavor_name: + type: string + default: m1.medium + required: false + availability_zone: + description: >- + OpenStack availability zone. + type: string + required: false + os_users: + type: map + entry_schema: os.UserInfo + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + inputs: + openstack_credential: + description: The OpenStack API credential for all operations. + type: openstack.Credential + create: + implementation: + primary: openstack/create_instance.sh + dependencies: + - openstack/utils/api.sh + - utils/os.sh + requirements: + - local_storage: # @override + capability: tosca.capabilities.Attachment + node: openstack.Volume + relationship: tosca.relationships.AttachesTo +# relationship: +# type: tosca.relationships.AttachesTo +# interfaces: +# Standard: +# inputs: +# xxx: +# type: string +# default: { concat: [ a, b ] } + occurrences: [ 0, UNBOUNDED ] + + openstack.Volume: + description: >- + OpenStack volume. + + See: http://developer.openstack.org/api-ref-blockstorage-v2.html + derived_from: tosca.nodes.BlockStorage + properties: + tenant_id: + type: openstack.UUID + required: false + availability_zone: + type: string + required: false + source_volid: + type: openstack.UUID + required: false + description: + type: string + required: false + multiattach: + type: boolean + default: false + #snapshot_id: # @override + # type: openstack.UUID + # required: false + name: + type: string + required: false + volume_type: + type: string + required: false + metadata: + type: map + entry_schema: string + required: false + source_replica: + type: openstack.UUID + required: false + consistencygroup_id: + type: openstack.UUID + required: false + scheduler_hints: + type: map + entry_schema: string + required: false + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + inputs: + openstack_credential: + description: The OpenStack API credential for all operations. + type: openstack.Credential + create: + implementation: + primary: openstack/create_volume.sh + dependencies: + - openstack/utils/api.sh + - utils/os.sh + +group_types: + + openstack.Secured: + description: >- + OpenStack secured group. + derived_from: tosca.groups.Root + members: + - openstack.Instance + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + inputs: + openstack_credential: + description: The OpenStack API credential for all operations. + type: openstack.Credential + create: + implementation: + primary: openstack/create_secured_group.sh + dependencies: + - openstack/utils/api.sh + - utils/os.sh + +policy_types: + + openstack.Scaling: + description: >- + OpenStack scaling policy. + derived_from: aria.Scaling + properties: + bandwidth_threshold: + type: scalar-unit.size + default: 1 GB + targets: + - openstack.Instance + - openstack.Secured + +data_types: + + openstack.Credential: + derived_from: tosca.datatypes.Credential + + openstack.UUID: + description: >- + OpenStack UUID (in GUID format). + derived_from: string + constraints: *OPENSTACK_UUID_CONSTRAINTS + +artifact_types: + + openstack.Image: + description: >- + OpenStack image artifact. + derived_from: tosca.artifacts.Deployment.Image.VM + file_ext: + - img + - iso diff --git a/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/os.yaml b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/os.yaml new file mode 100644 index 0000000..adc6363 --- /dev/null +++ b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/types/os.yaml @@ -0,0 +1,74 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +dsl_definitions: + + os: + user_and_group_name_constraints: &OS_USER_AND_GROUP_NAME_CONSTRAINTS + - pattern: '^[a-z0-9_-]{3,16}$' + password_constraints: &OS_PASSWORD_CONSTRAINTS + - pattern: '^[a-z0-9_-]{6,18}$' + +artifact_types: + + os.Package: + description: >- + Generic application package. + derived_from: tosca.artifacts.Root + + os.Archive: + description: >- + Application package in an archive. + derived_from: os.Package + file_ext: + - zip + - tar + - tar.gz + - tar.xz + properties: + unpack_credential: + type: tosca.datatypes.Credential + required: false + + os.Deb: + description: >- + Debian application package. + derived_from: os.Package + file_ext: + - deb + + os.RPM: + description: >- + RPM application package. + derived_from: os.Package + file_ext: + - rpm + +data_types: + + os.UserInfo: + description: >- + Information about an operating system user. + derived_from: tosca.datatypes.Root + properties: + password: + type: string + constraints: *OS_PASSWORD_CONSTRAINTS + groups: + type: list + entry_schema: + type: string + constraints: *OS_USER_AND_GROUP_NAME_CONSTRAINTS + required: false diff --git a/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/workflows.py b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/workflows.py new file mode 100644 index 0000000..fdca65d --- /dev/null +++ b/azure/aria/aria-extension-cloudify/src/aria/tests/resources/service-templates/tosca-simple-1.0/node-cellar/workflows.py @@ -0,0 +1,40 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +from aria import workflow +from aria.orchestrator.workflows.api import task +from aria.orchestrator.workflows.exceptions import TaskException + + +INTERFACE_NAME = 'Maintenance' +ENABLE_OPERATION_NAME = 'enable' +DISABLE_OPERATION_NAME = 'disable' + + +@workflow +def maintenance(ctx, graph, enabled): + """ + Custom workflow to call the operations on the Maintenance interface. + """ + + for node in ctx.model.node.iter(): + try: + graph.add_tasks(task.OperationTask(node, + interface_name=INTERFACE_NAME, + operation_name=ENABLE_OPERATION_NAME if enabled + else DISABLE_OPERATION_NAME)) + except TaskException: + pass |