No description
  • Shell 42.8%
  • JavaScript 40%
  • PLpgSQL 17.2%
Find a file
2022-09-13 18:13:50 +02:00
.sublime sgetting contracts from OVH 2022-09-13 18:08:33 +02:00
nj "fixed" to newer OVH API authorization 2022-09-13 17:57:11 +02:00
ovh-api sgetting contracts from OVH 2022-09-13 18:08:33 +02:00
scripts various fixes etc. 2020-07-13 00:51:20 +02:00
tmp_secrets various fixes etc. 2020-07-13 00:51:20 +02:00
.gitignore . 2020-07-13 00:38:31 +02:00
Get_it_in_postgresql.md last tweaks 2020-10-20 17:23:35 +02:00
LICENSE Add LICENSE 2020-07-10 22:52:20 +00:00
ovh-views.sql near final stuff before needing to move on ;( 2020-07-16 23:39:54 +02:00
README.md Merge remote-tracking branch 'origin/master' 2022-09-13 18:13:50 +02:00
untitled.sql last tweaks 2020-10-20 17:23:35 +02:00

ovh-stuff

Stuff for accessing/simplify OVH API related stuff

Nothing guaranteed, nothing supported... but would be great if you add your own additions etc. to help expand ;)

Might be specific for me, but use as you see/etc. fit

https://docs.ovh.com/ca/en/customer/first-steps-with-ovh-api/ https://ca.api.ovh.com/createApp/

The file to add your specific keys you fetched from https://ca.api.ovh.com/createApp/ secrets/Secrets.json:

{
    "AppKey": "fromCreateApp",
 "AppSecret": "AlsoFromCreateAppAbove",
  "Redirect": "http://www.example.com/"
}

For the automated Authorization to work, you need a file in $HOME/.Config.json (The words security issue comes to mind in big red letters), as shown here:

const homedir = require('os').homedir();
const ovhc=require(homedir+'/.Config.json');

that $HOME/.Config.json contains your email/OVH NIC handle (I mentioned security red flags??) and your password (definate problem) example:

{
 "Email": "sp00000-ovh",
  "Pass": "SecretPasswordToOVH"
}

(I haven't yet checked this with 2 factor authentication, but would be interesting to test etc.)

The ovh-api/pre_query.sh will do the needed (you need a functional puppeteer installation) with the above information to create the needed tickets etc.

once that is done, you can use ovh-api/post-query.sh or apiovh.sh to do queries that uses the function(s) in ovh-api/functions.sh

I've started to fetch data I'll be pushing into POstgreSQL's JSONB data structres for querying the needed data etc. from the servers.

Info from all dedicated servers: ./post-query.sh GET /dedicated/server | jq '.[]'| xargs -tn1 -I \{\} ./post-query.sh GET /dedicated/server/\{\}

<<<<<<< HEAD

pvesh get /pools/AfricaDirect --output-format json | jq -r '.members|map({id,node,name,type})[]|"pvesh get /nodes/"+.node+"/"+.id+"/config -output-format json |jq -s '''map({name,net0})[]|.+{id:""+.id+"",node:""+.node+""}'''"'|sh|jq -r '"pvesh set /nodes/"+.node+"/"+.id+"/config -net0 "+.net0+",link_down=1"'|sh -x

=======

origin/master