Made the respective changes for Cisco Meraki Solution Installation Experience for Playbooks, Custom Connector and CreateSolution Tool

This commit is contained in:
Sarath Tirumalareddy 2022-02-02 19:39:26 +05:30
Родитель e614f439b9
Коммит 8efd3b1a65
7 изменённых файлов: 63 добавлений и 16 удалений

Просмотреть файл

@ -12,6 +12,7 @@
"support": {
"tier": "community"
},
"comments": "This custom connector connects to Cisco Meraki Dashboard API service endpoint and programmatically manages and monitors Meraki networks at scale.",
"author": {
"name": "Accenture"
}
@ -24,17 +25,27 @@
"description": "Enter the name for Cisco Meraki custom connector without spaces"
},
"minLength": 3
},
"ApiKey": {
"type": "securestring",
"defaultValue": "",
"metadata": {
"description": "Enter the API KEY for Cisco Meraki Dashboard API Service End"
},
"minLength": 4
},
"ServiceEndPoint": {
"type": "String",
"defaultValue": "https://{CiscoMerakiDomain}/api/{VersionNumber}",
"defaultValue": "https://api.meraki.com/api/v1",
"metadata": {
"description": "Enter the Cisco Meraki Dashboard API Service End Point as 'https://{CiscoMerakiDomain}/api/{VersionNumber}'"
},
"minLength": 3
}
},
"variables": {},
"variables": {
"ApiKey":"parameters('ApiKey')"
},
"resources": [
{
"type": "Microsoft.Web/customApis",
@ -70,8 +81,8 @@
"title": "Meraki Dashboard API",
"description": "Cisco Meraki custom connector connects to Meraki Dashboard API service endpoint and programmatically manages and monitors Meraki networks at scale."
},
"host": "[parameters('ServiceEndPoint')]",
"basePath": "/",
"host": "api.meraki.com",
"basePath": "/api/v1",
"schemes": [ "https" ],
"consumes": [ "application/json" ],
"produces": [ "application/json" ],

Просмотреть файл

@ -64,7 +64,7 @@
},
"variables": {
"Meraki_Connection": "[concat('Meraki-', parameters('PlaybookName'))]",
"AzureSentinel_Connection": "[concat('Azuresentienl-', parameters('PlaybookName'))]"
"AzureSentinel_Connection": "[concat('Azuresentinel-', parameters('PlaybookName'))]"
},
"resources": [
{
@ -974,8 +974,12 @@
"properties": {
"api": {
"id": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Web/customApis/',parameters('CiscoMerakiConnectorName'))]"
}
},
"parameterValues": {
"api_key": ""
}
},
"dependsOn": ["[resourceId('Microsoft.Web/customApis', parameters('CiscoMerakiConnectorName'))]"]
},
{
"type": "MICROSOFT.WEB/CONNECTIONS",

Просмотреть файл

@ -56,7 +56,7 @@
},
"variables": {
"Meraki_Connection": "[concat('Meraki-', parameters('PlaybookName'))]",
"AzureSentinel_Connection": "[concat('Azuresentienl-', parameters('PlaybookName'))]"
"AzureSentinel_Connection": "[concat('Azuresentinel-', parameters('PlaybookName'))]"
},
"resources": [
{
@ -974,8 +974,12 @@
"properties": {
"api": {
"id": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Web/customApis/',parameters('CiscoMerakiConnectorName'))]"
}
},
"parameterValues": {
"api_key": ""
}
},
"dependsOn": ["[resourceId('Microsoft.Web/customApis', parameters('CiscoMerakiConnectorName'))]"]
},
{
"type": "MICROSOFT.WEB/CONNECTIONS",

Просмотреть файл

@ -56,7 +56,7 @@
},
"variables": {
"Meraki_Connection": "[concat('Meraki-', parameters('PlaybookName'))]",
"AzureSentinel_Connection": "[concat('Azuresentienl-', parameters('PlaybookName'))]"
"AzureSentinel_Connection": "[concat('Azuresentinel-', parameters('PlaybookName'))]"
},
"resources": [
{
@ -730,9 +730,13 @@
"properties": {
"api": {
"id": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Web/customApis/',parameters('CiscoMerakiConnectorName'))]"
}
},
"parameterValues": {
"api_key": ""
}
},
},
"dependsOn": ["[resourceId('Microsoft.Web/customApis', parameters('CiscoMerakiConnectorName'))]"]
},
{
"type": "MICROSOFT.WEB/CONNECTIONS",
"apiVersion": "2016-06-01",

Просмотреть файл

@ -48,7 +48,7 @@
},
"variables": {
"Meraki_Connection": "[concat('Meraki-', parameters('PlaybookName'))]",
"AzureSentinel_Connection": "[concat('Azuresentienl-', parameters('PlaybookName'))]"
"AzureSentinel_Connection": "[concat('Azuresentinel-', parameters('PlaybookName'))]"
},
"resources": [
{
@ -752,8 +752,12 @@
"properties": {
"api": {
"id": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Web/customApis/',parameters('CiscoMerakiConnectorName'))]"
}
},
"parameterValues": {
"api_key": ""
}
},
"dependsOn": ["[resourceId('Microsoft.Web/customApis', parameters('CiscoMerakiConnectorName'))]"]
},
{
"type": "MICROSOFT.WEB/CONNECTIONS",

Просмотреть файл

@ -48,7 +48,7 @@
},
"variables": {
"Meraki_Connection": "[concat('Meraki-', parameters('PlaybookName'))]",
"AzureSentinel_Connection": "[concat('Azuresentienl-', parameters('PlaybookName'))]"
"AzureSentinel_Connection": "[concat('Azuresentinel-', parameters('PlaybookName'))]"
},
"resources": [
{
@ -555,8 +555,12 @@
"properties": {
"api": {
"id": "[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Web/customApis/',parameters('CiscoMerakiConnectorName'))]"
}
},
"parameterValues": {
"api_key": ""
}
},
"dependsOn": ["[resourceId('Microsoft.Web/customApis', parameters('CiscoMerakiConnectorName'))]"]
},
{
"type": "MICROSOFT.WEB/CONNECTIONS",

Просмотреть файл

@ -407,7 +407,14 @@ foreach ($inputFile in $(Get-ChildItem $path)) {
if ($variableValue -is [System.String]) {
$variableValue = $(node "$PSScriptRoot/templating/replacePlaybookParamNames.js" $variableValue $playbookCounter)
}
$baseMainTemplate.variables | Add-Member -NotePropertyName "playbook$playbookCounter-$variableName" -NotePropertyValue $variableValue
if (($solutionName.ToLower() -eq "ciscomeraki") -and ($variableName.ToLower().contains("apikey")))
{
$baseMainTemplate.variables | Add-Member -NotePropertyName "playbook-$variableName" -NotePropertyValue "[$variableValue]"
}
else
{
$baseMainTemplate.variables | Add-Member -NotePropertyName "playbook$playbookCounter-$variableName" -NotePropertyValue $variableValue
}
}
$azureManagementUrlExists = $false
@ -494,11 +501,20 @@ foreach ($inputFile in $(Get-ChildItem $path)) {
$foundConnection = getConnectionVariableName $connectionVar
if ($foundConnection) {
$playbookResource.properties.api.id = "[variables('_$foundConnection')]"
if(($playbookResource.properties.parameterValues) -and ($null -ne $baseMainTemplate.variables.'playbook-ApiKey'))
{
$playbookResource.properties.parameterValues.api_key = "[variables('playbook-ApiKey')]"
}
}
else {
$baseMainTemplate.variables | Add-Member -NotePropertyName "playbook-$playbookCounter-connection-$connectionCounter" -NotePropertyValue $(replaceVarsRecursively $connectionVar)
$baseMainTemplate.variables | Add-Member -NotePropertyName "_playbook-$playbookCounter-connection-$connectionCounter" -NotePropertyValue "[variables('playbook-$playbookCounter-connection-$connectionCounter')]"
$playbookResource.properties.api.id = "[variables('_playbook-$playbookCounter-connection-$connectionCounter')]"
if(($playbookResource.properties.parameterValues) -and ($null -ne $baseMainTemplate.variables.'playbook-ApiKey'))
{
$playbookResource.properties.parameterValues.api_key = "[variables('playbook-ApiKey')]"
}
}
}
}