Skip to content

RecoveryServices Identities and Usages APIs#920

Merged
dsgouda merged 5 commits into
Azure:masterfrom
MabOneSdk:master
Mar 27, 2017
Merged

RecoveryServices Identities and Usages APIs#920
dsgouda merged 5 commits into
Azure:masterfrom
MabOneSdk:master

Conversation

@dragonfly91
Copy link
Copy Markdown

@dragonfly91 dragonfly91 commented Feb 9, 2017

Adding registeredIdentities, vault extended info APIs and vault usages API. Also making this a composite client.

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

  • I have read the contribution guidelines.
  • My spec meets the review criteria:
    • The spec conforms to the Swagger 2.0 specification.
    • Validation errors from the Linter extension for VS Code have all been fixed for this spec. (Note: for large, previously checked in specs, there will likely be many errors shown. Please contact our team so we can set a timeframe for fixing these errors if your PR is not going to address them).
    • The spec follows the patterns described in the Swagger good patterns document unless the service API makes this impossible.

@amarzavery
Copy link
Copy Markdown
Contributor

amarzavery commented Feb 10, 2017

@dragonfly91 - Hello, thanks for sending the PR.

Can you please provide (1 minimum [just the required properties/parameters for making a request] and 1 maximum [full blown request with all the required and optional properties]) examples for request and response using the extension "x-ms-examples"? This will

  • help us validate the the swagger spec using the examples and catch errors early on and
  • it will also form the basis for customer facing REST API documentation on docs.microsoft.com website.

You can find more info about the extension and an example swagger spec over here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not used anywhere in document, just wondering if it is required

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This was output by Swashbuckle tool by default and we can't remove it while document generation. Our previous PR also contained this object but was merged still.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove it after document generation. Note that generating using Swashbuckle is supposed to be a one time thing, so editing this out should not be an issue. We will not merge (and should not have merged) it like that. SDK's providing their own (unused) Object type are super weird.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

In our team, we have a deeply integrated Swashbuckle tier with which we are aiming to generate the specs with a quality that is review ready. So it is not one time for us. Anyway, we can write a post-script to remove the Object definition manually. Will update the PR by addressing this comment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider x-ms-client-flatten to avoid nested properties

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is a polymorphic response type and we observed previously that this structure needs to be preserved for polymorphism to work in the intended manner.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider setting format to byte (for base64 as per swagger specs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

type:string and format:byte for base64 encoding

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit:typo

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

discriminator should be set to required

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is addressed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider setting a min/max length and a regex all params like these

Copy link
Copy Markdown
Author

@dragonfly91 dragonfly91 Feb 22, 2017

Choose a reason for hiding this comment

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

Is this a new requirement? This was not suggested in the previous PRs. Setting such constraints for global params in each Swagger spec - isn't this a bit redundant; where every team has to add the exact same settings?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Disregard this comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@dragonfly91 Our set of requirements is constantly in motion, "previous PRs" always let stuff pass that won't pass now, even if it's just because a reviewer missed something.
Regarding min/max length or regex patterns: If there is a well defined and strictly enforced (by your service) contract that is most likely not going to change soon, it makes sense to specify it here. For example: Thinking of vaultName, if your service rejects empty string, please do provide a min length of 1. The client side validation will not only fail faster but also provide a better exception!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doesn't look like this is used anywhere

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is output by Swashbuckle by default and we were not able to get rid of it. Can this be ignored?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@amarzavery do you have an opinion here?

@dragonfly91
Copy link
Copy Markdown
Author

dragonfly91 commented Feb 20, 2017

@amarzavery, is providing x-ms-examples a blocker for the review to pass?

We use Swashbuckle to auto generate the swagger specs and this new requirement is not yet supported in the tool. So we need to write extra filters and tooling to auto generate the example files. We are in the middle of a release cycle right now and this would add extra cost; we would really like to take this up in the upcoming PR. Is it fine?

@dragonfly91 dragonfly91 force-pushed the master branch 2 times, most recently from e76550c to f44da91 Compare February 22, 2017 08:09
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The correct convention to name operations here would be either "usages_list" or "usages_listbyvaults"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Vault usage represents usage per vault. The guideline states that the first half of Operation ID should be noun; VaultUsage is a compound noun. What is the issue with this name?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We are updating some of these guidelines. "Usages" should be the noun here, we plan to discourage such compound nouns moving forward. When fetching collections, the list operation should be named as either "CollectionItem_List" or "CollectionItem_ListByParent" where parent is the immediate preceding type in the url, which is "vaults" in this case

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

'PUT' operations should be named as "_create" or "_update"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An Operations API must be exposed which lists all the operations available

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An Operations API must be exposed which lists all the operations available

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ResourceCertificateDetailsResource is a tracked resource which must have a "GET" operation and a "PATCH" operation (which supports at least updating of tags)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We don't have GET and PATCH APIs supported in our service as of now. Is this a blocking requirement? We will open a bug on our backend service to support these APIs and once they are in production, we can add the Swagger descriptions for those APIs. Will this work?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For newer swagger specs we're considering this as a blocking requirement. @ravbhatnagar FYI

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agreed, GET/PATCH are required. @dragonfly91 - Have these APIs gone through the ARM/Azure API review ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

An Operations API must be exposed which lists all the operations available

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I understand that the requirement seems to be to support one ListOperations API per swagger spec. We do have Operation_List APIs for each doc, but we have not yet exposed some of the APIs in Swagger yet. So, is it okay if the Operation_List API returns more APIs than that are defined in the spec?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

After some offline discussions it seems exposing the operations API as-is would be the right thing to do.
Alternatively:

  • You could expose all the right APIs in the swagger documents for completeness OR
  • You could return only those APIs that are currently in swagger from the operations API
    @ravbhatnagar could you chime in here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep, exposing all operations through the /operations API is required. Please fix!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@amarzavery do you have an opinion here?

@dsgouda
Copy link
Copy Markdown
Contributor

dsgouda commented Feb 24, 2017

Apart from the latest validation rules' violations, PR seems fine, @olydis / @amarzavery would appreciate if you took a cursory look

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like a result-only data type. If so, please mark all properties as readonly. Same applies to MonitoringSummary and JobsSummary. If primitive member are guaranteed to exist in server responses (if they are "required" to be sent), mark them as x-nullable: false to provide a better user experience for the resulting .Net SDK.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

uhm what is this? not used, so please remove

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is the order of parameters intended? I have no clear expectations regarding this service, but it seems odd that vaultName is named prior to resourceGroupName, especially since this is the reverse order of how stuff appears in the path! Does this generate an intuitive method signature? (this comment may apply to other methods)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this an intuitive name? e.g. are both the Resource prefix and suffix crucial?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hmmm, a property named "properties" that returns something of type "...Details". @amarzavery Is this convention regarding extending Resource types? Otherwise this mismatch feels a little counter-intuitive.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

duplicate description (or not really specific to this usage). The "encodedness" seems to be a property of the type and not this usage, so simply say that in the type's description and remove this one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is properties required or is your service happy about empty requests? Mark the property as required otherwise.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like a request data type, but none of the properties are marked as required. What does your service do if some of those are missing? I guess at least certificate is required, so please mark it accordingly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove it after document generation. Note that generating using Swashbuckle is supposed to be a one time thing, so editing this out should not be an issue. We will not merge (and should not have merged) it like that. SDK's providing their own (unused) Object type are super weird.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@dragonfly91 Our set of requirements is constantly in motion, "previous PRs" always let stuff pass that won't pass now, even if it's just because a reviewer missed something.
Regarding min/max length or regex patterns: If there is a well defined and strictly enforced (by your service) contract that is most likely not going to change soon, it makes sense to specify it here. For example: Thinking of vaultName, if your service rejects empty string, please do provide a min length of 1. The client side validation will not only fail faster but also provide a better exception!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

id, type and name properties for Resource should be marked as read-only

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Paths should follow this format Subscriptions/{subscriptionId}/ResourceGroups/{resourceGroupName}/providers/namespace/typename1/{typename1type}/typename2/{typename2type}/operationname

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any updates?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Our service contains this API which is in production and we can't afford to change this at time point. Can't take this change now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sure, that works, please mark it as a future requirement since this might become a blocker moving forward

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

patch operations should be named as '_update'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Is this an operation that could take a long time (>30 seconds) if so we might need a 202 response and x-ms-long-running-operation set to true. This applies to the delete operation as well

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any updates here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This API doesn't take more than 30 seconds; we haven't modeled it as a long running operation in our back-end. So, this comment doesn't apply to us.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Vault is a tracked resource, please expose a PATCH operation for it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mark resource properties "id, name, tag" as readonly

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Per @olydis comments remove this definition even if it is autogenerated by swashbuckle

@olydis
Copy link
Copy Markdown
Contributor

olydis commented Mar 8, 2017

Note that most of our CI jobs are currently failing. As far as I can tell it's due to compositeRecoveryServicesClient.json being invalid JSON (trailing comma in array).

"produces": [
"application/json"
],
"parameters": [
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: maintain consistency, either place SubscriptionId and ApiVersion together at the beginning of the parameters section or at the end

],
"parameters": [
{
"$ref": "#/parameters/ApiVersion"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: same comment as above

"$ref": "#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/VaultName"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Definitely maintain parameter ordering here as it appears in the path, that makes for better user experience

"description": "Summary of the replication monitoring data for this vault.",
"type": "object",
"properties": {
"unHealthyVmCount": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: typo unhealthyVmCount

Copy link
Copy Markdown
Author

@dragonfly91 dragonfly91 Mar 20, 2017

Choose a reason for hiding this comment

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

Can't take this comment, as this involves changing the service contract.

}
}
},
"Object": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Per earlier discussions please remove these Object definitions even if swashbuckle autogenerated these

],
"parameters": [
{
"$ref": "#/parameters/ApiVersion"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Parameter ordering

],
"parameters": [
{
"$ref": "#/parameters/ApiVersion"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fix parameter ordering

"type": "string",
"readOnly": true
},
"blobDuration": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this a string in date-time format, please confirm

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, this is a string in date-time format

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please set the format accordingly

"readOnly": true
},
"Properties": {
"$ref": "#/definitions/ClientDiscoveryForProperties",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ClientDiscoveryForProperties does not sound right semantically. Did you mean ClientDiscoveryProperties

},
"x-ms-discriminator-value": "AzureActiveDirectory"
},
"ResourceCertificateAndACSDetails": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this being used/allOfed anywhere? What is the discriminator field here given you are setting the x-ms-discriminator extension

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is a derived class.

