Skip to content

Commit

Permalink
Merge pull request #2 from SaaShup/monthly_payment
Browse files Browse the repository at this point in the history
✨ implement monthly payemtn
  • Loading branch information
dzove855 authored Oct 1, 2024
2 parents 73d22ad + 407302b commit 9696764
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 13 deletions.
89 changes: 77 additions & 12 deletions flows.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
{
"id": "6c4196a5da9e173c",
"port": 0
},
{
"id": "dadb49d4dd54c930",
"port": 0
}
]
}
Expand Down Expand Up @@ -280,7 +284,7 @@
"fa6f862ce5995b04"
],
"uncaught": false,
"x": 1130,
"x": 850,
"y": 220,
"wires": [
[]
Expand All @@ -302,6 +306,21 @@
]
]
},
{
"id": "dadb49d4dd54c930",
"type": "catch",
"z": "f26f92b9561d3735",
"name": "",
"scope": [
"2d0de34508e101ba"
],
"uncaught": false,
"x": 850,
"y": 280,
"wires": [
[]
]
},
{
"id": "18db3dc4cf3c44c8",
"type": "http in",
Expand All @@ -311,7 +330,7 @@
"method": "post",
"upload": false,
"swaggerDoc": "",
"x": 110,
"x": 130,
"y": 120,
"wires": [
[
Expand Down Expand Up @@ -437,7 +456,7 @@
"from": "",
"to": "",
"reg": false,
"x": 330,
"x": 350,
"y": 120,
"wires": [
[
Expand Down Expand Up @@ -589,7 +608,7 @@
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\t \"server\":{\t \"flavorRef\": msg.createvm.flavor,\t \"name\": msg.createvm.name,\t \"imageRef\": msg.createvm.image,\t \"networks\":[\t {\t \"uuid\": msg.createvm.network\t }\t ],\t \"key_name\": msg.createvm.keyPair,\t \"user_data\": msg.createvm.userData\t }\t}",
"to": "{\t \"server\":{\t \"flavorRef\": msg.createvm.flavor,\t \"name\": msg.createvm.name,\t \"imageRef\": msg.createvm.image,\t \"networks\":[\t {\t \"uuid\": msg.createvm.network\t }\t ],\t \"metadata\": {\t \"ovh-monthly-instance\": msg.createvm.paymentPeriod = \"monthly\" ? \"1\" : \"0\"\t },\t \"key_name\": msg.createvm.keyPair,\t \"user_data\": msg.createvm.userData\t }\t}",
"tot": "jsonata"
}
],
Expand Down Expand Up @@ -627,7 +646,7 @@
"wires": [
[
"cac3c2207ec1f1d9",
"bdc41e0727eed85d"
"39d57fde5f738cb9"
]
]
},
Expand All @@ -651,8 +670,8 @@
"name": "",
"statusCode": "",
"headers": {},
"x": 1110,
"y": 260,
"x": 1190,
"y": 240,
"wires": []
},
{
Expand Down Expand Up @@ -725,7 +744,7 @@
"links": [
"d2fe6bfa6a8cae77"
],
"x": 1105,
"x": 1275,
"y": 340,
"wires": []
},
Expand Down Expand Up @@ -994,6 +1013,29 @@
"y": 460,
"wires": []
},
{
"id": "39d57fde5f738cb9",
"type": "switch",
"z": "f498656cd7178fd2",
"name": "",
"property": "payload.server",
"propertyType": "msg",
"rules": [
{
"t": "nempty"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 1130,
"y": 300,
"wires": [
[
"bdc41e0727eed85d"
]
]
},
{
"id": "2e3451e108a30101",
"type": "link in",
Expand All @@ -1003,11 +1045,11 @@
"d5a303be485f823f",
"e4159275aef7dd1b"
],
"x": 245,
"x": 125,
"y": 240,
"wires": [
[
"1b9a3a26756111fd"
"664ba98f5286c753"
]
]
},
Expand Down Expand Up @@ -1058,7 +1100,7 @@
"from": "",
"to": "",
"reg": false,
"x": 420,
"x": 560,
"y": 240,
"wires": [
[
Expand All @@ -1082,7 +1124,7 @@
"authType": "",
"senderr": false,
"headers": [],
"x": 650,
"x": 750,
"y": 240,
"wires": [
[
Expand Down Expand Up @@ -1352,5 +1394,28 @@
"wires": [
[]
]
},
{
"id": "664ba98f5286c753",
"type": "switch",
"z": "0f9d09fb97baf1f4",
"name": "Run Netbox only if variable is set",
"property": "NETBOX_URL",
"propertyType": "env",
"rules": [
{
"t": "nempty"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 300,
"y": 240,
"wires": [
[
"1b9a3a26756111fd"
]
]
}
]
10 changes: 9 additions & 1 deletion schema/createvm-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
"keyPair": {
"type": "string"
},
"paymentPeriod": {
"type": "string"
"enum": [
"hourly",
"monthly"
]
},
"userData": {
"type": "string"
}
Expand All @@ -56,7 +63,8 @@
"name",
"image",
"network",
"keyPair"
"keyPair",
"paymentPeriod"
]
}

0 comments on commit 9696764

Please sign in to comment.