Crear un nuevo mecanismo
Genera un nuevo motor para la bóveda (SVault). El motor funciona como una agrupación de configuraciones. El motor tiene la configuración del tipo de formato de los datos, si hay algún tipo de almacenamiento interno o externo y si los datos tienen algún tipo de checksum para generar su sustituto.
Punto final: api/svault/engine
API_TOKEN="Place here your API Token"
curl --location --request POST 'https://service.dinamonetworks.io/api/svault/engine' \
--header 'Content-Type: application/json' \
--header "X-Api-Key: ${API_TOKEN}" \
--data-raw '{
"label": "myengine",
"storage": "internal",
"format": "base10",
"checksum": "nocheck"
}'
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"label\": \"myengine\",\n \"storage\": \"internal\",\n \"format\": \"base10\",\n \"checksum\": \"nocheck\"\n}");
Request request = new Request.Builder()
.url("https://service.dinamonetworks.io/api/svault/engine")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("X-Api-Key", "Place here your API Token")
.build();
Response response = client.newCall(request).execute();
var client = new RestClient("https://service.dinamonetworks.io/api/svault/engine");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("X-Api-Key", "Place here your API Token");
var body = @"{" + "\n" +
@" ""label"": ""myengine""," + "\n" +
@" ""storage"": ""internal""," + "\n" +
@" ""format"": ""base10""," + "\n" +
@" ""checksum"": ""nocheck""" + "\n" +
@"}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://service.dinamonetworks.io/api/svault/engine"
method := "POST"
payload := strings.NewReader(`{
"label": "myengine",
"storage": "internal",
"format": "base10",
"checksum": "nocheck"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("X-Api-Key", "Place here your API Token")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var settings = {
"url": "https://service.dinamonetworks.io/api/svault/engine",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json",
"X-Api-Key": "Place here your API Token"
},
"data": JSON.stringify({
"label": "myengine",
"storage": "internal",
"format": "base10",
"checksum": "nocheck"
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
Respuesta
{
"message": "Engine created successfully!!!",
"id": "2OWPQCQAAELU9NsN"
}