-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CosmosDB - Locations field missing from model #6823
CosmosDB - Locations field missing from model #6823
Comments
The CreateOrUpdate method actually takes a |
Yeah so that model requires Prior to doing an update I'd need the full copy of the resource from a Ideally I'd It looks like the Azure CLI just manually hacks the Seems like in current situation you can't really programmatically update the account without some trickery that may or may not be safe. I believe that fixing the swagger and generating the models again so that the full HTTP response from |
This appears to be the incorrect swagger file responsible for bad models when retrieving current state
|
This is the best I've come up with to try to update an account (I'm using the raw dictionary here instead of the model, but the same applies either way) I'm concerned this isn't safe? Could
|
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @shurd |
1 similar comment
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @shurd |
Hi @stefangordon thank you for raising this issue. Every region on an account is a readable location, so you can use these from the GET response to form an update request. The code snippet you provided looks to be correct. Right now, our PATCH request only supports updating tags as this behavior is required by ARM. We are currently working on supporting PATCH for all properties on the account. |
And if |
We will include locations in the next swagger update, which is expected in the next two weeks. We are tracking this internally as work item 509483. |
Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment. |
It seems the
properties.locations
field is not in the modelhttps://github.com/Azure/azure-sdk-for-python/blob/master/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py
However it is required to update the account:
https://docs.microsoft.com/en-us/rest/api/cosmos-db-resource-provider/databaseaccounts/createorupdate#request-body
The field comes across in the HTTP response from a
GET
just fine, it is just lost in deserialization.This seem to make it hard for me to update a CosmosDB account (e.g. change a firewall) as the API does not appear to fully support
PATCH
(only for tags?) and I can't get the data I need to do acreate or update
.What am I missing here?
@shurd as you handled a similar issue :)
The text was updated successfully, but these errors were encountered: