Skip to content

Commit bce284a

Browse files
authored
API update (#121)
* AAPI update * Update CLI
2 parents 9c9e762 + df84dd5 commit bce284a

File tree

12 files changed

+5539
-7418
lines changed

12 files changed

+5539
-7418
lines changed

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
SDK Release History
44
===================
55

6+
8.0.0 (2020-06-15)
7+
------------------
8+
9+
* Update to match latest Python SDK taking associated breaking changes.
10+
611
7.0.0 (2019-08-20)
712
------------------
813

azext/batch/_file_utils.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,7 @@ def resolve_resource_file(self, resource_file):
344344
blobs = self.list_container_contents(resource_file.source, container, storage_client)
345345
return convert_blobs_to_resource_files(blobs, resource_file)
346346
if resource_file.source.container_url:
347-
# Input data storage in arbitrary container
348-
uri = urlsplit(resource_file.source.container_url)
349-
container = uri.pathname.split('/')[1]
350-
blobs = self.list_container_contents(resource_file.source, container, storage_client)
351-
return convert_blobs_to_resource_files(blobs, resource_file)
347+
return resource_file.source.container_url
352348
if resource_file.source.url:
353349
# TODO: Input data from an arbitrary HTTP GET source
354350
raise ValueError('Not implemented')

azext/batch/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55

6-
VERSION = "7.0.0"
6+
VERSION = "8.0.0"

batch-cli-extensions/HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
Release History
44
===============
55

6+
6.0.0 (2020-06-15)
7+
------------------
8+
9+
* Update SDK dependency to get latest models and defaults
10+
611
5.0.1 (2019-08-20)
712
------------------
813

batch-cli-extensions/azext_batch/_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def load_arguments(self, _):
2929
c.argument('start_task_wait_for_success', arg_group='Pool: Start Task', action='store_true', help='Whether the Batch service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node. If true and the start task fails on a compute node, the Batch service retries the start task up to its maximum retry count (maxTaskRetryCount). If the task has still not completed successfully after all retries, then the Batch service marks the compute node unusable, and will not schedule tasks to it. This condition can be detected via the node state and scheduling error detail. If false, the Batch service will not wait for the start task to complete. In this case, other tasks can start executing on the compute node while the start task is still running; and even if the start task fails, new tasks will continue to be scheduled on the node. The default is false. True if flag present.')
3030
c.argument('os_family', arg_group="Pool: Cloud Service Configuration",
3131
help='The Azure Guest OS family to be installed on the virtual machines in the pool. Possible values are: 2 - OS Family 2, equivalent to Windows Server 2008 R2 SP1. 3 - OS Family 3, equivalent to Windows Server 2012. 4 - OS Family 4, equivalent to Windows Server 2012 R2. 5 - OS Family 5, equivalent to Windows Server 2016. For more information, see Azure Guest OS Releases (https://azure.microsoft.com/documentation/articles/cloud-services-guestos-update-matrix/#releases). Allowed values: 2, 3, 4, 5.')
32+
c.extra('disk_encryption_targets',
33+
arg_group="Pool: Virtual Machine Configuration",
34+
help='A space seperated list of DiskEncryptionTargets. current possible values include OsDisk and TemporaryDisk.')
3235
c.argument('node_agent_sku_id', arg_group="Pool: Virtual Machine Configuration", help='The SKU of the Batch node agent to be provisioned on compute nodes in the pool. The Batch node agent is a program that runs on each node in the pool, and provides the command-and-control interface between the node and the Batch service. There are different implementations of the node agent, known as SKUs, for different operating systems. You must specify a node agent SKU which matches the selected image reference. To get the list of supported node agent SKUs along with their list of verified image references, see the \'List supported node agent SKUs\' operation.')
3336
c.argument('image', completer=load_supported_images, arg_group="Pool: Virtual Machine Configuration",
3437
help="OS image reference. This can be either 'publisher:offer:sku[:version]' format, or a fully qualified ARM image id of the form '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}'. If 'publisher:offer:sku[:version]' format, version is optional and if omitted latest will be used. Valid values can be retrieved via 'az batch pool node-agent-skus list'. For example: 'MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:latest'")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"azext.minCliCoreVersion": "2.0.73",
2+
"azext.minCliCoreVersion": "2.0.74",
33
"azext.maxCliCoreVersion": "3.0.0"
44
}

