Skip to content

Commit

Permalink
spring-cloud renaming (#22356)
Browse files Browse the repository at this point in the history
  • Loading branch information
houk-ms authored May 13, 2022
1 parent 0732186 commit 2d310f7
Showing 1 changed file with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
# The enum value will be used in command name
class RESOURCE(Enum):
WebApp = 'webapp'
SpringCloud = 'spring-cloud'
# `az spring-cloud` migrated to `az spring`
SpringCloud = 'spring'
SpringCloudDeprecated = 'spring-cloud'
KubernetesCluster = 'aks'
ContainerApp = 'containerapp'
CosmosCassandra = 'cosmos-cassandra'
Expand Down Expand Up @@ -70,7 +72,7 @@ class CLIENT_TYPE(Enum):


# The source resources released as CLI extensions
SOURCE_RESOURCES_IN_EXTENSION = [RESOURCE.SpringCloud, RESOURCE.ContainerApp]
SOURCE_RESOURCES_IN_EXTENSION = [RESOURCE.SpringCloud, RESOURCE.SpringCloudDeprecated, RESOURCE.ContainerApp]

# The source resources using user token
SOURCE_RESOURCES_USERTOKEN = [RESOURCE.KubernetesCluster]
Expand All @@ -82,6 +84,7 @@ class CLIENT_TYPE(Enum):
SOURCE_RESOURCES = {
RESOURCE.WebApp: '/subscriptions/{subscription}/resourceGroups/{source_resource_group}/providers/Microsoft.Web/sites/{site}',
RESOURCE.SpringCloud: '/subscriptions/{subscription}/resourceGroups/{source_resource_group}/providers/Microsoft.AppPlatform/Spring/{spring}/apps/{app}/deployments/{deployment}',
RESOURCE.SpringCloudDeprecated: '/subscriptions/{subscription}/resourceGroups/{source_resource_group}/providers/Microsoft.AppPlatform/Spring/{spring}/apps/{app}/deployments/{deployment}',
# RESOURCE.KubernetesCluster: '/subscriptions/{subscription}/resourceGroups/{source_resource_group}/providers/Microsoft.ContainerService/managedClusters/{cluster}',
RESOURCE.ContainerApp: '/subscriptions/{subscription}/resourceGroups/{source_resource_group}/providers/Microsoft.App/containerApps/{app}'
}
Expand Down Expand Up @@ -156,6 +159,28 @@ class CLIENT_TYPE(Enum):
'placeholder': 'MyDeployment'
}
},
RESOURCE.SpringCloudDeprecated: {
'source_resource_group': {
'options': ['--resource-group', '-g'],
'help': 'The resource group which contains the spring-cloud',
'placeholder': 'SpringCloudRG'
},
'spring': {
'options': ['--service'],
'help': 'Name of the spring-cloud service',
'placeholder': 'MySpringService'
},
'app': {
'options': ['--app'],
'help': 'Name of the spring-cloud app',
'placeholder': 'MyApp'
},
'deployment': {
'options': ['--deployment'],
'help': 'The deployment name of the app',
'placeholder': 'MyDeployment'
}
},
RESOURCE.KubernetesCluster: {
'source_resource_group': {
'options': ['--resource-group', '-g'],
Expand Down Expand Up @@ -706,6 +731,7 @@ class CLIENT_TYPE(Enum):
RESOURCE.ConfluentKafka: [AUTH_TYPE.Secret],
},
}
SUPPORTED_AUTH_TYPE[RESOURCE.SpringCloudDeprecated] = SUPPORTED_AUTH_TYPE[RESOURCE.SpringCloud]


# The dict defines the supported client types of each source-target resource pair
Expand Down Expand Up @@ -1041,5 +1067,6 @@ class CLIENT_TYPE(Enum):
]
}
}
SUPPORTED_CLIENT_TYPE[RESOURCE.SpringCloudDeprecated] = SUPPORTED_CLIENT_TYPE[RESOURCE.SpringCloud]
SUPPORTED_CLIENT_TYPE[RESOURCE.KubernetesCluster] = SUPPORTED_CLIENT_TYPE[RESOURCE.WebApp]
SUPPORTED_CLIENT_TYPE[RESOURCE.ContainerApp] = SUPPORTED_CLIENT_TYPE[RESOURCE.WebApp]

0 comments on commit 2d310f7

Please sign in to comment.