Skip to content

Instantly share code, notes, and snippets.

@suresh-sendinblue
Created February 20, 2023 05:21
Show Gist options
  • Save suresh-sendinblue/2e31319cd4e4be321ac064df76d5fb91 to your computer and use it in GitHub Desktop.
Save suresh-sendinblue/2e31319cd4e4be321ac064df76d5fb91 to your computer and use it in GitHub Desktop.
#!/bin/bash
### Get ArgoCD token
curl -s --location -H "CF-Access-Client-Id: <xxxxxxxx>" -H "CF-Access-Client-Secret: <xxxxxxx>" -d $'{"username":"<xxxxx>","password":"<xxxxx>"}' https://argocd.example.com/api/v1/session
### Restart k8s resource
curl --location --request POST 'https://argocd.example.com/api/v1/applications/<application-name>/resource/actions?namespace=<app namespace>&resourceName=<resourse to restart>&version=v1&kind=<kind of the resource>&group=apps' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: CF_Authorization=<cloudflare-generated-auth>' \
--data-urlencode '"restart"='
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment