mirror of https://github.com/dapr/docs.git
Add subscriptions to metadata API reference examples (#3682)
* Add subscription example to metadata API Signed-off-by: Shubham Sharma <shubhash@microsoft.com> * Update metadata API docs Signed-off-by: Shubham Sharma <shubhash@microsoft.com> --------- Signed-off-by: Shubham Sharma <shubhash@microsoft.com> Co-authored-by: Mark Fussell <markfussell@gmail.com>
This commit is contained in:
parent
5d3ae81284
commit
2eac805c5e
|
@ -75,6 +75,7 @@ Name | Type
|
||||||
---- | ---- | -----------
|
---- | ---- | -----------
|
||||||
id | string | Application ID
|
id | string | Application ID
|
||||||
runtimeVersion | string | Version of the Dapr runtime
|
runtimeVersion | string | Version of the Dapr runtime
|
||||||
|
enabledFeatures | string[] | List of features enabled by Dapr Configuration, see https://docs.dapr.io/operations/configuration/preview-features/
|
||||||
actors | [Metadata API Response Registered Actor](#metadataapiresponseactor)[] | A json encoded array of registered actors metadata.
|
actors | [Metadata API Response Registered Actor](#metadataapiresponseactor)[] | A json encoded array of registered actors metadata.
|
||||||
extended.attributeName | string | List of custom attributes as key-value pairs, where key is the attribute name.
|
extended.attributeName | string | List of custom attributes as key-value pairs, where key is the attribute name.
|
||||||
components | [Metadata API Response Component](#metadataapiresponsecomponent)[] | A json encoded array of loaded components metadata.
|
components | [Metadata API Response Component](#metadataapiresponsecomponent)[] | A json encoded array of loaded components metadata.
|
||||||
|
@ -111,14 +112,14 @@ Name | Type | Description
|
||||||
pubsubname | string | Name of the pub/sub.
|
pubsubname | string | Name of the pub/sub.
|
||||||
topic | string | Topic name.
|
topic | string | Topic name.
|
||||||
metadata | object | Metadata associated with the subscription.
|
metadata | object | Metadata associated with the subscription.
|
||||||
rules | [Metadata API Response Subscription Rules](metadataapiresponsesubscriptionrules)[] | List of rules associated with the subscription.
|
rules | [Metadata API Response Subscription Rules](#metadataapiresponsesubscriptionrules)[] | List of rules associated with the subscription.
|
||||||
deadLetterTopic | string | Dead letter topic name.
|
deadLetterTopic | string | Dead letter topic name.
|
||||||
|
|
||||||
<a id="metadataapiresponsesubscriptionrules"></a>**Metadata API Response Subscription Rules**
|
<a id="metadataapiresponsesubscriptionrules"></a>**Metadata API Response Subscription Rules**
|
||||||
|
|
||||||
Name | Type | Description
|
Name | Type | Description
|
||||||
---- | ---- | -----------
|
---- | ---- | -----------
|
||||||
match | string | CEL expression to match the message.
|
match | string | CEL expression to match the message, see https://docs.dapr.io/developing-applications/building-blocks/pubsub/howto-route-messages/#common-expression-language-cel
|
||||||
path | string | Path to route the message if the match expression is true.
|
path | string | Path to route the message if the match expression is true.
|
||||||
|
|
||||||
<a id="metadataapiresponseappconnectionproperties"></a>**Metadata API Response AppConnectionProperties**
|
<a id="metadataapiresponseappconnectionproperties"></a>**Metadata API Response AppConnectionProperties**
|
||||||
|
@ -143,15 +144,13 @@ healthThreshold | integer | Max number of failed health probes before the app is
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
Note: This example is based on the Actor sample provided in the [Dapr SDK for Python](https://github.com/dapr/python-sdk/tree/master/examples/demo_actor).
|
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
curl http://localhost:3500/v1.0/metadata
|
curl http://localhost:3500/v1.0/metadata
|
||||||
```
|
```
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "demo-actor",
|
"id": "myApp",
|
||||||
"runtimeVersion": "1.12.0",
|
"runtimeVersion": "1.12.0",
|
||||||
"enabledFeatures": [
|
"enabledFeatures": [
|
||||||
"ServiceInvocationStreaming"
|
"ServiceInvocationStreaming"
|
||||||
|
@ -178,6 +177,27 @@ curl http://localhost:3500/v1.0/metadata
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"httpEndpoints": [
|
||||||
|
{
|
||||||
|
"name": "my-backend-api"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"subscriptions": [
|
||||||
|
{
|
||||||
|
"pubsubname": "pubsub",
|
||||||
|
"topic": "orders",
|
||||||
|
"deadLetterTopic": "",
|
||||||
|
"metadata": {
|
||||||
|
"ttlInSeconds": "30"
|
||||||
|
},
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"match": "%!s(<nil>)",
|
||||||
|
"path": "orders"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"extended": {
|
"extended": {
|
||||||
"appCommand": "uvicorn --port 3000 demo_actor_service:app",
|
"appCommand": "uvicorn --port 3000 demo_actor_service:app",
|
||||||
"appPID": "98121",
|
"appPID": "98121",
|
||||||
|
@ -187,7 +207,12 @@ curl http://localhost:3500/v1.0/metadata
|
||||||
"appConnectionProperties": {
|
"appConnectionProperties": {
|
||||||
"port": 3000,
|
"port": 3000,
|
||||||
"protocol": "http",
|
"protocol": "http",
|
||||||
"channelAddress": "127.0.0.1"
|
"channelAddress": "127.0.0.1",
|
||||||
|
"health": {
|
||||||
|
"healthProbeInterval": "5s",
|
||||||
|
"healthProbeTimeout": "500ms",
|
||||||
|
"healthThreshold": 3
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -236,8 +261,6 @@ Code | Description
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
Note: This example is based on the Actor sample provided in the [Dapr SDK for Python](https://github.com/dapr/python-sdk/tree/master/examples/demo_actor).
|
|
||||||
|
|
||||||
Add a custom attribute to the metadata endpoint:
|
Add a custom attribute to the metadata endpoint:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
@ -248,7 +271,7 @@ Get the metadata information to confirm your custom attribute was added:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"id": "demo-actor",
|
"id": "myApp",
|
||||||
"runtimeVersion": "1.12.0",
|
"runtimeVersion": "1.12.0",
|
||||||
"enabledFeatures": [
|
"enabledFeatures": [
|
||||||
"ServiceInvocationStreaming"
|
"ServiceInvocationStreaming"
|
||||||
|
@ -275,6 +298,27 @@ Get the metadata information to confirm your custom attribute was added:
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"httpEndpoints": [
|
||||||
|
{
|
||||||
|
"name": "my-backend-api"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"subscriptions": [
|
||||||
|
{
|
||||||
|
"pubsubname": "pubsub",
|
||||||
|
"topic": "orders",
|
||||||
|
"deadLetterTopic": "",
|
||||||
|
"metadata": {
|
||||||
|
"ttlInSeconds": "30"
|
||||||
|
},
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"match": "%!s(<nil>)",
|
||||||
|
"path": "orders"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"extended": {
|
"extended": {
|
||||||
"myDemoAttribute": "myDemoAttributeValue",
|
"myDemoAttribute": "myDemoAttributeValue",
|
||||||
"appCommand": "uvicorn --port 3000 demo_actor_service:app",
|
"appCommand": "uvicorn --port 3000 demo_actor_service:app",
|
||||||
|
@ -285,7 +329,12 @@ Get the metadata information to confirm your custom attribute was added:
|
||||||
"appConnectionProperties": {
|
"appConnectionProperties": {
|
||||||
"port": 3000,
|
"port": 3000,
|
||||||
"protocol": "http",
|
"protocol": "http",
|
||||||
"channelAddress": "127.0.0.1"
|
"channelAddress": "127.0.0.1",
|
||||||
|
"health": {
|
||||||
|
"healthProbeInterval": "5s",
|
||||||
|
"healthProbeTimeout": "500ms",
|
||||||
|
"healthThreshold": 3
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue