summaryrefslogtreecommitdiffstats
path: root/osdf/templates
diff options
context:
space:
mode:
authorAnkitkumar Patel <ankit@research.att.com>2018-02-11 17:51:13 -0500
committerAnkitkumar Patel <ankit@research.att.com>2018-02-11 17:52:51 -0500
commit0b855c08fd98fb8fa0f4bc40d8df430c897b4bad (patch)
treeefdd3c7ab31be64080dd71951a64d13f0ba493de /osdf/templates
parentbb8471cae394aa6ff0af8ba3e5354f3b121c56fc (diff)
Re-org folders, onboard test folder, test config
Reorganized the folder structure. Onboarded testcases. Added test config. Issue-ID: OPTFRA-74 Change-Id: I97882a162a405a18ffd287495039e15ae9d0ad7b Signed-off-by: Ankitkumar Patel <ankit@research.att.com>
Diffstat (limited to 'osdf/templates')
-rwxr-xr-xosdf/templates/cms_opt_request.jsont35
-rwxr-xr-xosdf/templates/cms_opt_request.jsont_1707_v167
-rwxr-xr-xosdf/templates/cms_opt_request_1702.jsont63
-rw-r--r--osdf/templates/cms_opt_response.jsont8
-rwxr-xr-xosdf/templates/conductor_interface.json81
-rw-r--r--osdf/templates/license_opt_request.jsont6
-rwxr-xr-xosdf/templates/plc_opt_request.jsont142
-rwxr-xr-xosdf/templates/plc_opt_response.jsont14
-rwxr-xr-xosdf/templates/policy_request.jsont3
-rwxr-xr-xosdf/templates/test_cms_nb_req_from_client.jsont19
-rwxr-xr-xosdf/templates/test_plc_nb_req_from_client.jsont52
11 files changed, 490 insertions, 0 deletions
diff --git a/osdf/templates/cms_opt_request.jsont b/osdf/templates/cms_opt_request.jsont
new file mode 100755
index 0000000..006562b
--- /dev/null
+++ b/osdf/templates/cms_opt_request.jsont
@@ -0,0 +1,35 @@
+{
+ "transaction_id": "{{ transaction_id }}",
+ "request_id": "{{ request_id }}",
+ "start_date" : "{{ start_time }}",
+ "end_date" : "{{ end_time }}",
+ "change_elements" : {{ json.dumps(change_elements) }},
+ "constraints" : [
+ {
+ "type" : "general_concurrency_limit",
+ "parameters": [{{ concurrency_limit }}]
+ },
+
+ {
+ "type" : "allowed_forbidden_periods",
+ "parameters" : {{ json.dumps(allowed_periods) }}
+ }
+
+ {% if spatial_conflicts is defined and spatial_conflicts|length > 0 %}
+ ,
+ {
+ "type" : "spatial_conflict",
+ "parameters": {{ json.dumps(spatial_conflicts) }}
+ }
+ {% endif %}
+
+
+ {% if critical_periods is defined and spatial_conflicts|length > 0 %}
+ ,
+ {
+ "type" : "critical_periods",
+ "parameters": {{ json.dumps(critical_periods) }}
+ }
+ {% endif %}
+ ]
+}
diff --git a/osdf/templates/cms_opt_request.jsont_1707_v1 b/osdf/templates/cms_opt_request.jsont_1707_v1
new file mode 100755
index 0000000..75ecbe5
--- /dev/null
+++ b/osdf/templates/cms_opt_request.jsont_1707_v1
@@ -0,0 +1,67 @@
+{
+ "transaction_id": "{{ transaction_id }}",
+ "request_id": "{{ request_id }}",
+ "start_date" : "{{ start_time }}",
+ "end_date" : "{{ end_time }}",
+
+ "change_elements" : [
+ {% set comma = joiner(",") -%}
+ {% for element in all_upgrades -%} {{ comma() }}
+ {
+ "id" : "{{ element.id }}",
+ "failback_duration": {{ element.failback_duration }},
+ {% if element.group_id -%}
+ "group_id": "{{ element.group_id }}",
+ {% endif %}
+ {% if element.scheduled_on -%}
+ "scheduled_on": "{{ element.scheduled_on }}",
+ {% endif %}
+ "duration": {{ element.duration }}
+ }
+ {% endfor -%}
+ ],
+
+ "constraints" : [
+ {
+ "type" : "general_concurrency_limit",
+ "parameters": [{{ concurrency_limit }}]
+ },
+
+ {
+ "type" : "allowed_forbidden_periods",
+ "parameters" : [
+ {% set comma = joiner(",") -%}
+ {% for idx in all_pending -%} {{ comma() }}
+ { "id" : "{{ idx.id }}",
+ "allowed_periods": [ {{ allowed_periods }}]
+ }
+ {% endfor -%}
+ ]
+ },
+ {
+ "type" : "spatial_conflict",
+ "parameters": [
+ {% set comma = joiner(",") -%}
+ {% for pserver, vce_list in vce_pserver_mapping.items() -%} {{ comma() }}
+ {
+ "spatial_entity": "{{ pserver }}",
+ "affected_entities": {{ vce_list }}
+ }
+ {% endfor -%}
+ ]
+ },
+
+ {
+ "type" : "critical_periods",
+ "parameters": [
+ {% set comma = joiner(",") -%}
+ {% for element, conflict_period in conflict_interval.items() -%} {{ comma() }}
+ {
+ "id" : "{{ element }}",
+ "periods": [{{ conflict_period }}]
+ }
+ {% endfor -%}
+ ]
+ }
+ ]
+}
diff --git a/osdf/templates/cms_opt_request_1702.jsont b/osdf/templates/cms_opt_request_1702.jsont
new file mode 100755
index 0000000..bcafa45
--- /dev/null
+++ b/osdf/templates/cms_opt_request_1702.jsont
@@ -0,0 +1,63 @@
+{
+ "request_id": "{{ request_id }}",
+ "startdate" : "{{ start_time }}",
+ "enddate" : "{{ end_time }}",
+
+ "change_elements" : [
+{% set comma = joiner(",") -%}
+{% for element in all_upgrades -%} {{ comma() }}
+ { "id" : "{{ element.id }}",
+ {% if element.scheduled -%} "scheduled_on": "{{ element.scheduled }}", {% endif -%}
+ "duration": {{ element.duration }}, {# duration in seconds #}
+ "failback_duration": {{ element.failback_duration }}, {# duration in seconds #}
+ "group_id": {{ element.group_id }}, {# duration in seconds #}
+ }{% endfor -%}
+ ],
+
+ "constraints" : [
+ {
+ "type" : "general_concurrency_limit",
+ "parameters" : [ {{ general_concurrency_limit }} ]
+ },
+
+ {
+ "type" : "allowed_forbidden_periods",
+ "parameters" : [
+{% set comma = joiner(",") -%}
+{% for idx in all_pending -%} {{ comma() }}
+ { "id" : "{{ idx.id }}",
+ "allowed_periods": [ {% set comma2 = joiner(",") -%}
+ {% for period in allowed_periods -%} {{ comma2() }} [{{ json.dumps(period[0]) }}, {{ json.dumps(period[1]) }}]
+ {% endfor -%} ] }{% endfor -%}
+ ]
+ }
+
+{% if p_v_conflict is defined and p_v_conflict|length > 0 %}
+ ,
+ {
+ "type" : "critical_periods",
+ "description" : "Simultaneous upgrades",
+ "parameters" : [
+{% set comma2 = joiner(",") -%}
+{% for element in p_v_conflict -%} {{ comma2() }}
+ {
+ "id" : "{{ element[0] }}",
+ "periods" : [{{ json.dumps(element[0]) }}, {{ json.dumps(element[1]) }}]
+ }
+{% endfor -%}
+{% endif %}
+
+{% for pserver, vce_group in grouped_vces.items() -%} {{ comma() }}
+ ,
+ {
+ "id" : "{{ pserver }}",
+ "name" : "VCE's on pserver {{ pserver }}",
+ "description": "Only some VCEs on a pserver can be upgraded at a time",
+ "max_num_upgrades" : {{ max_num_upgrades(vce_group) }},
+ "upgrades" : {{ json.dumps(vce_group) }}
+ }
+{% endfor -%}
+ ]
+ }
+ ]
+}
diff --git a/osdf/templates/cms_opt_response.jsont b/osdf/templates/cms_opt_response.jsont
new file mode 100644
index 0000000..a8817df
--- /dev/null
+++ b/osdf/templates/cms_opt_response.jsont
@@ -0,0 +1,8 @@
+{
+ "transactionId": "{{transaction_id}}",
+ "scheduleId":"{{schedule_id}}",
+ "requestState": "{{request_state}}",
+ "status": "{{status}}",
+ "description": "{{description}}",
+ "schedule": {{schedule}}
+} \ No newline at end of file
diff --git a/osdf/templates/conductor_interface.json b/osdf/templates/conductor_interface.json
new file mode 100755
index 0000000..2b48647
--- /dev/null
+++ b/osdf/templates/conductor_interface.json
@@ -0,0 +1,81 @@
+{
+ "name": "{{ name }}",
+ "files": {},
+ "timeout": {{ timeout }},
+ "limit": {{ limit }},
+ "template": {
+ "conductor_template_version": "2018-02-01",
+ "parameters": {
+ "REQUEST_TYPE": "{{ requestType }}",
+ "CHOSEN_REGION": "{{ chosenRegion }}",
+ "LATITUDE": "{{ latitude }}",
+ "LONGITUDE": "{{ longitude }}",
+ {% if serviceType == 'DHV' %}
+ "E2EVPNKEY": "{{ e2eVpnKey }}",
+ "UCPEHOST": "{{ ucpeHostName }}",
+ "EFFECTIVE_BANDWIDTH": "{{ effectiveBandwidth }}",
+ "WAN_PORT1_UP": "{{ ipsec_bw_up }}",
+ "WAN_PORT1_DOWN": "{{ ipsec_bw_down }}",
+ "WAN_PORT2_UP": "{{ ipsec2_bw_up }}",
+ "WAN_PORT2_DOWN": "{{ ipsec2_bw_down }}",
+ {% endif %}
+ {% if serviceType != 'DHV' %}
+ "GW_TENANT_ID": "{{ gwTenantId }}",
+ "PORTAL_TENANT_ID": "{{ portalTenantId }}",
+ {% endif %}
+ "CHOSEN_COMPLEX": "{{ chosenComplex }}",
+ {% if serviceType == 'ADIOD' or serviceType == 'VPE' %}
+ "BANDWIDTH": "{{ bandwidth }}",
+ "UNIT": "{{ bandwidth_unit }}",
+ {% endif %}
+ "SERVICE_INST": "{{ serviceInstance }}",
+ "PROV_STATUS": {{ json.dumps(provStatus) }}
+ },
+ "locations": {
+ {% if serviceType == 'DHV' %}
+ "customer_loc": {
+ "host_name": { "get_param": "UCPEHOST" }
+ }
+ {% elif serviceType == 'ADIOD' %}
+ "customer_pref_location": {
+ "clli_code": { "get_param": "CHOSEN_COMPLEX" }
+ }
+ {% elif serviceType == 'NETBOND' %}
+ "peering_point": {
+ "latitude": { "get_param": "LATITUDE" },
+ "longitude": { "get_param": "LONGITUDE" }
+ }
+ {% else %}
+ "customer_pref_loc": {
+ "clli_code": { "get_param": "CHOSEN_COMPLEX" }
+ }
+ {% endif %}
+ },
+ "demands": {{ json.dumps(demand_list) }},
+ {% set comma_main = joiner(",") %}
+ "constraints": {
+ {% set comma=joiner(",") %}
+ {% for elem in policy_groups %} {{ comma() }}
+ {% for key, value in elem.items() %}
+ "{{key}}": {{ json.dumps(value) }}
+ {% endfor %}
+ {% endfor %}
+ },
+ "reservation": {
+ {% set comma=joiner(",") %}
+ {% for elem in reservation_groups %} {{ comma() }}
+ {% for key, value in elem.items() %}
+ "{{key}}": {{ json.dumps(value) }}
+ {% endfor %}
+ {% endfor %}
+ },
+ "optimization": {
+ {% set comma=joiner(",") %}
+ {% for elem in optimization_policies %} {{ comma() }}
+ {% for key, value in elem.items() %}
+ "{{key}}": {{ json.dumps(value) }}
+ {% endfor %}
+ {% endfor %}
+ }
+ }
+} \ No newline at end of file
diff --git a/osdf/templates/license_opt_request.jsont b/osdf/templates/license_opt_request.jsont
new file mode 100644
index 0000000..7baa759
--- /dev/null
+++ b/osdf/templates/license_opt_request.jsont
@@ -0,0 +1,6 @@
+{
+ "transactionId": "{{transaction_id}}",
+ "requestId": "{{request_id}}",
+ "partNumber": "{{part_number}}",
+ "licenseModel" : "{{artifact}}"
+} \ No newline at end of file
diff --git a/osdf/templates/plc_opt_request.jsont b/osdf/templates/plc_opt_request.jsont
new file mode 100755
index 0000000..cd78b3e
--- /dev/null
+++ b/osdf/templates/plc_opt_request.jsont
@@ -0,0 +1,142 @@
+{
+ "name": "{{ name }}",
+ "files": "{{ files }}",
+ "timeout": "{{ timeout }}",
+ "limit": "{{ limit }}",
+ "template": {
+ "CUST_ID": "{{ cust_id }}",
+ "E2EVPNKEY": "{{ e2evpnkey }}",
+ "UCPEHOST": "{{ ucpehost }}",
+ "WAN_PORT1_UP": "{{ wan_port1_up }}",
+ "WAN_PORT1_DOWN": "{{ wan_port1_down }}",
+ "EFFECTIVE_BANDWIDTH": "{{ effective_bandwidth }}",
+ "SERVICE_INST": "{{ service_inst }}",
+ "locations": {
+ "customer_loc": {
+ "host_name": "{{ ucpehost }}"
+ }
+ },
+ "demands": [
+ {% set comma=joiner(",") %}
+ {% for demand in demand_list %} {{ comma() }}
+ {
+ "{{ demand.vnf_name }}": [
+ {% set comma2=joiner(",") %}
+ {% for property in demand.property %}
+ "inventory_provider": {{ property.inventory_provider }},
+ "inventory_type": {{ property.inventory_type }},
+ "service_type": {{ property.service_type }},
+ "customer_id": {{ property.customer_id }},
+ "candidate_id": {{ property.candidate_id }}
+ {% endfor %}
+ ]
+ }
+ {% endfor %}
+ ],
+ "constraints": {
+ {% set comma_main=joiner(",") %}
+
+ {% if attribute_policy_list %} {{ comma_main() }} {% endif %}
+ {% set comma=joiner(",") %}
+ {% for attribute in attribute_policy_list %} {{ comma() }}
+ attribute['identity'] : {
+ "type": {{ attribute['type'] }},
+ "demands": {{ attribute['demands'] }},
+ "properties": {
+ "evaluate": {
+ "hypervisor": {{ attribute['property']['hypervisor'] }},
+ "aic_version": {{ attribute['property']['aicVersion'] }},
+ "aic_type": {{ attribute['property']['aicType'] }},
+ "dataplane": {{ attribute['property']['datatype'] }},
+ "network_roles": {{ attribute['property']['networkRoles'] }},
+ "complex": {{ attribute['property']['complex'] }}
+ }
+ }
+ }
+ {% endfor %}
+
+ {% if distance_to_location_policy_list %} {{ comma_main() }} {% endif %}
+ {% set comma=joiner(",") %}
+ {% for distance_location in distance_to_location_policy_list %} {{ comma() }}
+ distance_location['identity'] : {
+ "type": {{ distance_location['type'] }},
+ "demands": {{ distance_location['demands'] }},
+ "properties": {
+ "distance": {{ distance_location['property']['distance'] }},
+ "location": {{ distance_location['property']['location'] }}
+ }
+ }
+ {% endfor %}
+
+ {% if inventory_policy_list %} {{ comma_main() }} {% endif %}
+ {% set comma=joiner(",") %}
+ {% for inventory in inventory_policy_list %} {{ comma() }}
+ inventory['identity'] : {
+ "type": {{ inventory['type'] }},
+ "demands": {{ inventory['demands'] }}
+ }
+ {% endfor %}
+
+ {% if resource_instance_policy_list %} {{ comma_main() }} {% endif %}
+ {% set comma=joiner(",") %}
+ {% for resource_instance in resource_instance_policy_list %} {{ comma() }}
+ resource_instance['identity'] : {
+ "type": {{ resource_instance['type'] }},
+ "demands": {{ resource_instance['demands'] }},
+ "properties": {
+ "controller": {{ resource_instance['property']['controller'] }},
+ "request": {{ resource_instance['property']['request'] }}
+ }
+ }
+ {% endfor %}
+
+ {% if resource_region_policy_list %} {{ comma_main() }} {% endif %}
+ {% set comma=joiner(",") %}
+ {% for resource_region in resource_region_policy_list %} {{ comma() }}
+ resource_region['identity'] : {
+ "type": {{ resource_region['type'] }},
+ "demands": {{ resource_region['demands'] }},
+ "properties": {
+ "controller": {{ resource_region['property']['controller'] }},
+ "request": {{ resource_region['property']['request'] }}
+ }
+ }
+ {% endfor %}
+
+ {% if zone_policy_list %} {{ comma_main() }} {% endif %}
+ {% set comma=joiner(",") %}
+ {% for zone in zone_policy_list %} {{ comma() }}
+ zone['identity'] : {
+ "type": {{ zone['type'] }},
+ "demands": {{ zone['demands'] }},
+ "properties": {
+ "qualifier": {{ resource_region['property']['qualifier'] }},
+ "category": {{ resource_region['property']['category'] }}
+ }
+ }
+ {% endfor %}
+
+ {% if optmization_policy_list %} {{ comma_main() }} {% endif %}
+ {% set comma=joiner(",") %}
+ {% for optimization in optimization_policy_list %} {{ comma() }}
+ "optimization" : {
+ {{ optimization['objective'] }}: {
+ "sum": [
+ {% set comma2=joiner(",") %}
+ {% for parameter in optimization['parameter'] %} {{ comma() }}
+ {
+ "product": [
+ {{ parameter['weight'] }},
+ {
+ "distance_between": [{{ parameter['customerLocation'] }},{{ parameter['demand'] }}]
+ }
+ ]
+ }
+ {% endfor %}
+ ]
+ }
+ }
+ {% endfor %}
+ }
+ }
+} \ No newline at end of file
diff --git a/osdf/templates/plc_opt_response.jsont b/osdf/templates/plc_opt_response.jsont
new file mode 100755
index 0000000..aa678b5
--- /dev/null
+++ b/osdf/templates/plc_opt_response.jsont
@@ -0,0 +1,14 @@
+{
+ "requestId": "{{requestId}}",
+ "transactionId": "{{transacationId}}",
+ "startTime": "{{startTime}}",
+ "responseTime": "{{responseTime}}",
+ "requestType": "{{requestType}}",
+ "requestState": "{{requestState}}",
+ "statusMessage": "{{statusMessage}}",
+ "percentProgress": "{{percentProgress}}",
+ "solutionInfo": {
+ "placement": {{ json.dumps(composite_solutions) }},
+ "licenseInfo":{ "featureGroupId": "{{featureGroupId}}" }
+ }
+}
diff --git a/osdf/templates/policy_request.jsont b/osdf/templates/policy_request.jsont
new file mode 100755
index 0000000..3a9e201
--- /dev/null
+++ b/osdf/templates/policy_request.jsont
@@ -0,0 +1,3 @@
+{
+ "policyName": "{{policy_name}}" {# we currently only support query by policy name only -- policyName #}
+}
diff --git a/osdf/templates/test_cms_nb_req_from_client.jsont b/osdf/templates/test_cms_nb_req_from_client.jsont
new file mode 100755
index 0000000..a60c8ff
--- /dev/null
+++ b/osdf/templates/test_cms_nb_req_from_client.jsont
@@ -0,0 +1,19 @@
+{
+ "schedulingInfo": {
+ "change_management_id": "{{ change_management_id }}",
+ "start_time": "{{ start_time }}",
+ "end_time": "{{ end_time }}",
+ "policy_id": {{ json.dumps(policy_id) }}, {# a list of policy Ids #}
+ "service_type": "{{ service_type }}",
+ "workflow_type": "{{ workflow_type }}",
+ "upgrades": {{ json.dumps(upgrades) }} {# a list of node Ids #}
+ },
+ "requestInfo": {
+ "requestId": "{{ requestId }}",
+ "sourceId": "{{ sourceId }}",
+ "optimizer": "{{ optimizer }}",
+ "numSolutions": "{{ numSolutions }}",
+ "callbackUrl" : "{{ callbackUrl }}"
+ }
+}
+
diff --git a/osdf/templates/test_plc_nb_req_from_client.jsont b/osdf/templates/test_plc_nb_req_from_client.jsont
new file mode 100755
index 0000000..998ffb3
--- /dev/null
+++ b/osdf/templates/test_plc_nb_req_from_client.jsont
@@ -0,0 +1,52 @@
+{
+ "requestInfo": {
+ "requestId": "{{requestId}}",
+ "sourceId": "{{sourceId}}",
+ "optimizer": "{{optimizer}}",
+ "numSolutions": {{numSolutions}},
+ "timeout": {{timeout}},
+ "callbackUrl" : "{{callbackUrl}}"
+ },
+ "placementInfo": {
+ "modelInfo": {
+ "modelType": "{{modelType}}",
+ "modelInvariant": "{{modelInvariantId}}",
+ "modelVersionId": "{{modelVersionId}}",
+ "modelName": "{{modelName}}",
+ "modelVersion": "{{modelVersion}}",
+ "modelCustomizationId": "{{modelCustomizationId}}"
+ },
+ "subscriberInfo": {
+ "globalSubscriberId": "{{globalSubscriberId}}",
+ "subscriberName": "{{subscriberName}}",
+ "subscriberCommonSiteId": "{{subscriberCommonSiteId}}",
+ "ucpeHostName": "{{ucpeHostName}}"
+ },
+ "policyId": {{json.dumps(policyId)}},
+ "vnfInfo": {
+ "vnfType": "{{vnfType}}",
+ "vnfPartNumber": "{{vnfPartNumber}}",
+ "nominalThroughput": "{{nominalThroughput}}",
+ "vnfSoftwareVersion": "{{vnfSoftwareVersion}}",
+ "vnfManagementOption": "{{vnfManagementOption}}"
+ },
+ "vpnInfo": {
+ "vpnId": "{{vpnId}}",
+ "pvcId": "{{pvcId}}"
+ },
+ "serviceInfo": {
+ "dhvServiceInfo": {
+ "serviceInstanceId": "{{serviceInstanceId}}",
+ "serviceType": "{{serviceType}}",
+ "e2evpnkey": "{{e2evpnkey}}",
+ "dhvSiteEffectiveTransportBandwidth": {{dhvSiteEffectiveTransportBandwidth}},
+ "dhvIPSecTransportBandwidthUp": {{dhvIPSecTransportBandwidthUp}},
+ "dhvIPSecTransportBandwidthDown": {{dhvIPSecTransportBandwidthDown}},
+ "dhvIPSec2TransportBandwidthUp": {{dhvIPSec2TransportBandwidthUp}},
+ "dhvIPSec2TransportBandwidthDown": {{dhvIPSec2TransportBandwidthDown}},
+ "dhvVendorName": "{{dhvVendorName}}"
+ }
+ },
+ "demandInfo": {{json.dumps(demandInfo)}}
+ }
+}