mirror of https://github.com/dapr/docs.git
Merge branch 'v1.1' into version-mention-updates-v1.1
This commit is contained in:
commit
7c3ca5ada9
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="206px" height="206px" viewBox="0 0 206 206" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>dark on white</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="dark-on-white" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M63.08125,128 L51.55,128 L51.55,124.378906 C50.448432,125.761726 49.3351619,126.769528 48.2101562,127.402344 C46.2413964,128.503912 44.0031375,129.054688 41.4953125,129.054688 C37.4406047,129.054688 33.8312658,127.66017 30.6671875,124.871094 C26.8937311,121.542952 25.0070312,117.136746 25.0070312,111.652344 C25.0070312,106.074191 26.9406057,101.62111 30.8078125,98.2929688 C33.8781404,95.644518 37.4054488,94.3203125 41.3898437,94.3203125 C43.7101679,94.3203125 45.8898336,94.8124951 47.9289062,95.796875 C49.1007871,96.3593778 50.3078063,97.2851498 51.55,98.5742188 L51.55,75.1953125 L63.08125,75.1953125 L63.08125,128 Z M51.9015625,111.6875 C51.9015625,109.62499 51.1750073,107.873054 49.721875,106.431641 C48.2687427,104.990227 46.5109478,104.269531 44.4484375,104.269531 C42.151551,104.269531 40.2648511,105.13671 38.7882812,106.871094 C37.5929628,108.277351 36.9953125,109.882803 36.9953125,111.6875 C36.9953125,113.492197 37.5929628,115.097649 38.7882812,116.503906 C40.2414135,118.23829 42.1281134,119.105469 44.4484375,119.105469 C46.5343854,119.105469 48.2980397,118.390632 49.7394531,116.960938 C51.1808666,115.531243 51.9015625,113.773448 51.9015625,111.6875 Z M106.329687,128 L94.7984375,128 L94.7984375,124.378906 C93.6968695,125.761726 92.5835994,126.769528 91.4585937,127.402344 C89.4898339,128.503912 87.251575,129.054688 84.74375,129.054688 C80.6890422,129.054688 77.0797033,127.66017 73.915625,124.871094 C70.1421686,121.542952 68.2554687,117.136746 68.2554687,111.652344 C68.2554687,106.074191 70.1890432,101.62111 74.05625,98.2929688 C77.1265779,95.644518 80.6538863,94.3203125 84.6382812,94.3203125 C86.9586054,94.3203125 89.1382711,94.8124951 91.1773437,95.796875 C92.3492246,96.3593778 93.5562438,97.2851498 94.7984375,98.5742188 L94.7984375,95.375 L106.329687,95.375 L106.329687,128 Z M95.15,111.6875 C95.15,109.62499 94.4234448,107.873054 92.9703125,106.431641 C91.5171802,104.990227 89.7593853,104.269531 87.696875,104.269531 C85.3999885,104.269531 83.5132886,105.13671 82.0367187,106.871094 C80.8414003,108.277351 80.24375,109.882803 80.24375,111.6875 C80.24375,113.492197 80.8414003,115.097649 82.0367187,116.503906 C83.489851,118.23829 85.3765509,119.105469 87.696875,119.105469 C89.7828229,119.105469 91.5464772,118.390632 92.9878906,116.960938 C94.4293041,115.531243 95.15,113.773448 95.15,111.6875 Z M150.878906,111.722656 C150.878906,117.300809 148.945332,121.75389 145.078125,125.082031 C142.007797,127.730482 138.480489,129.054688 134.496094,129.054688 C132.17577,129.054688 129.996104,128.562505 127.957031,127.578125 C126.78515,127.015622 125.578131,126.08985 124.335937,124.800781 L124.335937,144.3125 L112.804687,144.3125 L112.804687,95.375 L124.335937,95.375 L124.335937,98.9960938 C125.367193,97.636712 126.480463,96.6289095 127.675781,95.9726562 C129.644541,94.8710882 131.8828,94.3203125 134.390625,94.3203125 C138.445333,94.3203125 142.054672,95.7148298 145.21875,98.5039062 C148.992206,101.832048 150.878906,106.238254 150.878906,111.722656 Z M138.890625,111.6875 C138.890625,109.835928 138.304693,108.230476 137.132812,106.871094 C135.656243,105.13671 133.757824,104.269531 131.4375,104.269531 C129.351552,104.269531 127.587898,104.984368 126.146484,106.414062 C124.705071,107.843757 123.984375,109.601552 123.984375,111.6875 C123.984375,113.75001 124.71093,115.501946 126.164062,116.943359 C127.617195,118.384773 129.37499,119.105469 131.4375,119.105469 C133.757824,119.105469 135.644524,118.23829 137.097656,116.503906 C138.292975,115.097649 138.890625,113.492197 138.890625,111.6875 Z M180.521875,106.027344 C178.904679,105.253902 177.264071,104.867188 175.6,104.867188 C171.803106,104.867188 169.342193,106.414047 168.217187,109.507812 C167.79531,110.632818 167.584375,112.144522 167.584375,114.042969 L167.584375,128 L156.053125,128 L156.053125,95.375 L167.584375,95.375 L167.584375,100.71875 C168.803131,98.820303 170.115618,97.449223 171.521875,96.6054688 C173.420322,95.4804631 175.670299,94.9179688 178.271875,94.9179688 C178.881253,94.9179688 179.631246,94.9531246 180.521875,95.0234375 L180.521875,106.027344 Z" id="dapr" fill="#000000"></path>
|
||||
<polygon id="tie" fill="#000000" fill-rule="nonzero" points="112.713867 128.237305 124.324219 128.237305 125.324219 155.49707 118.519043 160.265625 111.713867 155.49707"></polygon>
|
||||
<rect id="Rectangle-4" fill="#000000" fill-rule="nonzero" x="86.6816586" y="46" width="44.0478543" height="31" rx="2"></rect>
|
||||
<rect id="Rectangle-4" fill="#FFFFFF" fill-rule="nonzero" opacity="0.15" x="86.6816586" y="46" width="16.2935291" height="31"></rect>
|
||||
<rect id="Rectangle-3" fill="#000000" fill-rule="nonzero" x="72.7718099" y="75" width="71.2879747" height="7.44032012" rx="3.72016"></rect>
|
||||
<rect id="Rectangle-4" fill="#FFFFFF" fill-rule="nonzero" opacity="0.15" x="72.7718099" y="75" width="22.0566132" height="9.15731707"></rect>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 5.2 KiB |
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="480px" height="480px" viewBox="0 0 480 480" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>logo large</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="logo-large" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path d="M147.109839,298.504854 L120.218166,298.504854 L120.218166,290.060213 C117.649233,293.285044 115.05301,295.635309 112.429419,297.111079 C107.838135,299.680011 102.618361,300.964459 96.7699392,300.964459 C87.3140802,300.964459 78.8968522,297.712348 71.5180026,291.208029 C62.7180414,283.446572 58.3181267,273.170995 58.3181267,260.380989 C58.3181267,247.372351 62.827356,236.987459 71.8459499,229.226003 C79.0061668,223.049632 87.2320942,219.961493 96.5239788,219.961493 C101.935135,219.961493 107.018266,221.109297 111.773525,223.404939 C114.506432,224.716735 117.321284,226.875699 120.218166,229.881897 L120.218166,175.36067 L147.109839,175.36067 L147.109839,298.504854 Z M121.038034,260.462976 C121.038034,255.653059 119.343657,251.567424 115.954852,248.205948 C112.566047,244.844472 108.466748,243.16376 103.656831,243.16376 C98.3003328,243.16376 93.9004182,245.186081 90.456955,249.230783 C87.6693897,252.510272 86.2756279,256.254299 86.2756279,260.462976 C86.2756279,264.671653 87.6693897,268.41568 90.456955,271.695169 C93.84576,275.739871 98.2456746,277.762192 103.656831,277.762192 C108.521406,277.762192 112.63437,276.095144 115.995845,272.760997 C119.357321,269.42685 121.038034,265.327551 121.038034,260.462976 Z M247.968187,298.504854 L221.076514,298.504854 L221.076514,290.060213 C218.507581,293.285044 215.911358,295.635309 213.287767,297.111079 C208.696483,299.680011 203.476709,300.964459 197.628287,300.964459 C188.172428,300.964459 179.7552,297.712348 172.376351,291.208029 C163.576389,283.446572 159.176475,273.170995 159.176475,260.380989 C159.176475,247.372351 163.685704,236.987459 172.704298,229.226003 C179.864515,223.049632 188.090442,219.961493 197.382327,219.961493 C202.793483,219.961493 207.876614,221.109297 212.631873,223.404939 C215.36478,224.716735 218.179632,226.875699 221.076514,229.881897 L221.076514,222.421098 L247.968187,222.421098 L247.968187,298.504854 Z M221.896382,260.462976 C221.896382,255.653059 220.202005,251.567424 216.8132,248.205948 C213.424395,244.844472 209.325096,243.16376 204.515179,243.16376 C199.158681,243.16376 194.758766,245.186081 191.315303,249.230783 C188.527738,252.510272 187.133976,256.254299 187.133976,260.462976 C187.133976,264.671653 188.527738,268.41568 191.315303,271.695169 C194.704108,275.739871 199.104023,277.762192 204.515179,277.762192 C209.379754,277.762192 213.492717,276.095144 216.854193,272.760997 C220.215669,269.42685 221.896382,265.327551 221.896382,260.462976 Z M351.860046,260.544963 C351.860046,273.553601 347.350817,283.938493 338.332223,291.699949 C331.172006,297.87632 322.946079,300.964459 313.654194,300.964459 C308.243038,300.964459 303.159907,299.816655 298.404648,297.521013 C295.671741,296.209217 292.856889,294.050253 289.960007,291.044055 L289.960007,336.546733 L263.068334,336.546733 L263.068334,222.421098 L289.960007,222.421098 L289.960007,230.865739 C292.364966,227.695566 294.961188,225.345301 297.748754,223.814873 C302.340038,221.24594 307.559812,219.961493 313.408234,219.961493 C322.864093,219.961493 331.281321,223.213604 338.66017,229.717923 C347.460132,237.47938 351.860046,247.754957 351.860046,260.544963 Z M323.902545,260.462976 C323.902545,256.144983 322.536112,252.400956 319.803205,249.230783 C316.359742,245.186081 311.932498,243.16376 306.521342,243.16376 C301.656767,243.16376 297.543804,244.830808 294.182328,248.164955 C290.820852,251.499102 289.140139,255.598401 289.140139,260.462976 C289.140139,265.272893 290.834516,269.358528 294.223321,272.720004 C297.612126,276.081479 301.711425,277.762192 306.521342,277.762192 C311.932498,277.762192 316.332413,275.739871 319.721218,271.695169 C322.508783,268.41568 323.902545,264.671653 323.902545,260.462976 Z M420.9895,247.2631 C417.218088,245.459381 413.392075,244.557535 409.511347,244.557535 C400.656728,244.557535 394.917709,248.164919 392.294118,255.379794 C391.310271,258.003385 390.818355,261.528782 390.818355,265.956092 L390.818355,298.504854 L363.926682,298.504854 L363.926682,222.421098 L390.818355,222.421098 L390.818355,234.883092 C393.660579,230.455782 396.721389,227.258329 400.000877,225.290636 C404.428187,222.667045 409.67529,221.355269 415.742344,221.355269 C417.163456,221.355269 418.912491,221.437255 420.9895,221.601229 L420.9895,247.2631 Z" id="dapr" fill="#0D2192"></path>
|
||||
<polygon id="tie" fill="#0D2192" fill-rule="nonzero" points="262.856535 299.058265 289.932678 299.058265 292.264747 362.629924 276.394607 373.750524 260.524466 362.629924"></polygon>
|
||||
<rect id="Rectangle-4" fill="#0D2192" fill-rule="nonzero" x="202.147624" y="107.275182" width="102.722643" height="72.2941444" rx="2"></rect>
|
||||
<rect id="Rectangle-4" fill="#FFFFFF" fill-rule="nonzero" opacity="0.0799999982" x="202.147624" y="107.275182" width="37.9976369" height="72.2941444"></rect>
|
||||
<rect id="Rectangle-3" fill="#0D2192" fill-rule="nonzero" x="169.708895" y="174.905188" width="166.248488" height="17.3513412" rx="3.72016"></rect>
|
||||
<rect id="Rectangle-4" fill="#FFFFFF" fill-rule="nonzero" opacity="0.0799999982" x="169.708895" y="174.905188" width="51.4375478" height="21.3554969"></rect>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 5.4 KiB |
|
@ -24,6 +24,6 @@ The following are the building blocks provided by Dapr:
|
|||
| [**State management**]({{<ref "state-management-overview.md">}}) | `/v1.0/state` | Application state is anything an application wants to preserve beyond a single session. Dapr provides a key/value-based state API with pluggable state stores for persistence.
|
||||
| [**Publish and subscribe**]({{<ref "pubsub-overview.md">}}) | `/v1.0/publish` `/v1.0/subscribe`| Pub/Sub is a loosely coupled messaging pattern where senders (or publishers) publishes messages to a topic, to which subscribers subscribe. Dapr supports the pub/sub pattern between applications.
|
||||
| [**Resource bindings**]({{<ref "bindings-overview.md">}}) | `/v1.0/bindings` | A binding provides a bi-directional connection to an external cloud/on-premise service or system. Dapr allows you to invoke the external service through the Dapr binding API, and it allows your application to be triggered by events sent by the connected service.
|
||||
| [**Actors**]({{<ref "actors-overview.md">}}) | `/v1.0/actors` | An actor is an isolated, independent unit of compute and state with single-threaded execution. Dapr provides an actor implementation based on the Virtual Actor pattern which provides a single-threaded programming model and where actors are garbage collected when not in use. See [Actor Overview](./actors#understanding-actors)
|
||||
| [**Actors**]({{<ref "actors-overview.md">}}) | `/v1.0/actors` | An actor is an isolated, independent unit of compute and state with single-threaded execution. Dapr provides an actor implementation based on the Virtual Actor pattern which provides a single-threaded programming model and where actors are garbage collected when not in use.
|
||||
| [**Observability**]({{<ref "observability-concept.md">}}) | `N/A` | Dapr system components and runtime emit metrics, logs, and traces to debug, operate and monitor Dapr system services, components and user applications.
|
||||
| [**Secrets**]({{<ref "secrets-overview.md">}}) | `/v1.0/secrets` | Dapr offers a secrets building block API and integrates with secret stores such as Azure Key Vault and Kubernetes to store the secrets. Service code can call the secrets API to retrieve secrets out of the Dapr supported secret stores.
|
||||
|
|
|
@ -112,7 +112,7 @@ Threat modeling is a process by which potential threats, such as structural vuln
|
|||
|
||||
### February 2021
|
||||
|
||||
In February 2021, Dapr has gone a 2nd security audit targetting it's 1.0 release by Cure53.
|
||||
In February 2021, Dapr has gone through a 2nd security audit targetting it's 1.0 release by Cure53.
|
||||
The test focused on the following:
|
||||
|
||||
* Dapr runtime code base evaluation since last audit
|
||||
|
|
|
@ -367,7 +367,7 @@ dapr run --app-id testpubsub --dapr-http-port 3500
|
|||
Then publish a message to the `deathStarStatus` topic:
|
||||
|
||||
```bash
|
||||
dapr publish --publish-app-id testpubapp --pubsub pubsub --topic deathStarStatus --data '{"status": "completed"}'
|
||||
dapr publish --publish-app-id testpubsub --pubsub pubsub --topic deathStarStatus --data '{"status": "completed"}'
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ Table captions:
|
|||
| [InfluxDB]({{< ref influxdb.md >}}) | | ✅ | Alpha | v1 | 1.0 |
|
||||
| [Kafka]({{< ref kafka.md >}}) | ✅ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [Kubernetes Events]({{< ref "kubernetes-binding.md" >}}) | ✅ | | Alpha | v1 | 1.0 |
|
||||
| [Local Storage]({{< ref localstorage.md >}}) | | ✅ | Alpha | v1 | 1.1 |
|
||||
| [MQTT]({{< ref mqtt.md >}}) | ✅ | ✅ | Alpha | v1 | 1.0 |
|
||||
| [MySQL]({{< ref mysql.md >}}) | | ✅ | Alpha | v1 | 1.0 |
|
||||
| [PostgreSql]({{< ref postgres.md >}}) | | ✅ | Alpha | v1 | 1.0 |
|
||||
|
|
|
@ -70,6 +70,85 @@ This component supports **output binding** with the following operations:
|
|||
|
||||
- `create`
|
||||
|
||||
### Create file
|
||||
|
||||
To perform a create operation, invoke the GCP Storage Bucket binding with a `POST` method and the following JSON body:
|
||||
|
||||
> Note: by default, a random UUID is generated. See below for Metadata support to set the name
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "create",
|
||||
"data": "YOUR_CONTENT"
|
||||
}
|
||||
```
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
##### Save text to a random generated UUID file
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
{{% codetab %}}
|
||||
On Windows, utilize cmd prompt (PowerShell has different escaping mechanism)
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\" }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World" }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
##### Save text to a specific file
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\", \"metadata\": { \"name\": \"my-test-file.txt\" } }" \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World", "metadata": { "name": "my-test-file.txt" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
|
||||
##### Upload a file
|
||||
|
||||
To upload a file, pass the file contents as the data payload; you may want to encode this in e.g. Base64 for binary content.
|
||||
|
||||
Then you can upload it as you would normally:
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"(YOUR_FILE_CONTENTS)\", \"metadata\": { \"name\": \"my-test-file.jpg\" } }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "$(cat my-test-file.jpg)", "metadata": { "name": "my-test-file.jpg" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
## Related links
|
||||
|
||||
- [Basic schema for a Dapr component]({{< ref component-schema >}})
|
||||
|
|
|
@ -0,0 +1,266 @@
|
|||
---
|
||||
type: docs
|
||||
title: "Local Storage binding spec"
|
||||
linkTitle: "Local Storage"
|
||||
description: "Detailed documentation on the Local Storage binding component"
|
||||
---
|
||||
|
||||
## Component format
|
||||
|
||||
To set up the Local Storage binding, create a component of type `bindings.localstorage`. See [this guide]({{< ref "howto-bindings.md#1-create-a-binding" >}}) on how to create and apply a binding configuration.
|
||||
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: <NAME>
|
||||
namespace: <NAMESPACE>
|
||||
spec:
|
||||
type: bindings.localstorage
|
||||
version: v1
|
||||
metadata:
|
||||
- name: rootPath
|
||||
value: <string>
|
||||
```
|
||||
|
||||
## Spec metadata fields
|
||||
|
||||
| Field | Required | Binding support | Details | Example |
|
||||
|--------------------|:--------:|--------|---------|---------|
|
||||
| rootPath | Y | Input / Output | The root path anchor to which files can be read / saved | `"/temp/files"` |
|
||||
|
||||
## Binding support
|
||||
|
||||
This component supports **output binding** with the following operations:
|
||||
|
||||
- `create` : [Create file](#create-file)
|
||||
- `get` : [Get file](#get-file)
|
||||
- `list` : [List files](#list-files)
|
||||
- `delete` : [Delete file](#delete-file)
|
||||
|
||||
### Create file
|
||||
|
||||
To perform a create file operation, invoke the Local Storage binding with a `POST` method and the following JSON body:
|
||||
|
||||
> Note: by default, a random UUID is generated. See below for Metadata support to set the name
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "create",
|
||||
"data": "YOUR_CONTENT"
|
||||
}
|
||||
```
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
##### Save text to a random generated UUID file
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
{{% codetab %}}
|
||||
On Windows, utilize cmd prompt (PowerShell has different escaping mechanism)
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\" }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World" }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
##### Save text to a specific file
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\", \"metadata\": { \"fileName\": \"my-test-file.txt\" } }" \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World", "metadata": { "fileName": "my-test-file.txt" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
|
||||
##### Save a binary file
|
||||
|
||||
To upload a file, encode it as Base64. The binding should automatically detect the Base64 encoding.
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"YOUR_BASE_64_CONTENT\", \"metadata\": { \"fileName\": \"my-test-file.jpg\" } }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "YOUR_BASE_64_CONTENT", "metadata": { "fileName": "my-test-file.jpg" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
#### Response
|
||||
|
||||
The response body will contain the following JSON:
|
||||
|
||||
```json
|
||||
{
|
||||
"fileName": "<filename>"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Get file
|
||||
|
||||
To perform a get file operation, invoke the Local Storage binding with a `POST` method and the following JSON body:
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "get",
|
||||
"metadata": {
|
||||
"fileName": "myfile"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Example
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ \"operation\": \"get\", \"metadata\": { \"fileName\": \"myfile\" }}' http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "get", "metadata": { "fileName": "myfile" }}' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
#### Response
|
||||
|
||||
The response body contains the value stored in the file.
|
||||
|
||||
### List files
|
||||
|
||||
To perform a list files operation, invoke the Local Storage binding with a `POST` method and the following JSON body:
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "list"
|
||||
}
|
||||
```
|
||||
|
||||
If you only want to list the files beneath a particular directory below the `rootPath`, specify the relative directory name as the `fileName` in the metadata.
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "list",
|
||||
"metadata": {
|
||||
"fileName": "my/cool/directory"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Example
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ \"operation\": \"list\", \"metadata\": { \"fileName\": \"my/cool/directory\" }}' http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "list", "metadata": { "fileName": "my/cool/directory" }}' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
#### Response
|
||||
|
||||
The response is a JSON array of file names.
|
||||
|
||||
### Delete file
|
||||
|
||||
To perform a delete file operation, invoke the Local Storage binding with a `POST` method and the following JSON body:
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "delete",
|
||||
"metadata": {
|
||||
"fileName": "myfile"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Example
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ \"operation\": \"delete\", \"metadata\": { \"fileName\": \"myfile\" }}' http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "delete", "metadata": { "fileName": "myfile" }}' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
#### Response
|
||||
|
||||
An HTTP 204 (No Content) and empty body will be returned if successful.
|
||||
|
||||
## Metadata information
|
||||
|
||||
By default the Local Storage output binding auto generates a UUID as the file name. It is configurable in the metadata property of the message.
|
||||
|
||||
```json
|
||||
{
|
||||
"data": "file content",
|
||||
"metadata": {
|
||||
"fileName": "filename.txt"
|
||||
},
|
||||
"operation": "create"
|
||||
}
|
||||
```
|
||||
|
||||
## Related links
|
||||
|
||||
- [Basic schema for a Dapr component]({{< ref component-schema >}})
|
||||
- [Bindings building block]({{< ref bindings >}})
|
||||
- [How-To: Trigger application with input binding]({{< ref howto-triggers.md >}})
|
||||
- [How-To: Use bindings to interface with external resources]({{< ref howto-bindings.md >}})
|
||||
- [Bindings API reference]({{< ref bindings_api.md >}})
|
|
@ -29,8 +29,8 @@ spec:
|
|||
value: *****************
|
||||
- name: secretKey
|
||||
value: *****************
|
||||
- name: bucket
|
||||
value: mybucket
|
||||
- name: sessionToken
|
||||
value: mysession
|
||||
```
|
||||
|
||||
{{% alert title="Warning" color="warning" %}}
|
||||
|
@ -54,6 +54,85 @@ This component supports **output binding** with the following operations:
|
|||
|
||||
- `create`
|
||||
|
||||
### Create file
|
||||
|
||||
To perform a create operation, invoke the AWS S3 binding with a `POST` method and the following JSON body:
|
||||
|
||||
> Note: by default, a random UUID is generated. See below for Metadata support to set the name
|
||||
|
||||
```json
|
||||
{
|
||||
"operation": "create",
|
||||
"data": "YOUR_CONTENT"
|
||||
}
|
||||
```
|
||||
|
||||
#### Examples
|
||||
|
||||
|
||||
##### Save text to a random generated UUID file
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
{{% codetab %}}
|
||||
On Windows, utilize cmd prompt (PowerShell has different escaping mechanism)
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\" }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World" }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
##### Save text to a specific file
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"Hello World\", \"metadata\": { \"key\": \"my-test-file.txt\" } }" \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "Hello World", "metadata": { "key": "my-test-file.txt" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
|
||||
##### Upload a file
|
||||
|
||||
To upload a file, pass the file contents as the data payload; you may want to encode this in e.g. Base64 for binary content.
|
||||
|
||||
Then you can upload it as you would normally:
|
||||
|
||||
{{< tabs Windows Linux >}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d "{ \"operation\": \"create\", \"data\": \"(YOUR_FILE_CONTENTS)\", \"metadata\": { \"key\": \"my-test-file.jpg\" } }" http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
```bash
|
||||
curl -d '{ "operation": "create", "data": "$(cat my-test-file.jpg)", "metadata": { "key": "my-test-file.jpg" } }' \
|
||||
http://localhost:<dapr-port>/v1.0/bindings/<binding-name>
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
## Related links
|
||||
|
||||
- [Basic schema for a Dapr component]({{< ref component-schema >}})
|
||||
|
|
|
@ -7,7 +7,7 @@ description: Detailed information on the AWS DynamoDB state store component
|
|||
|
||||
## Component format
|
||||
|
||||
To setup a DynamoDB state store create a component of type `state.dynamodb`. See [this guide]({{< ref "howto-get-save-state.md#step-1-setup-a-state-store" >}}) on how to create and apply a state store configuration.
|
||||
To setup a DynamoDB state store create a component of type `state.aws.dynamodb`. See [this guide]({{< ref "howto-get-save-state.md#step-1-setup-a-state-store" >}}) on how to create and apply a state store configuration.
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
|
@ -16,7 +16,7 @@ metadata:
|
|||
name: <NAME>
|
||||
namespace: <NAMESPACE>
|
||||
spec:
|
||||
type: state.dynamodb
|
||||
type: state.aws.dynamodb
|
||||
version: v1
|
||||
metadata:
|
||||
- name: table
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
type: docs
|
||||
title: "Setup a Google Kubernetes Engine cluster"
|
||||
linkTitle: "Google Kubernetes Engine"
|
||||
weight: 3000
|
||||
description: "Setup a Google Kubernetes Engine cluster"
|
||||
---
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
|
||||
- [Google Cloud SDK](https://cloud.google.com/sdk)
|
||||
|
||||
## Create a new cluster
|
||||
```bash
|
||||
$ gcloud services enable container.googleapis.com && \
|
||||
gcloud container clusters create $CLUSTER_NAME \
|
||||
--zone $ZONE \
|
||||
--project $PROJECT_ID
|
||||
```
|
||||
For more options refer to the [Google Cloud SDK docs](https://cloud.google.com/sdk/gcloud/reference/container/clusters/create), or instead create a cluster through the [Cloud Console](https://console.cloud.google.com/kubernetes) for a more interactive experience.
|
||||
|
||||
{{% alert title="For private GKE clusters" color="warning" %}}
|
||||
Sidecar injection will not work for private clusters without extra steps. An automatically created firewall rule for master access does not open port 4000. This is needed for Dapr sidecar injection.
|
||||
|
||||
To review the relevant firewall rule:
|
||||
```bash
|
||||
$ gcloud compute firewall-rules list --filter="name~gke-${CLUSTER_NAME}-[0-9a-z]*-master"
|
||||
```
|
||||
|
||||
To replace the existing rule and allow kubernetes master access to port 4000:
|
||||
```bash
|
||||
$ gcloud compute firewall-rules update <firewall-rule-name> --allow tcp:10250,tcp:443,tcp:4000
|
||||
```
|
||||
{{% /alert %}}
|
||||
|
||||
## Retrieve your credentials for `kubectl`
|
||||
|
||||
```bash
|
||||
$ gcloud container clusters get-credentials $CLUSTER_NAME \
|
||||
--zone $ZONE \
|
||||
--project $PROJECT_ID
|
||||
```
|
||||
|
||||
## (optional) Install Helm v3
|
||||
|
||||
1. [Install Helm v3 client](https://helm.sh/docs/intro/install/)
|
||||
|
||||
> **Note:** The latest Dapr helm chart no longer supports Helm v2. Please migrate from helm v2 to helm v3 by following [this guide](https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/).
|
||||
|
||||
2. In case you need permissions the kubernetes dashboard (i.e. configmaps is forbidden: User "system:serviceaccount:kube-system:kubernetes-dashboard" cannot list configmaps in the namespace "default", etc.) execute this command
|
||||
|
||||
```bash
|
||||
kubectl create clusterrolebinding kubernetes-dashboard -n kube-system --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard
|
||||
```
|
|
@ -2,7 +2,7 @@
|
|||
type: docs
|
||||
title: "Setup an Minikube cluster"
|
||||
linkTitle: "Minikube"
|
||||
weight: 2000
|
||||
weight: 1000
|
||||
description: >
|
||||
How to setup Dapr on a Minikube cluster.
|
||||
---
|
||||
|
|
|
@ -20,7 +20,7 @@ The following table shows all the supported pod Spec annotations supported by Da
|
|||
| `dapr.io/api-token-secret` | Tells Dapr which Kubernetes secret to use for token based API authentication. By default this is not set.
|
||||
| `dapr.io/app-protocol` | Tells Dapr which protocol your application is using. Valid options are `http` and `grpc`. Default is `http`
|
||||
| `dapr.io/app-max-concurrency` | Limit the concurrency of your application. A valid value is any number larger than `0`
|
||||
| `dapr.io/app-ssl` | Tells Dapr to invoke the app over an insecure SSL connection. Applies to both HTTP and gRPC. Default is `false`.
|
||||
| `dapr.io/app-ssl` | Tells Dapr to invoke the app over an insecure SSL connection. Applies to both HTTP and gRPC. Traffic between your app and the Dapr sidecar is encrypted with a certificate issued by a non-trusted certificate authority, which is considered insecure. Default is `false`.
|
||||
| `dapr.io/metrics-port` | Sets the port for the sidecar metrics server. Default is `9090`
|
||||
| `dapr.io/sidecar-cpu-limit` | Maximum amount of CPU that the Dapr sidecar can use. See valid values [here](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/). By default this is not set
|
||||
| `dapr.io/sidecar-memory-limit` | Maximum amount of Memory that the Dapr sidecar can use. See valid values [here](https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/). By default this is not set
|
||||
|
|
|
@ -10,7 +10,7 @@ description: "Overview of how to get Dapr running on your Kubernetes cluster"
|
|||
|
||||
Dapr can be configured to run on any Kubernetes cluster. To achieve this, Dapr begins by deploying the `dapr-sidecar-injector`, `dapr-operator`, `dapr-placement`, and `dapr-sentry` Kubernetes services. These provide first-class integration to make running applications with Dapr easy.
|
||||
- **dapr-operator:** Manages [component]({{< ref components >}}) updates and Kubernetes services endpoints for Dapr (state stores, pub/subs, etc.)
|
||||
- **dapr-sidecar-injector:** Injects Dapr into [annotated](#adding-dapr-to-a-kubernetes-cluster) deployment pods and adds the environment variables `DAPR_HTTP_PORT` and `DAPR_GRPC_PORT` to enable user-defined applications to easily communicate with Dapr without hard-coding Dapr port values.
|
||||
- **dapr-sidecar-injector:** Injects Dapr into [annotated](#adding-dapr-to-a-kubernetes-deployment) deployment pods and adds the environment variables `DAPR_HTTP_PORT` and `DAPR_GRPC_PORT` to enable user-defined applications to easily communicate with Dapr without hard-coding Dapr port values.
|
||||
- **dapr-placement:** Used for [actors]({{< ref actors >}}) only. Creates mapping tables that map actor instances to pods
|
||||
- **dapr-sentry:** Manages mTLS between services and acts as a certificate authority. For more information read the [security overview]({{< ref "security-concept.md" >}}).
|
||||
|
||||
|
@ -22,7 +22,7 @@ Read [this guide]({{< ref kubernetes-deploy.md >}}) to learn how to deploy Dapr
|
|||
|
||||
## Adding Dapr to a Kubernetes deployment
|
||||
|
||||
Deploying and running a Dapr enabled application into your Kubernetes cluster is a simple as adding a few annotations to the deployment schemes. To give your service an `id` and `port` known to Dapr, turn on tracing through configuration and launch the Dapr sidecar container, you annotate your Kubernetes deployment like this.
|
||||
Deploying and running a Dapr enabled application into your Kubernetes cluster is as simple as adding a few annotations to the deployment schemes. To give your service an `id` and `port` known to Dapr, turn on tracing through configuration and launch the Dapr sidecar container, you annotate your Kubernetes deployment like this. For more information check [dapr annotations]({{< ref kubernetes-annotations.md >}})
|
||||
|
||||
```yml
|
||||
annotations:
|
||||
|
|
|
@ -16,7 +16,7 @@ the cloud or on-premises.
|
|||
The `tracing` section under the `Configuration` spec contains the following properties:
|
||||
|
||||
```yml
|
||||
tracing:
|
||||
spec:
|
||||
tracing:
|
||||
samplingRate: "1"
|
||||
zipkin:
|
||||
|
|
|
@ -47,6 +47,8 @@ If your pod spec template is annotated correctly and you still don't see the sid
|
|||
|
||||
If this is the case, restarting the pods will fix the issue.
|
||||
|
||||
If you are deploying Dapr on a private GKE cluster, sidecar injection does not work without extra steps. See [Setup a Google Kubernetes Engine cluster]({{< ref setup-gke.md >}}).
|
||||
|
||||
In order to further diagnose any issue, check the logs of the Dapr sidecar injector:
|
||||
|
||||
```bash
|
||||
|
@ -202,4 +204,4 @@ This is usually due to one of the following issues
|
|||
|
||||
- You may have defined the `NAMESPACE` environment variable locally or deployed your components into a different namespace in Kubernetes. Check which namespace your app and the components are deployed to. Read [scoping components to one or more applications]({{< ref "component-scopes.md" >}}) for more information.
|
||||
- You may have not provided a `--components-path` with the Dapr `run` commands or not placed your components into the default components folder for your OS. Read [define a component]({{< ref "get-started-component.md" >}}) for more information.
|
||||
- You may have a syntax issue in component YAML file. Check your component YAML with the component [YAML samples]({{< ref "components.md" >}}).
|
||||
- You may have a syntax issue in component YAML file. Check your component YAML with the component [YAML samples]({{< ref "components.md" >}}).
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit e26148b866552f94a148c5ad6fe81e066775b804
|
||||
Subproject commit 1806602cccee4cc091c38d6bb06ef7b0220a53ed
|
Loading…
Reference in New Issue