Copy link
Copy Markdown
Contributor

@dsgouda dsgouda left a comment

Choose a reason for hiding this comment

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

A bunch of model definitions are being repeated across files, it's better if they are consolidated instead given we have a composite swagger here anyway
Also, if model definitions are not being used, please remove them

],
"parameters": [
{
"$ref": "#/parameters/SubscriptionId"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: parameter ordering

],
"parameters": [
{
"$ref": "#/parameters/SubscriptionId"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: parameter ordering

],
"parameters": [
{
"$ref": "#/parameters/SubscriptionId"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit:parameter ordering

],
"parameters": [
{
"$ref": "#/parameters/SubscriptionId"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: parameter ordering

],
"parameters": [
{
"$ref": "#/parameters/SubscriptionId"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit:parameter ordering

}
}
},
"ClientDiscoveryForProperties": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is being defined twice, can we define it in a single definitions section instead and refer accordingly, this applies to all model definitions being repeated here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Do you mean to say that this is repeated across multiple JSONs? Is there a way to share definitions across swagger json files?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes the model definitions are repeated across JSONs. If you believe these definitions are going to be the same for these JSONs it makes sense to put them in a common spec and refer it from there. (Given that the JSONs here belong to the same namespace i.e. Microsoft.RecoveryServices I would believe that to be the case)
Yes, you can certainly share definitions across JSONs. Here is an example

"$ref": "./networkInterface.json#/definitions/NetworkInterfaceListResult"

},
"x-ms-azure-resource": true
},
"NonTrackedResource": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NonTrackedResource cannot have the location property. Also if you wish to have tracked and proxy (non-tracked) resources do the following:

  • Define a base class called Resource with id, name, tag readonly properties
  • Define a tracked resource with location as required property that allOfs on Resource
  • Define a proxy resource (non tracked resource) that allOfs on Resource and has any additional properties you wish to add

Copy link
Copy Markdown
Contributor

@dsgouda dsgouda left a comment

Choose a reason for hiding this comment

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

Requesting some Minor changes and updates on some previous comments, looks good otherwise

],
"parameters": [
{
"$ref": "#/parameters/SubscriptionId"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Please maintain consistency with parameter ordering, either put SubscriptionId and ApiVersion together at the beginning or at the end of the parameters section

],
"parameters": [
{
"$ref": "#/parameters/SubscriptionId"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: parameter ordering

"application/json"
],
"parameters": [
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: parameter ordering

"application/json"
],
"parameters": [
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: parameter ordering

}
}
},
"ResourceCertificateAndAADDetails": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unless I'm mistaken there are duplicate properties in ResourceCertificateAndAADDetails and ResourceCertificateAndACSDetails, why not move them in ResourceCertificateDetails

"application/json"
],
"parameters": [
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit parameter ordering

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any updates?

}
}
},
"Resource": {
Copy link
Copy Markdown
Contributor

@dsgouda dsgouda Mar 21, 2017

Choose a reason for hiding this comment

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

Please set the extension x-ms-azure-resource to true

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We don't want to model Resource as a tracked resource. Only the "TrackedResource" should be an ARM resource and Vault derives from TrackedResource, which derives from Resource.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can set move the x-ms-azure-resource extension from "TrackedResource" to "Resource". The extension does not determine if a resource is "TrackedResource" or not, the required property location does that

"$ref": "#/definitions/Vault"
}
},
"nextLink": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

mark this as readonly

}
},
"VaultExtendedInfo": {
"description": "Vault extended information.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: This is a part of request and response objects, please ensure the right properties have been set to readonly

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Planning to take this up in the next iteration

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think that is a good idea. Parameters that can be set only at the server side should be marked readonly accordingly. Not doing this would allow users to send incorrect request to the server and result in a bad developer experience.
@olydis thoughts?

Copy link
Copy Markdown
Contributor

@olydis olydis Mar 22, 2017

Choose a reason for hiding this comment

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

@dragonfly91 @dsgouda Indeed, we even had unusable SDK methods in the past because of that very issue. It boils down to this: readonly not only improves the developer experience, but also causes properties to not be serialized by generated clients during requests. We had RPs that rejected POST/PUT requests containing properties that are readonly from the services perspective. I'm not sure about your RP, but please be aware of this problem and make sure - not only for the developer experience, but actual basic usability - that sending those properties makes sense for your service!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I've confirmed that none of the properties in this class are eligible for readOnly:true; all the properties can be set during Creation / Update.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for confirming this

@dragonfly91
Copy link
Copy Markdown
Author

I took care of the param ordering comments and the comment about restructuring the Resource Certificate. Planning to take up remaining comments in the next iteration.

@dsgouda
Copy link
Copy Markdown
Contributor

dsgouda commented Mar 21, 2017

@azuresdkci Test this please

Copy link
Copy Markdown
Contributor

@dsgouda dsgouda left a comment

Choose a reason for hiding this comment

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

Looks good to me

@dsgouda
Copy link
Copy Markdown
Contributor

dsgouda commented Mar 22, 2017

@sarangan12 Can you make required changes in the ruby sdk to unblock the failing CI builds

"description": "Composite Swagger for Recovery Services Client"
},
"documents": [
"./2015-11-10/swagger/replicationusages.json",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So, I missed this earlier. You cannot have different version references like so. What you want to do here is keep the 2015-11-10/swagger/replicationusages.json file as it is and create a new file 2016-06-01/swagger/replicationusages.json and have it referenced here.

Copy link
Copy Markdown
Contributor

@dsgouda dsgouda left a comment

Choose a reason for hiding this comment

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

Please address comment

Removed unwanted spec

Updating composite json
@dsgouda
Copy link
Copy Markdown
Contributor

dsgouda commented Mar 27, 2017

Ruby builds are failing since we need to make changes in the Ruby sdk repo to reflect the files corresponding to this RP
@sarangan12 will be making these changes once we merge this PR

@azuresdkci
Copy link
Copy Markdown
Contributor

Can one of the admins verify this patch?

@dsgouda dsgouda merged commit bd58a94 into Azure:master Mar 27, 2017
@AutorestCI
Copy link
Copy Markdown

No modification for NodeJS

@AutorestCI
Copy link
Copy Markdown

No modification for Python

mccleanp pushed a commit that referenced this pull request Mar 23, 2022
* MS.K8 ARM Spec

* Updated readme.ruby.md

* Removed azure-sdk-for-node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants