CORD-3162 Get public networking working

Change-Id: If8376c07b52da7764cbe328eb6bb05693dd74b01
diff --git a/xos-profiles/demo-exampleservice/requirements.yaml b/xos-profiles/demo-exampleservice/requirements.yaml
index b398892..1db6f54 100644
--- a/xos-profiles/demo-exampleservice/requirements.yaml
+++ b/xos-profiles/demo-exampleservice/requirements.yaml
@@ -18,3 +18,6 @@
 - name: exampleservice
   version: 0.1.0
   repository: file://../../xos-services/exampleservice
+- name: addressmanager
+  version: 0.1.0
+  repository: file://../../xos-services/addressmanager
diff --git a/xos-profiles/demo-exampleservice/templates/_tosca.tpl b/xos-profiles/demo-exampleservice/templates/_tosca.tpl
index 7747670..66c3279 100644
--- a/xos-profiles/demo-exampleservice/templates/_tosca.tpl
+++ b/xos-profiles/demo-exampleservice/templates/_tosca.tpl
@@ -18,8 +18,12 @@
 tosca_definitions_version: tosca_simple_yaml_1_0
 description: Setup public network
 imports:
+  - custom_types/addressmanagerservice.yaml
+  - custom_types/addressmanagerserviceinstance.yaml
+  - custom_types/addresspool.yaml
   - custom_types/networktemplate.yaml
   - custom_types/network.yaml
+  - custom_types/serviceinstancelink.yaml
   - custom_types/site.yaml
   - custom_types/slice.yaml
 topology_template:
@@ -64,4 +68,44 @@
         - owner:
             node: public_networking_slice
             relationship: tosca.relationships.BelongsToOne
+
+    service#addressmanager:
+      type: tosca.nodes.AddressManagerService
+      properties:
+        name: addressmanager
+
+    addresses_public:
+      type: tosca.nodes.AddressPool
+      properties:
+        name: addresses_public
+        addresses: {{ .Values.addresspool_public_cidr }}
+        gateway_ip: {{ .Values.addresspool_public_gateway_ip }}
+        gateway_mac:  {{ .Values.addresspool_public_gateway_mac }}
+      requirements:
+        - service:
+            node: service#addressmanager
+            relationship: tosca.relationships.BelongsToOne
+
+    AddressManagerServiceInstancePublicNetwork:
+      type: tosca.nodes.AddressManagerServiceInstance
+      requirements:
+        - owner:
+            node: service#addressmanager
+            relationship: tosca.relationships.BelongsToOne
+        - address_pool:
+            node: addresses_public
+            relationship: tosca.relationships.BelongsToOne
+      properties:
+        name: AM_public_net
+
+    public_to_address_manager:
+      type: tosca.nodes.ServiceInstanceLink
+      requirements:
+        - provider_service_instance:
+            node: AddressManagerServiceInstancePublicNetwork
+            relationship: tosca.relationships.BelongsToOne
+        - subscriber_network:
+            node: public
+            relationship: tosca.relationships.BelongsToOne
+
 {{- end -}}
diff --git a/xos-profiles/demo-exampleservice/values.yaml b/xos-profiles/demo-exampleservice/values.yaml
index a9fc768..59fc79f 100644
--- a/xos-profiles/demo-exampleservice/values.yaml
+++ b/xos-profiles/demo-exampleservice/values.yaml
@@ -33,6 +33,8 @@
 cordDeploymentName: "mydeployment"
 
 addresspool_public_cidr: "10.8.1.0/24"
+addresspool_public_gateway_ip: "10.8.1.1"
+addresspool_public_gateway_mac: "a4:23:05:06:01:01"
 
 global:
   proxySshEnabled: true