-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
ADL Updates for errors and new endpoints #304
Changes from all commits
3c7555c
96c05a1
6b2d1e2
d14dadc
bb2178d
e4a2b8c
7bf762d
b1563a5
bd335c4
eafe1b0
5f32e3f
be8b7bf
7074192
e121987
ed32520
799fedf
e99b99a
4cc7648
1026b14
c985596
cabf298
3086b7c
04f0052
0298665
d226499
275f42c
15f769f
6cd6d46
ed28f3a
aebb774
a68ceff
822fb58
e2150a5
8acf2fd
105b888
042635b
5ed42e5
3e72fe1
310b460
4c883a2
54b862c
91f27c1
2b4962d
805a632
2675ff8
c8cba3e
c17be3c
8818a93
14c8726
cdcb856
76c2386
6b0d442
20b445f
54e9046
c9a145b
ac5f63b
b17324c
5673cd0
b27cf5b
601cdd0
f95bf4c
78fcd72
b54f0bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,6 @@ node_modules | |
|
||
#### JetBrains | ||
.idea | ||
|
||
# ignore code gen virtual env folder | ||
SdkCodeGen |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,6 +192,32 @@ | |
} | ||
} | ||
}, | ||
"/catalog/usql/databases/{databaseName}/secrets": { | ||
"delete": { | ||
"tags": [ | ||
"Catalog" | ||
], | ||
"operationId": "Catalog_DeleteAllSecrets", | ||
"description": "Deletes all secrets in the specified database", | ||
"parameters": [ | ||
{ | ||
"name": "databaseName", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "The name of the database containing the secret." | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "" | ||
} | ||
} | ||
} | ||
}, | ||
"/catalog/usql/databases/{databaseName}/externaldatasources/{externalDataSourceName}": { | ||
"get": { | ||
"tags": [ | ||
|
@@ -835,7 +861,7 @@ | |
"Catalog" | ||
], | ||
"operationId": "Catalog_GetTableStatistic", | ||
"description": "Retrieves the specified table from the Data Lake Analytics catalog.", | ||
"description": "Retrieves the specified table statistics from the Data Lake Analytics catalog.", | ||
"parameters": [ | ||
{ | ||
"name": "databaseName", | ||
|
@@ -885,7 +911,7 @@ | |
"Catalog" | ||
], | ||
"operationId": "Catalog_ListTableStatistics", | ||
"description": "Retrieves the list of tables from the Data Lake Analytics catalog.", | ||
"description": "Retrieves the list of table statistics from the Data Lake Analytics catalog.", | ||
"parameters": [ | ||
{ | ||
"name": "databaseName", | ||
|
@@ -976,6 +1002,153 @@ | |
} | ||
} | ||
}, | ||
"/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions/{partitionName}": { | ||
"get": { | ||
"tags": [ | ||
"Catalog" | ||
], | ||
"operationId": "Catalog_GetTablePartition", | ||
"description": "Retrieves the specified table partition from the Data Lake Analytics catalog.", | ||
"parameters": [ | ||
{ | ||
"name": "databaseName", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "The name of the database containing the partition." | ||
}, | ||
{ | ||
"name": "schemaName", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "The name of the schema containing the partition." | ||
}, | ||
{ | ||
"name": "tableName", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "The name of the table containing the partition." | ||
}, | ||
{ | ||
"name": "partitionName", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "The name of the table partition." | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "", | ||
"schema": { | ||
"$ref": "#/definitions/USqlTablePartition" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions": { | ||
"get": { | ||
"tags": [ | ||
"Catalog" | ||
], | ||
"operationId": "Catalog_ListTablePartitions", | ||
"description": "Retrieves the list of table partitions from the Data Lake Analytics catalog.", | ||
"parameters": [ | ||
{ | ||
"name": "databaseName", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "The name of the database containing the partitions." | ||
}, | ||
{ | ||
"name": "schemaName", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "The name of the schema containing the partitions." | ||
}, | ||
{ | ||
"name": "tableName", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "The name of the table containing the partitions." | ||
}, | ||
{ | ||
"name": "$filter", | ||
"in": "query", | ||
"required": false, | ||
"type": "string", | ||
"description": "OData filter. Optional." | ||
}, | ||
{ | ||
"name": "$top", | ||
"in": "query", | ||
"required": false, | ||
"type": "integer", | ||
"format": "int32", | ||
"description": "The number of items to return. Optional." | ||
}, | ||
{ | ||
"name": "$skip", | ||
"in": "query", | ||
"required": false, | ||
"type": "integer", | ||
"format": "int32", | ||
"description": "The number of items to skip over before returning elements. Optional." | ||
}, | ||
{ | ||
"name": "$expand", | ||
"in": "query", | ||
"required": false, | ||
"type": "string", | ||
"description": "OData expansion. Expand related resources in line with the retrieved resources, e.g. Categories?$expand=Products would expand Product data in line with each Category entry. Optional." | ||
}, | ||
{ | ||
"name": "$select", | ||
"in": "query", | ||
"required": false, | ||
"type": "string", | ||
"description": "OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional." | ||
}, | ||
{ | ||
"name": "$orderby", | ||
"in": "query", | ||
"required": false, | ||
"type": "string", | ||
"description": "OrderBy clause. One or more comma-separated expressions with an optional \"asc\" (the default) or \"desc\" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional." | ||
}, | ||
{ | ||
"name": "$count", | ||
"in": "query", | ||
"required": false, | ||
"type": "boolean", | ||
"description": "The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional." | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiVersionParameter" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "default" response? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a new requirement? by default, anything that is not a 200 response gets generated into a cloudException, which is currently what we want for everything except our filesystem swagger. What should I be putting in the default response if I want to continue to have the current behavior? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @amarzavery for example, https://github.com/Azure/azure-rest-api-specs/blob/master/arm-resources/resources/2016-02-01/swagger/resources.json does not contain a single "default" either, since it uses the built in "everything that isn't explicitly specified is a CloudError" model. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That should be fine |
||
"description": "", | ||
"schema": { | ||
"$ref": "#/definitions/USqlTablePartitionList" | ||
} | ||
} | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. x-ms-odata ?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure what the question is here. We support x-ms-odata types for one type "USqlType", but that is not at this line. Do I need to include it everywhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As per the doc the x-ms-odata extension is applied on the operation and not on the type. This will indicate AutoRest that it needs to handle odata parameters in a special way. As this operation has odata parameters and the x-ms-odata extension was missing hence high highlighted it. |
||
"x-ms-pageable": { | ||
"nextLinkName": "nextLink" | ||
} | ||
} | ||
}, | ||
"/catalog/usql/databases/{databaseName}/schemas/{schemaName}/types": { | ||
"get": { | ||
"tags": [ | ||
|
@@ -2006,6 +2179,59 @@ | |
}, | ||
"description": "A Data Lake Analytics catalog U-SQL view item list." | ||
}, | ||
"USqlTablePartition": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/CatalogItem" | ||
} | ||
], | ||
"properties": { | ||
"databaseName": { | ||
"type": "string", | ||
"description": "Gets or sets the name of the database." | ||
}, | ||
"schemaName": { | ||
"type": "string", | ||
"description": "Gets or sets the name of the schema associated with this table partition and database." | ||
}, | ||
"partitionName": { | ||
"type": "string", | ||
"x-ms-client-name": "name", | ||
"description": "Gets or sets the name of the table partition." | ||
}, | ||
"indexId": { | ||
"type": "integer", | ||
"format": "int32", | ||
"description": "Gets or sets the index ID for this partition." | ||
}, | ||
"label": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"description": "Gets or sets the list of labels associated with this partition." | ||
} | ||
}, | ||
"description": "A Data Lake Analytics catalog U-SQL table partition item." | ||
}, | ||
"USqlTablePartitionList": { | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/CatalogItemList" | ||
} | ||
], | ||
"properties": { | ||
"value": { | ||
"type": "array", | ||
"readOnly": true, | ||
"items": { | ||
"$ref": "#/definitions/USqlTablePartition" | ||
}, | ||
"description": "Gets the list of table partitions in the database, schema and table combination" | ||
} | ||
}, | ||
"description": "A Data Lake Analytics catalog U-SQL table partition item list." | ||
}, | ||
"USqlTableStatistics": { | ||
"allOf": [ | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
general comment: have default response everyewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of today AutoRest will atleast deserialized code and message into the CloudError object. Any extra properties will not be deserialized since default does not have a schema. Although you will get the raw request and response as properties of the Exception so you can do deserialized it your way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amarzavery that makes sense. Our errors actually adhere to the CloudError schema as it is right now, so it makes sense for us to use the default CloudException/CloudError setup. Below is the schema for all of our errors except Filesystem (which I updated). This should be properly deserialized by CloudError, right?
“error”: {
“code”: “string”,
“message”: “string”,
“target”: “optional string”,
“details”: [{
“code”: “string”,
“message”: “string”,
“target”: “optional string”
]},
“innerError”: {
“context”: “string”,
“trace”: “sdf”
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will get deserialized correctly in node.js as the mapper has it defined.
It looks like this will be deserialized correctly in C# as well (even when the default schema is not specified).
@markcowl @hovsepm - Is my understanding correct?