Skip to content

Commit

Permalink
Merge branch 'main' into pitch/connect-renkulab-and-openbis-datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius authored Sep 12, 2024
2 parents 06cede5 + 31dabba commit 75c794f
Show file tree
Hide file tree
Showing 14 changed files with 1,696 additions and 1,296 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from renku_data_services.message_queue.avro_models.io.renku.events.v2.project_member_updated import ProjectMemberUpdated
from renku_data_services.message_queue.avro_models.io.renku.events.v2.project_removed import ProjectRemoved
from renku_data_services.message_queue.avro_models.io.renku.events.v2.project_updated import ProjectUpdated
from renku_data_services.message_queue.avro_models.io.renku.events.v2.reprovisioning_finished import ReprovisioningFinished
from renku_data_services.message_queue.avro_models.io.renku.events.v2.reprovisioning_started import ReprovisioningStarted
from renku_data_services.message_queue.avro_models.io.renku.events.v2.user_added import UserAdded
from renku_data_services.message_queue.avro_models.io.renku.events.v2.user_removed import UserRemoved
from renku_data_services.message_queue.avro_models.io.renku.events.v2.user_updated import UserUpdated
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from dataclasses import asdict, dataclass
from typing import ClassVar, Dict

from dataclasses_avroschema import AvroModel
from undictify import type_checked_constructor


@type_checked_constructor()
@dataclass
class ReprovisioningFinished(AvroModel):
"""
Event raised when a reprovisioning of data events finished
"""
id: str

#: The Avro Schema associated to this class
_schema: ClassVar[str] = """{
"type": "record",
"name": "ReprovisioningFinished",
"namespace": "io.renku.events.v2",
"doc": "Event raised when a reprovisioning of data events finished",
"fields": [
{
"name": "id",
"type": "string"
}
]
}"""

def serialize_json(self) -> str:
"""
Returns an Avro-json representation of this instance.
"""
return self.serialize(serialization_type='avro-json').decode('ascii')

def to_dict(self) -> Dict:
"""
Returns a dictionary version of this instance.
"""
return asdict(self)

@classmethod
def from_dict(
cls,
the_dict: Dict
) -> 'ReprovisioningFinished':
"""
Returns an instance of this class from a dictionary.
:param the_dict: The dictionary from which to create an instance of this class.
"""
return cls(**the_dict)
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from dataclasses import asdict, dataclass
from typing import ClassVar, Dict

from dataclasses_avroschema import AvroModel
from undictify import type_checked_constructor


@type_checked_constructor()
@dataclass
class ReprovisioningStarted(AvroModel):
"""
Event raised when a reprovisioning of data events started
"""
id: str

#: The Avro Schema associated to this class
_schema: ClassVar[str] = """{
"type": "record",
"name": "ReprovisioningStarted",
"namespace": "io.renku.events.v2",
"doc": "Event raised when a reprovisioning of data events started",
"fields": [
{
"name": "id",
"type": "string"
}
]
}"""

def serialize_json(self) -> str:
"""
Returns an Avro-json representation of this instance.
"""
return self.serialize(serialization_type='avro-json').decode('ascii')

def to_dict(self) -> Dict:
"""
Returns a dictionary version of this instance.
"""
return asdict(self)

@classmethod
def from_dict(
cls,
the_dict: Dict
) -> 'ReprovisioningStarted':
"""
Returns an instance of this class from a dictionary.
:param the_dict: The dictionary from which to create an instance of this class.
"""
return cls(**the_dict)
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
asyncapi: 3.0.0
info:
title: Search Sync Events
version: 0.0.1
servers:
redis:
host: renku-redis
protocol: redis
description: Renku Redis Instance
channels:
data_service.all_events:
messages:
syncEvent:
payload:
schemaFormat: "application/vnd.apache.avro;version=1.9.0"
oneOf:
- $ref: './user/events/added.avsc#/UserAdded'
- $ref: './user/events/created.avsc#/UserUpdated'
- $ref: './user/events/removed.avsc#/UserRemoved'
- $ref: './group/events/added.avsc#/GroupAdded'
- $ref: './group/events/created.avsc#/GroupUpdated'
- $ref: './group/events/removed.avsc#/GroupRemoved'
- $ref: './group/events/member_added.avsc#/GroupMemberAdded'
- $ref: './group/events/member_added.avsc#/GroupMemberUpdated'
- $ref: './group/events/member_removed.avsc#/GroupMemberRemoved'
- $ref: './project/events/created.avsc#/ProjectCreated'
- $ref: './project/events/updated.avsc#/ProjectUpdated'
- $ref: './project/events/removed.avsc#/ProjectRemoved'
- $ref: './project/events/member_added.avsc#/ProjectMemberAdded'
- $ref: './project/events/member_updated.avsc#/ProjectMemberUpdated'
- $ref: './project/events/member_removed.avsc#/ProjectMemberRemoved'
- $ref: './notify/events/reprovisioning_started.asvc#/ReprovisioningStarted'
- $ref: './notify/events/reprovisioning_finished.asvc#/ReprovisioningFinished'
traits:
- $ref: '#/components/messageTraits/headers'

components:
messageTraits:
headers:
payload:
type: object
properties:
id:
type: string
headers:
- $ref: '../header/headers.avsc#/Header'
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "record",
"name":"ReprovisioningFinished",
"namespace":"io.renku.events.v2",
"doc":"Event raised when a reprovisioning of data events finished",
"fields":[
{
"name":"id",
"type":"string"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "record",
"name":"ReprovisioningStarted",
"namespace":"io.renku.events.v2",
"doc":"Event raised when a reprovisioning of data events started",
"fields":[
{
"name":"id",
"type":"string"
}
]
}
Loading

0 comments on commit 75c794f

Please sign in to comment.