Hello community,
here is the log from the commit of package azure-cli-container for
openSUSE:Factory checked in at 2018-10-15 10:47:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/azure-cli-container (Old)
and /work/SRC/openSUSE:Factory/.azure-cli-container.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "azure-cli-container"
Mon Oct 15 10:47:52 2018 rev:4 rq:641227 version:0.3.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/azure-cli-container/azure-cli-container.changes
2018-05-13 16:01:57.369137270 +0200
+++
/work/SRC/openSUSE:Factory/.azure-cli-container.new/azure-cli-container.changes
2018-10-15 10:47:54.279104007 +0200
@@ -1,0 +2,9 @@
+Mon Sep 17 09:41:57 UTC 2018 - John Paul Adrian Glaubitz
<[email protected]>
+
+- New upstream release
+ + Version 0.3.3
+ + For detailed information about changes see the
+ HISTORY.txt file provided with this package
+- Update Requires from setup.py
+
+-------------------------------------------------------------------
Old:
----
azure-cli-container-0.1.22.tar.gz
New:
----
azure-cli-container-0.3.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ azure-cli-container.spec ++++++
--- /var/tmp/diff_new_pack.GksE2k/_old 2018-10-15 10:47:54.831103418 +0200
+++ /var/tmp/diff_new_pack.GksE2k/_new 2018-10-15 10:47:54.835103414 +0200
@@ -12,12 +12,12 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: azure-cli-container
-Version: 0.1.22
+Version: 0.3.3
Release: 0
Summary: Microsoft Azure CLI 'container' Command Module
License: MIT
@@ -34,8 +34,10 @@
Requires: azure-cli-command-modules-nspkg
Requires: azure-cli-core
Requires: azure-cli-nspkg
-Requires: python3-PyYAML
-Requires: python3-azure-mgmt-containerinstance >= 0.4.0
+Requires: python3-PyYAML >= 3.13
+Requires: python3-azure-mgmt-containerinstance >= 1.0.0
+Requires: python3-azure-mgmt-loganalytics >= 0.2.0
+Requires: python3-azure-mgmt-resource >= 2.0.0
Requires: python3-azure-nspkg
Requires: python3-colorama
Requires: python3-websocket-client
++++++ azure-cli-container-0.1.22.tar.gz -> azure-cli-container-0.3.3.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/azure-cli-container-0.1.22/HISTORY.rst
new/azure-cli-container-0.3.3/HISTORY.rst
--- old/azure-cli-container-0.1.22/HISTORY.rst 2018-04-06 19:33:13.000000000
+0200
+++ new/azure-cli-container-0.3.3/HISTORY.rst 2018-08-09 08:34:43.000000000
+0200
@@ -3,6 +3,43 @@
Release History
===============
+0.3.3
++++++
+* Add '--secure-environment-variables' for passing secure environment
variables to a container
+
+0.3.2
++++++
+* Do not require '--log-analytics-workspace-key' for name or ID when in set
subscription
+
+0.3.1
++++++
+* Update PyYAML dependency to 3.13
+
+0.3.0
++++++
+* BREAKING CHANGE: 'show' commands log error message and fail with exit code
of 3 upon a missing resource.
+* Remove the requirement for username and password for non dockerhub registries
+* Fix error when creating container groups from yaml file
+
+0.2.1
++++++
+* Update PyYAML dependency to 4.2b4
+
+0.2.0
++++++
+* Default to long running operation for `az container create`
+* Add Log Analytics parameters '--log-analytics-workspace' and
'--log-analytics-workspace-key'
+* Add --protocol parameter to specify which network protocol to use
+
+0.1.24
+++++++
+* Allow exporting a container group in yaml format.
+* Allow using a yaml file to create / update a container group.
+
+0.1.23
+++++++
+* Do not require --registry-server for `az container create` when a registry
server is included in the image name.
+
0.1.22
++++++
* Add Git Repo volume mount parameters '--gitrepo-url' '--gitrepo-dir'
'--gitrepo-revision' and '--gitrepo-mount-path'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/azure-cli-container-0.1.22/PKG-INFO
new/azure-cli-container-0.3.3/PKG-INFO
--- old/azure-cli-container-0.1.22/PKG-INFO 2018-04-06 19:33:36.000000000
+0200
+++ new/azure-cli-container-0.3.3/PKG-INFO 2018-08-09 08:36:01.000000000
+0200
@@ -1,12 +1,11 @@
Metadata-Version: 1.1
Name: azure-cli-container
-Version: 0.1.22
+Version: 0.3.3
Summary: Microsoft Azure Command-Line Tools container Command Module
Home-page: https://github.com/Azure/azure-cli
Author: Microsoft Corporation
Author-email: [email protected]
License: MIT
-Description-Content-Type: UNKNOWN
Description: Microsoft Azure CLI 'container' Command Module
==============================================================
@@ -39,23 +38,42 @@
using `az configure --defaults
group=<name>`.
--command-line : The command line to run when
the container is started, e.g.
'/bin/bash -c myscript.sh'.
- --cpu : The required number of CPU
cores of the containers. Default: 1.
- --environment-variables -e : A list of environment variable
for the container.
- Space-separated values in
'key=value' format.
- --ip-address : The IP address type of the
container group. Allowed values:
+ --cpu : The required number of CPU
cores of the containers. Default:
+ 1.
+ --dns-name-label : The dns name label for
container group with public IP.
+ --environment-variables -e : A list of environment
variable for the container. Space-
+ separated values in
'key=value' format.
+ --file -f : The path to the input file.
+ --image : The container image name.
+ --ip-address : The IP address type of the
container group. Allowed values:
Public.
- --location -l : Location. You can configure
the default location using `az
+ --location -l : Location. You can configure
the default location using `az
configure --defaults
location=<location>`.
- --memory : The required memory of the
containers in GB. Default: 1.5.
- --os-type : The OS type of the containers.
Allowed values: Linux, Windows.
- Default: Linux.
- --port : Default: 80.
+ --memory : The required memory of the
containers in GB. Default: 1.5.
+ --name -n : The name of the container
group.
+ --no-wait : Do not wait for the
long-running operation to finish.
+ --os-type : The OS type of the
containers. Allowed values: Linux,
+ Windows. Default: Linux.
+ --ports : The ports to open.
Default: [80].
+ --protocol : The network protocol to
use. Allowed values: TCP, UDP.
+ --restart-policy : Restart policy for all
containers within the container group.
+ Allowed values: Always, Never,
OnFailure. Default: Always.
+ --secrets : Space-separated secrets in
'key=value' format.
+ --secrets-mount-path : The path within the
container where the secrets volume should
+ be mounted. Must not contain
colon ':'.
+ --secure-environment-variables : A list of secure
environment variable for the container.
+ Space-separated values in
'key=value' format.
Image Registry Arguments
--registry-login-server : The container image registry
login server.
--registry-password : The password to log in
container image registry server.
--registry-username : The username to log in
container image registry server.
+ Log Analytics Arguments
+ --log-analytics-workspace : The Log Analytics workspace
name or id. Use the --subscription
+ flag to set the subscription
if not current.
+ --log-analytics-workspace-key : The Log Analytics workspace
key.
+
Global Arguments
--debug : Increase logging verbosity to
show all debug logs.
--help -h : Show this help message and
exit.
@@ -78,6 +96,10 @@
az container create -g MyResourceGroup --name MyAlpine
--image alpine:latest --ip-address
public
+ Create a container in a container group with public IP address
and UDP port.
+ az container create -g MyResourceGroup --name myapp
--image myimage:latest --ip-address
+ public --ports 8081 --protocol UDP
+
Create a container group with starting command line.
az container create -g MyResourceGroup --name MyAlpine
--image alpine:latest --command-line
"/bin/sh -c '/path to/myscript.sh'"
@@ -95,6 +117,28 @@
1.5 --registry-login-server myregistry.com
--registry-username username --registry-password
password
+ Create a container in a container group that mounts an Azure
File share as volume.
+ az container create -g MyResourceGroup --name myapp
--image myimage:latest --command-line
+ "cat /mnt/azfile/myfile" --azure-file-volume-share-name
myshare --azure-file-volume-account-
+ name mystorageaccount --azure-file-volume-account-key
mystoragekey --azure-file-volume-
+ mount-path /mnt/azfile
+
+ Create a container in a container group that mounts a git repo
as volume.
+ az container create -g MyResourceGroup --name myapp
--image myimage:latest --command-line
+ "cat /mnt/gitrepo" --gitrepo-url
https://github.com/user/myrepo.git --gitrepo-dir ./dir1
+ --gitrepo-mount-path /mnt/gitrepo
+
+ Create a container in a container group using a yaml file.
+ az container create -g MyResourceGroup -f
containerGroup.yaml
+
+ Create a container group using Log Analytics from a workspace
name.
+ az container create -g MyResourceGroup --name myapp
--log-analytics-workspace myworkspace
+
+ Create a container group using Log Analytics from a workspace
id and key.
+ az container create -g MyResourceGroup --name myapp
--log-analytics-workspace workspaceid
+ --log-analytics-workspace-key workspacekey
+
+
Commands to get an Azure container group
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::
@@ -188,6 +232,46 @@
examples.
--verbose : Increase logging verbosity. Use --debug
for full debug logs.
+
+ Commands to execute a command in a running container
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ ::
+
+ Command
+ az container exec: Execute a command from within a running
container of a container group.
+ The most common use case is to open an interactive bash
shell. See examples below. This
+ command is currently not supported for Windows machines.
+
+ Arguments
+ --exec-command [Required]: The command to run from within the
container.
+ --container-name : The container name where to execute
the command. Can be ommitted for
+ container groups with only one
container.
+ --terminal-col-size : The col size for the command
output. Default: 80.
+ --terminal-row-size : The row size for the command
output. Default: 20.
+
+ Resource Id Arguments
+ --ids : One or more resource IDs
(space-delimited). If provided, no other
+ 'Resource Id' arguments should be
specified.
+ --name -n : The name of the container group.
+ --resource-group -g : Name of resource group. You can
configure the default group using `az
+ configure --defaults group=<name>`.
+
+ 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.
+ --subscription : Name or ID of subscription. You can
configure the default
+ subscription using `az account set -s
NAME_OR_ID`".
+ --verbose : Increase logging verbosity. Use
--debug for full debug logs.
+
+ Examples
+ Stream a shell from within an nginx container.
+ az container exec -g MyResourceGroup --name mynginx
--container-name nginx --exec-command
+ "/bin/bash"
+
Commands to attach to a container in a container group
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::
@@ -221,6 +305,43 @@
Release History
===============
+ 0.3.3
+ +++++
+ * Add '--secure-environment-variables' for passing secure environment
variables to a container
+
+ 0.3.2
+ +++++
+ * Do not require '--log-analytics-workspace-key' for name or ID when
in set subscription
+
+ 0.3.1
+ +++++
+ * Update PyYAML dependency to 3.13
+
+ 0.3.0
+ +++++
+ * BREAKING CHANGE: 'show' commands log error message and fail with
exit code of 3 upon a missing resource.
+ * Remove the requirement for username and password for non dockerhub
registries
+ * Fix error when creating container groups from yaml file
+
+ 0.2.1
+ +++++
+ * Update PyYAML dependency to 4.2b4
+
+ 0.2.0
+ +++++
+ * Default to long running operation for `az container create`
+ * Add Log Analytics parameters '--log-analytics-workspace' and
'--log-analytics-workspace-key'
+ * Add --protocol parameter to specify which network protocol to use
+
+ 0.1.24
+ ++++++
+ * Allow exporting a container group in yaml format.
+ * Allow using a yaml file to create / update a container group.
+
+ 0.1.23
+ ++++++
+ * Do not require --registry-server for `az container create` when a
registry server is included in the image name.
+
0.1.22
++++++
* Add Git Repo volume mount parameters '--gitrepo-url' '--gitrepo-dir'
'--gitrepo-revision' and '--gitrepo-mount-path'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/azure-cli-container-0.1.22/README.rst
new/azure-cli-container-0.3.3/README.rst
--- old/azure-cli-container-0.1.22/README.rst 2018-04-06 19:33:13.000000000
+0200
+++ new/azure-cli-container-0.3.3/README.rst 2018-08-09 08:34:43.000000000
+0200
@@ -30,23 +30,42 @@
using `az configure --defaults
group=<name>`.
--command-line : The command line to run when the
container is started, e.g.
'/bin/bash -c myscript.sh'.
- --cpu : The required number of CPU cores of
the containers. Default: 1.
- --environment-variables -e : A list of environment variable for the
container.
- Space-separated values in 'key=value'
format.
- --ip-address : The IP address type of the container
group. Allowed values:
+ --cpu : The required number of CPU cores of
the containers. Default:
+ 1.
+ --dns-name-label : The dns name label for container
group with public IP.
+ --environment-variables -e : A list of environment variable for
the container. Space-
+ separated values in 'key=value' format.
+ --file -f : The path to the input file.
+ --image : The container image name.
+ --ip-address : The IP address type of the
container group. Allowed values:
Public.
- --location -l : Location. You can configure the
default location using `az
+ --location -l : Location. You can configure the
default location using `az
configure --defaults
location=<location>`.
- --memory : The required memory of the containers
in GB. Default: 1.5.
- --os-type : The OS type of the containers.
Allowed values: Linux, Windows.
- Default: Linux.
- --port : Default: 80.
+ --memory : The required memory of the
containers in GB. Default: 1.5.
+ --name -n : The name of the container group.
+ --no-wait : Do not wait for the long-running
operation to finish.
+ --os-type : The OS type of the containers.
Allowed values: Linux,
+ Windows. Default: Linux.
+ --ports : The ports to open. Default: [80].
+ --protocol : The network protocol to use.
Allowed values: TCP, UDP.
+ --restart-policy : Restart policy for all containers
within the container group.
+ Allowed values: Always, Never,
OnFailure. Default: Always.
+ --secrets : Space-separated secrets in
'key=value' format.
+ --secrets-mount-path : The path within the container where
the secrets volume should
+ be mounted. Must not contain colon ':'.
+ --secure-environment-variables : A list of secure environment
variable for the container.
+ Space-separated values in 'key=value'
format.
Image Registry Arguments
--registry-login-server : The container image registry login
server.
--registry-password : The password to log in container image
registry server.
--registry-username : The username to log in container image
registry server.
+ Log Analytics Arguments
+ --log-analytics-workspace : The Log Analytics workspace name or
id. Use the --subscription
+ flag to set the subscription if not
current.
+ --log-analytics-workspace-key : The Log Analytics workspace key.
+
Global Arguments
--debug : Increase logging verbosity to show all
debug logs.
--help -h : Show this help message and exit.
@@ -69,6 +88,10 @@
az container create -g MyResourceGroup --name MyAlpine --image
alpine:latest --ip-address
public
+ Create a container in a container group with public IP address and UDP
port.
+ az container create -g MyResourceGroup --name myapp --image
myimage:latest --ip-address
+ public --ports 8081 --protocol UDP
+
Create a container group with starting command line.
az container create -g MyResourceGroup --name MyAlpine --image
alpine:latest --command-line
"/bin/sh -c '/path to/myscript.sh'"
@@ -86,6 +109,28 @@
1.5 --registry-login-server myregistry.com --registry-username
username --registry-password
password
+ Create a container in a container group that mounts an Azure File
share as volume.
+ az container create -g MyResourceGroup --name myapp --image
myimage:latest --command-line
+ "cat /mnt/azfile/myfile" --azure-file-volume-share-name myshare
--azure-file-volume-account-
+ name mystorageaccount --azure-file-volume-account-key mystoragekey
--azure-file-volume-
+ mount-path /mnt/azfile
+
+ Create a container in a container group that mounts a git repo as
volume.
+ az container create -g MyResourceGroup --name myapp --image
myimage:latest --command-line
+ "cat /mnt/gitrepo" --gitrepo-url
https://github.com/user/myrepo.git --gitrepo-dir ./dir1
+ --gitrepo-mount-path /mnt/gitrepo
+
+ Create a container in a container group using a yaml file.
+ az container create -g MyResourceGroup -f containerGroup.yaml
+
+ Create a container group using Log Analytics from a workspace name.
+ az container create -g MyResourceGroup --name myapp
--log-analytics-workspace myworkspace
+
+ Create a container group using Log Analytics from a workspace id and
key.
+ az container create -g MyResourceGroup --name myapp
--log-analytics-workspace workspaceid
+ --log-analytics-workspace-key workspacekey
+
+
Commands to get an Azure container group
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::
@@ -179,6 +224,46 @@
examples.
--verbose : Increase logging verbosity. Use --debug for full
debug logs.
+
+Commands to execute a command in a running container
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+::
+
+ Command
+ az container exec: Execute a command from within a running container
of a container group.
+ The most common use case is to open an interactive bash shell. See
examples below. This
+ command is currently not supported for Windows machines.
+
+ Arguments
+ --exec-command [Required]: The command to run from within the
container.
+ --container-name : The container name where to execute the
command. Can be ommitted for
+ container groups with only one container.
+ --terminal-col-size : The col size for the command output.
Default: 80.
+ --terminal-row-size : The row size for the command output.
Default: 20.
+
+ Resource Id Arguments
+ --ids : One or more resource IDs (space-delimited).
If provided, no other
+ 'Resource Id' arguments should be specified.
+ --name -n : The name of the container group.
+ --resource-group -g : Name of resource group. You can configure
the default group using `az
+ configure --defaults group=<name>`.
+
+ 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.
+ --subscription : Name or ID of subscription. You can
configure the default
+ subscription using `az account set -s
NAME_OR_ID`".
+ --verbose : Increase logging verbosity. Use --debug for
full debug logs.
+
+ Examples
+ Stream a shell from within an nginx container.
+ az container exec -g MyResourceGroup --name mynginx
--container-name nginx --exec-command
+ "/bin/bash"
+
Commands to attach to a container in a container group
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-container-0.1.22/azure/cli/command_modules/container/_client_factory.py
new/azure-cli-container-0.3.3/azure/cli/command_modules/container/_client_factory.py
---
old/azure-cli-container-0.1.22/azure/cli/command_modules/container/_client_factory.py
2018-04-06 19:33:13.000000000 +0200
+++
new/azure-cli-container-0.3.3/azure/cli/command_modules/container/_client_factory.py
2018-08-09 08:34:43.000000000 +0200
@@ -14,9 +14,21 @@
return _container_instance_client_factory(cli_ctx).container_groups
-def cf_container_logs(cli_ctx, *_):
- return _container_instance_client_factory(cli_ctx).container_logs
+def cf_container(cli_ctx, *_):
+ return _container_instance_client_factory(cli_ctx).container
-def cf_start_container(cli_ctx, *_):
- return _container_instance_client_factory(cli_ctx).start_container
+def _log_analytics_client_factory(cli_ctx, *_):
+ from azure.mgmt.loganalytics import LogAnalyticsManagementClient
+ from azure.cli.core.commands.client_factory import get_mgmt_service_client
+ return get_mgmt_service_client(cli_ctx, LogAnalyticsManagementClient)
+
+
+def cf_log_analytics(cli_ctx, *_):
+ return _log_analytics_client_factory(cli_ctx).workspaces
+
+
+def cf_resource(cli_ctx):
+ from azure.mgmt.resource import ResourceManagementClient
+ from azure.cli.core.commands.client_factory import get_mgmt_service_client
+ return get_mgmt_service_client(cli_ctx, ResourceManagementClient)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-container-0.1.22/azure/cli/command_modules/container/_help.py
new/azure-cli-container-0.3.3/azure/cli/command_modules/container/_help.py
--- old/azure-cli-container-0.1.22/azure/cli/command_modules/container/_help.py
2018-04-06 19:33:13.000000000 +0200
+++ new/azure-cli-container-0.3.3/azure/cli/command_modules/container/_help.py
2018-08-09 08:34:43.000000000 +0200
@@ -1,3 +1,4 @@
+# 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.
@@ -21,6 +22,8 @@
text: az container create -g MyResourceGroup --name mywinapp --image
winappimage:latest --os-type Windows --cpu 2 --memory 3.5
- name: Create a container in a container group with public IP address
and ports.
text: az container create -g MyResourceGroup --name myapp --image
myimage:latest --ip-address public --ports 80 443
+ - name: Create a container in a container group with public IP address
and UDP port.
+ text: az container create -g MyResourceGroup --name myapp --image
myimage:latest --ip-address public --ports 8081 --protocol UDP
- name: Create a container in a container group with public IP
address, ports and DNS name label.
text: az container create -g MyResourceGroup --name myapp --image
myimage:latest --ports 80 443 --dns-name-label contoso
- name: Create a container in a container group that invokes a script
upon start.
@@ -37,6 +40,12 @@
text: az container create -g MyResourceGroup --name myapp --image
myimage:latest --command-line "cat /mnt/azfile/myfile"
--azure-file-volume-share-name myshare --azure-file-volume-account-name
mystorageaccount --azure-file-volume-account-key mystoragekey
--azure-file-volume-mount-path /mnt/azfile
- name: Create a container in a container group that mounts a git repo
as volume.
text: az container create -g MyResourceGroup --name myapp --image
myimage:latest --command-line "cat /mnt/gitrepo" --gitrepo-url
https://github.com/user/myrepo.git --gitrepo-dir ./dir1 --gitrepo-mount-path
/mnt/gitrepo
+ - name: Create a container in a container group using a yaml file.
+ text: az container create -g MyResourceGroup -f containerGroup.yaml
+ - name: Create a container group using Log Analytics from a workspace
name.
+ text: az container create -g MyResourceGroup --name myapp
--log-analytics-workspace myworkspace
+ - name: Create a container group using Log Analytics from a workspace
id and key.
+ text: az container create -g MyResourceGroup --name myapp
--log-analytics-workspace workspaceid --log-analytics-workspace-key workspacekey
"""
helps['container delete'] = """
@@ -59,6 +68,14 @@
short-summary: Examine the logs for a container in a container group.
"""
+helps['container export'] = """
+ type: command
+ short-summary: Export a container group in yaml format.
+ examples:
+ - name: Export a container group in yaml.
+ text: az container export -g MyResourceGroup --name mynginx -f
output.yaml
+"""
+
helps['container exec'] = """
type: command
short-summary: Execute a command from within a running container of a
container group.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-container-0.1.22/azure/cli/command_modules/container/_params.py
new/azure-cli-container-0.3.3/azure/cli/command_modules/container/_params.py
---
old/azure-cli-container-0.1.22/azure/cli/command_modules/container/_params.py
2018-04-06 19:33:13.000000000 +0200
+++
new/azure-cli-container-0.3.3/azure/cli/command_modules/container/_params.py
2018-08-09 08:34:43.000000000 +0200
@@ -9,7 +9,8 @@
get_location_type,
resource_group_name_type)
from azure.cli.core.commands.validators import
get_default_location_from_resource_group
-from azure.mgmt.containerinstance.models import (ContainerGroupRestartPolicy,
OperatingSystemTypes)
+from azure.mgmt.containerinstance.models import (
+ ContainerGroupRestartPolicy, OperatingSystemTypes,
ContainerNetworkProtocol)
from ._validators import validate_volume_mount_path, validate_secrets,
validate_gitrepo_directory
# pylint: disable=line-too-long
@@ -21,11 +22,22 @@
"""Space-separated values in 'key=value' format."""
try:
env_name, env_value = value.split('=', 1)
+ return {'name': env_name, 'value': env_value}
except ValueError:
message = ("Incorrectly formatted environment settings. "
"Argument values should be in the format a=b c=d")
raise CLIError(message)
- return {'name': env_name, 'value': env_value}
+
+
+def _secure_environment_variables_type(value):
+ """Space-separated values in 'key=value' format."""
+ try:
+ env_name, env_secure_value = value.split('=', 1)
+ return {'name': env_name, 'secureValue': env_secure_value}
+ except ValueError:
+ message = ("Incorrectly formatted secure environment settings. "
+ "Argument values should be in the format a=b c=d")
+ raise CLIError(message)
secrets_type = CLIArgumentType(
@@ -35,6 +47,7 @@
)
+# pylint: disable=too-many-statements
def load_arguments(self, _):
with self.argument_context('container') as c:
c.argument('resource_group_name', arg_type=resource_group_name_type)
@@ -49,12 +62,15 @@
c.argument('os_type', arg_type=get_enum_type(OperatingSystemTypes),
help='The OS type of the containers')
c.argument('ip_address', arg_type=get_enum_type(IP_ADDRESS_TYPES),
help='The IP address type of the container group')
c.argument('ports', type=int, nargs='+', default=[80], help='The ports
to open')
+ c.argument('protocol',
arg_type=get_enum_type(ContainerNetworkProtocol), help='The network protocol to
use')
c.argument('dns_name_label', help='The dns name label for container
group with public IP')
c.argument('restart_policy',
arg_type=get_enum_type(ContainerGroupRestartPolicy), help='Restart policy for
all containers within the container group')
c.argument('command_line', help='The command line to run when the
container is started, e.g. \'/bin/bash -c myscript.sh\'')
c.argument('environment_variables', nargs='+',
options_list=['--environment-variables', '-e'],
type=_environment_variables_type, help='A list of environment variable for the
container. Space-separated values in \'key=value\' format.')
+ c.argument('secure_environment_variables', nargs='+',
type=_secure_environment_variables_type, help='A list of secure environment
variable for the container. Space-separated values in \'key=value\' format.')
c.argument('secrets', secrets_type)
c.argument('secrets_mount_path', validator=validate_volume_mount_path,
help="The path within the container where the secrets volume should be mounted.
Must not contain colon ':'.")
+ c.argument('file', options_list=['--file', '-f'], help="The path to
the input file.")
with self.argument_context('container create', arg_group='Image Registry')
as c:
c.argument('registry_login_server', help='The container image registry
login server')
@@ -67,6 +83,10 @@
c.argument('azure_file_volume_account_key', help='The storage account
access key used to access the Azure File share')
c.argument('azure_file_volume_mount_path',
validator=validate_volume_mount_path, help="The path within the container where
the azure file volume should be mounted. Must not contain colon ':'.")
+ with self.argument_context('container create', arg_group='Log Analytics')
as c:
+ c.argument('log_analytics_workspace', help='The Log Analytics
workspace name or id. Use the current subscription or use --subscription flag
to set the desired subscription.')
+ c.argument('log_analytics_workspace_key', help='The Log Analytics
workspace key.')
+
with self.argument_context('container create', arg_group='Git Repo
Volume') as c:
c.argument('gitrepo_url', help='The URL of a git repository to be
mounted as a volume')
c.argument('gitrepo_dir', validator=validate_gitrepo_directory,
help="The target directory path in the git repository. Must not contain '..'.")
@@ -77,6 +97,9 @@
c.argument('container_name', help='The container name to tail the
logs. If omitted, the first container in the container group will be chosen')
c.argument('follow', help='Indicate to stream the tailing logs',
action='store_true')
+ with self.argument_context('container export') as c:
+ c.argument('file', options_list=['--file', '-f'], help="The file path
to export the container group.")
+
with self.argument_context('container exec') as c:
c.argument('container_name', help='The container name where to execute
the command. Can be ommitted for container groups with only one container.')
c.argument('exec_command', help='The command to run from within the
container')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-container-0.1.22/azure/cli/command_modules/container/commands.py
new/azure-cli-container-0.3.3/azure/cli/command_modules/container/commands.py
---
old/azure-cli-container-0.1.22/azure/cli/command_modules/container/commands.py
2018-04-06 19:33:13.000000000 +0200
+++
new/azure-cli-container-0.3.3/azure/cli/command_modules/container/commands.py
2018-08-09 08:34:43.000000000 +0200
@@ -3,18 +3,18 @@
# Licensed under the MIT License. See License.txt in the project root for
license information.
#
--------------------------------------------------------------------------------------------
-from azure.cli.core.util import empty_on_404
-from ._client_factory import cf_container_groups, cf_container_logs
+from ._client_factory import cf_container_groups, cf_container
from ._format import transform_container_group_list, transform_container_group
def load_command_table(self, _):
with self.command_group('container', client_factory=cf_container_groups)
as g:
g.custom_command('list', 'list_containers',
table_transformer=transform_container_group_list)
- g.custom_command('create', 'create_container',
table_transformer=transform_container_group)
- g.custom_command('show', 'get_container',
exception_handler=empty_on_404,
+ g.custom_command('create', 'create_container', supports_no_wait=True,
table_transformer=transform_container_group)
+ g.custom_show_command('show', 'get_container',
table_transformer=transform_container_group)
g.custom_command('delete', 'delete_container', confirmation=True)
- g.custom_command('logs', 'container_logs',
client_factory=cf_container_logs)
+ g.custom_command('logs', 'container_logs', client_factory=cf_container)
g.custom_command('exec', 'container_exec')
+ g.custom_command('export', 'container_export')
g.custom_command('attach', 'attach_to_container')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-container-0.1.22/azure/cli/command_modules/container/custom.py
new/azure-cli-container-0.3.3/azure/cli/command_modules/container/custom.py
---
old/azure-cli-container-0.1.22/azure/cli/command_modules/container/custom.py
2018-04-06 19:33:13.000000000 +0200
+++ new/azure-cli-container-0.3.3/azure/cli/command_modules/container/custom.py
2018-08-09 08:34:43.000000000 +0200
@@ -25,18 +25,22 @@
# Not supported for Windows machines.
pass
import websocket
+import yaml
from knack.log import get_logger
-from knack.prompting import prompt_pass, NoTTYException
+from knack.prompting import prompt_pass, prompt, NoTTYException
from knack.util import CLIError
from azure.mgmt.containerinstance.models import (AzureFileVolume, Container,
ContainerGroup, ContainerGroupNetworkProtocol,
ContainerPort,
ImageRegistryCredential, IpAddress, Port, ResourceRequests,
ResourceRequirements, Volume,
VolumeMount, ContainerExecRequestTerminalSize,
- GitRepoVolume)
-from ._client_factory import cf_container_groups, cf_container_logs,
cf_start_container
+ GitRepoVolume, LogAnalytics,
ContainerGroupDiagnostics)
+from azure.cli.core.util import sdk_no_wait
+from msrestazure.tools import parse_resource_id
+from ._client_factory import cf_container_groups, cf_container,
cf_log_analytics, cf_resource
logger = get_logger(__name__)
WINDOWS_NAME = 'Windows'
-ACR_SERVER_SUFFIX = '.azurecr.io/'
+SERVER_DELIMITER = '.'
+ACR_SERVER_DELIMITER = '.azurecr.io'
AZURE_FILE_VOLUME_NAME = 'azurefile'
SECRETS_VOLUME_NAME = 'secrets'
GITREPO_VOLUME_NAME = 'gitrepo'
@@ -59,20 +63,22 @@
return client.delete(resource_group_name, name)
-def create_container(client,
+def create_container(cmd,
resource_group_name,
- name,
- image,
+ name=None,
+ image=None,
location=None,
cpu=1,
memory=1.5,
restart_policy='Always',
ports=None,
+ protocol=None,
os_type='Linux',
ip_address=None,
dns_name_label=None,
command_line=None,
environment_variables=None,
+ secure_environment_variables=None,
registry_login_server=None,
registry_username=None,
registry_password=None,
@@ -80,15 +86,29 @@
azure_file_volume_account_name=None,
azure_file_volume_account_key=None,
azure_file_volume_mount_path=None,
+ log_analytics_workspace=None,
+ log_analytics_workspace_key=None,
gitrepo_url=None,
gitrepo_dir='.',
gitrepo_revision=None,
gitrepo_mount_path=None,
secrets=None,
- secrets_mount_path=None):
+ secrets_mount_path=None,
+ file=None,
+ no_wait=False):
"""Create a container group. """
+ if file:
+ return _create_update_from_file(cmd.cli_ctx, resource_group_name,
name, location, file, no_wait)
+
+ if not name:
+ raise CLIError("error: the --name/-n argument is required unless
specified with a passed in file.")
+
+ if not image:
+ raise CLIError("error: the --image argument is required unless
specified with a passed in file.")
+
ports = ports or [80]
+ protocol = protocol or ContainerGroupNetworkProtocol.tcp
container_resource_requirements = _create_resource_requirements(cpu=cpu,
memory=memory)
@@ -120,6 +140,23 @@
volumes.append(secrets_volume)
mounts.append(secrets_volume_mount)
+ diagnostics = None
+ tags = {}
+ if log_analytics_workspace and log_analytics_workspace_key:
+ log_analytics = LogAnalytics(
+ workspace_id=log_analytics_workspace,
workspace_key=log_analytics_workspace_key)
+
+ diagnostics = ContainerGroupDiagnostics(
+ log_analytics=log_analytics
+ )
+ elif log_analytics_workspace and not log_analytics_workspace_key:
+ diagnostics, tags = _get_diagnostics_from_workspace(
+ cmd.cli_ctx, log_analytics_workspace)
+ if not diagnostics:
+ raise CLIError('Log Analytics workspace "' +
log_analytics_workspace + '" not found.')
+ elif not log_analytics_workspace and log_analytics_workspace_key:
+ raise CLIError('"--log-analytics-workspace-key" requires
"--log-analytics-workspace".')
+
gitrepo_volume = _create_gitrepo_volume(gitrepo_url=gitrepo_url,
gitrepo_dir=gitrepo_dir, gitrepo_revision=gitrepo_revision)
gitrepo_volume_mount =
_create_gitrepo_volume_mount(gitrepo_volume=gitrepo_volume,
gitrepo_mount_path=gitrepo_mount_path)
@@ -127,13 +164,20 @@
volumes.append(gitrepo_volume)
mounts.append(gitrepo_volume_mount)
- cgroup_ip_address = _create_ip_address(ip_address, ports, dns_name_label)
+ cgroup_ip_address = _create_ip_address(ip_address, ports, protocol,
dns_name_label)
+
+ # Concatenate secure and standard environment variables
+ if environment_variables and secure_environment_variables:
+ environment_variables = environment_variables +
secure_environment_variables
+ else:
+ environment_variables = environment_variables or
secure_environment_variables
container = Container(name=name,
image=image,
resources=container_resource_requirements,
command=command,
- ports=[ContainerPort(port=p) for p in ports] if
cgroup_ip_address else None,
+ ports=[ContainerPort(
+ port=p, protocol=protocol) for p in ports] if
cgroup_ip_address else None,
environment_variables=environment_variables,
volume_mounts=mounts or None)
@@ -143,10 +187,75 @@
restart_policy=restart_policy,
ip_address=cgroup_ip_address,
image_registry_credentials=image_registry_credentials,
- volumes=volumes or None)
+ volumes=volumes or None,
+ diagnostics=diagnostics,
+ tags=tags)
+
+ container_group_client = cf_container_groups(cmd.cli_ctx)
+ return sdk_no_wait(no_wait, container_group_client.create_or_update,
resource_group_name, name, cgroup)
+
+
+def _get_diagnostics_from_workspace(cli_ctx, log_analytics_workspace):
+ log_analytics_client = cf_log_analytics(cli_ctx)
+
+ for workspace in log_analytics_client.list():
+ if log_analytics_workspace == workspace.name or
log_analytics_workspace == workspace.customer_id:
+ keys = log_analytics_client.get_shared_keys(
+ parse_resource_id(workspace.id)['resource_group'],
workspace.name)
+
+ log_analytics = LogAnalytics(
+ workspace_id=workspace.customer_id,
workspace_key=keys.primary_shared_key)
+
+ diagnostics = ContainerGroupDiagnostics(
+ log_analytics=log_analytics)
+
+ return (diagnostics, {'oms-resource-link': workspace.id})
+
+ return None, {}
+
- raw_response = client.create_or_update(resource_group_name, name, cgroup,
raw=True)
- return raw_response.output
+def _create_update_from_file(cli_ctx, resource_group_name, name, location,
file, no_wait):
+ resource_client = cf_resource(cli_ctx)
+ container_group_client = cf_container_groups(cli_ctx)
+
+ cg_defintion = None
+
+ try:
+ with open(file, 'r') as f:
+ cg_defintion = yaml.load(f)
+ except FileNotFoundError:
+ raise CLIError("No such file or directory: " + file)
+ except yaml.YAMLError as e:
+ raise CLIError("Error while parsing yaml file:\n\n" + str(e))
+
+ # Validate names match if both are provided
+ if name and cg_defintion.get('name', None):
+ if name != cg_defintion.get('name', None):
+ raise CLIError("The name parameter and name from yaml definition
must match.")
+ else:
+ # Validate at least one name is provided
+ name = name or cg_defintion.get('name', None)
+ if cg_defintion.get('name', None) is None and not name:
+ raise CLIError("The name of the container group is required")
+
+ cg_defintion['name'] = name
+
+ location = location or cg_defintion.get('location', None)
+ if not location:
+ location =
resource_client.resource_groups.get(resource_group_name).location
+ cg_defintion['location'] = location
+
+ api_version = cg_defintion.get('apiVersion', None) or
container_group_client.api_version
+
+ return sdk_no_wait(no_wait,
+ resource_client.resources.create_or_update,
+ resource_group_name,
+ "Microsoft.ContainerInstance",
+ '',
+ "containerGroups",
+ name,
+ api_version,
+ cg_defintion)
# pylint: disable=inconsistent-return-statements
@@ -171,7 +280,13 @@
image_registry_credentials =
[ImageRegistryCredential(server=registry_login_server,
username=registry_username,
password=registry_password)]
- elif ACR_SERVER_SUFFIX in image:
+ elif ACR_SERVER_DELIMITER in image.split("/")[0]:
+ if not registry_username:
+ try:
+ registry_username = prompt(msg='Image registry username: ')
+ except NoTTYException:
+ raise CLIError('Please specify --registry-username in order to
use Azure Container Registry.')
+
if not registry_password:
try:
registry_password = prompt_pass(msg='Image registry password:
')
@@ -179,13 +294,18 @@
raise CLIError('Please specify --registry-password in order to
use Azure Container Registry.')
acr_server = image.split("/")[0] if image.split("/") else None
- acr_username = image.split(ACR_SERVER_SUFFIX)[0] if
image.split(ACR_SERVER_SUFFIX) else None
- if acr_server and acr_username:
+ if acr_server:
image_registry_credentials =
[ImageRegistryCredential(server=acr_server,
-
username=acr_username,
+
username=registry_username,
+
password=registry_password)]
+ elif registry_username and registry_password and SERVER_DELIMITER in
image.split("/")[0]:
+ login_server = image.split("/")[0] if image.split("/") else None
+ if login_server:
+ image_registry_credentials =
[ImageRegistryCredential(server=login_server,
+
username=registry_username,
password=registry_password)]
else:
- raise CLIError('Failed to parse ACR server or username from image
name; please explicitly specify --registry-server and --registry-username.')
+ raise CLIError('Failed to parse login server from image name;
please explicitly specify --registry-server.')
return image_registry_credentials
@@ -250,16 +370,16 @@
# pylint: disable=inconsistent-return-statements
-def _create_ip_address(ip_address, ports, dns_name_label):
+def _create_ip_address(ip_address, ports, protocol, dns_name_label):
"""Create IP address. """
if (ip_address and ip_address.lower() == 'public') or dns_name_label:
- return
IpAddress(ports=[Port(protocol=ContainerGroupNetworkProtocol.tcp, port=p) for p
in ports], dns_name_label=dns_name_label)
+ return IpAddress(ports=[Port(protocol=protocol, port=p) for p in
ports], dns_name_label=dns_name_label)
# pylint: disable=inconsistent-return-statements
def container_logs(cmd, resource_group_name, name, container_name=None,
follow=False):
"""Tail a container instance log. """
- logs_client = cf_container_logs(cmd.cli_ctx)
+ container_client = cf_container(cmd.cli_ctx)
container_group_client = cf_container_groups(cmd.cli_ctx)
container_group = container_group_client.get(resource_group_name, name)
@@ -268,7 +388,7 @@
container_name = container_group.containers[0].name
if not follow:
- log = logs_client.list(resource_group_name, name, container_name)
+ log = container_client.list_logs(resource_group_name, name,
container_name)
print(log.content)
else:
_start_streaming(
@@ -276,13 +396,45 @@
terminate_condition_args=(container_group_client,
resource_group_name, name, container_name),
shupdown_grace_period=5,
stream_target=_stream_logs,
- stream_args=(logs_client, resource_group_name, name,
container_name, container_group.restart_policy))
+ stream_args=(container_client, resource_group_name, name,
container_name, container_group.restart_policy))
+
+
+def container_export(cmd, resource_group_name, name, file):
+ resource_client = cf_resource(cmd.cli_ctx)
+ container_group_client = cf_container_groups(cmd.cli_ctx)
+
+ resource = resource_client.resources.get(resource_group_name,
+ "Microsoft.ContainerInstance",
+ '',
+ "containerGroups",
+ name,
+
container_group_client.api_version,
+ False).__dict__
+
+ # Remove unwanted properites
+ resource['properties'].pop('instanceView', None)
+ resource.pop('sku', None)
+ resource.pop('id', None)
+ resource.pop('plan', None)
+ resource.pop('identity', None)
+ resource.pop('kind', None)
+ resource.pop('managed_by', None)
+ resource['properties'].pop('provisioningState', None)
+
+ for i in range(len(resource['properties']['containers'])):
+
resource['properties']['containers'][i]['properties'].pop('instanceView', None)
+
+ # Add the api version
+ resource['apiVersion'] = container_group_client.api_version
+
+ with open(file, 'w+') as f:
+ yaml.dump(resource, f, default_flow_style=False)
def container_exec(cmd, resource_group_name, name, exec_command,
container_name=None, terminal_row_size=20, terminal_col_size=80):
"""Start exec for a container. """
- start_container_client = cf_start_container(cmd.cli_ctx)
+ container_client = cf_container(cmd.cli_ctx)
container_group_client = cf_container_groups(cmd.cli_ctx)
container_group = container_group_client.get(resource_group_name, name)
@@ -293,7 +445,7 @@
terminal_size =
ContainerExecRequestTerminalSize(rows=terminal_row_size, cols=terminal_col_size)
- execContainerResponse =
start_container_client.launch_exec(resource_group_name, name, container_name,
exec_command, terminal_size)
+ execContainerResponse =
container_client.execute_command(resource_group_name, name, container_name,
exec_command, terminal_size)
if platform.system() is WINDOWS_NAME:
_start_exec_pipe_win(execContainerResponse.web_socket_uri,
execContainerResponse.password)
@@ -373,7 +525,7 @@
def attach_to_container(cmd, resource_group_name, name, container_name=None):
"""Attach to a container. """
- logs_client = cf_container_logs(cmd.cli_ctx)
+ container_client = cf_container(cmd.cli_ctx)
container_group_client = cf_container_groups(cmd.cli_ctx)
container_group = container_group_client.get(resource_group_name, name)
@@ -386,7 +538,7 @@
terminate_condition_args=(container_group_client, resource_group_name,
name, container_name),
shupdown_grace_period=5,
stream_target=_stream_container_events_and_logs,
- stream_args=(container_group_client, logs_client, resource_group_name,
name, container_name))
+ stream_args=(container_group_client, container_client,
resource_group_name, name, container_name))
def _start_streaming(terminate_condition, terminate_condition_args,
shupdown_grace_period, stream_target, stream_args):
@@ -412,7 +564,7 @@
"""Stream logs for a container. """
lastOutputLines = 0
while True:
- log = client.list(resource_group_name, name, container_name)
+ log = client.list_logs(resource_group_name, name, container_name)
lines = log.content.split('\n')
currentOutputLines = len(lines)
@@ -428,7 +580,7 @@
time.sleep(2)
-def _stream_container_events_and_logs(container_group_client, logs_client,
resource_group_name, name, container_name):
+def _stream_container_events_and_logs(container_group_client,
container_client, resource_group_name, name, container_name):
"""Stream container events and logs. """
lastOutputLines = 0
lastContainerState = None
@@ -459,7 +611,7 @@
time.sleep(2)
- _stream_logs(logs_client, resource_group_name, name, container_name,
container_group.restart_policy)
+ _stream_logs(container_client, resource_group_name, name, container_name,
container_group.restart_policy)
def _is_container_terminated(client, resource_group_name, name,
container_name):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-container-0.1.22/azure_cli_container.egg-info/PKG-INFO
new/azure-cli-container-0.3.3/azure_cli_container.egg-info/PKG-INFO
--- old/azure-cli-container-0.1.22/azure_cli_container.egg-info/PKG-INFO
2018-04-06 19:33:36.000000000 +0200
+++ new/azure-cli-container-0.3.3/azure_cli_container.egg-info/PKG-INFO
2018-08-09 08:36:01.000000000 +0200
@@ -1,12 +1,11 @@
Metadata-Version: 1.1
Name: azure-cli-container
-Version: 0.1.22
+Version: 0.3.3
Summary: Microsoft Azure Command-Line Tools container Command Module
Home-page: https://github.com/Azure/azure-cli
Author: Microsoft Corporation
Author-email: [email protected]
License: MIT
-Description-Content-Type: UNKNOWN
Description: Microsoft Azure CLI 'container' Command Module
==============================================================
@@ -39,23 +38,42 @@
using `az configure --defaults
group=<name>`.
--command-line : The command line to run when
the container is started, e.g.
'/bin/bash -c myscript.sh'.
- --cpu : The required number of CPU
cores of the containers. Default: 1.
- --environment-variables -e : A list of environment variable
for the container.
- Space-separated values in
'key=value' format.
- --ip-address : The IP address type of the
container group. Allowed values:
+ --cpu : The required number of CPU
cores of the containers. Default:
+ 1.
+ --dns-name-label : The dns name label for
container group with public IP.
+ --environment-variables -e : A list of environment
variable for the container. Space-
+ separated values in
'key=value' format.
+ --file -f : The path to the input file.
+ --image : The container image name.
+ --ip-address : The IP address type of the
container group. Allowed values:
Public.
- --location -l : Location. You can configure
the default location using `az
+ --location -l : Location. You can configure
the default location using `az
configure --defaults
location=<location>`.
- --memory : The required memory of the
containers in GB. Default: 1.5.
- --os-type : The OS type of the containers.
Allowed values: Linux, Windows.
- Default: Linux.
- --port : Default: 80.
+ --memory : The required memory of the
containers in GB. Default: 1.5.
+ --name -n : The name of the container
group.
+ --no-wait : Do not wait for the
long-running operation to finish.
+ --os-type : The OS type of the
containers. Allowed values: Linux,
+ Windows. Default: Linux.
+ --ports : The ports to open.
Default: [80].
+ --protocol : The network protocol to
use. Allowed values: TCP, UDP.
+ --restart-policy : Restart policy for all
containers within the container group.
+ Allowed values: Always, Never,
OnFailure. Default: Always.
+ --secrets : Space-separated secrets in
'key=value' format.
+ --secrets-mount-path : The path within the
container where the secrets volume should
+ be mounted. Must not contain
colon ':'.
+ --secure-environment-variables : A list of secure
environment variable for the container.
+ Space-separated values in
'key=value' format.
Image Registry Arguments
--registry-login-server : The container image registry
login server.
--registry-password : The password to log in
container image registry server.
--registry-username : The username to log in
container image registry server.
+ Log Analytics Arguments
+ --log-analytics-workspace : The Log Analytics workspace
name or id. Use the --subscription
+ flag to set the subscription
if not current.
+ --log-analytics-workspace-key : The Log Analytics workspace
key.
+
Global Arguments
--debug : Increase logging verbosity to
show all debug logs.
--help -h : Show this help message and
exit.
@@ -78,6 +96,10 @@
az container create -g MyResourceGroup --name MyAlpine
--image alpine:latest --ip-address
public
+ Create a container in a container group with public IP address
and UDP port.
+ az container create -g MyResourceGroup --name myapp
--image myimage:latest --ip-address
+ public --ports 8081 --protocol UDP
+
Create a container group with starting command line.
az container create -g MyResourceGroup --name MyAlpine
--image alpine:latest --command-line
"/bin/sh -c '/path to/myscript.sh'"
@@ -95,6 +117,28 @@
1.5 --registry-login-server myregistry.com
--registry-username username --registry-password
password
+ Create a container in a container group that mounts an Azure
File share as volume.
+ az container create -g MyResourceGroup --name myapp
--image myimage:latest --command-line
+ "cat /mnt/azfile/myfile" --azure-file-volume-share-name
myshare --azure-file-volume-account-
+ name mystorageaccount --azure-file-volume-account-key
mystoragekey --azure-file-volume-
+ mount-path /mnt/azfile
+
+ Create a container in a container group that mounts a git repo
as volume.
+ az container create -g MyResourceGroup --name myapp
--image myimage:latest --command-line
+ "cat /mnt/gitrepo" --gitrepo-url
https://github.com/user/myrepo.git --gitrepo-dir ./dir1
+ --gitrepo-mount-path /mnt/gitrepo
+
+ Create a container in a container group using a yaml file.
+ az container create -g MyResourceGroup -f
containerGroup.yaml
+
+ Create a container group using Log Analytics from a workspace
name.
+ az container create -g MyResourceGroup --name myapp
--log-analytics-workspace myworkspace
+
+ Create a container group using Log Analytics from a workspace
id and key.
+ az container create -g MyResourceGroup --name myapp
--log-analytics-workspace workspaceid
+ --log-analytics-workspace-key workspacekey
+
+
Commands to get an Azure container group
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::
@@ -188,6 +232,46 @@
examples.
--verbose : Increase logging verbosity. Use --debug
for full debug logs.
+
+ Commands to execute a command in a running container
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ ::
+
+ Command
+ az container exec: Execute a command from within a running
container of a container group.
+ The most common use case is to open an interactive bash
shell. See examples below. This
+ command is currently not supported for Windows machines.
+
+ Arguments
+ --exec-command [Required]: The command to run from within the
container.
+ --container-name : The container name where to execute
the command. Can be ommitted for
+ container groups with only one
container.
+ --terminal-col-size : The col size for the command
output. Default: 80.
+ --terminal-row-size : The row size for the command
output. Default: 20.
+
+ Resource Id Arguments
+ --ids : One or more resource IDs
(space-delimited). If provided, no other
+ 'Resource Id' arguments should be
specified.
+ --name -n : The name of the container group.
+ --resource-group -g : Name of resource group. You can
configure the default group using `az
+ configure --defaults group=<name>`.
+
+ 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.
+ --subscription : Name or ID of subscription. You can
configure the default
+ subscription using `az account set -s
NAME_OR_ID`".
+ --verbose : Increase logging verbosity. Use
--debug for full debug logs.
+
+ Examples
+ Stream a shell from within an nginx container.
+ az container exec -g MyResourceGroup --name mynginx
--container-name nginx --exec-command
+ "/bin/bash"
+
Commands to attach to a container in a container group
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
::
@@ -221,6 +305,43 @@
Release History
===============
+ 0.3.3
+ +++++
+ * Add '--secure-environment-variables' for passing secure environment
variables to a container
+
+ 0.3.2
+ +++++
+ * Do not require '--log-analytics-workspace-key' for name or ID when
in set subscription
+
+ 0.3.1
+ +++++
+ * Update PyYAML dependency to 3.13
+
+ 0.3.0
+ +++++
+ * BREAKING CHANGE: 'show' commands log error message and fail with
exit code of 3 upon a missing resource.
+ * Remove the requirement for username and password for non dockerhub
registries
+ * Fix error when creating container groups from yaml file
+
+ 0.2.1
+ +++++
+ * Update PyYAML dependency to 4.2b4
+
+ 0.2.0
+ +++++
+ * Default to long running operation for `az container create`
+ * Add Log Analytics parameters '--log-analytics-workspace' and
'--log-analytics-workspace-key'
+ * Add --protocol parameter to specify which network protocol to use
+
+ 0.1.24
+ ++++++
+ * Allow exporting a container group in yaml format.
+ * Allow using a yaml file to create / update a container group.
+
+ 0.1.23
+ ++++++
+ * Do not require --registry-server for `az container create` when a
registry server is included in the image name.
+
0.1.22
++++++
* Add Git Repo volume mount parameters '--gitrepo-url' '--gitrepo-dir'
'--gitrepo-revision' and '--gitrepo-mount-path'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/azure-cli-container-0.1.22/azure_cli_container.egg-info/requires.txt
new/azure-cli-container-0.3.3/azure_cli_container.egg-info/requires.txt
--- old/azure-cli-container-0.1.22/azure_cli_container.egg-info/requires.txt
2018-04-06 19:33:36.000000000 +0200
+++ new/azure-cli-container-0.3.3/azure_cli_container.egg-info/requires.txt
2018-08-09 08:36:01.000000000 +0200
@@ -1,5 +1,7 @@
-azure-mgmt-containerinstance==0.4.0
+azure-mgmt-containerinstance==1.0.0
+azure-mgmt-loganalytics==0.2.0
+azure-mgmt-resource==2.0.0
azure-cli-core
-pyyaml
+pyyaml>=3.13
colorama
websocket-client
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/azure-cli-container-0.1.22/setup.py
new/azure-cli-container-0.3.3/setup.py
--- old/azure-cli-container-0.1.22/setup.py 2018-04-06 19:33:13.000000000
+0200
+++ new/azure-cli-container-0.3.3/setup.py 2018-08-09 08:34:43.000000000
+0200
@@ -14,7 +14,7 @@
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}
-VERSION = "0.1.22"
+VERSION = "0.3.3"
CLASSIFIERS = [
'Development Status :: 4 - Beta',
@@ -31,9 +31,11 @@
]
DEPENDENCIES = [
- 'azure-mgmt-containerinstance==0.4.0',
+ 'azure-mgmt-containerinstance==1.0.0',
+ 'azure-mgmt-loganalytics==0.2.0',
+ 'azure-mgmt-resource==2.0.0',
'azure-cli-core',
- 'pyyaml',
+ 'pyyaml>=3.13',
'colorama',
'websocket-client'
]