Skip to content

Comments

Service Bus: added Standard to Premium namespace migration API#2854

Merged
hovsepm merged 8 commits intoAzure:masterfrom
v-Ajnava:masterSBMigrate
Apr 20, 2018
Merged

Service Bus: added Standard to Premium namespace migration API#2854
hovsepm merged 8 commits intoAzure:masterfrom
v-Ajnava:masterSBMigrate

Conversation

@v-Ajnava
Copy link
Contributor

@v-Ajnava v-Ajnava commented Apr 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

Ajit Maruti Navasare (MINDTREE LIMITED) added 2 commits April 3, 2018 09:59
@AutorestCI
Copy link

AutorestCI commented Apr 11, 2018

Automation for azure-sdk-for-python

A 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:
Azure/azure-sdk-for-python#2037

@AutorestCI
Copy link

AutorestCI commented Apr 11, 2018

Automation for azure-sdk-for-node

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

@AutorestCI
Copy link

AutorestCI commented Apr 11, 2018

Automation for azure-libraries-for-java

Encountered 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']
Finished with return code 1
and output:

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.

@AutorestCI
Copy link

AutorestCI commented Apr 11, 2018

Automation for azure-sdk-for-go

A 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:
Azure/azure-sdk-for-go#1670

}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/$default": {
Copy link
Member

Choose a reason for hiding this comment

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

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
    }
}

Copy link
Member

Choose a reason for hiding this comment

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

you can also move this definition to parameters section and refer it from eligible operations in migrationConfigurations operation group

Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

"migrationConfigurations"
],
"operationId": "MigrationConfig_upgrade",
"description": "This operation disables the Migration",
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed it to 'migrationConfigurations_CompleteMigration' and changed the description. as this operation will complete migration process

@hovsepm hovsepm added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Apr 13, 2018
@hovsepm
Copy link
Contributor

hovsepm commented Apr 13, 2018

@ravbhatnagar Could you check if it was approved by review board?

@hovsepm
Copy link
Contributor

hovsepm commented Apr 13, 2018

please add x-ms-examples to all the new operations.

"migrationConfigurations"
],
"operationId": "migrationConfigurations_Delete",
"description": "Deletes an MigrationConfig",
Copy link
Contributor

Choose a reason for hiding this comment

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

an [](start = 32, length = 2)

should be "Deletes a MigrationConfig"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

"properties": {
"provisioningState": {
"readOnly": true,
"type": "string",
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made it read only string

"in": "path",
"description": "The configuration name. Should always be \"$default\".",
"required": true,
"type": "string",
Copy link
Member

Choose a reason for hiding this comment

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

Please add "x-ms-parameter-location": "method" annotation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

@ravbhatnagar
Copy link
Contributor

Looks good!

@ravbhatnagar ravbhatnagar added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Apr 19, 2018
@v-Ajnava v-Ajnava changed the title Service Bus: added Standard to Premium namespace migration API [DO NOT MERGE] Service Bus: added Standard to Premium namespace migration API Apr 19, 2018
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}": {
"put": {
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 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.

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 its LRO, marked its as "x-ms-long-running-operation": true

}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/migrationConfigurations/{configName}/upgrade": {
"post": {
Copy link
Contributor

Choose a reason for hiding this comment

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

are Migration upgrade and/or revert operations LRO?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, those are not LRO

"tags": [
"migrationConfigurations"
],
"operationId": "migrationConfigurations_List",
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

could you please help me on this?
for DisasterRecoveryConfigs operations its 'DisasterRecoveryConfigs' for Namespaces operations its 'Namespaces'.

Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

@v-Ajnava v-Ajnava Apr 20, 2018

Choose a reason for hiding this comment

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

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

Copy link
Contributor

@hovsepm hovsepm 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 review comments.

@azuresdkciprbot
Copy link

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: specification/servicebus/resource-manager/readme.md
Before the PR: Warning(s): 36 Error(s): 0
After the PR: Warning(s): 40 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

@azuresdkciprbot
Copy link

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: specification/servicebus/resource-manager/readme.md
Before the PR: Warning(s): 36 Error(s): 0
After the PR: Warning(s): 40 Error(s): 0

AutoRest Linter Guidelines | AutoRest Linter Issues | Send feedback

Thanks for your co-operation.

"MigrationConfigurationsStartMigration": { "$ref": "./examples/Migrationconfigurations/SBMigrationconfigurationCreateAndStartMigration.json" }
},
"description": "Creates Migration configuration and starts migration of enties from Standard to Premium namespace",
"parameters": [
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a typo "enties"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

],
"responses": {
"200": {
"description": "Delete Migration Config request accepted"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should also handle 204: not found the same way as 200

Copy link
Contributor

Choose a reason for hiding this comment

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

Otherwise callers will get Exception in C# and Java which is undesired.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants