Skip to content

Added get configuration method for Dapr config API#323

Merged
wcs1only merged 6 commits intodapr:masterfrom
amulyavarote:feature/config_get_api
Jan 5, 2022
Merged

Added get configuration method for Dapr config API#323
wcs1only merged 6 commits intodapr:masterfrom
amulyavarote:feature/config_get_api

Conversation

@amulyavarote
Copy link
Copy Markdown
Contributor

@amulyavarote amulyavarote commented Dec 29, 2021

Description

Added a method to get the configuration details.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #308

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@amulyavarote amulyavarote requested review from a team as code owners December 29, 2021 19:05
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 29, 2021

Codecov Report

Merging #323 (d05543b) into master (2e32ea8) will increase coverage by 0.04%.
The diff coverage is 92.10%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #323      +/-   ##
==========================================
+ Coverage   89.43%   89.48%   +0.04%     
==========================================
  Files          52       52              
  Lines        2158     2196      +38     
==========================================
+ Hits         1930     1965      +35     
- Misses        228      231       +3     
Impacted Files Coverage Δ
dapr/clients/grpc/client.py 91.12% <88.88%> (-0.13%) ⬇️
dapr/clients/grpc/_response.py 94.94% <93.10%> (-0.36%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2e32ea8...d05543b. Read the comment docs.

Comment thread dapr/clients/grpc/_response.py

def json(self) -> Dict[str, object]:
"""Gets content as deserialized JSON dictionary."""
return json.loads(to_str(self._value))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick question: is the value a single field or consists multiple items?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It consists of multiple items.

Comment thread dapr/proto/runtime/v1/dapr_pb2.py
Comment thread examples/configuration/README.md Outdated
Comment thread examples/configuration/README.md
Comment thread examples/configuration/configuration.py Outdated
Copy link
Copy Markdown
Contributor

@mukundansundar mukundansundar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add in an example for multiple values being returned as well as a usage for the "json()" method?

raise ValueError("Config store name cannot be empty to get the configuration")
req = api_v1.GetConfigurationRequest(
store_name=store_name, keys=keys, metadata=config_metadata)
response, call = self._stub.GetConfigurationAlpha1.with_call(req)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a field to pass in custom metadata to the GRPC call similar to other methods ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we talked over this at the release meeting. I think we've made the decision to deprecate the gRPC metadata parameter from all of our APIs given how highly confusing it is to have both dapr and gRPC metadata. I've created a proposal for this: #324

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on our meeting, we decided not to add grpc metadata because there is an issue being created to take grpc metadata out completely.

Comment thread examples/configuration/configuration.py Outdated

key = 'greeting'

# Wait for sidecar to be up within 5 seconds.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: 20 seconds.

Amulya Varote and others added 6 commits January 4, 2022 01:18
Signed-off-by: Amulya Varote <amulyavarote@Ruban-laptop.fareast.corp.microsoft.com>
Signed-off-by: Amulya Varote <amulyavarote@Ruban-laptop.fareast.corp.microsoft.com>
Signed-off-by: Amulya Varote <amulyavarote@SHRISU-YOGA.redmond.corp.microsoft.com>
Signed-off-by: Amulya Varote <amulyavarote@SHRISU-YOGA.redmond.corp.microsoft.com>
Signed-off-by: Amulya Varote <amulyavarote@SHRISU-YOGA.redmond.corp.microsoft.com>
Signed-off-by: Amulya Varote <amulyavarote@Amulyas-MacBook-Pro.local>
@wcs1only wcs1only merged commit bba469a into dapr:master Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add support for Configuration API

3 participants