Skip to content

Instantly share code, notes, and snippets.

@preaction
Last active February 27, 2017 20:33
Show Gist options
  • Save preaction/1f3c816b66c161d6696cd96f6b212f98 to your computer and use it in GitHub Desktop.
Save preaction/1f3c816b66c161d6696cd96f6b212f98 to your computer and use it in GitHub Desktop.

I need to test a UI for a REST JSON API. I don't want to set up a database. I can't set up the dozens of remote machines that my UI interacts with each with different hardware and revealing different potential problems in my code. So I need a mock API that can test my UI without actually doing anything.

So let's set up a simple Mojolicious::Lite app that responds to a request with a JSON response.

XXX Example of single route

But, since we're an AJAX API, we need to explicitly allow cross browser requests:

XXX Cross browser things

That's pretty easy and shows how easy Mojolicious can be to get started. But I have dozens of routes in my application! Combined with all the possible data and its thousands of routes. How do I make all of them work without copy-paste every single route?

XXX Example of copy/paste every route

Let's match the whole path of the route and then just look up the template from that! Mojolicious lets us do this:

XXX Example with full path

Also lets us have variation based on the content type (format)

XXX Example with default format

So now I can just write a bunch of JSON in my script and it is part of my API.

But I'd like it to be easier to make lists of things: REST APIs often have one endpoint as a list and another as an individual item in that list. We can make a list by composing our individual parts using Mojolicious templates:

XXX Template include

But I also need to respond to POST requests and PUT requests. Lets add that to the template path, right up at the front.

XXX method in template path

And those POST/PUT requests should modify things while we're testing. For this we can use Mojolcious sessions:

XXX Try sessions for state

Now what if I need to test specific edge cases or run my API with different data in certain scenarios? Mojolicious has variants XXX

Finally, my API needs sone websockets. This isn't nearly as easy as the rest API, since the initial WebSocket handshake is just a simple GET request, which we already have a handler for! So, let's go back, check to see if the transaction is a websocket, then set up to send some messages over the socket.

XXX Websocket example

There's a few things I'd love to do here, including request/response data structures, delayed/repeating messages, and other such, but those will have to wait until I need them.

So, here's all the code. 20 lines that allow me to easily mock any kind of web API.

