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

mgmt core Region #14470

Merged
Merged

Conversation

weidongxu-microsoft
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft commented Aug 26, 2020

Put Region to azure-core-management, which is to be shared across mgmt SDKs.

Region is common to all mgmt Azure resources.
https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md#put-resource

Required, string. The location of the resource. This would be one amongst the supported Azure Geo Regions registered by the RP:West US | East US | North Central US | South Central US | West Europe | North Europe | East Asia | Southeast Asia | East US 2 | etc. Resource Providers should ignore whitespace and capitalization when accepting geo regions. That is, "West US," "westus" and "West us" should all be acceptable for the georegion. This will greatly simplify the pattern for CLI / Powershell / SDK clients. An RP should use this to create the resource in the appropriate geo-affinity region. The geo region of a resource never changes after it is created.


I am not sure whether this be in root namespace or better be a nested namespace (models)?

@weidongxu-microsoft weidongxu-microsoft changed the title mgmt core region mgmt core Region Aug 26, 2020
@weidongxu-microsoft
Copy link
Member Author

@srnagar Let me know if any feedback or recommendation.

*/
public static Region[] values() {
Collection<Region> valuesCollection = VALUES_BY_NAME.values();
return valuesCollection.toArray(new Region[valuesCollection.size()]);
Copy link
Member

Choose a reason for hiding this comment

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

Why not return the collection itself instead of converting it to array?

Copy link
Member Author

@weidongxu-microsoft weidongxu-microsoft Sep 3, 2020

Choose a reason for hiding this comment

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

@@ -32,6 +32,7 @@
public static final Region CANADA_CENTRAL = new Region("canadacentral", "Canada Central");
public static final Region CANADA_EAST = new Region("canadaeast", "Canada East");
public static final Region BRAZIL_SOUTH = new Region("brazilsouth", "Brazil South");
public static final Region BRAZIL_SOUTHEAST = new Region("brazilsoutheast", "Brazil Southeast");
Copy link
Member

Choose a reason for hiding this comment

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

Do we need another Region.java in azure-resourcemanager-resources? Can this just use the one in azure-core-management?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we add it in core-management, we will do the switch after next release.

@weidongxu-microsoft

This comment has been minimized.

@weidongxu-microsoft weidongxu-microsoft merged commit f01cc0b into Azure:master Sep 4, 2020
@weidongxu-microsoft weidongxu-microsoft deleted the mgmt-core_region branch September 4, 2020 13:12
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.

4 participants