First sync

This commit is contained in:
2025-06-03 09:41:27 +02:00
parent b5818e580d
commit dd0502453d
6 changed files with 309 additions and 0 deletions

30
GCP/Publish-PubSub.ps1 Normal file
View File

@ -0,0 +1,30 @@
$ProjectId = "ari-prj-np-mdf-001"
$TopicName = "MindFlow:publish"
$Message = "Vendredi 23 mai à 12:00"
$AccessToken = "ya29.a0AW4Xtxhb0o5hP7lkY1kH6ZplZy2hUlfLP1l7QDQlv8th758tD2T-GSL3fKw65zQGr1ilrBBpgn9lM3B4ZhZTmebQgwPykr6gW_MbhLDr7RWmY5mBZXY3EPz9hYjaWa4qEbJDyp1NHsSCKeYWQ-9n24jMNRjeqzxPH50qQIBV2wH7lgaCgYKAToSARESFQHGX2MiqPoqBQZYeAWTQqbEYyLehA0181"
$apiUrl = "https://pubsub.googleapis.com/v1/projects/$ProjectId/topics/$TopicName"
$response = $null
$headers = @{
"Authorization" = "Bearer $AccessToken"
"accept" = "application/json"
"Content-Type" = "application/json"
}
# Define the request body (if needed)
$body = @{
messages= @(
@{
data = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($message))
attributes = @{
subject = "ARI_202209_029"
}
}
)
} | ConvertTo-Json -Depth 10
# Make the API call using Invoke-RestMethod
$response = Invoke-RestMethod -Uri $apiUrl -Method Post -Headers $headers -Body $body
# Output the response
$response