prova body json
This commit is contained in:
@@ -97,15 +97,19 @@ do
|
||||
$id = $($item.id)
|
||||
$url = $($item.url)
|
||||
WriteLogOutput 2 "ID: $id - URL: $url"
|
||||
#tronco fino a azzano o nembro
|
||||
$trunk = $url.Remove(0, ($url.Length - 18))
|
||||
WriteLogOutput 2 "Truncated: $trunk"
|
||||
#chiamata api con method delete che cancella mirror con id specificato
|
||||
$callUrlDeleteMirror = "https://gitlab.steamware.net/api/v4/projects/" + $projectCount + "/remote_mirrors/" + $id
|
||||
Invoke-WebRequest -URI $callUrlDeleteMirror -Method Delete -Headers $head -ContentType "application/json" -UseBasicParsing
|
||||
#chiamata api con method post che crea mirror con username e token specificati
|
||||
#$callUrlCreateMirror = "https://gitlab.steamware.net/api/v4/projects/" + $projectCount + "/remote_mirrors"
|
||||
#$newMirrorUrl = "https://" + $userName + ":" + $tokenAzzano + "@gitlab-azzano.steamware.net" + $trunk
|
||||
#Invoke-WebRequest -Method Post -URI $callUrlCreateMirror -Headers $head -ContentType "application/json" -UseBasicParsing
|
||||
$callUrlCreateMirror = "https://gitlab.steamware.net/api/v4/projects/" + $projectCount + "/remote_mirrors"
|
||||
$newMirrorUrl = "https://" + $userName + ":" + $tokenAzzano + "@gitlab-azzano.steamware.net" + $trunk
|
||||
$jsonBody
|
||||
|
||||
#converto body in json prima di passarlo
|
||||
Invoke-WebRequest -Method Post -URI $callUrlCreateMirror -Headers $head -ContentType "application/json" -Body -UseBasicParsing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user