forked from KelvinTegelaar/CIPP-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'KelvinTegelaar:dev' into dev
- Loading branch information
Showing
7 changed files
with
98 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Modules/CIPPCore/Public/Entrypoints/Invoke-Z_CIPPHttpTrigger.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
function Invoke-Z_CIPPHttpTrigger { | ||
<# | ||
.FUNCTIONALITY | ||
Entrypoint | ||
#> | ||
Param( | ||
$Request, | ||
$TriggerMetadata | ||
) | ||
|
||
$FunctionName = 'Invoke-{0}' -f $Request.Params.CIPPEndpoint | ||
|
||
Write-Host "Function: $($Request.Params.CIPPEndpoint)" | ||
|
||
$HttpTrigger = @{ | ||
Request = $Request | ||
TriggerMetadata = $TriggerMetadata | ||
} | ||
|
||
if (Get-Command -Name $FunctionName -ErrorAction SilentlyContinue) { | ||
& $FunctionName @HttpTrigger | ||
} else { | ||
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{ | ||
StatusCode = [HttpStatusCode]::NotFound | ||
Body = 'Endpoint not found' | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
Modules/CIPPCore/Public/Entrypoints/Push-Z_CIPPQueueTrigger.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function Push-Z_CIPPQueueTrigger { | ||
Param($QueueItem, $TriggerMetadata) | ||
$APIName = $QueueItem.FunctionName | ||
|
||
$FunctionName = 'Push-{0}' -f $APIName | ||
if (Get-Command -Name $FunctionName -ErrorAction SilentlyContinue) { | ||
& $FunctionName -QueueItem $QueueItem -TriggerMetadata $TriggerMetadata | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
ListGraphRequestQueue/function.json → Z_CIPPQueueTrigger/function.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
{ | ||
"scriptFile": "../Modules/CippEntryPoints/CippEntryPoints.psm1", | ||
"entryPoint": "Receive-CippQueueTrigger", | ||
"bindings": [ | ||
{ | ||
"name": "QueueItem", | ||
"type": "queueTrigger", | ||
"direction": "in", | ||
"queueName": "GraphRequestQueue" | ||
"queueName": "CIPPGenericQueue" | ||
} | ||
] | ||
} |