Skip to content

Commit

Permalink
Add association between FabricAdapter and Port
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
baemyung authored and williamspatrick committed Apr 28, 2023
1 parent a82161a commit df32eb5
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
15 changes: 15 additions & 0 deletions gen/xyz/openbmc_project/Inventory/Connector/Port/meson.build
Original file line number Diff line number Diff line change
@@ -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',
],
)

15 changes: 15 additions & 0 deletions gen/xyz/openbmc_project/Inventory/Connector/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ generated_others += custom_target(
],
)

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(),
Expand Down
11 changes: 11 additions & 0 deletions yaml/xyz/openbmc_project/Inventory/Connector/Port.interface.yaml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@ description: >
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
1 change: 1 addition & 0 deletions yaml/xyz/openbmc_project/Inventory/Item/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ Document ObjectMapper association forward and reverse names as follows:
- led and item: `{identifying, identified_by}`
`{fault_identifying, fault_identified_by}`
- powerSupply and item: `{powering, powered_by}`
- FabricAdapter and port: `{connecting, connected_to}`

0 comments on commit df32eb5

Please sign in to comment.