This repository has been archived by the owner on Jun 25, 2024. It is now read-only.
Activate OVH GPU Machine #1
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
name: Activate OVH GPU Machine | |
on: | |
workflow_dispatch: | |
jobs: | |
curl: | |
name: "Call to OVH" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Call API" | |
id: api | |
run: | | |
HTTP_METHOD="POST" | |
HTTP_QUERY="https://api.ovh.com/1.0/cloud/project/${{ secrets.PROJECT_ID }}/instance/${{ secrets.INSTANCE_ID }}/stop" | |
TIME=$(curl -s https://api.ovh.com/1.0/auth/time) | |
CLEAR_SIGN=${{ secrets.OVH_APP_SECRET }}"+"${{ secrets.OVH_CONSUMER_KEY }}"+"$HTTP_METHOD"+"$HTTP_QUERY"+"$TIME | |
SIG='$1$'$(echo -n $CLEAR_SIGN | openssl dgst -sha1 -hex | cut -f 2 -d ' ' ) | |
curl -X $HTTP_METHOD \ | |
$HTTP_QUERY \ | |
-H "Content-Type: application/json" \ | |
-H "X-Ovh-Application: ${{ secrets.OVH_APP_KEY }}" \ | |
-H "X-Ovh-Timestamp: $TIME" \ | |
-H "X-Ovh-Signature: $SIG" \ | |
-H "X-Ovh-Consumer: ${{ secrets.OVH_CONSUMER_KEY }}" | |
- name: "Get response" | |
run: echo ${{ steps.api.outputs.response }} |