mirror of https://github.com/dapr/docs.git
Merge branch 'v1.0-rc3' into yaron2-patch-1
This commit is contained in:
commit
abfe45d948
|
|
@ -0,0 +1,52 @@
|
|||
name: Azure Static Web Apps CI/CD
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v1.0-rc3
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, closed]
|
||||
branches:
|
||||
- v1.0-rc3
|
||||
|
||||
jobs:
|
||||
build_and_deploy_job:
|
||||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
|
||||
runs-on: ubuntu-latest
|
||||
name: Build and Deploy Job
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Setup Docsy
|
||||
run: cd daprdocs && git submodule update --init --recursive && sudo npm install -D --save autoprefixer && sudo npm install -D --save postcss-cli
|
||||
- name: Build And Deploy
|
||||
id: builddeploy
|
||||
uses: Azure/static-web-apps-deploy@v0.0.1-preview
|
||||
env:
|
||||
HUGO_ENV: production
|
||||
HUGO_VERSION: "0.74.3"
|
||||
with:
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_KIND_POND_0F48CBE1E }}
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
|
||||
skip_deploy_on_missing_secrets: true
|
||||
action: "upload"
|
||||
###### Repository/Build Configurations - These values can be configured to match you app requirements. ######
|
||||
app_location: "daprdocs" # App source code path
|
||||
api_location: "api" # Api source code path - optional
|
||||
app_artifact_location: 'public' # Built app content directory - optional
|
||||
app_build_command: "hugo"
|
||||
###### End of Repository/Build Configurations ######
|
||||
|
||||
close_pull_request_job:
|
||||
if: github.event_name == 'pull_request' && github.event.action == 'closed'
|
||||
runs-on: ubuntu-latest
|
||||
name: Close Pull Request Job
|
||||
steps:
|
||||
- name: Close Pull Request
|
||||
id: closepullrequest
|
||||
uses: Azure/static-web-apps-deploy@v0.0.1-preview
|
||||
with:
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_KIND_POND_0F48CBE1E }}
|
||||
skip_deploy_on_missing_secrets: true
|
||||
action: "close"
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
name: Azure Static Web Apps CI/CD
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- v1.0-rc2
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, closed]
|
||||
branches:
|
||||
- v1.0-rc2
|
||||
|
||||
jobs:
|
||||
build_and_deploy_job:
|
||||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
|
||||
runs-on: ubuntu-latest
|
||||
name: Build and Deploy Job
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Setup Docsy
|
||||
run: cd daprdocs && git submodule update --init --recursive && sudo npm install -D --save autoprefixer && sudo npm install -D --save postcss-cli
|
||||
- name: Build And Deploy
|
||||
id: builddeploy
|
||||
uses: Azure/static-web-apps-deploy@v0.0.1-preview
|
||||
env:
|
||||
HUGO_ENV: production
|
||||
HUGO_VERSION: "0.74.3"
|
||||
with:
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_POLITE_BUSH_0F42B0A1E }}
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
|
||||
skip_deploy_on_missing_secrets: true
|
||||
action: "upload"
|
||||
###### Repository/Build Configurations - These values can be configured to match you app requirements. ######
|
||||
# For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
|
||||
app_location: "daprdocs" # App source code path
|
||||
api_location: "api" # Api source code path - optional
|
||||
app_artifact_location: 'public' # Built app content directory - optional
|
||||
app_build_command: "hugo"
|
||||
###### End of Repository/Build Configurations ######
|
||||
|
||||
close_pull_request_job:
|
||||
if: github.event_name == 'pull_request' && github.event.action == 'closed'
|
||||
runs-on: ubuntu-latest
|
||||
name: Close Pull Request Job
|
||||
steps:
|
||||
- name: Close Pull Request
|
||||
id: closepullrequest
|
||||
uses: Azure/static-web-apps-deploy@v0.0.1-preview
|
||||
with:
|
||||
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_POLITE_BUSH_0F42B0A1E }}
|
||||
skip_deploy_on_missing_secrets: true
|
||||
action: "close"
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
# Site Configuration
|
||||
baseURL = "https://docs.dapr.io/"
|
||||
baseURL = "https://v1-rc2.docs.dapr.io/"
|
||||
title = "Dapr Docs"
|
||||
theme = "docsy"
|
||||
|
||||
|
|
@ -51,26 +51,26 @@ copyright = "Dapr"
|
|||
#privacy_policy = "https://policies.google.com/privacy"
|
||||
|
||||
# Algolia
|
||||
algolia_docsearch = true
|
||||
algolia_docsearch = false
|
||||
offlineSearch = false
|
||||
|
||||
# GitHub Information
|
||||
github_repo = "https://github.com/dapr/docs"
|
||||
github_project_repo = "https://github.com/dapr/dapr"
|
||||
github_subdir = "daprdocs"
|
||||
github_branch = "v0.11"
|
||||
github_branch = "v1.0-rc2"
|
||||
|
||||
# Versioning
|
||||
version_menu = "v0.11 (latest)"
|
||||
version = "v0.11"
|
||||
version_menu = "v1.0-rc.2 (preview)"
|
||||
version = "v1.0-rc.2"
|
||||
archived_version = false
|
||||
|
||||
[[params.versions]]
|
||||
version = "v1.0-rc.2 (preview)"
|
||||
url = "https://v1-rc2.docs.dapr.io"
|
||||
url = "#"
|
||||
[[params.versions]]
|
||||
version = "v0.11 (latest)"
|
||||
url = "#"
|
||||
url = "https://docs.dapr.io"
|
||||
[[params.versions]]
|
||||
version = "v0.10"
|
||||
url = "https://github.com/dapr/docs/tree/v0.10.0"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,3 @@ type: docs
|
|||
# <img src="/images/home-title.png" alt="Dapr Docs" width=400>
|
||||
|
||||
Welcome to the Dapr documentation site!
|
||||
|
||||
{{% alert title="New release candidate" color="primary" %}}
|
||||
v1.0-rc.2 preview is now available to download and test as part of the upcoming Dapr v1.0 release. Visit the [v1.0-rc.2 version of the docs](https://v1-rc2.docs.dapr.io) if you would like to upgrade and use the latest preview version.
|
||||
{{% /alert %}}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ Dapr uses a modular design where functionality is delivered as a component. Each
|
|||
* [Service discovery name resolution](https://github.com/dapr/components-contrib/tree/master/nameresolution)
|
||||
* [Secret stores](https://github.com/dapr/components-contrib/tree/master/secretstores)
|
||||
* [State](https://github.com/dapr/components-contrib/tree/master/state)
|
||||
* [Tracing exporters](https://github.com/dapr/components-contrib/tree/master/exporters)
|
||||
|
||||
### Service invocation and service discovery components
|
||||
Service discovery components are used with the [service invocation]({{<ref "service-invocation-overview.md">}}) building block to integrate with the hosting environment to provide service-to-service discovery. For example, the Kubernetes service discovery component integrates with the Kubernetes DNS service and self hosted uses mDNS.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,95 @@
|
|||
---
|
||||
type: docs
|
||||
title: "How-To: Share state between applications"
|
||||
linkTitle: "How-To: Share state between applications"
|
||||
weight: 400
|
||||
description: "Choose different strategies for sharing state between different applications"
|
||||
---
|
||||
|
||||
## Introduction
|
||||
|
||||
Dapr offers developers different ways to share state between applications.
|
||||
|
||||
Different architectures might have different needs when it comes to sharing state. For example, in one scenario you may want to encapsulate all state within a given application and have Dapr manage the access for you. In a different scenario, you may need to have two applications working on the same state be able to get and save the same keys.
|
||||
|
||||
To enable state sharing, Dapr supports the following key prefixes strategies:
|
||||
|
||||
* **`appid`** - This is the default strategy. the `appid` prefix allows state to be managed only by the app with the specified `appid`. All state keys will be prefixed with the `appid`, and are scoped for the application.
|
||||
|
||||
* **`name`** - This setting uses the name of the state store component as the prefix. Multiple applications can share the same state for a given state store.
|
||||
|
||||
* **`none`** - This setting uses no prefixing. Multiple applications share state across different state stores.
|
||||
|
||||
## Specifying a state prefix strategy
|
||||
|
||||
To specify a prefix strategy, add a metadata key named `keyPrefix` on a state component:
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: statestore
|
||||
namespace: production
|
||||
spec:
|
||||
type: state.redis
|
||||
version: v1
|
||||
metadata:
|
||||
- name: keyPrefix
|
||||
value: <key-prefix-strategy>
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
The following examples will show you how state retrieval looks like with each of the supported prefix strategies:
|
||||
|
||||
### `appid` (default)
|
||||
|
||||
A Dapr application with app id `myApp` is saving state into a state store named `redis`:
|
||||
|
||||
```shell
|
||||
curl -X POST http://localhost:3500/v1.0/state/redis \
|
||||
-H "Content-Type: application/json"
|
||||
-d '[
|
||||
{
|
||||
"key": "darth",
|
||||
"value": "nihilus"
|
||||
}
|
||||
]'
|
||||
```
|
||||
|
||||
The key will be saved as `myApp||darth`.
|
||||
|
||||
### `name`
|
||||
|
||||
A Dapr application with app id `myApp` is saving state into a state store named `redis`:
|
||||
|
||||
```shell
|
||||
curl -X POST http://localhost:3500/v1.0/state/redis \
|
||||
-H "Content-Type: application/json"
|
||||
-d '[
|
||||
{
|
||||
"key": "darth",
|
||||
"value": "nihilus"
|
||||
}
|
||||
]'
|
||||
```
|
||||
|
||||
The key will be saved as `redis||darth`.
|
||||
|
||||
### `none`
|
||||
|
||||
A Dapr application with app id `myApp` is saving state into a state store named `redis`:
|
||||
|
||||
```shell
|
||||
curl -X POST http://localhost:3500/v1.0/state/redis \
|
||||
-H "Content-Type: application/json"
|
||||
-d '[
|
||||
{
|
||||
"key": "darth",
|
||||
"value": "nihilus"
|
||||
}
|
||||
]'
|
||||
```
|
||||
|
||||
The key will be saved as `darth`.
|
||||
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
type: docs
|
||||
title: "Work with backend state stores"
|
||||
linkTitle: "Backend stores"
|
||||
weight: 400
|
||||
weight: 500
|
||||
description: "Guides for working with specific backend states stores"
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -19,4 +19,7 @@ See the [Go SDK repository](https://github.com/dapr/go-sdk)
|
|||
See the [Python SDK repository](https://github.com/dapr/python-sdk)
|
||||
|
||||
### Javascript
|
||||
See the [Javascript SDK repository](https://github.com/dapr/js-sdk)
|
||||
See the [Javascript SDK repository](https://github.com/dapr/js-sdk)
|
||||
|
||||
### PHP
|
||||
See the [PHP SDK repository](https://github.com/dapr/php-sdk)
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ description: "Install the Dapr CLI to get started with Dapr"
|
|||
|
||||
## Dapr CLI installation scripts
|
||||
|
||||
Begin by downloading and installing the Dapr CLI for v0.11. This is used to initialize your environment on your desired platform.
|
||||
Begin by downloading and installing the Dapr CLI for v1.0.0-rc.3. This is used to initialize your environment on your desired platform.
|
||||
|
||||
{{% alert title="Note" color="warning" %}}
|
||||
This command downloads and install Dapr CLI v0.11. To install the latest preview release, please visit the [v1.0-rc2 version of this page](https://v1-rc2.docs.dapr.io/getting-started/install-dapr-cli/).
|
||||
This command downloads and install Dapr CLI v1.0-rc.3. To install v0.11, the latest release prior to the release candidates for the [upcoming v1.0 release](https://blog.dapr.io/posts/2020/10/20/the-path-to-v.1.0-production-ready-dapr/), please visit the [v0.11 docs](https://docs.dapr.io).
|
||||
{{% /alert %}}
|
||||
|
||||
{{< tabs Linux Windows MacOS Binaries>}}
|
||||
|
|
@ -19,14 +19,14 @@ This command downloads and install Dapr CLI v0.11. To install the latest preview
|
|||
{{% codetab %}}
|
||||
This command installs the latest linux Dapr CLI to `/usr/local/bin`:
|
||||
```bash
|
||||
wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash
|
||||
wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash -s 1.0.0-rc.3
|
||||
```
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
This command installs the latest windows Dapr cli to `C:\dapr` and add this directory to User PATH environment variable. Run in Command Prompt:
|
||||
```powershell
|
||||
powershell -Command "iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1 | iex"
|
||||
powershell -Command "$script=iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1; $block=[ScriptBlock]::Create($script); invoke-command -ScriptBlock $block -ArgumentList 1.0.0-rc.3"
|
||||
```
|
||||
Verify by opening Explorer and entering `C:\dapr` into the address bar. You should see folders for bin, components, and a config file.
|
||||
{{% /codetab %}}
|
||||
|
|
@ -34,13 +34,24 @@ Verify by opening Explorer and entering `C:\dapr` into the address bar. You shou
|
|||
{{% codetab %}}
|
||||
This command installs the latest darwin Dapr CLI to `/usr/local/bin`:
|
||||
```bash
|
||||
curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | /bin/bash
|
||||
curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | /bin/bash -s 1.0.0-rc.3
|
||||
```
|
||||
|
||||
Or you can install via [Homebrew](https://brew.sh):
|
||||
```bash
|
||||
brew install dapr/tap/dapr-cli
|
||||
brew install dapr/tap/dapr-cli@1.0.0-rc.3
|
||||
```
|
||||
|
||||
{{% alert title="Note for M1 Macs" color="primary" %}}
|
||||
For M1 Macs, homebrew is not supported. You will need to use the dapr install script and have the rosetta amd64 compatibility layer installed. If you do not have it installed already, you can run the following:
|
||||
|
||||
```bash
|
||||
softwareupdate --install-rosetta
|
||||
```
|
||||
|
||||
{{% /alert %}}
|
||||
|
||||
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ Both the Dapr CLI and the Dapr Helm chart automatically deploy with affinity for
|
|||
You can install Dapr to a Kubernetes cluster using the [Dapr CLI]({{< ref install-dapr-cli.md >}}).
|
||||
|
||||
{{% alert title="Release candidate" color="warning" %}}
|
||||
This command downloads and installs Dapr runtime v0.11. To install v1.0-rc2 preview, the release candidate for the upcoming v1.0 release please visit the [v1.0-rc2 docs version of this page](https://v1-rc1.docs.dapr.io/getting-started/install-dapr-kubernetes/). Note you will need to ensure you are also using the preview version of the CLI (instructions to install the latest preview CLI can be found [here](https://v1-rc2.docs.dapr.io/getting-started/install-dapr-cli/)).
|
||||
This command downloads and install Dapr runtime v1.0-rc.2. To install v0.11, the latest release prior to the release candidates for the [upcoming v1.0 release](https://blog.dapr.io/posts/2020/10/20/the-path-to-v.1.0-production-ready-dapr/), please visit the [v0.11 docs](https://docs.dapr.io).
|
||||
{{% /alert %}}
|
||||
|
||||
### Install Dapr
|
||||
|
|
@ -51,10 +51,10 @@ The `-k` flag initializes Dapr on the Kubernetes cluster in your current context
|
|||
Make sure the correct "target" cluster is set. Check `kubectl context (kubectl config kubectl config get-contexts)` to verify. You can set a different context using `kubectl config use-context <CONTEXT>`.
|
||||
{{% /alert %}}
|
||||
|
||||
Run `dapr init -k` on your local machine:
|
||||
Run `dapr init -k --runtime-version 1.0.0-rc.2` on your local machine:
|
||||
|
||||
```bash
|
||||
$ dapr init -k
|
||||
$ dapr init -k --runtime-version 1.0.0-rc.2
|
||||
|
||||
⌛ Making the jump to hyperspace...
|
||||
ℹ️ Note: To install Dapr using Helm, see here: https://github.com/dapr/docs/blob/master/getting-started/environment-setup.md#using-helm-advanced
|
||||
|
|
@ -68,7 +68,7 @@ $ dapr init -k
|
|||
The default namespace when initializing Dapr is `dapr-system`. You can override this with the `-n` flag.
|
||||
|
||||
```
|
||||
dapr init -k -n mynamespace
|
||||
dapr init -k -n mynamespace --runtime-version 1.0.0-rc.2
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ dapr init -k -n mynamespace
|
|||
You can run Dapr with 3 replicas of each control plane pod with the exception of the Placement pod in the dapr-system namespace for [production scenarios]({{< ref kubernetes-production.md >}}).
|
||||
|
||||
```
|
||||
dapr init -k --enable-ha=true
|
||||
dapr init -k --enable-ha=true --runtime-version 1.0.0-rc.2
|
||||
```
|
||||
|
||||
### Disable mTLS
|
||||
|
|
@ -85,7 +85,7 @@ dapr init -k --enable-ha=true
|
|||
Dapr is initialized by default with [mTLS]({{< ref "security-concept.md#sidecar-to-sidecar-communication" >}}). You can disable it with:
|
||||
|
||||
```
|
||||
dapr init -k --enable-mtls=false
|
||||
dapr init -k --enable-mtls=false --runtime-version 1.0.0-rc.2
|
||||
```
|
||||
|
||||
### Uninstall Dapr on Kubernetes with CLI
|
||||
|
|
@ -122,7 +122,7 @@ The latest Dapr helm chart no longer supports Helm v2. Please migrate from helm
|
|||
4. Install the Dapr chart on your cluster in the `dapr-system` namespace.
|
||||
|
||||
```bash
|
||||
helm install dapr dapr/dapr --namespace dapr-system
|
||||
helm install dapr dapr/dapr --namespace dapr-system --version 1.0.0-rc.2
|
||||
```
|
||||
|
||||
### Verify installation
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ This step installs the latest Dapr Docker containers and setup a developer envir
|
|||
- For Windows Dapr is initialized to `%USERPROFILE%\.dapr\`
|
||||
|
||||
{{% alert title="Note" color="warning" %}}
|
||||
This command downloads and installs Dapr runtime v0.11. To install v1.0-rc2 preview, the release candidate for the upcoming v1.0 release please visit the [v1.0-rc2 docs version of this page](https://v1-rc1.docs.dapr.io/getting-started/install-dapr-selfhost/). Note you will need to ensure you are also using the preview version of the CLI (instructions to install the latest preview CLI can be found [here](https://v1-rc2.docs.dapr.io/getting-started/install-dapr-cli/)).
|
||||
This command downloads and installs Dapr runtime v1.0-rc.2. To install v0.11, the latest release prior to the release candidates for the [upcoming v1.0 release](https://blog.dapr.io/posts/2020/10/20/the-path-to-v.1.0-production-ready-dapr/), please visit the [v0.11 docs](https://docs.dapr.io).
|
||||
{{% /alert %}}
|
||||
|
||||
1. Ensure you are in an elevated terminal:
|
||||
|
|
@ -40,12 +40,12 @@ This command downloads and installs Dapr runtime v0.11. To install v1.0-rc2 prev
|
|||
|
||||
{{< /tabs >}}
|
||||
|
||||
1. Run `dapr init`:
|
||||
1. Run `dapr init --runtime-version 1.0.0-rc.2`:
|
||||
|
||||
You can install or upgrade to a specific version of the Dapr runtime using `dapr init --runtime-version`. You can find the list of versions in [Dapr Release](https://github.com/dapr/dapr/releases)
|
||||
|
||||
```bash
|
||||
$ dapr init
|
||||
$ dapr init --runtime-version 1.0.0-rc.2
|
||||
⌛ Making the jump to hyperspace...
|
||||
Downloading binaries and setting up components
|
||||
✅ Success! Dapr is up and running. To get started, go here: https://aka.ms/dapr-getting-started
|
||||
|
|
@ -55,8 +55,8 @@ This command downloads and installs Dapr runtime v0.11. To install v1.0-rc2 prev
|
|||
|
||||
```bash
|
||||
$ dapr --version
|
||||
CLI version: 0.11
|
||||
Runtime version: 0.11
|
||||
CLI version: 1.0.0-rc.3
|
||||
Runtime version: 1.0.0-rc.2
|
||||
```
|
||||
|
||||
1. Verify Dapr containers are running with `docker ps`:
|
||||
|
|
@ -68,7 +68,7 @@ This command downloads and installs Dapr runtime v0.11. To install v1.0-rc2 prev
|
|||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
0dda6684dc2e openzipkin/zipkin "/busybox/sh run.sh" 2 minutes ago Up 2 minutes 9410/tcp, 0.0.0.0:9411->9411/tcp dapr_zipkin
|
||||
9bf6ef339f50 redis "docker-entrypoint.s…" 2 minutes ago Up 2 minutes 0.0.0.0:6379->6379/tcp dapr_redis
|
||||
8d993e514150 daprio/dapr "./placement" 2 minutes ago Up 2 minutes 0.0.0.0:6050->50005/tcp dapr_placement
|
||||
8d993e514150 daprio/dapr:1.0.0-rc.2 "./placement" 2 minutes ago Up 2 minutes 0.0.0.0:6050->50005/tcp dapr_placement
|
||||
```
|
||||
|
||||
1. Verify Dapr directory has been initialized
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ weight: 60
|
|||
description: "Tutorials with code samples that are aimed to get you started quickly with Dapr"
|
||||
---
|
||||
|
||||
The [Dapr Quickstarts](https://github.com/dapr/quickstarts/tree/release-0.11) are a collection of tutorials with code samples that are aimed to get you started quickly with Dapr, each highlighting a different Dapr capability.
|
||||
The [Dapr Quickstarts](https://github.com/dapr/quickstarts/tree/v1.0.0-rc.2) are a collection of tutorials with code samples that are aimed to get you started quickly with Dapr, each highlighting a different Dapr capability.
|
||||
|
||||
- A good place to start is the hello-world quickstart, it demonstrates how to run Dapr in standalone mode locally on your machine and demonstrates state management and service invocation in a simple application.
|
||||
- Next, if you are familiar with Kubernetes and want to see how to run the same application in a Kubernetes environment, look for the hello-kubernetes quickstart. Other quickstarts such as pub-sub, bindings and the distributed-calculator quickstart explore different Dapr capabilities include instructions for running both locally and on Kubernetes and can be completed in any order. A full list of the quickstarts can be found below.
|
||||
|
|
@ -17,11 +17,11 @@ The [Dapr Quickstarts](https://github.com/dapr/quickstarts/tree/release-0.11) ar
|
|||
|
||||
| Quickstart | Description |
|
||||
|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| [Hello World](https://github.com/dapr/quickstarts/tree/release-0.11/hello-world) | Demonstrates how to run Dapr locally. Highlights service invocation and state management. |
|
||||
| [Hello Kubernetes](https://github.com/dapr/quickstarts/tree/release-0.11/hello-kubernetes) | Demonstrates how to run Dapr in Kubernetes. Highlights service invocation and state management. |
|
||||
| [Distributed Calculator](https://github.com/dapr/quickstarts/tree/release-0.11/distributed-calculator) | Demonstrates a distributed calculator application that uses Dapr services to power a React web app. Highlights polyglot (multi-language) programming, service invocation and state management. |
|
||||
| [Pub/Sub](https://github.com/dapr/quickstarts/tree/release-0.11/pub-sub) | Demonstrates how to use Dapr to enable pub-sub applications. Uses Redis as a pub-sub component. |
|
||||
| [Bindings](https://github.com/dapr/quickstarts/tree/release-0.11/bindings) | Demonstrates how to use Dapr to create input and output bindings to other components. Uses bindings to Kafka. |
|
||||
| [Middleware](https://github.com/dapr/quickstarts/tree/release-0.11/middleware) | Demonstrates use of Dapr middleware to enable OAuth 2.0 authorization. |
|
||||
| [Observability](https://github.com/dapr/quickstarts/tree/release-0.11/observability) | Demonstrates Dapr tracing capabilities. Uses Zipkin as a tracing component. |
|
||||
| [Secret Store](https://github.com/dapr/quickstarts/tree/release-0.11/secretstore) | Demonstrates the use of Dapr Secrets API to access secret stores. |
|
||||
| [Hello World](https://github.com/dapr/quickstarts/tree/v1.0.0-rc.2/hello-world) | Demonstrates how to run Dapr locally. Highlights service invocation and state management. |
|
||||
| [Hello Kubernetes](https://github.com/dapr/quickstarts/tree/v1.0.0-rc.2/hello-kubernetes) | Demonstrates how to run Dapr in Kubernetes. Highlights service invocation and state management. |
|
||||
| [Distributed Calculator](https://github.com/dapr/quickstarts/tree/v1.0.0-rc.2/distributed-calculator) | Demonstrates a distributed calculator application that uses Dapr services to power a React web app. Highlights polyglot (multi-language) programming, service invocation and state management. |
|
||||
| [Pub/Sub](https://github.com/dapr/quickstarts/tree/v1.0.0-rc.2/pub-sub) | Demonstrates how to use Dapr to enable pub-sub applications. Uses Redis as a pub-sub component. |
|
||||
| [Bindings](https://github.com/dapr/quickstarts/tree/v1.0.0-rc.2/bindings) | Demonstrates how to use Dapr to create input and output bindings to other components. Uses bindings to Kafka. |
|
||||
| [Middleware](https://github.com/dapr/quickstarts/tree/v1.0.0-rc.2/middleware) | Demonstrates use of Dapr middleware to enable OAuth 2.0 authorization. |
|
||||
| [Observability](https://github.com/dapr/quickstarts/tree/v1.0.0-rc.2/observability) | Demonstrates Dapr tracing capabilities. Uses Zipkin as a tracing component. |
|
||||
| [Secret Store](https://github.com/dapr/quickstarts/tree/v1.0.0-rc.2/secretstore) | Demonstrates the use of Dapr Secrets API to access secret stores. |
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
type: docs
|
||||
title: "Component schema"
|
||||
linkTitle: "Component schema"
|
||||
weight: 100
|
||||
description: "The basic schema for a Dapr component"
|
||||
---
|
||||
|
||||
Dapr defines and registers components using a [CustomResourceDefinition](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/). All components are defined as a CRD and can be applied to any hosting environment where Dapr is running, not just Kubernetes.
|
||||
|
||||
## Format
|
||||
|
||||
```yaml
|
||||
apiVersion: dapr.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: [COMPONENT-NAME]
|
||||
namespace: [COMPONENT-NAMESPACE]
|
||||
spec:
|
||||
type: [COMPONENT-TYPE]
|
||||
version: v1
|
||||
initTimeout: [TIMEOUT-DURATION]
|
||||
ignoreErrors: [BOOLEAN]
|
||||
metadata:
|
||||
- name: [METADATA-NAME]
|
||||
value: [METADATA-VALUE]
|
||||
```
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Required | Details | Example |
|
||||
|--------------------|:--------:|---------|---------|
|
||||
| apiVersion | Y | The version of the Dapr (and Kubernetes if applicable) API you are calling | `dapr.io/v1alpha1`
|
||||
| kind | Y | The type of CRD. For components is must always be `Component` | `Component`
|
||||
| **metadata** | - | **Information about the component registration** |
|
||||
| metadata.name | Y | The name of the component | `prod-statestore`
|
||||
| metadata.namespace | N | The namespace for the component for hosting environments with namespaces | `myapp-namespace`
|
||||
| **spec** | - | **Detailed information on the component resource**
|
||||
| spec.type | Y | The type of the component | `state.redis`
|
||||
| spec.version | Y | The version of the component | `v1`
|
||||
| spec.initTimeout | N | The timeout duration for the initialization of the component. Default is 30s | `5m`, `1h`, `20s`
|
||||
| spec.ignoreErrors | N | Tells the Dapr sidecar to continue initialization if the component fails to load. Default is false | `false`
|
||||
| **spec.metadata** | - | **A key/value pair of component specific configuration. See your component definition for fields**|
|
||||
|
||||
## Further reading
|
||||
- [Components concept]({{< ref components-concept.md >}})
|
||||
- [Reference secrets in component definitions]({{< ref component-secrets.md >}})
|
||||
- [Supported state stores]({{< ref supported-state-stores >}})
|
||||
- [Supported pub/sub brokers]({{< ref supported-pubsub >}})
|
||||
- [Supported secret stores]({{< ref supported-secret-stores >}})
|
||||
- [Supported bindings]({{< ref supported-bindings >}})
|
||||
- [Set component scopes]({{< ref component-scopes.md >}})
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
type: docs
|
||||
title: "How-To: Scope components to one or more applications"
|
||||
linkTitle: "How-To: Set component scopes"
|
||||
weight: 100
|
||||
weight: 200
|
||||
description: "Limit component access to particular Dapr instances"
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
type: docs
|
||||
title: "How-To: Reference secrets in components"
|
||||
linkTitle: "How-To: Reference secrets"
|
||||
weight: 200
|
||||
weight: 300
|
||||
description: "How to securly reference secrets from a component definition"
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ Code | Description
|
|||
---- | -----------
|
||||
200 | Request successful
|
||||
500 | Request failed
|
||||
404 | Actor not found
|
||||
XXX | Status code from upstream call
|
||||
|
||||
#### URL Parameters
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ POST/PUT http://localhost:<daprPort>/v1.0/actors/<actorType>/<actorId>/state
|
|||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
201 | Request successful
|
||||
204 | Request successful
|
||||
400 | Actor not found
|
||||
500 | Request failed
|
||||
|
||||
|
|
@ -208,9 +208,9 @@ To configure the reminder to fire once only, the period should be set to empty s
|
|||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
200 | Request successful
|
||||
204 | Request successful
|
||||
500 | Request failed
|
||||
404 | Actor not found
|
||||
400 | Actor not found or malformed request
|
||||
|
||||
#### URL Parameters
|
||||
|
||||
|
|
@ -251,7 +251,6 @@ Code | Description
|
|||
---- | -----------
|
||||
200 | Request successful
|
||||
500 | Request failed
|
||||
404 | Actor not found
|
||||
|
||||
#### URL Parameters
|
||||
|
||||
|
|
@ -295,9 +294,8 @@ DELETE http://localhost:<daprPort>/v1.0/actors/<actorType>/<actorId>/reminders/<
|
|||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
200 | Request successful
|
||||
204 | Request successful
|
||||
500 | Request failed
|
||||
404 | Actor not found
|
||||
|
||||
#### URL Parameters
|
||||
|
||||
|
|
@ -349,9 +347,9 @@ A `dueTime` of 0 means to fire immediately. The following body means to fire im
|
|||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
200 | Request successful
|
||||
204 | Request successful
|
||||
500 | Request failed
|
||||
404 | Actor not found
|
||||
400 | Actor not found or malformed request
|
||||
|
||||
#### URL Parameters
|
||||
|
||||
|
|
@ -391,9 +389,8 @@ DELETE http://localhost:<daprPort>/v1.0/actors/<actorType>/<actorId>/timers/<nam
|
|||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
200 | Request successful
|
||||
204 | Request successful
|
||||
500 | Request failed
|
||||
404 | Actor not found
|
||||
|
||||
#### URL Parameters
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ metadata:
|
|||
namespace: <NAMESPACE>
|
||||
spec:
|
||||
type: bindings.<TYPE>
|
||||
version: v1
|
||||
metadata:
|
||||
- name: <NAME>
|
||||
value: <VALUE>
|
||||
|
|
@ -58,6 +59,7 @@ metadata:
|
|||
namespace: default
|
||||
spec:
|
||||
type: bindings.kafka
|
||||
version: v1
|
||||
metadata:
|
||||
- name: brokers
|
||||
value: "http://localhost:5050"
|
||||
|
|
@ -171,6 +173,8 @@ POST/PUT http://localhost:<daprPort>/v1.0/bindings/<name>
|
|||
Code | Description
|
||||
---- | -----------
|
||||
200 | Request successful
|
||||
204 | Empty Response
|
||||
400 | Malformed request
|
||||
500 | Request failed
|
||||
|
||||
### Payload
|
||||
|
|
|
|||
|
|
@ -16,30 +16,34 @@ For http calls made to Dapr runtime, when an error is encountered, an error json
|
|||
|
||||
Following table lists the error codes returned by Dapr runtime:
|
||||
|
||||
| Error Code | Description |
|
||||
|----------------------------------|-------------|
|
||||
| ERR_ACTOR_INSTANCE_MISSING | Error getting an actor instance. This means that actor is now hosted in some other service replica.
|
||||
| ERR_ACTOR_RUNTIME_NOT_FOUND | Error getting the actor instance.
|
||||
| ERR_ACTOR_REMINDER_CREATE | Error creating a reminder for an actor.
|
||||
| ERR_ACTOR_REMINDER_DELETE | Error deleting a reminder for an actor.
|
||||
| ERR_ACTOR_TIMER_CREATE | Error creating a timer for an actor.
|
||||
| ERR_ACTOR_TIMER_DELETE | Error deleting a timer for an actor.
|
||||
| ERR_ACTOR_REMINDER_GET | Error getting a reminder for an actor.
|
||||
| ERR_ACTOR_INVOKE_METHOD | Error invoking a method on an actor.
|
||||
| ERR_ACTOR_STATE_DELETE | Error deleting the state for an actor.
|
||||
| ERR_ACTOR_STATE_GET | Error getting the state for an actor.
|
||||
| ERR_ACTOR_STATE_TRANSACTION_SAVE | Error storing actor state transactionally.
|
||||
| ERR_PUBSUB_NOT_FOUND | Error referencing the Pub/Sub component in Dapr runtime.
|
||||
| ERR_PUBSUB_PUBLISH_MESSAGE | Error publishing a message.
|
||||
| ERR_PUBSUB_CLOUD_EVENTS_SER | Error serializing Pub/Sub event envelope.
|
||||
| ERR_STATE_STORE_NOT_FOUND | Error referencing a state store not found.
|
||||
| ERR_STATE_GET | Error getting a state for state store.
|
||||
| ERR_STATE_DELETE | Error deleting a state from state store.
|
||||
| ERR_STATE_SAVE | Error saving a state in state store.
|
||||
| ERR_INVOKE_OUTPUT_BINDING | Error invoking an output binding.
|
||||
| ERR_MALFORMED_REQUEST | Error with a malformed request.
|
||||
| ERR_DIRECT_INVOKE | Error in direct invocation.
|
||||
| ERR_DESERIALIZE_HTTP_BODY | Error deserializing an HTTP request body.
|
||||
| ERR_SECRET_STORE_NOT_CONFIGURED | Error that no secret store is configured.
|
||||
| ERR_SECRET_STORE_NOT_FOUND | Error that specified secret store is not found.
|
||||
| ERR_HEALTH_NOT_READY | Error that Dapr is not ready.
|
||||
| Error Code | Description |
|
||||
|-----------------------------------|-------------|
|
||||
| ERR_ACTOR_INSTANCE_MISSING | Error getting an actor instance. This means that actor is now hosted in some other service replica.
|
||||
| ERR_ACTOR_RUNTIME_NOT_FOUND | Error getting the actor instance.
|
||||
| ERR_ACTOR_REMINDER_CREATE | Error creating a reminder for an actor.
|
||||
| ERR_ACTOR_REMINDER_DELETE | Error deleting a reminder for an actor.
|
||||
| ERR_ACTOR_TIMER_CREATE | Error creating a timer for an actor.
|
||||
| ERR_ACTOR_TIMER_DELETE | Error deleting a timer for an actor.
|
||||
| ERR_ACTOR_REMINDER_GET | Error getting a reminder for an actor.
|
||||
| ERR_ACTOR_INVOKE_METHOD | Error invoking a method on an actor.
|
||||
| ERR_ACTOR_STATE_DELETE | Error deleting the state for an actor.
|
||||
| ERR_ACTOR_STATE_GET | Error getting the state for an actor.
|
||||
| ERR_ACTOR_STATE_TRANSACTION_SAVE | Error storing actor state transactionally.
|
||||
| ERR_PUBSUB_NOT_FOUND | Error referencing the Pub/Sub component in Dapr runtime.
|
||||
| ERR_PUBSUB_PUBLISH_MESSAGE | Error publishing a message.
|
||||
| ERR_PUBSUB_FORBIDDEN | Error message forbidden by access controls.
|
||||
| ERR_PUBSUB_CLOUD_EVENTS_SER | Error serializing Pub/Sub event envelope.
|
||||
| ERR_STATE_STORE_NOT_FOUND | Error referencing a state store not found.
|
||||
| ERR_STATE_STORES_NOT_CONFIGURED | Error no state stores configured.
|
||||
| ERR_NOT_SUPPORTED_STATE_OPERATION | Error transaction requested on a state store with no transaction support.
|
||||
| ERR_STATE_GET | Error getting a state for state store.
|
||||
| ERR_STATE_DELETE | Error deleting a state from state store.
|
||||
| ERR_STATE_SAVE | Error saving a state in state store.
|
||||
| ERR_INVOKE_OUTPUT_BINDING | Error invoking an output binding.
|
||||
| ERR_MALFORMED_REQUEST | Error with a malformed request.
|
||||
| ERR_DIRECT_INVOKE | Error in direct invocation.
|
||||
| ERR_DESERIALIZE_HTTP_BODY | Error deserializing an HTTP request body.
|
||||
| ERR_SECRET_STORES_NOT_CONFIGURED | Error that no secret store is configured.
|
||||
| ERR_SECRET_STORE_NOT_FOUND | Error that specified secret store is not found.
|
||||
| ERR_HEALTH_NOT_READY | Error that Dapr is not ready.
|
||||
| ERR_METADATA_GET | Error parsing the Metadata information.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ type: docs
|
|||
title: "Health API reference"
|
||||
linkTitle: "Health API"
|
||||
description: "Detailed documentation on the health API"
|
||||
weight: 900
|
||||
weight: 700
|
||||
---
|
||||
|
||||
Dapr provides health checking probes that can be used as readiness or liveness of Dapr.
|
||||
|
|
@ -22,7 +22,7 @@ GET http://localhost:<daprPort>/v1.0/healthz
|
|||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
200 | dapr is healthy
|
||||
204 | dapr is healthy
|
||||
500 | dapr is not healthy
|
||||
|
||||
### URL Parameters
|
||||
|
|
|
|||
|
|
@ -0,0 +1,181 @@
|
|||
---
|
||||
type: docs
|
||||
title: "Metadata API reference"
|
||||
linkTitle: "Metadata API"
|
||||
description: "Detailed documentation on the Metadata API"
|
||||
weight: 800
|
||||
---
|
||||
|
||||
Dapr has a metadata API that returns information about the sidecar allowing runtime discoverability. The metadata endpoint returns among other things, a list of the components loaded and the activated actors (if present).
|
||||
|
||||
The Dapr metadata API also allows you to store additional information in the format of key-value pairs.
|
||||
|
||||
Note: The Dapr metatada endpoint is for instance being used by the Dapr CLI when running dapr in standalone mode to store the PID of the process hosting the sidecar and the command used to run the application.
|
||||
|
||||
## Get the Dapr sidecar information
|
||||
|
||||
Gets the Dapr sidecar information provided by the Metadata Endpoint.
|
||||
|
||||
### HTTP Request
|
||||
|
||||
```http
|
||||
GET http://localhost:<daprPort>/v1.0/metadata
|
||||
```
|
||||
|
||||
### URL Parameters
|
||||
|
||||
Parameter | Description
|
||||
--------- | -----------
|
||||
daprPort | The Dapr port.
|
||||
|
||||
### HTTP Response Codes
|
||||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
200 | Metadata information returned
|
||||
500 | Dapr could not return the metadata information
|
||||
|
||||
### HTTP Response Body
|
||||
|
||||
**Metadata API Response Object**
|
||||
|
||||
Name | Type | Description
|
||||
---- | ---- | -----------
|
||||
id | string | Application ID
|
||||
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.
|
||||
components | [Metadata API Response Component](#metadataapiresponsecomponent)[] | A json encoded array of loaded components metadata.
|
||||
|
||||
<a id="metadataapiresponseactor"></a>**Metadata API Response Registered Actor**
|
||||
|
||||
Name | Type | Description
|
||||
---- | ---- | -----------
|
||||
type | string | The registered actor type.
|
||||
count | integer | Number of actors running.
|
||||
|
||||
<a id="metadataapiresponsecomponent"></a>**Metadata API Response Component**
|
||||
|
||||
Name | Type | Description
|
||||
---- | ---- | -----------
|
||||
name | string | Name of the component.
|
||||
type | string | Component type.
|
||||
version | string | Component version.
|
||||
|
||||
### 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
|
||||
curl http://localhost:3500/v1.0/metadata
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"id":"demo-actor",
|
||||
"actors":[
|
||||
{
|
||||
"type":"DemoActor",
|
||||
"count":1
|
||||
}
|
||||
],
|
||||
"extended": {
|
||||
"cliPID":"1031040",
|
||||
"appCommand":"uvicorn --port 3000 demo_actor_service:app"
|
||||
},
|
||||
"components":[
|
||||
{
|
||||
"name":"pubsub",
|
||||
"type":"pubsub.redis",
|
||||
"version":""
|
||||
},
|
||||
{
|
||||
"name":"statestore",
|
||||
"type":"state.redis",
|
||||
"version":""
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Add a custom attribute to the Dapr sidecar information
|
||||
|
||||
Adds a custom attribute to the Dapr sidecar information stored by the Metadata Endpoint.
|
||||
|
||||
### HTTP Request
|
||||
|
||||
```http
|
||||
PUT http://localhost:<daprPort>/v1.0/metadata/attributeName
|
||||
```
|
||||
|
||||
### URL Parameters
|
||||
|
||||
Parameter | Description
|
||||
--------- | -----------
|
||||
daprPort | The Dapr port.
|
||||
attributeName | Custom attribute name. This is they key name in the key-value pair.
|
||||
|
||||
### HTTP Request Body
|
||||
|
||||
In the request you need to pass the custom attribute value as RAW data:
|
||||
|
||||
```json
|
||||
{
|
||||
"Content-Type": "text/plain"
|
||||
}
|
||||
```
|
||||
|
||||
Within the body of the request place the custom attribute value you want to store:
|
||||
|
||||
```
|
||||
attributeValue
|
||||
```
|
||||
|
||||
### HTTP Response Codes
|
||||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
204 | Custom attribute added to the metadata information
|
||||
|
||||
### 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:
|
||||
|
||||
```shell
|
||||
curl -X PUT -H "Content-Type: text/plain" --data "myDemoAttributeValue" http://localhost:3500/v1.0/metadata/myDemoAttribute
|
||||
```
|
||||
|
||||
Get the metadata information to confirm your custom attribute was added:
|
||||
|
||||
```json
|
||||
{
|
||||
"id":"demo-actor",
|
||||
"actors":[
|
||||
{
|
||||
"type":"DemoActor",
|
||||
"count":1
|
||||
}
|
||||
],
|
||||
"extended": {
|
||||
"myDemoAttribute": "myDemoAttributeValue",
|
||||
"cliPID":"1031040",
|
||||
"appCommand":"uvicorn --port 3000 demo_actor_service:app"
|
||||
},
|
||||
"components":[
|
||||
{
|
||||
"name":"pubsub",
|
||||
"type":"pubsub.redis",
|
||||
"version":""
|
||||
},
|
||||
{
|
||||
"name":"statestore",
|
||||
"type":"state.redis",
|
||||
"version":""
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
|
@ -21,7 +21,9 @@ POST http://localhost:<daprPort>/v1.0/publish/<pubsubname>/<topic>
|
|||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
200 | Message delivered
|
||||
204 | Message delivered
|
||||
403 | Message forbidden by access controls
|
||||
404 | No pubsub name or topic given
|
||||
500 | Delivery failed
|
||||
|
||||
### URL Parameters
|
||||
|
|
@ -101,7 +103,8 @@ path | route path from the subscription configuration
|
|||
|
||||
#### Expected HTTP Response
|
||||
|
||||
An HTTP 200 response with JSON encoded payload body with the processing status:
|
||||
An HTTP 2xx response denotes successful processing of message.
|
||||
For richer response handling, a JSON encoded payload body with the processing status can be sent:
|
||||
|
||||
```json
|
||||
{
|
||||
|
|
@ -114,8 +117,9 @@ Status | Description
|
|||
SUCCESS | message is processed successfully
|
||||
RETRY | message to be retried by Dapr
|
||||
DROP | warning is logged and message is dropped
|
||||
Others | error, message to be retried by Dapr
|
||||
|
||||
For empty payload responses in HTTP 2xx, Dapr assumes `SUCCESS`.
|
||||
Dapr assumes a JSON encoded payload response without `status` field or an empty payload responses with HTTP 2xx, as `SUCCESS`.
|
||||
|
||||
The HTTP response might be different from HTTP 2xx, the following are Dapr's behavior in different HTTP statuses:
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ type: docs
|
|||
title: "Secrets API reference"
|
||||
linkTitle: "Secrets API"
|
||||
description: "Detailed documentation on the secrets API"
|
||||
weight: 700
|
||||
weight: 600
|
||||
---
|
||||
|
||||
## Get Secret
|
||||
|
|
@ -89,7 +89,8 @@ Code | Description
|
|||
200 | OK
|
||||
204 | Secret not found
|
||||
400 | Secret store is missing or misconfigured
|
||||
500 | Failed to get secret
|
||||
403 | Access denied
|
||||
500 | Failed to get secret or no secret stores defined
|
||||
|
||||
### Examples
|
||||
|
||||
|
|
@ -106,3 +107,62 @@ curl http://localhost:3500/v1.0/secrets/vault/db-secret?metadata.version_id=15&m
|
|||
```shell
|
||||
curl http://localhost:3500/v1.0/secrets/vault/db-secret?metadata.version_id=15&?metadata.namespace=production
|
||||
```
|
||||
|
||||
## Get Bulk Secret
|
||||
|
||||
This endpoint lets you get all the secrets in a secret store.
|
||||
It's recommended to use [token authentication]({{<ref "api-token.md">}}) for Dapr if configuring a secret store.
|
||||
|
||||
### HTTP Request
|
||||
|
||||
```
|
||||
GET http://localhost:<daprPort>/v1.0/secrets/<secret-store-name>/bulk
|
||||
```
|
||||
|
||||
#### URL Parameters
|
||||
|
||||
Parameter | Description
|
||||
--------- | -----------
|
||||
daprPort | the Dapr port
|
||||
secret-store-name | the name of the secret store to get the secret from
|
||||
|
||||
> Note, all URL parameters are case-sensitive.
|
||||
|
||||
### HTTP Response
|
||||
|
||||
#### Response Body
|
||||
|
||||
The returned response is a JSON containing the secrets. The JSON object will contain the secret keys as fields and the secret value as the field value.
|
||||
|
||||
##### Response with multiple keys in a secret (eg. Kubernetes):
|
||||
|
||||
```shell
|
||||
curl http://localhost:3500/v1.0/secrets/kubernetes/bulk
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"key1": "value1",
|
||||
"key2": "value2"
|
||||
}
|
||||
```
|
||||
|
||||
#### Response Codes
|
||||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
200 | OK
|
||||
400 | Secret store is missing or misconfigured
|
||||
403 | Access denied
|
||||
500 | Failed to get secret or no secret stores defined
|
||||
|
||||
### Examples
|
||||
|
||||
```shell
|
||||
curl http://localhost:3500/v1.0/secrets/vault/bulk \
|
||||
|
||||
{
|
||||
"key1": "value1",
|
||||
"key2": "value2"
|
||||
}
|
||||
```
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ In case a user invokes Dapr over HTTP to talk to a gRPC enabled service, an erro
|
|||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
XXX | Upstream status returned
|
||||
400 | Method name not given
|
||||
403 | Invocation forbidden by access control
|
||||
500 | Request failed
|
||||
|
||||
### URL Parameters
|
||||
|
|
@ -118,4 +121,4 @@ In case you are invoking `mathService` on a different namespace, you can use the
|
|||
In this URL, `testing` is the namespace that `mathService` is running in.
|
||||
|
||||
## Next Steps
|
||||
- [How-To: Invoke and discover services]({{< ref howto-invoke-discover-services.md >}})
|
||||
- [How-To: Invoke and discover services]({{< ref howto-invoke-discover-services.md >}})
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ metadata:
|
|||
namespace: <NAMESPACE>
|
||||
spec:
|
||||
type: state.<TYPE>
|
||||
version: v1
|
||||
metadata:
|
||||
- name:<KEY>
|
||||
value:<VALUE>
|
||||
|
|
@ -86,8 +87,8 @@ options | (optional) state operation options, see [state operation options](#opt
|
|||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
201 | State saved
|
||||
400 | State store is missing or misconfigured
|
||||
204 | State saved
|
||||
400 | State store is missing or misconfigured or malformed request
|
||||
500 | Failed to save state
|
||||
|
||||
#### Response Body
|
||||
|
|
@ -183,7 +184,7 @@ This endpoint lets you get a list of values for a given list of keys.
|
|||
### HTTP Request
|
||||
|
||||
```
|
||||
POST http://localhost:<daprPort>/v1.0/state/<storename>/bulk
|
||||
POST/PUT http://localhost:<daprPort>/v1.0/state/<storename>/bulk
|
||||
```
|
||||
|
||||
#### URL Parameters
|
||||
|
|
@ -216,7 +217,7 @@ curl http://localhost:3500/v1.0/state/myRedisStore/bulk \
|
|||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"keys": [ "key1", "key2" ],
|
||||
"parallelism": 10,
|
||||
"parallelism": 10
|
||||
}'
|
||||
```
|
||||
|
||||
|
|
@ -233,7 +234,7 @@ curl http://localhost:3500/v1.0/state/myRedisStore/bulk \
|
|||
"key": "key2",
|
||||
"data": "value2",
|
||||
"etag": "1"
|
||||
},
|
||||
}
|
||||
]
|
||||
```
|
||||
To pass metadata as query parammeter:
|
||||
|
|
@ -277,7 +278,7 @@ If-Match | (Optional) ETag associated with the key to be deleted
|
|||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
200 | Delete state successful
|
||||
204 | Delete state successful
|
||||
400 | State store is missing or misconfigured
|
||||
500 | Delete state failed
|
||||
|
||||
|
|
@ -314,8 +315,8 @@ POST/PUT http://localhost:<daprPort>/v1.0/state/<storename>/transaction
|
|||
|
||||
Code | Description
|
||||
---- | -----------
|
||||
201 | Request successful
|
||||
400 | State store is missing or misconfigured
|
||||
204 | Request successful
|
||||
400 | State store is missing or misconfigured or malformed request
|
||||
500 | Request failed
|
||||
|
||||
#### URL Parameters
|
||||
|
|
@ -387,6 +388,7 @@ metadata:
|
|||
namespace: default
|
||||
spec:
|
||||
type: state.redis
|
||||
version: v1
|
||||
metadata:
|
||||
- name: redisHost
|
||||
value: <redis host>
|
||||
|
|
@ -446,7 +448,7 @@ curl -X POST http://localhost:3500/v1.0/state/starwars \
|
|||
"etag": "xxxxx",
|
||||
"options": {
|
||||
"concurrency": "first-write",
|
||||
"consistency": "strong",
|
||||
"consistency": "strong"
|
||||
}
|
||||
}
|
||||
]'
|
||||
|
|
@ -454,4 +456,4 @@ curl -X POST http://localhost:3500/v1.0/state/starwars \
|
|||
|
||||
## Next Steps
|
||||
- [State management overview]({{< ref state-management-overview.md >}})
|
||||
- [How-To: Save & get state]({{< ref howto-get-save-state.md >}})
|
||||
- [How-To: Save & get state]({{< ref howto-get-save-state.md >}})
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
// Your apiKey and indexName will be given to you once
|
||||
// we create your config
|
||||
apiKey: '54ae43aa28ce8f00c54c8d5f544d29b9',
|
||||
indexName: 'crawler_dapr',
|
||||
indexName: 'crawler_dapr-rc2',
|
||||
appId: 'O0QLQGNF38',
|
||||
// Replace inputSelector with a CSS selector
|
||||
// matching your search input
|
||||
|
|
|
|||
Loading…
Reference in New Issue