-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestCcrpApi.ps1
41 lines (36 loc) · 1.58 KB
/
TestCcrpApi.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function InvokeCcrp {
param (
$api = '',
$env = 'prod',
$auth = ''
)
$headers = @{
'ccrpApiVersion' = '1.0';
'email' = '[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]' | Get-Random;
'xOriginAppName' = 'mobile';
'Content-Type' = 'application/json';
'Authorization' = $auth
}
$timeIn = Get-Date
try {
$url = 'https://abb-ccrp-api-proxy-'+$env+'.ir-e1.cloudhub.io/api/'+$api
Invoke-WebRequest $url -Method 'GET' -Headers $headers | Out-Null
}
catch {
Write-Host $_.Exception.Response.StatusCode.value__
}
$timeEnd = Get-Date
$timeOut = NEW-TIMESPAN -Start $timeIn -End $timeEnd
Write-Host $env $timeOut $api
}
while ($true) {
$myIssue = 'my/issues?page=1&pageSize=30'
# InvokeCcrp -api $myIssue -env 'prod' -auth 'Basic Y2NycC1saWdodC11c2VyOkF2NFhkODNJTDA1NndYSHF2NDlw'
InvokeCcrp -api $myIssue -env 'stage' -auth 'Basic Y2NycC1saWdodC11c2VyLXN0YWdlOktyV2tINDhnY1ZrekdHeWR2SE1H'
#InvokeCcrp -api $myIssue -env 'dev' -auth 'Basic cmVzdFVzZXI6RXFOcklPMkcxYWVwdnBIdGZBMmc='
Start-Sleep -Seconds 1
$myIssue = 'hc'
# InvokeCcrp -api $myIssue -env 'prod' -auth 'Basic Y2NycC1saWdodC11c2VyOkF2NFhkODNJTDA1NndYSHF2NDlw'
InvokeCcrp -api $myIssue -env 'stage' -auth 'Basic Y2NycC1saWdodC11c2VyLXN0YWdlOktyV2tINDhnY1ZrekdHeWR2SE1H'
#InvokeCcrp -api $myIssue -env 'dev' -auth 'Basic cmVzdFVzZXI6RXFOcklPMkcxYWVwdnBIdGZBMmc='
}