-
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
Unable to get generic resources from SQL endpoints #553
Comments
Could you be more precise about the parameters you used in
|
This happens when I attempt to get a SQL Database or SQL Server. resource_provider_namespace = Microsoft.Sql |
Found, msrest does not use content negotiation and SQL endpoints returns XML by default. Will publish an update asap. |
In the meantime adding result = resource_client.resources.get(
resource_group_name='rgroup',
resource_name='test',
resource_provider_namespace='Microsoft.Sql',
resource_type='servers',
api_version='2014-04-01-preview',
parent_resource_path='',
custom_headers={'Accept': 'application/json'}
) |
Yep, that worked, thanks! |
When trying to show a resource:
I get an msrest DeserializationError:
msrest.exceptions.DeserializationError: Unable to deserialize to object: type, AttributeError: 'str' object has no attribute 'get'
In the SDK resource_operations.py at line 461 when it tries to deserialize the response is when I'm getting the exception.
The traceback:
And the response.content that won't deserialize:
b'<?xml version="1.0" encoding="utf-8"?><entry xml:base="https://testserver23456.database.windows.net/v2/ManagementService.Trusted.svc/modules/ServerManagement/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><id>https://testserver23456.database.windows.net/v2/ManagementService.Trusted.svc/modules/ServerManagement/databases/testsql23456</id><category term="Microsoft.SqlServer.Management.Service.Domain.ArmResourceProvider.Database" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /><link rel="edit" title="Database" href="databases/testsql23456" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/dataWarehouseQueries" type="application/atom+xml;type=feed" title="dataWarehouseQueries" href="databases/testsql23456/dataWarehouseQueries" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/usages" type="application/atom+xml;type=feed" title="usages" href="databases/testsql23456/usages" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/operationresults" type="application/atom+xml;type=feed" title="operationresults" href="databases/testsql23456/operationresults" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/azureAsyncOperation" type="application/atom+xml;type=feed" title="azureAsyncOperation" href="databases/testsql23456/azureAsyncOperation" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/importExportOperationResults" type="application/atom+xml;type=feed" title="importExportOperationResults" href="databases/testsql23456/importExportOperationResults" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/replicationLinks" type="application/atom+xml;type=feed" title="replicationLinks" href="databases/testsql23456/replicationLinks" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/extensions" type="application/atom+xml;type=feed" title="extensions" href="databases/testsql23456/extensions" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/auditingPolicies" type="application/atom+xml;type=feed" title="auditingPolicies" href="databases/testsql23456/auditingPolicies" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/connectionPolicies" type="application/atom+xml;type=feed" title="connectionPolicies" href="databases/testsql23456/connectionPolicies" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/securityMetrics" type="application/atom+xml;type=feed" title="securityMetrics" href="databases/testsql23456/securityMetrics" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/auditingEvents" type="application/atom+xml;type=feed" title="auditingEvents" href="databases/testsql23456/auditingEvents" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/backupArchivalPolicies" type="application/atom+xml;type=feed" title="backupArchivalPolicies" href="databases/testsql23456/backupArchivalPolicies" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/queryStore" type="application/atom+xml;type=feed" title="queryStore" href="databases/testsql23456/queryStore" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/topQueries" type="application/atom+xml;type=feed" title="topQueries" href="databases/testsql23456/topQueries" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/dataMaskingPolicies" type="application/atom+xml;type=feed" title="dataMaskingPolicies" href="databases/testsql23456/dataMaskingPolicies" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/serviceTierAdvisors" type="application/atom+xml;type=feed" title="serviceTierAdvisors" href="databases/testsql23456/serviceTierAdvisors" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/upgradeHint" type="application/atom+xml;type=entry" title="upgradeHint" href="databases/testsql23456/upgradeHint" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/schemas" type="application/atom+xml;type=feed" title="schemas" href="databases/testsql23456/schemas" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/transparentDataEncryption" type="application/atom+xml;type=feed" title="transparentDataEncryption" href="databases/testsql23456/transparentDataEncryption" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/restorePoints" type="application/atom+xml;type=feed" title="restorePoints" href="databases/testsql23456/restorePoints" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/metrics" type="application/atom+xml;type=feed" title="metrics" href="databases/testsql23456/metrics" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/metricDefinitions" type="application/atom+xml;type=feed" title="metricDefinitions" href="databases/testsql23456/metricDefinitions" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/securityAlertPolicies" type="application/atom+xml;type=feed" title="securityAlertPolicies" href="databases/testsql23456/securityAlertPolicies" /><link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/advisors" type="application/atom+xml;type=feed" title="advisors" href="databases/testsql23456/advisors" /><title /><updated>2016-03-21T17:50:48Z</updated><author><name /></author><m:action metadata="https://testserver23456.database.windows.net/v2/ManagementService.Trusted.svc/modules/ServerManagement/$metadata#ArmResourceProviderModel.pause" title="pause" target="https://testserver23456.database.windows.net/v2/ManagementService.Trusted.svc/modules/ServerManagement/databases/testsql23456/pause" /><m:action metadata="https://testserver23456.database.windows.net/v2/ManagementService.Trusted.svc/modules/ServerManagement/$metadata#ArmResourceProviderModel.resume" title="resume" target="https://testserver23456.database.windows.net/v2/ManagementService.Trusted.svc/modules/ServerManagement/databases/testsql23456/resume" /><m:action metadata="https://testserver23456.database.windows.net/v2/ManagementService.Trusted.svc/modules/ServerManagement/$metadata#ArmResourceProviderModel.export" title="export" target="https://testserver23456.database.windows.net/v2/ManagementService.Trusted.svc/modules/ServerManagement/databases/testsql23456/export" /><content type="application/xml"><m:properties><d:id>/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/TravisTestResourceGroup/providers/Microsoft.Sql/servers/testserver23456/databases/testsql23456</d:id><d:name>testsql23456</d:name><d:type>Microsoft.Sql/servers/databases</d:type><d:location>West US</d:location><d:kind>v12.0,user</d:kind><d:properties m:type="Microsoft.SqlServer.Management.Service.Domain.ArmResourceProvider.Database_DatabaseProperties"><d:databaseId m:type="Edm.Guid">926e001e-945f-4a39-859c-bc80bb259109</d:databaseId><d:edition>Basic</d:edition><d:status>Online</d:status><d:serviceLevelObjective>Basic</d:serviceLevelObjective><d:collation>SQL_Latin1_General_CP1_CI_AS</d:collation><d:maxSizeBytes m:type="Edm.Int64">2147483648</d:maxSizeBytes><d:creationDate m:type="Edm.DateTime">2016-03-15T22:11:13.617Z</d:creationDate><d:currentServiceObjectiveId m:type="Edm.Guid">dd6d99bb-f193-4ec1-86f2-43d3bccbc49c</d:currentServiceObjectiveId><d:requestedServiceObjectiveId m:type="Edm.Guid">dd6d99bb-f193-4ec1-86f2-43d3bccbc49c</d:requestedServiceObjectiveId><d:requestedServiceObjectiveName m:null="true" /><d:createMode m:null="true" /><d:sourceDatabaseId m:null="true" /><d:defaultSecondaryLocation>East US</d:defaultSecondaryLocation><d:earliestRestoreDate m:type="Edm.DateTime">2016-03-15T22:22:00.953Z</d:earliestRestoreDate><d:restorePointInTime m:type="Edm.DateTime" m:null="true" /><d:sourceDatabaseDeletionDate m:type="Edm.DateTime" m:null="true" /><d:blobUriAndSasKey m:null="true" /><d:archivedBackupResourceId m:null="true" /><d:elasticPoolName m:null="true" /><d:containmentState m:type="Edm.Int32">2</d:containmentState></d:properties></m:properties></content></entry>'
The text was updated successfully, but these errors were encountered: