Skip to content
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

Swagger change for getting all availability sets in a subscription and StandardSSD #3302

Merged
merged 5 commits into from
Jun 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,34 @@
}
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets": {
"get": {
"tags": [
"AvailabilitySets"
],
"operationId": "AvailabilitySets_ListBySubscription",
"description": "Lists all availability sets in a subscription.",
"parameters": [
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/AvailabilitySetListResult"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
Copy link
Member

Choose a reason for hiding this comment

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

The provided example creates a linter error:

The property 'nextLink' specified by nextLinkName does not exist in the 200 response schema. \nPlease, specify the name of the property that provides the nextLink. If the model does not have the nextLink property then specify null.

Could you either:

  • Update the example to include an example of nextLink if server supports it
  • Update the Swagger to replace "nextLink" by null if server does not support nextLink

Whatever you do, do NOT remove "x-ms-pageable", that's the right thing to do since it's a method that has the semantic of a list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you please check again? I think the issue is not that nextLink is missing in the example, but that nextLink is missing AvailabilitySetListResult in compute.json.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I see what you mean, you re-used AvailabilitySetListResult as it was defined. Let me check what should be the correct way to remove this warning then.

Copy link
Member

@lmazuel lmazuel Jun 28, 2018

Choose a reason for hiding this comment

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

@dochung4 I made an actual call to the endpoint, and didn't get a nextLink back in the JSON. But maybe I didn't have enough resource to trigger the nextLink. But if it's the truth and the endpoint always returns a unique page whatever the number of AS, then the correct definition is to use null.
Could you confirm the actual server behavior:

  • If server never returns nextLink, use null
  • If server may return nextLink, use what you did nextLink

Swagger must described accurately the server, and since I don't own the server implementation I don't know which one is the truth. Your last commit changed a lot of null to nextLink and that concerns me a bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For which call did you not get a nextLink back? Currently we have nextLink for listing all availability sets in a subscription, but not for listing all resource groups in a resource group. But I discussed this with my team and I added nextLink to the latter too, because it will be enabled very soon.

Please let me know if you have other thoughts.

Copy link
Member

@lmazuel lmazuel Jun 28, 2018

Choose a reason for hiding this comment

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

I checked listing AS in a RG indeed. So if I understand you correctly:

  • List AS at the subscription level always returns nextLink
  • List AS at the RG level didn't have nextLink, but you're adding it live on all api-versions from 2016-04-30-preview to now soon.

Is this accurate?
If this is accurate, I'm good with the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that's correct.

}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets": {
"get": {
Expand Down Expand Up @@ -191,7 +219,7 @@
}
},
"x-ms-pageable": {
"nextLinkName": null
"nextLinkName": "nextLink"
}
}
},
Expand Down Expand Up @@ -3189,8 +3217,15 @@
"$ref": "#/definitions/AvailabilitySet"
},
"description": "The list of availability sets"
},
"nextLink": {
"type": "string",
"description": "The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets."
}
},
"required": [
"value"
],
"description": "The List Availability Set operation response."
},
"VirtualMachineSize": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"parameters": {
"subscriptionId": "{subscriptionId}",
"api-version": "2016-04-30-preview"
},
"responses": {
"200": {
"body": {
"value": [
{
"properties": {
"platformUpdateDomainCount": 5,
"platformFaultDomainCount": 2
},
"type": "Microsoft.Compute/availabilitySets",
"location": "centralus",
"tags": {
"{tagName}": "{tagValue}"
},
"id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}",
"name": "{availabilitySetName}",
"sku": {
"name": "Aligned"
}
},
{
"properties": {
"platformUpdateDomainCount": 3,
"platformFaultDomainCount": 2
},
"type": "Microsoft.Compute/availabilitySets",
"location": "westus",
"tags": {
"{tagName}": "{tagValue}"
},
"id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}",
"name": "{availabilitySetName}",
"sku": {
"name": "Classic"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
}
},
"x-ms-pageable": {
"nextLinkName": null
"nextLinkName": "nextLink"
}
}
},
Expand Down Expand Up @@ -2746,8 +2746,15 @@
"$ref": "#/definitions/AvailabilitySet"
},
"description": "The list of availability sets"
},
"nextLink": {
"type": "string",
"description": "The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets."
}
},
"required": [
"value"
],
"description": "The List Availability Set operation response."
},
"VirtualMachineSize": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,34 @@
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets": {
"get": {
"tags": [
"AvailabilitySets"
],
"operationId": "AvailabilitySets_ListBySubscription",
"description": "Lists all availability sets in a subscription.",
"parameters": [
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/AvailabilitySetListResult"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets": {
"get": {
"tags": [
Expand Down Expand Up @@ -191,7 +219,7 @@
}
},
"x-ms-pageable": {
"nextLinkName": null
"nextLinkName": "nextLink"
}
}
},
Expand Down Expand Up @@ -2792,8 +2820,15 @@
"$ref": "#/definitions/AvailabilitySet"
},
"description": "The list of availability sets"
},
"nextLink": {
"type": "string",
"description": "The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets."
}
},
"required": [
"value"
],
"description": "The List Availability Set operation response."
},
"VirtualMachineSize": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,34 @@
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets": {
"get": {
"tags": [
"AvailabilitySets"
],
"operationId": "AvailabilitySets_ListBySubscription",
"description": "Lists all availability sets in a subscription.",
"parameters": [
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/AvailabilitySetListResult"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets": {
"get": {
"tags": [
Expand Down Expand Up @@ -195,7 +223,7 @@
}
},
"x-ms-pageable": {
"nextLinkName": null
"nextLinkName": "nextLink"
}
}
},
Expand Down Expand Up @@ -3771,8 +3799,15 @@
"$ref": "#/definitions/AvailabilitySet"
},
"description": "The list of availability sets"
},
"nextLink": {
"type": "string",
"description": "The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets."
}
},
"required": [
"value"
],
"description": "The List Availability Set operation response."
},
"VirtualMachineSize": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"parameters": {
"subscriptionId": "{subscriptionId}",
"api-version": "2017-03-30"
},
"responses": {
"200": {
"body": {
"value": [
{
"properties": {
"platformUpdateDomainCount": 5,
"platformFaultDomainCount": 2
},
"type": "Microsoft.Compute/availabilitySets",
"location": "centralus",
"tags": {
"{tagName}": "{tagValue}"
},
"id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}",
"name": "{availabilitySetName}",
"sku": {
"name": "Aligned"
}
},
{
"properties": {
"platformUpdateDomainCount": 3,
"platformFaultDomainCount": 2
},
"type": "Microsoft.Compute/availabilitySets",
"location": "westus",
"tags": {
"{tagName}": "{tagValue}"
},
"id": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}",
"name": "{availabilitySetName}",
"sku": {
"name": "Classic"
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,34 @@
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets": {
"get": {
"tags": [
"AvailabilitySets"
],
"operationId": "AvailabilitySets_ListBySubscription",
"description": "Lists all availability sets in a subscription.",
"parameters": [
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/AvailabilitySetListResult"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets": {
"get": {
"tags": [
Expand Down Expand Up @@ -266,7 +294,7 @@
}
},
"x-ms-pageable": {
"nextLinkName": null
"nextLinkName": "nextLink"
}
}
},
Expand Down Expand Up @@ -4466,8 +4494,15 @@
"$ref": "#/definitions/AvailabilitySet"
},
"description": "The list of availability sets"
},
"nextLink": {
"type": "string",
"description": "The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets."
}
},
"required": [
"value"
],
"description": "The List Availability Set operation response."
},
"VirtualMachineSize": {
Expand Down
Loading