Skip to content

Commit

Permalink
Update template files, config, and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
TheByronHimes committed Nov 17, 2023
1 parent f942c4a commit 46c14eb
Show file tree
Hide file tree
Showing 5 changed files with 449 additions and 285 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/.dev_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ loader_token_hashes:
log_level: trace

service_name: metldata
service_instance_id: 001
service_instance_id: "001"
kafka_servers: ["kafka:9092"]

primary_artifact_name: embedded_public
Expand Down
197 changes: 166 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,38 +94,142 @@ metldata --help
### Parameters

The service requires the following configuration parameters:
- **`artifact_infos`** *(array)*: Information for artifacts to be queryable via the Artifacts REST API.
- **`db_connection_str`** *(string, format: password)*: MongoDB connection string. Might include credentials. For more information see: https://naiveskill.com/mongodb-connection-string/.

- **Items**: Refer to *[#/definitions/ArtifactInfo](#definitions/ArtifactInfo)*.

- **`db_connection_str`** *(string, format: password)*: MongoDB connection string. Might include credentials. For more information see: https://naiveskill.com/mongodb-connection-string/.
Examples:

```json
"mongodb://localhost:27017"
```


- **`db_name`** *(string)*: Name of the database located on the MongoDB server.


Examples:

```json
"my-database"
```


- **`service_name`** *(string)*: Default: `"metldata"`.

- **`service_instance_id`** *(string)*: A string that uniquely identifies this instance across all instances of this service. A globally unique Kafka client ID will be created by concatenating the service_name and the service_instance_id.


Examples:

```json
"germany-bw-instance-001"
```


- **`kafka_servers`** *(array)*: A list of connection strings to connect to Kafka bootstrap servers.

- **Items** *(string)*


Examples:

```json
[
"localhost:9092"
]
```


- **`kafka_security_protocol`** *(string)*: Protocol used to communicate with brokers. Valid values are: PLAINTEXT, SSL. Must be one of: `["PLAINTEXT", "SSL"]`. Default: `"PLAINTEXT"`.

- **`kafka_ssl_cafile`** *(string)*: Certificate Authority file path containing certificates used to sign broker certificates. If a CA not specified, the default system CA will be used if found by OpenSSL. Default: `""`.

- **`kafka_ssl_certfile`** *(string)*: Optional filename of client certificate, as well as any CA certificates needed to establish the certificate's authenticity. Default: `""`.

- **`kafka_ssl_keyfile`** *(string)*: Optional filename containing the client private key. Default: `""`.

- **`kafka_ssl_password`** *(string)*: Optional password to be used for the client private key. Default: `""`.

- **`primary_artifact_name`** *(string)*: Name of the artifact from which the information for outgoing change events is derived.


Examples:

```json
"embedded_public"
```


- **`primary_dataset_name`** *(string)*: Name of the resource class corresponding to the embedded_dataset slot.


Examples:

```json
"EmbeddedDataset"
```


- **`resource_change_event_topic`** *(string)*: Name of the topic used for events informing other services about resource changes, i.e. deletion or insertion.


Examples:

```json
"searchable_resources"
```


- **`resource_deletion_event_type`** *(string)*: Type used for events indicating the deletion of a previously existing resource.


Examples:

```json
"searchable_resource_deleted"
```


- **`resource_upsertion_type`** *(string)*: Type used for events indicating the upsert of a resource.


Examples:

```json
"searchable_resource_upserted"
```


- **`dataset_change_event_topic`** *(string)*: Name of the topic announcing, among other things, the list of files included in a new dataset.


Examples:

```json
"metadata_datasets"
```


- **`dataset_deletion_type`** *(string)*: Type used for events announcing a new dataset overview.


Examples:

```json
"dataset_deleted"
```


- **`dataset_upsertion_type`** *(string)*: Type used for events announcing a new dataset overview.


Examples:

```json
"dataset_created"
```


- **`host`** *(string)*: IP of the host. Default: `"127.0.0.1"`.

- **`port`** *(integer)*: Port to expose the server on the specified host. Default: `8080`.
Expand All @@ -142,60 +246,91 @@ The service requires the following configuration parameters:

- **`docs_url`** *(string)*: Path to host the swagger documentation. This is relative to the specified host and port. Default: `"/docs"`.

- **`cors_allowed_origins`** *(array)*: A list of origins that should be permitted to make cross-origin requests. By default, cross-origin requests are not allowed. You can use ['*'] to allow any origin.
- **`cors_allowed_origins`**: A list of origins that should be permitted to make cross-origin requests. By default, cross-origin requests are not allowed. You can use ['*'] to allow any origin. Default: `null`.

- **Items** *(string)*
- **Any of**

- **`cors_allow_credentials`** *(boolean)*: Indicate that cookies should be supported for cross-origin requests. Defaults to False. Also, cors_allowed_origins cannot be set to ['*'] for credentials to be allowed. The origins must be explicitly specified.
- *array*

- **`cors_allowed_methods`** *(array)*: A list of HTTP methods that should be allowed for cross-origin requests. Defaults to ['GET']. You can use ['*'] to allow all standard methods.
- **Items** *(string)*

- **Items** *(string)*
- *null*

- **`cors_allowed_headers`** *(array)*: A list of HTTP request headers that should be supported for cross-origin requests. Defaults to []. You can use ['*'] to allow all headers. The Accept, Accept-Language, Content-Language and Content-Type headers are always allowed for CORS requests.

- **Items** *(string)*
Examples:

- **`loader_token_hashes`** *(array)*: Hashes of tokens used to authenticate for loading artifact.
```json
[
"https://example.org",
"https://www.example.org"
]
```

- **Items** *(string)*

## Definitions
- **`cors_allow_credentials`**: Indicate that cookies should be supported for cross-origin requests. Defaults to False. Also, cors_allowed_origins cannot be set to ['*'] for credentials to be allowed. The origins must be explicitly specified. Default: `null`.

- **Any of**

- *boolean*

- *null*


Examples:

```json
[
"https://example.org",
"https://www.example.org"
]
```


- <a id="definitions/AnchorPoint"></a>**`AnchorPoint`** *(object)*: A model for describing an anchor point for the specified target class.
- **`cors_allowed_methods`**: A list of HTTP methods that should be allowed for cross-origin requests. Defaults to ['GET']. You can use ['*'] to allow all standard methods. Default: `null`.

- **`target_class`** *(string, required)*: The name of the class to be targeted.
- **Any of**

- **`identifier_slot`** *(string, required)*: The name of the slot in the target class that is used as identifier.
- *array*

- **`root_slot`** *(string, required)*: The name of the slot in the root class used to link to the target class.
- **Items** *(string)*

- <a id="definitions/ArtifactResourceClass"></a>**`ArtifactResourceClass`** *(object)*: Model to describe a resource class of an artifact.
- *null*

- **`name`** *(string, required)*: The name of the metadata class.

- **`description`** *(string)*: A description of the metadata class.
Examples:

- **`anchor_point`**: The anchor point for this metadata class.
```json
[
"*"
]
```

- **All of**

- : Refer to *[#/definitions/AnchorPoint](#definitions/AnchorPoint)*.
- **`cors_allowed_headers`**: A list of HTTP request headers that should be supported for cross-origin requests. Defaults to []. You can use ['*'] to allow all headers. The Accept, Accept-Language, Content-Language and Content-Type headers are always allowed for CORS requests. Default: `null`.

- **`json_schema`** *(object, required)*: The JSON schema for this metadata class.
- **Any of**

- <a id="definitions/ArtifactInfo"></a>**`ArtifactInfo`** *(object)*: Model to describe general information on an artifact.
Please note, it does not contain actual artifact instances derived from specific
metadata.
- *array*

- **`name`** *(string, required)*: The name of the artifact.
- **Items** *(string)*

- **`description`** *(string, required)*: A description of the artifact.
- *null*

- **`resource_classes`** *(object, required)*: A dictionary of resource classes for this artifact. The keys are the names of the classes. The values are the corresponding class models. Can contain additional properties.

- **Additional Properties**: Refer to *[#/definitions/ArtifactResourceClass](#definitions/ArtifactResourceClass)*.
Examples:

```json
[]
```


- **`artifact_infos`** *(array)*: Information for artifacts to be queryable via the Artifacts REST API.

- **Items**: Refer to *[#/$defs/ArtifactInfo](#$defs/ArtifactInfo)*.

- **`loader_token_hashes`** *(array)*: Hashes of tokens used to authenticate for loading artifact.

- **Items** *(string)*


### Usage:
Expand Down
Loading

0 comments on commit 46c14eb

Please sign in to comment.