use Mojolicious::Lite;
hook after_build_tx => sub {
my ($tx, $app) = @_;
$tx->res->headers->header( 'Access-Control-Allow-Origin' => '*' );
$tx->res->headers->header( 'Access-Control-Allow-Methods' => 'GET, POST, PUT, PATCH, DELETE, OPTIONS' );
$tx->res->headers->header( 'Access-Control-Max-Age' => 3600 );
$tx->res->headers->header( 'Access-Control-Allow-Headers' => 'Content-Type, Authorization, X-Requested-With, X-SC-API-TOKEN' );
};
any '/*path' => { path => 'v1/server' } => sub {
my ( $c ) = @_;
if ( $c->tx->is_websocket ) {
$c->inactivity_timeout( 6000 );
# XXX: We could use some way to send mock messages via the
# websocket. Render the template to a string, parse it as JSON, and
# somehow allow delays between messages and/or repeating?
return $c->rendered( 101 );
}
# Allow all XmlHttpRequests to succeed
if ( $c->req->method eq 'OPTIONS' ) {
return $c->render(
status => 200,
text => '',
format => 'text',
);
}
return $c->render(
template => join( '/', lc $c->req->method, $c->stash( 'path' ) ),
variant => $c->app->mode,
format => 'json',
);
};
app->start;
__DATA__
@@ get/v1/bmc.json.ep
[
<%= include 'get/v1/bmc/1' %>,
<%= include 'get/v1/bmc/2' %>
]
@@ get/v1/server.json.ep
[
<%= include 'get/v1/server/1' %>,
<%= include 'get/v1/server/2' %>
]
@@ ws/v1/updates.json.ep
[]
@@ get/v1/location.json.ep
[
<%= include 'get/v1/location/1' %>,
<%= include 'get/v1/location/2' %>
]
@@ get/v1/location/1.json.ep
{
"created": "2017-01-20 15:01:30.254393-06",
"description": null,
"id": 1,
"name": "rack-1",
"parent": null,
"path": [{
"id": 1,
"name": "rack-1",
"type": "rack"
}],
"type": "rack",
"updated": "2017-01-20 15:01:30.254393-06"
}
@@ get/v1/location/2.json.ep
{
"created": "2017-01-20 15:01:30.264269-06",
"description": null,
"id": 2,
"name": "rack-2",
"parent": null,
"path": [{
"id": 2,
"name": "rack-2",
"type": "rack"
}],
"type": "rack",
"updated": "2017-01-20 15:01:30.264269-06"
}
@@ get/v1/bmc/1.json.ep
{
"hostname": "",
"id": 1,
"ip": "10.0.0.1",
"location": <%= include 'get/v1/location/1' %>,
"location_id": 1,
"mac": "01:02:03:04:05:06",
"port": "ge-0\/0\/30.0",
"power_state": true,
"protected": false,
"rack": "rack-1",
"server_id": 1,
"state": 2,
"switch": "tor2.ec137.ord6"
}
@@ get/v1/bmc/2.json.ep
{
"hostname": "",
"id": 2,
"ip": "10.0.0.2",
"location": <%= include 'get/v1/location/2' %>,
"location_id": 2,
"mac": "a1:a2:a3:a4:a5:a6",
"port": "ge-0\/1\/30.0",
"protected": false,
"rack": "rack-2",
"server_id": 3,
"state": 0,
"switch": "tor9.ec001.ord2"
}
@@ get/v1/server.json.ep
[
<%= include 'get/v1/server/1' %>,
<%= include 'get/v1/server/2' %>
]
@@ get/v1/server/1.json.ep
{
"bmc_id": 1,
"board": "Other",
"changed": "2017-01-17 15:01:01.02823-06",
"created": "2017-01-17 15:01:01.019941-06",
"data": {
"baseboard-product-name": "Other",
"bmc-mac": "01:02:03:04:05:06",
"cpu": {},
"memory": {},
"system-manufacturer": "Dell",
"system-product-name": "Whatever",
"system-serial-number": "012345",
"system-uuid": "00000000-0000-4000-0000-000000000000"
},
"disk_config": {
"megaraid": {
"0": {
"details": {
"bios_version": "6.18.03.0_4.16.07.00_0x06070400",
"fw_version": "4.241.00-4163",
"memory_size": "1024MB",
"product_name": "PERC H730 Mini",
"serial_no": "52S01QH"
},
"enclosures": {
"0": {
"device": "32",
"pd_count": "2",
"pds": {
"0": {
"manufacturer": "TOSHIBA",
"model": "AL13SXB300N",
"serial": "DF0925G0A02LF92A",
"size": 279396000000,
"status": "Online, Spun Up",
"wwn": "500003961821D058"
},
"1": {
"manufacturer": "TOSHIBA",
"model": "AL13SXB300N",
"serial": "DF0925W0A08SF92A",
"size": 279396000000,
"status": "Online, Spun Up",
"wwn": "50000396182830CC"
}
},
"slots": 8
}
},
"id": 0,
"pci": {
"bus": "2",
"device": "0",
"function": "0"
},
"vds": {
"0": {
"badblocksexist": "No",
"canspinupin1minute": "Yes",
"currentaccesspolicy": "Read/Write",
"currentcachepolicy": "WriteBack, ReadAdaptive, Cached, No Write Cache if Bad BBU",
"currentpowersavingspolicy": "None",
"defaultaccesspolicy": "Read/Write",
"defaultcachepolicy": "WriteBack, ReadAdaptive, Cached, No Write Cache if Bad BBU",
"defaultpowersavingspolicy": "Controller Defined",
"diskcachepolicy": "Disk's Default",
"encryptiontype": "None",
"isvdcached": "No",
"isvdemulated": "No",
"ldhasdrivesthatsupportt10powerconditions": "Yes",
"ldsioprofilesupportsmaxpowersavingswithcachedwrites": "No",
"mirrordata": "278.875 GB",
"name": "",
"numberofdrives": "2",
"numberofspans": "1",
"path": {
"by-id": "wwn-0x644a84201d115d001de7ad635c6361c2",
"by-path": "pci-0000:02:00.0-scsi-0:2:0:0"
},
"pds": {
"0": {
"0": {
"0": [
"32:0"
],
"1": [
"32:1"
]
}
}
},
"pitype": "No PI",
"raidlevel": "Primary-1, Secondary-0, RAID Level Qualifier-0",
"sectorsize": "512",
"size": "278.875 GB",
"span:0-numberofpds": "2",
"spandepth": "1",
"state": "Optimal",
"stripsize": "64 KB"
}
}
}
}
},
"disks": [
{
"manufacturer": "TOSHIBA",
"model": "AL13SXB300N",
"serial": "DF0925G0A02LF92A",
"size": 279396000000,
"status": "Online, Spun Up",
"wwn": "500003961821D058"
},
{
"manufacturer": "TOSHIBA",
"model": "AL13SXB300N",
"serial": "DF0925W0A08SF92A",
"size": 279396000000,
"status": "Online, Spun Up",
"wwn": "50000396182830CC"
}
],
"diskless_ip": null,
"id": 1,
"location_id": 1,
"model": "Whatever",
"port_map": null,
"protected": 0,
"seen": "2017-01-20 15:01:30.303602-06",
"serial": "012345",
"summary": "Dell Whatever x -core 0.00 GiB ",
"uuid": "00000000-0000-4000-0000-000000000000",
"vendor": "Dell"
}
@@ get/v1/server/2.json.ep
{
"bmc_id": 2,
"board": "Other",
"changed": "2017-01-20 15:01:30.312556-06",
"created": "2017-01-20 15:01:30.310157-06",
"data": {
"baseboard-product-name": "Other",
"bmc-mac": "a1:a2:a3:a4:a5:a6",
"cpu": {},
"memory": {},
"system-manufacturer": "SuperMicro",
"system-product-name": "Whatever",
"system-serial-number": "adf113ad",
"system-uuid": "00000000-0000-4000-0000-999999999999"
},
"disk_config": {
"megaraid": <%= include 'get/v1/server/2/raid' %>
},
"diskless_ip": null,
"disks": [
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83QZ",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E750"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83VD",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E3C8"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83RM",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E71C"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83JE",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EF2C"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83MV",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EB70"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83RV",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E7A4"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83NV",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EA44"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83S7",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E5F8"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83KC",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EDAC"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83JZ",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EDBC"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83WD",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E2E0"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83XX",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E230"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83Y2",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E21C"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83PD",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E9F8"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83KB",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EE44"
},
{
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83YB",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E1AC"
}
],
"id": 2,
"location_id": 2,
"model": "Whatever",
"port_map": null,
"protected": 0,
"seen": "2017-01-20 15:01:30.310157-06",
"serial": "adf113ad",
"summary": "SuperMicro Whatever x -core 0.00 GiB ",
"uuid": "00000000-0000-4000-0000-999999999999",
"vendor": "SuperMicro"
}
@@ get/v1/server/1/raid.json.ep
{
"id": 0,
"pci": {
"bus": "1",
"device": "0",
"function": "0"
},
"vds": {
},
"details": {
"serial_no": "27S04EB",
"fw_version": "3.131.05-8147",
"memory_size": "512MB",
"bios_version": "5.42.00.1_4.12.05.00_0x05290003",
"product_name": "PERC H710 Mini"
},
"enclosures": {
"0": {
"pds": {
"0": {
"wwn": "5000c5004e8359d4",
"size": 465761000000,
"model": "AA09",
"serial": null,
"status": "Online, Spun Up",
"manufacturer": "9XF1WJSCST9500620NS"
},
"1": {
"wwn": "5000C5006BBB8A94",
"size": 136732000000,
"model": "ST9146853SS",
"serial": "YS0C6XM35A72",
"status": "Unconfigured(good), Spun Up",
"manufacturer": "SEAGATE"
},
"2": {
"wwn": "5000C50059881060",
"size": 136732000000,
"model": "ST9146853SS",
"serial": "YS096XM1E971",
"status": "Online, Spun Up",
"manufacturer": "SEAGATE"
},
"3": {
"wwn": "5000C5005987A0BC",
"size": 136732000000,
"model": "ST9146853SS",
"serial": "YS096XM1EB24",
"status": "Online, Spun Up",
"manufacturer": "SEAGATE"
},
"4": {
"wwn": "5000C5006C5D2A40",
"size": 136732000000,
"model": "ST9146853SS",
"serial": "YS0A6XM3B1CK",
"status": "Online, Spun Up",
"manufacturer": "SEAGATE"
}
},
"slots": 8,
"device": "32",
"pd_count": "5"
}
}
}
@@ get/v1/server/2/raid.json.ep
{
"0": {
"details": {
"bios_version": "6.22.03.0_4.16.08.00_0x060B0200",
"fw_version": "4.270.00-3972",
"memory_size": "2048MB",
"product_name": "LSI 3108 MegaRAID",
"serial_no": ""
},
"enclosures": {
"0": {
"device": "0",
"pd_count": "12",
"pds": {
"0": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83WD",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E2E0"
},
"1": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83S7",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E5F8"
},
"2": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83YB",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E1AC"
},
"3": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83PD",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E9F8"
},
"4": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83RV",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E7A4"
},
"5": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83KB",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EE44"
},
"6": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83XX",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E230"
},
"7": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83Y2",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E21C"
},
"8": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83JZ",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EDBC"
},
"9": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83MV",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EB70"
},
"10": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83NV",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EA44"
},
"11": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83KC",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EDAC"
}
},
"slots": 12
},
"1": {
"device": "252",
"pd_count": "4",
"pds": {
"0": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83RM",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E71C"
},
"1": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83VD",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E3C8"
},
"2": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83JE",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EF2C"
},
"3": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83QZ",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E750"
}
},
"slots": 8
}
},
"id": 0,
"pci": {
"bus": "1",
"device": "0",
"function": "0"
},
"vds": {}
}
}
@@ post/v1/server/1/raid/1.json.ep
{
"details": {
"bios_version": "6.22.03.0_4.16.08.00_0x060B0200",
"fw_version": "4.270.00-3972",
"memory_size": "2048MB",
"product_name": "LSI 3108 MegaRAID",
"serial_no": ""
},
"enclosures": {
"0": {
"device": "0",
"pd_count": "12",
"pds": {
"0": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83WD",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E2E0"
},
"1": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83S7",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E5F8"
},
"2": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83YB",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E1AC"
},
"3": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83PD",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E9F8"
},
"4": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83RV",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E7A4"
},
"5": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83KB",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EE44"
},
"6": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83XX",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E230"
},
"7": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83Y2",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E21C"
},
"8": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83JZ",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EDBC"
},
"9": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83MV",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EB70"
},
"10": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83NV",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EA44"
},
"11": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83KC",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EDAC"
}
},
"slots": 12
},
"1": {
"device": "252",
"pd_count": "4",
"pds": {
"0": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83RM",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E71C"
},
"1": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83VD",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E3C8"
},
"2": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83JE",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6EF2C"
},
"3": {
"manufacturer": "SEAGATE",
"model": "ST4000NM0023",
"serial": "0006Z1ZB83QZ",
"size": 3638000000000,
"status": "Unconfigured(good), Spun down",
"wwn": "5000C50085A6E750"
}
},
"slots": 8
}
},
"id": 0,
"pci": {
"bus": "1",
"device": "0",
"function": "0"
},
"vds": {}
}
@@ delete/v1/server/1/raid/1/1.json.ep
[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment