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

Added BackupValidateOperation API #3395

Merged
merged 9 commits into from
Jul 18, 2018
Merged

Conversation

sumitmal
Copy link
Contributor

@sumitmal sumitmal commented Jul 11, 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

@AutorestCI
Copy link

AutorestCI commented Jul 11, 2018

Automation for azure-sdk-for-python

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-python#2945

@AutorestCI
Copy link

AutorestCI commented Jul 11, 2018

Automation for azure-sdk-for-go

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-go#2250

@AutorestCI
Copy link

AutorestCI commented Jul 11, 2018

Automation for azure-sdk-for-node

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-node#3047

@AutorestCI
Copy link

AutorestCI commented Jul 11, 2018

Automation for azure-sdk-for-ruby

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-ruby#1408

@AutorestCI
Copy link

AutorestCI commented Jul 11, 2018

Automation for azure-sdk-for-java

Nothing to generate for azure-sdk-for-java

Copy link
Member

@jhendrixMSFT jhendrixMSFT left a comment

Choose a reason for hiding this comment

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

Semantic validation is failing, can you please fix? https://travis-ci.org/Azure/azure-rest-api-specs/jobs/402622342

@sumitmal
Copy link
Contributor Author

@jhendrixMSFT the validation failed with below error, but the file is added at the right location in the PR. Can you let me know what am I missing?

Uncaught Error: /home/travis/build/Azure/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2017-07-01/bms.json has references that cannot be resolved. They are as follows:

'Error opening file "/home/travis/build/Azure/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2017-07-01/examples/AzureIaasVM/ValidateOperation_RestoreDisk.json" \nENOENT: no such file or directory, open '/home/travis/build/Azure/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2017-07-01/examples/AzureIaasVM/ValidateOperation_RestoreDisk.json''
at /home/travis/build/Azure/azure-rest-api-specs/test/syntax.js:72:17
at /home/travis/build/Azure/azure-rest-api-specs/node_modules/call-me-maybe/index.js:13:28
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)

@jhendrixMSFT
Copy link
Member

CI runs on Linux which has case-sensitive file paths. In part of the path you've specified AzureIaasVM but the file is checked in under AzureIaasVm.

@@ -4110,12 +4110,7 @@
"VMAppContainer",
"SQLAGWorkLoadContainer",
"StorageContainer",
"GenericContainer",
Copy link
Member

Choose a reason for hiding this comment

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

Why are these being removed from a stable spec? This is a breaking change from an SDK perspective. Same comment applies to other places where enums are removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GenericContainer should not have been there in first place. The API set is not exposed yet. I will check with the team on why this was there earlier.

Copy link
Member

Choose a reason for hiding this comment

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

When a swagger is merged into the public repo it's considered a release event. As such we've already released this for the Go programming language and possibly others. While we won't prevent you from making this change it will be flagged as a breaking change and reported in S360.

Copy link
Member

Choose a reason for hiding this comment

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

Do you want to leave these breaking changes as-is?

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. We discussed this internally. These were not used anywhere. So we will leave them as is.

"Validate"
],
"description": "Validate operation for specified backed up item. This is a synchronous operation.",
"operationId": "Validate_Operation",
Copy link
Member

Choose a reason for hiding this comment

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

I think we need a better name for this, what this will generate now is a client named Validate with a method named Operation which isn't very intuitive. If this API is to validate an existing backup I would suggest something like Backup_Validate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. The idea here is to validate the feasibility of the operation. Validate Operation can work before triggering the actual operation.
In example, we try to validate whether the restore operation can happen. API is written generic for all operations.
How about Operation_Validate ?

Copy link
Member

Choose a reason for hiding this comment

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

Ah I see, yeah let's go with Operation_Validate.

@jhendrixMSFT
Copy link
Member

jhendrixMSFT commented Jul 11, 2018

There are model validation failures for the added API, see the log here, can you please take a look? You can find instructions on running the model validation locally here, the command will be oav validate-example <path to spec>. In the output search for the operation ID "Validate_Operation".

@jhendrixMSFT
Copy link
Member

Latest model validation failures log https://travis-ci.org/Azure/azure-rest-api-specs/jobs/403424152

@sumitmal
Copy link
Contributor Author

Not able to understand the Model failure logs? The additional paramaeters are actually part of IaasVMRestoreRequest. I thought if we add objectType (swagger discriminator to the sample, that would fix this.

"region": "southeastasia",
"createNewCloudService": true,
"originalStorageAccountOption": false,
"api-version": "2016-12-01",
Copy link
Member

Choose a reason for hiding this comment

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

OK regarding the model validation failures, I dug into this some more and the only problem is this extra "api-version" parameter in the request body. The reporting of the other properties appears to be a bug in the validation tool and we are investigating futher.

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.

3 participants