Skip to content

Commit 5ce9f07

Browse files
Add a parameter '--assign-endpoint' and deprecate the parameter '--is-public' (Azure#2972)
1 parent 36f1959 commit 5ce9f07

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

src/spring-cloud/HISTORY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Release History
33
2.1.2
44
-----
55
* Add optional '--deployment' to 'az spring-cloud app logs' command
6+
* Add a parameter '--assign-endpoint' into 'az spring-cloud app create' and 'az spring-cloud app update'
7+
* Deprecate the parameter '--is-public' in 'az spring-cloud app create' and 'az spring-cloud app update'
68

79
2.1.1
810
-----

src/spring-cloud/azext_spring_cloud/_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
- name: Create an app with the default configuration.
9494
text: az spring-cloud app create -n MyApp -s MyCluster -g MyResourceGroup
9595
- name: Create an public accessible app with 3 instances and 2 cpu cores and 3 GB of memory per instance.
96-
text: az spring-cloud app create -n MyApp -s MyCluster -g MyResourceGroup --is-public true --cpu 2 --memory 3 --instance-count 3
96+
text: az spring-cloud app create -n MyApp -s MyCluster -g MyResourceGroup --assign-endpoint true --cpu 2 --memory 3 --instance-count 3
9797
"""
9898

9999
helps['spring-cloud app update'] = """

src/spring-cloud/azext_spring_cloud/_params.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ def load_arguments(self, _):
7474
c.argument('name', name_type, help='Name of app.')
7575

7676
with self.argument_context('spring-cloud app create') as c:
77-
c.argument(
78-
'is_public', arg_type=get_three_state_flag(), help='If true, assign public domain', default=False)
77+
c.argument('assign_endpoint', arg_type=get_three_state_flag(),
78+
help='If true, assign endpoint URL for direct access.', default=False,
79+
options_list=['--assign-endpoint', c.deprecate(target='--is-public', redirect='--assign-endpoint', hide=True)])
7980
c.argument('assign_identity', arg_type=get_three_state_flag(),
8081
help='If true, assign managed service identity.')
8182
c.argument('cpu', type=int, default=1,
@@ -86,7 +87,9 @@ def load_arguments(self, _):
8687
default=1, help='Number of instance.', validator=validate_instance_count)
8788

8889
with self.argument_context('spring-cloud app update') as c:
89-
c.argument('is_public', arg_type=get_three_state_flag(), help='If true, assign endpoint')
90+
c.argument('assign_endpoint', arg_type=get_three_state_flag(),
91+
help='If true, assign endpoint URL for direct access.',
92+
options_list=['--assign-endpoint', c.deprecate(target='--is-public', redirect='--assign-endpoint', hide=True)])
9093
c.argument('https_only', arg_type=get_three_state_flag(), help='If true, access app via https', default=False)
9194

9295
for scope in ['spring-cloud app update', 'spring-cloud app start', 'spring-cloud app stop', 'spring-cloud app restart', 'spring-cloud app deploy', 'spring-cloud app scale', 'spring-cloud app set-deployment', 'spring-cloud app show-deploy-log']:

src/spring-cloud/azext_spring_cloud/custom.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def regenerate_keys(cmd, client, resource_group, name, type):
210210

211211

212212
def app_create(cmd, client, resource_group, service, name,
213-
is_public=None,
213+
assign_endpoint=None,
214214
cpu=None,
215215
memory=None,
216216
instance_count=None,
@@ -226,7 +226,6 @@ def app_create(cmd, client, resource_group, service, name,
226226
properties = models.AppResourceProperties()
227227
properties.temporary_disk = models.TemporaryDisk(
228228
size_in_gb=5, mount_path="/tmp")
229-
230229
resource = client.services.get(resource_group, service)
231230

232231
_validate_instance_count(resource.sku.tier, instance_count)
@@ -267,7 +266,7 @@ def app_create(cmd, client, resource_group, service, name,
267266

268267
logger.warning("[3/4] Setting default deployment to production")
269268
properties = models.AppResourceProperties(
270-
active_deployment_name=DEFAULT_DEPLOYMENT_NAME, public=is_public)
269+
active_deployment_name=DEFAULT_DEPLOYMENT_NAME, public=assign_endpoint)
271270

272271
if enable_persistent_storage:
273272
properties.persistent_disk = models.PersistentDisk(
@@ -300,7 +299,7 @@ def _check_active_deployment_exist(client, resource_group, service, app):
300299

301300

302301
def app_update(cmd, client, resource_group, service, name,
303-
is_public=None,
302+
assign_endpoint=None,
304303
deployment=None,
305304
runtime_version=None,
306305
jvm_options=None,
@@ -312,7 +311,7 @@ def app_update(cmd, client, resource_group, service, name,
312311
resource = client.services.get(resource_group, service)
313312
location = resource.location
314313

315-
properties = models.AppResourceProperties(public=is_public, https_only=https_only)
314+
properties = models.AppResourceProperties(public=assign_endpoint, https_only=https_only)
316315
if enable_persistent_storage is True:
317316
properties.persistent_disk = models.PersistentDisk(
318317
size_in_gb=_get_persistent_disk_size(resource.sku.tier), mount_path="/persistent")

src/spring-cloud/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# TODO: Confirm this is the right version number you want and it matches your
1818
# HISTORY.rst entry.
19-
VERSION = '2.1.1'
19+
VERSION = '2.1.2'
2020

2121
# The full list of classifiers is available at
2222
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)