diff --git a/frinx_conductor_workers/frinx_conductor_workers/import_workflows.py b/frinx_conductor_workers/frinx_conductor_workers/import_workflows.py index f6ed363..f31a635 100644 --- a/frinx_conductor_workers/frinx_conductor_workers/import_workflows.py +++ b/frinx_conductor_workers/frinx_conductor_workers/import_workflows.py @@ -1,6 +1,7 @@ import json import logging import os +from pathlib import Path import requests from frinx_conductor_workers.frinx_rest import conductor_headers @@ -10,11 +11,12 @@ workflow_import_url = conductor_url_base + "/metadata/workflow" +DIR_PATH = Path(os.path.dirname(os.path.realpath(__file__))).parent +FRINX_CONDUCTOR_WORKFLOWS: Path = Path(f"{DIR_PATH}/frinx_conductor_workflows") -def import_base_workflows(): - import frinx_conductor_workflows - import_workflows(os.path.dirname(frinx_conductor_workflows.__file__)) +def import_base_workflows(): + import_workflows(FRINX_CONDUCTOR_WORKFLOWS) def import_workflows(path): @@ -36,7 +38,7 @@ def import_workflows(path): headers=conductor_headers, ) local_logs.info("Response status code - %s", r.status_code) - if r.status_code != 204: + if r.status_code != requests.codes.ok: local_logs.warning( "Import of workflow %s failed. " "Ignoring the workflow. Response content: %s", diff --git a/frinx_conductor_workers/frinx_conductor_workers/netconf_worker.py b/frinx_conductor_workers/frinx_conductor_workers/netconf_worker.py index b5bcc20..a757cf5 100644 --- a/frinx_conductor_workers/frinx_conductor_workers/netconf_worker.py +++ b/frinx_conductor_workers/frinx_conductor_workers/netconf_worker.py @@ -75,14 +75,14 @@ def execute_mount_netconf(task): if ( "reconcile" in task["inputData"] and task["inputData"]["reconcile"] is not None - and task["inputData"]["reconcile"] is not "" + and task["inputData"]["reconcile"] != "" ): mount_body["input"]["netconf"]["node-extension:reconcile"] = task["inputData"]["reconcile"] if ( "schema-cache-directory" in task["inputData"] and task["inputData"]["schema-cache-directory"] is not None - and task["inputData"]["schema-cache-directory"] is not "" + and task["inputData"]["schema-cache-directory"] != "" ): mount_body["input"]["netconf"]["netconf-node-topology:schema-cache-directory"] = task[ "inputData" @@ -91,7 +91,7 @@ def execute_mount_netconf(task): if ( "sleep-factor" in task["inputData"] and task["inputData"]["sleep-factor"] is not None - and task["inputData"]["sleep-factor"] is not "" + and task["inputData"]["sleep-factor"] != "" ): mount_body["input"]["netconf"]["netconf-node-topology:sleep-factor"] = task["inputData"][ "sleep-factor" @@ -100,7 +100,7 @@ def execute_mount_netconf(task): if ( "between-attempts-timeout-millis" in task["inputData"] and task["inputData"]["between-attempts-timeout-millis"] is not None - and task["inputData"]["between-attempts-timeout-millis"] is not "" + and task["inputData"]["between-attempts-timeout-millis"] != "" ): mount_body["input"]["netconf"]["netconf-node-topology:between-attempts-timeout-millis"] = ( task["inputData"]["between-attempts-timeout-millis"] @@ -109,7 +109,7 @@ def execute_mount_netconf(task): if ( "connection-timeout-millis" in task["inputData"] and task["inputData"]["connection-timeout-millis"] is not None - and task["inputData"]["connection-timeout-millis"] is not "" + and task["inputData"]["connection-timeout-millis"] != "" ): mount_body["input"]["netconf"]["netconf-node-topology:connection-timeout-millis"] = task[ "inputData" @@ -118,7 +118,7 @@ def execute_mount_netconf(task): if ( "uniconfig-native" in task["inputData"] and task["inputData"]["uniconfig-native"] is not None - and task["inputData"]["uniconfig-native"] is not "" + and task["inputData"]["uniconfig-native"] != "" ): mount_body["input"]["netconf"]["uniconfig-config:uniconfig-native-enabled"] = task[ "inputData" diff --git a/frinx_conductor_workers/frinx_conductor_workers/resource_manager_worker.py b/frinx_conductor_workers/frinx_conductor_workers/resource_manager_worker.py index f081d67..eb45ae5 100644 --- a/frinx_conductor_workers/frinx_conductor_workers/resource_manager_worker.py +++ b/frinx_conductor_workers/frinx_conductor_workers/resource_manager_worker.py @@ -60,7 +60,11 @@ }, resourceTypeId: $resource_type_id) { - id + edges { + node { + id + } + } } }""" ) @@ -81,10 +85,14 @@ """ query SearchPools($poolTag: String!) { SearchPoolsByTags(tags: { matchesAny: [{matchesAll: [$poolTag]}]}) { - id - AllocationStrategy {Name} - Name - PoolProperties + edges { + node { + id + AllocationStrategy {Name} + Name + PoolProperties + } + } } } """ ) @@ -97,9 +105,7 @@ {{ input }}) { edges { - cursor { - ID - } + cursor node { id Properties @@ -162,12 +168,10 @@ query_resource_by_alt_id_template = Template( """ - query QueryResourcesByAltId($poolId: ID, $input: Map!, $first: Int, $last: Int, $after: String, $before: String) { + query QueryResourcesByAltId($poolId: ID, $input: Map!, $first: Int, $last: Int, $after: Cursor, $before: Cursor) { QueryResourcesByAltId(input: $input, poolId: $poolId, first: $first, last: $last, after: $after, before: $before) { edges { - cursor { - ID - } + cursor node { id Properties @@ -216,14 +220,18 @@ """ query getEmptyPools($resourceTypeId: ID) { QueryEmptyResourcePools(resourceTypeId: $resourceTypeId) { - id - Name - Tags { - Tag + edges { + node { + id + Name + Tags { + Tag + } + AllocationStrategy { + Name + } + } } - AllocationStrategy { - Name - } } }""" ) @@ -246,9 +254,7 @@ Name } } - cursor{ - ID - } + cursor } } } @@ -344,9 +350,7 @@ def query_claimed_resources(task, logs): "data": { "": { edges [ - cursor { - - } + cursor: "" node { "id": "", "Properties": { @@ -715,14 +719,18 @@ def query_pool(task, logs): Returns: Response from uniresource. Worker output format:: - "result":{ - "data": { - "QueryResourcePools": [ - { - "id": "" - } - ] - } + "result": { + "data": { + "QueryResourcePools": { + "edges": [ + { + "node": { + "id": "" + } + } + ] + } + } } """ @@ -800,14 +808,18 @@ def query_pool_by_tag(task, logs): Response from uniresource. Worker output format:: "result": { "data": { - "SearchPoolsByTags": [ - { + "SearchPoolsByTags": { + "edges": [ + { + "node": { "id": "", "AllocationStrategy": "Name": "" "PoolProperties": - } - ] + } + } + ] + } } } @@ -1395,14 +1407,18 @@ def query_search_empty_pools(task, logs): Response from uniresource. Worker output format:: "result": { "data": { - "QueryEmptyResourcePools": [ - { - "id": "", - "AllocationStrategy": - "Name": "" - "Tags": - } - ] + "QueryEmptyResourcePools": { + "edges": [ + { + "node": { + "id": "", + "AllocationStrategy": + "Name": "" + "Tags": + } + } + ] + } } } @@ -1444,9 +1460,7 @@ def query_recently_active_resources(task, logs): Name } } - cursor{ - ID - } + cursor: "" } } } diff --git a/frinx_conductor_workers/frinx_conductor_workers/uniconfig_worker.py b/frinx_conductor_workers/frinx_conductor_workers/uniconfig_worker.py index 8022f7b..1ca77dc 100644 --- a/frinx_conductor_workers/frinx_conductor_workers/uniconfig_worker.py +++ b/frinx_conductor_workers/frinx_conductor_workers/uniconfig_worker.py @@ -290,11 +290,9 @@ def parse_devices(task, fail_on_empty=True): if "name" in dev: extracted_devices.append(dev.get("name")) else: - extracted_devices = ( - [x.strip() for x in devices.split(",") if x is not ""] if devices else [] - ) + extracted_devices = [x.strip() for x in devices.split(",") if x != ""] if devices else [] - if fail_on_empty and len(extracted_devices) is 0: + if fail_on_empty and len(extracted_devices) == 0: raise Exception( "For Uniconfig RPCs, a list of devices needs to be specified. " "Global RPCs (involving all devices in topology) are not allowed for your own safety." diff --git a/frinx_conductor_workers/frinx_conductor_workflows/__init__.py b/frinx_conductor_workers/frinx_conductor_workflows/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv4_Prefix_Resource.json b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv4_Prefix_Resource.json index 14a2b66..680a0eb 100644 --- a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv4_Prefix_Resource.json +++ b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv4_Prefix_Resource.json @@ -17,7 +17,7 @@ "name": "decisionTask", "taskReferenceName": "pool_exists", "inputParameters": { - "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags}" + "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges}" }, "type": "DECISION", "caseExpression": "$.pool_exists.length > 0 ? 'True' : 'False'", @@ -48,8 +48,8 @@ "name": "LAMBDA_TASK", "taskReferenceName": "lambda_print_alt_id", "inputParameters": { - "address": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].PoolProperties.address}", - "prefix": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].PoolProperties.prefix}", + "address": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.PoolProperties.address}", + "prefix": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.PoolProperties.prefix}", "scriptExpression": "return {'subnetAddress': $.address, 'subnetPrefix': $.prefix}" }, "type": "LAMBDA", @@ -67,7 +67,7 @@ "name": "RESOURCE_MANAGER_calculate_desired_size_from_prefix", "taskReferenceName": "calculate_desired_size_from_prefix", "inputParameters": { - "subnet": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].PoolProperties.subnet}", + "subnet": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.PoolProperties.subnet}", "prefix": "${workflow.input.prefix}", "resourceType": "ipv4_prefix" }, @@ -92,7 +92,7 @@ "taskReferenceName": "claim_resource_with_desired_value", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}", + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}", "userInput": {"desiredValue": "${workflow.input.desired_value}", "desiredSize": "${calculate_desired_size_from_prefix.output.result.data}"}, "description": "${workflow.input.description}", "alternativeId": "${lambda_print_alt_id.output.result}" @@ -105,7 +105,7 @@ "taskReferenceName": "claim_resource_without_desired_value", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}", + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}", "userInput": {"desiredSize": "${calculate_desired_size_from_prefix.output.result.data}"}, "description": "${workflow.input.description}", "alternativeId": "${lambda_print_alt_id.output.result}" diff --git a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv4_Resource.json b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv4_Resource.json index a37fe97..77e1054 100644 --- a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv4_Resource.json +++ b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv4_Resource.json @@ -17,7 +17,7 @@ "name": "decisionTask", "taskReferenceName": "pool_exists", "inputParameters": { - "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags}" + "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges}" }, "type": "DECISION", "caseExpression": "$.pool_exists.length > 0 ? 'True' : 'False'", @@ -48,8 +48,8 @@ "name": "LAMBDA_TASK", "taskReferenceName": "lambda_print_alt_id", "inputParameters": { - "address": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].PoolProperties.address}", - "prefix": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].PoolProperties.prefix}", + "address": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.PoolProperties.address}", + "prefix": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.PoolProperties.prefix}", "scriptExpression": "return {'subnetAddress': $.address, 'subnetPrefix': $.prefix}" }, "type": "LAMBDA", @@ -79,7 +79,7 @@ "taskReferenceName": "claim_resource_with_desired_value", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}", + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}", "userInput": {"desiredValue": "${workflow.input.desired_value}"}, "description": "${workflow.input.description}", "alternativeId": "${lambda_print_alt_id.output.result}" @@ -92,7 +92,7 @@ "taskReferenceName": "claim_resource_without_desired_value", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}", + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}", "description": "${workflow.input.description}", "alternativeId": "${lambda_print_alt_id.output.result}" } diff --git a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv6_Prefix_Resource.json b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv6_Prefix_Resource.json index cecad03..d62a2b4 100644 --- a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv6_Prefix_Resource.json +++ b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv6_Prefix_Resource.json @@ -17,7 +17,7 @@ "name": "decisionTask", "taskReferenceName": "pool_exists", "inputParameters": { - "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags}" + "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges}" }, "type": "DECISION", "caseExpression": "$.pool_exists.length > 0 ? 'True' : 'False'", @@ -48,8 +48,8 @@ "name": "LAMBDA_TASK", "taskReferenceName": "lambda_print_alt_id", "inputParameters": { - "address": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].PoolProperties.address}", - "prefix": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].PoolProperties.prefix}", + "address": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.PoolProperties.address}", + "prefix": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.PoolProperties.prefix}", "scriptExpression": "return {'subnetAddress': $.address, 'subnetPrefix': $.prefix}" }, "type": "LAMBDA", @@ -67,7 +67,7 @@ "name": "RESOURCE_MANAGER_calculate_desired_size_from_prefix", "taskReferenceName": "calculate_desired_size_from_prefix", "inputParameters": { - "subnet": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].PoolProperties.subnet}", + "subnet": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.PoolProperties.subnet}", "prefix": "${workflow.input.prefix}", "resourceType": "ipv6_prefix" }, @@ -92,7 +92,7 @@ "taskReferenceName": "claim_resource_with_desired_value", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}", + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}", "userInput": {"desiredValue": "${workflow.input.desired_value}", "desiredSize": "${calculate_desired_size_from_prefix.output.result.data}"}, "description": "${workflow.input.description}", "alternativeId": "${lambda_print_alt_id.output.result}" @@ -105,7 +105,7 @@ "taskReferenceName": "claim_resource_without_desired_value", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}", + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}", "userInput": {"desiredSize": "${calculate_desired_size_from_prefix.output.result.data}"}, "description": "${workflow.input.description}", "alternativeId": "${lambda_print_alt_id.output.result}" diff --git a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv6_Resource.json b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv6_Resource.json index 4374fca..a04e574 100644 --- a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv6_Resource.json +++ b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Allocate_IPv6_Resource.json @@ -17,7 +17,7 @@ "name": "decisionTask", "taskReferenceName": "pool_exists", "inputParameters": { - "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags}" + "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges}" }, "type": "DECISION", "caseExpression": "$.pool_exists.length > 0 ? 'True' : 'False'", @@ -48,8 +48,8 @@ "name": "LAMBDA_TASK", "taskReferenceName": "lambda_print_alt_id", "inputParameters": { - "address": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].PoolProperties.address}", - "prefix": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].PoolProperties.prefix}", + "address": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.PoolProperties.address}", + "prefix": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.PoolProperties.prefix}", "scriptExpression": "return {'subnetAddress': $.address, 'subnetPrefix': $.prefix}" }, "type": "LAMBDA", @@ -79,7 +79,7 @@ "taskReferenceName": "claim_resource_with_desired_value", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}", + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}", "userInput": {"desiredValue": "${workflow.input.desired_value}"}, "description": "${workflow.input.description}", "alternativeId": "${lambda_print_alt_id.output.result}" @@ -92,7 +92,7 @@ "taskReferenceName": "claim_resource_without_desired_value", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}", + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}", "description": "${workflow.input.description}", "alternativeId": "${lambda_print_alt_id.output.result}" } diff --git a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv4_Pool.json b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv4_Pool.json index fafa71a..e8ddf9c 100644 --- a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv4_Pool.json +++ b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv4_Pool.json @@ -17,7 +17,7 @@ "name": "decisionTask", "taskReferenceName": "pool_exists", "inputParameters": { - "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags}" + "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges}" }, "type": "DECISION", "caseExpression": "$.pool_exists.length > 0 ? 'True' : 'False'", diff --git a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv4_Prefix_Pool.json b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv4_Prefix_Pool.json index 2761150..fe29a95 100644 --- a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv4_Prefix_Pool.json +++ b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv4_Prefix_Pool.json @@ -17,7 +17,7 @@ "name": "decisionTask", "taskReferenceName": "pool_exists", "inputParameters": { - "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags}" + "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges}" }, "type": "DECISION", "caseExpression": "$.pool_exists.length > 0 ? 'True' : 'False'", diff --git a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv6_Pool.json b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv6_Pool.json index 9b7d52e..a340a79 100644 --- a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv6_Pool.json +++ b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv6_Pool.json @@ -17,7 +17,7 @@ "name": "decisionTask", "taskReferenceName": "pool_exists", "inputParameters": { - "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags}" + "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges}" }, "type": "DECISION", "caseExpression": "$.pool_exists.length > 0 ? 'True' : 'False'", diff --git a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv6_Prefix_Pool.json b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv6_Prefix_Pool.json index 6198792..66bdd62 100644 --- a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv6_Prefix_Pool.json +++ b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_IPv6_Prefix_Pool.json @@ -17,7 +17,7 @@ "name": "decisionTask", "taskReferenceName": "pool_exists", "inputParameters": { - "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags}" + "pool_exists": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges}" }, "type": "DECISION", "caseExpression": "$.pool_exists.length > 0 ? 'True' : 'False'", diff --git a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_Subnet.json b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_Subnet.json index 337f8e2..7080f83 100644 --- a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_Subnet.json +++ b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Create_Subnet.json @@ -15,8 +15,8 @@ "name": "LAMBDA_TASK", "taskReferenceName": "lambda_print_alt_id", "inputParameters": { - "address": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].PoolProperties.address}", - "prefix": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].PoolProperties.prefix}", + "address": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.PoolProperties.address}", + "prefix": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.PoolProperties.prefix}", "scriptExpression": "return {'subnetAddress': $.address, 'subnetPrefix': $.prefix}" }, "type": "LAMBDA", @@ -34,8 +34,9 @@ "name": "RESOURCE_MANAGER_calculate_desired_size_from_prefix", "taskReferenceName": "calculate_desired_size_from_prefix", "inputParameters": { + "subnet": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.PoolProperties.subnet}", "prefix": "${workflow.input.prefix}", - "resourceType": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].AllocationStrategy.Name}" + "resourceType": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.AllocationStrategy.Name}" }, "type": "SIMPLE", "startDelay": 0, @@ -77,7 +78,7 @@ "taskReferenceName": "decision_pool_type", "caseExpression": "$.poolType.startsWith(\"ipv4_prefix\") ? 'ipv4_prefix' : $.poolType.startsWith(\"ipv6_prefix\") ? 'ipv6_prefix' : 'defaultCase';", "inputParameters": { - "poolType": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].AllocationStrategy.Name}" + "poolType": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.AllocationStrategy.Name}" }, "decisionCases": { "ipv4_prefix": [ @@ -97,7 +98,7 @@ "taskReferenceName": "claim_resource_ipv4_desiredValue", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}", + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}", "hostAddress" : "${workflow.input.subnet_ip_address}", "userInput": {"desiredSize": "${calculate_desired_size_from_prefix.output.result.data}", "desiredValue": "${workflow.input.subnet_ip_address}"}, "description": "parent resource for nested pool", @@ -111,7 +112,7 @@ "taskReferenceName": "claim_resource_ipv4", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}", + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}", "userInput": {"desiredSize": "${calculate_desired_size_from_prefix.output.result.data}"}, "description": "parent resource for nested pool", "alternativeId": "${lambda_print_alt_id.output.result}" @@ -190,7 +191,7 @@ "taskReferenceName": "claim_resource_ipv6_desiredValue", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}", + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}", "hostAddress" : "${workflow.input.subnet_ip_address}", "userInput": {"desiredSize": "${calculate_desired_size_from_prefix.output.result.data}", "desiredValue": "${workflow.input.subnet_ip_address}"}, "description": "parent resource for nested pool", @@ -204,7 +205,7 @@ "taskReferenceName": "claim_resource_ipv6", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}", + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}", "userInput": {"desiredSize": "${calculate_desired_size_from_prefix.output.result.data}"}, "description": "parent resource for nested pool", "alternativeId": "${lambda_print_alt_id.output.result}" diff --git a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Deallocate_Resource.json b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Deallocate_Resource.json index d297b35..1c4ac2b 100644 --- a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Deallocate_Resource.json +++ b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Deallocate_Resource.json @@ -17,7 +17,7 @@ "taskReferenceName": "deallocate_resource", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}", + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}", "userInput": {"address": "${workflow.input.ip_address}"} } } diff --git a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Delete_Pool_IPv4.json b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Delete_Pool_IPv4.json index 507fb21..610787f 100644 --- a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Delete_Pool_IPv4.json +++ b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Delete_Pool_IPv4.json @@ -17,7 +17,7 @@ "taskReferenceName": "delete_pool", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}" + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}" } } ], diff --git a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Delete_Pool_IPv6.json b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Delete_Pool_IPv6.json index 4c0d11e..839a89b 100644 --- a/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Delete_Pool_IPv6.json +++ b/frinx_conductor_workers/frinx_conductor_workflows/resource_manager_workflows/Delete_Pool_IPv6.json @@ -17,7 +17,7 @@ "taskReferenceName": "delete_pool", "type": "SIMPLE", "inputParameters": { - "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags[0].id}" + "poolId": "${query_pool_by_tag.output.result.data.SearchPoolsByTags.edges[0].node.id}" } } ], diff --git a/frinx_conductor_workers/setup.py b/frinx_conductor_workers/setup.py index 44a5590..8501d81 100644 --- a/frinx_conductor_workers/setup.py +++ b/frinx_conductor_workers/setup.py @@ -10,7 +10,7 @@ def __read__(file_name): setup( name="frinx_conductor_workers", packages=["frinx_conductor_workers", "frinx_conductor_workflows"], - version="2.0.0", + version="2.1.0", description="Conductor python client workers", author="Frinx", author_email="info@frinx.io",