-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(models): add support for generic platform resources
- Loading branch information
1 parent
4ffa439
commit 2cd7665
Showing
4 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
metadata-models/src/main/pegasus/com/linkedin/platformresource/PlatformResourceInfo.pdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
namespace com.linkedin.platformresource | ||
|
||
import com.linkedin.common.SerializedValue | ||
|
||
/** | ||
* Platform Resource Info. | ||
* These entities are for miscelaneous data that is used in non-core parts of the system. | ||
* For instance, if we want to persist & retrieve data from auxiliary integrations such as Slack or Microsoft Teams. | ||
*/ | ||
@Aspect = { | ||
"name": "platformResourceInfo" | ||
} | ||
record PlatformResourceInfo { | ||
/** | ||
* The type of the resource. | ||
* Intended as a loose specifier of the generic type of the resource. | ||
* Producer is not forced to conform to a specific set of symbols for | ||
* resource types. | ||
* The @PlatformResourceType enumeration offers a paved path for agreed upon | ||
* common terms, but is not required to be followed. | ||
* Example values could be: conversation, user, grant, etc. | ||
* Resource types are indexed for ease of access. | ||
* e.g. Get me all platform resources of type user for the platform looker | ||
*/ | ||
@Searchable = { | ||
"fieldType": "KEYWORD" | ||
} | ||
resourceType: string | ||
|
||
/** | ||
* The primary key for this platform resource. | ||
* e.g. for a slack member this would be the memberID. | ||
* primary keys specified here don't need to include any additional specificity for the | ||
dataPlatform | ||
* The @PlatformResourceKey is supposed to represent that | ||
*/ | ||
@Searchable = { | ||
"fieldType": "KEYWORD" | ||
} | ||
primaryKey: string | ||
|
||
/** | ||
* The secondary keys this platform resource can be located by. | ||
* I.e., for a slack member this would be email or phone. | ||
*/ | ||
@Searchable = { | ||
"/*": { | ||
"fieldType": "KEYWORD" | ||
} | ||
} | ||
secondaryKeys: optional array[string] | ||
|
||
/** | ||
* The serialized value of this platform resource item. | ||
*/ | ||
value: optional SerializedValue | ||
} |
28 changes: 28 additions & 0 deletions
28
metadata-models/src/main/pegasus/com/linkedin/platformresource/PlatformResourceKey.pdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace com.linkedin.platformresource | ||
|
||
/** | ||
* Key for a Platform Resource. | ||
* Platform Resources are assets that are not part of the core data model. | ||
* They are stored in DataHub primarily to help with application-specific | ||
* use-cases that are not sufficiently generalized to move into the core data model. | ||
* For instance, if we want to persist & retrieve additional user profile data | ||
* from auxiliary integrations such as Slack or Microsoft Teams for resolving details later. | ||
*/ | ||
@Aspect = { | ||
"name": "platformResourceKey" | ||
} | ||
record PlatformResourceKey { | ||
/** | ||
* A unique id for this entity. | ||
* There are no constraints on the format of this id, but most implementations | ||
* will choose to use a UUID. | ||
* This id should be globally unique for the entire DataHub instance and | ||
uniquely identify the resource that is being stored, so most | ||
implementations | ||
* will combine logical attributes like platform name, platform instance, | ||
* platform-specific-id and the resource type to create the unique id. | ||
* e.g. slack:slack-instance:slack-user-id:user-info | ||
* or guid(slack, slack-instance, slack-user-id, user-info) etc. | ||
*/ | ||
id: string | ||
} |
11 changes: 11 additions & 0 deletions
11
metadata-models/src/main/pegasus/com/linkedin/platformresource/PlatformResourceType.pdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
enum PlatformResourceType { | ||
/** | ||
* e.g. a Slack member resource, Looker user resource, etc. | ||
*/ | ||
USER_INFO, | ||
/** | ||
* I.e. a Slack channel | ||
*/ | ||
CONVERSATION | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters