Skip to content

Commit

Permalink
Revved the InvokeRestApi task to support multiple connection types (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishea authored Jul 3, 2018
1 parent 49175da commit ea58963
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
"loc.description": "Invoke REST API as a part of your process.",
"loc.instanceNameFormat": "Invoke REST API: $(method)",
"loc.group.displayName.completionOptions": "Advanced",
"loc.input.label.connectedServiceNameSelector": "Connection type",
"loc.input.help.connectedServiceNameSelector": "Select the service connection type to use to invoke the REST API.",
"loc.input.label.connectedServiceName": "Generic service connection",
"loc.input.help.connectedServiceName": "Select a generic service connection that should be used to pick the URL and construct authorization header for the http request.",
"loc.input.label.connectedServiceNameARM": "Azure subscription",
"loc.input.help.connectedServiceNameARM": "Select an Azure Resource Manager subscription that should be used to pick the url and construct authorization header for the http request.",
"loc.input.label.method": "Method",
"loc.input.help.method": "Select the HTTP method with which the API should be invoked.",
"loc.input.label.headers": "Headers",
Expand Down
30 changes: 27 additions & 3 deletions Tasks/InvokeRestApiV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 2
"Patch": 3
},
"instanceNameFormat": "Invoke REST API: $(method)",
"groups": [{
Expand All @@ -27,15 +27,39 @@
}
],
"inputs": [
{
"name": "connectedServiceNameSelector",
"aliases": ["connectionType"],
"type": "pickList",
"label": "Connection type",
"required": true,
"helpMarkDown": "Select the service connection type to use to invoke the REST API.",
"defaultValue": "connectedServiceName",
"options": {
"connectedServiceName": "Generic",
"connectedServiceNameARM": "Azure Resource Manager"
}
},
{
"name": "connectedServiceName",
"aliases": ["serviceConnection"],
"type": "connectedService:Generic",
"label": "Generic service connection",
"defaultValue": "",
"required": "true",
"helpMarkDown": "Select a generic service connection that should be used to pick the URL and construct authorization header for the http request."
"helpMarkDown": "Select a generic service connection that should be used to pick the URL and construct authorization header for the http request.",
"visibleRule": "connectedServiceNameSelector = connectedServiceName"
},
{
"name": "connectedServiceNameARM",
"aliases": ["azureServiceConnection"],
"type": "connectedService:AzureRM",
"label": "Azure subscription",
"defaultValue": "",
"required": true,
"helpMarkDown": "Select an Azure Resource Manager subscription that should be used to pick the url and construct authorization header for the http request.",
"visibleRule": "connectedServiceNameSelector = connectedServiceNameARM"
},
{
"name": "method",
"type": "pickList",
Expand Down Expand Up @@ -116,7 +140,7 @@
"execution": {
"HttpRequest": {
"Execute": {
"EndpointId":"$(connectedServiceName)",
"EndpointId":"TaskInputs[TaskInputs['connectedServiceNameSelector']]",
"EndpointUrl": "$(endpoint.url)$(urlSuffix)",
"Method": "$(method)",
"Body": "$(body)",
Expand Down
34 changes: 31 additions & 3 deletions Tasks/InvokeRestApiV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 2
"Patch": 3
},
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
"groups": [
Expand All @@ -28,6 +28,21 @@
}
],
"inputs": [
{
"name": "connectedServiceNameSelector",
"aliases": [
"connectionType"
],
"type": "pickList",
"label": "ms-resource:loc.input.label.connectedServiceNameSelector",
"required": true,
"helpMarkDown": "ms-resource:loc.input.help.connectedServiceNameSelector",
"defaultValue": "connectedServiceName",
"options": {
"connectedServiceName": "Generic",
"connectedServiceNameARM": "Azure Resource Manager"
}
},
{
"name": "connectedServiceName",
"aliases": [
Expand All @@ -37,7 +52,20 @@
"label": "ms-resource:loc.input.label.connectedServiceName",
"defaultValue": "",
"required": "true",
"helpMarkDown": "ms-resource:loc.input.help.connectedServiceName"
"helpMarkDown": "ms-resource:loc.input.help.connectedServiceName",
"visibleRule": "connectedServiceNameSelector = connectedServiceName"
},
{
"name": "connectedServiceNameARM",
"aliases": [
"azureServiceConnection"
],
"type": "connectedService:AzureRM",
"label": "ms-resource:loc.input.label.connectedServiceNameARM",
"defaultValue": "",
"required": true,
"helpMarkDown": "ms-resource:loc.input.help.connectedServiceNameARM",
"visibleRule": "connectedServiceNameSelector = connectedServiceNameARM"
},
{
"name": "method",
Expand Down Expand Up @@ -118,7 +146,7 @@
"execution": {
"HttpRequest": {
"Execute": {
"EndpointId": "$(connectedServiceName)",
"EndpointId": "TaskInputs[TaskInputs['connectedServiceNameSelector']]",
"EndpointUrl": "$(endpoint.url)$(urlSuffix)",
"Method": "$(method)",
"Body": "$(body)",
Expand Down

0 comments on commit ea58963

Please sign in to comment.