forked from kleprevost/saladcat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_salad_hashcat.py
41 lines (36 loc) · 1.21 KB
/
create_salad_hashcat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import requests
# EDIT THESE VARIABLES
salad_org_name = "myorg"
salad_project_name = "myproject"
salad_api_key = "mykey"
container_group_name = "saladcat"
hashtopolis_api_server_url = "http://myip:myport/api/server.php"
hashtopolis_voucher = "myvoucher"
url = "https://api.salad.com/api/public/organizations/"+salad_org_name+"/projects/"+salad_project_name+"/containers"
# This payload will create a new container group on Salad.
# The default settings are 4 CPU cores, 30gb RAM (max), and a 4090.
payload = {
"name": container_group_name,
"container": {
"image": "kleprevost/hashtopolis-hashcat-salad:latest",
"resources": {
"cpu": 4,
"memory": 30720,
"gpu_classes":["ed563892-aacd-40f5-80b7-90c9be6c759b"],
"storage_amount":53687091200
},
"command": []
},
"environment_variables": {
"API_SERVER_URL":hashtopolis_api_server_url,
"VOUCHER":hashtopolis_voucher},
"autostart_policy": False,
"restart_policy": "always",
"replicas": 1
}
headers = {
"Salad-Api-Key": salad_api_key,
"Content-Type": "application/json"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)