batch-cli-extensions/azext_batch/custom.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,29 @@
1818
# pylint: disable=redefined-builtin
1919

2020

21+
def disk_encryption_target_format(value):
22+
"""Space seperated target disks to be encrypted. Values can either be OsDisk or TemporaryDisk"""
23+
from azext.batch.models import DiskEncryptionTarget
24+
if value == 'OsDisk':
25+
return DiskEncryptionTarget.os_disk
26+
if value == 'TemporaryDisk':
27+
return DiskEncryptionTarget.temporary_disk
28+
message = 'Argument {} is not a valid disk_encryption_target'
29+
raise ValueError(message.format(value))
30+
31+
2132
def create_pool(client, template=None, parameters=None, json_file=None, id=None, vm_size=None, # pylint:disable=too-many-arguments, too-many-locals
2233
target_dedicated_nodes=None, target_low_priority_nodes=None, auto_scale_formula=None, # pylint: disable=redefined-builtin
23-
enable_inter_node_communication=False, os_family=None, image=None,
34+
enable_inter_node_communication=False, os_family=None, image=None, disk_encryption_targets=None,
2435
node_agent_sku_id=None, resize_timeout=None, start_task_command_line=None,
2536
start_task_resource_files=None, start_task_wait_for_success=False, application_licenses=None,
2637
certificate_references=None, application_package_references=None, metadata=None):
2738
# pylint: disable=too-many-branches, too-many-statements
2839
from azext.batch.errors import MissingParameterValue
2940
from azext.batch.models import (
3041
PoolAddOptions, StartTask, ImageReference,
31-
CloudServiceConfiguration, VirtualMachineConfiguration)
42+
CloudServiceConfiguration, VirtualMachineConfiguration,
43+
DiskEncryptionConfiguration)
3244
if template or json_file:
3345
if template:
3446
json_obj = None
@@ -81,6 +93,13 @@ def create_pool(client, template=None, parameters=None, json_file=None, id=None,
8193
pool.virtual_machine_configuration = VirtualMachineConfiguration(
8294
image_reference=ImageReference(publisher=publisher, offer=offer, sku=sku, version=version),
8395
node_agent_sku_id=node_agent_sku_id)
96+
if disk_encryption_targets:
97+
targets = disk_encryption_targets.split(' ')
98+
parsed_targets = []
99+
for target in targets:
100+
parsed_targets.append(
101+
disk_encryption_target_format(target))
102+
pool.virtual_machine_configuration.disk_configuration = DiskEncryptionConfiguration(targets=parsed_targets)
84103
except ValueError:
85104
if '/' not in image:
86105
message = ("Incorrect format for VM image. Should be in the format: \n"

batch-cli-extensions/azext_batch/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55

6-
VERSION = "5.0.2"
6+
VERSION = "6.0.0"

batch-cli-extensions/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
]
2828

2929
DEPENDENCIES = [
30-
'azure-batch-extensions>=7.0.0,<7.1',
30+
'azure-batch-extensions>=8.0.0,<8.1',
3131
'pycparser==2.18'
3232
]
3333

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
DEPENDENCIES = [
3030
'msrestazure>=0.4.14,<1',
31-
'azure-batch>=8.0,<9',
32-
'azure-mgmt-batch>=7.0,<8',
31+
'azure-batch>=9.0,<10',
32+
'azure-mgmt-batch>=9.0,<10',
3333
'azure-storage-blob>=1.1.0,<2',
3434
'azure-mgmt-storage>=2.0,<3'
3535
]

0 commit comments

Comments
 (0)