Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ure-cli-extensions into k8s-extension/public
  • Loading branch information
[email protected] authored and [email protected] committed Apr 3, 2021
2 parents 22c8e92 + 12212f1 commit 010e9a8
Show file tree
Hide file tree
Showing 32 changed files with 2,206 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -189,3 +189,5 @@
/src/next/ @zhoxing-ms

/src/redisenterprise/ @greenms

/src/cloudservice/ @qwordy
8 changes: 8 additions & 0 deletions src/cloudservice/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:
Release History
===============

0.1.0
++++++
* Initial release.
38 changes: 38 additions & 0 deletions src/cloudservice/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Azure CLI cloud-service Extension #
This is the extension for cloud-service. Refer to https://azure.microsoft.com/en-us/services/cloud-services/.

### How to use ###
Install this extension using the below CLI command
```
az extension add --name cloud-service
```

Get help of commands and subgroups.
```
az cloud-service -h
az cloud-service role -h
az cloud-service role-instance -h
az cloud-service update-domain -h
```

Create a cloud service.
```
az cloud-service create -g rg -n cs --roles ContosoFrontend:Standard_D1_v2:1:Standard ContosoBackend:Standard_D1_v2:1:Standard --package-url packageurl --configuration config --load-balancer-configurations myLoadBalancer:myfe:publicip:subnetid: myLoadBalancer2:myfe2:::privateip --secrets vault0:cert0:cert1 vault1:cert2:cert3:cert4 --extensions "@extensions.json"
```

`extensions.json` is a file that has the following content. Please replace values with your real values.
```
[
{
"properties": {
"type": "RDP",
"autoUpgradeMinorVersion": false,
"protectedSettings": "settings",
"publisher": "Microsoft.Windows.Azure.Extensions",
"settings": "settings",
"typeHandlerVersion": "1.2.1"
},
"name": "RDPExtension"
}
]
```
50 changes: 50 additions & 0 deletions src/cloudservice/azext_cloudservice/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azext_cloudservice.generated._help import helps # pylint: disable=unused-import
try:
from azext_cloudservice.manual._help import helps # pylint: disable=reimported
except ImportError:
pass


class ComputeManagementClientCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_cloudservice.generated._client_factory import cf_cloud_service_cl
cloud_service_custom = CliCommandType(
operations_tmpl='azext_cloudservice.custom#{}',
client_factory=cf_cloud_service_cl)
parent = super(ComputeManagementClientCommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=cloud_service_custom)

def load_command_table(self, args):
from azext_cloudservice.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_cloudservice.manual.commands import load_command_table as load_command_table_manual
load_command_table_manual(self, args)
except ImportError:
pass
return self.command_table

def load_arguments(self, command):
from azext_cloudservice.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_cloudservice.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError:
pass


COMMAND_LOADER_CLS = ComputeManagementClientCommandsLoader
17 changes: 17 additions & 0 deletions src/cloudservice/azext_cloudservice/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.action import * # noqa: F403
try:
from .manual.action import * # noqa: F403
except ImportError:
pass
4 changes: 4 additions & 0 deletions src/cloudservice/azext_cloudservice/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.15.0"
}
17 changes: 17 additions & 0 deletions src/cloudservice/azext_cloudservice/custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import

from .generated.custom import * # noqa: F403
try:
from .manual.custom import * # noqa: F403
except ImportError:
pass
12 changes: 12 additions & 0 deletions src/cloudservice/azext_cloudservice/generated/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

__path__ = __import__('pkgutil').extend_path(__path__, __name__)
32 changes: 32 additions & 0 deletions src/cloudservice/azext_cloudservice/generated/_client_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------


def cf_cloud_service_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.compute import ComputeManagementClient
return get_mgmt_service_client(cli_ctx,
ComputeManagementClient)


def cf_cloud_service_role_instance(cli_ctx, *_):
return cf_cloud_service_cl(cli_ctx).cloud_service_role_instances


def cf_cloud_service_role(cli_ctx, *_):
return cf_cloud_service_cl(cli_ctx).cloud_service_roles


def cf_cloud_service(cli_ctx, *_):
return cf_cloud_service_cl(cli_ctx).cloud_services


def cf_cloud_service_update_domain(cli_ctx, *_):
return cf_cloud_service_cl(cli_ctx).cloud_services_update_domain
Loading

0 comments on commit 010e9a8

Please sign in to comment.