Add association between FabricAdapter and Port
As a course of implementing PortCollection and Port schemas,
this commit adds a new association to describe the links
between FabricAdapter and Port.
- FabricAdapter may be "connected_to" one or more ports,
- A port may also be "connecting" one or more items.
The generic associations of 'containing' and 'contained_by'
are considered, but they are for the physically "containing" items.
Related schemas are:
- https://redfish.dmtf.org/schemas/v1/Port.v1_8_0.json
```
"Links": {
"description": "The links to other resources that are related to this resource.",
"properties": {
"AssociatedEndpoints": {
"description": "An array of links to the endpoints at the other end of the link.",
"items": {
"$ref": "http://redfish.dmtf.org/schemas/v1/Endpoint.json#/definitions/Endpoint"
},
"longDescription": "This property shall contain an array of links to resources of type Endpoint that represent the endpoints to which this port is connected.",
"readonly": true,
"type": "array"
},
"AssociatedEndpoints@odata.count": {
"$ref": "http://redfish.dmtf.org/schemas/v1/odata-v4.json#/definitions/count"
},
```
- https://redfish.dmtf.org/schemas/v1/FabricAdapter.v1_5_0.json
```
"Ports": {
"$ref": "http://redfish.dmtf.org/schemas/v1/PortCollection.json#/definitions/PortCollection",
"description": "The link to the collection of ports that exist on the fabric adapter.",
"longDescription": "This property shall contain a link to a Resource Collection of type PortCollection.",
"readonly": true
},
```
Change-Id: I2cc8caf0128bf1cfa619312e689fe02039977e44
Signed-off-by: Myung Bae <myungbae@us.ibm.com>
diff --git a/gen/xyz/openbmc_project/Inventory/Connector/Port/meson.build b/gen/xyz/openbmc_project/Inventory/Connector/Port/meson.build
new file mode 100644
index 0000000..aa197d7
--- /dev/null
+++ b/gen/xyz/openbmc_project/Inventory/Connector/Port/meson.build
@@ -0,0 +1,15 @@
+# Generated file; do not modify.
+generated_sources += custom_target(
+ 'xyz/openbmc_project/Inventory/Connector/Port__cpp'.underscorify(),
+ input: [ '../../../../../../yaml/xyz/openbmc_project/Inventory/Connector/Port.interface.yaml', ],
+ output: [ 'common.hpp', 'server.cpp', 'server.hpp', 'client.hpp', ],
+ depend_files: sdbusplusplus_depfiles,
+ command: [
+ sdbuspp_gen_meson_prog, '--command', 'cpp',
+ '--output', meson.current_build_dir(),
+ '--tool', sdbusplusplus_prog,
+ '--directory', meson.current_source_dir() / '../../../../../../yaml',
+ 'xyz/openbmc_project/Inventory/Connector/Port',
+ ],
+)
+
diff --git a/gen/xyz/openbmc_project/Inventory/Connector/meson.build b/gen/xyz/openbmc_project/Inventory/Connector/meson.build
index 39e673e..afdd161 100644
--- a/gen/xyz/openbmc_project/Inventory/Connector/meson.build
+++ b/gen/xyz/openbmc_project/Inventory/Connector/meson.build
@@ -14,6 +14,21 @@
],
)
+subdir('Port')
+generated_others += custom_target(
+ 'xyz/openbmc_project/Inventory/Connector/Port__markdown'.underscorify(),
+ input: [ '../../../../../yaml/xyz/openbmc_project/Inventory/Connector/Port.interface.yaml', ],
+ output: [ 'Port.md' ],
+ depend_files: sdbusplusplus_depfiles,
+ command: [
+ sdbuspp_gen_meson_prog, '--command', 'markdown',
+ '--output', meson.current_build_dir(),
+ '--tool', sdbusplusplus_prog,
+ '--directory', meson.current_source_dir() / '../../../../../yaml',
+ 'xyz/openbmc_project/Inventory/Connector/Port',
+ ],
+)
+
subdir('Slot')
generated_others += custom_target(
'xyz/openbmc_project/Inventory/Connector/Slot__markdown'.underscorify(),
diff --git a/yaml/xyz/openbmc_project/Inventory/Connector/Port.interface.yaml b/yaml/xyz/openbmc_project/Inventory/Connector/Port.interface.yaml
new file mode 100644
index 0000000..eefd9b7
--- /dev/null
+++ b/yaml/xyz/openbmc_project/Inventory/Connector/Port.interface.yaml
@@ -0,0 +1,11 @@
+description: >
+ This defines a Port of a switch, controller, chassis, or any other device
+ that could be connected to another entity.
+
+association:
+ name: connected_to
+ description: >
+ Objects that are connected at the other end of the link.
+ reverse_name: connecting
+ required_endpoint_interfaces:
+ - xyz.openbmc_project.Inventory.Item.FabricAdapter
diff --git a/yaml/xyz/openbmc_project/Inventory/Item/FabricAdapter.interface.yaml b/yaml/xyz/openbmc_project/Inventory/Item/FabricAdapter.interface.yaml
index 315f6bb..cd3cf91 100644
--- a/yaml/xyz/openbmc_project/Inventory/Item/FabricAdapter.interface.yaml
+++ b/yaml/xyz/openbmc_project/Inventory/Item/FabricAdapter.interface.yaml
@@ -2,3 +2,12 @@
Implement to provide fabric adapter attributes. A physical fabric adapter
capable of connecting to an interconnect fabric. Examples include but are
not limited to Ethernet, NVMe over Fabrics, etc.
+
+associations:
+ name: connecting
+ description: >
+ Objects that implement FabricAdapter can optionally implement the
+ connecting association to provide links to one or more Ports.
+ reverse_name: connected_to
+ required_endpoint_interfaces:
+ - xyz.openbmc_project.Inventory.Connector.Port
diff --git a/yaml/xyz/openbmc_project/Inventory/Item/README.md b/yaml/xyz/openbmc_project/Inventory/Item/README.md
index 086e285..d9709a0 100644
--- a/yaml/xyz/openbmc_project/Inventory/Item/README.md
+++ b/yaml/xyz/openbmc_project/Inventory/Item/README.md
@@ -24,3 +24,4 @@
- led and item: `{identifying, identified_by}`
`{fault_identifying, fault_identified_by}`
- powerSupply and item: `{powering, powered_by}`
+- FabricAdapter and port: `{connecting, connected_to}`