Skip to content

Commit

Permalink
change data path and readme (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryli17 authored Nov 18, 2024
1 parent 8b70c74 commit 7ca54cf
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 35 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# OS X Finder Files
.DS_Store

# IDE files
.idea

# Local Setup Scripts for Repo
local_helper_scripts/*
81 changes: 73 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,84 @@
# cloud-events
# Equinix CloudEvents

Equinix published [CloudEvent](https://cloudevents.io/) Types

Definitive "source of truth" for the Equinix Observability event data formats
Definitive "source of truth" for the Equinix Interconnection Observability event data formats

## CloudEvents in this repository

The following data payloads are the supported events and formats for Equinix Observability
The following data payloads are the supported events and formats for Equinix Interconnection Observability

<!-- CATALOG_GENERATION_START -->
### Equinix Fabric ChangeAlert
#### DataSchema [JSON](https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/ChangeAlert.json)
#### Data Type
`equinix.events.fabric.v1.ChangeAlert`
#### CloudEvent Type(s)

|Product|Schemas|Types|
|Equinix Fabric ChangeAlert|[JSON](https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/events/fabric/v1/ChangeAlert.json)|<br>Data Type:<br>`equinix.events.fabric.v1.ChangeAlert`<br>CloudEvent Type(s):<br><br>|
|Equinix Fabric ChangeEvent|[JSON](https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/events/fabric/v1/ChangeEvent.json)|<br>Data Type:<br>`equinix.events.fabric.v1.ChangeEvent`<br>CloudEvent Type(s):<br>`equinix.fabric.router.state.provisioning`<br>`equinix.fabric.router.state.provisioned`<br>`equinix.fabric.router.state.reprovisioning`<br>`equinix.fabric.router.state.deprovisioning`<br>`equinix.fabric.router.state.deprovisioned`<br>`equinix.fabric.router.state.failed`<br>`equinix.fabric.router.state.not_provisioned`<br>`equinix.fabric.router.state.not_deprovisioned`<br>`equinix.fabric.port.state.provisioned`<br>`equinix.fabric.port.state.deprovisioned`<br>`equinix.fabric.port.state.failed`<br>`equinix.fabric.port.status.up`<br>`equinix.fabric.port.status.down`<br>`equinix.fabric.service_token.state.inactive`<br>`equinix.fabric.service_token.state.deleted`<br>`equinix.fabric.service_token.attribute.changed`<br>`equinix.fabric.connection.state.pending`<br>`equinix.fabric.connection.state.pending_interface_configuration`<br>`equinix.fabric.connection.state.provisioning`<br>`equinix.fabric.connection.state.provisioned`<br>`equinix.fabric.connection.state.deprovisioning`<br>`equinix.fabric.connection.state.deprovisioned`<br>`equinix.fabric.connection.state.pending_approval`<br>`equinix.fabric.connection.attribute.changed`<br>`equinix.fabric.connection.status.up`<br>`equinix.fabric.connection.status.down`<br>`equinix.fabric.connection.bgpipv4_session_status.established`<br>`equinix.fabric.connection.bgpipv4_session_status.idle`<br>`equinix.fabric.connection.bgpipv4_session_status.connect`<br>`equinix.fabric.connection.bgpipv6_session_status.established`<br>`equinix.fabric.connection.bgpipv6_session_status.idle`<br>`equinix.fabric.connection.bgpipv6_session_status.connect`<br>`equinix.fabric.network.state.provisioning`<br>`equinix.fabric.network.state.provisioned`<br>`equinix.fabric.network.state.deprovisioning`<br>`equinix.fabric.network.state.deprovisioned`<br>|
|Equinix Fabric MetricAlert|[JSON](https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/events/fabric/v1/MetricAlert.json)|<br>Data Type:<br>`equinix.events.fabric.v1.MetricAlert`<br>CloudEvent Type(s):<br><br>|
|Equinix Fabric MetricEvent|[JSON](https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/events/fabric/v1/MetricEvent.json)|<br>Data Type:<br>`equinix.events.fabric.v1.MetricEvent`<br>CloudEvent Type(s):<br>`equinix.fabric.metric`<br><br>Metric Type(s):<br>`equinix.fabric.port.packets_erred_rx.count`<br>`equinix.fabric.port.packets_erred_tx.count`<br>`equinix.fabric.port.packets_dropped_rx.count`<br>`equinix.fabric.port.packets_dropped_tx.count`<br>`equinix.fabric.metro.{:asideMetroCode}_{:zsideMetroCode}.latency`<br>`equinix.fabric.connection.bandwidth_rx.usage`<br>`equinix.fabric.connection.bandwidth_tx.usage`<br>`equinix.fabric.port.bandwidth_rx.usage`<br>`equinix.fabric.port.bandwidth_tx.usage`|

### Equinix Fabric ChangeEvent
#### DataSchema [JSON](https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/ChangeEvent.json)
#### Data Type
`equinix.events.fabric.v1.ChangeEvent`
#### CloudEvent Type(s)
`equinix.fabric.router.state.provisioning`<br>
`equinix.fabric.router.state.provisioned`<br>
`equinix.fabric.router.state.reprovisioning`<br>
`equinix.fabric.router.state.deprovisioning`<br>
`equinix.fabric.router.state.deprovisioned`<br>
`equinix.fabric.router.state.failed`<br>
`equinix.fabric.router.state.not_provisioned`<br>
`equinix.fabric.router.state.not_deprovisioned`<br>
`equinix.fabric.port.state.provisioned`<br>
`equinix.fabric.port.state.deprovisioned`<br>
`equinix.fabric.port.state.failed`<br>
`equinix.fabric.port.status.up`<br>
`equinix.fabric.port.status.down`<br>
`equinix.fabric.service_token.state.inactive`<br>
`equinix.fabric.service_token.state.deleted`<br>
`equinix.fabric.service_token.attribute.changed`<br>
`equinix.fabric.connection.state.pending`<br>
`equinix.fabric.connection.state.pending_interface_configuration`<br>
`equinix.fabric.connection.state.provisioning`<br>
`equinix.fabric.connection.state.provisioned`<br>
`equinix.fabric.connection.state.deprovisioning`<br>
`equinix.fabric.connection.state.deprovisioned`<br>
`equinix.fabric.connection.state.pending_approval`<br>
`equinix.fabric.connection.attribute.changed`<br>
`equinix.fabric.connection.status.up`<br>
`equinix.fabric.connection.status.down`<br>
`equinix.fabric.connection.bgpipv4_session_status.established`<br>
`equinix.fabric.connection.bgpipv4_session_status.idle`<br>
`equinix.fabric.connection.bgpipv4_session_status.connect`<br>
`equinix.fabric.connection.bgpipv6_session_status.established`<br>
`equinix.fabric.connection.bgpipv6_session_status.idle`<br>
`equinix.fabric.connection.bgpipv6_session_status.connect`<br>
`equinix.fabric.network.state.provisioning`<br>
`equinix.fabric.network.state.provisioned`<br>
`equinix.fabric.network.state.deprovisioning`<br>
`equinix.fabric.network.state.deprovisioned`

### Equinix Fabric MetricAlert
#### DataSchema [JSON](https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/MetricAlert.json)
#### Data Type
`equinix.events.fabric.v1.MetricAlert`
#### CloudEvent Type(s)


### Equinix Fabric MetricEvent
#### DataSchema [JSON](https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/MetricEvent.json)
#### Data Type
`equinix.events.fabric.v1.MetricEvent`
#### CloudEvent Type(s)
`equinix.fabric.metric`
#### Metric Type(s)
`equinix.fabric.port.packets_erred_rx.count`<br>
`equinix.fabric.port.packets_erred_tx.count`<br>
`equinix.fabric.port.packets_dropped_rx.count`<br>
`equinix.fabric.port.packets_dropped_tx.count`<br>
`equinix.fabric.metro.{:asideMetroCode}_{:zsideMetroCode}.latency`<br>
`equinix.fabric.connection.bandwidth_rx.usage`<br>
`equinix.fabric.connection.bandwidth_tx.usage`<br>
`equinix.fabric.port.bandwidth_rx.usage`<br>
`equinix.fabric.port.bandwidth_tx.usage`
<!-- CATALOG_GENERATION_END -->
16 changes: 8 additions & 8 deletions jsonschema/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"version": 1,
"schemas": [
{
"url": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/events/fabric/v1/ChangeAlert.json",
"product": "Equinix Fabric ChangeAlert",
"url": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/ChangeAlert.json",
"domain": "Equinix Fabric ChangeAlert",
"name": "ChangeAlert",
"description": "The data within all ChangeAlert events.",
"datatype": "equinix.events.fabric.v1.ChangeAlert",
"cloudeventTypes": []
},
{
"url": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/events/fabric/v1/ChangeEvent.json",
"product": "Equinix Fabric ChangeEvent",
"url": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/ChangeEvent.json",
"domain": "Equinix Fabric ChangeEvent",
"name": "ChangeEvent",
"description": "The data within all ChangeEvent events.",
"datatype": "equinix.events.fabric.v1.ChangeEvent",
Expand Down Expand Up @@ -56,16 +56,16 @@
]
},
{
"url": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/events/fabric/v1/MetricAlert.json",
"product": "Equinix Fabric MetricAlert",
"url": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/MetricAlert.json",
"domain": "Equinix Fabric MetricAlert",
"name": "MetricAlert",
"description": "The data within all MetricAlert events.",
"datatype": "equinix.events.fabric.v1.MetricAlert",
"cloudeventTypes": []
},
{
"url": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/events/fabric/v1/MetricEvent.json",
"product": "Equinix Fabric MetricEvent",
"url": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/MetricEvent.json",
"domain": "Equinix Fabric MetricEvent",
"name": "MetricEvent",
"description": "The data within all MetricEvent events.",
"datatype": "equinix.events.fabric.v1.MetricEvent",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$id": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/events/fabric/v1/ChangeAlert.json",
"$id": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/ChangeAlert.json",
"name": "ChangeAlert",
"examples": [],
"package": "equinix.events.fabric.v1",
"datatype": "equinix.events.fabric.v1.ChangeAlert",
"cloudeventTypes": [],
"product": "Equinix Fabric ChangeAlert",
"domain": "Equinix Fabric ChangeAlert",
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Data",
"definitions": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/events/fabric/v1/ChangeEvent.json",
"$id": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/ChangeEvent.json",
"name": "ChangeEvent",
"examples": [],
"package": "equinix.events.fabric.v1",
Expand Down Expand Up @@ -42,7 +42,7 @@
"equinix.fabric.network.state.deprovisioning",
"equinix.fabric.network.state.deprovisioned"
],
"product": "Equinix Fabric ChangeEvent",
"domain": "Equinix Fabric ChangeEvent",
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Data",
"definitions": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"$id": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/events/fabric/v1/MetricAlert.json",
"$id": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/MetricAlert.json",
"name": "MetricAlert",
"examples": [],
"package": "equinix.events.fabric.v1",
"datatype": "equinix.events.fabric.v1.MetricAlert",
"cloudeventTypes": [],
"product": "Equinix Fabric MetricAlert",
"domain": "Equinix Fabric MetricAlert",
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Data",
"definitions": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$id": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/events/fabric/v1/MetricEvent.json",
"$id": "https://equinix.github.io/equinix-cloudevents/jsonschema/equinix/fabric/v1/MetricEvent.json",
"name": "MetricEvent",
"examples": [],
"package": "equinix.events.fabric.v1",
"datatype": "equinix.events.fabric.v1.MetricEvent",
"cloudeventTypes": [
"equinix.fabric.metric"
],
"product": "Equinix Fabric MetricEvent",
"domain": "Equinix Fabric MetricEvent",
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/Data",
"metricNames": [
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_json_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def retrieve_json_schemas():
data = json.load(eventFile)
newItem = {
"url": data["$id"],
"product": data["product"],
"domain": data["domain"],
"name": data["name"],
"description": data["definitions"]["Data"]["description"],
"datatype": data["datatype"],
Expand Down
21 changes: 11 additions & 10 deletions scripts/generate_readme_event_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
import json

def table_row(schema):
cloudEventTypes = "<br>".join(map(lambda x: f"`{x}`", schema["cloudeventTypes"]))
cloudEventTypes = "<br>\n".join(map(lambda x: f"`{x}`", schema["cloudeventTypes"]))
metrics = ""
if "metricNames" in schema:
metricNames = "<br>".join(map(lambda x: f"`{x}`", schema["metricNames"]))
metrics = f"<br>Metric Type(s):<br>{metricNames}"
return f"|{schema["product"]}|[JSON]({schema["url"]})|<br>Data Type:<br>`{schema["datatype"]}`<br>CloudEvent Type(s):<br>{cloudEventTypes}<br>{metrics}|"
metricNames = "<br>\n".join(map(lambda x: f"`{x}`", schema["metricNames"]))
metrics = f"#### Metric Type(s)\n{metricNames}"
return f"""### {schema["domain"]}
#### DataSchema [JSON]({schema["url"]})
#### Data Type
`{schema["datatype"]}`
#### CloudEvent Type(s)
{cloudEventTypes}
{metrics}"""

def replace_readme_catalog():
readme_path = os.path.dirname(os.path.abspath(__file__)) + "/../README.md"
Expand All @@ -16,11 +22,6 @@ def replace_readme_catalog():
catalog = json.load(catalog_file)
schemas = "\n".join(map(table_row, catalog["schemas"]))

replacement_readme_catalog = f"""
|Product|Schemas|Types|
{schemas}
"""

with open(readme_path, "r+") as readme_file:
content = readme_file.read()
readme_file.seek(0)
Expand All @@ -29,7 +30,7 @@ def replace_readme_catalog():
header = content[:content.index(generation_start)+len(generation_start)]
footer = content[content.index(generation_end):]
readme_file.write(f"""{header}
{replacement_readme_catalog}
{schemas}
{footer}""")
readme_file.truncate()

Expand Down

0 comments on commit 7ca54cf

Please sign in to comment.