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

[Service Connector] az spring connection: Add support for az sping-cloud renaming #22356

Merged
merged 1 commit into from
May 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]