Skip to content

Commit

Permalink
indexerOperationParameters Group
Browse files Browse the repository at this point in the history
  • Loading branch information
joalmeid committed Apr 10, 2020
1 parent bcfb6c2 commit ba43aed
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 46 deletions.
28 changes: 9 additions & 19 deletions src/azsearch-indexer-operation-task/dsoperationV0/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,41 +22,31 @@ async function run(): Promise<void> {

// Indexer Operation Task
switch (taskParameters.indexerOperation){
case 'createUpdateDataSource':
console.log('createUpdateDataSource');
case 'CreateUpdateDataSource':
await dsController.createUpdateDataSource();
break;
case 'deleteDataSource':
console.log('deleteDataSource');
case 'DeleteDataSource':
await dsController.deleteDataSource();
break;
case 'listDataSources':
console.log('listDataSources');
case 'ListDataSources':
await dsController.listDataSources();
throw new Error('listDataSources not implemented.');
break;
case 'createUpdateIndexer':
console.log('createUpdateIndexer');
case 'CreateUpdateIndexer':
await dsController.createUpdateIndexer();
break;
case 'listIndexers':
console.log('listIndexers');
case 'ListIndexers':
await dsController.listIndexers();
break;
case 'getIndexerStatus':
console.log('getIndexerStatus');
case 'GetIndexerStatus':
await dsController.getIndexerStatus();
break;
case 'resetIndexer':
console.log('resetIndexer');
case 'ResetIndexer':
await dsController.resetIndexer();
break;
case 'runIndexer':
console.log('runIndexer');
case 'RunIndexer':
await dsController.runIndexer();
break;
case 'deleteIndexer':
console.log('deleteIndexer');
case 'DeleteIndexer':
await dsController.deleteIndexer();
break;
}
Expand Down
56 changes: 29 additions & 27 deletions src/azsearch-indexer-operation-task/dsoperationV0/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
],
"minimumAgentVersion": "2.160.0",
"instanceNameFormat": "Indexer Operation: $(IndexerOperation)",
"groups": [
{
"name": "indexerOperationParameters",
"displayName": "Operation parameters",
"isExpanded": true
}
],
"inputs": [
{
"name": "ConnectedServiceName",
Expand Down Expand Up @@ -56,7 +63,7 @@
},
{
"name": "AzureCognitiveSearch2",
"label": "Azure Cognitive Search resource",
"label": "Azure Cognitive Search resource2",
"type": "pickList",
"helpMarkDown": "Select an Azure Cognitive Search in the selected Azure Subscription.",
"defaultValue": "",
Expand All @@ -72,38 +79,40 @@
"type": "pickList",
"required": true,
"options": {
"createUpdateDataSource": "Create/Update DataSource",
"deleteDataSource": "Delete Datasource",
"listDataSources": "List Datasource",
"createUpdateIndexer": "Create/Update Indexer",
"deleteIndexer": "Delete Indexer",
"listIndexers": "List Indexers",
"runIndexer": "Run Indexer",
"resetIndexer": "Reset Indexer",
"getIndexerStatus": "Get Indexer Status"
"CreateUpdateDataSource": "Create/Update DataSource",
"DeleteDataSource": "Delete Datasource",
"ListDataSources": "List Datasource",
"CreateUpdateIndexer": "Create/Update Indexer",
"DeleteIndexer": "Delete Indexer",
"ListIndexers": "List Indexers",
"RunIndexer": "Run Indexer",
"ResetIndexer": "Reset Indexer",
"GetIndexerStatus": "Get Indexer Status"
},
"defaultValue": "createUpdateDataSource"
},
{
"name": "JsonPayloadLocation",
"type": "pickList",
"label": "Json Location",
"defaultValue": "scriptPath",
"defaultValue": "filePath",
"required": true,
"helpMarkDown": "Type of Json Payload: File path or Inline Json",
"options": {
"inlineJson": "Inline Json",
"filePath": "File path"
}
},
},
"groupName": "indexerOperationParameters"
},
{
"name": "JsonPayloadPath",
"type": "filePath",
"label": "Json File Path",
"defaultValue": "",
"required": true,
"visibleRule": "JsonPayloadLocation = filePath",
"helpMarkDown": "Fully qualified path of the Json payload file or a path relative to the the default working directory"
"helpMarkDown": "Fully qualified path of the Json payload file or a path relative to the the default working directory",
"groupName": "indexerOperationParameters"
},
{
"name": "InlineJsonPayload",
Expand All @@ -117,7 +126,8 @@
"resizable": "true",
"rows": "10",
"maxLength": "5000"
}
},
"groupName": "indexerOperationParameters"
},
{
"name": "DatasourceName",
Expand All @@ -126,7 +136,8 @@
"defaultValue": "",
"required": true,
"visibleRule": "IndexerOperation = createUpdateDataSource || IndexerOperation = deleteDataSource",
"helpMarkDown": "Datasource name."
"helpMarkDown": "Datasource name.",
"groupName": "indexerOperationParameters"
},
{
"name": "IndexerName",
Expand All @@ -135,7 +146,8 @@
"defaultValue": "",
"required": true,
"visibleRule": "IndexerOperation = createUpdateIndexer || IndexerOperation = deleteIndexer || IndexerOperation = getIndexerStatus || IndexerOperation = resetIndexer",
"helpMarkDown": "Indexer name."
"helpMarkDown": "Indexer name.",
"groupName": "indexerOperationParameters"
}
],
"dataSourceBindings": [
Expand All @@ -149,16 +161,6 @@
"endpointId": "$(ConnectedServiceName)",
"endpointUrl": "{{endpoint.url}}subscriptions/{{endpoint.subscriptionId}}/resourceGroups/$(ResourceGroupName)/providers/Microsoft.Search/searchServices?api-version=2019-10-01-Preview",
"resultSelector": "jsonpath:$.value[*].name"
},
{
"target": "AzureCognitiveSearch2",
"endpointId": "$(ConnectedServiceName)",
"dataSourceName": "AzureRMResourcesInRGBasedOnType",
"parameters": {
"ResourceGroupName": "$(ResourceGroupName)",
"ResourceType":"Microsoft.Search/searchServices"
},
"resultTemplate": "{ \"Value\" : \"{{{name}}}\", \"DisplayValue\" : \"{{{name}}}\" }"
}
],
"outputVariables": [
Expand Down

0 comments on commit ba43aed

Please sign in to comment.