Skip to content

Commit

Permalink
feat: Implemented mouseflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Leaseweb CI committed Feb 24, 2025
1 parent 3d5608f commit 01d9005
Show file tree
Hide file tree
Showing 37 changed files with 871 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic?limit=20&offset=10"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-LSW-Auth", "REPLACE_KEY_VALUE")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182"

req, _ := http.NewRequest("DELETE", url, nil)

req.Header.Add("X-LSW-Auth", "REPLACE_KEY_VALUE")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main

import (
"fmt"
"net/http"
"io/ioutil"
)

func main() {

url := "https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-LSW-Auth", "REPLACE_KEY_VALUE")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package main

import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)

func main() {

url := "https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182"

payload := strings.NewReader("{\"threshold\":{\"value\":0,\"unit\":\"MB\"},\"timePeriod\":\"DAY\",\"action\":\"POWER_OFF\",\"channels\":[{\"type\":\"EMAIL\",\"contactGroup\":\"TECHNICAL\"}]}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-LSW-Auth", "REPLACE_KEY_VALUE")
req.Header.Add("content-type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package main

import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)

func main() {

url := "https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182"

payload := strings.NewReader("{\"threshold\":{\"value\":0,\"unit\":\"MB\"},\"timePeriod\":\"DAY\",\"action\":\"POWER_OFF\",\"channels\":[{\"type\":\"EMAIL\",\"contactGroup\":\"TECHNICAL\"}]}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("X-LSW-Auth", "REPLACE_KEY_VALUE")
req.Header.Add("content-type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

fmt.Println(res)
fmt.Println(string(body))

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const settings = {
"async": true,
"crossDomain": true,
"url": "https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic?limit=20&offset=10",
"method": "GET",
"headers": {
"X-LSW-Auth": "REPLACE_KEY_VALUE"
}
};

$.ajax(settings).done(function (response) {
console.log(response);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const settings = {
"async": true,
"crossDomain": true,
"url": "https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182",
"method": "DELETE",
"headers": {
"X-LSW-Auth": "REPLACE_KEY_VALUE"
}
};

$.ajax(settings).done(function (response) {
console.log(response);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const settings = {
"async": true,
"crossDomain": true,
"url": "https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182",
"method": "GET",
"headers": {
"X-LSW-Auth": "REPLACE_KEY_VALUE"
}
};

$.ajax(settings).done(function (response) {
console.log(response);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const settings = {
"async": true,
"crossDomain": true,
"url": "https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182",
"method": "POST",
"headers": {
"X-LSW-Auth": "REPLACE_KEY_VALUE",
"content-type": "application/json"
},
"processData": false,
"data": "{\"threshold\":{\"value\":0,\"unit\":\"MB\"},\"timePeriod\":\"DAY\",\"action\":\"POWER_OFF\",\"channels\":[{\"type\":\"EMAIL\",\"contactGroup\":\"TECHNICAL\"}]}"
};

$.ajax(settings).done(function (response) {
console.log(response);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const settings = {
"async": true,
"crossDomain": true,
"url": "https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182",
"method": "PUT",
"headers": {
"X-LSW-Auth": "REPLACE_KEY_VALUE",
"content-type": "application/json"
},
"processData": false,
"data": "{\"threshold\":{\"value\":0,\"unit\":\"MB\"},\"timePeriod\":\"DAY\",\"action\":\"POWER_OFF\",\"channels\":[{\"type\":\"EMAIL\",\"contactGroup\":\"TECHNICAL\"}]}"
};

$.ajax(settings).done(function (response) {
console.log(response);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'limit' => '20',
'offset' => '10'
]));

$request->setHeaders([
'X-LSW-Auth' => 'REPLACE_KEY_VALUE'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182');
$request->setRequestMethod('DELETE');
$request->setHeaders([
'X-LSW-Auth' => 'REPLACE_KEY_VALUE'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182');
$request->setRequestMethod('GET');
$request->setHeaders([
'X-LSW-Auth' => 'REPLACE_KEY_VALUE'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"threshold":{"value":0,"unit":"MB"},"timePeriod":"DAY","action":"POWER_OFF","channels":[{"type":"EMAIL","contactGroup":"TECHNICAL"}]}');

$request->setRequestUrl('https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
'X-LSW-Auth' => 'REPLACE_KEY_VALUE',
'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{"threshold":{"value":0,"unit":"MB"},"timePeriod":"DAY","action":"POWER_OFF","channels":[{"type":"EMAIL","contactGroup":"TECHNICAL"}]}');

$request->setRequestUrl('https://api.leaseweb.com/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182');
$request->setRequestMethod('PUT');
$request->setBody($body);

$request->setHeaders([
'X-LSW-Auth' => 'REPLACE_KEY_VALUE',
'content-type' => 'application/json'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import http.client

conn = http.client.HTTPSConnection("api.leaseweb.com")

headers = { 'X-LSW-Auth': "REPLACE_KEY_VALUE" }

conn.request("GET", "/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic?limit=20&offset=10", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import http.client

conn = http.client.HTTPSConnection("api.leaseweb.com")

headers = { 'X-LSW-Auth': "REPLACE_KEY_VALUE" }

conn.request("DELETE", "/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import http.client

conn = http.client.HTTPSConnection("api.leaseweb.com")

headers = { 'X-LSW-Auth': "REPLACE_KEY_VALUE" }

conn.request("GET", "/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import http.client

conn = http.client.HTTPSConnection("api.leaseweb.com")

payload = "{\"threshold\":{\"value\":0,\"unit\":\"MB\"},\"timePeriod\":\"DAY\",\"action\":\"POWER_OFF\",\"channels\":[{\"type\":\"EMAIL\",\"contactGroup\":\"TECHNICAL\"}]}"

headers = {
'X-LSW-Auth': "REPLACE_KEY_VALUE",
'content-type': "application/json"
}

conn.request("POST", "/publicCloud/v1/vps/vps/999999999/notificationSettings/dataTraffic/3a042956-0689-45dc-8322-8b8325464182", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
Loading

0 comments on commit 01d9005

Please sign in to comment.