-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Adding support for delegations on a subnet #3693
Adding support for delegations on a subnet #3693
Conversation
Can one of the admins verify this patch? |
Automation for azure-sdk-for-rubyNothing to generate for azure-sdk-for-ruby |
Automation for azure-sdk-for-pythonA PR has been created for you: |
Automation for azure-sdk-for-goA PR has been created for you: |
Automation for azure-sdk-for-nodeA PR has been created for you: |
Automation for azure-sdk-for-javaNothing to generate for azure-sdk-for-java |
c1cfa85
to
0985af5
Compare
6b10c04
to
8ef462d
Compare
{ | ||
"parameters" : { | ||
"api-version": "2018-08-01", | ||
"subscriptionId" : "subId" |
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.
Parameter "location" is required.
...anager/Microsoft.Network/stable/2018-08-01/examples/AvailableDelegationsSubscriptionGet.json
Show resolved
Hide resolved
"api-version": "2018-08-01", | ||
"subscriptionId" : "subId", | ||
"resourceGroupName" : "rg1" | ||
}, |
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.
Missing parameter "location".
...nager/Microsoft.Network/stable/2018-08-01/examples/AvailableDelegationsResourceGroupGet.json
Show resolved
Hide resolved
} | ||
], | ||
"delegations": [ | ||
{ |
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.
According to the spec, "delegations" is a list of ServiceDelegationPropertiesFormat
which doesn't contain name, id, properties.
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.
Hey Jianghao - I noticed that "id" isn't included in most of the resources, but is included in the examples (as it is in the response of the request).
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.
Does your service return "id", "name", etc? The spec and examples must match the service behavior.
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.
"provisioningState" in "properties" is not defined in the spec.
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.
Id, name comes from the SubResource.
And provisioningState is included here:
"ServiceDelegationPropertiesFormat": {
"properties": {
"serviceName": {
"type": "string",
"description": "The name of the service to whom the subnet should be delegated (e.g. Microsoft.Sql/servers)"
},
"actions": {
"type": "array",
"items": {
"type": "string"
},
"description": "Describes the actions permitted to the service upon delegation"
},
"provisioningState": {
"type": "string",
"description": "The provisioning state of the resource."
}
},
...k/resource-manager/Microsoft.Network/stable/2018-08-01/examples/SubnetGetWithDelegation.json
Outdated
Show resolved
Hide resolved
...k/resource-manager/Microsoft.Network/stable/2018-08-01/examples/SubnetGetWithDelegation.json
Show resolved
Hide resolved
...esource-manager/Microsoft.Network/stable/2018-08-01/examples/SubnetCreateWithDelegation.json
Show resolved
Hide resolved
...esource-manager/Microsoft.Network/stable/2018-08-01/examples/SubnetCreateWithDelegation.json
Outdated
Show resolved
Hide resolved
...esource-manager/Microsoft.Network/stable/2018-08-01/examples/SubnetCreateWithDelegation.json
Outdated
Show resolved
Hide resolved
} | ||
} | ||
} | ||
} |
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.
Is this a special character?
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.
looks like it just denotes that there is no newline at the EOF. Since none of the other files are saying that, I'll just add a newline
...ation/network/resource-manager/Microsoft.Network/stable/2018-08-01/availableDelegations.json
Show resolved
Hide resolved
...ation/network/resource-manager/Microsoft.Network/stable/2018-08-01/availableDelegations.json
Show resolved
Hide resolved
8ef462d
to
222ffaf
Compare
"$ref": "#/definitions/Delegation" | ||
}, | ||
"description": "Gets an array of references to the delegations on the subnet." | ||
}, | ||
"provisioningState": { |
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.
You need to include the "purpose" property as a read-only property or the SDK (and thus CLI) will not see it.
7fec20d
to
09faf04
Compare
8a7d951
to
a35f946
Compare
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.
Most errors are repeated across examples - I'm not going to post them all since they could be spec errors. Once spec errors are fixed we may see a significant decrease in model validation errors.
...anager/Microsoft.Network/stable/2018-08-01/examples/AvailableDelegationsSubscriptionGet.json
Show resolved
Hide resolved
...nager/Microsoft.Network/stable/2018-08-01/examples/AvailableDelegationsResourceGroupGet.json
Show resolved
Hide resolved
} | ||
], | ||
"delegations": [ | ||
{ |
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.
Does your service return "id", "name", etc? The spec and examples must match the service behavior.
"name": "myDelegation", | ||
"id": "/subscriptions/subId/resourceGroups/subnet-test/providers/Microsoft.Network/virtualNetworks/vnetname/subnets/subnet1/delegations/myDelegation", | ||
"properties": { | ||
"provisioningState": "Succeeded", |
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.
According the spec you are returning a "Delegation" instead of an "AvailableDelegation" here. "Delegation"'s properties don't contain provisioningState
and `actions': https://github.com/Azure/azure-rest-api-specs/pull/3693/files#diff-48ae68150e376ac636b1bc2e92b09b32R868.
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.
Maybe the service is actually returning "AvailableDelegation"? Please double check.
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.
AvailableDelegation and ServiceDelegation are two different resources on the backend
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.
Jianghaolu - I do not see any problem here. Rupali is returning Delegations. Can you please confirm and explain more on what you are saying?
a35f946
to
ea8045e
Compare
}, | ||
"AvailableDelegation": { | ||
"properties": { | ||
"name": { |
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.
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.
Couple of questions:
- Why?
- How?
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.
Because if it IS a proxy resource then extending it from proxy resource is the CORRECT 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.
You may also extend from SubResource and get rid of the id
property, that's okay too
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.
We'll fix this and get back.
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.
Fixed
21773b5
to
0139e0a
Compare
}, | ||
"Delegation": { | ||
"properties": { | ||
"properties": { |
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.
Property missing: "type"
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.
Fixed
], | ||
"purpose": "" | ||
}, | ||
"type": "Microsoft.Network/virtualNetworks/subnets" |
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.
"type" property is also missing in the definition of "Subnet"
This PR was completed via #3805 |
This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.
PR information
api-version
in the path should match theapi-version
in the spec).Quality of Swagger