Conversation
|
|
||
| /// Represents a DASD device (specific to s390x systems). | ||
| #[derive(Clone, Debug, Serialize, Default, utoipa::ToSchema)] | ||
| pub struct DASDDevice { |
There was a problem hiding this comment.
Some of the fields in this struct (status, device_type and/or access_type) might deserve an enum.
There was a problem hiding this comment.
btw resulting json is not consistent with others. I think agreemend is snakeCase...so let me change it to #[serde(rename_all = "camelCase")]
| Ok(devices) | ||
| } | ||
|
|
||
| pub async fn format(&self, ids: &[&str]) -> Result<String, ServiceError> { |
There was a problem hiding this comment.
API looks strange, it allows formating multiple DASDs but it return only one path for job.
There was a problem hiding this comment.
There was a problem hiding this comment.
there is only one job, that is ok, but then we need to check the status for each device, I think the missing part is the job Summary call on formatProgress callback.
https://github.com/openSUSE/agama/blob/master/web/src/client/storage.js#L891
There was a problem hiding this comment.
I say nothing, it already uses the Summary but the DASD path is not sent at all...
see ... https://github.com/openSUSE/agama/pull/1532/files#diff-481b9b86ced79110f138995e6097a0f0cde62016924c72f1c5c6397940566654R210
and ... https://github.com/openSUSE/agama/pull/1532/files#diff-481b9b86ced79110f138995e6097a0f0cde62016924c72f1c5c6397940566654R220
|
|
||
| #[derive(Clone, Debug, Serialize)] | ||
| #[serde(tag = "type")] | ||
| #[serde(rename_all = "camelCase", tag = "type")] |
There was a problem hiding this comment.
good, I recheck that it affects only dasd format event. So it is safe.
Bring back the DASD management support adapting the web UI using the new HTTP/JSON API introduced by #1532 --------- Co-authored-by: Knut Anderssen <kanderssen@suse.com> Co-authored-by: Imobach González Sosa <igonzalezsosa@suse.com>
Prepare for releasing Agama 10· * #1263 * #1330 * #1407 * #1408 * #1410 * #1411 * #1412 * #1416 * #1417 * #1419 * #1420 * #1421 * #1422 * #1423 * #1424 * #1425 * #1428 * #1429 * #1430 * #1431 * #1432 * #1433 * #1436 * #1437 * #1438 * #1439 * #1440 * #1441 * #1443 * #1444 * #1445 * #1449 * #1450 * #1451 * #1452 * #1453 * #1454 * #1455 * #1456 * #1457 * #1459 * #1460 * #1462 * #1464 * #1465 * #1466 * #1467 * #1468 * #1469 * #1470 * #1471 * #1472 * #1473 * #1475 * #1476 * #1477 * #1478 * #1479 * #1480 * #1481 * #1482 * #1483 * #1484 * #1485 * #1486 * #1487 * #1488 * #1489 * #1491 * #1492 * #1493 * #1494 * #1496 * #1497 * #1498 * #1499 * #1500 * #1501 * #1502 * #1503 * #1504 * #1505 * #1506 * #1507 * #1508 * #1510 * #1511 * #1512 * #1513 * #1514 * #1515 * #1516 * #1517 * #1518 * #1519 * #1520 * #1522 * #1523 * #1524 * #1525 * #1526 * #1527 * #1528 * #1529 * #1530 * #1531 * #1532 * #1533 * #1534 * #1535 * #1536 * #1537 * #1540 * #1541 * #1543 * #1544 * #1545 * #1546 * #1547 * #1548 * #1549 * #1550 * #1552 * #1553 * #1554 * #1555 * #1556 * #1557 * #1558 * #1559 * #1560 * #1562 * #1563 * #1565 * #1566 * #1567 * #1568 * #1569 * #1570 * #1571 * #1572 * #1573 * #1574 * #1575 * #1576 * #1577 * #1578 * #1579 * #1580 * #1581 * #1583 * #1584 * #1585 * #1586 * #1587 * #1588 * #1589 * #1590 * #1591 * #1592 * #1593 * #1596 * #1597 * #1598 * #1600 * #1602 * #1605 * #1606 * #1607 * #1608 * #1610 * #1611 * #1612 * #1613 * #1614 * #1619 * #1620 * #1621
Trello: https://trello.com/c/2LC8JEZR/3743-8-agama-adapt-dasd-configuration-to-current-architecture
This PR is the first step to bring back support for DASD devices on s390x architectures. It includes:
After some discussion, we decided to retain the original intention of the D-Bus API at HTTP level.
Examples
This section contains a few examples you can use to explore the API. For the ones using
curl, it is required to have aheaders.txtfile containing the credentials (similar to the following example, but replacingTOKENwith your actual token):DASD operations
Remember that the
-kdisables the SSL certificate checking.Probing for DASD devices
curl -k -H @headers.txt -X POST https://$AGAMA_SERVER/api/storage/dasd/probeListing DASD devices
Enabling DASD devices
Disabling devices
Setting the DIAG attribute
Formatting devices
Jobs operation
Listing jobs
Events
The PR adds the following events:
DASDDeviceAdded,DASDDeviceChanedandDASDDeviceRemoved.JobAdded,JobChangedandJobRemoved.DASDFormatProgress.Let's see a few examples:
Formatting progress
{ "type": "DASDFormatJobChanged", "job_id": "/org/opensuse/Agama/Storage1/jobs/9", "total": 30050, "step": 30050, "done": true }DASD device detected
{ "type": "DASDDeviceAdded", "device": { "id": "0.0.0160", "enabled": true, "device_name": "dasda", "formatted": false, "diag": false, "status": "no_format", "device_type": "ECKD", "access_type": "rw", "partition_info": "" } }DASD device changes
{ "type": "DASDDeviceChanged", "device": { "id": "0.0.0160", "enabled": true, "device_name": "dasda", "formatted": false, "diag": false, "status": "no_format", "device_type": "ECKD", "access_type": "rw", "partition_info": "" } }A notes about signals
We have discussed whether we are abusing standard D-Bus signals a bit. For instance, we rely heavily on
PropertiesChanged,InterfacesAdded,InterfacesRemoved, etc., even for meaningful and important system events. Then, the client code needs to figure out what those signals actually mean. Also, unless you use a proxy (and that's not always possible), you cannot rely on the type checking that the introspection offers.Of course, that's out of the scope of this pull request.
Code repetition
As you might notice, there is quite some repetitive code. At this point, I just wanted to have some working code. We can reduce the repetition later. Improving our signals would help reduce the amount of code on the client side.