Skip to content

Commit

Permalink
[DevSpaces] Adding endpoint type option to the extension (#1241)
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshvanga authored Feb 23, 2020
1 parent f380e3c commit 21f17ae
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/dev-spaces/azext_dev_spaces/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from azure.cli.core import AzCommandsLoader
from azure.cli.core.commands import CliCommandType
from azure.cli.core.commands.parameters import (get_enum_type)
import azext_dev_spaces._help # pylint: disable=unused-import
import azext_dev_spaces.custom # pylint: disable=unused-import

Expand All @@ -31,6 +32,8 @@ def load_arguments(self, _):
c.argument('cluster_name', options_list=['--name', '-n'])
c.argument('update', options_list=['--update'], action='store_true')
c.argument('space_name', options_list=['--space', '-s'])
c.argument('endpoint_type', get_enum_type(['Public', 'Private', 'None'], default='Public'),
options_list=['--endpoint', '-e'])
c.argument('do_not_prompt', options_list=['--yes', '-y'],
action='store_true', help='Do not prompt for confirmation. Requires --space.')

Expand Down
2 changes: 1 addition & 1 deletion src/dev-spaces/azext_dev_spaces/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"azext.minCliCoreVersion": "2.0.63"
"azext.minCliCoreVersion": "2.1.0"
}
8 changes: 6 additions & 2 deletions src/dev-spaces/azext_dev_spaces/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
# pylint:disable=no-member,too-many-lines,too-many-locals,too-many-statements


def ads_use_dev_spaces(cluster_name, resource_group_name, update=False, space_name=None, do_not_prompt=False):
def ads_use_dev_spaces(cluster_name, resource_group_name, update=False, space_name=None,
endpoint_type='Public', do_not_prompt=False):
"""
Use Azure Dev Spaces with a managed Kubernetes cluster.
Expand All @@ -31,14 +32,17 @@ def ads_use_dev_spaces(cluster_name, resource_group_name, update=False, space_na
:type update: bool
:param space_name: Name of the new or existing dev space to select. Defaults to an interactive selection experience.
:type space_name: String
:param endpoint_type: The endpoint type to be used for a Azure Dev Spaces controller. \
See https://aka.ms/azds-networking for more information.
:type endpoint_type: String
:param do_not_prompt: Do not prompt for confirmation. Requires --space.
:type do_not_prompt: bool
"""

azds_cli = _install_dev_spaces_cli(update, do_not_prompt)

use_command_arguments = [azds_cli, 'use', '--name', cluster_name,
'--resource-group', resource_group_name]
'--resource-group', resource_group_name, '--endpoint', endpoint_type]

if space_name is not None:
use_command_arguments.append('--space')
Expand Down
2 changes: 1 addition & 1 deletion src/dev-spaces/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from setuptools import setup, find_packages

VERSION = "1.0.4"
VERSION = "1.0.5"

CLASSIFIERS = [
'Development Status :: 4 - Beta',
Expand Down
44 changes: 44 additions & 0 deletions src/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,50 @@
}
],
"dev-spaces": [
{
"downloadUrl": "https://azuredevspacestools.blob.core.windows.net/azdssetup/LKS/dev_spaces-1.0.5-py2.py3-none-any.whl",
"filename": "dev_spaces-1.0.5-py2.py3-none-any.whl",
"metadata": {
"azext.minCliCoreVersion": "2.1.0",
"classifiers": [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"License :: OSI Approved :: MIT License"
],
"extensions": {
"python.details": {
"contacts": [
{
"email": "azds-azcli@microsoft.com",
"name": "Microsoft Corporation",
"role": "author"
}
],
"document_names": {
"description": "DESCRIPTION.rst"
},
"project_urls": {
"Home": "https://github.com/Azure/azure-cli-extensions"
}
}
},
"generator": "bdist_wheel (0.30.0)",
"license": "MIT",
"metadata_version": "2.0",
"name": "dev-spaces",
"summary": "Dev Spaces provides a rapid, iterative Kubernetes development experience for teams.",
"version": "1.0.5"
},
"sha256Digest": "6d481b89be4fe8835143433bb0b7c5ba2aba230433bc9ba483c0d26c5ef682a0"
},
{
"downloadUrl": "https://azuredevspacestools.blob.core.windows.net/azdssetup/LKS/dev_spaces-1.0.4-py2.py3-none-any.whl",
"filename": "dev_spaces-1.0.4-py2.py3-none-any.whl",
Expand Down

0 comments on commit 21f17ae

Please sign in to comment.