Service Bus: added Standard to Premium namespace migration API#2854
Service Bus: added Standard to Premium namespace migration API#2854hovsepm merged 8 commits intoAzure:masterfrom
Conversation
Automation for azure-sdk-for-pythonA PR has been created for you based on this PR content. Once this PR will be merged, content will be added to your service PR: |
Automation for azure-sdk-for-nodeThe initial PR has been merged into your service PR: |
Automation for azure-libraries-for-javaEncountered a Subprocess error: (azure-libraries-for-java)
Command: ['/usr/local/bin/autorest', '/tmp/tmpouo3q1gn/rest/specification/servicebus/resource-manager/readme.md', '--azure-libraries-for-java-folder=/tmp/tmpouo3q1gn/sdk', '--fluent', '--java', '--multiapi', '--verbose'] AutoRest code generation utility [version: 2.0.4262; node: v7.10.1]
(C) 2018 Microsoft Corporation.
https://aka.ms/autorest
Loading AutoRest core '/root/.autorest/@microsoft.azure_autorest-core@2.0.4272/node_modules/@microsoft.azure/autorest-core/dist' (2.0.4272)
Loading AutoRest extension '@microsoft.azure/autorest.java' (~2.1.32->2.1.49)
Loading AutoRest extension '@microsoft.azure/autorest.modeler' (2.3.38->2.3.38)
FATAL: System.Exception: Duplicate File Generation: src/main/java/com/microsoft/azure/management/servicebus/implementation/PremiumMessagingRegionsInner.java
at AutoRest.Core.CodeGenerator.<Write>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AutoRest.Core.CodeGenerator.<Write>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AutoRest.Java.Azure.Fluent.CodeGeneratorJvaf.<Generate>d__6.MoveNext() in C:\Users\autorest-ci\AppData\Local\Temp\2\PUBLISHedxhk\164_20180307T193002\autorest.java\src\azurefluent\CodeGeneratorJvaf.cs:line 74
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AutoRest.Java.Program.<ProcessInternal>d__3.MoveNext() in C:\Users\autorest-ci\AppData\Local\Temp\2\PUBLISHedxhk\164_20180307T193002\autorest.java\src\Program.cs:line 115
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NewPlugin.<Process>d__15.MoveNext()
FATAL: java/generate - FAILED
FATAL: Error: Plugin java reported failure.
Process() cancelled due to exception : Plugin java reported failure.
Error: Plugin java reported failure. |
Automation for azure-sdk-for-goA PR has been created for you based on this PR content. Once this PR will be merged, content will be added to your service PR: |
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/$default": { |
There was a problem hiding this comment.
I understand that $default is the only valid value now but right thing to do here is model it as a parameter with single-value enum instead of hardcoding.
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}
/providers/Microsoft.ServiceBus/namespaces/{namespaceName}
/migrationConfigurations/{configName}
and model {configName} as:
{
"name": "configName",
"in": "path",
"description": "The configuration name. Should always be \"$default\".",
"required": true,
"type": "string",
"enum": [
"$default"
],
"x-ms-enum": {
"name": "MigrationConfigurationName",
"modelAsString": true
}
}
There was a problem hiding this comment.
you can also move this definition to parameters section and refer it from eligible operations in migrationConfigurations operation group
There was a problem hiding this comment.
Since this is an enum with ONE value ($default) and is required there will not be an enum type generated in SDK instead method impl will uses a const with value $default, hence it is not exposed to user i.e. generated methods will not have a "configName" parameter, which is exactly what you want here.
| "migrationConfigurations" | ||
| ], | ||
| "operationId": "MigrationConfig_upgrade", | ||
| "description": "This operation disables the Migration", |
There was a problem hiding this comment.
This should be named as "migrationConfigurations_DisableMigration" or something more self explanatory. No need to move it to a separate operation group on the client SDKs;.
There was a problem hiding this comment.
changed it to 'migrationConfigurations_CompleteMigration' and changed the description. as this operation will complete migration process
|
@ravbhatnagar Could you check if it was approved by review board? |
|
please add |
| "migrationConfigurations" | ||
| ], | ||
| "operationId": "migrationConfigurations_Delete", | ||
| "description": "Deletes an MigrationConfig", |
There was a problem hiding this comment.
an [](start = 32, length = 2)
should be "Deletes a MigrationConfig"
| "properties": { | ||
| "provisioningState": { | ||
| "readOnly": true, | ||
| "type": "string", |
There was a problem hiding this comment.
provisioningState is a readonly field returned from server and may have additional values in the future. Modeling it as enums will cause client side runtime exceptions if there is a different value received.
There was a problem hiding this comment.
made it read only string
| "in": "path", | ||
| "description": "The configuration name. Should always be \"$default\".", | ||
| "required": true, | ||
| "type": "string", |
There was a problem hiding this comment.
Please add "x-ms-parameter-location": "method" annotation
|
Looks good! |
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}": { | ||
| "put": { |
There was a problem hiding this comment.
Is this operation a LRO? IF so you need to mark it as "x-ms-long-running-operation": true. Otherwise the description is kind of confusing. If this operation initiates migration how does developer check the status of Migration? If it creates the configuration then method/operation Id is confusing.
There was a problem hiding this comment.
yes its LRO, marked its as "x-ms-long-running-operation": true
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/upgrade": { | ||
| "post": { |
There was a problem hiding this comment.
are Migration upgrade and/or revert operations LRO?
There was a problem hiding this comment.
no, those are not LRO
| "tags": [ | ||
| "migrationConfigurations" | ||
| ], | ||
| "operationId": "migrationConfigurations_List", |
There was a problem hiding this comment.
migrationConfigurations [](start = 24, length = 23)
please think about consistency in the operation naming. Here you have migrationConfigurations while the other already existing operation group is named DisasterRecoveryConfigs
There was a problem hiding this comment.
could you please help me on this?
for DisasterRecoveryConfigs operations its 'DisasterRecoveryConfigs' for Namespaces operations its 'Namespaces'.
There was a problem hiding this comment.
the thing is that you have already shipped DisasterRecoveryConfigs (I mean shortened form of Configuration) that is why I advice keeping the consistency in names to shorten migrationConfigurations to MigrationConfigs
There was a problem hiding this comment.
@hovsepm changed shortened to 'MigrationConfigs'. Also in URI, DR is 'disasterrecoveryconfigs' so have changed for migration to 'migrationconfigs'. please let me know the URI change is fine or need to revert it.
hovsepm
left a comment
There was a problem hiding this comment.
Please address review comments.
|
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: 💡 Please review potentially introduced Error(s)/Warning(s): Analysis Report 💡 File: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
|
Hi There, I am the AutoRest Linter Azure bot. I am here to help. My task is to analyze the situation from the AutoRest linter perspective. Please review the below analysis result: 💡 Please review potentially introduced Error(s)/Warning(s): Analysis Report 💡 File: AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback Thanks for your co-operation. |
5a154dd to
0228c28
Compare
| "MigrationConfigurationsStartMigration": { "$ref": "./examples/Migrationconfigurations/SBMigrationconfigurationCreateAndStartMigration.json" } | ||
| }, | ||
| "description": "Creates Migration configuration and starts migration of enties from Standard to Premium namespace", | ||
| "parameters": [ |
There was a problem hiding this comment.
Looks like a typo "enties"
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "Delete Migration Config request accepted" |
There was a problem hiding this comment.
I think you should also handle 204: not found the same way as 200
There was a problem hiding this comment.
Otherwise callers will get Exception in C# and Java which is undesired.
e0db156 to
fe062c9
Compare
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-versionin the path should match theapi-versionin the spec).Quality of Swagger