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

Adding support for delegations on a subnet #3693

Conversation

rupalivohra
Copy link
Contributor

@rupalivohra rupalivohra commented Aug 21, 2018

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

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes.
  • Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

@AutorestCI
Copy link

AutorestCI commented Aug 21, 2018

Automation for azure-sdk-for-ruby

Nothing to generate for azure-sdk-for-ruby

@AutorestCI
Copy link

AutorestCI commented Aug 21, 2018

Automation for azure-sdk-for-python

A PR has been created for you:
Azure/azure-sdk-for-python#3231

@rupalivohra rupalivohra mentioned this pull request Aug 21, 2018
10 tasks
@AutorestCI
Copy link

AutorestCI commented Aug 21, 2018

Automation for azure-sdk-for-go

A PR has been created for you:
Azure/azure-sdk-for-go#2585

@AutorestCI
Copy link

AutorestCI commented Aug 21, 2018

Automation for azure-sdk-for-node

A PR has been created for you:
Azure/azure-sdk-for-node#3393

@AutorestCI
Copy link

AutorestCI commented Aug 21, 2018

Automation for azure-sdk-for-java

Nothing to generate for azure-sdk-for-java

{
"parameters" : {
"api-version": "2018-08-01",
"subscriptionId" : "subId"
Copy link
Contributor

Choose a reason for hiding this comment

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

Parameter "location" is required.

"api-version": "2018-08-01",
"subscriptionId" : "subId",
"resourceGroupName" : "rg1"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing parameter "location".

}
],
"delegations": [
{
Copy link
Contributor

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.

Copy link
Contributor Author

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).

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Member

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."
}
},

}
}
}
}
Copy link
Contributor

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?

Copy link
Contributor Author

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

"$ref": "#/definitions/Delegation"
},
"description": "Gets an array of references to the delegations on the subnet."
},
"provisioningState": {
Copy link
Member

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.

@rupalivohra rupalivohra force-pushed the Network-September-Release branch 2 times, most recently from 7fec20d to 09faf04 Compare August 30, 2018 19:14
@rupalivohra rupalivohra force-pushed the Network-September-Release branch 3 times, most recently from 8a7d951 to a35f946 Compare August 31, 2018 02:21
Copy link
Contributor

@jianghaolu jianghaolu left a 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.

}
],
"delegations": [
{
Copy link
Contributor

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",
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Member

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?

@rupalivohra rupalivohra force-pushed the Network-September-Release branch from a35f946 to ea8045e Compare August 31, 2018 18:49
},
"AvailableDelegation": {
"properties": {
"name": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Couple of questions:

  1. Why?
  2. How?

Copy link
Contributor

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.

Copy link
Contributor

@jianghaolu jianghaolu Aug 31, 2018

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

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

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

Fixed

@rupalivohra rupalivohra force-pushed the Network-September-Release branch from 21773b5 to 0139e0a Compare August 31, 2018 21:23
},
"Delegation": {
"properties": {
"properties": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Property missing: "type"

Copy link
Member

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"
Copy link
Contributor

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"

@rupalivohra
Copy link
Contributor Author

This PR was completed via #3805
Closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants