mirror of https://github.com/dapr/docs.git
update bidirectional bindings (#619)
This commit is contained in:
parent
8fff50630b
commit
376a4bf626
|
@ -76,7 +76,7 @@ Read the [Create an event-driven app using input bindings](../../howto/trigger-a
|
|||
|
||||
## Output bindings
|
||||
|
||||
Output bindings allow users to invoke external resources
|
||||
Output bindings allow users to invoke external resources.
|
||||
An optional payload and metadata can be sent with the invocation request.
|
||||
|
||||
In order to invoke an output binding:
|
||||
|
|
|
@ -39,12 +39,15 @@ All that's left now is to invoke the bindings endpoint on a running Dapr instanc
|
|||
We can do so using HTTP:
|
||||
|
||||
```bash
|
||||
curl -X POST -H http://localhost:3500/v1.0/bindings/myEvent -d '{ "data": { "message": "Hi!" } }'
|
||||
curl -X POST -H http://localhost:3500/v1.0/bindings/myEvent -d '{ "data": { "message": "Hi!" }, "operation": "create" }'
|
||||
```
|
||||
|
||||
As seen above, we invoked the `/binding` endpoint with the name of the binding to invoke, in our case its `myEvent`.
|
||||
The payload goes inside the mandatory `data` field, and can be any JSON serializable value.
|
||||
|
||||
You'll also notice that there's an `operation` field that tells the binding what we need it to do.
|
||||
You can check [here](../../reference/specs/bindings) which operations are supported for every output binding.
|
||||
|
||||
|
||||
## References
|
||||
|
||||
|
|
|
@ -149,9 +149,12 @@ If ```concurrency``` is not set, it is sent out sequential (the example below sh
|
|||
}
|
||||
```
|
||||
|
||||
## Sending Messages to Output Bindings
|
||||
## Invoking Output Bindings
|
||||
|
||||
This endpoint lets you invoke an Dapr output binding.
|
||||
This endpoint lets you invoke a Dapr output binding.
|
||||
Dapr bindings support various operations, such as `create`.
|
||||
|
||||
See the [different specs](../specs/bindings) on each binding to see the list of supported operations.
|
||||
|
||||
### HTTP Request
|
||||
|
||||
|
@ -175,12 +178,14 @@ The bindings endpoint receives the following JSON payload:
|
|||
"data": "",
|
||||
"metadata": {
|
||||
"": ""
|
||||
}
|
||||
},
|
||||
"operation": ""
|
||||
}
|
||||
```
|
||||
|
||||
The `data` field takes any JSON serializable value and acts as the payload to be sent to the output binding.
|
||||
The metadata is an array of key/value pairs and allows you to set binding specific metadata for each call.
|
||||
The `metadata` field is an array of key/value pairs and allows you to set binding specific metadata for each call.
|
||||
The `operation` field tells the Dapr binding which operation it should perform.
|
||||
|
||||
### URL Parameters
|
||||
|
||||
|
@ -200,7 +205,8 @@ curl -X POST http://localhost:3500/v1.0/bindings/myKafka \
|
|||
},
|
||||
"metadata": {
|
||||
"key": "redis-key-1"
|
||||
}
|
||||
},
|
||||
"operation": "create"
|
||||
}'
|
||||
```
|
||||
|
||||
|
|
|
@ -23,6 +23,10 @@ spec:
|
|||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
||||
## Additional information
|
||||
|
||||
By default the Azure Blob Storage output binding will auto generate a UUID as blob filename and not assign any system or custom metadata to it. It is configurable in the Metadata property of the message (all optional).
|
||||
|
@ -40,6 +44,7 @@ Applications publishing to an Azure Blob Storage output binding should send a me
|
|||
"ContentDisposition" : "attachment",
|
||||
"CacheControl" : "no-cache",
|
||||
"Custom" : "hello-world",
|
||||
}
|
||||
},
|
||||
"operation": "create"
|
||||
}
|
||||
```
|
||||
|
|
|
@ -27,4 +27,8 @@ spec:
|
|||
- `collection` is name of the collection inside the database.
|
||||
- `partitionKey` is the name of the partitionKey to extract from the payload.
|
||||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
|
@ -24,4 +24,8 @@ spec:
|
|||
- `secretKey` is the AWS secret key.
|
||||
- `table` is the DynamoDB table name.
|
||||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
|
@ -59,6 +59,10 @@ spec:
|
|||
|
||||
- `eventSubscriptionName` (Optional) is the name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only.
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
||||
## Output Binding Metadata
|
||||
- `accessKey` is the Access Key to be used for publishing an Event Grid Event to a custom topic
|
||||
|
||||
|
|
|
@ -33,3 +33,7 @@ spec:
|
|||
- `partitionID` (Optional) ID of the partition to send and receive events.
|
||||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
|
@ -45,4 +45,8 @@ spec:
|
|||
- `client_x509_cert_url` is the GCP credentials project x509 cert url.
|
||||
- `private_key` is the GCP credentials private key.
|
||||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
|
@ -48,4 +48,8 @@ spec:
|
|||
- `client_x509_cert_url` is the GCP credentials project x509 cert url.
|
||||
- `private_key` is the GCP credentials private key.
|
||||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
|
@ -17,3 +17,7 @@ spec:
|
|||
|
||||
- `url` is the HTTP url to invoke.
|
||||
- `method` is the HTTP verb to use for the request.
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
|
|
@ -52,6 +52,11 @@ curl -X POST http://localhost:3500/v1.0/bindings/myKafka \
|
|||
},
|
||||
"metadata": {
|
||||
"partitionKey": "key1"
|
||||
}
|
||||
},
|
||||
"operation": "create"
|
||||
}'
|
||||
```
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
|
|
@ -34,3 +34,7 @@ spec:
|
|||
|
||||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
|
@ -18,4 +18,8 @@ spec:
|
|||
- `url` is the MQTT broker url.
|
||||
- `topic` is the topic to listen on or send events to.
|
||||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
|
@ -48,6 +48,11 @@ curl -X POST http://localhost:3500/v1.0/bindings/myRabbitMQ \
|
|||
},
|
||||
"metadata": {
|
||||
"ttlInSeconds": "60"
|
||||
}
|
||||
},
|
||||
"operation": "create"
|
||||
}'
|
||||
```
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
|
|
@ -22,3 +22,7 @@ spec:
|
|||
- `enableTLS` - If the Redis instance supports TLS with public certificates it can be configured to enable or disable TLS.
|
||||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
|
|
@ -24,4 +24,8 @@ spec:
|
|||
- `secretKey` is the AWS secret key.
|
||||
- `table` is the name of the S3 bucket to write to.
|
||||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
|
|
@ -40,3 +40,7 @@ Example request payload
|
|||
```
|
||||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
|
|
@ -42,6 +42,11 @@ curl -X POST http://localhost:3500/v1.0/bindings/myServiceBusQueue \
|
|||
},
|
||||
"metadata": {
|
||||
"ttlInSeconds": "60"
|
||||
}
|
||||
},
|
||||
"operation": "create"
|
||||
}'
|
||||
```
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
|
|
@ -42,8 +42,13 @@ Applications publishing to an Azure SignalR output binding should send a message
|
|||
},
|
||||
"metadata": {
|
||||
"group": "chat123"
|
||||
}
|
||||
},
|
||||
"operation": "create"
|
||||
}
|
||||
```
|
||||
|
||||
For more information on integration Azure SignalR into a solution check the [documentation](https://docs.microsoft.com/en-us/azure/azure-signalr/)
|
||||
For more information on integration Azure SignalR into a solution check the [documentation](https://docs.microsoft.com/en-us/azure/azure-signalr/)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
|
|
@ -24,4 +24,8 @@ spec:
|
|||
- `secretKey` is the AWS secret key.
|
||||
- `topicArn` is the SNS topic name.
|
||||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
|
|
@ -24,4 +24,8 @@ spec:
|
|||
- `secretKey` is the AWS secret key.
|
||||
- `queueName` is the SQS queue name.
|
||||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
|
|
@ -45,6 +45,11 @@ curl -X POST http://localhost:3500/v1.0/bindings/myStorageQueue \
|
|||
},
|
||||
"metadata": {
|
||||
"ttlInSeconds": "60"
|
||||
}
|
||||
},
|
||||
"operation": "create"
|
||||
}'
|
||||
```
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
|
|
@ -24,4 +24,8 @@ spec:
|
|||
- `accountSid` is the Twilio account SID.
|
||||
- `authToken` is the Twilio auth token.
|
||||
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
> **Note:** In production never place passwords or secrets within Dapr components. For information on securely storing and retrieving secrets refer to [Setup Secret Store](../../../howto/setup-secret-store)
|
||||
|
||||
## Output Binding Supported Operations
|
||||
|
||||
* create
|
||||
|
|
Loading…
Reference in New Issue