-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add spring cloud gateway cli #8037
Changes from 8 commits
cf29687
5e50736
036a88c
dc0c56f
eb0ef11
3a60fdb
c6b0743
b5a96de
26cb728
813a1ca
218c10e
28bcc64
6d6e81e
5dac9c2
2e47e63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,7 +213,7 @@ def load_command_table(self, args): | |
with self.command_group('containerapp job replica', is_preview=True) as g: | ||
g.custom_show_command('list', 'list_replica_containerappsjob') | ||
|
||
with self.command_group('containerapp env java-component nacos') as g: | ||
with self.command_group('containerapp env java-component nacos', is_preview=True) as g: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why update There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The nacos should be in preview status, and the preview is removed from java component level, we need add the preview back to nacos level. Just add in this pr for convenience |
||
g.custom_command('create', 'create_nacos', supports_no_wait=True) | ||
g.custom_command('update', 'update_nacos', supports_no_wait=True) | ||
g.custom_show_command('show', 'show_nacos') | ||
|
@@ -225,6 +225,12 @@ def load_command_table(self, args): | |
g.custom_show_command('show', 'show_admin_for_spring') | ||
g.custom_command('delete', 'delete_admin_for_spring', confirmation=True, supports_no_wait=True) | ||
|
||
with self.command_group('containerapp env java-component gateway-for-spring', is_preview=True) as g: | ||
g.custom_command('create', 'create_gateway_for_spring', supports_no_wait=True) | ||
g.custom_command('update', 'update_gateway_for_spring', supports_no_wait=True) | ||
g.custom_show_command('show', 'show_gateway_for_spring') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what about list? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The list command is consistent with other Java components at the Java component level. |
||
g.custom_command('delete', 'delete_gateway_for_spring', confirmation=True, supports_no_wait=True) | ||
|
||
with self.command_group('containerapp env dotnet-component', is_preview=True) as g: | ||
g.custom_command('list', 'list_dotnet_components') | ||
g.custom_show_command('show', 'show_dotnet_component') | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ | |
DEV_QDRANT_CONTAINER_NAME, DEV_QDRANT_SERVICE_TYPE, DEV_WEAVIATE_IMAGE, DEV_WEAVIATE_CONTAINER_NAME, DEV_WEAVIATE_SERVICE_TYPE, | ||
DEV_MILVUS_IMAGE, DEV_MILVUS_CONTAINER_NAME, DEV_MILVUS_SERVICE_TYPE, DEV_SERVICE_LIST, CONTAINER_APPS_SDK_MODELS, BLOB_STORAGE_TOKEN_STORE_SECRET_SETTING_NAME, | ||
DAPR_SUPPORTED_STATESTORE_DEV_SERVICE_LIST, DAPR_SUPPORTED_PUBSUB_DEV_SERVICE_LIST, | ||
JAVA_COMPONENT_CONFIG, JAVA_COMPONENT_EUREKA, JAVA_COMPONENT_ADMIN, JAVA_COMPONENT_NACOS, DOTNET_COMPONENT_RESOURCE_TYPE) | ||
JAVA_COMPONENT_CONFIG, JAVA_COMPONENT_EUREKA, JAVA_COMPONENT_ADMIN, JAVA_COMPONENT_NACOS, JAVA_COMPONENT_GATEWAY, DOTNET_COMPONENT_RESOURCE_TYPE) | ||
|
||
|
||
logger = get_logger(__name__) | ||
|
@@ -2328,7 +2328,7 @@ def delete_java_component(cmd, java_component_name, environment_name, resource_g | |
return java_component_decorator.delete() | ||
|
||
|
||
def create_java_component(cmd, java_component_name, environment_name, resource_group_name, target_java_component_type, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, no_wait): | ||
def create_java_component(cmd, java_component_name, environment_name, resource_group_name, target_java_component_type, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, route_yaml, no_wait): | ||
raw_parameters = locals() | ||
java_component_decorator = JavaComponentDecorator( | ||
cmd=cmd, | ||
|
@@ -2340,7 +2340,7 @@ def create_java_component(cmd, java_component_name, environment_name, resource_g | |
return java_component_decorator.create() | ||
|
||
|
||
def update_java_component(cmd, java_component_name, environment_name, resource_group_name, target_java_component_type, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, no_wait): | ||
def update_java_component(cmd, java_component_name, environment_name, resource_group_name, target_java_component_type, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, route_yaml, no_wait): | ||
raw_parameters = locals() | ||
java_component_decorator = JavaComponentDecorator( | ||
cmd=cmd, | ||
|
@@ -2352,12 +2352,12 @@ def update_java_component(cmd, java_component_name, environment_name, resource_g | |
return java_component_decorator.update() | ||
|
||
|
||
def create_config_server_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, unbind_service_bindings=None, service_bindings=None, min_replicas=1, max_replicas=1, no_wait=False): | ||
return create_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_CONFIG, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, no_wait) | ||
def create_config_server_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, unbind_service_bindings=None, service_bindings=None, min_replicas=1, max_replicas=1, route_yaml=None, no_wait=False): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why add Same as update_config_server_for_spring, create_eureka_server_for_spring, update_eureka_server_for_spring, create_nacos, update_nacos, create_admin_for_spring, update_admin_for_spring There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, they are not used in commands except gateway. Thanks for teaching me the usage of params, I have removed them with better coding |
||
return create_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_CONFIG, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, route_yaml, no_wait) | ||
|
||
|
||
def update_config_server_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, unbind_service_bindings=None, service_bindings=None, min_replicas=None, max_replicas=None, no_wait=False): | ||
return update_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_CONFIG, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, no_wait) | ||
def update_config_server_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, unbind_service_bindings=None, service_bindings=None, min_replicas=None, max_replicas=None, route_yaml=None, no_wait=False): | ||
return update_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_CONFIG, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, route_yaml, no_wait) | ||
|
||
|
||
def show_config_server_for_spring(cmd, java_component_name, environment_name, resource_group_name): | ||
|
@@ -2368,12 +2368,12 @@ def delete_config_server_for_spring(cmd, java_component_name, environment_name, | |
return delete_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_CONFIG, no_wait) | ||
|
||
|
||
def create_eureka_server_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, unbind_service_bindings=None, service_bindings=None, min_replicas=1, max_replicas=1, no_wait=False): | ||
return create_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_EUREKA, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, no_wait) | ||
def create_eureka_server_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, unbind_service_bindings=None, service_bindings=None, min_replicas=1, max_replicas=1, route_yaml=None, no_wait=False): | ||
return create_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_EUREKA, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, route_yaml, no_wait) | ||
|
||
|
||
def update_eureka_server_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, unbind_service_bindings=None, service_bindings=None, min_replicas=None, max_replicas=None, no_wait=False): | ||
return update_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_EUREKA, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, no_wait) | ||
def update_eureka_server_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, unbind_service_bindings=None, service_bindings=None, min_replicas=None, max_replicas=None, route_yaml=None, no_wait=False): | ||
return update_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_EUREKA, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, route_yaml, no_wait) | ||
|
||
|
||
def show_eureka_server_for_spring(cmd, java_component_name, environment_name, resource_group_name): | ||
|
@@ -2384,12 +2384,12 @@ def delete_eureka_server_for_spring(cmd, java_component_name, environment_name, | |
return delete_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_EUREKA, no_wait) | ||
|
||
|
||
def create_nacos(cmd, java_component_name, environment_name, resource_group_name, configuration=None, service_bindings=None, unbind_service_bindings=None, min_replicas=1, max_replicas=1, no_wait=False): | ||
return create_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_NACOS, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, no_wait) | ||
def create_nacos(cmd, java_component_name, environment_name, resource_group_name, configuration=None, service_bindings=None, unbind_service_bindings=None, min_replicas=1, max_replicas=1, route_yaml=None, no_wait=False): | ||
return create_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_NACOS, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, route_yaml, no_wait) | ||
|
||
|
||
def update_nacos(cmd, java_component_name, environment_name, resource_group_name, configuration=None, service_bindings=None, unbind_service_bindings=None, min_replicas=None, max_replicas=None, no_wait=False): | ||
return update_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_NACOS, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, no_wait) | ||
def update_nacos(cmd, java_component_name, environment_name, resource_group_name, configuration=None, service_bindings=None, unbind_service_bindings=None, min_replicas=None, max_replicas=None, route_yaml=None, no_wait=False): | ||
return update_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_NACOS, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, route_yaml, no_wait) | ||
|
||
|
||
def show_nacos(cmd, java_component_name, environment_name, resource_group_name): | ||
|
@@ -2400,12 +2400,12 @@ def delete_nacos(cmd, java_component_name, environment_name, resource_group_name | |
return delete_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_NACOS, no_wait) | ||
|
||
|
||
def create_admin_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, service_bindings=None, unbind_service_bindings=None, min_replicas=1, max_replicas=1, no_wait=False): | ||
return create_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_ADMIN, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, no_wait) | ||
def create_admin_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, service_bindings=None, unbind_service_bindings=None, min_replicas=1, max_replicas=1, route_yaml=None, no_wait=False): | ||
return create_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_ADMIN, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, route_yaml, no_wait) | ||
|
||
|
||
def update_admin_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, service_bindings=None, unbind_service_bindings=None, min_replicas=None, max_replicas=None, no_wait=False): | ||
return update_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_ADMIN, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, no_wait) | ||
def update_admin_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, service_bindings=None, unbind_service_bindings=None, min_replicas=None, max_replicas=None, route_yaml=None, no_wait=False): | ||
return update_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_ADMIN, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, route_yaml, no_wait) | ||
|
||
|
||
def show_admin_for_spring(cmd, java_component_name, environment_name, resource_group_name): | ||
|
@@ -2416,6 +2416,22 @@ def delete_admin_for_spring(cmd, java_component_name, environment_name, resource | |
return delete_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_ADMIN, no_wait) | ||
|
||
|
||
def create_gateway_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, service_bindings=None, unbind_service_bindings=None, min_replicas=1, max_replicas=1, route_yaml=None, no_wait=False): | ||
return create_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_GATEWAY, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, route_yaml, no_wait) | ||
|
||
|
||
def update_gateway_for_spring(cmd, java_component_name, environment_name, resource_group_name, configuration=None, service_bindings=None, unbind_service_bindings=None, min_replicas=None, max_replicas=None, route_yaml=None, no_wait=False): | ||
return update_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_GATEWAY, configuration, service_bindings, unbind_service_bindings, min_replicas, max_replicas, route_yaml, no_wait) | ||
|
||
|
||
def show_gateway_for_spring(cmd, java_component_name, environment_name, resource_group_name): | ||
return show_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_GATEWAY) | ||
|
||
|
||
def delete_gateway_for_spring(cmd, java_component_name, environment_name, resource_group_name, no_wait=False): | ||
return delete_java_component(cmd, java_component_name, environment_name, resource_group_name, JAVA_COMPONENT_GATEWAY, no_wait) | ||
|
||
|
||
def set_environment_telemetry_data_dog(cmd, | ||
name, | ||
resource_group_name, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried https://aka.ms/gateway-for-spring-routes-yaml
But seems it doesn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link will point to our SCG doc, we will release the doc after the cli released, and make the link available.