Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@
/src/dev-spaces-preview/ @saurabsa

/src/datamigration/ @temandr

/src/mesh/ @linggengmsft
34 changes: 34 additions & 0 deletions src/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,40 @@
"version": "0.1.3"
}
}
],
"mesh": [
{
"filename": "mesh-0.9.0-py2.py3-none-any.whl",
"sha256Digest": "fcfdaadd48b7ac5bb7248d07c0d8f20f2057faeed58b9e70634df3afb6ec84b5",
"downloadUrl": "https://meshcli.blob.core.windows.net/cli/mesh-0.9.0-py2.py3-none-any.whl",
"metadata": {
"azext.minCliCoreVersion": "2.0.30",
"azext.isPreview": true,
"extensions": {
"python.details": {
"contacts": [
{
"email": "[email protected]",
"name": "Microsoft Corporation",
"role": "author"
}
],
"document_names": {
"description": "DESCRIPTION.rst"
},
"project_urls": {
"Home": "https://github.com/Azure/azure-cli"
}
}
},
"generator": "bdist_wheel (0.30.0)",
"license": "MIT",
"metadata_version": "2.0",
"name": "mesh",
"summary": "Support for Microsoft Azure Service Fabric Mesh - Public Preview",
"version": "0.9.0"
}
}
]
}
}
58 changes: 58 additions & 0 deletions src/mesh/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.. :changelog:

Release History
===============


0.9.0 (2018-07-16)
++++++++++++++++++

* Added diagnostic output to deployment create command.


0.8.0 (2018-07-09)
++++++++++++++++++

* Update SDK, use api-version (2018-07-01-preview).


0.7.0 (2018-06-26)
++++++++++++++++++

* Add statusDetails and unhealthyEvaluation


0.6.0 (2018-05-14)
++++++++++++++++++

* Change servicereplica and codepackage command name for CLI convenction


0.5.0 (2018-05-02)
++++++++++++++++++

* Public Preview - Service Fabric Mesh


0.4.0 (2018-03-26)
++++++++++++++++++

* Private Preview 2 - Application Model


0.3.0 (2018-01-26)
++++++++++++++++++

* Support Tail parameter in log.


0.2.0 (2018-01-19)
++++++++++++++++++

* Support Azure CLI 2.0.24 and up.


0.1.1 (2017-11-17)
++++++++++++++++++

* Preview release.
1 change: 1 addition & 0 deletions src/mesh/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include *.rst
49 changes: 49 additions & 0 deletions src/mesh/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Microsoft Azure CLI 'mesh' Command Module
==============================================================

Commands to manage Azure Service Fabric Mesh resources
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::

Group
az mesh: Manage Azure Service Fabric Mesh resources.

Commands:
app create: Create an application.
app delete: Delete an application.
app list : List applications.
app show : Show the details of an application.
codepackage logs : Tail the log of a container.

Commands to create an application
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::

Command
az mesh app create: Create an Service Fabric Mesh application.

Arguments
--resource-group -g [Required]: Name of resource group. You can configure the default group
using `az configure --defaults group=<name>`.
--mode
--no-wait : Do not wait for the long-running operation to finish.
--parameters
--template-file : The full file path of creation template.
--template-uri : The full file path of creation template on a http or https link.

Global Arguments
--debug : Increase logging verbosity to show all debug logs.
--help -h : Show this help message and exit.
--output -o : Output format. Allowed values: json, jsonc, table, tsv.
Default: json.
--query : JMESPath query string. See http://jmespath.org/ for more
information and examples.
--verbose : Increase logging verbosity. Use --debug for full debug logs.

Examples
Create an application with a template file on the remote.
az mesh app create --resource-group mygroup --template-uri
https://seabreezequickstart.blob.core.windows.net/quickstart/application-quickstart.json

Create an application with a template file on local disk.
az mesh app create --resource-group mygroup --template-file ./appTemplate.json
30 changes: 30 additions & 0 deletions src/mesh/azext_mesh/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader

from ._help import helps # pylint: disable=unused-import


class SbzCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
custom = CliCommandType(operations_tmpl='azext_mesh.custom#{}')
super(SbzCommandsLoader, self).__init__(cli_ctx=cli_ctx,
min_profile='2017-03-10-profile',
custom_command_type=custom)

def load_command_table(self, args):
from .commands import load_command_table
load_command_table(self, args)
return self.command_table

def load_arguments(self, command):
from ._params import load_arguments
load_arguments(self, command)


COMMAND_LOADER_CLS = SbzCommandsLoader
44 changes: 44 additions & 0 deletions src/mesh/azext_mesh/_client_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------


def _cf_mesh(cli_ctx, **_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from .servicefabricmesh.mgmt.servicefabricmesh import ServiceFabricMeshManagementClient
return get_mgmt_service_client(cli_ctx, ServiceFabricMeshManagementClient)


def cf_mesh_application(cli_ctx, _):
return _cf_mesh(cli_ctx).application


def cf_mesh_service(cli_ctx, _):
return _cf_mesh(cli_ctx).service


def cf_mesh_replica(cli_ctx, _):
return _cf_mesh(cli_ctx).replica


def cf_mesh_code_package(cli_ctx, _):
return _cf_mesh(cli_ctx).code_package


def cf_mesh_network(cli_ctx, _):
return _cf_mesh(cli_ctx).network


def cf_mesh_volume(cli_ctx, _):
return _cf_mesh(cli_ctx).volume


def _resource_client_factory(cli_ctx, **_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.cli.core.profiles import ResourceType
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES)


def cf_mesh_deployments(cli_ctx, _):
return _resource_client_factory(cli_ctx).deployments
13 changes: 13 additions & 0 deletions src/mesh/azext_mesh/_exception_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------


def resource_exception_handler(exception):
from knack.util import CLIError

if exception.response.status_code == 404:
raise CLIError('Can\'t find the resource.')
else:
raise CLIError(exception.message)
126 changes: 126 additions & 0 deletions src/mesh/azext_mesh/_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from knack.help_files import helps

helps['mesh'] = """
type: group
short-summary: (PREVIEW) Manage Azure Service Fabric Mesh Resources.
"""

helps['mesh deployment'] = """
type: group
short-summary: Manage Service Fabric Mesh deployments.
"""

helps['mesh deployment create'] = """
type: command
short-summary: Create a Service Fabric Mesh application.
examples:
- name: Create a deployment with a template file on the remote.
text: az mesh deployment create --resource-group mygroup --template-uri https://seabreezequickstart.blob.core.windows.net/templates/quickstart/sbz_rp.linux.json
- name: Create a deployment with a template file on local disk.
text: az mesh deployment create --resource-group mygroup --template-file ./appTemplate.json
"""

helps['mesh app'] = """
type: group
short-summary: Manage Service Fabric Mesh applications.
"""

helps['mesh app delete'] = """
type: command
short-summary: Delete a Service Fabric Mesh application.
"""

helps['mesh app list'] = """
type: command
short-summary: List Service Fabric Mesh applications.
"""

helps['mesh app show'] = """
type: command
short-summary: Get the details of a Service Fabric Mesh application.
"""

helps['mesh service'] = """
type: group
short-summary: Manage Service Fabric Mesh services.
"""

helps['mesh service show'] = """
type: command
short-summary: Get the details of a service.
"""

helps['mesh service-replica'] = """
type: group
short-summary: Manage Service Fabric Mesh service replicas.
"""

helps['mesh service-replica list'] = """
type: command
short-summary: List the details of service replicas.
"""

helps['mesh code-package-log'] = """
type: group
short-summary: Examine the logs for a codepackage.
"""

helps['mesh code-package-log get'] = """
type: command
short-summary: Examine the logs for a codepackage.
"""

helps['mesh network'] = """
type: group
short-summary: Manage networks.
"""

helps['mesh network delete'] = """
type: command
short-summary: Delete a network.
"""

helps['mesh network list'] = """
type: command
short-summary: List networks.
"""

helps['mesh network show'] = """
type: command
short-summary: Get the details of a network.
"""

helps['mesh volume'] = """
type: group
short-summary: Manage volumes.
"""

helps['mesh volume create'] = """
type: command
short-summary: Create a volume.
examples:
- name: Create a volume with a template file on a remote URL.
text: az mesh volume create --location westus --name myvolume --resource-group mygroup --template-uri https://mystorage.blob.core.windows.net/templates/volumeDescription.json
- name: Create a volume with a template file on local disk.
text: az mesh volume create --location westus --name myvolume --resource-group mygroup --template-file ./volumeDescription.json
"""

helps['mesh volume delete'] = """
type: command
short-summary: Delete a volume.
"""

helps['mesh volume list'] = """
type: command
short-summary: List volumes.
"""

helps['mesh volume show'] = """
type: command
short-summary: Get the details of a volume.
"""
Loading