diff --git a/azure-cli.pyproj b/azure-cli.pyproj
index 0b84a619a6d..accc259c7c4 100644
--- a/azure-cli.pyproj
+++ b/azure-cli.pyproj
@@ -119,6 +119,11 @@
+
+
+
+
+
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/__init__.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/__init__.py
index a17865d1321..2d0cb03a03d 100644
--- a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/__init__.py
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/__init__.py
@@ -3,10 +3,12 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
-import azure.cli.command_modules.batch._help # pylint: disable=unused-import
+import azure.cli.command_modules.batch._help # pylint: disable=unused-import
+
def load_params(_):
- import azure.cli.command_modules.batch._params #pylint: disable=redefined-outer-name
+ import azure.cli.command_modules.batch._params # pylint: disable=redefined-outer-name
+
def load_commands():
- import azure.cli.command_modules.batch.commands #pylint: disable=redefined-outer-name
+ import azure.cli.command_modules.batch.commands # pylint: disable=redefined-outer-name
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_client_factory.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_client_factory.py
index b44cd67ef24..bda4787aae7 100644
--- a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_client_factory.py
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_client_factory.py
@@ -3,9 +3,73 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
-from azure.mgmt.batch import BatchManagementClient
-from azure.cli.core.commands.client_factory import get_mgmt_service_client
+def account_mgmt_client_factory(kwargs):
+ return batch_client_factory(**kwargs).batch_account
+
+
+def application_mgmt_client_factory(kwargs):
+ return batch_client_factory(**kwargs).application
+
+
+def application_package_client_factory(kwargs):
+ return batch_client_factory(**kwargs).application_package
+
+
+def location_client_factory(kwargs):
+ return batch_client_factory(**kwargs).location
+
+
+def application_client_factory(kwargs):
+ return batch_data_service_factory(kwargs).application
+
+
+def account_client_factory(kwargs):
+ return batch_data_service_factory(kwargs).account
+
+
+def certificate_client_factory(kwargs):
+ return batch_data_service_factory(kwargs).certificate
+
+
+def pool_client_factory(kwargs):
+ return batch_data_service_factory(kwargs).pool
+
+
+def job_client_factory(kwargs):
+ return batch_data_service_factory(kwargs).job
+
+
+def job_schedule_client_factory(kwargs):
+ return batch_data_service_factory(kwargs).job_schedule
+
+
+def task_client_factory(kwargs):
+ return batch_data_service_factory(kwargs).task
+
+
+def file_client_factory(kwargs):
+ return batch_data_service_factory(kwargs).file
+
+
+def compute_node_client_factory(kwargs):
+ return batch_data_service_factory(kwargs).compute_node
+
def batch_client_factory(**_):
+ from azure.mgmt.batch import BatchManagementClient
+ from azure.cli.core.commands.client_factory import get_mgmt_service_client
+
return get_mgmt_service_client(BatchManagementClient)
+
+
+def batch_data_service_factory(kwargs):
+ import azure.batch.batch_service_client as batch
+ import azure.batch.batch_auth as batchauth
+
+ account_name = kwargs.pop('account_name', None)
+ account_key = kwargs.pop('account_key', None)
+ account_endpoint = kwargs.pop('account_endpoint', None)
+ kwargs.pop('force', None)
+ credentials = batchauth.SharedKeyCredentials(account_name, account_key)
+ return batch.BatchServiceClient(credentials, base_url=account_endpoint)
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_command_type.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_command_type.py
new file mode 100644
index 00000000000..a1b09527133
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_command_type.py
@@ -0,0 +1,853 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+
+import json
+import re
+
+from six import string_types
+from msrest.exceptions import DeserializationError
+
+from azure.cli.command_modules.batch import _validators as validators
+from azure.cli.core.commands import (
+ FORCE_PARAM_NAME,
+ command_table,
+ command_module_map,
+ CliCommand,
+ CliCommandArgument,
+ get_op_handler)
+from azure.cli.core.commands._introspection import (
+ extract_full_summary_from_signature,
+ extract_args_from_signature)
+
+
+_CLASS_NAME = re.compile(r"<(.*?)>") # Strip model name from class docstring
+_UNDERSCORE_CASE = re.compile('(?!^)([A-Z]+)') # Convert from CamelCase to underscore_case
+FLATTEN = 3 # The level of complex object namespace to flatten.
+IGNORE_OPTIONS = { # Options parameters that should not be exposed as arguments.
+ 'ocp_date',
+ 'timeout',
+ 'client_request_id',
+ 'return_client_request_id',
+ 'max_results'
+}
+IGNORE_PARAMETERS = [
+ 'callback',
+ 'thumbprint_algorithm',
+ 'display_name',
+ 'common_environment_settings'
+]
+FLATTEN_OPTIONS = { # Options to be flattened into multiple arguments.
+ 'ocp_range': {'start_range': "The byte range to be retrieved. "
+ "If not set the file will be retrieved from the beginning.",
+ 'end_range': "The byte range to be retrieved. "
+ "If not set the file will be retrieved to the end."}
+}
+BASIC_TYPES = { # Argument types that should not be flattened.
+ 'str',
+ 'int',
+ 'bool',
+ 'float',
+ 'long',
+ 'duration',
+ 'iso-8601',
+ 'rfc-1123',
+ 'date',
+ 'decimal',
+ 'unix-time'
+}
+QUALIFIED_PROPERTIES = [ # Common argument names the should always be prefixed by their context
+ 'id',
+ 'display_name',
+ 'command_line',
+ 'environment_settings',
+ 'run_elevated',
+ 'wait_for_success',
+ 'max_task_retry_count',
+ 'constraints_max_task_retry_count',
+ 'max_wall_clock_time',
+ 'constraints_max_wall_clock_time',
+ 'retention_time',
+ 'constraints_retention_time',
+ 'application_package_references',
+ 'resource_files'
+]
+
+
+def _load_model(name):
+ """Load a model class from the SDK in order to inspect for
+ parameter names and whether they're required.
+ :param str name: The model class name to load.
+ :returns: Model class
+ """
+ if name.startswith('azure.'):
+ namespace = name.split('.')
+ else:
+ namespace = ['azure', 'batch', 'models', name]
+ model = __import__(namespace[0])
+ for level in namespace[1:]:
+ model = getattr(model, level)
+ return model
+
+
+def _join_prefix(prefix, name):
+ """Filter certain superflous parameter name suffixes
+ from argument names.
+ :param str prefix: The potential prefix that will be filtered.
+ :param str name: The arg name to be prefixed.
+ :returns: Combined name with prefix.
+ """
+ if prefix.endswith("_specification"):
+ return prefix[:-14] + "_" + name
+ elif prefix.endswith("_patch_parameter"):
+ return prefix[:-16] + "_" + name
+ elif prefix.endswith("_update_parameter"):
+ return prefix[:-17] + "_" + name
+ return prefix + "_" + name
+
+
+def _build_prefix(arg, param, path):
+ """Recursively build a command line argument prefix from the request
+ parameter object to avoid name conflicts.
+ :param str arg: Currenct argument name.
+ :param str param: Original request parameter name.
+ :param str path: Request parameter namespace.
+ """
+ prefix_list = path.split('.')
+ if len(prefix_list) == 1:
+ return arg
+ resolved_name = _join_prefix(prefix_list[0], param)
+ if arg == resolved_name:
+ return arg
+ for prefix in prefix_list[1:]:
+ new_name = _join_prefix(prefix, param)
+ if new_name == arg:
+ return resolved_name
+ resolved_name = new_name
+ return resolved_name
+
+
+def find_param_type(model, param):
+ """Parse the parameter type from the model docstring.
+ :param class model: Model class.
+ :param str param: The name of the parameter.
+ :returns: str
+ """
+ # Search for the :type param_name: in the docstring
+ pattern = r":type {}:(.*?)\n(\s*:param |\s*:rtype:|\s*:raises:|\s*\"{{3}})".format(param)
+ param_type = re.search(pattern, model.__doc__, re.DOTALL)
+ return re.sub(r"\n\s*", "", param_type.group(1).strip())
+
+
+def find_param_help(model, param):
+ """Parse the parameter help info from the model docstring.
+ :param class model: Model class.
+ :param str param: The name of the parameter.
+ :returns: str
+ """
+ # Search for :param param_name: in the docstring
+ pattern = r":param {}:(.*?)\n\s*:type ".format(param)
+ param_doc = re.search(pattern, model.__doc__, re.DOTALL)
+ return re.sub(r"\n\s*", " ", param_doc.group(1).strip())
+
+
+def find_return_type(model):
+ """Parse the parameter help info from the model docstring.
+ :param class model: Model class.
+ :param str param: The name of the parameter.
+ :returns: str
+ """
+ # Search for :rtype: in the docstring
+ pattern = r":rtype: (.*?)\n(\s*:rtype:|\s*:raises:|\"\"\")"
+ return_type = re.search(pattern, model.__doc__, re.DOTALL)
+ if return_type:
+ return re.sub(r"\n\s*", "", return_type.group(1))
+
+
+def class_name(type_str):
+ """Extract class name from type docstring.
+ :param str type_str: Parameter type docstring.
+ :returns: class name
+ """
+ return _CLASS_NAME.findall(type_str)[0]
+
+
+def operations_name(class_str):
+ """Convert the operations class name into Python case.
+ :param str class_str: The class name.
+ """
+ if class_str.endswith('Operations'):
+ class_str = class_str[:-10]
+ return _UNDERSCORE_CASE.sub(r'_\1', class_str).lower()
+
+
+def full_name(arg_details):
+ """Create a full path to the complex object parameter of a
+ given argument.
+ :param dict arg_details: The details of the argument.
+ :returns: str
+ """
+ return ".".join([arg_details['path'], arg_details['root']])
+
+
+def group_title(path):
+ """Create a group title from the argument path.
+ :param str path: The complex object path of the argument.
+ :returns: str
+ """
+ def filter_group(group):
+ for suffix in ["_patch_parameter", "_update_parameter", "_parameter"]:
+ if group.endswith(suffix):
+ group = group[:0 - len(suffix)]
+ return group
+ group_path = path.split('.')
+ group_path = list(map(filter_group, group_path)) # pylint: disable=bad-builtin
+ title = ': '.join(group_path)
+ for group in group_path:
+ title = title.replace(group, " ".join([n.title() for n in group.split('_')]), 1)
+ return title
+
+
+def arg_name(name):
+ """Convert snake case argument name to a command line name.
+ :param str name: The argument parameter name.
+ :returns: str
+ """
+ return "--" + name.replace('_', '-')
+
+
+def format_options_name(operation):
+ """Format the name of the request options parameter from the
+ operation name and path.
+ :param str operation: Operation path
+ :returns: str - options parameter name.
+ """
+ operation = operation.split('#')[-1]
+ op_class, op_function = operation.split('.')
+ op_class = operations_name(op_class)
+ return "{}_{}_options".format(op_class, op_function)
+
+
+class BatchArgumentTree(object):
+ """Dependency tree parser for arguments of complex objects"""
+
+ def __init__(self, validator, silent):
+ self._arg_tree = {}
+ self._request_param = {}
+ self._custom_validator = validator
+ self._silent_args = silent
+ self.done = False
+
+ def __iter__(self):
+ """Iterate over arguments"""
+ for arg, details in self._arg_tree.items():
+ yield arg, details
+
+ def _is_silent(self, name):
+ """Whether argument should not be exposed"""
+ arg = self._arg_tree[name]
+ full_path = full_name(arg)
+ return arg['path'] in self._silent_args or full_path in self._silent_args
+
+ def _is_bool(self, name):
+ """Whether argument value is a boolean"""
+ return self._arg_tree[name]['type'] == 'bool'
+
+ def _is_list(self, name):
+ """Whether argument value is a list"""
+ return self._arg_tree[name]['type'].startswith('[')
+
+ def _is_datetime(self, name):
+ """Whether argument value is a timestamp"""
+ return self._arg_tree[name]['type'] in ['iso-8601', 'rfc-1123']
+
+ def _is_duration(self, name):
+ """Whether argument is value is a duration"""
+ return self._arg_tree[name]['type'] == 'duration'
+
+ def _help(self, name, text):
+ """Append phrase to existing help text"""
+ self._arg_tree[name]['options']['help'] += ' ' + text
+
+ def _get_children(self, group):
+ """Find all the arguments under to a specific complex argument group.
+ :param str group: The namespace of the complex parameter.
+ :returns: The names of the related arugments.
+ """
+ return [arg for arg, value in self._arg_tree.items() if value['path'].startswith(group)]
+
+ def _get_siblings(self, group):
+ """Find all the arguments at the same level of a specific complex argument group.
+ :param str group: The namespace of the complex parameter.
+ :returns: The names of the related arugments.
+ """
+ return [arg for arg, value in self._arg_tree.items() if value['path'] == group]
+
+ def _parse(self, namespace, path, required):
+ """Parse dependency tree to list all required command line arguments based on
+ current inputs.
+ :param namespace: The namespace container all current argument inputs
+ :param path: The current complex object path
+ :param required: Whether the args in this object path are required
+ """
+ required_args = []
+ children = self._get_children(path)
+ if not required:
+ if not any([getattr(namespace, n) for n in children]):
+ return []
+ siblings = self._get_siblings(path)
+ if not siblings:
+ raise ValueError("Invalid argmuent dependency tree") # TODO
+ dependencies = self._arg_tree[siblings[0]]['dependencies']
+ for child_arg in children:
+ if child_arg in required_args:
+ continue
+ details = self._arg_tree[child_arg]
+ if full_name(details) in dependencies:
+ required_args.append(child_arg)
+ elif details['path'] in dependencies:
+ required_args.extend(self._parse(namespace, details['path'], True))
+ elif details['path'] == path:
+ continue
+ else:
+ required_args.extend(self._parse(namespace, details['path'], False))
+ return set(required_args)
+
+ def set_request_param(self, name, model):
+ """Set the name of the parameter that will be serialized for the
+ request body.
+ :param str name: The name of the parameter
+ :param str model: The name of the class
+ """
+ self._request_param['name'] = name
+ self._request_param['model'] = model.split('.')[-1]
+
+ def deserialize_json(self, client, kwargs, json_obj):
+ """Deserialize the contents of a JSON file into the request body
+ parameter.
+ :param client: An Azure Batch SDK client
+ :param dict kwargs: The request kwargs
+ :param dict json_obj: The loaded JSON content
+ """
+ message = "Failed to deserialized JSON file into object {}"
+ try:
+ kwargs[self._request_param['name']] = client._deserialize( # pylint: disable=protected-access
+ self._request_param['model'], json_obj)
+ except DeserializationError as error:
+ message += ": {}".format(error)
+ raise ValueError(message.format(self._request_param['model']))
+ else:
+ if kwargs[self._request_param['name']] is None:
+ raise ValueError(message.format(self._request_param['model']))
+
+ def queue_argument(self, name=None, path=None, root=None, # pylint:disable=too-many-arguments
+ options=None, type=None, dependencies=None): # pylint: disable=redefined-builtin
+ """Add pending command line argument
+ :param str name: The name of the command line argument.
+ :param str path: The complex object path to the parameter.
+ :param str root: The original name of the parameter.
+ :param dict options: The kwargs to be used to instantiate CliCommandArgument.
+ :param list dependencies: A list of complete paths to other parameters that
+ are required if this parameter is set.
+ """
+ self._arg_tree[name] = {
+ 'path': path,
+ 'root': root,
+ 'options': options,
+ 'type': type,
+ 'dependencies': [".".join([path, arg]) for arg in dependencies]
+ }
+
+ def dequeue_argument(self, name):
+ """Remove pending command line argument for modification
+ :param str name: The command line argument to remove.
+ :returns: The details of the argument.
+ """
+ return self._arg_tree.pop(name, {})
+
+ def compile_args(self):
+ """Generator to convert pending arguments into CliCommandArgument
+ objects.
+ """
+ for name, details in self._arg_tree.items():
+ if self._is_bool(name):
+ if self._request_param['name'].endswith('patch_parameter'):
+ self._help(name, "Specify either 'true' or 'false' to update the property.")
+ else:
+ details['options']['action'] = 'store_true'
+ self._help(name, "True if flag present, otherwise defaults to False.")
+ elif self._is_list(name):
+ details['options']['nargs'] = '+'
+ elif self._is_datetime(name):
+ details['options']['type'] = validators.datetime_format
+ self._help(name, "Expected format is an ISO-8601 timestamp.")
+ elif self._is_duration(name):
+ details['options']['type'] = validators.duration_format
+ self._help(name, "Expected format is an ISO-8601 duration.")
+ elif self._is_silent(name):
+ import argparse
+ from azure.cli.core.commands.parameters import IgnoreAction
+ details['options']['nargs'] = '?'
+ details['options']['help'] = argparse.SUPPRESS
+ details['options']['required'] = False
+ details['options']['action'] = IgnoreAction
+ yield (name, CliCommandArgument(dest=name, **details['options']))
+
+ def existing(self, name):
+ """Whether the argument name is already used by a pending
+ argument.
+ :param str name: The name of the argument to check.
+ :returns: bool
+ """
+ return name in self._arg_tree
+
+ def parse_mutually_exclusive(self, namespace, required, params):
+ """Validate whether two or more mutually exclusive arguments or
+ argument groups have been set correctly.
+ :param bool required: Whether one of the parameters must be set.
+ :param list params: List of namespace paths for mutually exclusive
+ request properties.
+ """
+ argtree = self._arg_tree.items()
+ ex_arg_names = [a for a, v in argtree if full_name(v) in params]
+ ex_args = [getattr(namespace, a) for a, v in argtree if a in ex_arg_names]
+ ex_args = [x for x in ex_args if x is not None]
+ ex_group_names = []
+ ex_groups = []
+ for arg_group in params:
+ child_args = self._get_children(arg_group)
+ if child_args:
+ ex_group_names.append(group_title(arg_group))
+ if any([getattr(namespace, arg) for arg in child_args]):
+ ex_groups.append(ex_group_names[-1])
+
+ message = None
+ if not ex_groups and not ex_args and required:
+ message = "One of the following arguments, or argument groups are required: \n"
+ elif len(ex_groups) > 1 or len(ex_args) > 1 or (ex_groups and ex_args):
+ message = ("The follow arguments or argument groups are mutually "
+ "exclusive and cannot be combined: \n")
+ if message:
+ missing = [arg_name(n) for n in ex_arg_names] + ex_group_names
+ message += '\n'.join(missing)
+ raise ValueError(message)
+
+ def parse(self, namespace):
+ """Parse all arguments in the namespace to validate whether all required
+ arguments have been set.
+ :param namespace: The namespace object.
+ :raises: ValueError if a require argument was not set.
+ """
+ if self._custom_validator:
+ try:
+ self._custom_validator(namespace, self)
+ except TypeError:
+ raise ValueError("Custom validator must be a function that takes two arguments.")
+ try:
+ if namespace.json_file:
+ try:
+ with open(namespace.json_file) as file_handle:
+ namespace.json_file = json.load(file_handle)
+ except EnvironmentError:
+ raise ValueError("Cannot access JSON request file: " + namespace.json_file)
+ except ValueError as err:
+ raise ValueError("Invalid JSON file: {}".format(err))
+ other_values = [arg_name(n) for n in self._arg_tree if getattr(namespace, n)]
+ if other_values:
+ message = "--json-file cannot be combined with:\n"
+ raise ValueError(message + '\n'.join(other_values))
+ self.done = True
+ return
+ except AttributeError:
+ pass
+ required_args = self._parse(namespace, self._request_param['name'], True)
+ missing_args = [n for n in required_args if not getattr(namespace, n)]
+ if missing_args:
+ message = "The following additional arguments are required:\n"
+ message += "\n".join([arg_name(m) for m in missing_args])
+ raise ValueError(message)
+ self.done = True
+
+
+class AzureBatchDataPlaneCommand(object):
+ # pylint:disable=too-many-instance-attributes, too-few-public-methods
+
+ def __init__(self, module_name, name, operation, factory, transform_result, # pylint:disable=too-many-arguments
+ table_transformer, flatten, ignore, validator, silent):
+
+ if not isinstance(operation, string_types):
+ raise ValueError("Operation must be a string. Got '{}'".format(operation))
+
+ self.flatten = flatten # Number of object levels to flatten
+ self.silent = silent if silent else []
+ self.ignore = list(IGNORE_PARAMETERS) # Parameters to ignore
+ if ignore:
+ self.ignore.extend(ignore)
+ self.parser = None
+ self.validator = validator
+ self.confirmation = 'delete' in operation
+
+ # The name of the request options parameter
+ self._options_param = format_options_name(operation)
+ # Arguments used for request options
+ self._options_attrs = []
+ # The loaded options model to populate for the request
+ self._options_model = None
+
+ def _execute_command(kwargs):
+ from msrest.paging import Paged
+ from msrest.exceptions import ValidationError, ClientRequestError
+ from azure.batch.models import BatchErrorException
+ from azure.cli.core._util import CLIError
+ from azure.cli.core._config import az_config
+ from azure.cli.core.commands import _user_confirmed
+
+ if self._cancel_operation(kwargs, az_config, _user_confirmed):
+ raise CLIError('Operation cancelled.')
+
+ try:
+ client = factory(kwargs)
+ self._build_options(kwargs)
+
+ stream_output = kwargs.pop('destination', None)
+ json_file = kwargs.pop('json_file', None)
+
+ # Build the request parameters from command line arguments
+ if json_file:
+ self.parser.deserialize_json(client, kwargs, json_file)
+ for arg, _ in self.parser:
+ del kwargs[arg]
+ else:
+ for arg, details in self.parser:
+ try:
+ param_value = kwargs.pop(arg)
+ if param_value is None:
+ continue
+ else:
+ self._build_parameters(
+ details['path'],
+ kwargs,
+ details['root'],
+ param_value)
+ except KeyError:
+ continue
+
+ # Make request
+ op = get_op_handler(operation)
+ result = op(client, **kwargs)
+
+ # File download
+ if stream_output:
+ with open(stream_output, "wb") as file_handle:
+ for data in result:
+ file_handle.write(data)
+ return
+
+ # Apply results transform if specified
+ elif transform_result:
+ return transform_result(result)
+
+ # Otherwise handle based on return type of results
+ elif isinstance(result, Paged):
+ return list(result)
+ else:
+ return result
+ except BatchErrorException as ex:
+ try:
+ message = ex.error.message.value
+ if ex.error.values:
+ for detail in ex.error.values:
+ message += "\n{}: {}".format(detail.key, detail.value)
+ raise CLIError(message)
+ except AttributeError:
+ raise CLIError(ex)
+ except (ValidationError, ClientRequestError) as ex:
+ raise CLIError(ex)
+
+ command_module_map[name] = module_name
+ self.cmd = CliCommand(
+ ' '.join(name.split()),
+ _execute_command,
+ table_transformer=table_transformer,
+ arguments_loader=lambda: self._load_transformed_arguments(
+ get_op_handler(operation)),
+ description_loader=lambda: extract_full_summary_from_signature(
+ get_op_handler(operation))
+ )
+
+ def _cancel_operation(self, kwargs, config, user):
+ """Whether to cancel the current operation because user
+ declined the confirmation prompt.
+ :param dict kwargs: The request arguments.
+ :returns: bool
+ """
+ return self.confirmation \
+ and not kwargs.get(FORCE_PARAM_NAME) \
+ and not config.getboolean('core', 'disable_confirm_prompt', fallback=False) \
+ and not user(self.confirmation, kwargs)
+
+ def _build_parameters(self, path, kwargs, param, value):
+ """Recursively build request parameter dictionary from command line args.
+ :param str arg_path: Current parameter namespace.
+ :param dict kwargs: The request arguments being built.
+ :param param: The name of the request parameter.
+ :param value: The value of the request parameter.
+ """
+ keys = path.split('.')
+ if keys[0] not in kwargs:
+ kwargs[keys[0]] = {}
+ if len(keys) < 2:
+ kwargs[keys[0]][param] = value
+ else:
+ self._build_parameters('.'.join(keys[1:]), kwargs[keys[0]], param, value)
+
+ path = param[0]
+ return path.split('.')[0]
+
+ def _build_options(self, kwargs):
+ """Build request options model from command line arguments.
+ :param dict kwargs: The request arguments being built.
+ """
+ kwargs[self._options_param] = self._options_model
+ for param in self._options_attrs:
+ if param in IGNORE_OPTIONS:
+ continue
+ param_value = kwargs.pop(param)
+ if param_value is None:
+ continue
+ setattr(kwargs[self._options_param], param, param_value)
+
+ def _load_options_model(self, func_obj):
+ """Load the request headers options model to gather arguments.
+ :param func func_obj: The request function.
+ """
+ option_type = find_param_type(func_obj, self._options_param)
+ option_type = class_name(option_type)
+ self._options_model = _load_model(option_type)()
+ self._options_attrs = list(self._options_model.__dict__.keys())
+
+ def _should_flatten(self, param):
+ """Check whether the current parameter object should be flattened.
+ :param str param: The parameter name with complete namespace.
+ :returns: bool
+ """
+ return param.count('.') < self.flatten and param not in self.ignore
+
+ def _get_attrs(self, model, path):
+ """Get all the attributes from the complex parameter model that should
+ be exposed as command line arguments.
+ :param class model: The parameter model class.
+ :param str path: Request parameter namespace.
+ """
+ for attr, details in model._attribute_map.items(): # pylint: disable=protected-access
+ conditions = []
+ conditions.append(model._validation.get(attr, {}).get('readonly')) # pylint: disable=protected-access
+ conditions.append(model._validation.get(attr, {}).get('constant')) # pylint: disable=protected-access
+ conditions.append('.'.join([path, attr]) in self.ignore)
+ conditions.append(details['type'][0] in ['{'])
+ if not any(conditions):
+ yield attr, details
+
+ def _process_options(self):
+ """Process the request options parameter to expose as arguments."""
+ for param in [o for o in self._options_attrs if o not in IGNORE_OPTIONS]:
+ options = {}
+ options['required'] = False
+ options['arg_group'] = 'Pre-condition and Query'
+ if param in ['if_modified_since', 'if_unmodified_since']:
+ options['type'] = validators.datetime_format
+ if param in FLATTEN_OPTIONS:
+ for f_param, f_docstring in FLATTEN_OPTIONS[param].items():
+ options['default'] = None
+ options['help'] = f_docstring
+ options['options_list'] = [arg_name(f_param)]
+ options['validator'] = validators.validate_options
+ yield (f_param, CliCommandArgument(f_param, **options))
+ else:
+ options['default'] = getattr(self._options_model, param)
+ options['help'] = find_param_help(self._options_model, param)
+ options['options_list'] = [arg_name(param)]
+ yield (param, CliCommandArgument(param, **options))
+
+ def _resolve_conflict(self, arg, param, path, options, typestr, dependencies, conflicting): # pylint:disable=too-many-arguments
+ """Resolve conflicting command line arguments.
+ :param str arg: Name of the command line argument.
+ :param str param: Original request parameter name.
+ :param str path: Request parameter namespace.
+ :param dict options: The kwargs to be used to instantiate CliCommandArgument.
+ :param list dependencies: A list of complete paths to other parameters that are required
+ if this parameter is set.
+ :param list conflicting: A list of the argument names that have already conflicted.
+ """
+ if self.parser.existing(arg):
+ conflicting.append(arg)
+ existing = self.parser.dequeue_argument(arg)
+ existing['name'] = _build_prefix(arg, existing['root'], existing['path'])
+ existing['options']['options_list'] = [arg_name(existing['name'])]
+ self.parser.queue_argument(**existing)
+ new = _build_prefix(arg, param, path)
+ options['options_list'] = [arg_name(new)]
+ self._resolve_conflict(new, param, path, options, typestr, dependencies, conflicting)
+ elif arg in conflicting or arg in QUALIFIED_PROPERTIES:
+ new = _build_prefix(arg, param, path)
+ if new in conflicting or new in QUALIFIED_PROPERTIES and '.' not in path:
+ self.parser.queue_argument(arg, path, param, options, typestr, dependencies)
+ else:
+ options['options_list'] = [arg_name(new)]
+ self._resolve_conflict(new, param, path, options,
+ typestr, dependencies, conflicting)
+ else:
+ self.parser.queue_argument(arg, path, param, options, typestr, dependencies)
+
+ def _flatten_object(self, path, param_model, conflict_names=[]): # pylint: disable=dangerous-default-value
+ """Flatten a complex parameter object into command line arguments.
+ :param str path: The complex parameter namespace.
+ :param class param_model: The complex parameter class.
+ :param list conflict_name: List of argument names that conflict.
+ """
+ if self._should_flatten(path):
+ required_attrs = [key for key,
+ val in param_model._validation.items() if val.get('required')] # pylint: disable=protected-access
+
+ for param_attr, details in self._get_attrs(param_model, path):
+ if param_attr in IGNORE_PARAMETERS:
+ continue
+ options = {}
+ options['options_list'] = [arg_name(param_attr)]
+ options['required'] = False
+ options['arg_group'] = group_title(path)
+ options['help'] = find_param_help(param_model, param_attr)
+ options['validator'] = \
+ lambda ns: validators.validate_required_parameter(ns, self.parser)
+ options['default'] = None # Extract details from signature
+
+ if details['type'] in BASIC_TYPES:
+ self._resolve_conflict(param_attr, param_attr, path, options,
+ details['type'], required_attrs, conflict_names)
+ elif details['type'].startswith('['):
+ # We only expose a list arg if there's a validator for it
+ # This will fail for 2D arrays - though Batch doesn't have any yet
+ inner_type = details['type'][1:-1]
+ if inner_type in BASIC_TYPES:
+ options['help'] += " Space separated values."
+ self._resolve_conflict(
+ param_attr, param_attr, path, options,
+ details['type'], required_attrs, conflict_names)
+ else:
+ inner_type = operations_name(inner_type)
+ try:
+ validator = getattr(validators, inner_type + "_format")
+ options['help'] += ' ' + validator.__doc__
+ options['type'] = validator
+ self._resolve_conflict(
+ param_attr, param_attr, path, options,
+ details['type'], required_attrs, conflict_names)
+ except AttributeError:
+ continue
+ else:
+ attr_model = _load_model(details['type'])
+ if not hasattr(attr_model, '_attribute_map'): # Must be an enum
+ values_index = options['help'].find(' Possible values include')
+ if values_index >= 0:
+ choices = options['help'][values_index + 25:].split(', ')
+ options['choices'] = [c for c in choices if c != "'unmapped'"]
+ options['help'] = options['help'][0:values_index]
+ self._resolve_conflict(param_attr, param_attr, path, options,
+ details['type'], required_attrs, conflict_names)
+ else:
+ self._flatten_object('.'.join([path, param_attr]), attr_model)
+
+ def _load_transformed_arguments(self, handler):
+ """Load all the command line arguments from the request parameters.
+ :param func handler: The operation function.
+ """
+ from azure.cli.core.commands.parameters import file_type
+ from argcomplete.completers import FilesCompleter, DirectoriesCompleter
+
+ self.parser = BatchArgumentTree(self.validator, self.silent)
+ self._load_options_model(handler)
+ for arg in extract_args_from_signature(handler):
+ arg_type = find_param_type(handler, arg[0])
+ if arg[0] == self._options_param:
+ for option_arg in self._process_options():
+ yield option_arg
+ elif arg_type.startswith("str or"):
+ docstring = find_param_help(handler, arg[0])
+ choices = []
+ values_index = docstring.find(' Possible values include')
+ if values_index >= 0:
+ choices = docstring[values_index + 25:].split(', ')
+ choices = [c for c in choices if c != "'unmapped'"]
+ docstring = docstring[0:values_index]
+ yield (arg[0], CliCommandArgument(arg[0],
+ options_list=[arg_name(arg[0])],
+ required=False,
+ default=None,
+ choices=choices,
+ help=docstring))
+ elif arg_type.startswith(":class:"): # TODO: could add handling for enums
+ param_type = class_name(arg_type)
+ self.parser.set_request_param(arg[0], param_type)
+ param_model = _load_model(param_type)
+ self._flatten_object(arg[0], param_model)
+ for flattened_arg in self.parser.compile_args():
+ yield flattened_arg
+ param = 'json_file'
+ docstring = "A file containing the {} specification in JSON format. " \
+ "If this parameter is specified, all '{} Arguments'" \
+ " are ignored.".format(arg[0].replace('_', ' '), group_title(arg[0]))
+ yield (param, CliCommandArgument(param,
+ options_list=[arg_name(param)],
+ required=False,
+ default=None,
+ type=file_type,
+ completer=FilesCompleter(),
+ help=docstring))
+ elif arg[0] not in self.ignore:
+ yield arg
+ if find_return_type(handler) == 'Generator':
+ param = 'destination'
+ docstring = "The path to the destination file or directory."
+ yield (param, CliCommandArgument(param,
+ options_list=[arg_name(param)],
+ required=True,
+ default=None,
+ completer=DirectoriesCompleter(),
+ type=file_type,
+ validator=validators.validate_file_destination,
+ help=docstring))
+ if self.confirmation:
+ param = FORCE_PARAM_NAME
+ docstring = 'Do not prompt for confirmation.'
+ yield (param, CliCommandArgument(param,
+ options_list=[arg_name(param)],
+ required=False,
+ action='store_true',
+ help=docstring))
+
+
+def cli_batch_data_plane_command(name, operation, client_factory, transform=None, # pylint:disable=too-many-arguments
+ table_transformer=None, flatten=FLATTEN,
+ ignore=None, validator=None, silent=None):
+ """ Registers an Azure CLI Batch Data Plane command. These commands must respond to a
+ challenge from the service when they make requests. """
+ command = AzureBatchDataPlaneCommand(__name__, name, operation, client_factory, transform,
+ table_transformer, flatten, ignore, validator, silent)
+
+ # add parameters required to create a batch client
+ group_name = 'Batch Account'
+ command.cmd.add_argument('account_name', '--account-name', required=False, default=None,
+ validator=validators.validate_client_parameters, arg_group=group_name,
+ help='Batch account name. Alternatively, set by environment variable: '
+ 'AZURE_BATCH_ACCOUNT')
+ command.cmd.add_argument('account_key', '--account-key', required=False, default=None,
+ arg_group=group_name,
+ help='Batch account key. Alternatively, set by environment'
+ ' variable: AZURE_BATCH_ACCESS_KEY')
+ command.cmd.add_argument('account_endpoint', '--account-endpoint', required=False, default=None,
+ arg_group=group_name,
+ help='Batch service endpoint. Alternatively, set by environment'
+ ' variable: AZURE_BATCH_ENDPOINT')
+ command_table[command.cmd.name] = command.cmd
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_help.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_help.py
index 0264684bffb..0edf798f946 100644
--- a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_help.py
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_help.py
@@ -5,7 +5,7 @@
from azure.cli.core.help_files import helps
-#pylint: disable=line-too-long
+# pylint: disable=line-too-long
helps['batch'] = """
type: group
@@ -27,6 +27,11 @@
short-summary: Creates a new Batch account with the specified parameters.
"""
+helps['batch account set'] = """
+ type: command
+ short-summary: Updates the properties of the specified Batch account. Properties that are not specified remain unchanged.
+"""
+
helps['batch account autostorage-keys'] = """
type: group
short-summary: Commands to manage the access keys for the auto storage account configured for your Batch account.
@@ -42,11 +47,31 @@
short-summary: Commands to manage your Batch applications.
"""
+helps['batch application set'] = """
+ type: command
+ short-summary: Updates the properties of the specified application. Properties that are not specified remain unchanged.
+"""
+
helps['batch application package'] = """
type: group
short-summary: Commands to manage your Batch application packages.
"""
+helps['batch application package create'] = """
+ type: command
+ short-summary: Creates an application package record and attempts to activate it.
+"""
+
+helps['batch application package activate'] = """
+ type: command
+ short-summary: Activates the specified application package. This step is unnecessary if the package has already been successfully activated by the 'create' command.
+"""
+
+helps['batch application summary'] = """
+ type: group
+ short-summary: Commands to view a summary of your Batch application packages.
+"""
+
helps['batch location'] = """
type: group
short-summary: Commands to manage Batch service options for a subscription at the region level.
@@ -56,3 +81,208 @@
type: group
short-summary: Commands to manage Batch service quotas at the region level.
"""
+
+helps['batch certificate'] = """
+ type: group
+ short-summary: Commands to manage your Batch certificates.
+"""
+
+helps['batch task file'] = """
+ type: group
+ short-summary: Commands to manage your Batch task files.
+"""
+
+helps['batch task file download'] = """
+ type: command
+ short-summary: Downloads the content of the specified task file.
+"""
+
+helps['batch node file'] = """
+ type: group
+ short-summary: Commands to manage your Batch compute node files.
+"""
+
+helps['batch node file download'] = """
+ type: command
+ short-summary: Downloads the content of the specified node file.
+"""
+
+helps['batch job'] = """
+ type: group
+ short-summary: Commands to manage your Batch jobs.
+"""
+
+helps['batch job all-statistics'] = """
+ type: group
+ short-summary: Commands to view statistics of all the jobs under your Batch account
+"""
+
+helps['batch job all-statistics show'] = """
+ type: command
+ short-summary: Gets lifetime summary statistics for all of the jobs in the specified account. Statistics are aggregated across all jobs that have ever existed in the account, from account creation to the last update time of the statistics.
+"""
+
+helps['batch job prep-release-status'] = """
+ type: group
+ short-summary: Commands to view the status of your job preparation and release tasks.
+"""
+
+helps['batch job-schedule'] = """
+ type: group
+ short-summary: Commands to manage your Batch job schedules.
+"""
+
+helps['batch node user'] = """
+ type: group
+ short-summary: Commands to manage your Batch compute node users.
+"""
+
+helps['batch node user create'] = """
+ type: command
+ short-summary: Adds a user account to the specified compute node.
+"""
+
+helps['batch node user reset'] = """
+ type: command
+ short-summary: Updates the properties of a user account on the specified compute node. All updatable properties are replaced with the values specified or reset if unspecified.
+"""
+
+helps['batch node'] = """
+ type: group
+ short-summary: Commands to manage your Batch compute nodes.
+"""
+
+helps['batch node remote-login-settings'] = """
+ type: group
+ short-summary: Commands to retrieve the remote login settings for a Batch compute node.
+"""
+
+helps['batch node remote-desktop'] = """
+ type: group
+ short-summary: Commands to retrieve the remote desktop protocol for a Batch compute node.
+"""
+
+helps['batch node scheduling'] = """
+ type: group
+ short-summary: Commands to manage task scheduling for a Batch compute node.
+"""
+
+helps['batch pool'] = """
+ type: group
+ short-summary: Commands to manage your Batch pools.
+"""
+
+helps['batch pool os'] = """
+ type: group
+ short-summary: Commands to manage the operating system of your Batch pools.
+"""
+
+helps['batch pool autoscale'] = """
+ type: group
+ short-summary: Commands to manage automatic scaling of your Batch pools.
+"""
+
+helps['batch pool all-statistics'] = """
+ type: group
+ short-summary: Commands to view statistics of all pools under your Batch account.
+"""
+
+helps['batch pool all-statistics show'] = """
+ type: command
+ short-summary: Gets lifetime summary statistics for all of the pools in the specified account. Statistics are aggregated across all pools that have ever existed in the account, from account creation to the last update time of the statistics.
+"""
+
+helps['batch pool usage-metrics'] = """
+ type: group
+ short-summary: Commands to view usage metrics of your Batch pools.
+"""
+
+helps['batch pool node-agent-skus'] = """
+ type: group
+ short-summary: Commands to retrieve node agent SKUs of pools using a Virtual Machine Configuration.
+"""
+
+helps['batch task'] = """
+ type: group
+ short-summary: Commands to manage your Batch tasks.
+"""
+
+helps['batch task subtask'] = """
+ type: group
+ short-summary: Commands to manage subtask information of your Batch task.
+"""
+
+helps['batch certificate create'] = """
+ type: command
+ short-summary: Adds a certificate.
+"""
+
+helps['batch certificate delete'] = """
+ type: command
+ short-summary: Deletes the specified Batch certificate.
+"""
+
+helps['batch pool create'] = """
+ type: command
+ short-summary: Creates a pool in the specified account. When creating a pool, please chose arguments from either Cloud Services Configuration or Virtual Machine Configuration.
+"""
+
+helps['batch pool set'] = """
+ type: command
+ short-summary: Updates the properties of the specified pool. Properties can be updated independently, but please note that an updated property in a sub-group (i.e. 'start task') will result in all properties of that group being reset.
+"""
+
+helps['batch pool reset'] = """
+ type: command
+ short-summary: Updates the properties of the specified pool. All updatable properties are replaced with the values specified or cleared/defaulted if unspecified.
+"""
+
+helps['batch pool resize'] = """
+ type: command
+ short-summary: Resizes (or stops resizing) the Batch pool.
+"""
+
+helps['batch job create'] = """
+ type: command
+ short-summary: Adds a job to the specified account.
+"""
+
+helps['batch job list'] = """
+ type: command
+ short-summary: Lists all of the jobs in the specified account or the specified job schedule.
+"""
+
+helps['batch job set'] = """
+ type: command
+ short-summary: Updates the properties of a job. Properties can be updated independently, but please note that an updated property in a sub-group (i.e. 'constraints' and 'pool info') will result in all properties of that group being reset.
+"""
+
+helps['batch job reset'] = """
+ type: command
+ short-summary: Updates the properties of a job. All updatable properties are replaced with the values specified or cleared/defaulted if unspecified.
+"""
+
+helps['batch job-schedule create'] = """
+ type: command
+ short-summary: Adds a job schedule to the specified account.
+"""
+
+helps['batch job-schedule set'] = """
+ type: command
+ short-summary: Updates the properties of the specified job schedule. You can independently update the 'schedule' and/or the 'job specification', but note that any change to either of these entities will reset all properties in that entity.
+"""
+
+helps['batch job-schedule reset'] = """
+ type: command
+ short-summary: Updates the properties of the specified job schedule. All updatable properties are replaced with the values specified or cleared if unspecified. An updated job-specification will only apply to new jobs.
+"""
+
+helps['batch task create'] = """
+ type: command
+ short-summary: Creates a single Batch task or multiple Batch tasks.
+"""
+
+helps['batch task reset'] = """
+ type: command
+ short-summary: Updates the properties of the specified task. All updatable properties are replaced with the values specified or reset if unspecified.
+"""
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_params.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_params.py
index 6975d838d4b..8288f39259c 100644
--- a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_params.py
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_params.py
@@ -6,30 +6,104 @@
from argcomplete.completers import FilesCompleter
from azure.mgmt.batch.models.batch_management_client_enums import \
(AccountKeyType)
+from azure.batch.models.batch_service_client_enums import \
+ (ComputeNodeDeallocationOption)
from azure.cli.core.commands import \
- (register_cli_argument, CliArgumentType)
+ (register_cli_argument, CliArgumentType, register_extra_cli_argument)
from azure.cli.core.commands.parameters import \
(tags_type, location_type, resource_group_name_type,
get_resource_name_completion_list, enum_choice_list, file_type)
-from ._validators import \
- (application_enabled)
+from azure.cli.command_modules.batch._validators import \
+ (application_enabled, datetime_format, storage_account_id, application_package_reference_format,
+ validate_client_parameters, validate_pool_resize_parameters, metadata_item_format,
+ certificate_reference_format, validate_json_file, validate_cert_file,
+ environment_setting_format, validate_cert_settings, resource_file_format, load_node_agent_skus)
# pylint: disable=line-too-long
# ARGUMENT DEFINITIONS
-batch_name_type = CliArgumentType(help='Name of the Batch account.', options_list=('--account_name',), completer=get_resource_name_completion_list('Microsoft.Batch/batchAccounts'), id_part=None)
-
+batch_name_type = CliArgumentType(help='Name of the Batch account.', options_list=('--account-name',), completer=get_resource_name_completion_list('Microsoft.Batch/batchAccounts'), id_part=None)
# PARAMETER REGISTRATIONS
-register_cli_argument('batch', 'account_name', batch_name_type, options_list=('--name', '-n'))
-register_cli_argument('batch', 'resource_group_name', resource_group_name_type, completer=None, validator=None)
-register_cli_argument('batch account create', 'location', location_type)
-register_cli_argument('batch account create', 'tags', tags_type)
+register_cli_argument('batch', 'resource_group_name', resource_group_name_type, help='Name of the resource group', completer=None, validator=None)
+register_cli_argument('batch account', 'account_name', batch_name_type, options_list=('--name', '-n'))
+register_cli_argument('batch account create', 'location', location_type, help='The region in which to create the account.')
+register_cli_argument('batch account create', 'tags', tags_type, help="Space separated tags in 'key[=value]' format.")
+register_extra_cli_argument('batch account create', 'storage_account', help='The storage account name or resource ID to be used for auto storage.', validator=storage_account_id)
register_cli_argument('batch account set', 'tags', tags_type)
+register_extra_cli_argument('batch account set', 'storage_account', help='The storage account name or resource ID to be used for auto storage.', validator=storage_account_id)
register_cli_argument('batch account keys renew', 'key_name', **enum_choice_list(AccountKeyType))
-register_cli_argument('batch application', 'account_name', batch_name_type, options_list=('--name', '-n'), validator=application_enabled)
+register_cli_argument('batch application set', 'application_id', options_list=('--application-id',), help="The ID of the application.")
+register_cli_argument('batch application set', 'allow_updates', options_list=('--allow-updates',), help="Specify to indicate whether packages within the application may be overwritten using the same version string. Specify either 'true' or 'false' to update the property.")
+register_cli_argument('batch application create', 'allow_updates', options_list=('--allow-updates',), action="store_true", help="Specify to indicate whether packages within the application may be overwritten using the same version string. True if flag present.")
register_cli_argument('batch application package create', 'package_file', type=file_type, help='The path of the application package in zip format', completer=FilesCompleter())
-register_cli_argument('batch location quotas show', 'location_name', location_type)
+register_cli_argument('batch application package create', 'application_id', options_list=('--application-id',), help="The ID of the application.")
+register_cli_argument('batch application package create', 'version', options_list=('--version',), help="The version of the application.")
+register_cli_argument('batch location quotas show', 'location_name', location_type, help='The region from which to display the Batch service quotas.')
+
+for command in ['list', 'show', 'create', 'set', 'delete', 'package']:
+ register_cli_argument('batch application {}'.format(command), 'account_name', batch_name_type, options_list=('--name', '-n'), validator=application_enabled)
+
+# TODO: Refactor so the help text can be extracted automatically
+register_cli_argument('batch pool resize', 'if_modified_since', help='The operation will be performed only if the resource has been modified since the specified timestamp.', type=datetime_format, arg_group='Pre-condition and Query')
+register_cli_argument('batch pool resize', 'if_unmodified_since', help='The operation will not be performed only if the resource has been modified since the specified timestamp.', type=datetime_format, arg_group='Pre-condition and Query')
+register_cli_argument('batch pool resize', 'if_match', help='The operation will be performed only if the resource\'s current ETag exactly matches the specified value.', arg_group='Pre-condition and Query')
+register_cli_argument('batch pool resize', 'if_none_match', help='The operation will not be performed only if the resource\'s current ETag exactly matches the specified value.', arg_group='Pre-condition and Query')
+register_cli_argument('batch pool resize', 'pool_id', help='The ID of the pool.')
+register_cli_argument('batch pool resize', 'abort', action='store_true', help='Stop the pool resize operation.', validator=validate_pool_resize_parameters)
+register_cli_argument('batch pool resize', 'node_deallocation_option', options_list=('--node-deallocation-option',), help='When nodes may be removed from the pool, if the pool size is decreasing.', **enum_choice_list(ComputeNodeDeallocationOption))
+
+# TODO: Refactor so the help text can be extracted automatically
+register_cli_argument('batch pool reset', 'json_file', type=file_type, help='The file containing pool update properties parameter specification in JSON format. If this parameter is specified, all \'Pool Update Properties Parameter Arguments\' are ignored.', validator=validate_json_file, completer=FilesCompleter())
+register_cli_argument('batch pool reset', 'pool_id', help='The ID of the pool to update.')
+register_cli_argument('batch pool reset', 'application_package_references', nargs='+', type=application_package_reference_format, arg_group='Pool')
+register_cli_argument('batch pool reset', 'certificate_references', nargs='+', type=certificate_reference_format, arg_group='Pool')
+register_cli_argument('batch pool reset', 'metadata', nargs='+', type=metadata_item_format, arg_group='Pool')
+register_cli_argument('batch pool reset', 'start_task_command_line', arg_group='Pool: Start Task',
+ help='The command line of the start task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.')
+register_cli_argument('batch pool reset', 'start_task_run_elevated', action='store_true', arg_group='Pool: Start Task',
+ help='Whether to run the start task in elevated mode. The default value is false. True if flag present, otherwise defaults to False.')
+register_cli_argument('batch pool reset', 'start_task_wait_for_success', action='store_true', arg_group='Pool: Start Task',
+ 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. True if flag present, otherwise defaults to False.')
+register_cli_argument('batch pool reset', 'start_task_max_task_retry_count', arg_group='Pool: Start Task',
+ help='The maximum number of times the task may be retried.')
+register_cli_argument('batch pool reset', 'start_task_environment_settings', nargs='+', type=environment_setting_format, arg_group='Pool: Start Task',
+ help='A list of environment variable settings for the start task. Space separated values in \'key=value\' format.')
+
+register_cli_argument('batch job list', 'filter', help=' An OData $filter clause.', arg_group='Pre-condition and Query')
+register_cli_argument('batch job list', 'select', help=' An OData $select clause.', arg_group='Pre-condition and Query')
+register_cli_argument('batch job list', 'expand', help=' An OData $expand clause.', arg_group='Pre-condition and Query')
+register_cli_argument('batch job list', 'job_schedule_id', help='The ID of the job schedule from which you want to get a list of jobs. If omitted, lists all jobs in the account.')
+for command in ['job create', 'job set', 'job reset', 'job-schedule create', 'job-schedule set', 'job-schedule reset']:
+ register_cli_argument('batch {}'.format(command), 'pool_id', options_list=('--pool-id',), help='The id of an existing pool. All the tasks of the job will run on the specified pool.')
+
+register_cli_argument('batch pool create', 'os_family', **enum_choice_list(['2', '3', '4', '5']))
+register_extra_cli_argument('batch pool create', 'image', completer=load_node_agent_skus, arg_group="Pool: Virtual Machine Configuration",
+ help="OS image URN in 'publisher:offer:sku[:version]' format. Version is optional and if omitted latest will be used.\n\tValues from 'az batch pool node-agent-skus list'.\n\tExample: 'MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:latest'")
+
+register_cli_argument('batch certificate', 'thumbprint', help='The certificate thumbprint.')
+register_cli_argument('batch certificate show', 'thumbprint', help='The certificate thumbprint.', validator=validate_cert_settings)
+register_cli_argument('batch certificate', 'password', help='The password to access the certificate\'s private key.')
+register_cli_argument('batch certificate', 'certificate_file', type=file_type, help='The certificate file: cer file or pfx file.', validator=validate_cert_file, completer=FilesCompleter())
+register_cli_argument('batch certificate delete', 'abort', action='store_true', help='Cancel the failed certificate deletion operation.')
+
+register_cli_argument('batch task create', 'json_file', type=file_type, help='The file containing the task(s) to create in JSON format, if this parameter is specified, all other parameters are ignored.', validator=validate_json_file, completer=FilesCompleter())
+register_cli_argument('batch task create', 'application_package_references', nargs='+', help='The space separated list of IDs specifying the application packages to be installed. Space separated application IDs with optional version in \'id[#version]\' format.', type=application_package_reference_format)
+register_cli_argument('batch task create', 'job_id', help='The ID of the job containing the task.')
+register_cli_argument('batch task create', 'task_id', help='The ID of the task.')
+register_cli_argument('batch task create', 'command_line', help='The command line of the task. The command line does not run under a shell, and therefore cannot take advantage of shell features such as environment variable expansion. If you want to take advantage of such features, you should invoke the shell in the command line, for example using "cmd /c MyCommand" in Windows or "/bin/sh -c MyCommand" in Linux.')
+register_cli_argument('batch task create', 'environment_settings', nargs='+', help='A list of environment variable settings for the task. Space separated values in \'key=value\' format.', type=environment_setting_format)
+register_cli_argument('batch task create', 'run_elevated', action='store_true', help='Whether to run the task in elevated mode. True if flag present, otherwise defaults to False.')
+register_cli_argument('batch task create', 'resource_files', nargs='+', help='A list of files that the Batch service will download to the compute node before running the command line. Space separated resource references in filename=blobsource format.', type=resource_file_format)
+
+for item in ['batch certificate delete', 'batch certificate create', 'batch pool resize', 'batch pool reset', 'batch job list', 'batch task create']:
+ register_extra_cli_argument(item, 'account_name', arg_group='Batch Account',
+ validator=validate_client_parameters,
+ help='The Batch account name. Alternatively, set by environment variable: AZURE_BATCH_ACCOUNT')
+ register_extra_cli_argument(item, 'account_key', arg_group='Batch Account',
+ help='The Batch account key. Alternatively, set by environment variable: AZURE_BATCH_ACCESS_KEY')
+ register_extra_cli_argument(item, 'account_endpoint', arg_group='Batch Account',
+ help='Batch service endpoint. Alternatively, set by environment variable: AZURE_BATCH_ENDPOINT')
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_validators.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_validators.py
index 6cc45cb9ee2..060456a935e 100644
--- a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_validators.py
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/_validators.py
@@ -3,20 +3,302 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
-from azure.mgmt.batch import BatchManagementClient
+import os
+import json
+
+from six.moves.urllib.parse import urlsplit # pylint: disable=import-error
+
+from msrest.serialization import Deserializer
+from msrest.exceptions import DeserializationError
+
+
+def load_node_agent_skus(prefix, **kwargs): # pylint: disable=unused-argument
+ from msrest.exceptions import ClientRequestError
+ from azure.batch.models import BatchErrorException
+ from azure.cli.command_modules.batch._client_factory import account_client_factory
+ from azure.cli.core._config import az_config
+ all_images = []
+ client_creds = {}
+ client_creds['account_name'] = az_config.get('batch', 'account', None)
+ client_creds['account_key'] = az_config.get('batch', 'access_key', None)
+ client_creds['account_endpoint'] = az_config.get('batch', 'endpoint', None)
+ try:
+ client = account_client_factory(client_creds)
+ skus = client.list_node_agent_skus()
+ for sku in skus:
+ for image in sku['verifiedImageReferences']:
+ all_images.append("{}:{}:{}:{}".format(
+ image['publisher'],
+ image['offer'],
+ image['sku'],
+ image['version']))
+ return all_images
+ except (ClientRequestError, BatchErrorException):
+ return []
+
+
+# TYPES VALIDATORS
+
+def datetime_format(value):
+ """Validate the correct format of a datetime string and deserialize."""
+ try:
+ datetime_obj = Deserializer.deserialize_iso(value)
+ except DeserializationError:
+ message = "Argument {} is not a valid ISO-8601 datetime format"
+ raise ValueError(message.format(value))
+ return datetime_obj
+
+
+def duration_format(value):
+ """Validate the correct format of a timespan string and deserilize."""
+ try:
+ duration_obj = Deserializer.deserialize_duration(value)
+ except DeserializationError:
+ message = "Argument {} is not in a valid ISO-8601 duration format"
+ raise ValueError(message.format(value))
+ return duration_obj
+
+
+def metadata_item_format(value):
+ """Space separated values in 'key=value' format."""
+ try:
+ data_name, data_value = value.split('=')
+ except ValueError:
+ message = ("Incorrectly formatted metadata. "
+ "Argmuent values should be in the format a=b c=d")
+ raise ValueError(message)
+ return {'name': data_name, 'value': data_value}
+
+
+def environment_setting_format(value):
+ """Space separated values in 'key=value' format."""
+ try:
+ env_name, env_value = value.split('=')
+ except ValueError:
+ message = ("Incorrectly formatted enviroment settings. "
+ "Argmuent values should be in the format a=b c=d")
+ raise ValueError(message)
+ return {'name': env_name, 'value': env_value}
+
+
+def application_package_reference_format(value):
+ """Space separated application IDs with optional version in 'id[#version]' format."""
+ app_reference = value.split('#', 1)
+ package = {'application_id': app_reference[0]}
+ try:
+ package['version'] = app_reference[1]
+ except IndexError: # No specified version - ignore
+ pass
+ return package
+
+
+def certificate_reference_format(value):
+ """Space separated certificate thumbprints."""
+ cert = {'thumbprint': value, 'thumbprint_algorithm': 'sha1'}
+ return cert
+
+
+def task_id_ranges_format(value):
+ """Space separated number ranges in 'start-end' format."""
+ try:
+ start, end = [int(i) for i in value.split('-')]
+ except ValueError:
+ message = ("Incorrectly formatted task ID range. "
+ "Argmuent values should be numbers in the format 'start-end'")
+ raise ValueError(message)
+ return {'start': start, 'end': end}
+
+
+def resource_file_format(value):
+ """Space separated resource references in filename=blobsource format."""
+ try:
+ file_name, blob_source = value.split('=')
+ except ValueError:
+ message = ("Incorrectly formatted resource reference. "
+ "Argmuent values should be in the format filename=blobsource")
+ raise ValueError(message)
+ return {'file_path': file_name, 'blob_source': blob_source}
-from azure.cli.core.commands.client_factory import get_mgmt_service_client
# COMMAND NAMESPACE VALIDATORS
+def validate_required_parameter(ns, parser):
+ """Validates required parameters in Batch complex objects"""
+ if not parser.done:
+ parser.parse(ns)
+
+
+def storage_account_id(namespace):
+ """Validate storage account name"""
+ from azure.mgmt.storage import StorageManagementClient
+ from azure.cli.core.commands.client_factory import get_mgmt_service_client
+
+ if (namespace.storage_account and not
+ ('/providers/Microsoft.ClassicStorage/storageAccounts/' in namespace.storage_account or
+ '/providers/Microsoft.Storage/storageAccounts/' in namespace.storage_account)):
+ storage_client = get_mgmt_service_client(StorageManagementClient)
+ acc = storage_client.storage_accounts.get_properties(namespace.resource_group_name,
+ namespace.storage_account)
+ if not acc:
+ raise ValueError("Batch account named '{}' not found in the resource group '{}'.".
+ format(namespace.storage_account, namespace.resource_group_name))
+ namespace.storage_account = acc.id # pylint: disable=no-member
+
+
def application_enabled(namespace):
- """ Validates account has auto-storage enabled"""
+ """Validates account has auto-storage enabled"""
+ from azure.mgmt.batch import BatchManagementClient
+ from azure.cli.core.commands.client_factory import get_mgmt_service_client
client = get_mgmt_service_client(BatchManagementClient)
acc = client.batch_account.get(namespace.resource_group_name, namespace.account_name)
if not acc:
raise ValueError("Batch account '{}' not found.".format(namespace.account_name))
- if not acc.auto_storage or not acc.auto_storage.storage_account_id: #pylint: disable=no-member
+ if not acc.auto_storage or not acc.auto_storage.storage_account_id: # pylint: disable=no-member
raise ValueError("Batch account '{}' needs auto-storage enabled.".
format(namespace.account_name))
+
+def validate_pool_resize_parameters(namespace):
+ """Validate pool resize parameters correct"""
+ if not namespace.abort and not namespace.target_dedicated:
+ raise ValueError("The target-dedicated parameter is required to resize the pool.")
+
+
+def validate_json_file(namespace):
+ """Validate the give json file existing"""
+ if namespace.json_file:
+ try:
+ with open(namespace.json_file) as file_handle:
+ json.load(file_handle)
+ except EnvironmentError:
+ raise ValueError("Cannot access JSON request file: " + namespace.json_file)
+ except ValueError as err:
+ raise ValueError("Invalid JSON file: {}".format(err))
+
+
+def validate_cert_file(namespace):
+ """Validate the give cert file existing"""
+ try:
+ with open(namespace.certificate_file, "rb"):
+ pass
+ except EnvironmentError:
+ raise ValueError("Cannot access certificate file: " + namespace.certificate_file)
+
+
+def validate_options(namespace):
+ """Validate any flattened request header option arguments."""
+ try:
+ start = namespace.start_range
+ end = namespace.end_range
+ except AttributeError:
+ return
+ else:
+ namespace.ocp_range = None
+ del namespace.start_range
+ del namespace.end_range
+ if start or end:
+ start = start if start else 0
+ end = end if end else ""
+ namespace.ocp_range = "bytes={}-{}".format(start, end)
+
+
+def validate_file_destination(namespace):
+ """Validate the destination path for a file download."""
+ try:
+ path = namespace.destination
+ except AttributeError:
+ return
+ else:
+ # TODO: Need to confirm this logic...
+ file_path = path
+ file_dir = os.path.dirname(path)
+ if os.path.isdir(path):
+ file_name = os.path.basename(namespace.file_name)
+ file_path = os.path.join(path, file_name)
+ elif not os.path.isdir(file_dir):
+ try:
+ os.mkdir(file_dir)
+ except EnvironmentError as exp:
+ message = "Directory {} does not exist, and cannot be created: {}"
+ raise ValueError(message.format(file_dir, exp))
+ if os.path.isfile(file_path):
+ raise ValueError("File {} already exists.".format(file_path))
+ namespace.destination = file_path
+
+
+def validate_client_parameters(namespace):
+ """Retrieves Batch connection parameters from environment variables"""
+ from azure.mgmt.batch import BatchManagementClient
+ from azure.cli.core.commands.client_factory import get_mgmt_service_client
+ from azure.cli.core._config import az_config
+
+ # simply try to retrieve the remaining variables from environment variables
+ if not namespace.account_name:
+ namespace.account_name = az_config.get('batch', 'account', None)
+ if not namespace.account_key:
+ namespace.account_key = az_config.get('batch', 'access_key', None)
+ if not namespace.account_endpoint:
+ namespace.account_endpoint = az_config.get('batch', 'endpoint', None)
+
+ # if account name is specified but no key, attempt to query
+ if namespace.account_name and namespace.account_endpoint and not namespace.account_key:
+ endpoint = urlsplit(namespace.account_endpoint)
+ host = endpoint.netloc
+ client = get_mgmt_service_client(BatchManagementClient)
+ acc = next((x for x in client.batch_account.list()
+ if x.name == namespace.account_name and x.account_endpoint == host), None)
+ if acc:
+ from azure.cli.core.commands.arm import parse_resource_id
+ rg = parse_resource_id(acc.id)['resource_group']
+ namespace.account_key = \
+ client.batch_account.get_keys(rg, namespace.account_name).primary # pylint: disable=no-member
+ else:
+ raise ValueError("Batch account '{}' not found.".format(namespace.account_name))
+ else:
+ if not namespace.account_name:
+ raise ValueError("Need specifiy batch account in command line or enviroment variable.")
+ if not namespace.account_endpoint:
+ raise ValueError("Need specifiy batch endpoint in command line or enviroment variable.")
+
+# CUSTOM REQUEST VALIDATORS
+
+
+def validate_pool_settings(ns, parser):
+ """Custom parsing to enfore that either PaaS or IaaS instances are configured
+ in the add pool request body.
+ """
+ if not ns.json_file:
+ if ns.node_agent_sku_id and not ns.image:
+ raise ValueError("Missing required argument: --image")
+ if ns.image:
+ ns.version = 'latest'
+ try:
+ ns.publisher, ns.offer, ns.sku = ns.image.split(':', 2)
+ except ValueError:
+ message = ("Incorrect format for VM image URN. Should be in the format: \n"
+ "'publisher:offer:sku[:version]'")
+ raise ValueError(message)
+ try:
+ ns.sku, ns.version = ns.sku.split(':', 1)
+ except ValueError:
+ pass
+ del ns.image
+ groups = ['pool.cloud_service_configuration', 'pool.virtual_machine_configuration']
+ parser.parse_mutually_exclusive(ns, True, groups)
+
+ paas_sizes = ['small', 'medium', 'large', 'extralarge']
+ if ns.vm_size and ns.vm_size.lower() in paas_sizes and not ns.os_family:
+ message = ("The selected VM size is incompatible with Virtual Machine Configuration. "
+ "Please swap for the equivalent: Standard_A1 (small), Standard_A2 "
+ "(medium), Standard_A3 (large), or Standard_A4 (extra large).")
+ raise ValueError(message)
+ if ns.auto_scale_formula:
+ ns.enable_auto_scale = True
+
+
+def validate_cert_settings(ns):
+ """Custom parsing for certificate commands - adds default thumbprint
+ algorithm.
+ """
+ ns.thumbprint_algorithm = 'sha1'
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/commands.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/commands.py
index a85480f35e4..3127323ae54 100644
--- a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/commands.py
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/commands.py
@@ -5,7 +5,24 @@
from azure.cli.core.commands import cli_command
-from ._client_factory import batch_client_factory
+from azure.cli.command_modules.batch._command_type import cli_batch_data_plane_command
+from azure.cli.command_modules.batch._validators import (
+ validate_pool_settings, validate_cert_settings)
+from azure.cli.command_modules.batch._client_factory import (
+ account_mgmt_client_factory,
+ account_client_factory,
+ application_mgmt_client_factory,
+ application_package_client_factory,
+ application_client_factory,
+ certificate_client_factory,
+ compute_node_client_factory,
+ file_client_factory,
+ job_client_factory,
+ job_schedule_client_factory,
+ location_client_factory,
+ pool_client_factory,
+ task_client_factory)
+
data_path = 'azure.batch.operations.{}_operations#{}'
custom_path = 'azure.cli.command_modules.batch.custom#{}'
@@ -14,32 +31,129 @@
# pylint: disable=line-too-long
# Mgmt Account Operations
-factory = lambda args: batch_client_factory(**args).batch_account
-cli_command(__name__, 'batch account list', custom_path.format('list_accounts'), factory)
-cli_command(__name__, 'batch account show', mgmt_path.format('batch_account', 'BatchAccountOperations.get'), factory)
-cli_command(__name__, 'batch account create', custom_path.format('create_account'), factory)
-cli_command(__name__, 'batch account set', custom_path.format('update_account'), factory)
-cli_command(__name__, 'batch account delete', mgmt_path.format('batch_account', 'BatchAccountOperations.delete'), factory)
-cli_command(__name__, 'batch account autostorage-keys sync', mgmt_path.format('batch_account', 'BatchAccountOperations.synchronize_auto_storage_keys'), factory)
+cli_command(__name__, 'batch account list', custom_path.format('list_accounts'), account_mgmt_client_factory)
+cli_command(__name__, 'batch account show', mgmt_path.format('batch_account', 'BatchAccountOperations.get'), account_mgmt_client_factory)
+cli_command(__name__, 'batch account create', custom_path.format('create_account'), account_mgmt_client_factory)
+cli_command(__name__, 'batch account set', custom_path.format('update_account'), account_mgmt_client_factory)
+cli_command(__name__, 'batch account delete', mgmt_path.format('batch_account', 'BatchAccountOperations.delete'), account_mgmt_client_factory, confirmation=True)
+cli_command(__name__, 'batch account autostorage-keys sync', mgmt_path.format('batch_account', 'BatchAccountOperations.synchronize_auto_storage_keys'), account_mgmt_client_factory)
+cli_command(__name__, 'batch account keys list', mgmt_path.format('batch_account', 'BatchAccountOperations.get_keys'), account_mgmt_client_factory)
+cli_command(__name__, 'batch account keys renew', mgmt_path.format('batch_account', 'BatchAccountOperations.regenerate_key'), account_mgmt_client_factory)
+
+cli_command(__name__, 'batch application list', mgmt_path.format('application', 'ApplicationOperations.list'), application_mgmt_client_factory)
+cli_command(__name__, 'batch application show', mgmt_path.format('application', 'ApplicationOperations.get'), application_mgmt_client_factory)
+cli_command(__name__, 'batch application create', mgmt_path.format('application', 'ApplicationOperations.create'), application_mgmt_client_factory)
+cli_command(__name__, 'batch application set', custom_path.format('update_application'), application_mgmt_client_factory)
+cli_command(__name__, 'batch application delete', mgmt_path.format('application', 'ApplicationOperations.delete'), application_mgmt_client_factory, confirmation=True)
+
+cli_command(__name__, 'batch application package create', custom_path.format('create_application_package'), application_package_client_factory)
+cli_command(__name__, 'batch application package delete', mgmt_path.format('application_package', 'ApplicationPackageOperations.delete'), application_package_client_factory, confirmation=True)
+cli_command(__name__, 'batch application package show', mgmt_path.format('application_package', 'ApplicationPackageOperations.get'), application_package_client_factory)
+cli_command(__name__, 'batch application package activate', mgmt_path.format('application_package', 'ApplicationPackageOperations.activate'), application_package_client_factory)
+
+cli_command(__name__, 'batch location quotas show', mgmt_path.format('location', 'LocationOperations.get_quotas'), location_client_factory)
+
+# Data Plane Commands
+
+cli_batch_data_plane_command('batch application summary list', data_path.format('application', 'ApplicationOperations.list'), application_client_factory)
+cli_batch_data_plane_command('batch application summary show', data_path.format('application', 'ApplicationOperations.get'), application_client_factory)
+
+cli_batch_data_plane_command('batch pool node-agent-skus list', data_path.format('account', 'AccountOperations.list_node_agent_skus'), account_client_factory)
+
+cli_command(__name__, 'batch certificate create', custom_path.format('create_certificate'), certificate_client_factory)
+cli_command(__name__, 'batch certificate delete', custom_path.format('delete_certificate'), certificate_client_factory, confirmation=True)
+cli_batch_data_plane_command('batch certificate show', data_path.format('certificate', 'CertificateOperations.get'), certificate_client_factory, validator=validate_cert_settings)
+cli_batch_data_plane_command('batch certificate list', data_path.format('certificate', 'CertificateOperations.list'), certificate_client_factory)
-cli_command(__name__, 'batch account keys list', mgmt_path.format('batch_account', 'BatchAccountOperations.get_keys'), factory)
-cli_command(__name__, 'batch account keys renew', mgmt_path.format('batch_account', 'BatchAccountOperations.regenerate_key'), factory)
+cli_batch_data_plane_command('batch pool usage-metrics list', data_path.format('pool', 'PoolOperations.list_pool_usage_metrics'), pool_client_factory)
+cli_batch_data_plane_command('batch pool all-statistics show', data_path.format('pool', 'PoolOperations.get_all_pools_lifetime_statistics'), pool_client_factory)
+cli_batch_data_plane_command('batch pool create', data_path.format('pool', 'PoolOperations.add'), pool_client_factory, validator=validate_pool_settings,
+ ignore=['pool.cloud_service_configuration.current_os_version', 'pool.virtual_machine_configuration.windows_configuration',
+ 'pool.auto_scale_evaluation_interval', 'pool.enable_auto_scale', 'pool.max_tasks_per_node', 'pool.network_configuration',
+ 'pool.cloud_service_configuration.target_os_version', 'pool.task_scheduling_policy',
+ 'pool.start_task.max_task_retry_count', 'pool.start_task.environment_settings'], silent=['pool.virtual_machine_configuration.image_reference'])
+cli_batch_data_plane_command('batch pool list', data_path.format('pool', 'PoolOperations.list'), pool_client_factory)
+cli_batch_data_plane_command('batch pool delete', data_path.format('pool', 'PoolOperations.delete'), pool_client_factory)
+cli_batch_data_plane_command('batch pool show', data_path.format('pool', 'PoolOperations.get'), pool_client_factory)
+cli_batch_data_plane_command('batch pool set', data_path.format('pool', 'PoolOperations.patch'), pool_client_factory)
+cli_command(__name__, 'batch pool reset', custom_path.format('update_pool'), pool_client_factory)
+cli_batch_data_plane_command('batch pool autoscale disable', data_path.format('pool', 'PoolOperations.disable_auto_scale'), pool_client_factory)
+cli_batch_data_plane_command('batch pool autoscale enable', data_path.format('pool', 'PoolOperations.enable_auto_scale'), pool_client_factory)
+cli_batch_data_plane_command('batch pool autoscale evaluate', data_path.format('pool', 'PoolOperations.evaluate_auto_scale'), pool_client_factory)
+cli_command(__name__, 'batch pool resize', custom_path.format('resize_pool'), pool_client_factory)
+cli_batch_data_plane_command('batch pool os upgrade', data_path.format('pool', 'PoolOperations.upgrade_os'), pool_client_factory)
+cli_batch_data_plane_command('batch node delete', data_path.format('pool', 'PoolOperations.remove_nodes'), pool_client_factory)
+cli_batch_data_plane_command('batch job all-statistics show', data_path.format('job', 'JobOperations.get_all_jobs_lifetime_statistics'), job_client_factory)
+cli_batch_data_plane_command('batch job create', data_path.format('job', 'JobOperations.add'), job_client_factory,
+ ignore=['job.job_preparation_task', 'job.job_release_task', 'job.pool_info.auto_pool_specification', 'job.on_task_failure',
+ 'job.job_manager_task.kill_job_on_completion', 'job.common_environment_settings', 'job.on_all_tasks_complete',
+ 'job.job_manager_task.run_exclusive', 'job.job_manager_task.constraints', 'job.job_manager_task.application_package_references'])
+cli_batch_data_plane_command('batch job delete', data_path.format('job', 'JobOperations.delete'), job_client_factory)
+cli_batch_data_plane_command('batch job show', data_path.format('job', 'JobOperations.get'), job_client_factory)
+cli_batch_data_plane_command('batch job set', data_path.format('job', 'JobOperations.patch'), job_client_factory, flatten=2)
+cli_batch_data_plane_command('batch job reset', data_path.format('job', 'JobOperations.update'), job_client_factory, flatten=2)
+cli_command(__name__, 'batch job list', custom_path.format('list_job'), job_client_factory)
+cli_batch_data_plane_command('batch job disable', data_path.format('job', 'JobOperations.disable'), job_client_factory)
+cli_batch_data_plane_command('batch job enable', data_path.format('job', 'JobOperations.enable'), job_client_factory)
+cli_batch_data_plane_command('batch job stop', data_path.format('job', 'JobOperations.terminate'), job_client_factory)
+cli_batch_data_plane_command('batch job prep-release-status list', data_path.format('job', 'JobOperations.list_preparation_and_release_task_status'), job_client_factory)
-factory = lambda args: batch_client_factory(**args).application
-cli_command(__name__, 'batch application list', mgmt_path.format('application', 'ApplicationOperations.list'), factory)
-cli_command(__name__, 'batch application show', mgmt_path.format('application', 'ApplicationOperations.get'), factory)
-cli_command(__name__, 'batch application create', mgmt_path.format('application', 'ApplicationOperations.create'), factory)
-cli_command(__name__, 'batch application set', custom_path.format('update_application'), factory)
-cli_command(__name__, 'batch application delete', mgmt_path.format('application', 'ApplicationOperations.delete'), factory)
+cli_batch_data_plane_command('batch job-schedule create', data_path.format('job_schedule', 'JobScheduleOperations.add'), job_schedule_client_factory,
+ ignore=['cloud_job_schedule.job_specification.job_preparation_task',
+ 'cloud_job_schedule.job_specification.job_release_task', 'cloud_job_schedule.job_specification.metadata',
+ 'cloud_job_schedule.job_specification.job_manager_task.kill_job_on_completion',
+ 'cloud_job_schedule.job_specification.job_manager_task.run_exclusive',
+ 'cloud_job_schedule.job_specification.job_manager_task.application_package_references',
+ 'cloud_job_schedule.job_specification.job_manager_task.environment_settings'])
+cli_batch_data_plane_command('batch job-schedule delete', data_path.format('job_schedule', 'JobScheduleOperations.delete'), job_schedule_client_factory)
+cli_batch_data_plane_command('batch job-schedule show', data_path.format('job_schedule', 'JobScheduleOperations.get'), job_schedule_client_factory)
+cli_batch_data_plane_command('batch job-schedule set', data_path.format('job_schedule', 'JobScheduleOperations.patch'), job_schedule_client_factory,
+ ignore=['job_schedule_patch_parameter.job_specification.job_preparation_task',
+ 'job_schedule_patch_parameter.job_specification.job_release_task',
+ 'job_schedule_patch_parameter.job_specification.constraints',
+ 'job_schedule_patch_parameter.job_specification.job_manager_task.kill_job_on_completion',
+ 'job_schedule_patch_parameter.job_specification.job_manager_task.run_exclusive',
+ 'job_schedule_patch_parameter.job_specification.job_manager_task.constraints'])
+cli_batch_data_plane_command('batch job-schedule reset', data_path.format('job_schedule', 'JobScheduleOperations.update'), job_schedule_client_factory,
+ ignore=['job_schedule_update_parameter.job_specification.job_preparation_task',
+ 'job_schedule_update_parameter.job_specification.job_release_task',
+ 'job_schedule_update_parameter.job_specification.constraints',
+ 'job_schedule_update_parameter.job_specification.job_manager_task.kill_job_on_completion',
+ 'job_schedule_update_parameter.job_specification.job_manager_task.run_exclusive',
+ 'job_schedule_update_parameter.job_specification.job_manager_task.constraints'])
+cli_batch_data_plane_command('batch job-schedule disable', data_path.format('job_schedule', 'JobScheduleOperations.disable'), job_schedule_client_factory)
+cli_batch_data_plane_command('batch job-schedule enable', data_path.format('job_schedule', 'JobScheduleOperations.enable'), job_schedule_client_factory)
+cli_batch_data_plane_command('batch job-schedule stop', data_path.format('job_schedule', 'JobScheduleOperations.terminate'), job_schedule_client_factory)
+cli_batch_data_plane_command('batch job-schedule list', data_path.format('job_schedule', 'JobScheduleOperations.list'), job_schedule_client_factory)
+cli_command(__name__, 'batch task create', custom_path.format('create_task'), task_client_factory)
+cli_batch_data_plane_command('batch task list', data_path.format('task', 'TaskOperations.list'), task_client_factory)
+cli_batch_data_plane_command('batch task delete', data_path.format('task', 'TaskOperations.delete'), task_client_factory)
+cli_batch_data_plane_command('batch task show', data_path.format('task', 'TaskOperations.get'), task_client_factory)
+cli_batch_data_plane_command('batch task reset', data_path.format('task', 'TaskOperations.update'), task_client_factory)
+cli_batch_data_plane_command('batch task reactivate', data_path.format('task', 'TaskOperations.reactivate'), task_client_factory)
+cli_batch_data_plane_command('batch task stop', data_path.format('task', 'TaskOperations.terminate'), task_client_factory)
+cli_batch_data_plane_command('batch task subtask list', data_path.format('task', 'TaskOperations.list_subtasks'), task_client_factory)
-factory = lambda args: batch_client_factory(**args).application_package
-cli_command(__name__, 'batch application package create', custom_path.format('create_application_package'), factory)
-cli_command(__name__, 'batch application package delete', mgmt_path.format('application_package', 'ApplicationPackageOperations.delete'), factory)
-cli_command(__name__, 'batch application package show', mgmt_path.format('application_package', 'ApplicationPackageOperations.get'), factory)
-cli_command(__name__, 'batch application package activate', mgmt_path.format('application_package', 'ApplicationPackageOperations.activate'), factory)
+cli_batch_data_plane_command('batch task file delete', data_path.format('file', 'FileOperations.delete_from_task'), file_client_factory)
+cli_batch_data_plane_command('batch task file download', data_path.format('file', 'FileOperations.get_from_task'), file_client_factory)
+cli_batch_data_plane_command('batch task file show', data_path.format('file', 'FileOperations.get_node_file_properties_from_task'), file_client_factory)
+cli_batch_data_plane_command('batch task file list', data_path.format('file', 'FileOperations.list_from_task'), file_client_factory)
+cli_batch_data_plane_command('batch node user create', data_path.format('compute_node', 'ComputeNodeOperations.add_user'), compute_node_client_factory)
+cli_batch_data_plane_command('batch node user delete', data_path.format('compute_node', 'ComputeNodeOperations.delete_user'), compute_node_client_factory)
+cli_batch_data_plane_command('batch node user reset', data_path.format('compute_node', 'ComputeNodeOperations.update_user'), compute_node_client_factory)
+cli_batch_data_plane_command('batch node show', data_path.format('compute_node', 'ComputeNodeOperations.get'), compute_node_client_factory)
+cli_batch_data_plane_command('batch node list', data_path.format('compute_node', 'ComputeNodeOperations.list'), compute_node_client_factory)
+cli_batch_data_plane_command('batch node reboot', data_path.format('compute_node', 'ComputeNodeOperations.reboot'), compute_node_client_factory)
+cli_batch_data_plane_command('batch node reimage', data_path.format('compute_node', 'ComputeNodeOperations.reimage'), compute_node_client_factory)
+cli_batch_data_plane_command('batch node scheduling disable', data_path.format('compute_node', 'ComputeNodeOperations.disable_scheduling'), compute_node_client_factory)
+cli_batch_data_plane_command('batch node scheduling enable', data_path.format('compute_node', 'ComputeNodeOperations.enable_scheduling'), compute_node_client_factory)
+cli_batch_data_plane_command('batch node remote-login-settings show', data_path.format('compute_node', 'ComputeNodeOperations.get_remote_login_settings'), compute_node_client_factory)
+cli_batch_data_plane_command('batch node remote-desktop download', data_path.format('compute_node', 'ComputeNodeOperations.get_remote_desktop'), compute_node_client_factory)
-factory = lambda args: batch_client_factory(**args).location
-cli_command(__name__, 'batch location quotas show', mgmt_path.format('location', 'LocationOperations.get_quotas'), factory)
+cli_batch_data_plane_command('batch node file delete', data_path.format('file', 'FileOperations.delete_from_compute_node'), file_client_factory)
+cli_batch_data_plane_command('batch node file download', data_path.format('file', 'FileOperations.get_from_compute_node'), file_client_factory)
+cli_batch_data_plane_command('batch node file show', data_path.format('file', 'FileOperations.get_node_file_properties_from_compute_node'), file_client_factory)
+cli_batch_data_plane_command('batch node file list', data_path.format('file', 'FileOperations.list_from_compute_node'), file_client_factory)
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/custom.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/custom.py
index 31a266c12c2..a7d360e9fa1 100644
--- a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/custom.py
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/custom.py
@@ -3,34 +3,53 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
-try:
- from urllib.parse import urlsplit
-except ImportError:
- from urlparse import urlsplit # pylint: disable=import-error
+import json
+import base64
+from six.moves.urllib.parse import urlsplit # pylint: disable=import-error
+from msrest.exceptions import DeserializationError, ValidationError, ClientRequestError
+from azure.mgmt.batch import BatchManagementClient
from azure.mgmt.batch.models import (BatchAccountCreateParameters,
AutoStorageBaseProperties,
UpdateApplicationParameters)
from azure.mgmt.batch.operations import (ApplicationPackageOperations)
+
+from azure.batch.models import (CertificateAddParameter, PoolStopResizeOptions, PoolResizeParameter,
+ PoolResizeOptions, JobListOptions, JobListFromJobScheduleOptions,
+ TaskAddParameter, TaskConstraints, PoolUpdatePropertiesParameter,
+ StartTask, BatchErrorException)
+
from azure.storage.blob import BlockBlobService
+from azure.cli.core._util import CLIError
+from azure.cli.core.commands.client_factory import get_mgmt_service_client
import azure.cli.core.azlogging as azlogging
logger = azlogging.get_az_logger(__name__)
+
+def transfer_doc(source_func, *additional_source_funcs):
+ def _decorator(func):
+ func.__doc__ = source_func.__doc__
+ for f in additional_source_funcs:
+ func.__doc__ += "\n" + f.__doc__
+ return func
+ return _decorator
+
+
+# Mgmt custom commands
+
def list_accounts(client, resource_group_name=None):
acct_list = client.list_by_resource_group(resource_group_name=resource_group_name) \
if resource_group_name else client.list()
return list(acct_list)
-def create_account(client, resource_group_name, account_name, location, #pylint:disable=too-many-arguments
- tags=None, storage_account_id=None):
- # TODO: get storage_account_id by search storage account name
- if storage_account_id:
- properties = AutoStorageBaseProperties(storage_account_id=storage_account_id)
- else:
- properties = None
+@transfer_doc(AutoStorageBaseProperties)
+def create_account(client, resource_group_name, account_name, location, # pylint:disable=too-many-arguments
+ tags=None, storage_account=None):
+ properties = AutoStorageBaseProperties(storage_account_id=storage_account) \
+ if storage_account else None
parameters = BatchAccountCreateParameters(location=location,
tags=tags,
auto_storage=properties)
@@ -39,23 +58,21 @@ def create_account(client, resource_group_name, account_name, location, #pylint:
account_name=account_name,
parameters=parameters)
-create_account.__doc__ = AutoStorageBaseProperties.__doc__
-def update_account(client, resource_group_name, account_name, #pylint:disable=too-many-arguments
- tags=None, storage_account_id=None):
- if storage_account_id:
- properties = AutoStorageBaseProperties(storage_account_id=storage_account_id)
- else:
- properties = None
+@transfer_doc(AutoStorageBaseProperties)
+def update_account(client, resource_group_name, account_name, # pylint:disable=too-many-arguments
+ tags=None, storage_account=None):
+ properties = AutoStorageBaseProperties(storage_account_id=storage_account) \
+ if storage_account else None
return client.update(resource_group_name=resource_group_name,
account_name=account_name,
tags=tags,
auto_storage=properties)
-update_account.__doc__ = AutoStorageBaseProperties.__doc__
-def update_application(client, resource_group_name, account_name, application_id, #pylint:disable=too-many-arguments
+@transfer_doc(UpdateApplicationParameters)
+def update_application(client, resource_group_name, account_name, application_id, # pylint:disable=too-many-arguments
allow_updates=None, display_name=None, default_version=None):
parameters = UpdateApplicationParameters(allow_updates=allow_updates,
display_name=display_name,
@@ -65,7 +82,6 @@ def update_application(client, resource_group_name, account_name, application_id
application_id=application_id,
parameters=parameters)
-update_application.__doc__ = UpdateApplicationParameters.__doc__
def _upload_package_blob(package_file, url):
"""Upload the location file to storage url provided by autostorage"""
@@ -90,11 +106,199 @@ def _upload_package_blob(package_file, url):
file_path=package_file,
)
-def create_application_package(client, resource_group_name, account_name, #pylint:disable=too-many-arguments
+
+@transfer_doc(ApplicationPackageOperations.create)
+def create_application_package(client, resource_group_name, account_name, # pylint:disable=too-many-arguments
application_id, version, package_file):
+
+ # create application if not exist
+ mgmt_client = get_mgmt_service_client(BatchManagementClient)
+ try:
+ mgmt_client.application.get(resource_group_name, account_name, application_id)
+ except Exception: # pylint:disable=broad-except
+ mgmt_client.application.create(resource_group_name, account_name, application_id)
+
result = client.create(resource_group_name, account_name, application_id, version)
+
+ # upload binary as application package
logger.info('Uploading %s to storage blob %s...', package_file, result.storage_url)
_upload_package_blob(package_file, result.storage_url)
- return result
-create_application_package.__doc__ = ApplicationPackageOperations.create.__doc__
+ # activate the application package
+ client.activate(resource_group_name, account_name, application_id, version, "zip")
+ return client.get(resource_group_name, account_name, application_id, version)
+
+
+# Data plane custom commands
+
+def _handle_batch_exception(action):
+ try:
+ return action()
+ except BatchErrorException as ex:
+ try:
+ message = ex.error.message.value
+ if ex.error.values:
+ for detail in ex.error.values:
+ message += "\n{}: {}".format(detail.key, detail.value)
+ raise CLIError(message)
+ except AttributeError:
+ raise CLIError(ex)
+ except (ValidationError, ClientRequestError) as ex:
+ raise CLIError(ex)
+
+
+@transfer_doc(CertificateAddParameter)
+def create_certificate(client, certificate_file, thumbprint, password=None):
+ thumbprint_algorithm = 'sha1'
+
+ def action():
+ client.add(cert)
+ return client.get(thumbprint_algorithm, thumbprint)
+
+ certificate_format = 'pfx' if password else 'cer'
+ with open(certificate_file, "rb") as f:
+ data_bytes = f.read()
+ data = base64.b64encode(data_bytes).decode('utf-8')
+ cert = CertificateAddParameter(thumbprint, thumbprint_algorithm, data,
+ certificate_format=certificate_format,
+ password=password)
+ return _handle_batch_exception(action)
+
+
+def delete_certificate(client, thumbprint, abort=False):
+ thumbprint_algorithm = 'sha1'
+
+ def action():
+ if abort:
+ client.cancel_deletion(thumbprint_algorithm, thumbprint)
+ else:
+ client.delete(thumbprint_algorithm, thumbprint)
+
+ return _handle_batch_exception(action)
+
+
+@transfer_doc(PoolResizeParameter)
+def resize_pool(client, pool_id, target_dedicated=None, # pylint:disable=too-many-arguments
+ resize_timeout=None, node_deallocation_option=None,
+ if_match=None, if_none_match=None, if_modified_since=None,
+ if_unmodified_since=None, abort=False):
+ def action():
+ if abort:
+ stop_resize_option = PoolStopResizeOptions(if_match=if_match,
+ if_none_match=if_none_match,
+ if_modified_since=if_modified_since,
+ if_unmodified_since=if_unmodified_since)
+ return client.stop_resize(pool_id, pool_stop_resize_options=stop_resize_option)
+ else:
+ param = PoolResizeParameter(target_dedicated,
+ resize_timeout=resize_timeout,
+ node_deallocation_option=node_deallocation_option)
+ resize_option = PoolResizeOptions(if_match=if_match,
+ if_none_match=if_none_match,
+ if_modified_since=if_modified_since,
+ if_unmodified_since=if_unmodified_since)
+ return client.resize(pool_id, param, pool_resize_options=resize_option)
+
+ return _handle_batch_exception(action)
+
+
+@transfer_doc(PoolUpdatePropertiesParameter, StartTask)
+def update_pool(client, pool_id, json_file=None, start_task_command_line=None, # pylint:disable=too-many-arguments
+ certificate_references=None, application_package_references=None, metadata=None,
+ start_task_run_elevated=None, start_task_environment_settings=None,
+ start_task_wait_for_success=None, start_task_max_task_retry_count=None):
+ def action():
+ client.update_properties(pool_id=pool_id, pool_update_properties_parameter=param)
+ return client.get(pool_id)
+
+ if json_file:
+ with open(json_file) as f:
+ json_obj = json.load(f)
+ param = None
+ try:
+ param = client._deserialize('PoolUpdatePropertiesParameter', json_obj) # pylint: disable=protected-access
+ except DeserializationError:
+ pass
+ if not param:
+ raise ValueError("JSON file '{}' is not in correct format.".format(json_file))
+
+ if param.certificate_references is None:
+ param.certificate_references = []
+ if param.metadata is None:
+ param.metadata = []
+ if param.application_package_references is None:
+ param.application_package_references = []
+ else:
+ if certificate_references is None:
+ certificate_references = []
+ if metadata is None:
+ metadata = []
+ if application_package_references is None:
+ application_package_references = []
+ param = PoolUpdatePropertiesParameter(certificate_references,
+ application_package_references,
+ metadata)
+
+ if start_task_command_line:
+ param.start_task = StartTask(start_task_command_line,
+ environment_settings=start_task_environment_settings,
+ run_elevated=start_task_run_elevated,
+ wait_for_success=start_task_wait_for_success,
+ max_task_retry_count=start_task_max_task_retry_count)
+ return _handle_batch_exception(action)
+
+
+def list_job(client, job_schedule_id=None, filter=None, select=None, expand=None): # pylint: disable=redefined-builtin
+ def action():
+ if job_schedule_id:
+ option1 = JobListFromJobScheduleOptions(filter=filter,
+ select=select,
+ expand=expand)
+ return list(client.list_from_job_schedule(job_schedule_id=job_schedule_id,
+ job_list_from_job_schedule_options=option1))
+ else:
+ option2 = JobListOptions(filter=filter,
+ select=select,
+ expand=expand)
+ return list(client.list(job_list_options=option2))
+
+ return _handle_batch_exception(action)
+
+
+@transfer_doc(TaskAddParameter, TaskConstraints)
+def create_task(client, job_id, json_file=None, task_id=None, command_line=None, # pylint:disable=too-many-arguments
+ resource_files=None, environment_settings=None, affinity_info=None,
+ max_wall_clock_time=None, retention_time=None, max_task_retry_count=None,
+ run_elevated=None, application_package_references=None):
+ def action():
+ if task is not None:
+ client.add(job_id=job_id, task=task)
+ return client.get(job_id=job_id, task_id=task.id)
+ else:
+ result = client.add_collection(job_id=job_id, value=tasks)
+ return result.value
+
+ task = None
+ if json_file:
+ with open(json_file) as f:
+ json_obj = json.load(f)
+ try:
+ task = client._deserialize('TaskAddParameter', json_obj) # pylint: disable=protected-access
+ except DeserializationError:
+ try:
+ tasks = client._deserialize('[TaskAddParameter]', json_obj) # pylint: disable=protected-access
+ except DeserializationError:
+ raise ValueError("JSON file '{}' is not in reqired format.".format(json_file))
+ else:
+ task = TaskAddParameter(task_id, command_line,
+ resource_files=resource_files,
+ environment_settings=environment_settings,
+ affinity_info=affinity_info,
+ run_elevated=run_elevated,
+ application_package_references=application_package_references)
+ if max_wall_clock_time is not None or retention_time is not None \
+ or max_task_retry_count is not None:
+ task.constraints = TaskConstraints(max_wall_clock_time=max_wall_clock_time,
+ retention_time=retention_time,
+ max_task_retry_count=max_task_retry_count)
+ return _handle_batch_exception(action)
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/README.md b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/README.md
new file mode 100644
index 00000000000..c5b211f4635
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/README.md
@@ -0,0 +1,10 @@
+###Setup Instructions
+
+- If recording, set the following environment variables. In playback mode, the account name and url will be read from the recorded file instead, and the key will be set to a default value.
+ * AZURE_BATCH_ACCOUNT: The name of the Batch account you're using for recording.
+ * AZURE_BATCH_ACCESS_KEY: The key for the Batch account.
+ * AZURE_BATCH_ENDPOINT: The url of the account.
+- If recording, create the common test pool and wait for it to reach steady state.
+ * Run the following command from the root to create the shared pool: "az batch pool create --json-file batchCreateTestPool.json"
+ * Wait for the pool to reach active state, steady allocation state, and to have 3 VMs: "az batch pool show xplatTestPool"
+ * Some tests may change the size of the pool, so double check that you still have 3 VMs before recording again.
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batch-pool-create-invalid.json b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batch-pool-create-invalid.json
new file mode 100644
index 00000000000..83bec8562c3
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batch-pool-create-invalid.json
@@ -0,0 +1,16 @@
+{
+ "id": "azure-cli-test-json",
+ "vmSize": "small",
+ "cloudServiceConfiguration": {
+ "osFamily": "4",
+ "targetOSVersion": "*"
+ }
+ "targetDedicated": 2,
+ "resizeTimeout": "PT15M",
+ "environmentSettings": [
+ {
+ "name": "TEST_ENV",
+ "value": "TEST_VALUE"
+ },
+ ]
+}
\ No newline at end of file
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batch-pool-create.json b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batch-pool-create.json
new file mode 100644
index 00000000000..58625e7b17a
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batch-pool-create.json
@@ -0,0 +1,20 @@
+{
+ "id": "azure-cli-test-json",
+ "vmSize": "small",
+ "cloudServiceConfiguration": {
+ "osFamily": "4",
+ "targetOSVersion": "*"
+ },
+ "targetDedicated": 2,
+ "resizeTimeout": "PT15M",
+ "environmentSettings": [
+ {
+ "name": "TEST_ENV",
+ "value": "TEST_VALUE"
+ }
+ ],
+ "startTask": {
+ "commandLine": "cmd /c echo test",
+ "waitForSuccess": true
+ }
+}
\ No newline at end of file
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batch-pool-update.json b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batch-pool-update.json
new file mode 100644
index 00000000000..29a37bafb88
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batch-pool-update.json
@@ -0,0 +1,9 @@
+{
+ "startTask": {
+ "commandLine": "cmd /c echo updated",
+ "waitForSuccess": true
+ },
+ "certificateReferences": {},
+ "metadata": {},
+ "applicationPackageReferences": {}
+}
\ No newline at end of file
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateJob.json b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateJob.json
new file mode 100644
index 00000000000..b4436a6934d
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateJob.json
@@ -0,0 +1,103 @@
+{
+ "id": "xplatJob",
+ "displayName": "displayName",
+ "priority": 1,
+ "constraints": {
+ "maxWallClockTime": "P1D",
+ "maxTaskRetryCount": 5
+ },
+ "jobManagerTask": {
+ "id": "jobManager",
+ "displayName": "jobManagerDisplay",
+ "commandLine": "cmd /c dir /s",
+ "resourceFiles": [
+ {
+ "blobSource": "https://testacct.blob.core.windows.net/",
+ "filePath": "filePath"
+ }
+ ],
+ "environmentSettings": [
+ {
+ "name": "name1",
+ "value": "value1"
+ },
+ {
+ "name": "name2",
+ "value": "value2"
+ }
+ ],
+ "constraints": {
+ "maxWallClockTime": "PT1H"
+ },
+ "killJobOnCompletion": false,
+ "runElevated": false
+ },
+ "jobPreparationTask": {
+ "id": "jobPrep",
+ "commandLine": "cmd /c dir /s",
+ "resourceFiles": [
+ {
+ "blobSource": "https://testacct.blob.core.windows.net/",
+ "filePath": "jobPrepFilePath"
+ }
+ ],
+ "environmentSettings": [
+ {
+ "name": "jobPrepName1",
+ "value": "jobPrepValue1"
+ },
+ {
+ "name": "jobPrepName2",
+ "value": "jobPrepValue2"
+ }
+ ],
+ "constraints": {
+ "maxTaskRetryCount": 2
+ },
+ "runElevated": false
+ },
+ "jobReleaseTask": {
+ "id": "jobRelease",
+ "commandLine": "cmd /c dir /s",
+ "resourceFiles": [
+ {
+ "blobSource": "https://testacct.blob.core.windows.net/",
+ "filePath": "jobReleaseFilePath"
+ }
+ ],
+ "environmentSettings": [
+ {
+ "name": "jobReleaseName1",
+ "value": "jobReleaseValue1"
+ },
+ {
+ "name": "jobReleaseName2",
+ "value": "jobReleaseValue2"
+ }
+ ],
+ "runElevated": false
+ },
+ "commonEnvironmentSettings": [
+ {
+ "name": "commonName1",
+ "value": "commonValue1"
+ },
+ {
+ "name": "commonName2",
+ "value": "commonValue2"
+ }
+ ],
+ "poolInfo": {
+ "poolId": "xplatTestPool"
+ },
+ "metadata": [
+ {
+ "name": "specMeta1",
+ "value": "specMetaValue1"
+ },
+ {
+ "name": "specMeta2",
+ "value": "specMetaValue2"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateJobForTaskTests.json b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateJobForTaskTests.json
new file mode 100644
index 00000000000..a110e2247d4
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateJobForTaskTests.json
@@ -0,0 +1,32 @@
+{
+ "id": "xplatJobForTaskTests",
+ "displayName": "displayName",
+ "priority": 1,
+ "constraints": {
+ "maxWallClockTime": "P1D",
+ "maxTaskRetryCount": 5
+ },
+ "commonEnvironmentSettings": [
+ {
+ "name": "commonName1",
+ "value": "commonValue1"
+ },
+ {
+ "name": "commonName2",
+ "value": "commonValue2"
+ }
+ ],
+ "poolInfo": {
+ "poolId": "xplatTestPool"
+ },
+ "metadata": [
+ {
+ "name": "specMeta1",
+ "value": "specMetaValue1"
+ },
+ {
+ "name": "specMeta2",
+ "value": "specMetaValue2"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateJobScheduleForJobTests.json b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateJobScheduleForJobTests.json
new file mode 100644
index 00000000000..0ace672bcab
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateJobScheduleForJobTests.json
@@ -0,0 +1,145 @@
+{
+ "id": "xplatJobScheduleJobTests",
+ "displayName": "displayName",
+ "schedule": {
+ "recurrenceInterval": "P2D"
+ },
+ "jobSpecification": {
+ "priority": 1,
+ "displayName": "jobSpecDisplayName",
+ "constraints": {
+ "maxWallClockTime": "P1D",
+ "maxTaskRetryCount": 5
+ },
+ "jobManagerTask": {
+ "id": "jobManager",
+ "displayName": "jobManagerDisplay",
+ "commandLine": "cmd /c dir /s",
+ "resourceFiles": [
+ {
+ "blobSource": "https://testacct.blob.core.windows.net/",
+ "filePath": "filePath"
+ }
+ ],
+ "environmentSettings": [
+ {
+ "name": "name1",
+ "value": "value1"
+ },
+ {
+ "name": "name2",
+ "value": "value2"
+ }
+ ],
+ "constraints": {
+ "maxWallClockTime": "PT1H"
+ },
+ "killJobOnCompletion": false,
+ "runElevated": false
+ },
+ "jobPreparationTask": {
+ "id": "jobPrep",
+ "commandLine": "cmd /c dir /s",
+ "resourceFiles": [
+ {
+ "blobSource": "https://testacct.blob.core.windows.net/",
+ "filePath": "jobPrepFilePath"
+ }
+ ],
+ "environmentSettings": [
+ {
+ "name": "jobPrepName1",
+ "value": "jobPrepValue1"
+ },
+ {
+ "name": "jobPrepName2",
+ "value": "jobPrepValue2"
+ }
+ ],
+ "constraints": {
+ "maxTaskRetryCount": 2
+ },
+ "runElevated": false
+ },
+ "jobReleaseTask": {
+ "id": "jobRelease",
+ "commandLine": "cmd /c dir /s",
+ "resourceFiles": [
+ {
+ "blobSource": "https://testacct.blob.core.windows.net/",
+ "filePath": "jobReleaseFilePath"
+ }
+ ],
+ "environmentSettings": [
+ {
+ "name": "jobReleaseName1",
+ "value": "jobReleaseValue1"
+ },
+ {
+ "name": "jobReleaseName2",
+ "value": "jobReleaseValue2"
+ }
+ ],
+ "runElevated": false
+ },
+ "commonEnvironmentSettings": [
+ {
+ "name": "commonName1",
+ "value": "commonValue1"
+ },
+ {
+ "name": "commonName2",
+ "value": "commonValue2"
+ }
+ ],
+ "poolInfo": {
+ "autoPoolSpecification": {
+ "autoPoolIdPrefix": "TestSpecPrefix",
+ "poolLifetimeOption": "jobschedule",
+ "keepAlive": false,
+ "pool": {
+ "vmSize": "small",
+ "cloudServiceConfiguration": {
+ "osFamily": "4",
+ "targetOSVersion": "*"
+ },
+ "targetDedicated": 3,
+ "startTask": {
+ "commandLine": "cmd /c dir /s"
+ },
+ "certificateReferences": [
+ {
+ "thumbprint": "0123456789ABCDEF",
+ "thumbprintAlgorithm": "sha1",
+ "storeLocation": "localmachine",
+ "storeName": "certStore",
+ "visibility": [
+ "starttask"
+ ]
+ }
+ ]
+ }
+ }
+ },
+ "metadata": [
+ {
+ "name": "specMeta1",
+ "value": "specMetaValue1"
+ },
+ {
+ "name": "specMeta2",
+ "value": "specMetaValue2"
+ }
+ ]
+ },
+ "metadata": [
+ {
+ "name": "meta2",
+ "value": "value2"
+ },
+ {
+ "name": "meta1",
+ "value": "value1"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateMultiTasks.json b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateMultiTasks.json
new file mode 100644
index 00000000000..7e23fd85c6a
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateMultiTasks.json
@@ -0,0 +1,45 @@
+[{
+ "id": "xplatTask1",
+ "displayName": "displayName",
+ "commandLine": "cmd /c dir /s",
+ "constraints": {
+ "maxWallClockTime": "P1D",
+ "maxTaskRetryCount": 2
+ },
+ "environmentSettings": [
+ {
+ "name": "env1",
+ "value": "value1"
+ },
+ {
+ "name": "env2",
+ "value": "value2"
+ }
+ ],
+ "runElevated": false
+},
+{
+ "id": "xplatTask2",
+ "displayName": "displayName1",
+ "commandLine": "cmd /c dir /s",
+ "constraints": {
+ "maxWallClockTime": "P1D",
+ "maxTaskRetryCount": 2
+ },
+ "runElevated": false
+},
+{
+ "id": "xplatTask3",
+ "displayName": "displayName2",
+ "commandLine": "cmd /c dir /s",
+ "environmentSettings": [
+ {
+ "name": "env1",
+ "value": "value1"
+ },
+ {
+ "name": "env2",
+ "value": "value2"
+ }
+ ]
+}]
\ No newline at end of file
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreatePool.json b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreatePool.json
new file mode 100644
index 00000000000..73b1551e801
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreatePool.json
@@ -0,0 +1,13 @@
+{
+ "id": "xplatCreatedPool",
+ "vmSize": "small",
+ "cloudServiceConfiguration": {
+ "osFamily": "4",
+ "targetOSVersion": "*"
+ },
+ "targetDedicated": 0,
+ "startTask": {
+ "commandLine": "cmd /c echo test",
+ "waitForSuccess": true
+ }
+}
\ No newline at end of file
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateTask.json b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateTask.json
new file mode 100644
index 00000000000..a2d382ce5b9
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateTask.json
@@ -0,0 +1,24 @@
+{
+ "id": "xplatTask",
+ "displayName": "displayName",
+ "commandLine": "cmd /c dir /s",
+ "constraints": {
+ "maxWallClockTime": "P1D",
+ "maxTaskRetryCount": 2
+ },
+ "environmentSettings": [
+ {
+ "name": "env1",
+ "value": "value1"
+ },
+ {
+ "name": "env2",
+ "value": "value2"
+ }
+ ],
+ "multiInstanceSettings": {
+ "numberOfInstances": 3,
+ "coordinationCommandLine": "cmd /c echo hello"
+ },
+ "runElevated": false
+}
\ No newline at end of file
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateTestPool.json b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateTestPool.json
new file mode 100644
index 00000000000..16fc1acf2a4
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchCreateTestPool.json
@@ -0,0 +1,14 @@
+{
+ "id": "xplatTestPool",
+ "vmSize": "small",
+ "cloudServiceConfiguration": {
+ "osFamily": "4",
+ "targetOSVersion": "*"
+ },
+ "targetDedicated": 3,
+ "enableInterNodeCommunication": true,
+ "startTask": {
+ "commandLine": "cmd /c echo test",
+ "waitForSuccess": true
+ }
+}
\ No newline at end of file
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchUpdatePool.json b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchUpdatePool.json
new file mode 100644
index 00000000000..29a37bafb88
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchUpdatePool.json
@@ -0,0 +1,9 @@
+{
+ "startTask": {
+ "commandLine": "cmd /c echo updated",
+ "waitForSuccess": true
+ },
+ "certificateReferences": {},
+ "metadata": {},
+ "applicationPackageReferences": {}
+}
\ No newline at end of file
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchtest.cer b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchtest.cer
new file mode 100644
index 00000000000..3cc58ce320a
Binary files /dev/null and b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/data/batchtest.cer differ
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_account_mgmt.yaml b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_account_mgmt.yaml
index 1b7ab5b32de..9bd3d46e769 100644
--- a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_account_mgmt.yaml
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_account_mgmt.yaml
@@ -1,33 +1,32 @@
interactions:
- request:
- body: !!python/unicode '{"sku": {"name": "Standard_LRS"}, "kind": "Storage", "location":
- "brazilsouth"}'
+ body: '{"location": "brazilsouth", "kind": "Storage", "sku": {"name": "Standard_LRS"}}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['79']
Content-Type: [application/json; charset=utf-8]
- User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
- msrest/0.4.4 msrest_azure/0.4.5 storagemanagementclient/0.30.0rc6 Azure-SDK-For-Python
- AZURECLI/TEST/0.1.0b11+dev]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 storagemanagementclient/0.31.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
accept-language: [en-US]
- x-ms-client-request-id: [10e80561-d467-11e6-8f8d-24be0520f64e]
+ x-ms-client-request-id: [1305379e-e359-11e6-9151-24be0520f64e]
method: PUT
- uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage2?api-version=2016-12-01
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage3?api-version=2016-12-01
response:
- body: {string: !!python/unicode ''}
+ body: {string: ''}
headers:
- cache-control: [no-cache]
- content-length: ['0']
- date: ['Fri, 06 Jan 2017 23:23:03 GMT']
- expires: ['-1']
- location: ['https://management.azure.com/subscriptions/f30ef677-64a9-4768-934f-5fbbc0e1ad27/providers/Microsoft.Storage/operations/6e123242-ea94-4817-a57f-1855a726bba1?monitor=true&api-version=2016-01-01']
- pragma: [no-cache]
- retry-after: ['17']
- server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
- strict-transport-security: [max-age=31536000; includeSubDomains]
- x-ms-ratelimit-remaining-subscription-writes: ['1198']
+ Cache-Control: [no-cache]
+ Content-Length: ['0']
+ Date: ['Wed, 25 Jan 2017 23:50:41 GMT']
+ Expires: ['-1']
+ Location: ['https://management.azure.com/subscriptions/f30ef677-64a9-4768-934f-5fbbc0e1ad27/providers/Microsoft.Storage/operations/ba7d4ede-60d0-497e-a0b6-a328da7dd7a5?monitor=true&api-version=2016-12-01']
+ Pragma: [no-cache]
+ Retry-After: ['17']
+ Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 202, message: Accepted}
- request:
body: null
@@ -36,58 +35,58 @@ interactions:
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
- User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
- msrest/0.4.4 msrest_azure/0.4.5 storagemanagementclient/0.30.0rc6 Azure-SDK-For-Python
- AZURECLI/TEST/0.1.0b11+dev]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 storagemanagementclient/0.31.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
accept-language: [en-US]
- x-ms-client-request-id: [10e80561-d467-11e6-8f8d-24be0520f64e]
+ x-ms-client-request-id: [1305379e-e359-11e6-9151-24be0520f64e]
method: GET
- uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/operations/6e123242-ea94-4817-a57f-1855a726bba1?monitor=true&api-version=2016-01-01
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Storage/operations/ba7d4ede-60d0-497e-a0b6-a328da7dd7a5?monitor=true&api-version=2016-12-01
response:
- body: {string: !!python/unicode '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage2","kind":"Storage","location":"brazilsouth","name":"clibatchteststorage2","properties":{"creationTime":"2017-01-06T23:23:03.2561606Z","primaryEndpoints":{"blob":"https://clibatchteststorage2.blob.core.windows.net/","file":"https://clibatchteststorage2.file.core.windows.net/","queue":"https://clibatchteststorage2.queue.core.windows.net/","table":"https://clibatchteststorage2.table.core.windows.net/"},"primaryLocation":"brazilsouth","provisioningState":"Succeeded","statusOfPrimary":"available"},"sku":{"name":"Standard_LRS","tier":"Standard"},"tags":{},"type":"Microsoft.Storage/storageAccounts"}
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage3","kind":"Storage","location":"brazilsouth","name":"clibatchteststorage3","properties":{"creationTime":"2017-01-25T23:50:41.6775141Z","primaryEndpoints":{"blob":"https://clibatchteststorage3.blob.core.windows.net/","file":"https://clibatchteststorage3.file.core.windows.net/","queue":"https://clibatchteststorage3.queue.core.windows.net/","table":"https://clibatchteststorage3.table.core.windows.net/"},"primaryLocation":"brazilsouth","provisioningState":"Succeeded","statusOfPrimary":"available","supportsHttpsTrafficOnly":false},"sku":{"name":"Standard_LRS","tier":"Standard"},"tags":{},"type":"Microsoft.Storage/storageAccounts"}
'}
headers:
- cache-control: [no-cache]
- content-length: ['757']
- content-type: [application/json]
- date: ['Fri, 06 Jan 2017 23:23:20 GMT']
- expires: ['-1']
- pragma: [no-cache]
- server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
- strict-transport-security: [max-age=31536000; includeSubDomains]
- transfer-encoding: [chunked]
- vary: [Accept-Encoding]
+ Cache-Control: [no-cache]
+ Content-Type: [application/json]
+ Date: ['Wed, 25 Jan 2017 23:50:58 GMT']
+ Expires: ['-1']
+ Pragma: [no-cache]
+ Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ Vary: [Accept-Encoding]
+ content-length: ['790']
status: {code: 200, message: OK}
- request:
- body: !!python/unicode '{"location": "brazilsouth"}'
+ body: '{"location": "brazilsouth"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['27']
Content-Type: [application/json; charset=utf-8]
- User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
- msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
- AZURECLI/TEST/0.1.0b11+dev]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
accept-language: [en-US]
- x-ms-client-request-id: [1def226e-d467-11e6-9f62-24be0520f64e]
+ x-ms-client-request-id: [2004938c-e359-11e6-b029-24be0520f64e]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4?api-version=2015-12-01
response:
- body: {string: !!python/unicode ''}
+ body: {string: ''}
headers:
- cache-control: [no-cache]
- content-length: ['0']
- date: ['Fri, 06 Jan 2017 23:23:26 GMT']
- expires: ['-1']
- location: ['https://management.azure.com/subscriptions/f30ef677-64a9-4768-934f-5fbbc0e1ad27/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4/operationResults/07e991fb-a8ae-48cc-938d-73be4382a1f3?api-version=2015-12-01']
- pragma: [no-cache]
- request-id: [07e991fb-a8ae-48cc-938d-73be4382a1f3]
- retry-after: ['15']
- server: [Microsoft-HTTPAPI/2.0]
- strict-transport-security: [max-age=31536000; includeSubDomains]
- x-content-type-options: [nosniff]
+ Cache-Control: [no-cache]
+ Content-Length: ['0']
+ Date: ['Wed, 25 Jan 2017 23:51:04 GMT']
+ Expires: ['-1']
+ Location: ['https://management.azure.com/subscriptions/f30ef677-64a9-4768-934f-5fbbc0e1ad27/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4/operationResults/2905fb06-af85-400d-b2f0-f8d9f0fb4ae7?api-version=2015-12-01']
+ Pragma: [no-cache]
+ Retry-After: ['15']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ X-Content-Type-Options: [nosniff]
+ request-id: [2905fb06-af85-400d-b2f0-f8d9f0fb4ae7]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 202, message: Accepted}
- request:
@@ -97,63 +96,93 @@ interactions:
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
- User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
- msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
- AZURECLI/TEST/0.1.0b11+dev]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
accept-language: [en-US]
- x-ms-client-request-id: [1def226e-d467-11e6-9f62-24be0520f64e]
+ x-ms-client-request-id: [2004938c-e359-11e6-b029-24be0520f64e]
method: GET
- uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4/operationResults/07e991fb-a8ae-48cc-938d-73be4382a1f3?api-version=2015-12-01
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4/operationResults/2905fb06-af85-400d-b2f0-f8d9f0fb4ae7?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"name":"clibatchtest4","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest4.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4","type":"Microsoft.Batch/batchAccounts"}'}
+ body: {string: '{"name":"clibatchtest4","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest4.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4","type":"Microsoft.Batch/batchAccounts"}'}
headers:
- cache-control: [no-cache]
+ Cache-Control: [no-cache]
+ Content-Type: [application/json; charset=utf-8]
+ Date: ['Wed, 25 Jan 2017 23:51:23 GMT']
+ ETag: ['0x8D4457D10EF30A5']
+ Expires: ['-1']
+ Last-Modified: ['Wed, 25 Jan 2017 23:51:22 GMT']
+ Pragma: [no-cache]
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ Vary: [Accept-Encoding]
+ X-Content-Type-Options: [nosniff]
content-length: ['408']
- content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 23:23:42 GMT']
- etag: ['0x8D4368B0E0F840E']
- expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 23:23:43 GMT']
- pragma: [no-cache]
- request-id: [87602ea3-6c3f-42d8-b087-a15f33738462]
- server: [Microsoft-HTTPAPI/2.0]
- strict-transport-security: [max-age=31536000; includeSubDomains]
- transfer-encoding: [chunked]
- vary: [Accept-Encoding]
- x-content-type-options: [nosniff]
+ request-id: [fc1feb61-33b2-45db-81d5-ecb696cd7eb0]
status: {code: 200, message: OK}
- request:
- body: !!python/unicode '{"properties": {"autoStorage": {"storageAccountId": "/subscriptions/f30ef677-64a9-4768-934f-5fbbc0e1ad27/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage2"}}}'
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 storagemanagementclient/0.31.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
+ accept-language: [en-US]
+ x-ms-client-request-id: [2e3fabdc-e359-11e6-9205-24be0520f64e]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage3?api-version=2016-12-01
+ response:
+ body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage3","kind":"Storage","location":"brazilsouth","name":"clibatchteststorage3","properties":{"creationTime":"2017-01-25T23:50:41.6775141Z","primaryEndpoints":{"blob":"https://clibatchteststorage3.blob.core.windows.net/","file":"https://clibatchteststorage3.file.core.windows.net/","queue":"https://clibatchteststorage3.queue.core.windows.net/","table":"https://clibatchteststorage3.table.core.windows.net/"},"primaryLocation":"brazilsouth","provisioningState":"Succeeded","statusOfPrimary":"available","supportsHttpsTrafficOnly":false},"sku":{"name":"Standard_LRS","tier":"Standard"},"tags":{},"type":"Microsoft.Storage/storageAccounts"}
+
+ '}
+ headers:
+ Cache-Control: [no-cache]
+ Content-Type: [application/json]
+ Date: ['Wed, 25 Jan 2017 23:51:24 GMT']
+ Expires: ['-1']
+ Pragma: [no-cache]
+ Server: [Microsoft-Azure-Storage-Resource-Provider/1.0, Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ Vary: [Accept-Encoding]
+ content-length: ['790']
+ status: {code: 200, message: OK}
+- request:
+ body: '{"properties": {"autoStorage": {"storageAccountId": "/subscriptions/f30ef677-64a9-4768-934f-5fbbc0e1ad27/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage3"}}}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['207']
Content-Type: [application/json; charset=utf-8]
- User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
- msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
- AZURECLI/TEST/0.1.0b11+dev]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
accept-language: [en-US]
- x-ms-client-request-id: [2aca7491-d467-11e6-b687-24be0520f64e]
+ x-ms-client-request-id: [2e8c4734-e359-11e6-ac1f-24be0520f64e]
method: PATCH
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"name":"clibatchtest4","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest4.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage2","lastKeySync":"2017-01-06T23:23:46.7908008Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4","type":"Microsoft.Batch/batchAccounts"}'}
+ body: {string: '{"name":"clibatchtest4","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest4.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage3","lastKeySync":"2017-01-25T23:51:27.9139039Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4","type":"Microsoft.Batch/batchAccounts"}'}
headers:
- cache-control: [no-cache]
+ Cache-Control: [no-cache]
+ Content-Type: [application/json; charset=utf-8]
+ Date: ['Wed, 25 Jan 2017 23:51:27 GMT']
+ ETag: ['0x8D4457D141AFA3E']
+ Expires: ['-1']
+ Last-Modified: ['Wed, 25 Jan 2017 23:51:27 GMT']
+ Pragma: [no-cache]
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ Vary: [Accept-Encoding]
+ X-Content-Type-Options: [nosniff]
content-length: ['641']
- content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 23:23:47 GMT']
- etag: ['0x8D4368B1060FBF1']
- expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 23:23:46 GMT']
- pragma: [no-cache]
- request-id: [b3b091e5-9498-4b7b-bc67-22fe5e10fa25]
- server: [Microsoft-HTTPAPI/2.0]
- strict-transport-security: [max-age=31536000; includeSubDomains]
- transfer-encoding: [chunked]
- vary: [Accept-Encoding]
- x-content-type-options: [nosniff]
+ request-id: [52b9ebf5-b71b-4247-b347-2abc1a23bcd5]
x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 200, message: OK}
- request:
@@ -163,30 +192,30 @@ interactions:
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
- User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
- msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
- AZURECLI/TEST/0.1.0b11+dev]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
accept-language: [en-US]
- x-ms-client-request-id: [2d8a09c0-d467-11e6-93bd-24be0520f64e]
+ x-ms-client-request-id: [313d20f6-e359-11e6-990b-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"name":"clibatchtest4","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest4.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage2","lastKeySync":"2017-01-06T23:23:46.7908008Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4","type":"Microsoft.Batch/batchAccounts"}'}
+ body: {string: '{"name":"clibatchtest4","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest4.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage3","lastKeySync":"2017-01-25T23:51:27.9139039Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4","type":"Microsoft.Batch/batchAccounts"}'}
headers:
- cache-control: [no-cache]
+ Cache-Control: [no-cache]
+ Content-Type: [application/json; charset=utf-8]
+ Date: ['Wed, 25 Jan 2017 23:51:30 GMT']
+ ETag: ['0x8D4457D15DAAB25']
+ Expires: ['-1']
+ Last-Modified: ['Wed, 25 Jan 2017 23:51:30 GMT']
+ Pragma: [no-cache]
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ Vary: [Accept-Encoding]
+ X-Content-Type-Options: [nosniff]
content-length: ['641']
- content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 23:23:49 GMT']
- etag: ['0x8D4368B117B7F3B']
- expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 23:23:48 GMT']
- pragma: [no-cache]
- request-id: [295dbeaa-d03a-4133-b713-dc4bd20347d7]
- server: [Microsoft-HTTPAPI/2.0]
- strict-transport-security: [max-age=31536000; includeSubDomains]
- transfer-encoding: [chunked]
- vary: [Accept-Encoding]
- x-content-type-options: [nosniff]
+ request-id: [2eec541c-0664-4494-a3e7-647917b6af3e]
status: {code: 200, message: OK}
- request:
body: null
@@ -196,26 +225,26 @@ interactions:
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
- User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
- msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
- AZURECLI/TEST/0.1.0b11+dev]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
accept-language: [en-US]
- x-ms-client-request-id: [2ec262b0-d467-11e6-8c92-24be0520f64e]
+ x-ms-client-request-id: [32ba06b6-e359-11e6-8680-24be0520f64e]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4/syncAutoStorageKeys?api-version=2015-12-01
response:
- body: {string: !!python/unicode ''}
+ body: {string: ''}
headers:
- cache-control: [no-cache]
- content-length: ['0']
- date: ['Fri, 06 Jan 2017 23:23:52 GMT']
- expires: ['-1']
- pragma: [no-cache]
- request-id: [77de3562-c75a-419f-94ad-f37ab95e851f]
- server: [Microsoft-HTTPAPI/2.0]
- strict-transport-security: [max-age=31536000; includeSubDomains]
- x-content-type-options: [nosniff]
- x-ms-ratelimit-remaining-subscription-writes: ['1198']
+ Cache-Control: [no-cache]
+ Content-Length: ['0']
+ Date: ['Wed, 25 Jan 2017 23:51:35 GMT']
+ Expires: ['-1']
+ Pragma: [no-cache]
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ X-Content-Type-Options: [nosniff]
+ request-id: [575ad14b-66d8-45f3-8d85-0757f85e8e2c]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 204, message: No Content}
- request:
body: null
@@ -225,60 +254,60 @@ interactions:
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
- User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
- msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
- AZURECLI/TEST/0.1.0b11+dev]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
accept-language: [en-US]
- x-ms-client-request-id: [305cb1c0-d467-11e6-a080-24be0520f64e]
+ x-ms-client-request-id: [3536d6d2-e359-11e6-acc2-24be0520f64e]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4/listKeys?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"accountName":"clibatchtest4","primary":"HmQYx7OceyBtjCl1+6IhsxdsAfY3tWI+G2xE6rdgKjiHvA+W3E3pVVk90atKXE2qyEy1yxg6+uEqJ8PgPYm5QQ==","secondary":"CiHgMGfCOFowhV05TmgOzftmpCehwUIrYBL2yQEOmMrGPibQ3AxZIjJSQTjCUHbkHGWCJogT8kYZIl+MJoIgiA=="}'}
+ body: {string: '{"accountName":"clibatchtest4","primary":"Qg0xIFeI8H//GLLy1xy2B+dC+bZueRYs47GYo66NY1FuIYyTGMN/adBv+nTqRIh/Qgoy65+yiDzXmwidWhbl4Q==","secondary":"D/PFHL6jIXRZZXcRen1zRmIZkBMGLFNWMZYZYG3mTZm8ichveNbZMRqrmsOJXSG9iAQoh8sQVT52hlnUvrYoFQ=="}'}
headers:
- cache-control: [no-cache]
+ Cache-Control: [no-cache]
+ Content-Type: [application/json; charset=utf-8]
+ Date: ['Wed, 25 Jan 2017 23:51:38 GMT']
+ Expires: ['-1']
+ Pragma: [no-cache]
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ Vary: [Accept-Encoding]
+ X-Content-Type-Options: [nosniff]
content-length: ['235']
- content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 23:23:54 GMT']
- expires: ['-1']
- pragma: [no-cache]
- request-id: [c902a290-dcf3-4598-b76b-0bfaf51cb7d6]
- server: [Microsoft-HTTPAPI/2.0]
- strict-transport-security: [max-age=31536000; includeSubDomains]
- transfer-encoding: [chunked]
- vary: [Accept-Encoding]
- x-content-type-options: [nosniff]
- x-ms-ratelimit-remaining-subscription-writes: ['1197']
+ request-id: [275a5890-9fb7-4ca6-939a-004740468401]
+ x-ms-ratelimit-remaining-subscription-writes: ['1198']
status: {code: 200, message: OK}
- request:
- body: !!python/unicode '{"keyName": "Primary"}'
+ body: '{"keyName": "Primary"}'
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['22']
Content-Type: [application/json; charset=utf-8]
- User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
- msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
- AZURECLI/TEST/0.1.0b11+dev]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
accept-language: [en-US]
- x-ms-client-request-id: [317d15e1-d467-11e6-af60-24be0520f64e]
+ x-ms-client-request-id: [377319d8-e359-11e6-bee2-24be0520f64e]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4/regenerateKeys?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"accountName":"clibatchtest4","primary":"zkMBM5/dK+d6ONy733iEdiXsDn2Ka6A1tG5KHJtIXSTMVSH8rfBuapC9v99cV3N+6OwD/bgHbOMdqTALq+MiIA==","secondary":"CiHgMGfCOFowhV05TmgOzftmpCehwUIrYBL2yQEOmMrGPibQ3AxZIjJSQTjCUHbkHGWCJogT8kYZIl+MJoIgiA=="}'}
+ body: {string: '{"accountName":"clibatchtest4","primary":"PYy8nEyQIZn5C/qKxhxX6+6+cJV3KPP3F+AUu3+22AA2gnH9FOswYIhOLgY2aLQHSQTlT8s+ihq0OIaiTW0w4A==","secondary":"D/PFHL6jIXRZZXcRen1zRmIZkBMGLFNWMZYZYG3mTZm8ichveNbZMRqrmsOJXSG9iAQoh8sQVT52hlnUvrYoFQ=="}'}
headers:
- cache-control: [no-cache]
+ Cache-Control: [no-cache]
+ Content-Type: [application/json; charset=utf-8]
+ Date: ['Wed, 25 Jan 2017 23:51:48 GMT']
+ Expires: ['-1']
+ Pragma: [no-cache]
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ Vary: [Accept-Encoding]
+ X-Content-Type-Options: [nosniff]
content-length: ['235']
- content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 23:23:55 GMT']
- expires: ['-1']
- pragma: [no-cache]
- request-id: [e69765ed-e1a2-4ca0-a28f-9f88961f2b88]
- server: [Microsoft-HTTPAPI/2.0]
- strict-transport-security: [max-age=31536000; includeSubDomains]
- transfer-encoding: [chunked]
- vary: [Accept-Encoding]
- x-content-type-options: [nosniff]
+ request-id: [eed30d65-9dbc-4b46-a4c6-736877e21ac4]
x-ms-ratelimit-remaining-subscription-writes: ['1198']
status: {code: 200, message: OK}
- request:
@@ -289,28 +318,28 @@ interactions:
Connection: [keep-alive]
Content-Length: ['0']
Content-Type: [application/json; charset=utf-8]
- User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
- msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
- AZURECLI/TEST/0.1.0b11+dev]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
accept-language: [en-US]
- x-ms-client-request-id: [321f9770-d467-11e6-a6b3-24be0520f64e]
+ x-ms-client-request-id: [3ce5488a-e359-11e6-8188-24be0520f64e]
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4?api-version=2015-12-01
response:
- body: {string: !!python/unicode ''}
+ body: {string: ''}
headers:
- cache-control: [no-cache]
- content-length: ['0']
- date: ['Fri, 06 Jan 2017 23:23:59 GMT']
- expires: ['-1']
- location: ['https://management.azure.com/subscriptions/f30ef677-64a9-4768-934f-5fbbc0e1ad27/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4/operationResults/42f0b019-009f-4e60-85b8-76924ce29856?api-version=2015-12-01']
- pragma: [no-cache]
- request-id: [42f0b019-009f-4e60-85b8-76924ce29856]
- retry-after: ['15']
- server: [Microsoft-HTTPAPI/2.0]
- strict-transport-security: [max-age=31536000; includeSubDomains]
- x-content-type-options: [nosniff]
- x-ms-ratelimit-remaining-subscription-writes: ['1198']
+ Cache-Control: [no-cache]
+ Content-Length: ['0']
+ Date: ['Wed, 25 Jan 2017 23:51:51 GMT']
+ Expires: ['-1']
+ Location: ['https://management.azure.com/subscriptions/f30ef677-64a9-4768-934f-5fbbc0e1ad27/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4/operationResults/957a8ebd-3f1e-463e-8395-5678e586a642?api-version=2015-12-01']
+ Pragma: [no-cache]
+ Retry-After: ['15']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ X-Content-Type-Options: [nosniff]
+ request-id: [957a8ebd-3f1e-463e-8395-5678e586a642]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 202, message: Accepted}
- request:
body: null
@@ -319,27 +348,27 @@ interactions:
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
- User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
- msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
- AZURECLI/TEST/0.1.0b11+dev]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
accept-language: [en-US]
- x-ms-client-request-id: [321f9770-d467-11e6-a6b3-24be0520f64e]
+ x-ms-client-request-id: [3ce5488a-e359-11e6-8188-24be0520f64e]
method: GET
- uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4/operationResults/42f0b019-009f-4e60-85b8-76924ce29856?api-version=2015-12-01
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest4/operationResults/957a8ebd-3f1e-463e-8395-5678e586a642?api-version=2015-12-01
response:
- body: {string: !!python/unicode ''}
+ body: {string: ''}
headers:
- cache-control: [no-cache]
- content-length: ['0']
- date: ['Fri, 06 Jan 2017 23:24:14 GMT']
- etag: ['0x8D4368B20A3AF65']
- expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 23:24:14 GMT']
- pragma: [no-cache]
- request-id: [0f17951a-a414-47d1-ac6e-30b255b365d4]
- server: [Microsoft-HTTPAPI/2.0]
- strict-transport-security: [max-age=31536000; includeSubDomains]
- x-content-type-options: [nosniff]
+ Cache-Control: [no-cache]
+ Content-Length: ['0']
+ Date: ['Wed, 25 Jan 2017 23:52:08 GMT']
+ ETag: ['0x8D4457D2BEF70B5']
+ Expires: ['-1']
+ Last-Modified: ['Wed, 25 Jan 2017 23:52:07 GMT']
+ Pragma: [no-cache]
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ X-Content-Type-Options: [nosniff]
+ request-id: [3f18a609-f8aa-42bb-8a36-4f97b594f2e2]
status: {code: 200, message: OK}
- request:
body: null
@@ -348,28 +377,24 @@ interactions:
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
- User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
- msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
- AZURECLI/TEST/0.1.0b11+dev]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
accept-language: [en-US]
- x-ms-client-request-id: [3dc74b8f-d467-11e6-8d2f-24be0520f64e]
+ x-ms-client-request-id: [4945c852-e359-11e6-8a06-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"value":[]}'}
+ body: {string: '{"value":[]}'}
headers:
- cache-control: [no-cache]
+ Cache-Control: [no-cache]
+ Content-Type: [application/json; charset=utf-8]
+ Date: ['Wed, 25 Jan 2017 23:52:09 GMT']
+ Expires: ['-1']
+ Pragma: [no-cache]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Vary: [Accept-Encoding]
content-length: ['12']
- content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 23:24:15 GMT']
- expires: ['-1']
- pragma: [no-cache]
- request-id: [813e4491-8606-4cf7-9f19-f9e34f5c1e9b]
- server: [Microsoft-HTTPAPI/2.0]
- strict-transport-security: [max-age=31536000; includeSubDomains]
- transfer-encoding: [chunked]
- vary: [Accept-Encoding]
- x-content-type-options: [nosniff]
status: {code: 200, message: OK}
- request:
body: null
@@ -378,27 +403,27 @@ interactions:
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
- User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
- msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
- AZURECLI/TEST/0.1.0b11+dev]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.1b2+dev]
accept-language: [en-US]
- x-ms-client-request-id: [3e569340-d467-11e6-8866-24be0520f64e]
+ x-ms-client-request-id: [49d40236-e359-11e6-bd24-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Batch/locations/brazilsouth/quotas?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"accountQuota":1}'}
+ body: {string: '{"accountQuota":1}'}
headers:
- cache-control: [no-cache]
+ Cache-Control: [no-cache]
+ Content-Type: [application/json; charset=utf-8]
+ Date: ['Wed, 25 Jan 2017 23:52:11 GMT']
+ Expires: ['-1']
+ Pragma: [no-cache]
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ Vary: [Accept-Encoding]
+ X-Content-Type-Options: [nosniff]
content-length: ['18']
- content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 23:24:18 GMT']
- expires: ['-1']
- pragma: [no-cache]
- request-id: [de0e2d0c-2c9d-45de-9585-97ba031da057]
- server: [Microsoft-HTTPAPI/2.0]
- strict-transport-security: [max-age=31536000; includeSubDomains]
- transfer-encoding: [chunked]
- vary: [Accept-Encoding]
- x-content-type-options: [nosniff]
+ request-id: [358f413e-ae00-4fe7-9c39-6569e07fd557]
status: {code: 200, message: OK}
version: 1
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_application_mgmt.yaml b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_application_mgmt.yaml
index f2fd4ec6837..ceebeda4bf3 100644
--- a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_application_mgmt.yaml
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_application_mgmt.yaml
@@ -10,21 +10,21 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [1b149e21-d45a-11e6-bb54-24be0520f64e]
+ x-ms-client-request-id: [c6b801ee-dd32-11e6-842e-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-06T21:49:55.1332365Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
+ body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-18T04:01:04.5019746Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
headers:
cache-control: [no-cache]
- content-length: ['645']
+ content-length: ['641']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:15 GMT']
- etag: ['0x8D4367DFF395E01']
+ date: ['Wed, 18 Jan 2017 04:01:24 GMT']
+ etag: ['0x8D43F56AB15B1CB']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:14 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:01:23 GMT']
pragma: [no-cache]
- request-id: [c4ef5f77-0139-4f7d-a955-76cdb482c136]
+ request-id: [e492b583-5549-44fa-a9f6-df27098c86f6]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
@@ -43,7 +43,7 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [1bf205cf-d45a-11e6-971e-24be0520f64e]
+ x-ms-client-request-id: [c7d6b85e-dd32-11e6-888b-24be0520f64e]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7/applications/testapp?api-version=2015-12-01
response:
@@ -52,14 +52,14 @@ interactions:
cache-control: [no-cache]
content-length: ['50']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:17 GMT']
+ date: ['Wed, 18 Jan 2017 04:01:26 GMT']
expires: ['-1']
pragma: [no-cache]
- request-id: [4d480aa6-4128-4be7-981d-1ff059a633c3]
+ request-id: [e3f7aa60-3bc4-4798-99fa-7b14bebec8d3]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-content-type-options: [nosniff]
- x-ms-ratelimit-remaining-subscription-writes: ['1198']
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 201, message: Created}
- request:
body: null
@@ -72,21 +72,21 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [1d4ab800-d45a-11e6-8b5d-24be0520f64e]
+ x-ms-client-request-id: [c94bcc30-dd32-11e6-8cae-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-06T21:49:55.1332365Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
+ body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-18T04:01:04.5019746Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
headers:
cache-control: [no-cache]
- content-length: ['645']
+ content-length: ['641']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:18 GMT']
- etag: ['0x8D4367E011378D1']
+ date: ['Wed, 18 Jan 2017 04:01:28 GMT']
+ etag: ['0x8D43F56AD8307F6']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:17 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:01:27 GMT']
pragma: [no-cache]
- request-id: [9c7050f5-8db1-46a3-9328-ac5a82ba7aa3]
+ request-id: [fead1abd-9af9-46e4-8db4-c92065d83785]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
@@ -104,7 +104,7 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [1e1cfc21-d45a-11e6-b921-24be0520f64e]
+ x-ms-client-request-id: [ca1e5e6e-dd32-11e6-9a03-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7/applications?api-version=2015-12-01
response:
@@ -113,10 +113,10 @@ interactions:
cache-control: [no-cache]
content-length: ['62']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:21 GMT']
+ date: ['Wed, 18 Jan 2017 04:01:29 GMT']
expires: ['-1']
pragma: [no-cache]
- request-id: [ca4add4a-9d6b-47f1-829d-d394ab8435e1]
+ request-id: [aed94066-a082-4ccb-a393-0e40049957e6]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
@@ -134,21 +134,53 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [1f40bba1-d45a-11e6-ab3a-24be0520f64e]
+ x-ms-client-request-id: [cb60a26e-dd32-11e6-861e-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-06T21:49:55.1332365Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
+ body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-18T04:01:04.5019746Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['641']
+ content-type: [application/json; charset=utf-8]
+ date: ['Wed, 18 Jan 2017 04:01:31 GMT']
+ etag: ['0x8D43F56AFB1AE98']
+ expires: ['-1']
+ last-modified: ['Wed, 18 Jan 2017 04:01:31 GMT']
+ pragma: [no-cache]
+ request-id: [c21b50d9-d4f0-4c0b-967b-3bfa1539f15b]
+ server: [Microsoft-HTTPAPI/2.0]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ x-content-type-options: [nosniff]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.0b11+dev]
+ accept-language: [en-US]
+ x-ms-client-request-id: [cc4dc18f-dd32-11e6-9733-24be0520f64e]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7/applications/testapp?api-version=2015-12-01
+ response:
+ body: {string: !!python/unicode '{"id":"testapp","packages":[],"allowUpdates":true}'}
headers:
cache-control: [no-cache]
- content-length: ['645']
+ content-length: ['50']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:22 GMT']
- etag: ['0x8D4367E03002B21']
+ date: ['Wed, 18 Jan 2017 04:01:33 GMT']
+ etag: ['0x8D43F56ACC42971']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:21 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:01:26 GMT']
pragma: [no-cache]
- request-id: [9aabd8b2-40f6-4aaa-aa95-27d9d351493f]
+ request-id: [5975bcc6-ec90-4f70-80f3-4c2a61e5d26a]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
@@ -167,19 +199,19 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [20085161-d45a-11e6-bad7-24be0520f64e]
+ x-ms-client-request-id: [cd25f921-dd32-11e6-88b9-24be0520f64e]
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7/applications/testapp/versions/1.0?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"id":"testapp","version":"1.0","storageUrl":"https://clibatchteststorage7.blob.core.windows.net/app-testapp-4a19557dc1b96c20dfa19772af36624f6913ae44/testapp-1.0-87203d45-1003-48e5-95ac-fec09ffec5a3?sv=2015-04-05&sr=b&sig=e0qHoHA3X9xACKAV8MK29PHVP3m1qr96cC8CQYiz9ho%3D&st=2017-01-06T21%3A45%3A24Z&se=2017-01-07T01%3A50%3A24Z&sp=rw","storageUrlExpiry":"2017-01-07T01:50:24.320784Z","state":"pending"}'}
+ body: {string: !!python/unicode '{"id":"testapp","version":"1.0","storageUrl":"https://clibatchteststorage7.blob.core.windows.net/app-testapp-4a19557dc1b96c20dfa19772af36624f6913ae44/testapp-1.0-d43fb7fb-e43b-4d93-bb5a-30fd283fe94c?sv=2015-04-05&sr=b&sig=R4izt%2B4lbLHqVm4vNUP%2BVyYZG80EMsxA3ojHHF7Do%2BE%3D&st=2017-01-18T03%3A56%3A34Z&se=2017-01-18T08%3A01%3A34Z&sp=rw","storageUrlExpiry":"2017-01-18T08:01:34.9785786Z","state":"pending"}'}
headers:
cache-control: [no-cache]
- content-length: ['399']
+ content-length: ['406']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:24 GMT']
+ date: ['Wed, 18 Jan 2017 04:01:36 GMT']
expires: ['-1']
pragma: [no-cache]
- request-id: [b496e3fb-adda-4032-88fa-5c77e7f75f18]
+ request-id: [e32638e7-5785-4e15-a4a3-27d228803f5d]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-content-type-options: [nosniff]
@@ -192,22 +224,53 @@ interactions:
Content-Length: ['29']
User-Agent: [Azure-Storage/0.33.0 (Python CPython 2.7.9; Windows 2008ServerR2)]
x-ms-blob-type: [BlockBlob]
- x-ms-client-request-id: [21177770-d45a-11e6-a051-24be0520f64e]
- x-ms-date: ['Fri, 06 Jan 2017 21:50:24 GMT']
+ x-ms-client-request-id: [ce867380-dd32-11e6-9303-24be0520f64e]
+ x-ms-date: ['Wed, 18 Jan 2017 04:01:36 GMT']
x-ms-version: ['2015-07-08']
method: PUT
- uri: https://clibatchteststorage7.blob.core.windows.net/app-testapp-4a19557dc1b96c20dfa19772af36624f6913ae44/testapp-1.0-87203d45-1003-48e5-95ac-fec09ffec5a3?sv=2015-04-05&sr=b&sig=e0qHoHA3X9xACKAV8MK29PHVP3m1qr96cC8CQYiz9ho%3D&st=2017-01-06T21%3A45%3A24Z&se=2017-01-07T01%3A50%3A24Z&sp=rw
+ uri: https://clibatchteststorage7.blob.core.windows.net/app-testapp-4a19557dc1b96c20dfa19772af36624f6913ae44/testapp-1.0-d43fb7fb-e43b-4d93-bb5a-30fd283fe94c?sv=2015-04-05&sr=b&sig=R4izt%2B4lbLHqVm4vNUP%2BVyYZG80EMsxA3ojHHF7Do%2BE%3D&st=2017-01-18T03%3A56%3A34Z&se=2017-01-18T08%3A01%3A34Z&sp=rw
response:
body: {string: !!python/unicode ''}
headers:
content-md5: [JeBon6PeparxrbCKMR+6hw==]
- date: ['Fri, 06 Jan 2017 21:50:25 GMT']
- etag: ['"0x8D4367E05CD1880"']
- last-modified: ['Fri, 06 Jan 2017 21:50:25 GMT']
+ date: ['Wed, 18 Jan 2017 04:01:35 GMT']
+ etag: ['"0x8D43F56B3016D75"']
+ last-modified: ['Wed, 18 Jan 2017 04:01:36 GMT']
server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
transfer-encoding: [chunked]
x-ms-version: ['2015-07-08']
status: {code: 201, message: Created}
+- request:
+ body: !!python/unicode '{"format": "zip"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['17']
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.0b11+dev]
+ accept-language: [en-US]
+ x-ms-client-request-id: [cf22da8f-dd32-11e6-9360-24be0520f64e]
+ method: POST
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7/applications/testapp/versions/1.0/activate?api-version=2015-12-01
+ response:
+ body: {string: !!python/unicode ''}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['0']
+ date: ['Wed, 18 Jan 2017 04:01:38 GMT']
+ etag: ['0x8D43F56B254A9DB']
+ expires: ['-1']
+ last-modified: ['Wed, 18 Jan 2017 04:01:35 GMT']
+ pragma: [no-cache]
+ request-id: [2c93535a-4fa1-499f-942c-25c0a0c66e36]
+ server: [Microsoft-HTTPAPI/2.0]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ x-content-type-options: [nosniff]
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
+ status: {code: 204, message: No Content}
- request:
body: null
headers:
@@ -219,21 +282,53 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [2204bda1-d45a-11e6-903c-24be0520f64e]
+ x-ms-client-request-id: [d0096a00-dd32-11e6-9847-24be0520f64e]
+ method: GET
+ uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7/applications/testapp/versions/1.0?api-version=2015-12-01
+ response:
+ body: {string: !!python/unicode '{"id":"testapp","version":"1.0","storageUrl":"https://clibatchteststorage7.blob.core.windows.net/app-testapp-4a19557dc1b96c20dfa19772af36624f6913ae44/testapp-1.0-d43fb7fb-e43b-4d93-bb5a-30fd283fe94c?sv=2015-04-05&sr=b&sig=%2FNh41tLvYKAd4Qzd6%2BBmV%2BuuU%2BpwtnSVRhPiERzeYnU%3D&st=2017-01-18T03%3A56%3A37Z&se=2017-01-18T08%3A01%3A37Z&sp=rw","storageUrlExpiry":"2017-01-18T08:01:37.9896514Z","state":"active","format":"zip","lastActivationTime":"2017-01-18T04:01:38.3945462Z"}'}
+ headers:
+ cache-control: [no-cache]
+ content-length: ['474']
+ content-type: [application/json; charset=utf-8]
+ date: ['Wed, 18 Jan 2017 04:01:39 GMT']
+ etag: ['0x8D43F56B3D97BA5']
+ expires: ['-1']
+ last-modified: ['Wed, 18 Jan 2017 04:01:38 GMT']
+ pragma: [no-cache]
+ request-id: [d1c73e4d-8c64-4739-a941-e0c88fd95ec1]
+ server: [Microsoft-HTTPAPI/2.0]
+ strict-transport-security: [max-age=31536000; includeSubDomains]
+ transfer-encoding: [chunked]
+ vary: [Accept-Encoding]
+ x-content-type-options: [nosniff]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; charset=utf-8]
+ User-Agent: [python/2.7.9 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
+ AZURECLI/TEST/0.1.0b11+dev]
+ accept-language: [en-US]
+ x-ms-client-request-id: [d0cd7d4f-dd32-11e6-84ff-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-06T21:49:55.1332365Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
+ body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-18T04:01:04.5019746Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
headers:
cache-control: [no-cache]
- content-length: ['645']
+ content-length: ['641']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:26 GMT']
- etag: ['0x8D4367E05C95CD2']
+ date: ['Wed, 18 Jan 2017 04:01:40 GMT']
+ etag: ['0x8D43F56B52A419F']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:25 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:01:40 GMT']
pragma: [no-cache]
- request-id: [dfae9041-9f99-49e0-9c40-75a9b27ddcea]
+ request-id: [12bf7f31-e4b8-4df0-8b62-187b2c8ef9c8]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
@@ -252,7 +347,7 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [22d469b0-d45a-11e6-bc36-24be0520f64e]
+ x-ms-client-request-id: [d197840f-dd32-11e6-8fa3-24be0520f64e]
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7/applications/testapp/versions/1.0/activate?api-version=2015-12-01
response:
@@ -260,12 +355,12 @@ interactions:
headers:
cache-control: [no-cache]
content-length: ['0']
- date: ['Fri, 06 Jan 2017 21:50:28 GMT']
- etag: ['0x8D4367E05A261C8']
+ date: ['Wed, 18 Jan 2017 04:01:42 GMT']
+ etag: ['0x8D43F56B3D97BA5']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:25 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:01:38 GMT']
pragma: [no-cache]
- request-id: [96071d0d-e043-45c0-a34f-7f99492a7283]
+ request-id: [40f8cda4-c387-428b-aebf-85bef467035c]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-content-type-options: [nosniff]
@@ -282,21 +377,21 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [240b3c00-d45a-11e6-92ea-24be0520f64e]
+ x-ms-client-request-id: [d291c28f-dd32-11e6-bc36-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-06T21:49:55.1332365Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
+ body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-18T04:01:04.5019746Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
headers:
cache-control: [no-cache]
- content-length: ['645']
+ content-length: ['641']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:30 GMT']
- etag: ['0x8D4367E08BE624A']
+ date: ['Wed, 18 Jan 2017 04:01:43 GMT']
+ etag: ['0x8D43F56B6EEF829']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:30 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:01:43 GMT']
pragma: [no-cache]
- request-id: [f7e96baf-98bc-452d-b28e-34159d8a925e]
+ request-id: [a68d0c62-27d5-46f9-ae92-86a637e8989c]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
@@ -314,21 +409,21 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [24e0b470-d45a-11e6-a4f9-24be0520f64e]
+ x-ms-client-request-id: [d38634ae-dd32-11e6-a408-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7/applications/testapp/versions/1.0?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"id":"testapp","version":"1.0","storageUrl":"https://clibatchteststorage7.blob.core.windows.net/app-testapp-4a19557dc1b96c20dfa19772af36624f6913ae44/testapp-1.0-87203d45-1003-48e5-95ac-fec09ffec5a3?sv=2015-04-05&sr=b&sig=oy5fYSeHgbq%2BIPwuffafyBNCLAGOVY31W%2B3OJQwg53g%3D&st=2017-01-06T21%3A45%3A31Z&se=2017-01-07T01%3A50%3A31Z&sp=rw","storageUrlExpiry":"2017-01-07T01:50:31.0617935Z","state":"active","format":"zip","lastActivationTime":"2017-01-06T21:50:29.0230869Z"}'}
+ body: {string: !!python/unicode '{"id":"testapp","version":"1.0","storageUrl":"https://clibatchteststorage7.blob.core.windows.net/app-testapp-4a19557dc1b96c20dfa19772af36624f6913ae44/testapp-1.0-d43fb7fb-e43b-4d93-bb5a-30fd283fe94c?sv=2015-04-05&sr=b&sig=rCmXIkgPiqT5BZlotQJxRu9JJ59Q5Df7YpIqjYyGrrg%3D&st=2017-01-18T03%3A56%3A45Z&se=2017-01-18T08%3A01%3A45Z&sp=rw","storageUrlExpiry":"2017-01-18T08:01:45.0428391Z","state":"active","format":"zip","lastActivationTime":"2017-01-18T04:01:41.7398682Z"}'}
headers:
cache-control: [no-cache]
- content-length: ['470']
+ content-length: ['466']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:31 GMT']
- etag: ['0x8D4367E08317F5B']
+ date: ['Wed, 18 Jan 2017 04:01:45 GMT']
+ etag: ['0x8D43F56B5D7C555']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:29 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:01:41 GMT']
pragma: [no-cache]
- request-id: [86c61c62-5839-4109-97ca-6a734d22e4f0]
+ request-id: [888b969d-cba2-4e27-be21-79651cd287c1]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
@@ -346,21 +441,21 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [2576169e-d45a-11e6-8c9a-24be0520f64e]
+ x-ms-client-request-id: [d4dceb0f-dd32-11e6-9db9-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-06T21:49:55.1332365Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
+ body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-18T04:01:04.5019746Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
headers:
cache-control: [no-cache]
- content-length: ['645']
+ content-length: ['641']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:32 GMT']
- etag: ['0x8D4367E089BDA56']
+ date: ['Wed, 18 Jan 2017 04:01:47 GMT']
+ etag: ['0x8D43F56B8E981DE']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:30 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:01:46 GMT']
pragma: [no-cache]
- request-id: [1a0d5290-8f3e-49f2-a23f-28f45f0d36e4]
+ request-id: [f10921b4-5f86-4217-938d-dc2d5eaff967]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
@@ -379,7 +474,7 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [25a738c0-d45a-11e6-b62e-24be0520f64e]
+ x-ms-client-request-id: [d5ac21f0-dd32-11e6-9e8b-24be0520f64e]
method: PATCH
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7/applications/testapp?api-version=2015-12-01
response:
@@ -387,16 +482,16 @@ interactions:
headers:
cache-control: [no-cache]
content-length: ['0']
- date: ['Fri, 06 Jan 2017 21:50:32 GMT']
- etag: ['0x8D4367E016DC883']
+ date: ['Wed, 18 Jan 2017 04:01:49 GMT']
+ etag: ['0x8D43F56ACC42971']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:18 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:01:26 GMT']
pragma: [no-cache]
- request-id: [b51e2da9-d97e-4bd6-be5d-2098dff29178]
+ request-id: [0d9f57d4-78c9-4b31-8cae-1debff10705a]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-content-type-options: [nosniff]
- x-ms-ratelimit-remaining-subscription-writes: ['1196']
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 204, message: No Content}
- request:
body: null
@@ -409,21 +504,21 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [265ef000-d45a-11e6-8055-24be0520f64e]
+ x-ms-client-request-id: [d72d43ae-dd32-11e6-b6a1-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-06T21:49:55.1332365Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
+ body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-18T04:01:04.5019746Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
headers:
cache-control: [no-cache]
- content-length: ['645']
+ content-length: ['641']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:33 GMT']
- etag: ['0x8D4367E098604C1']
+ date: ['Wed, 18 Jan 2017 04:01:51 GMT']
+ etag: ['0x8D43F56BB3E39B1']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:31 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:01:50 GMT']
pragma: [no-cache]
- request-id: [5f38aabe-aba5-48e4-a276-0e5d9760477d]
+ request-id: [f569e77b-f79b-484e-9343-87406e22a8e1]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
@@ -441,21 +536,21 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [268feb0f-d45a-11e6-bf71-24be0520f64e]
+ x-ms-client-request-id: [d801d1c0-dd32-11e6-baa7-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7/applications/testapp?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"id":"testapp","packages":[{"version":"1.0","state":"active","lastActivationTime":"2017-01-06T21:50:29.0230869Z","format":"zip"}],"allowUpdates":true,"defaultVersion":"1.0"}'}
+ body: {string: !!python/unicode '{"id":"testapp","packages":[{"version":"1.0","state":"active","lastActivationTime":"2017-01-18T04:01:41.7398682Z","format":"zip"}],"allowUpdates":true,"defaultVersion":"1.0"}'}
headers:
cache-control: [no-cache]
content-length: ['174']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:34 GMT']
- etag: ['0x8D4367E0A81BDAC']
+ date: ['Wed, 18 Jan 2017 04:01:52 GMT']
+ etag: ['0x8D43F56BA8FBC82']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:33 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:01:49 GMT']
pragma: [no-cache]
- request-id: [a022752f-c835-4487-8a44-04c219fd0eaa]
+ request-id: [7a39521c-0a64-4569-9d1f-f5670bf2f8f4]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
@@ -473,21 +568,21 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [2716f561-d45a-11e6-b7bc-24be0520f64e]
+ x-ms-client-request-id: [d8d54e5e-dd32-11e6-99fc-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-06T21:49:55.1332365Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
+ body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-18T04:01:04.5019746Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
headers:
cache-control: [no-cache]
- content-length: ['645']
+ content-length: ['641']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:35 GMT']
- etag: ['0x8D4367E0A3E7549']
+ date: ['Wed, 18 Jan 2017 04:01:53 GMT']
+ etag: ['0x8D43F56BCFFD989']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:33 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:01:53 GMT']
pragma: [no-cache]
- request-id: [b25edccc-1b5d-4a26-94cc-9919b1beafba]
+ request-id: [17b7ad59-0733-4c84-b85f-2aa8ab80a184]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
@@ -506,7 +601,7 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [2748b3c0-d45a-11e6-a79b-24be0520f64e]
+ x-ms-client-request-id: [d9ac265e-dd32-11e6-b681-24be0520f64e]
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7/applications/testapp/versions/1.0?api-version=2015-12-01
response:
@@ -514,14 +609,14 @@ interactions:
headers:
cache-control: [no-cache]
content-length: ['0']
- date: ['Fri, 06 Jan 2017 21:50:35 GMT']
+ date: ['Wed, 18 Jan 2017 04:01:56 GMT']
expires: ['-1']
pragma: [no-cache]
- request-id: [b06463ea-1e51-42c1-8e88-7a83fbd17b23]
+ request-id: [280c36ad-b85e-4acd-affc-5038c1467a00]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-content-type-options: [nosniff]
- x-ms-ratelimit-remaining-subscription-writes: ['1197']
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 204, message: No Content}
- request:
body: null
@@ -534,21 +629,21 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [27f658e1-d45a-11e6-aa64-24be0520f64e]
+ x-ms-client-request-id: [db76d440-dd32-11e6-a643-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-06T21:49:55.1332365Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
+ body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-18T04:01:04.5019746Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
headers:
cache-control: [no-cache]
- content-length: ['645']
+ content-length: ['641']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:36 GMT']
- etag: ['0x8D4367E0CA624A2']
+ date: ['Wed, 18 Jan 2017 04:01:59 GMT']
+ etag: ['0x8D43F56BFBE8C76']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:37 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:01:58 GMT']
pragma: [no-cache]
- request-id: [13c9d774-ee18-4260-bbce-957f501741ff]
+ request-id: [ac8c9754-ff0a-49e7-93fd-6f749e014971]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
@@ -567,7 +662,7 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [28c875f0-d45a-11e6-9dfb-24be0520f64e]
+ x-ms-client-request-id: [dc6a34f0-dd32-11e6-bf10-24be0520f64e]
method: DELETE
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7/applications/testapp?api-version=2015-12-01
response:
@@ -575,14 +670,14 @@ interactions:
headers:
cache-control: [no-cache]
content-length: ['0']
- date: ['Fri, 06 Jan 2017 21:50:37 GMT']
+ date: ['Wed, 18 Jan 2017 04:02:01 GMT']
expires: ['-1']
pragma: [no-cache]
- request-id: [4f56f9ba-2174-48ef-9907-5eacd8f6eb21]
+ request-id: [5c5603e3-fe29-4fcd-b0c5-d0fe37a60a8d]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
x-content-type-options: [nosniff]
- x-ms-ratelimit-remaining-subscription-writes: ['1198']
+ x-ms-ratelimit-remaining-subscription-writes: ['1199']
status: {code: 204, message: No Content}
- request:
body: null
@@ -595,21 +690,21 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [297e5870-d45a-11e6-9a40-24be0520f64e]
+ x-ms-client-request-id: [de983880-dd32-11e6-9b6b-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7?api-version=2015-12-01
response:
- body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-06T21:49:55.1332365Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
+ body: {string: !!python/unicode '{"name":"clibatchtest7","location":"brazilsouth","properties":{"accountEndpoint":"clibatchtest7.brazilsouth.batch.azure.com","provisioningState":"Succeeded","coreQuota":20,"poolQuota":20,"activeJobAndJobScheduleQuota":20,"autoStorage":{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Storage/storageAccounts/clibatchteststorage7","lastKeySync":"2017-01-18T04:01:04.5019746Z"}},"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7","type":"Microsoft.Batch/batchAccounts"}'}
headers:
cache-control: [no-cache]
- content-length: ['645']
+ content-length: ['641']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:38 GMT']
- etag: ['0x8D4367E0CA28D8E']
+ date: ['Wed, 18 Jan 2017 04:02:03 GMT']
+ etag: ['0x8D43F56C23AD79B']
expires: ['-1']
- last-modified: ['Fri, 06 Jan 2017 21:50:37 GMT']
+ last-modified: ['Wed, 18 Jan 2017 04:02:02 GMT']
pragma: [no-cache]
- request-id: [c28244a7-7f2d-4849-90e9-a526f5ac611f]
+ request-id: [88b30323-fac0-4f0f-aa2a-02409415fb50]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
@@ -627,7 +722,7 @@ interactions:
msrest/0.4.4 msrest_azure/0.4.5 batchmanagementclient/2.0.0 Azure-SDK-For-Python
AZURECLI/TEST/0.1.0b11+dev]
accept-language: [en-US]
- x-ms-client-request-id: [29adf3f0-d45a-11e6-9e68-24be0520f64e]
+ x-ms-client-request-id: [ded652ee-dd32-11e6-bd0e-24be0520f64e]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/vcr_resource_group/providers/Microsoft.Batch/batchAccounts/clibatchtest7/applications?api-version=2015-12-01
response:
@@ -636,10 +731,10 @@ interactions:
cache-control: [no-cache]
content-length: ['12']
content-type: [application/json; charset=utf-8]
- date: ['Fri, 06 Jan 2017 21:50:39 GMT']
+ date: ['Wed, 18 Jan 2017 04:02:03 GMT']
expires: ['-1']
pragma: [no-cache]
- request-id: [ae64a47d-b92b-4b7e-97a8-e6292faefc22]
+ request-id: [99245e2f-9d57-4afa-9410-2b85e9c53fad]
server: [Microsoft-HTTPAPI/2.0]
strict-transport-security: [max-age=31536000; includeSubDomains]
transfer-encoding: [chunked]
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_certificate_cmd.yaml b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_certificate_cmd.yaml
new file mode 100644
index 00000000000..772aa5cd8ef
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_certificate_cmd.yaml
@@ -0,0 +1,151 @@
+interactions:
+- request:
+ body: '{"thumbprint": "59833fd835f827e9ec693a4c82435a6360cc6271", "certificateFormat":
+ "cer", "thumbprintAlgorithm": "sha1", "data": "MIIDSTCCArKgAwIBAgIQaleE9RaQtoVKrBwEt2q6RzANBgkqhkiG9w0BAQsFADBnMSswKQYDVQQLDCJDcmVhdGVkIGJ5IGh0dHA6Ly93d3cuZmlkZGxlcjIuY29tMRUwEwYDVQQKDAxET19OT1RfVFJVU1QxITAfBgNVBAMMGERPX05PVF9UUlVTVF9GaWRkbGVyUm9vdDAeFw0xNTAxMTAxNDAwNDVaFw0yMTAxMDkxNDAwNDVaMFoxKzApBgNVBAsMIkNyZWF0ZWQgYnkgaHR0cDovL3d3dy5maWRkbGVyMi5jb20xFTATBgNVBAoMDERPX05PVF9UUlVTVDEUMBIGA1UEAwwLKi5hYm91dC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZEWc01Lku+PtDJXq9UMFRTpC9ITo/swlKcEODdOT/M+L7zv6OH8dEa9FOVquKoMjFCe6mv4s8c5/vVpaXseMDrWbU1v4OrZ6u3BtLVpcNg8SOUl5+s3gvWM7KTSjtEc4RQTKd5eZEj1vDKLbdyvbog9yCSoTrIfSpbN6S0G3utVBPD68evt8CQgQHPjy8DzElqemiPXVhKF5iJdaKn8JXSvjrcCiWG8A8y/+mFJHIW1jsbMevHSVat7ZPjyroR5PtImqtpXcgsZMiVuRVT0B/x7t3D3VlHp6Jb99d0rmci6DemF+ZyVtAgg+TBtqZEq24RS/nS+2/uVxTHDU3giApAgMBAAGjfzB9MA4GA1UdDwEB/wQEAwIEsDATBgNVHSUEDDAKBggrBgEFBQcDATAWBgNVHREEDzANggsqLmFib3V0LmNvbTAfBgNVHSMEGDAWgBSEeNrHb5Vx0ZxM797sUj1T7Bx+FTAdBgNVHQ4EFgQUp7MhHnwP4+9nNjGy9cx4PlHH3AQwDQYJKoZIhvcNAQELBQADgYEAEMFcH3KmCNT8r5oRtKL+JiBN/HIRIjzYT1ILlSnn57rDSlx6yQgMxTjLqcpCvt5vR62QhwcdSSkOBTnpbO5qACrC70CBKJ4cPu9pb0Ncs3IO+l1aIGWpxbwESqiKoraAVNkSaJvU8R6sx20n74JHgxZCVZeC8Rg9UHFhfSeAAOo="}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['1257']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [5d0f842e-df76-11e6-b320-24be0520f64e]
+ ocp-date: ['Sat, 21 Jan 2017 01:10:14 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/certificates?api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/certificates(ThumbprintAlgorithm=sha1,Thumbprint=59833fd835f827e9ec693a4c82435a6360cc6271)']
+ DataServiceVersion: ['3.0']
+ Date: ['Sat, 21 Jan 2017 01:10:15 GMT']
+ Location: ['https://test1.westus.batch.azure.com/certificates(ThumbprintAlgorithm=sha1,Thumbprint=59833fd835f827e9ec693a4c82435a6360cc6271)']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [59bdc11a-7335-4a63-b624-6810253e975c]
+ status: {code: 201, message: Created}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [5de3f09c-df76-11e6-aeda-24be0520f64e]
+ ocp-date: ['Sat, 21 Jan 2017 01:10:15 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/certificates(thumbprintAlgorithm=sha1,thumbprint=59833fd835f827e9ec693a4c82435a6360cc6271)?api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#certificates/@Element\"\
+ ,\"thumbprint\":\"59833fd835f827e9ec693a4c82435a6360cc6271\",\"thumbprintAlgorithm\"\
+ :\"sha1\",\"url\":\"https://test1.westus.batch.azure.com/certificates(thumbprintAlgorithm=sha1,thumbprint=59833fd835f827e9ec693a4c82435a6360cc6271)\"\
+ ,\"state\":\"active\",\"stateTransitionTime\":\"2017-01-21T01:10:17.0939146Z\"\
+ ,\"publicData\":\"MIIDSTCCArKgAwIBAgIQaleE9RaQtoVKrBwEt2q6RzANBgkqhkiG9w0BAQsFADBnMSswKQYDVQQLDCJDcmVhdGVkIGJ5IGh0dHA6Ly93d3cuZmlkZGxlcjIuY29tMRUwEwYDVQQKDAxET19OT1RfVFJVU1QxITAfBgNVBAMMGERPX05PVF9UUlVTVF9GaWRkbGVyUm9vdDAeFw0xNTAxMTAxNDAwNDVaFw0yMTAxMDkxNDAwNDVaMFoxKzApBgNVBAsMIkNyZWF0ZWQgYnkgaHR0cDovL3d3dy5maWRkbGVyMi5jb20xFTATBgNVBAoMDERPX05PVF9UUlVTVDEUMBIGA1UEAwwLKi5hYm91dC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZEWc01Lku+PtDJXq9UMFRTpC9ITo/swlKcEODdOT/M+L7zv6OH8dEa9FOVquKoMjFCe6mv4s8c5/vVpaXseMDrWbU1v4OrZ6u3BtLVpcNg8SOUl5+s3gvWM7KTSjtEc4RQTKd5eZEj1vDKLbdyvbog9yCSoTrIfSpbN6S0G3utVBPD68evt8CQgQHPjy8DzElqemiPXVhKF5iJdaKn8JXSvjrcCiWG8A8y/+mFJHIW1jsbMevHSVat7ZPjyroR5PtImqtpXcgsZMiVuRVT0B/x7t3D3VlHp6Jb99d0rmci6DemF+ZyVtAgg+TBtqZEq24RS/nS+2/uVxTHDU3giApAgMBAAGjfzB9MA4GA1UdDwEB/wQEAwIEsDATBgNVHSUEDDAKBggrBgEFBQcDATAWBgNVHREEDzANggsqLmFib3V0LmNvbTAfBgNVHSMEGDAWgBSEeNrHb5Vx0ZxM797sUj1T7Bx+FTAdBgNVHQ4EFgQUp7MhHnwP4+9nNjGy9cx4PlHH3AQwDQYJKoZIhvcNAQELBQADgYEAEMFcH3KmCNT8r5oRtKL+JiBN/HIRIjzYT1ILlSnn57rDSlx6yQgMxTjLqcpCvt5vR62QhwcdSSkOBTnpbO5qACrC70CBKJ4cPu9pb0Ncs3IO+l1aIGWpxbwESqiKoraAVNkSaJvU8R6sx20n74JHgxZCVZeC8Rg9UHFhfSeAAOo=\"\
+ \r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Sat, 21 Jan 2017 01:10:15 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [fa6ee559-0606-4758-a40e-2ede84b7cd97]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [5e775ac0-df76-11e6-8770-24be0520f64e]
+ ocp-date: ['Sat, 21 Jan 2017 01:10:16 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/certificates?api-version=2016-07-01.3.1&timeout=30
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#certificates\"\
+ ,\"value\":[\r\n {\r\n \"thumbprint\":\"59833fd835f827e9ec693a4c82435a6360cc6271\"\
+ ,\"thumbprintAlgorithm\":\"sha1\",\"url\":\"https://test1.westus.batch.azure.com/certificates(thumbprintAlgorithm=sha1,thumbprint=59833fd835f827e9ec693a4c82435a6360cc6271)\"\
+ ,\"state\":\"active\",\"stateTransitionTime\":\"2017-01-21T01:10:17.0939146Z\"\
+ ,\"publicData\":\"MIIDSTCCArKgAwIBAgIQaleE9RaQtoVKrBwEt2q6RzANBgkqhkiG9w0BAQsFADBnMSswKQYDVQQLDCJDcmVhdGVkIGJ5IGh0dHA6Ly93d3cuZmlkZGxlcjIuY29tMRUwEwYDVQQKDAxET19OT1RfVFJVU1QxITAfBgNVBAMMGERPX05PVF9UUlVTVF9GaWRkbGVyUm9vdDAeFw0xNTAxMTAxNDAwNDVaFw0yMTAxMDkxNDAwNDVaMFoxKzApBgNVBAsMIkNyZWF0ZWQgYnkgaHR0cDovL3d3dy5maWRkbGVyMi5jb20xFTATBgNVBAoMDERPX05PVF9UUlVTVDEUMBIGA1UEAwwLKi5hYm91dC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZEWc01Lku+PtDJXq9UMFRTpC9ITo/swlKcEODdOT/M+L7zv6OH8dEa9FOVquKoMjFCe6mv4s8c5/vVpaXseMDrWbU1v4OrZ6u3BtLVpcNg8SOUl5+s3gvWM7KTSjtEc4RQTKd5eZEj1vDKLbdyvbog9yCSoTrIfSpbN6S0G3utVBPD68evt8CQgQHPjy8DzElqemiPXVhKF5iJdaKn8JXSvjrcCiWG8A8y/+mFJHIW1jsbMevHSVat7ZPjyroR5PtImqtpXcgsZMiVuRVT0B/x7t3D3VlHp6Jb99d0rmci6DemF+ZyVtAgg+TBtqZEq24RS/nS+2/uVxTHDU3giApAgMBAAGjfzB9MA4GA1UdDwEB/wQEAwIEsDATBgNVHSUEDDAKBggrBgEFBQcDATAWBgNVHREEDzANggsqLmFib3V0LmNvbTAfBgNVHSMEGDAWgBSEeNrHb5Vx0ZxM797sUj1T7Bx+FTAdBgNVHQ4EFgQUp7MhHnwP4+9nNjGy9cx4PlHH3AQwDQYJKoZIhvcNAQELBQADgYEAEMFcH3KmCNT8r5oRtKL+JiBN/HIRIjzYT1ILlSnn57rDSlx6yQgMxTjLqcpCvt5vR62QhwcdSSkOBTnpbO5qACrC70CBKJ4cPu9pb0Ncs3IO+l1aIGWpxbwESqiKoraAVNkSaJvU8R6sx20n74JHgxZCVZeC8Rg9UHFhfSeAAOo=\"\
+ \r\n }\r\n ]\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Sat, 21 Jan 2017 01:10:15 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [b963cf6c-3f36-4c77-807d-2f593e160ed8]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [5f106a5c-df76-11e6-a29c-24be0520f64e]
+ ocp-date: ['Sat, 21 Jan 2017 01:10:17 GMT']
+ method: DELETE
+ uri: https://test1.westus.batch.azure.com/certificates(thumbprintAlgorithm=sha1,thumbprint=59833fd835f827e9ec693a4c82435a6360cc6271)?api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceVersion: ['3.0']
+ Date: ['Sat, 21 Jan 2017 01:10:15 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [28ab912b-3575-49dd-bf29-1670d0e8b949]
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [5f9b96ee-df76-11e6-9590-24be0520f64e]
+ ocp-date: ['Sat, 21 Jan 2017 01:10:18 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/certificates(thumbprintAlgorithm=sha1,thumbprint=59833fd835f827e9ec693a4c82435a6360cc6271)?api-version=2016-07-01.3.1&timeout=30
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#certificates/@Element\"\
+ ,\"thumbprint\":\"59833fd835f827e9ec693a4c82435a6360cc6271\",\"thumbprintAlgorithm\"\
+ :\"sha1\",\"url\":\"https://test1.westus.batch.azure.com/certificates(thumbprintAlgorithm=sha1,thumbprint=59833fd835f827e9ec693a4c82435a6360cc6271)\"\
+ ,\"state\":\"deleting\",\"stateTransitionTime\":\"2017-01-21T01:10:19.3061174Z\"\
+ ,\"previousState\":\"active\",\"previousStateTransitionTime\":\"2017-01-21T01:10:17.0939146Z\"\
+ ,\"publicData\":\"MIIDSTCCArKgAwIBAgIQaleE9RaQtoVKrBwEt2q6RzANBgkqhkiG9w0BAQsFADBnMSswKQYDVQQLDCJDcmVhdGVkIGJ5IGh0dHA6Ly93d3cuZmlkZGxlcjIuY29tMRUwEwYDVQQKDAxET19OT1RfVFJVU1QxITAfBgNVBAMMGERPX05PVF9UUlVTVF9GaWRkbGVyUm9vdDAeFw0xNTAxMTAxNDAwNDVaFw0yMTAxMDkxNDAwNDVaMFoxKzApBgNVBAsMIkNyZWF0ZWQgYnkgaHR0cDovL3d3dy5maWRkbGVyMi5jb20xFTATBgNVBAoMDERPX05PVF9UUlVTVDEUMBIGA1UEAwwLKi5hYm91dC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZEWc01Lku+PtDJXq9UMFRTpC9ITo/swlKcEODdOT/M+L7zv6OH8dEa9FOVquKoMjFCe6mv4s8c5/vVpaXseMDrWbU1v4OrZ6u3BtLVpcNg8SOUl5+s3gvWM7KTSjtEc4RQTKd5eZEj1vDKLbdyvbog9yCSoTrIfSpbN6S0G3utVBPD68evt8CQgQHPjy8DzElqemiPXVhKF5iJdaKn8JXSvjrcCiWG8A8y/+mFJHIW1jsbMevHSVat7ZPjyroR5PtImqtpXcgsZMiVuRVT0B/x7t3D3VlHp6Jb99d0rmci6DemF+ZyVtAgg+TBtqZEq24RS/nS+2/uVxTHDU3giApAgMBAAGjfzB9MA4GA1UdDwEB/wQEAwIEsDATBgNVHSUEDDAKBggrBgEFBQcDATAWBgNVHREEDzANggsqLmFib3V0LmNvbTAfBgNVHSMEGDAWgBSEeNrHb5Vx0ZxM797sUj1T7Bx+FTAdBgNVHQ4EFgQUp7MhHnwP4+9nNjGy9cx4PlHH3AQwDQYJKoZIhvcNAQELBQADgYEAEMFcH3KmCNT8r5oRtKL+JiBN/HIRIjzYT1ILlSnn57rDSlx6yQgMxTjLqcpCvt5vR62QhwcdSSkOBTnpbO5qACrC70CBKJ4cPu9pb0Ncs3IO+l1aIGWpxbwESqiKoraAVNkSaJvU8R6sx20n74JHgxZCVZeC8Rg9UHFhfSeAAOo=\"\
+ \r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Sat, 21 Jan 2017 01:10:17 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [06c4f9a8-0078-4cca-930d-60c72a109755]
+ status: {code: 200, message: OK}
+version: 1
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_job_list_cmd.yaml b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_job_list_cmd.yaml
new file mode 100644
index 00000000000..396d8664ae1
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_job_list_cmd.yaml
@@ -0,0 +1,295 @@
+interactions:
+- request:
+ body: '{"metadata": [{"name": "specMeta1", "value": "specMetaValue1"}, {"name":
+ "specMeta2", "value": "specMetaValue2"}], "constraints": {"maxTaskRetryCount":
+ 5, "maxWallClockTime": "P1D"}, "jobReleaseTask": {"commandLine": "cmd /c dir
+ /s", "resourceFiles": [{"filePath": "jobReleaseFilePath", "blobSource": "https://testacct.blob.core.windows.net/"}],
+ "environmentSettings": [{"name": "jobReleaseName1", "value": "jobReleaseValue1"},
+ {"name": "jobReleaseName2", "value": "jobReleaseValue2"}], "runElevated": false,
+ "id": "jobRelease"}, "poolInfo": {"poolId": "xplatTestPool"}, "priority": 1,
+ "jobPreparationTask": {"commandLine": "cmd /c dir /s", "resourceFiles": [{"filePath":
+ "jobPrepFilePath", "blobSource": "https://testacct.blob.core.windows.net/"}],
+ "environmentSettings": [{"name": "jobPrepName1", "value": "jobPrepValue1"},
+ {"name": "jobPrepName2", "value": "jobPrepValue2"}], "runElevated": false, "constraints":
+ {"maxTaskRetryCount": 2}, "id": "jobPrep"}, "commonEnvironmentSettings": [{"name":
+ "commonName1", "value": "commonValue1"}, {"name": "commonName2", "value": "commonValue2"}],
+ "jobManagerTask": {"commandLine": "cmd /c dir /s", "killJobOnCompletion": false,
+ "environmentSettings": [{"name": "name1", "value": "value1"}, {"name": "name2",
+ "value": "value2"}], "runElevated": false, "resourceFiles": [{"filePath": "filePath",
+ "blobSource": "https://testacct.blob.core.windows.net/"}], "constraints": {"maxWallClockTime":
+ "PT1H"}, "displayName": "jobManagerDisplay", "id": "jobManager"}, "displayName":
+ "displayName", "id": "xplatJob"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['1546']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [d9cb8436-e204-11e6-9b72-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 07:15:14 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/jobs?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/jobs/job-1']
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 07:15:14 GMT']
+ ETag: ['0x8D44428BE01E706']
+ Last-Modified: ['Tue, 24 Jan 2017 07:15:14 GMT']
+ Location: ['https://test1.westus.batch.azure.com/jobs/job-1']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [c89ed5d3-4f94-472d-aa38-c193e031cc6a]
+ status: {code: 201, message: Created}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [da4bdb10-e204-11e6-a309-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 07:15:15 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/jobschedules/xplatJobScheduleJobTests/jobs?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#jobs\"\
+ ,\"value\":[\r\n {\r\n \"id\":\"xplatJobScheduleJobTests:job-1\",\"\
+ displayName\":\"jobSpecDisplayName\",\"url\":\"https://test1.westus.batch.azure.com/jobs/xplatJobScheduleJobTests:job-1\"\
+ ,\"eTag\":\"0x8D44428BD8D2BD3\",\"lastModified\":\"2017-01-24T07:15:13.5608787Z\"\
+ ,\"creationTime\":\"2017-01-24T07:15:13.417612Z\",\"state\":\"completed\"\
+ ,\"stateTransitionTime\":\"2017-01-24T07:15:13.9299459Z\",\"previousState\"\
+ :\"active\",\"previousStateTransitionTime\":\"2017-01-24T07:15:13.5608787Z\"\
+ ,\"priority\":1,\"usesTaskDependencies\":false,\"constraints\":{\r\n \
+ \ \"maxWallClockTime\":\"P1D\",\"maxTaskRetryCount\":5\r\n },\"jobManagerTask\"\
+ :{\r\n \"id\":\"jobManager\",\"displayName\":\"jobManagerDisplay\"\
+ ,\"commandLine\":\"cmd /c dir /s\",\"resourceFiles\":[\r\n {\r\n\
+ \ \"blobSource\":\"https://testacct.blob.core.windows.net/\",\"\
+ filePath\":\"filePath\"\r\n }\r\n ],\"environmentSettings\"\
+ :[\r\n {\r\n \"name\":\"name1\",\"value\":\"value1\"\r\
+ \n },{\r\n \"name\":\"name2\",\"value\":\"value2\"\r\n\
+ \ }\r\n ],\"constraints\":{\r\n \"maxWallClockTime\"\
+ :\"PT1H\",\"retentionTime\":\"P10675199DT2H48M5.4775807S\",\"maxTaskRetryCount\"\
+ :5\r\n },\"runElevated\":false,\"runExclusive\":true,\"killJobOnCompletion\"\
+ :false\r\n },\"jobPreparationTask\":{\r\n \"id\":\"jobPrep\",\"\
+ commandLine\":\"cmd /c dir /s\",\"resourceFiles\":[\r\n {\r\n \
+ \ \"blobSource\":\"https://testacct.blob.core.windows.net/\",\"filePath\"\
+ :\"jobPrepFilePath\"\r\n }\r\n ],\"environmentSettings\":[\r\
+ \n {\r\n \"name\":\"jobPrepName1\",\"value\":\"jobPrepValue1\"\
+ \r\n },{\r\n \"name\":\"jobPrepName2\",\"value\":\"jobPrepValue2\"\
+ \r\n }\r\n ],\"constraints\":{\r\n \"maxWallClockTime\"\
+ :\"P10675199DT2H48M5.4775807S\",\"retentionTime\":\"P10675199DT2H48M5.4775807S\"\
+ ,\"maxTaskRetryCount\":2\r\n },\"runElevated\":false,\"waitForSuccess\"\
+ :true,\"rerunOnNodeRebootAfterSuccess\":true\r\n },\"jobReleaseTask\"\
+ :{\r\n \"id\":\"jobRelease\",\"commandLine\":\"cmd /c dir /s\",\"resourceFiles\"\
+ :[\r\n {\r\n \"blobSource\":\"https://testacct.blob.core.windows.net/\"\
+ ,\"filePath\":\"jobReleaseFilePath\"\r\n }\r\n ],\"environmentSettings\"\
+ :[\r\n {\r\n \"name\":\"jobReleaseName1\",\"value\":\"\
+ jobReleaseValue1\"\r\n },{\r\n \"name\":\"jobReleaseName2\"\
+ ,\"value\":\"jobReleaseValue2\"\r\n }\r\n ],\"maxWallClockTime\"\
+ :\"PT15M\",\"retentionTime\":\"P10675199DT2H48M5.4775807S\",\"runElevated\"\
+ :false\r\n },\"commonEnvironmentSettings\":[\r\n {\r\n \
+ \ \"name\":\"commonName1\",\"value\":\"commonValue1\"\r\n },{\r\n\
+ \ \"name\":\"commonName2\",\"value\":\"commonValue2\"\r\n \
+ \ }\r\n ],\"poolInfo\":{\r\n \"autoPoolSpecification\":{\r\n \
+ \ \"autoPoolIdPrefix\":\"TestSpecPrefix\",\"poolLifetimeOption\":\"\
+ jobschedule\",\"keepAlive\":false,\"pool\":{\r\n \"vmSize\":\"\
+ small\",\"maxTasksPerNode\":1,\"taskSchedulingPolicy\":{\r\n \
+ \ \"nodeFillType\":\"Spread\"\r\n },\"resizeTimeout\":\"PT15M\"\
+ ,\"targetDedicated\":3,\"enableAutoScale\":false,\"enableInterNodeCommunication\"\
+ :false,\"startTask\":{\r\n \"commandLine\":\"cmd /c dir /s\"\
+ ,\"runElevated\":false,\"maxTaskRetryCount\":0,\"waitForSuccess\":false\r\n\
+ \ },\"certificateReferences\":[\r\n {\r\n \
+ \ \"thumbprint\":\"0123456789abcdef\",\"thumbprintAlgorithm\":\"sha1\"\
+ ,\"storeLocation\":\"LocalMachine\",\"storeName\":\"certStore\",\"visibility\"\
+ :[\r\n \"starttask\"\r\n ]\r\n \
+ \ }\r\n ],\"cloudServiceConfiguration\":{\r\n \"\
+ osFamily\":\"4\",\"targetOSVersion\":\"*\"\r\n }\r\n }\r\
+ \n }\r\n },\"metadata\":[\r\n {\r\n \"name\":\"\
+ specMeta1\",\"value\":\"specMetaValue1\"\r\n },{\r\n \"name\"\
+ :\"specMeta2\",\"value\":\"specMetaValue2\"\r\n }\r\n ],\"executionInfo\"\
+ :{\r\n \"startTime\":\"2017-01-24T07:15:13.5608787Z\",\"endTime\":\"\
+ 2017-01-24T07:15:13.9299459Z\",\"poolId\":\"TestSpecPrefix_B9AF0891-4824-4A11-AE45-399B6437E020\"\
+ ,\"schedulingError\":{\r\n \"category\":\"UserError\",\"code\":\"\
+ InvalidCertificatesInAutoPool\",\"message\":\"One or more certificates specified\
+ \ for the pool are invalid\",\"details\":[\r\n {\r\n \
+ \ \"name\":\"sha1-0123456789abcdef\",\"value\":\"The specified certificate\
+ \ does not exist.\"\r\n }\r\n ]\r\n }\r\n \
+ \ },\"onAllTasksComplete\":\"noaction\",\"onTaskFailure\":\"noaction\"\r\n\
+ \ }\r\n ]\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 07:15:14 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [939d7239-674a-47ea-8ff9-8f073800014c]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [dacd1c4c-e204-11e6-900b-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 07:15:16 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/jobs?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#jobs\"\
+ ,\"value\":[\r\n {\r\n \"id\":\"xplatJob\",\"displayName\":\"displayName\"\
+ ,\"url\":\"https://test1.westus.batch.azure.com/jobs/xplatJob\",\"eTag\":\"\
+ 0x8D44428BE01E706\",\"lastModified\":\"2017-01-24T07:15:14.3258886Z\",\"creationTime\"\
+ :\"2017-01-24T07:15:14.2648912Z\",\"state\":\"active\",\"stateTransitionTime\"\
+ :\"2017-01-24T07:15:14.3258886Z\",\"priority\":1,\"usesTaskDependencies\"\
+ :false,\"constraints\":{\r\n \"maxWallClockTime\":\"P1D\",\"maxTaskRetryCount\"\
+ :5\r\n },\"jobManagerTask\":{\r\n \"id\":\"jobManager\",\"displayName\"\
+ :\"jobManagerDisplay\",\"commandLine\":\"cmd /c dir /s\",\"resourceFiles\"\
+ :[\r\n {\r\n \"blobSource\":\"https://testacct.blob.core.windows.net/\"\
+ ,\"filePath\":\"filePath\"\r\n }\r\n ],\"environmentSettings\"\
+ :[\r\n {\r\n \"name\":\"name1\",\"value\":\"value1\"\r\
+ \n },{\r\n \"name\":\"name2\",\"value\":\"value2\"\r\n\
+ \ }\r\n ],\"constraints\":{\r\n \"maxWallClockTime\"\
+ :\"PT1H\",\"retentionTime\":\"P10675199DT2H48M5.4775807S\",\"maxTaskRetryCount\"\
+ :5\r\n },\"runElevated\":false,\"runExclusive\":true,\"killJobOnCompletion\"\
+ :false\r\n },\"jobPreparationTask\":{\r\n \"id\":\"jobPrep\",\"\
+ commandLine\":\"cmd /c dir /s\",\"resourceFiles\":[\r\n {\r\n \
+ \ \"blobSource\":\"https://testacct.blob.core.windows.net/\",\"filePath\"\
+ :\"jobPrepFilePath\"\r\n }\r\n ],\"environmentSettings\":[\r\
+ \n {\r\n \"name\":\"jobPrepName1\",\"value\":\"jobPrepValue1\"\
+ \r\n },{\r\n \"name\":\"jobPrepName2\",\"value\":\"jobPrepValue2\"\
+ \r\n }\r\n ],\"constraints\":{\r\n \"maxWallClockTime\"\
+ :\"P10675199DT2H48M5.4775807S\",\"retentionTime\":\"P10675199DT2H48M5.4775807S\"\
+ ,\"maxTaskRetryCount\":2\r\n },\"runElevated\":false,\"waitForSuccess\"\
+ :true,\"rerunOnNodeRebootAfterSuccess\":true\r\n },\"jobReleaseTask\"\
+ :{\r\n \"id\":\"jobRelease\",\"commandLine\":\"cmd /c dir /s\",\"resourceFiles\"\
+ :[\r\n {\r\n \"blobSource\":\"https://testacct.blob.core.windows.net/\"\
+ ,\"filePath\":\"jobReleaseFilePath\"\r\n }\r\n ],\"environmentSettings\"\
+ :[\r\n {\r\n \"name\":\"jobReleaseName1\",\"value\":\"\
+ jobReleaseValue1\"\r\n },{\r\n \"name\":\"jobReleaseName2\"\
+ ,\"value\":\"jobReleaseValue2\"\r\n }\r\n ],\"maxWallClockTime\"\
+ :\"PT15M\",\"retentionTime\":\"P10675199DT2H48M5.4775807S\",\"runElevated\"\
+ :false\r\n },\"commonEnvironmentSettings\":[\r\n {\r\n \
+ \ \"name\":\"commonName1\",\"value\":\"commonValue1\"\r\n },{\r\n\
+ \ \"name\":\"commonName2\",\"value\":\"commonValue2\"\r\n \
+ \ }\r\n ],\"poolInfo\":{\r\n \"poolId\":\"xplatTestPool\"\r\n\
+ \ },\"metadata\":[\r\n {\r\n \"name\":\"specMeta1\",\"\
+ value\":\"specMetaValue1\"\r\n },{\r\n \"name\":\"specMeta2\"\
+ ,\"value\":\"specMetaValue2\"\r\n }\r\n ],\"executionInfo\":{\r\
+ \n \"startTime\":\"2017-01-24T07:15:14.3258886Z\",\"poolId\":\"xplatTestPool\"\
+ \r\n },\"onAllTasksComplete\":\"noaction\",\"onTaskFailure\":\"noaction\"\
+ \r\n },{\r\n \"id\":\"xplatJobScheduleJobTests:job-1\",\"displayName\"\
+ :\"jobSpecDisplayName\",\"url\":\"https://test1.westus.batch.azure.com/jobs/xplatJobScheduleJobTests:job-1\"\
+ ,\"eTag\":\"0x8D44428BD8D2BD3\",\"lastModified\":\"2017-01-24T07:15:13.5608787Z\"\
+ ,\"creationTime\":\"2017-01-24T07:15:13.417612Z\",\"state\":\"completed\"\
+ ,\"stateTransitionTime\":\"2017-01-24T07:15:13.9299459Z\",\"previousState\"\
+ :\"active\",\"previousStateTransitionTime\":\"2017-01-24T07:15:13.5608787Z\"\
+ ,\"priority\":1,\"usesTaskDependencies\":false,\"constraints\":{\r\n \
+ \ \"maxWallClockTime\":\"P1D\",\"maxTaskRetryCount\":5\r\n },\"jobManagerTask\"\
+ :{\r\n \"id\":\"jobManager\",\"displayName\":\"jobManagerDisplay\"\
+ ,\"commandLine\":\"cmd /c dir /s\",\"resourceFiles\":[\r\n {\r\n\
+ \ \"blobSource\":\"https://testacct.blob.core.windows.net/\",\"\
+ filePath\":\"filePath\"\r\n }\r\n ],\"environmentSettings\"\
+ :[\r\n {\r\n \"name\":\"name1\",\"value\":\"value1\"\r\
+ \n },{\r\n \"name\":\"name2\",\"value\":\"value2\"\r\n\
+ \ }\r\n ],\"constraints\":{\r\n \"maxWallClockTime\"\
+ :\"PT1H\",\"retentionTime\":\"P10675199DT2H48M5.4775807S\",\"maxTaskRetryCount\"\
+ :5\r\n },\"runElevated\":false,\"runExclusive\":true,\"killJobOnCompletion\"\
+ :false\r\n },\"jobPreparationTask\":{\r\n \"id\":\"jobPrep\",\"\
+ commandLine\":\"cmd /c dir /s\",\"resourceFiles\":[\r\n {\r\n \
+ \ \"blobSource\":\"https://testacct.blob.core.windows.net/\",\"filePath\"\
+ :\"jobPrepFilePath\"\r\n }\r\n ],\"environmentSettings\":[\r\
+ \n {\r\n \"name\":\"jobPrepName1\",\"value\":\"jobPrepValue1\"\
+ \r\n },{\r\n \"name\":\"jobPrepName2\",\"value\":\"jobPrepValue2\"\
+ \r\n }\r\n ],\"constraints\":{\r\n \"maxWallClockTime\"\
+ :\"P10675199DT2H48M5.4775807S\",\"retentionTime\":\"P10675199DT2H48M5.4775807S\"\
+ ,\"maxTaskRetryCount\":2\r\n },\"runElevated\":false,\"waitForSuccess\"\
+ :true,\"rerunOnNodeRebootAfterSuccess\":true\r\n },\"jobReleaseTask\"\
+ :{\r\n \"id\":\"jobRelease\",\"commandLine\":\"cmd /c dir /s\",\"resourceFiles\"\
+ :[\r\n {\r\n \"blobSource\":\"https://testacct.blob.core.windows.net/\"\
+ ,\"filePath\":\"jobReleaseFilePath\"\r\n }\r\n ],\"environmentSettings\"\
+ :[\r\n {\r\n \"name\":\"jobReleaseName1\",\"value\":\"\
+ jobReleaseValue1\"\r\n },{\r\n \"name\":\"jobReleaseName2\"\
+ ,\"value\":\"jobReleaseValue2\"\r\n }\r\n ],\"maxWallClockTime\"\
+ :\"PT15M\",\"retentionTime\":\"P10675199DT2H48M5.4775807S\",\"runElevated\"\
+ :false\r\n },\"commonEnvironmentSettings\":[\r\n {\r\n \
+ \ \"name\":\"commonName1\",\"value\":\"commonValue1\"\r\n },{\r\n\
+ \ \"name\":\"commonName2\",\"value\":\"commonValue2\"\r\n \
+ \ }\r\n ],\"poolInfo\":{\r\n \"autoPoolSpecification\":{\r\n \
+ \ \"autoPoolIdPrefix\":\"TestSpecPrefix\",\"poolLifetimeOption\":\"\
+ jobschedule\",\"keepAlive\":false,\"pool\":{\r\n \"vmSize\":\"\
+ small\",\"maxTasksPerNode\":1,\"taskSchedulingPolicy\":{\r\n \
+ \ \"nodeFillType\":\"Spread\"\r\n },\"resizeTimeout\":\"PT15M\"\
+ ,\"targetDedicated\":3,\"enableAutoScale\":false,\"enableInterNodeCommunication\"\
+ :false,\"startTask\":{\r\n \"commandLine\":\"cmd /c dir /s\"\
+ ,\"runElevated\":false,\"maxTaskRetryCount\":0,\"waitForSuccess\":false\r\n\
+ \ },\"certificateReferences\":[\r\n {\r\n \
+ \ \"thumbprint\":\"0123456789abcdef\",\"thumbprintAlgorithm\":\"sha1\"\
+ ,\"storeLocation\":\"LocalMachine\",\"storeName\":\"certStore\",\"visibility\"\
+ :[\r\n \"starttask\"\r\n ]\r\n \
+ \ }\r\n ],\"cloudServiceConfiguration\":{\r\n \"\
+ osFamily\":\"4\",\"targetOSVersion\":\"*\"\r\n }\r\n }\r\
+ \n }\r\n },\"metadata\":[\r\n {\r\n \"name\":\"\
+ specMeta1\",\"value\":\"specMetaValue1\"\r\n },{\r\n \"name\"\
+ :\"specMeta2\",\"value\":\"specMetaValue2\"\r\n }\r\n ],\"executionInfo\"\
+ :{\r\n \"startTime\":\"2017-01-24T07:15:13.5608787Z\",\"endTime\":\"\
+ 2017-01-24T07:15:13.9299459Z\",\"poolId\":\"TestSpecPrefix_B9AF0891-4824-4A11-AE45-399B6437E020\"\
+ ,\"schedulingError\":{\r\n \"category\":\"UserError\",\"code\":\"\
+ InvalidCertificatesInAutoPool\",\"message\":\"One or more certificates specified\
+ \ for the pool are invalid\",\"details\":[\r\n {\r\n \
+ \ \"name\":\"sha1-0123456789abcdef\",\"value\":\"The specified certificate\
+ \ does not exist.\"\r\n }\r\n ]\r\n }\r\n \
+ \ },\"onAllTasksComplete\":\"noaction\",\"onTaskFailure\":\"noaction\"\r\n\
+ \ }\r\n ]\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 07:15:16 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [b6de3308-4a40-4f6b-938e-a9831b27218e]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [db7ce8d0-e204-11e6-a0af-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 07:15:17 GMT']
+ method: DELETE
+ uri: https://test1.westus.batch.azure.com/jobs/xplatJob?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 07:15:16 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [06d23d62-d117-4bb3-8803-f9f7040ed226]
+ status: {code: 202, message: Accepted}
+version: 1
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_pool_cmd.yaml b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_pool_cmd.yaml
new file mode 100644
index 00000000000..9f54168306f
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_pool_cmd.yaml
@@ -0,0 +1,426 @@
+interactions:
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [a063bc00-e201-11e6-93a0-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 06:52:09 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools/xplatTestPool?api-version=2016-07-01.3.1&timeout=30
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools/@Element\"\
+ ,\"id\":\"xplatTestPool\",\"url\":\"https://test1.westus.batch.azure.com/pools/xplatTestPool\"\
+ ,\"eTag\":\"0x8D44424A8E0FA16\",\"lastModified\":\"2017-01-24T06:46:00.8910358Z\"\
+ ,\"creationTime\":\"2017-01-24T00:20:00.2512091Z\",\"state\":\"active\",\"\
+ stateTransitionTime\":\"2017-01-24T00:20:00.2512091Z\",\"allocationState\"\
+ :\"steady\",\"allocationStateTransitionTime\":\"2017-01-24T06:46:08.0218972Z\"\
+ ,\"vmSize\":\"small\",\"resizeTimeout\":\"PT15M\",\"resizeError\":{\r\n \
+ \ \"code\":\"ResizeStopped\",\"message\":\"Desired number of dedicated nodes\
+ \ could not be allocated due to a stop resize operation\"\r\n },\"currentDedicated\"\
+ :3,\"targetDedicated\":5,\"enableAutoScale\":false,\"enableInterNodeCommunication\"\
+ :true,\"startTask\":{\r\n \"commandLine\":\"cmd /c echo test\",\"runElevated\"\
+ :false,\"maxTaskRetryCount\":0,\"waitForSuccess\":true\r\n },\"maxTasksPerNode\"\
+ :1,\"taskSchedulingPolicy\":{\r\n \"nodeFillType\":\"Spread\"\r\n },\"\
+ cloudServiceConfiguration\":{\r\n \"osFamily\":\"4\",\"targetOSVersion\"\
+ :\"*\",\"currentOSVersion\":\"*\"\r\n }\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 06:52:11 GMT']
+ ETag: ['0x8D44424A8E0FA16']
+ Last-Modified: ['Tue, 24 Jan 2017 06:46:00 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [76159200-73e2-4bb0-a145-165804988056]
+ status: {code: 200, message: OK}
+- request:
+ body: '{"targetDedicated": 5}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['22']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [a226ad3a-e201-11e6-8551-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 06:52:12 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools/xplatTestPool/resize?api-version=2016-07-01.3.1&timeout=30
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/xplatTestPool/resize']
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 06:52:12 GMT']
+ ETag: ['0x8D4442586B417B8']
+ Last-Modified: ['Tue, 24 Jan 2017 06:52:13 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [b4440bbb-e807-42e0-a95e-687b8203d398]
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [a297e880-e201-11e6-b734-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 06:52:13 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools/xplatTestPool?api-version=2016-07-01.3.1&timeout=30
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools/@Element\"\
+ ,\"id\":\"xplatTestPool\",\"url\":\"https://test1.westus.batch.azure.com/pools/xplatTestPool\"\
+ ,\"eTag\":\"0x8D4442586B417B8\",\"lastModified\":\"2017-01-24T06:52:13.0510776Z\"\
+ ,\"creationTime\":\"2017-01-24T00:20:00.2512091Z\",\"state\":\"active\",\"\
+ stateTransitionTime\":\"2017-01-24T00:20:00.2512091Z\",\"allocationState\"\
+ :\"resizing\",\"allocationStateTransitionTime\":\"2017-01-24T06:52:13.0510776Z\"\
+ ,\"vmSize\":\"small\",\"resizeTimeout\":\"PT15M\",\"currentDedicated\":3,\"\
+ targetDedicated\":5,\"enableAutoScale\":false,\"enableInterNodeCommunication\"\
+ :true,\"startTask\":{\r\n \"commandLine\":\"cmd /c echo test\",\"runElevated\"\
+ :false,\"maxTaskRetryCount\":0,\"waitForSuccess\":true\r\n },\"maxTasksPerNode\"\
+ :1,\"taskSchedulingPolicy\":{\r\n \"nodeFillType\":\"Spread\"\r\n },\"\
+ cloudServiceConfiguration\":{\r\n \"osFamily\":\"4\",\"targetOSVersion\"\
+ :\"*\",\"currentOSVersion\":\"*\"\r\n }\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 06:52:13 GMT']
+ ETag: ['0x8D4442586B417B8']
+ Last-Modified: ['Tue, 24 Jan 2017 06:52:13 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [e9727830-154d-4d7c-9c51-9c4a2c1e0e2e]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [a3238a42-e201-11e6-8eb2-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 06:52:14 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools/xplatTestPool/stopresize?api-version=2016-07-01.3.1&timeout=30
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/xplatTestPool/stopresize']
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 06:52:13 GMT']
+ ETag: ['0x8D4442587B27807']
+ Last-Modified: ['Tue, 24 Jan 2017 06:52:14 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [9aa9e0e5-ff8a-4aea-a8e3-63753a0c297f]
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [c778659a-e201-11e6-b11d-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 06:53:15 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools/xplatTestPool?api-version=2016-07-01.3.1&timeout=30
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools/@Element\"\
+ ,\"id\":\"xplatTestPool\",\"url\":\"https://test1.westus.batch.azure.com/pools/xplatTestPool\"\
+ ,\"eTag\":\"0x8D4442587B27807\",\"lastModified\":\"2017-01-24T06:52:14.7181575Z\"\
+ ,\"creationTime\":\"2017-01-24T00:20:00.2512091Z\",\"state\":\"active\",\"\
+ stateTransitionTime\":\"2017-01-24T00:20:00.2512091Z\",\"allocationState\"\
+ :\"steady\",\"allocationStateTransitionTime\":\"2017-01-24T06:52:22.203492Z\"\
+ ,\"vmSize\":\"small\",\"resizeTimeout\":\"PT15M\",\"resizeError\":{\r\n \
+ \ \"code\":\"ResizeStopped\",\"message\":\"Desired number of dedicated nodes\
+ \ could not be allocated due to a stop resize operation\"\r\n },\"currentDedicated\"\
+ :3,\"targetDedicated\":5,\"enableAutoScale\":false,\"enableInterNodeCommunication\"\
+ :true,\"startTask\":{\r\n \"commandLine\":\"cmd /c echo test\",\"runElevated\"\
+ :false,\"maxTaskRetryCount\":0,\"waitForSuccess\":true\r\n },\"maxTasksPerNode\"\
+ :1,\"taskSchedulingPolicy\":{\r\n \"nodeFillType\":\"Spread\"\r\n },\"\
+ cloudServiceConfiguration\":{\r\n \"osFamily\":\"4\",\"targetOSVersion\"\
+ :\"*\",\"currentOSVersion\":\"*\"\r\n }\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 06:53:14 GMT']
+ ETag: ['0x8D4442587B27807']
+ Last-Modified: ['Tue, 24 Jan 2017 06:52:14 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [af2d723c-ba40-465a-84c4-d6ca866b9e8f]
+ status: {code: 200, message: OK}
+- request:
+ body: '{"cloudServiceConfiguration": {"targetOSVersion": "*", "osFamily": "4"},
+ "targetDedicated": 0, "id": "xplatCreatedPool", "startTask": {"commandLine":
+ "cmd /c echo test", "waitForSuccess": true}, "vmSize": "small"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['213']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [c80bf6d0-e201-11e6-be2c-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 06:53:16 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools?api-version=2016-07-01.3.1&timeout=30
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/xplatCreatedPool']
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 06:53:16 GMT']
+ ETag: ['0x8D44425AC99866B']
+ Last-Modified: ['Tue, 24 Jan 2017 06:53:16 GMT']
+ Location: ['https://test1.westus.batch.azure.com/pools/xplatCreatedPool']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [91c64071-e86c-4c58-853e-1e905e4d671d]
+ status: {code: 201, message: Created}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [c8aafa00-e201-11e6-847d-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 06:53:17 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools/xplatCreatedPool?api-version=2016-07-01.3.1&timeout=30
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools/@Element\"\
+ ,\"id\":\"xplatCreatedPool\",\"url\":\"https://test1.westus.batch.azure.com/pools/xplatCreatedPool\"\
+ ,\"eTag\":\"0x8D44425AC99866B\",\"lastModified\":\"2017-01-24T06:53:16.6303851Z\"\
+ ,\"creationTime\":\"2017-01-24T06:53:16.6303851Z\",\"state\":\"active\",\"\
+ stateTransitionTime\":\"2017-01-24T06:53:16.6303851Z\",\"allocationState\"\
+ :\"steady\",\"allocationStateTransitionTime\":\"2017-01-24T06:53:16.7782376Z\"\
+ ,\"vmSize\":\"small\",\"resizeTimeout\":\"PT15M\",\"currentDedicated\":0,\"\
+ targetDedicated\":0,\"enableAutoScale\":false,\"enableInterNodeCommunication\"\
+ :false,\"startTask\":{\r\n \"commandLine\":\"cmd /c echo test\",\"runElevated\"\
+ :false,\"maxTaskRetryCount\":0,\"waitForSuccess\":true\r\n },\"maxTasksPerNode\"\
+ :1,\"taskSchedulingPolicy\":{\r\n \"nodeFillType\":\"Spread\"\r\n },\"\
+ cloudServiceConfiguration\":{\r\n \"osFamily\":\"4\",\"targetOSVersion\"\
+ :\"*\",\"currentOSVersion\":\"*\"\r\n }\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 06:53:17 GMT']
+ ETag: ['0x8D44425AC99866B']
+ Last-Modified: ['Tue, 24 Jan 2017 06:53:16 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [c0bcfecc-9a40-4356-829e-69916c133ec8]
+ status: {code: 200, message: OK}
+- request:
+ body: '{"certificateReferences": [], "startTask": {"commandLine": "cmd /c echo
+ updated", "waitForSuccess": true}, "applicationPackageReferences": [], "metadata":
+ []}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['158']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [c956a7b6-e201-11e6-9a40-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 06:53:18 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools/xplatCreatedPool/updateproperties?api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ Content-Length: ['0']
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/xplatCreatedPool/updateproperties']
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 06:53:17 GMT']
+ ETag: ['0x8D44425ADE5DB18']
+ Last-Modified: ['Tue, 24 Jan 2017 06:53:18 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ X-Content-Type-Options: [nosniff]
+ request-id: [924fdc46-b11c-4fb2-87dd-118bc11f0c9f]
+ status: {code: 204, message: No Content}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [c97be3ec-e201-11e6-b771-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 06:53:18 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools/xplatCreatedPool?api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools/@Element\"\
+ ,\"id\":\"xplatCreatedPool\",\"url\":\"https://test1.westus.batch.azure.com/pools/xplatCreatedPool\"\
+ ,\"eTag\":\"0x8D44425ADE5DB18\",\"lastModified\":\"2017-01-24T06:53:18.808348Z\"\
+ ,\"creationTime\":\"2017-01-24T06:53:16.6303851Z\",\"state\":\"active\",\"\
+ stateTransitionTime\":\"2017-01-24T06:53:16.6303851Z\",\"allocationState\"\
+ :\"steady\",\"allocationStateTransitionTime\":\"2017-01-24T06:53:16.7782376Z\"\
+ ,\"vmSize\":\"small\",\"resizeTimeout\":\"PT15M\",\"currentDedicated\":0,\"\
+ targetDedicated\":0,\"enableAutoScale\":false,\"enableInterNodeCommunication\"\
+ :false,\"startTask\":{\r\n \"commandLine\":\"cmd /c echo updated\",\"runElevated\"\
+ :false,\"maxTaskRetryCount\":0,\"waitForSuccess\":true\r\n },\"maxTasksPerNode\"\
+ :1,\"taskSchedulingPolicy\":{\r\n \"nodeFillType\":\"Spread\"\r\n },\"\
+ cloudServiceConfiguration\":{\r\n \"osFamily\":\"4\",\"targetOSVersion\"\
+ :\"*\",\"currentOSVersion\":\"*\"\r\n }\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 06:53:18 GMT']
+ ETag: ['0x8D44425ADE5DB18']
+ Last-Modified: ['Tue, 24 Jan 2017 06:53:18 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [2d47364a-941d-48f8-ade6-9e6746450110]
+ status: {code: 200, message: OK}
+- request:
+ body: '{"certificateReferences": [], "startTask": {"commandLine": "hostname"},
+ "applicationPackageReferences": [], "metadata": [{"name": "a", "value": "b"},
+ {"name": "c", "value": "d"}]}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['179']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [ca0366e2-e201-11e6-ad0b-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 06:53:19 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools/xplatCreatedPool/updateproperties?api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ Content-Length: ['0']
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/xplatCreatedPool/updateproperties']
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 06:53:19 GMT']
+ ETag: ['0x8D44425AE91B9F6']
+ Last-Modified: ['Tue, 24 Jan 2017 06:53:19 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ X-Content-Type-Options: [nosniff]
+ request-id: [a43cf504-086e-453b-a625-43d491906d9f]
+ status: {code: 204, message: No Content}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [ca26ce4a-e201-11e6-857e-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 06:53:19 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools/xplatCreatedPool?api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools/@Element\"\
+ ,\"id\":\"xplatCreatedPool\",\"url\":\"https://test1.westus.batch.azure.com/pools/xplatCreatedPool\"\
+ ,\"eTag\":\"0x8D44425AE91B9F6\",\"lastModified\":\"2017-01-24T06:53:19.934719Z\"\
+ ,\"creationTime\":\"2017-01-24T06:53:16.6303851Z\",\"state\":\"active\",\"\
+ stateTransitionTime\":\"2017-01-24T06:53:16.6303851Z\",\"allocationState\"\
+ :\"steady\",\"allocationStateTransitionTime\":\"2017-01-24T06:53:16.7782376Z\"\
+ ,\"vmSize\":\"small\",\"resizeTimeout\":\"PT15M\",\"currentDedicated\":0,\"\
+ targetDedicated\":0,\"enableAutoScale\":false,\"enableInterNodeCommunication\"\
+ :false,\"startTask\":{\r\n \"commandLine\":\"hostname\",\"runElevated\"\
+ :false,\"maxTaskRetryCount\":0,\"waitForSuccess\":false\r\n },\"metadata\"\
+ :[\r\n {\r\n \"name\":\"a\",\"value\":\"b\"\r\n },{\r\n \"\
+ name\":\"c\",\"value\":\"d\"\r\n }\r\n ],\"maxTasksPerNode\":1,\"taskSchedulingPolicy\"\
+ :{\r\n \"nodeFillType\":\"Spread\"\r\n },\"cloudServiceConfiguration\"\
+ :{\r\n \"osFamily\":\"4\",\"targetOSVersion\":\"*\",\"currentOSVersion\"\
+ :\"*\"\r\n }\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 06:53:18 GMT']
+ ETag: ['0x8D44425AE91B9F6']
+ Last-Modified: ['Tue, 24 Jan 2017 06:53:19 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [461fa0b9-9794-4029-a3ab-cfd513efb43c]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [cac4e714-e201-11e6-9291-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 06:53:20 GMT']
+ method: DELETE
+ uri: https://test1.westus.batch.azure.com/pools/xplatCreatedPool?api-version=2016-07-01.3.1&timeout=30
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 06:53:20 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [86f1cba5-4393-46de-9cf1-07fcfdb37912]
+ status: {code: 202, message: Accepted}
+version: 1
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_pools.yaml b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_pools.yaml
new file mode 100644
index 00000000000..00c61ff11af
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_pools.yaml
@@ -0,0 +1,745 @@
+interactions:
+- request:
+ body: '{"vmSize": "small", "cloudServiceConfiguration": {"osFamily": "4"}, "id":
+ "azure-cli-test-paas"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['96']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [f550b2e4-e1c6-11e6-a00f-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:11 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/azure-cli-test-paas']
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:13 GMT']
+ ETag: ['0x8D443EADAC12B54']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:13 GMT']
+ Location: ['https://test1.westus.batch.azure.com/pools/azure-cli-test-paas']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [2d7f8961-8904-4ce1-bce0-3577774be6ca]
+ status: {code: 201, message: Created}
+- request:
+ body: '{"vmSize": "Standard_A1", "virtualMachineConfiguration": {"nodeAgentSKUId":
+ "batch.node.ubuntu 16.04", "imageReference": {"offer": "UbuntuServer", "publisher":
+ "Canonical", "sku": "16.04.0-LTS"}}, "id": "azure-cli-test-iaas"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['225']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [f73284e4-e1c6-11e6-a068-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:14 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/azure-cli-test-iaas']
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:13 GMT']
+ ETag: ['0x8D443EADB55F1D1']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:14 GMT']
+ Location: ['https://test1.westus.batch.azure.com/pools/azure-cli-test-iaas']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [78b810fb-3d59-4faf-981c-fa2e9f296af7]
+ status: {code: 201, message: Created}
+- request:
+ body: '{"cloudServiceConfiguration": {"osFamily": "4", "targetOSVersion": "*"},
+ "id": "azure-cli-test-json", "resizeTimeout": "PT15M", "startTask": {"commandLine":
+ "cmd /c echo test", "waitForSuccess": true}, "vmSize": "small", "targetDedicated":
+ 2}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['242']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [f90073ae-e1c6-11e6-be4a-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:17 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/azure-cli-test-json']
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:18 GMT']
+ ETag: ['0x8D443EADD4E4364']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:18 GMT']
+ Location: ['https://test1.westus.batch.azure.com/pools/azure-cli-test-json']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [9f27bd16-acf6-44ed-85b1-a60265719d1f]
+ status: {code: 201, message: Created}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [fa980f24-e1c6-11e6-873b-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:20 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools\"\
+ ,\"value\":[\r\n {\r\n \"id\":\"azure-cli-test-iaas\",\"url\":\"https://test1.westus.batch.azure.com/pools/azure-cli-test-iaas\"\
+ ,\"eTag\":\"0x8D443EADB55F1D1\",\"lastModified\":\"2017-01-23T23:52:14.7333585Z\"\
+ ,\"creationTime\":\"2017-01-23T23:52:14.7333585Z\",\"state\":\"active\",\"\
+ stateTransitionTime\":\"2017-01-23T23:52:14.7333585Z\",\"allocationState\"\
+ :\"steady\",\"allocationStateTransitionTime\":\"2017-01-23T23:52:15.2893726Z\"\
+ ,\"vmSize\":\"standard_a1\",\"resizeTimeout\":\"PT15M\",\"currentDedicated\"\
+ :0,\"targetDedicated\":0,\"enableAutoScale\":false,\"enableInterNodeCommunication\"\
+ :false,\"maxTasksPerNode\":1,\"taskSchedulingPolicy\":{\r\n \"nodeFillType\"\
+ :\"Spread\"\r\n },\"virtualMachineConfiguration\":{\r\n \"imageReference\"\
+ :{\r\n \"publisher\":\"Canonical\",\"offer\":\"UbuntuServer\",\"\
+ sku\":\"16.04.0-LTS\",\"version\":\"latest\"\r\n },\"nodeAgentSKUId\"\
+ :\"batch.node.ubuntu 16.04\"\r\n }\r\n },{\r\n \"id\":\"azure-cli-test-json\"\
+ ,\"url\":\"https://test1.westus.batch.azure.com/pools/azure-cli-test-json\"\
+ ,\"eTag\":\"0x8D443EADD4E4364\",\"lastModified\":\"2017-01-23T23:52:18.0384612Z\"\
+ ,\"creationTime\":\"2017-01-23T23:52:18.0384612Z\",\"state\":\"active\",\"\
+ stateTransitionTime\":\"2017-01-23T23:52:18.0384612Z\",\"allocationState\"\
+ :\"resizing\",\"allocationStateTransitionTime\":\"2017-01-23T23:52:18.0384612Z\"\
+ ,\"vmSize\":\"small\",\"resizeTimeout\":\"PT15M\",\"currentDedicated\":0,\"\
+ targetDedicated\":2,\"enableAutoScale\":false,\"enableInterNodeCommunication\"\
+ :false,\"startTask\":{\r\n \"commandLine\":\"cmd /c echo test\",\"\
+ runElevated\":false,\"maxTaskRetryCount\":0,\"waitForSuccess\":true\r\n \
+ \ },\"maxTasksPerNode\":1,\"taskSchedulingPolicy\":{\r\n \"nodeFillType\"\
+ :\"Spread\"\r\n },\"cloudServiceConfiguration\":{\r\n \"osFamily\"\
+ :\"4\",\"targetOSVersion\":\"*\",\"currentOSVersion\":\"*\"\r\n }\r\n\
+ \ },{\r\n \"id\":\"azure-cli-test-paas\",\"url\":\"https://test1.westus.batch.azure.com/pools/azure-cli-test-paas\"\
+ ,\"eTag\":\"0x8D443EADAC12B54\",\"lastModified\":\"2017-01-23T23:52:13.7583444Z\"\
+ ,\"creationTime\":\"2017-01-23T23:52:13.7583444Z\",\"state\":\"active\",\"\
+ stateTransitionTime\":\"2017-01-23T23:52:13.7583444Z\",\"allocationState\"\
+ :\"steady\",\"allocationStateTransitionTime\":\"2017-01-23T23:52:13.9853568Z\"\
+ ,\"vmSize\":\"small\",\"resizeTimeout\":\"PT15M\",\"currentDedicated\":0,\"\
+ targetDedicated\":0,\"enableAutoScale\":false,\"enableInterNodeCommunication\"\
+ :false,\"maxTasksPerNode\":1,\"taskSchedulingPolicy\":{\r\n \"nodeFillType\"\
+ :\"Spread\"\r\n },\"cloudServiceConfiguration\":{\r\n \"osFamily\"\
+ :\"4\",\"targetOSVersion\":\"*\",\"currentOSVersion\":\"*\"\r\n }\r\n\
+ \ }\r\n ]\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:20 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [847425c3-c53b-4340-b5d8-4c574711bc25]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [fb19bd74-e1c6-11e6-aeb6-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:21 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools?timeout=30&$filter=id%20eq%20%27azure-cli-test-paas%27&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools\"\
+ ,\"value\":[\r\n {\r\n \"id\":\"azure-cli-test-paas\",\"url\":\"https://test1.westus.batch.azure.com/pools/azure-cli-test-paas\"\
+ ,\"eTag\":\"0x8D443EADAC12B54\",\"lastModified\":\"2017-01-23T23:52:13.7583444Z\"\
+ ,\"creationTime\":\"2017-01-23T23:52:13.7583444Z\",\"state\":\"active\",\"\
+ stateTransitionTime\":\"2017-01-23T23:52:13.7583444Z\",\"allocationState\"\
+ :\"steady\",\"allocationStateTransitionTime\":\"2017-01-23T23:52:13.9853568Z\"\
+ ,\"vmSize\":\"small\",\"resizeTimeout\":\"PT15M\",\"currentDedicated\":0,\"\
+ targetDedicated\":0,\"enableAutoScale\":false,\"enableInterNodeCommunication\"\
+ :false,\"maxTasksPerNode\":1,\"taskSchedulingPolicy\":{\r\n \"nodeFillType\"\
+ :\"Spread\"\r\n },\"cloudServiceConfiguration\":{\r\n \"osFamily\"\
+ :\"4\",\"targetOSVersion\":\"*\",\"currentOSVersion\":\"*\"\r\n }\r\n\
+ \ }\r\n ]\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:20 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [155fb20a-6a06-4bda-896a-eebd56d5d1c8]
+ status: {code: 200, message: OK}
+- request:
+ body: '{"targetDedicated": 5}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['22']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [fbc198ae-e1c6-11e6-8c19-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:22 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-paas/resize?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/azure-cli-test-paas/resize']
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:22 GMT']
+ ETag: ['0x8D443EADFDFC929']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:22 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [0d410380-0e7c-4533-b657-ba32cf8ec358]
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [fc416250-e1c6-11e6-bb2f-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:23 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-paas?timeout=30&$select=allocationState%2C%20targetDedicated&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools/@Element\"\
+ ,\"allocationState\":\"resizing\",\"targetDedicated\":5\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:22 GMT']
+ ETag: ['0x8D443EADFDFC929']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:22 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [78439dbb-f1da-47fb-a496-e3b23fb1921b]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [fcccd66c-e1c6-11e6-92dd-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:24 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-paas/stopresize?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/azure-cli-test-paas/stopresize']
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:24 GMT']
+ ETag: ['0x8D443EAE0F18A3D']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:24 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [23f7ab27-8fc0-4a42-80a9-ccc4cce299ea]
+ status: {code: 202, message: Accepted}
+- request:
+ body: '{"autoScaleFormula": "$TargetDedicated=3"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['42']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [fd6abde6-e1c6-11e6-9e21-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:25 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-iaas/enableautoscale?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/azure-cli-test-iaas/enableautoscale']
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:25 GMT']
+ ETag: ['0x8D443EAE189D3F9']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:25 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [7f7732e8-d7fa-4f67-b1fa-cd7535b34a9d]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [fdff38be-e1c6-11e6-8fd3-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:26 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-iaas?timeout=30&$select=enableAutoScale&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools/@Element\"\
+ ,\"enableAutoScale\":true\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:26 GMT']
+ ETag: ['0x8D443EAE189D3F9']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:25 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [a9adaa39-430c-4a13-98ec-57e622eb9513]
+ status: {code: 200, message: OK}
+- request:
+ body: '{"autoScaleFormula": "$TargetDedicated=3"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['42']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [feaf1b1e-e1c6-11e6-9845-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:27 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-iaas/evaluateautoscale?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#Microsoft.Azure.Batch.Protocol.Entities.AutoScaleRun\"\
+ ,\"timestamp\":\"2017-01-23T23:52:27.3571622Z\",\"results\":\"$TargetDedicated=3;$NodeDeallocationOption=requeue\"\
+ \r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/azure-cli-test-iaas/evaluateautoscale']
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:27 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [592d4d3f-851f-4d3d-a38c-a3db54124922]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [ff3c63b4-e1c6-11e6-b988-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:28 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-iaas/disableautoscale?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/azure-cli-test-iaas/disableautoscale']
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:28 GMT']
+ ETag: ['0x8D443EAE35EA5D7']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:28 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [372e10ea-c4d9-4c25-b14e-14e54854c6da]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [ffb9ffec-e1c6-11e6-9e66-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:29 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-iaas?timeout=30&$select=enableAutoScale&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools/@Element\"\
+ ,\"enableAutoScale\":false\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:28 GMT']
+ ETag: ['0x8D443EAE35EA5D7']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:28 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [c71a3996-5269-47ff-b09a-f9670f828ea9]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [003c1d42-e1c7-11e6-8724-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:30 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/poolusagemetrics?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#poolusagemetrics\"\
+ ,\"value\":[\r\n {\r\n \"poolId\":\"luxblend_pool_2016-12-11-20-17-19-535237\"\
+ ,\"startTime\":\"2017-01-23T17:00:00Z\",\"endTime\":\"2017-01-23T17:30:00Z\"\
+ ,\"vmSize\":\"standard_nc24\",\"totalCoreHours\":6.9306946060000012,\"dataIngressGiB\"\
+ :0.0,\"dataEgressGiB\":0.0\r\n }\r\n ]\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:29 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [3d991166-4591-4745-95fe-0db8bd03ba2c]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [00e818fe-e1c7-11e6-b6e7-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:31 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-json?timeout=30&$select=startTask&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools/@Element\"\
+ ,\"startTask\":{\r\n \"commandLine\":\"cmd /c echo test\",\"runElevated\"\
+ :false,\"maxTaskRetryCount\":0,\"waitForSuccess\":true\r\n }\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:30 GMT']
+ ETag: ['0x8D443EADD4E4364']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:18 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [c0b69132-5a22-4498-8f5b-9250d95e0469]
+ status: {code: 200, message: OK}
+- request:
+ body: '{"startTask": {"commandLine": "new_value"}}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['43']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [014de2d0-e1c7-11e6-a10d-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:31 GMT']
+ method: PATCH
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-json?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/pools/azure-cli-test-json']
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:31 GMT']
+ ETag: ['0x8D443EAE56FF009']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:31 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [a2619bb4-d5aa-4919-a0b1-7fa722aedea6]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [01dbc5a2-e1c7-11e6-8dde-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:32 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-json?timeout=30&$select=startTask&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools/@Element\"\
+ ,\"startTask\":{\r\n \"commandLine\":\"new_value\",\"runElevated\":false,\"\
+ maxTaskRetryCount\":0,\"waitForSuccess\":false\r\n }\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:32 GMT']
+ ETag: ['0x8D443EAE56FF009']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:31 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [c51f4e38-b5bb-406d-9e0a-6a6b714cab0b]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [02793410-e1c7-11e6-8485-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:33 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/nodeagentskus?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#nodeagentskus\"\
+ ,\"value\":[\r\n {\r\n \"id\":\"batch.node.centos 7\",\"verifiedImageReferences\"\
+ :[\r\n {\r\n \"publisher\":\"OpenLogic\",\"offer\":\"CentOS\"\
+ ,\"sku\":\"7.2\",\"version\":\"latest\"\r\n },{\r\n \"publisher\"\
+ :\"OpenLogic\",\"offer\":\"CentOS\",\"sku\":\"7.1\",\"version\":\"latest\"\
+ \r\n },{\r\n \"publisher\":\"OpenLogic\",\"offer\":\"CentOS\"\
+ ,\"sku\":\"7.0\",\"version\":\"latest\"\r\n },{\r\n \"publisher\"\
+ :\"OpenLogic\",\"offer\":\"CentOS-HPC\",\"sku\":\"7.1\",\"version\":\"latest\"\
+ \r\n },{\r\n \"publisher\":\"Oracle\",\"offer\":\"Oracle-Linux\"\
+ ,\"sku\":\"7.2\",\"version\":\"latest\"\r\n },{\r\n \"publisher\"\
+ :\"Oracle\",\"offer\":\"Oracle-Linux\",\"sku\":\"7.0\",\"version\":\"latest\"\
+ \r\n },{\r\n \"publisher\":\"microsoft-ads\",\"offer\":\"\
+ linux-data-science-vm\",\"sku\":\"linuxdsvm\",\"version\":\"latest\"\r\n \
+ \ }\r\n ],\"osType\":\"linux\"\r\n },{\r\n \"id\":\"batch.node.debian\
+ \ 8\",\"verifiedImageReferences\":[\r\n {\r\n \"publisher\"\
+ :\"Credativ\",\"offer\":\"Debian\",\"sku\":\"8\",\"version\":\"latest\"\r\n\
+ \ }\r\n ],\"osType\":\"linux\"\r\n },{\r\n \"id\":\"batch.node.opensuse\
+ \ 13.2\",\"verifiedImageReferences\":[\r\n {\r\n \"publisher\"\
+ :\"SUSE\",\"offer\":\"openSUSE\",\"sku\":\"13.2\",\"version\":\"latest\"\r\
+ \n }\r\n ],\"osType\":\"linux\"\r\n },{\r\n \"id\":\"\
+ batch.node.opensuse 42.1\",\"verifiedImageReferences\":[\r\n {\r\n\
+ \ \"publisher\":\"SUSE\",\"offer\":\"openSUSE-Leap\",\"sku\":\"42.1\"\
+ ,\"version\":\"latest\"\r\n },{\r\n \"publisher\":\"SUSE\"\
+ ,\"offer\":\"SLES\",\"sku\":\"12-SP1\",\"version\":\"latest\"\r\n },{\r\
+ \n \"publisher\":\"SUSE\",\"offer\":\"SLES-HPC\",\"sku\":\"12-SP1\"\
+ ,\"version\":\"latest\"\r\n }\r\n ],\"osType\":\"linux\"\r\n \
+ \ },{\r\n \"id\":\"batch.node.ubuntu 14.04\",\"verifiedImageReferences\"\
+ :[\r\n {\r\n \"publisher\":\"Canonical\",\"offer\":\"UbuntuServer\"\
+ ,\"sku\":\"14.04.5-LTS\",\"version\":\"latest\"\r\n }\r\n ],\"\
+ osType\":\"linux\"\r\n },{\r\n \"id\":\"batch.node.ubuntu 16.04\"\
+ ,\"verifiedImageReferences\":[\r\n {\r\n \"publisher\":\"\
+ Canonical\",\"offer\":\"UbuntuServer\",\"sku\":\"16.04.0-LTS\",\"version\"\
+ :\"latest\"\r\n }\r\n ],\"osType\":\"linux\"\r\n },{\r\n \
+ \ \"id\":\"batch.node.windows amd64\",\"verifiedImageReferences\":[\r\n\
+ \ {\r\n \"publisher\":\"MicrosoftWindowsServer\",\"offer\"\
+ :\"WindowsServer\",\"sku\":\"2012-R2-Datacenter\",\"version\":\"latest\"\r\
+ \n },{\r\n \"publisher\":\"MicrosoftWindowsServer\",\"offer\"\
+ :\"WindowsServer\",\"sku\":\"2012-Datacenter\",\"version\":\"latest\"\r\n\
+ \ },{\r\n \"publisher\":\"MicrosoftWindowsServer\",\"offer\"\
+ :\"WindowsServer\",\"sku\":\"2008-R2-SP1\",\"version\":\"latest\"\r\n \
+ \ },{\r\n \"publisher\":\"MicrosoftWindowsServer\",\"offer\":\"\
+ WindowsServer\",\"sku\":\"2016-Datacenter\",\"version\":\"latest\"\r\n \
+ \ },{\r\n \"publisher\":\"MicrosoftWindowsServer\",\"offer\"\
+ :\"WindowsServer\",\"sku\":\"2016-Datacenter-with-Containers\",\"version\"\
+ :\"latest\"\r\n },{\r\n \"publisher\":\"microsoft-ads\",\"\
+ offer\":\"standard-data-science-vm\",\"sku\":\"standard-data-science-vm\"\
+ ,\"version\":\"latest\"\r\n }\r\n ],\"osType\":\"windows\"\r\n\
+ \ }\r\n ]\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:33 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [47181dfd-d09c-45b0-924a-4e375e419a1e]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [02e5bde6-e1c7-11e6-85a4-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:34 GMT']
+ method: DELETE
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-iaas?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:34 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [c72cd167-87b9-437b-8002-81f13b09c4cc]
+ status: {code: 202, message: Accepted}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [037344ac-e1c7-11e6-b19e-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:35 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-iaas?timeout=30&$select=state&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#pools/@Element\"\
+ ,\"state\":\"deleting\"\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:34 GMT']
+ ETag: ['0x8D443EAE70326F6']
+ Last-Modified: ['Mon, 23 Jan 2017 23:52:34 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [0f0a563f-eaf7-4987-b2bf-eb0cb55292a9]
+ status: {code: 200, message: OK}
+- request:
+ body: '{"vmSize": "small", "applicationPackageReferences": [{"applicationId":
+ "does-not-exist"}], "cloudServiceConfiguration": {"osFamily": "4"}, "id": "app_package_test"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['164']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [03e8709a-e1c7-11e6-a409-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:36 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/pools?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#Microsoft.Azure.Batch.Protocol.Entities.Container.errors/@Element\"\
+ ,\"code\":\"InvalidApplicationPackageReferences\",\"message\":{\r\n \"\
+ lang\":\"en-US\",\"value\":\"One or more of the specified application package\
+ \ references are invalid.\\nRequestId:9232316a-a0cf-4f04-b30a-3acf5789b2f1\\\
+ nTime:2017-01-23T23:52:36.1309218Z\"\r\n },\"values\":[\r\n {\r\n \
+ \ \"key\":\"does-not-exist\",\"value\":\"The specified application package\
+ \ does not exist.\"\r\n }\r\n ]\r\n}"}
+ headers:
+ Content-Length: ['521']
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:35 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ X-Content-Type-Options: [nosniff]
+ request-id: [9232316a-a0cf-4f04-b30a-3acf5789b2f1]
+ status: {code: 409, message: One or more of the specified application package
+ references are invalid.}
+- request:
+ body: '{"applicationPackageReferences": [{"applicationId": "does-not-exist"}]}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['71']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.1 (Windows-8.1-6.3.9600-SP0) requests/2.9.1 msrest/0.4.4
+ msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [046ae30a-e1c7-11e6-99a4-54ee750f2fc7]
+ ocp-date: ['Mon, 23 Jan 2017 23:52:37 GMT']
+ method: PATCH
+ uri: https://test1.westus.batch.azure.com/pools/azure-cli-test-paas?timeout=30&api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#Microsoft.Azure.Batch.Protocol.Entities.Container.errors/@Element\"\
+ ,\"code\":\"InvalidApplicationPackageReferences\",\"message\":{\r\n \"\
+ lang\":\"en-US\",\"value\":\"One or more of the specified application package\
+ \ references are invalid.\\nRequestId:e3baa04b-f7f7-453b-9439-8002316f39f0\\\
+ nTime:2017-01-23T23:52:37.0798071Z\"\r\n },\"values\":[\r\n {\r\n \
+ \ \"key\":\"does-not-exist\",\"value\":\"The specified application package\
+ \ does not exist.\"\r\n }\r\n ]\r\n}"}
+ headers:
+ Content-Length: ['521']
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Mon, 23 Jan 2017 23:52:36 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ X-Content-Type-Options: [nosniff]
+ request-id: [e3baa04b-f7f7-453b-9439-8002316f39f0]
+ status: {code: 409, message: One or more of the specified application package
+ references are invalid.}
+version: 1
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_task_create_cmd.yaml b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_task_create_cmd.yaml
new file mode 100644
index 00000000000..98f308c2214
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/recordings/test_batch_task_create_cmd.yaml
@@ -0,0 +1,237 @@
+interactions:
+- request:
+ body: '{"runElevated": false, "displayName": "displayName", "multiInstanceSettings":
+ {"numberOfInstances": 3, "coordinationCommandLine": "cmd /c echo hello"}, "environmentSettings":
+ [{"name": "env1", "value": "value1"}, {"name": "env2", "value": "value2"}],
+ "id": "xplatTask", "constraints": {"maxWallClockTime": "P1D", "maxTaskRetryCount":
+ 2}, "commandLine": "cmd /c dir /s"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['369']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [a4510886-e212-11e6-a2e1-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 08:53:57 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks?api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks/xplatTask']
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 08:53:56 GMT']
+ ETag: ['0x8D44436885A27E6']
+ Last-Modified: ['Tue, 24 Jan 2017 08:53:57 GMT']
+ Location: ['https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks/xplatTask']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [5128a0d3-cca4-4327-9fd0-80f30f02db65]
+ status: {code: 201, message: Created}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [a46f8dd0-e212-11e6-a2ab-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 08:53:57 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks/xplatTask?api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#tasks/@Element\"\
+ ,\"id\":\"xplatTask\",\"displayName\":\"displayName\",\"url\":\"https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks/xplatTask\"\
+ ,\"eTag\":\"0x8D44436885A27E6\",\"creationTime\":\"2017-01-24T08:53:57.2615142Z\"\
+ ,\"lastModified\":\"2017-01-24T08:53:57.2615142Z\",\"state\":\"active\",\"\
+ stateTransitionTime\":\"2017-01-24T08:53:57.2615142Z\",\"commandLine\":\"\
+ cmd /c dir /s\",\"environmentSettings\":[\r\n {\r\n \"name\":\"env1\"\
+ ,\"value\":\"value1\"\r\n },{\r\n \"name\":\"env2\",\"value\":\"value2\"\
+ \r\n }\r\n ],\"runElevated\":false,\"multiInstanceSettings\":{\r\n \
+ \ \"numberOfInstances\":3,\"coordinationCommandLine\":\"cmd /c echo hello\"\
+ \r\n },\"constraints\":{\r\n \"maxWallClockTime\":\"P1D\",\"retentionTime\"\
+ :\"P10675199DT2H48M5.4775807S\",\"maxTaskRetryCount\":2\r\n },\"executionInfo\"\
+ :{\r\n \"retryCount\":0,\"requeueCount\":0\r\n }\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 08:53:57 GMT']
+ ETag: ['0x8D44436885A27E6']
+ Last-Modified: ['Tue, 24 Jan 2017 08:53:57 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [2dbf2c65-e90d-4802-a088-7b2b6715ab69]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [a500adf6-e212-11e6-87ba-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 08:53:58 GMT']
+ method: DELETE
+ uri: https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks/xplatTask?api-version=2016-07-01.3.1&timeout=30
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 08:53:57 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [a5bdfd69-dbc8-4621-96b3-d409fe845eac]
+ status: {code: 200, message: OK}
+- request:
+ body: '{"id": "aaa", "commandLine": "echo hello"}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['42']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [a570fed4-e212-11e6-b573-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 08:53:59 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks?api-version=2016-07-01.3.1
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceId: ['https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks/aaa']
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 08:53:59 GMT']
+ ETag: ['0x8D4443689E3660D']
+ Last-Modified: ['Tue, 24 Jan 2017 08:53:59 GMT']
+ Location: ['https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks/aaa']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [ba2eaacd-be07-4b92-a3a1-66cf20167950]
+ status: {code: 201, message: Created}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [a5988508-e212-11e6-8c86-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 08:53:59 GMT']
+ method: GET
+ uri: https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks/aaa?api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#tasks/@Element\"\
+ ,\"id\":\"aaa\",\"url\":\"https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks/aaa\"\
+ ,\"eTag\":\"0x8D4443689E3660D\",\"creationTime\":\"2017-01-24T08:53:59.8386701Z\"\
+ ,\"lastModified\":\"2017-01-24T08:53:59.8386701Z\",\"state\":\"active\",\"\
+ stateTransitionTime\":\"2017-01-24T08:53:59.8386701Z\",\"commandLine\":\"\
+ echo hello\",\"runElevated\":false,\"constraints\":{\r\n \"maxWallClockTime\"\
+ :\"P10675199DT2H48M5.4775807S\",\"retentionTime\":\"P10675199DT2H48M5.4775807S\"\
+ ,\"maxTaskRetryCount\":5\r\n },\"executionInfo\":{\r\n \"retryCount\"\
+ :0,\"requeueCount\":0\r\n }\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 08:53:59 GMT']
+ ETag: ['0x8D4443689E3660D']
+ Last-Modified: ['Tue, 24 Jan 2017 08:53:59 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [0568049e-032a-4d1d-bc17-cd363154ee36]
+ status: {code: 200, message: OK}
+- request:
+ body: null
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['0']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [a630832c-e212-11e6-87a1-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 08:54:00 GMT']
+ method: DELETE
+ uri: https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks/aaa?api-version=2016-07-01.3.1&timeout=30
+ response:
+ body: {string: ''}
+ headers:
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 08:54:00 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [24a23dcb-8713-43a7-a736-2d0bad426590]
+ status: {code: 200, message: OK}
+- request:
+ body: '{"value": [{"runElevated": false, "displayName": "displayName", "environmentSettings":
+ [{"name": "env1", "value": "value1"}, {"name": "env2", "value": "value2"}],
+ "commandLine": "cmd /c dir /s", "constraints": {"maxWallClockTime": "P1D", "maxTaskRetryCount":
+ 2}, "id": "xplatTask1"}, {"runElevated": false, "id": "xplatTask2", "commandLine":
+ "cmd /c dir /s", "displayName": "displayName1", "constraints": {"maxWallClockTime":
+ "P1D", "maxTaskRetryCount": 2}}, {"id": "xplatTask3", "commandLine": "cmd /c
+ dir /s", "displayName": "displayName2", "environmentSettings": [{"name": "env1",
+ "value": "value1"}, {"name": "env2", "value": "value2"}]}]}'
+ headers:
+ Accept: [application/json]
+ Accept-Encoding: ['gzip, deflate']
+ Connection: [keep-alive]
+ Content-Length: ['643']
+ Content-Type: [application/json; odata=minimalmetadata; charset=utf-8]
+ User-Agent: [python/3.5.0 (Windows-2008ServerR2-6.1.7601-SP1) requests/2.9.1
+ msrest/0.4.4 msrest_azure/0.4.6 batchserviceclient/1.1.0 Azure-SDK-For-Python]
+ accept-language: [en-US]
+ client-request-id: [a6ca07fa-e212-11e6-9e57-24be0520f64e]
+ ocp-date: ['Tue, 24 Jan 2017 08:54:01 GMT']
+ method: POST
+ uri: https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/addtaskcollection?api-version=2016-07-01.3.1
+ response:
+ body: {string: "{\r\n \"odata.metadata\":\"https://test1.westus.batch.azure.com/$metadata#taskaddresult\"\
+ ,\"value\":[\r\n {\r\n \"status\":\"Success\",\"taskId\":\"xplatTask1\"\
+ ,\"eTag\":\"0x8D444368B049E3C\",\"lastModified\":\"2017-01-24T08:54:01.7340988Z\"\
+ ,\"location\":\"https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks/xplatTask1\"\
+ \r\n },{\r\n \"status\":\"Success\",\"taskId\":\"xplatTask3\",\"eTag\"\
+ :\"0x8D444368B09A8DE\",\"lastModified\":\"2017-01-24T08:54:01.767139Z\",\"\
+ location\":\"https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks/xplatTask3\"\
+ \r\n },{\r\n \"status\":\"Success\",\"taskId\":\"xplatTask2\",\"eTag\"\
+ :\"0x8D444368B0A1C6A\",\"lastModified\":\"2017-01-24T08:54:01.770097Z\",\"\
+ location\":\"https://test1.westus.batch.azure.com/jobs/xplatJobForTaskTests/tasks/xplatTask2\"\
+ \r\n }\r\n ]\r\n}"}
+ headers:
+ Content-Type: [application/json;odata=minimalmetadata]
+ DataServiceVersion: ['3.0']
+ Date: ['Tue, 24 Jan 2017 08:54:01 GMT']
+ Server: [Microsoft-HTTPAPI/2.0]
+ Strict-Transport-Security: [max-age=31536000; includeSubDomains]
+ Transfer-Encoding: [chunked]
+ X-Content-Type-Options: [nosniff]
+ request-id: [bac5e65f-daa7-4c42-95db-f57117a8211b]
+ status: {code: 200, message: OK}
+version: 1
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_commands.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_commands.py
new file mode 100644
index 00000000000..6cc99640bbf
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_commands.py
@@ -0,0 +1,685 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+import os
+import unittest
+import datetime
+import isodate
+import mock
+
+from msrest.exceptions import ValidationError, ClientRequestError
+from azure.batch import models, operations, BatchServiceClient
+from azure.batch.batch_auth import SharedKeyCredentials
+from azure.cli.core._util import CLIError
+
+from azure.cli.command_modules.batch import _validators
+from azure.cli.command_modules.batch import _command_type
+
+
+class TestObj(object):
+ # pylint: disable=too-many-instance-attributes,too-few-public-methods
+ pass
+
+
+class TestBatchValidators(unittest.TestCase):
+ # pylint: disable=attribute-defined-outside-init,no-member
+
+ def test_batch_datetime_format(self):
+ obj = _validators.datetime_format("2017-01-24T15:47:24Z")
+ self.assertIsInstance(obj, datetime.datetime)
+
+ with self.assertRaises(ValueError):
+ _validators.datetime_format("test")
+
+ def test_batch_duration_format(self):
+ obj = _validators.duration_format("P3Y6M4DT12H30M5S")
+ self.assertIsInstance(obj, isodate.Duration)
+
+ with self.assertRaises(ValueError):
+ _validators.duration_format("test")
+
+ def test_batch_metadata_item_format(self):
+ meta = _validators.metadata_item_format("name=value")
+ self.assertEqual(meta, {'name': 'name', 'value': 'value'})
+
+ with self.assertRaises(ValueError):
+ _validators.metadata_item_format("test")
+
+ with self.assertRaises(ValueError):
+ _validators.metadata_item_format("name=value=other")
+
+ def test_batch_environment_setting_format(self):
+ env = _validators.environment_setting_format("name=value")
+ self.assertEqual(env, {'name': 'name', 'value': 'value'})
+
+ with self.assertRaises(ValueError):
+ _validators.environment_setting_format("test")
+
+ with self.assertRaises(ValueError):
+ _validators.environment_setting_format("name=value=other")
+
+ def test_batch_application_package_reference_format(self):
+ ref = _validators.application_package_reference_format("app_1")
+ self.assertEqual(ref, {'application_id': 'app_1'})
+
+ ref = _validators.application_package_reference_format("app#1")
+ self.assertEqual(ref, {'application_id': 'app', 'version': '1'})
+
+ ref = _validators.application_package_reference_format("app#1#RC")
+ self.assertEqual(ref, {'application_id': 'app', 'version': '1#RC'})
+
+ def test_batch_certificate_reference_format(self):
+ cert = _validators.certificate_reference_format("thumbprint_lkjsahakjg")
+ self.assertEqual(cert, {'thumbprint': 'thumbprint_lkjsahakjg',
+ 'thumbprint_algorithm': 'sha1'})
+
+ def test_batch_task_id_ranges_format(self):
+ id_range = _validators.task_id_ranges_format("5-10")
+ self.assertEqual(id_range, {'start': 5, 'end': 10})
+
+ with self.assertRaises(ValueError):
+ _validators.task_id_ranges_format("5")
+
+ with self.assertRaises(ValueError):
+ _validators.task_id_ranges_format("test")
+
+ with self.assertRaises(ValueError):
+ _validators.environment_setting_format("5-")
+
+ with self.assertRaises(ValueError):
+ _validators.environment_setting_format("5-test")
+
+ with self.assertRaises(ValueError):
+ _validators.environment_setting_format("start-end")
+
+ def test_batch_resource_file_format(self):
+ meta = _validators.resource_file_format("file=source")
+ self.assertEqual(meta, {'file_path': 'file', 'blob_source': 'source'})
+
+ with self.assertRaises(ValueError):
+ _validators.resource_file_format("file")
+
+ with self.assertRaises(ValueError):
+ _validators.resource_file_format("file=source=mode")
+
+ def test_batch_validate_options(self):
+ ns = TestObj()
+ _validators.validate_options(ns)
+ self.assertFalse(hasattr(ns, 'ocp_range'))
+
+ ns.start_range = "100"
+ ns.end_range = None
+ _validators.validate_options(ns)
+ self.assertFalse(hasattr(ns, 'start_range'))
+ self.assertFalse(hasattr(ns, 'end_range'))
+ self.assertEqual(ns.ocp_range, "bytes=100-")
+
+ del ns.ocp_range
+ ns.start_range = None
+ ns.end_range = 150
+ _validators.validate_options(ns)
+ self.assertFalse(hasattr(ns, 'start_range'))
+ self.assertFalse(hasattr(ns, 'end_range'))
+ self.assertEqual(ns.ocp_range, "bytes=0-150")
+
+ del ns.ocp_range
+ ns.start_range = 11 # pylint: disable=redefined-variable-type
+ ns.end_range = 22
+ _validators.validate_options(ns)
+ self.assertFalse(hasattr(ns, 'start_range'))
+ self.assertFalse(hasattr(ns, 'end_range'))
+ self.assertEqual(ns.ocp_range, "bytes=11-22")
+
+ def test_batch_validate_file_destination(self):
+ ns = TestObj()
+ _validators.validate_file_destination(ns)
+ self.assertFalse(hasattr(ns, 'destination'))
+
+ ns.destination = os.path.dirname(__file__)
+ ns.file_name = "/wd/stdout.txt"
+ _validators.validate_file_destination(ns)
+ self.assertEqual(ns.destination, os.path.join(os.path.dirname(__file__), 'stdout.txt'))
+
+ ns.destination = __file__
+ with self.assertRaises(ValueError):
+ _validators.validate_file_destination(ns)
+
+ ns.destination = os.path.join(os.path.dirname(__file__), 'test.txt')
+ _validators.validate_file_destination(ns)
+ self.assertEqual(ns.destination, os.path.join(os.path.dirname(__file__), 'test.txt'))
+
+ ns.destination = "X:\\test.txt"
+ with self.assertRaises(ValueError):
+ _validators.validate_file_destination(ns)
+
+
+class TestBatchParser(unittest.TestCase):
+ # pylint: disable=attribute-defined-outside-init,protected-access
+
+ def test_batch_build_prefix(self):
+ resolved = _command_type._build_prefix('id', 'id', 'pool')
+ self.assertEqual(resolved, 'id')
+
+ resolved = _command_type._build_prefix('id', 'id', 'pool.start_task')
+ self.assertEqual(resolved, 'start_task_id')
+
+ resolved = _command_type._build_prefix('id', 'id', 'job_schedule.job_specification')
+ self.assertEqual(resolved, 'job_id')
+
+ resolved = _command_type._build_prefix('properties_id', 'id', 'pool.start_task.properties')
+ self.assertEqual(resolved, 'start_task_id')
+
+ resolved = _command_type._build_prefix('start_task_id', 'id', 'pool.start_task.properties')
+ self.assertEqual(resolved, 'pool_id')
+
+ resolved = _command_type._build_prefix('pool_id', 'id', 'pool.start_task.properties')
+ self.assertEqual(resolved, 'pool_id')
+
+ def test_batch_find_param_type(self):
+ model = TestObj()
+ model.__doc__ = """
+ :param name: The name of the environment variable.
+ :type name: str
+ :param value: The value of the environment variable.
+"""
+ self.assertEqual(_command_type.find_param_type(model, 'name'), 'str')
+
+ model.__doc__ = """
+ :param pool_get_options: Additional parameters for the operation
+ :type pool_get_options: :class:`PoolGetOptions
+ `
+ :param dict custom_headers: headers that will be added to the request
+"""
+ self.assertEqual(_command_type.find_param_type(model, 'pool_get_options'),
+ ':class:`PoolGetOptions`')
+
+ model.__doc__ = '''
+ :param node_fill_type: How tasks should be distributed across compute
+ nodes. Possible values include: 'spread', 'pack', 'unmapped'
+ :type node_fill_type: str or :class:`ComputeNodeFillType
+ `
+ """
+'''
+ self.assertEqual(_command_type.find_param_type(model, 'node_fill_type'),
+ 'str or :class:`ComputeNodeFillType' +
+ '`')
+
+ model.__doc__ = """
+ :param name: The name of the environment variable.
+ :type name:str
+ :raises: BatchException
+"""
+ self.assertEqual(_command_type.find_param_type(model, 'name'), 'str')
+
+ def test_batch_find_param_help(self):
+ model = TestObj()
+ model.__doc__ = """
+ :param pool_id: The id of the pool to get.
+ :type pool_id: str
+ :param pool_get_options: Additional parameters for the operation
+ :type pool_get_options: :class:`PoolGetOptions
+ `
+"""
+ self.assertEqual(_command_type.find_param_help(model, 'pool_id'),
+ 'The id of the pool to get.')
+ self.assertEqual(_command_type.find_param_help(model, 'pool_get_options'),
+ 'Additional parameters for the operation')
+
+ model.__doc__ = """
+ :param node_fill_type: How tasks should be distributed across compute
+ nodes. Possible values include: 'spread', 'pack', 'unmapped'
+ :type node_fill_type: str or :class:`ComputeNodeFillType
+ `
+"""
+ self.assertEqual(_command_type.find_param_help(model, 'node_fill_type'),
+ "How tasks should be distributed across compute nodes. " +
+ "Possible values include: 'spread', 'pack', 'unmapped'")
+
+ def test_batch_find_return_type(self):
+ model = TestObj()
+ model.__doc__ = """
+ :param node_fill_type: How tasks should be distributed across compute
+ nodes. Possible values include: 'spread', 'pack', 'unmapped'
+ :type node_fill_type: str or :class:`ComputeNodeFillType
+ `
+"""
+ self.assertIsNone(_command_type.find_return_type(model))
+
+ model.__doc__ = """
+ :type callback: Callable[Bytes, response=None]
+ :param operation_config: :ref:`Operation configuration
+ overrides`.
+ :rtype: Generator
+ :rtype: :class:`ClientRawResponse`
+ if raw=true
+"""
+ self.assertEqual(_command_type.find_return_type(model), 'Generator')
+
+ def test_batch_class_name(self):
+ type_str = ":class:`ComputeNodeFillType`"
+ self.assertEqual(_command_type.class_name(type_str),
+ "azure.batch.models.ComputeNodeFillType")
+
+ type_str = "str or :class:`ComputeNodeFillType`"
+ self.assertEqual(_command_type.class_name(type_str),
+ "azure.batch.models.ComputeNodeFillType")
+
+ def test_batch_operations_name(self):
+ op_str = "PythonTestCase"
+ self.assertEqual(_command_type.operations_name(op_str), "python_test_case")
+
+ op_str = "PythonTestCaseOperations"
+ self.assertEqual(_command_type.operations_name(op_str), "python_test_case")
+
+ op_str = "Python"
+ self.assertEqual(_command_type.operations_name(op_str), "python")
+
+ op_str = "python"
+ self.assertEqual(_command_type.operations_name(op_str), "python")
+
+ def test_batch_full_name(self):
+ arg_details = {'path': 'pool.start_task', 'root': 'id'}
+ self.assertEqual(_command_type.full_name(arg_details), 'pool.start_task.id')
+
+ def test_batch_group_title(self):
+ path = "pool"
+ self.assertEqual(_command_type.group_title(path), "Pool")
+
+ path = "pool_patch_parameter"
+ self.assertEqual(_command_type.group_title(path), "Pool")
+
+ path = "pool_update_parameter"
+ self.assertEqual(_command_type.group_title(path), "Pool")
+
+ path = "pool_update_properties_parameter"
+ self.assertEqual(_command_type.group_title(path), "Pool Update Properties")
+
+ path = "pool.start_task"
+ self.assertEqual(_command_type.group_title(path), "Pool: Start Task")
+
+ path = "pool.start_task.constraints"
+ self.assertEqual(_command_type.group_title(path), "Pool: Start Task: Constraints")
+
+ def test_batch_arg_name(self):
+ self.assertEqual(_command_type.arg_name("pool_id"), "--pool-id")
+ self.assertEqual(_command_type.arg_name("id"), "--id")
+ self.assertEqual(_command_type.arg_name("start_task_id"), "--start-task-id")
+
+ def test_batch_format_options_name(self):
+ op = "azure.batch.operations.pool_opterations#PoolOperations.get"
+ self.assertEqual(_command_type.format_options_name(op), "pool_get_options")
+
+ op = "azure.batch.operations.pool_opterations#PoolOperations.upgrade_os"
+ self.assertEqual(_command_type.format_options_name(op), "pool_upgrade_os_options")
+
+ op = "azure.batch.operations.pool_opterations#JobScheduleOperations.get"
+ self.assertEqual(_command_type.format_options_name(op), "job_schedule_get_options")
+
+ def test_batch_argument_tree(self):
+ # pylint: disable=too-many-statements
+ tree = _command_type.BatchArgumentTree(None, None)
+ self.assertEqual(list(tree), [])
+
+ tree.set_request_param("pool", "azure.batch.models.PoolAddParameter")
+ self.assertEqual(tree._request_param, {'name': 'pool', 'model': 'PoolAddParameter'})
+
+ self.assertEqual(tree.dequeue_argument("id"), {})
+ self.assertFalse(tree.existing("id"))
+
+ tree.queue_argument('id', 'pool', 'id', {}, 'str', ['vm_size', 'id'])
+ tree.queue_argument('vm_size', 'pool', 'vm_size', {}, 'str', ['vm_size', 'id'])
+ tree.queue_argument('target_dedicated', 'pool', 'target_dedicated', {}, 'int',
+ ['vm_size', 'id'])
+ tree.queue_argument('command_line', 'pool.start_task', 'command_line', {}, 'str',
+ ['command_line'])
+ tree.queue_argument('run_elevated', 'pool.start_task', 'run_elevated', {}, 'bool',
+ ['command_line'])
+ tree.queue_argument('node_agent_sku_id', 'pool.virtual_machine_configuration',
+ 'node_agent_sku_id', {}, 'str',
+ ['node_agent_sku_id', 'image_reference.offer',
+ 'image_reference.publisher'])
+ tree.queue_argument('offer', 'pool.virtual_machine_configuration.image_reference',
+ 'offer', {}, 'str', ['offer', 'publisher'])
+ tree.queue_argument('publisher', 'pool.virtual_machine_configuration.image_reference',
+ 'publisher', {}, 'str', ['offer', 'publisher'])
+ tree.queue_argument('version', 'pool.virtual_machine_configuration.image_reference',
+ 'version', {}, 'str', ['offer', 'publisher'])
+ tree.queue_argument('subnet_id', 'pool.network_configuration', 'id', {}, 'str', ['id'])
+ tree.queue_argument('os_family', 'pool.cloud_service_configuration', 'os_family', {},
+ 'str', ['os_family'])
+ tree.queue_argument('target_os_version', 'pool.cloud_service_configuration',
+ 'target_os_version', {}, 'str', ['os_family'])
+
+ self.assertEqual(len(list(tree)), 12)
+ self.assertTrue(tree.existing('vm_size'))
+
+ ns = TestObj()
+ ns.id = None
+ ns.vm_size = None
+ ns.target_dedicated = 3
+ ns.command_line = None
+ ns.run_elevated = None
+ ns.node_agent_sku_id = None
+ ns.offer = None
+ ns.publisher = None
+ ns.version = None
+ ns.subnet_id = None
+ ns.os_family = None
+ ns.target_os_version = None
+ with self.assertRaises(ValueError):
+ tree.parse(ns)
+ ns.id = "test_pool"
+ with self.assertRaises(ValueError):
+ tree.parse(ns)
+ ns.vm_size = "small"
+ tree.parse(ns)
+ ns.run_elevated = True
+ with self.assertRaises(ValueError):
+ tree.parse(ns)
+ ns.command_line = "cmd"
+ tree.parse(ns)
+ ns.run_elevated = None
+ tree.parse(ns)
+ ns.offer = "offer"
+ with self.assertRaises(ValueError):
+ tree.parse(ns)
+ ns.publisher = "publisher"
+ with self.assertRaises(ValueError):
+ tree.parse(ns)
+ ns.node_agent_sku_id = "sku id"
+ tree.parse(ns)
+
+ with self.assertRaises(ValueError):
+ tree.parse_mutually_exclusive(ns, False, ['pool.id', 'pool.vm_size'])
+ ns.id = None
+ tree.parse_mutually_exclusive(ns, False, ['pool.id', 'pool.vm_size'])
+ ns.vm_size = None
+ tree.parse_mutually_exclusive(ns, False, ['pool.id', 'pool.vm_size'])
+ with self.assertRaises(ValueError):
+ tree.parse_mutually_exclusive(ns, True, ['pool.id', 'pool.vm_size'])
+
+ ns.id = None
+ tree.parse_mutually_exclusive(ns, False, ['pool.id', 'pool.cloud_service_configuration'])
+ with self.assertRaises(ValueError):
+ tree.parse_mutually_exclusive(
+ ns, True, ['pool.id', 'pool.cloud_service_configuration'])
+ ns.id = "id"
+ tree.parse_mutually_exclusive(
+ ns, True, ['pool.id', 'pool.cloud_service_configuration'])
+ ns.target_os_version = "4"
+ with self.assertRaises(ValueError):
+ tree.parse_mutually_exclusive(
+ ns, True, ['pool.id', 'pool.cloud_service_configuration'])
+
+ with self.assertRaises(ValueError):
+ tree.parse_mutually_exclusive(
+ ns, True, ['pool.virtual_machine_configuration',
+ 'pool.cloud_service_configuration'])
+ ns.target_os_version = None
+ tree.parse_mutually_exclusive(
+ ns, True, ['pool.virtual_machine_configuration',
+ 'pool.cloud_service_configuration'])
+ ns.publisher = None
+ ns.offer = None
+ ns.node_agent_sku_id = None
+ tree.parse_mutually_exclusive(
+ ns, False, ['pool.virtual_machine_configuration',
+ 'pool.cloud_service_configuration'])
+ with self.assertRaises(ValueError):
+ tree.parse_mutually_exclusive(ns, True, ['pool.virtual_machine_configuration',
+ 'pool.cloud_service_configuration'])
+
+ siblings = tree._get_siblings("pool")
+ self.assertEqual(sorted(siblings), ["id", "target_dedicated", "vm_size"])
+ siblings = tree._get_siblings("pool.virtual_machine_configuration")
+ self.assertEqual(sorted(siblings), ["node_agent_sku_id"])
+ children = tree._get_children("pool.virtual_machine_configuration")
+ self.assertEqual(sorted(children), ["node_agent_sku_id", "offer", "publisher", "version"])
+
+ tree.dequeue_argument('node_agent_sku_id')
+ self.assertEqual(len(list(tree)), 11)
+
+
+class TestBatchLoader(unittest.TestCase):
+ # pylint: disable=attribute-defined-outside-init,protected-access
+
+ def setUp(self):
+ def get_client(*args): # pylint: disable=unused-argument
+ creds = SharedKeyCredentials('test1', 'ZmFrZV9hY29jdW50X2tleQ==')
+ return BatchServiceClient(creds, 'https://test1.westus.batch.azure.com/')
+
+ self.command_pool = _command_type.AzureBatchDataPlaneCommand(
+ 'batch_unit_tests',
+ 'batch_tests_pool',
+ 'azure.batch.operations.pool_operations#PoolOperations.add',
+ get_client, None, None, 3, None, None, None)
+ self.command_job = _command_type.AzureBatchDataPlaneCommand(
+ 'batch_unit_tests',
+ 'batch_tests_job',
+ 'azure.batch.operations.job_operations#JobOperations.add',
+ get_client, None, None, 3,
+ ['job.job_manager_task', 'job.job_preparation_task', \
+ 'job.job_release_task'], None, None)
+ self.command_task = _command_type.AzureBatchDataPlaneCommand(
+ 'batch_unit_tests',
+ 'batch_tests_task',
+ 'azure.batch.operations.task_operations#TaskOperations.add',
+ get_client, None, None, 1, None, None, None)
+ self.command_file = _command_type.AzureBatchDataPlaneCommand(
+ 'batch_unit_tests',
+ 'batch_tests_file',
+ 'azure.batch.operations.file_operations#FileOperations.get_from_task',
+ get_client, None, None, 3, None, None, None)
+ self.command_list = _command_type.AzureBatchDataPlaneCommand(
+ 'batch_unit_tests',
+ 'batch_tests_list',
+ 'azure.batch.operations.job_operations#JobOperations.list',
+ get_client, None, None, 3, None, None, None)
+ self.command_delete = _command_type.AzureBatchDataPlaneCommand(
+ 'batch_unit_tests',
+ 'batch_tests_delete',
+ 'azure.batch.operations.pool_operations#PoolOperations.delete',
+ get_client, None, None, 3, None, None, None)
+ self.command_conflicts = _command_type.AzureBatchDataPlaneCommand(
+ 'batch_unit_tests',
+ 'batch_tests_conflicts',
+ 'azure.batch.operations.job_schedule_operations#JobScheduleOperations.add',
+ get_client, None, None, 4, None, None, None)
+ return super(TestBatchLoader, self).setUp()
+
+ def test_batch_build_parameters(self):
+ kwargs = {
+ 'id': 'poolid',
+ 'vm_size': 'small',
+ 'os_family': '4',
+ 'run_elevated': True,
+ 'command_line': 'cmd',
+ 'wait_for_success': None
+ }
+ params = {
+ 'id': {'path': 'pool', 'root': 'id'},
+ 'vm_size': {'path': 'pool', 'root': 'vm_size'},
+ 'os_family': {'path': 'pool.cloud_service_configuration', 'root': 'os_family'},
+ 'run_elevated': {'path': 'pool.start_task', 'root': 'run_elevated'},
+ 'command_line': {'path': 'pool.start_task', 'root': 'command_line'},
+ 'wait_for_success': {'path': 'pool.start_task', 'root': 'wait_for_success'}
+ }
+ for arg, details in params.items():
+ value = kwargs.pop(arg)
+ if value is None:
+ continue
+ params = self.command_pool._build_parameters(
+ details['path'],
+ kwargs,
+ details['root'],
+ value)
+
+ request = {'pool': {'id': 'poolid', 'vm_size': 'small',
+ 'cloud_service_configuration': {'os_family': '4'},
+ 'start_task': {'run_elevated': True, 'command_line': 'cmd'}}}
+ self.assertEqual(kwargs, request)
+
+ def test_batch_options(self):
+ self.command_delete._load_options_model(
+ operations.pool_operations.PoolOperations.delete)
+ self.assertIsInstance(self.command_delete._options_model, models.PoolDeleteOptions)
+ self.assertEqual(sorted(self.command_delete._options_attrs),
+ ['client_request_id',
+ 'if_match',
+ 'if_modified_since',
+ 'if_none_match',
+ 'if_unmodified_since',
+ 'ocp_date',
+ 'return_client_request_id',
+ 'timeout'])
+ kwargs = {
+ 'if_match': None,
+ 'if_modified_since': 'abc',
+ 'if_none_match': None,
+ 'if_unmodified_since': 'def',
+ 'client_request_id': 'ignored'
+ }
+ self.command_delete._build_options(kwargs)
+ self.assertIsInstance(kwargs['pool_delete_options'], models.PoolDeleteOptions)
+ self.assertEqual(kwargs['pool_delete_options'].if_modified_since, 'abc')
+ self.assertEqual(kwargs['pool_delete_options'].if_unmodified_since, 'def')
+ self.assertIsNone(kwargs['pool_delete_options'].client_request_id)
+ self.assertEqual(kwargs['pool_delete_options'].timeout, 30)
+ self.assertIsNone(kwargs['pool_delete_options'].ocp_date)
+ options = list(self.command_delete._process_options())
+ self.assertEqual(len(options), 4)
+
+ def test_batch_cancel_operation(self):
+ from azure.cli.core._config import az_config as config
+ from azure.cli.core.commands import _user_confirmed as user
+
+ self.assertFalse(self.command_job._cancel_operation({}, config, user))
+ self.assertFalse(self.command_job._cancel_operation({'force': True}, config, user))
+ self.assertFalse(self.command_delete._cancel_operation({'force': True}, config, user))
+ self.assertTrue(self.command_delete._cancel_operation({'force': None}, config, user))
+
+ def test_batch_should_flatten(self):
+ self.assertFalse(self.command_task._should_flatten('task.depends_on'))
+ self.assertTrue(self.command_task._should_flatten('task'))
+ self.assertFalse(self.command_job._should_flatten(
+ 'job.job_manager_task.constraints.something'))
+ self.assertTrue(self.command_job._should_flatten('job.job_manager_task.constraints'))
+
+ def test_batch_get_model_attrs(self):
+ attrs = list(self.command_job._get_attrs(models.ResourceFile, 'task.resource_files'))
+ self.assertEqual(len(attrs), 3)
+ attrs = list(self.command_job._get_attrs(models.JobManagerTask, 'job.job_manager_task'))
+ self.assertEqual(len(attrs), 10)
+ attrs = list(self.command_job._get_attrs(models.JobAddParameter, 'job'))
+ self.assertEqual(len(attrs), 10)
+
+ def test_batch_load_arguments(self):
+ # pylint: disable=too-many-statements
+ handler = operations.pool_operations.PoolOperations.add
+ args = list(self.command_pool._load_transformed_arguments(handler))
+ self.assertEqual(len(args), 30)
+ self.assertFalse('force' in [a for a, _ in args])
+ self.assertTrue('json_file' in [a for a, _ in args])
+ self.assertFalse('destination' in [a for a, _ in args])
+ self.assertTrue('application_package_references' in [a for a, _ in args])
+ self.assertTrue('start_task_environment_settings' in [a for a, _ in args])
+ self.assertTrue('certificate_references' in [a for a, _ in args])
+ self.assertTrue('metadata' in [a for a, _ in args])
+ handler = operations.job_operations.JobOperations.add
+ args = list(self.command_job._load_transformed_arguments(handler))
+ self.assertEqual(len(args), 13)
+ self.assertFalse('force' in [a for a, _ in args])
+ self.assertTrue('json_file' in [a for a, _ in args])
+ self.assertFalse('destination' in [a for a, _ in args])
+ handler = operations.task_operations.TaskOperations.add
+ args = list(self.command_task._load_transformed_arguments(handler))
+ self.assertEqual(len(args), 8)
+ self.assertFalse('force' in [a for a, _ in args])
+ self.assertTrue('json_file' in [a for a, _ in args])
+ self.assertFalse('destination' in [a for a, _ in args])
+ handler = operations.file_operations.FileOperations.get_from_task
+ args = list(self.command_file._load_transformed_arguments(handler))
+ self.assertEqual(len(args), 8)
+ self.assertFalse('force' in [a for a, _ in args])
+ self.assertFalse('json_file' in [a for a, _ in args])
+ self.assertTrue('destination' in [a for a, _ in args])
+ handler = operations.job_operations.JobOperations.list
+ args = list(self.command_list._load_transformed_arguments(handler))
+ self.assertEqual(len(args), 3)
+ self.assertFalse('force' in [a for a, _ in args])
+ self.assertFalse('json_file' in [a for a, _ in args])
+ self.assertFalse('destination' in [a for a, _ in args])
+ handler = operations.pool_operations.PoolOperations.delete
+ args = list(self.command_delete._load_transformed_arguments(handler))
+ self.assertEqual(len(args), 6)
+ self.assertTrue('force' in [a for a, _ in args])
+ self.assertFalse('json_file' in [a for a, _ in args])
+ self.assertFalse('destination' in [a for a, _ in args])
+ handler = operations.job_schedule_operations.JobScheduleOperations.add
+ args = list(self.command_conflicts._load_transformed_arguments(handler))
+ self.assertEqual(len(args), 44)
+ self.assertTrue('id' in [a for a, _ in args])
+ self.assertTrue('job_manager_task_id' in [a for a, _ in args])
+ self.assertTrue('job_manager_task_max_wall_clock_time' in [a for a, _ in args])
+ self.assertTrue('job_max_wall_clock_time' in [a for a, _ in args])
+ self.assertFalse('force' in [a for a, _ in args])
+ self.assertTrue('json_file' in [a for a, _ in args])
+ self.assertFalse('destination' in [a for a, _ in args])
+
+ def test_batch_execute_command(self):
+ def function_result(client, **kwargs):
+ # pylint: disable=function-redefined,unused-argument
+ raise ValidationError('maximum', 'id', '100')
+
+ def get_op_handler(operation):
+ # pylint: disable=unused-argument
+ return function_result
+
+ handler = operations.pool_operations.PoolOperations.add
+ args = list(self.command_pool._load_transformed_arguments(handler))
+ with mock.patch.object(_command_type, 'get_op_handler', get_op_handler):
+ with self.assertRaises(CLIError):
+ self.command_pool.cmd.execute(kwargs={'id': 'pool_test', 'vm_size': 'small'})
+
+ def function_result(client, **kwargs):
+ # pylint: disable=function-redefined,unused-argument
+ raise ClientRequestError('Bad Response')
+
+ with mock.patch.object(_command_type, 'get_op_handler', get_op_handler):
+ with self.assertRaises(CLIError):
+ self.command_pool.cmd.execute(kwargs={'id': 'pool_test', 'vm_size': 'small'})
+
+ def function_result(client, **kwargs):
+ # pylint: disable=function-redefined,unused-argument
+ error = models.BatchError()
+ error.code = 'InvalidHeaderValue'
+ error.message = models.ErrorMessage('en-US', 'The value for one of the HTTP '
+ 'headers is not in the correct format')
+ error.values = [
+ models.BatchErrorDetail('HeaderName', 'Content-Type'),
+ models.BatchErrorDetail('HeaderValue', 'application/json')
+ ]
+ exp = models.BatchErrorException(lambda x, y: error, None)
+ raise exp
+
+ with mock.patch.object(_command_type, 'get_op_handler', get_op_handler):
+ with self.assertRaises(CLIError):
+ self.command_pool.cmd.execute(kwargs={'id': 'pool_test', 'vm_size': 'small'})
+
+ def function_result(client, **kwargs):
+ # pylint: disable=function-redefined,unused-argument
+ self.assertIsInstance(kwargs['pool'], models.PoolAddParameter)
+ self.assertEqual(kwargs['pool'].id, 'pool_id')
+ self.assertEqual(kwargs['pool'].vm_size, 'small')
+ self.assertEqual(kwargs['pool'].start_task.command_line, 'cmd')
+ self.assertTrue('id' not in kwargs)
+ return "Pool Created"
+
+ json_file = {'id': 'pool_id', 'vmSize': 'small', 'startTask': {'commandLine': 'cmd'}}
+ kwargs = {a: None for a, _ in args}
+ kwargs['json_file'] = json_file
+ with mock.patch.object(_command_type, 'get_op_handler', get_op_handler):
+ result = self.command_pool.cmd.execute(kwargs=kwargs)
+ self.assertEqual(result, "Pool Created")
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_data_plane_command_base.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_data_plane_command_base.py
new file mode 100644
index 00000000000..35183c373ee
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_data_plane_command_base.py
@@ -0,0 +1,27 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+import os
+
+from azure.cli.core.test_utils.vcr_test_base import VCRTestBase
+
+
+class BatchDataPlaneTestBase(VCRTestBase):
+ # pylint:disable=too-few-public-methods
+
+ def __init__(self, test_file, test_method):
+ super(BatchDataPlaneTestBase, self).__init__(test_file, test_method)
+ self.account_name = 'test1'
+ if not self.playback:
+ self.account_key = os.environ['AZURE_BATCH_ACCESS_KEY']
+ else:
+ self.account_key = 'ZmFrZV9hY29jdW50X2tleQ=='
+ self.account_endpoint = 'https://test1.westus.batch.azure.com/'
+
+ def cmd(self, command, checks=None, allowed_exceptions=None,
+ debug=False):
+ command = '{} --account-name {} --account-key "{}" --account-endpoint {}'.\
+ format(command, self.account_name, self.account_key, self.account_endpoint)
+ return super(BatchDataPlaneTestBase, self).cmd(command, checks, allowed_exceptions, debug)
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_data_plane_commands.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_data_plane_commands.py
new file mode 100644
index 00000000000..a78f1e59b58
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_data_plane_commands.py
@@ -0,0 +1,204 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+import os
+
+from azure.cli.core.test_utils.vcr_test_base import (JMESPathCheck)
+from azure.cli.command_modules.batch.tests.test_batch_data_plane_command_base import (
+ BatchDataPlaneTestBase)
+
+
+class BatchCertificateScenarioTest(BatchDataPlaneTestBase):
+
+ def __init__(self, test_method):
+ super(BatchCertificateScenarioTest, self).__init__(__file__, test_method)
+ self.create_cert_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+ 'data',
+ 'batchtest.cer')
+ self.cert_thumbprint = '59833fd835f827e9ec693a4c82435a6360cc6271'
+
+ def test_batch_certificate_cmd(self):
+ self.execute()
+
+ def body(self):
+ # test create certificate with default set
+ self.cmd('batch certificate create --thumbprint {} --certificate-file "{}"'.
+ format(self.cert_thumbprint, self.create_cert_file_path),
+ checks=[
+ JMESPathCheck('thumbprint', self.cert_thumbprint),
+ JMESPathCheck('thumbprintAlgorithm', 'sha1'),
+ JMESPathCheck('state', 'active')
+ ])
+
+ # test create account with default set
+ self.cmd('batch certificate list', checks=[
+ JMESPathCheck('length(@)', 1),
+ JMESPathCheck('[0].thumbprint', self.cert_thumbprint),
+ ])
+
+ self.cmd("batch certificate delete --thumbprint {} --force".
+ format(self.cert_thumbprint))
+
+ self.cmd('batch certificate show --thumbprint {}'.
+ format(self.cert_thumbprint),
+ checks=[
+ JMESPathCheck('thumbprint', self.cert_thumbprint),
+ JMESPathCheck('thumbprintAlgorithm', 'sha1'),
+ JMESPathCheck('state', 'deleting')
+ ])
+
+
+class BatchPoolScenarioTest(BatchDataPlaneTestBase):
+
+ def __init__(self, test_method):
+ super(BatchPoolScenarioTest, self).__init__(__file__, test_method)
+ self.create_pool_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+ 'data',
+ 'batchCreatePool.json')
+ self.update_pool_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+ 'data',
+ 'batchUpdatePool.json')
+ self.share_pool_id = 'xplatTestPool'
+ self.create_pool_id = 'xplatCreatedPool'
+
+ def test_batch_pool_cmd(self):
+ self.execute()
+
+ def body(self):
+ result = self.cmd('batch pool show --pool-id {}'.format(self.share_pool_id),
+ checks=[JMESPathCheck('allocationState', 'steady'),
+ JMESPathCheck('id', self.share_pool_id)])
+ target = result['currentDedicated']
+
+ self.cmd('batch pool resize --pool-id {} --target-dedicated 5'.format(self.share_pool_id))
+
+ self.cmd('batch pool show --pool-id {}'.format(self.share_pool_id),
+ checks=[JMESPathCheck('allocationState', 'resizing'),
+ JMESPathCheck('targetDedicated', 5),
+ JMESPathCheck('id', self.share_pool_id)])
+
+ self.cmd('batch pool resize --pool-id {} --abort'.format(self.share_pool_id))
+
+ if not self.playback:
+ import time
+ time.sleep(60)
+
+ self.cmd('batch pool show --pool-id {}'.format(self.share_pool_id),
+ checks=[JMESPathCheck('allocationState', 'steady'),
+ JMESPathCheck('id', self.share_pool_id),
+ JMESPathCheck('currentDedicated', target),
+ JMESPathCheck('targetDedicated', 5)])
+
+ self.cmd('batch pool create --json-file "{}"'.format(self.create_pool_file_path))
+
+ self.cmd('batch pool show --pool-id {}'.format(self.create_pool_id),
+ checks=[JMESPathCheck('allocationState', 'steady'),
+ JMESPathCheck('id', self.create_pool_id),
+ JMESPathCheck('startTask.commandLine', "cmd /c echo test")])
+
+ self.cmd('batch pool reset --pool-id {} --json-file "{}"'.
+ format(self.create_pool_id, self.update_pool_file_path),
+ checks=[JMESPathCheck('allocationState', 'steady'),
+ JMESPathCheck('id', self.create_pool_id),
+ JMESPathCheck('startTask.commandLine', "cmd /c echo updated")])
+
+ self.cmd('batch pool reset --pool-id {} --start-task-command-line '
+ 'hostname --metadata a=b c=d'.format(self.create_pool_id),
+ checks=[JMESPathCheck('allocationState', 'steady'),
+ JMESPathCheck('id', self.create_pool_id),
+ JMESPathCheck('startTask.commandLine', "hostname"),
+ JMESPathCheck('length(metadata)', 2),
+ JMESPathCheck('metadata[0].name', 'a'),
+ JMESPathCheck('metadata[1].value', 'd')])
+
+ self.cmd('batch pool delete --pool-id {} --force'.format(self.create_pool_id))
+
+
+class BatchJobListScenarioTest(BatchDataPlaneTestBase):
+
+ def set_up(self):
+ self.cmd('batch job-schedule create --json-file "{}"'.
+ format(self.create_jobschedule_file_path))
+
+ def tear_down(self):
+ self.cmd('batch job-schedule delete --job-schedule-id {} --force'.
+ format(self.job_schedule_id))
+
+ def __init__(self, test_method):
+ super(BatchJobListScenarioTest, self).__init__(__file__, test_method)
+ self.create_jobschedule_file_path = os.path.join(os.path.
+ dirname(os.path.realpath(__file__)),
+ 'data',
+ 'batchCreateJobScheduleForJobTests.json')
+ self.create_job_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+ 'data',
+ 'batchCreateJob.json')
+ self.job_schedule_id = 'xplatJobScheduleJobTests'
+ self.create_job_id = 'xplatJob'
+
+ def test_batch_job_list_cmd(self):
+ self.execute()
+
+ def body(self):
+ self.cmd('batch job create --json-file "{}"'.format(self.create_job_file_path))
+
+ self.cmd('batch job list --job-schedule-id {}'.format(self.job_schedule_id),
+ checks=[JMESPathCheck('length(@)', 1),
+ JMESPathCheck('[0].id', '{}:job-1'.format(self.job_schedule_id))])
+
+ result = self.cmd('batch job list',
+ checks=[JMESPathCheck('length(@)', 2)])
+ self.assertIsNotNone(
+ [i for i in result if i['id'] == '{}:job-1'.format(self.job_schedule_id)])
+ self.assertIsNotNone([i for i in result if i['id'] == self.create_job_id])
+
+ self.cmd('batch job delete --job-id {} --force'.format(self.create_job_id))
+
+
+class BatchTaskAddScenarioTest(BatchDataPlaneTestBase):
+ # pylint: disable=too-many-instance-attributes
+ def set_up(self):
+ self.cmd('batch job create --json-file "{}"'.format(self.create_job_file_path))
+
+ def tear_down(self):
+ self.cmd('batch job delete --job-id {} --force'.format(self.job_id))
+
+ def __init__(self, test_method):
+ super(BatchTaskAddScenarioTest, self).__init__(__file__, test_method)
+ self.create_task_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+ 'data',
+ 'batchCreateTask.json')
+ self.create_tasks_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+ 'data',
+ 'batchCreateMultiTasks.json')
+ self.create_job_file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+ 'data',
+ 'batchCreateJobForTaskTests.json')
+ self.job_id = 'xplatJobForTaskTests'
+ self.task_id = 'xplatTask'
+
+ def test_batch_task_create_cmd(self):
+ self.execute()
+
+ def body(self):
+ self.cmd('batch task create --job-id {} --json-file "{}"'.
+ format(self.job_id, self.create_task_file_path),
+ checks=[JMESPathCheck('id', self.task_id),
+ JMESPathCheck('commandLine', 'cmd /c dir /s')])
+
+ self.cmd('batch task delete --job-id {} --task-id {} --force'.
+ format(self.job_id, self.task_id))
+
+ self.cmd('batch task create --job-id {} --task-id aaa --command-line "echo hello"'.
+ format(self.job_id),
+ checks=[JMESPathCheck('id', 'aaa'),
+ JMESPathCheck('commandLine', 'echo hello')])
+
+ self.cmd('batch task delete --job-id {} --task-id aaa --force'.format(self.job_id))
+
+ result = self.cmd('batch task create --job-id {} --json-file "{}"'.
+ format(self.job_id, self.create_tasks_file_path),
+ checks=[JMESPathCheck('length(@)', 3)])
+ self.assertIsNotNone([i for i in result if i['taskId'] == 'xplatTask1'])
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_mgmt_commands.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_mgmt_commands.py
index 5d397a8c1dc..81e1c8bbda3 100644
--- a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_mgmt_commands.py
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_mgmt_commands.py
@@ -8,6 +8,7 @@
from azure.cli.core.test_utils.vcr_test_base import (ResourceGroupVCRTestBase, JMESPathCheck,
NoneCheck)
+
def _before_record_response(response):
# ignore any 401 responses during playback
if response['status']['code'] == 401:
@@ -27,7 +28,7 @@ def __init__(self, test_method):
self.resource_group = 'vcr_resource_group'
self.account_name = 'clibatchtest4'
self.location = 'brazilsouth'
- self.storage_account_name = 'clibatchteststorage2'
+ self.storage_account_name = 'clibatchteststorage3'
def test_batch_account_mgmt(self):
self.execute()
@@ -40,11 +41,9 @@ def body(self):
# test create storage account with default set
result = self.cmd('storage account create -g {} -n {} -l {} --sku Standard_LRS'.
format(rg, self.storage_account_name, loc),
- checks=[
- JMESPathCheck('name', self.storage_account_name),
- JMESPathCheck('location', loc),
- JMESPathCheck('resourceGroup', rg)
- ])
+ checks=[JMESPathCheck('name', self.storage_account_name),
+ JMESPathCheck('location', loc),
+ JMESPathCheck('resourceGroup', rg)])
sid = result['id']
# test create account with default set
@@ -54,44 +53,37 @@ def body(self):
JMESPathCheck('resourceGroup', rg)
])
- self.cmd('batch account set -g {} -n {} --storage-account-id {}'.
- format(rg, name, sid),
- checks=[
- JMESPathCheck('name', name),
- JMESPathCheck('location', loc),
- JMESPathCheck('resourceGroup', rg)
- ])
+ self.cmd('batch account set -g {} -n {} --storage-account {}'.
+ format(rg, name, self.storage_account_name),
+ checks=[JMESPathCheck('name', name),
+ JMESPathCheck('location', loc),
+ JMESPathCheck('resourceGroup', rg)])
- self.cmd('batch account show -g {} -n {}'.format(rg, name), checks=[
- JMESPathCheck('name', name),
- JMESPathCheck('location', loc),
- JMESPathCheck('resourceGroup', rg),
- JMESPathCheck('autoStorage.storageAccountId', sid)
- ])
+ self.cmd('batch account show -g {} -n {}'.format(rg, name),
+ checks=[JMESPathCheck('name', name),
+ JMESPathCheck('location', loc),
+ JMESPathCheck('resourceGroup', rg),
+ JMESPathCheck('autoStorage.storageAccountId', sid)])
self.cmd('batch account autostorage-keys sync -g {} -n {}'.format(rg, name))
- keys = self.cmd('batch account keys list -g {} -n {}'.format(rg, name), checks=[
- JMESPathCheck('primary != null', True),
- JMESPathCheck('secondary != null', True)
- ])
+ keys = self.cmd('batch account keys list -g {} -n {}'.format(rg, name),
+ checks=[JMESPathCheck('primary != null', True),
+ JMESPathCheck('secondary != null', True)])
keys2 = self.cmd('batch account keys renew -g {} -n {} --key-name primary'.
format(rg, name),
- checks=[
- JMESPathCheck('primary != null', True),
- JMESPathCheck('secondary', keys['secondary'])
- ])
+ checks=[JMESPathCheck('primary != null', True),
+ JMESPathCheck('secondary', keys['secondary'])])
self.assertTrue(keys['primary'] != keys2['primary'])
# test batch account delete
- self.cmd('batch account delete -g {} -n {}'.format(rg, name))
+ self.cmd('batch account delete -g {} -n {} --force'.format(rg, name))
self.cmd('batch account list -g {}'.format(rg), checks=NoneCheck())
- self.cmd('batch location quotas show -l {}'.format(loc), checks=[
- JMESPathCheck('accountQuota', 1)
- ])
+ self.cmd('batch location quotas show -l {}'.format(loc),
+ checks=[JMESPathCheck('accountQuota', 1)])
class BatchMgmtApplicationScenarioTest(ResourceGroupVCRTestBase):
@@ -112,20 +104,19 @@ def set_up(self):
JMESPathCheck('resourceGroup', rg)
])
- self.cmd('batch account create -g {} -n {} -l {} --storage-account-id {}'.
+ self.cmd('batch account create -g {} -n {} -l {} --storage-account {}'.
format(rg, name, loc, result['id']), checks=[
JMESPathCheck('name', name),
JMESPathCheck('location', loc),
JMESPathCheck('resourceGroup', rg)
])
-
def tear_down(self):
rg = self.resource_group
sname = self.storage_account_name
name = self.account_name
self.cmd('storage account delete -g {} -n {} --force'.format(rg, sname))
- self.cmd('batch account delete -g {} -n {}'.format(rg, name))
+ self.cmd('batch account delete -g {} -n {} --force'.format(rg, name))
def __init__(self, test_method):
super(BatchMgmtApplicationScenarioTest, self).__init__(__file__, test_method)
@@ -149,7 +140,7 @@ def body(self):
aname = self.application_name
ver = self.application_package_name
# test create application with default set
- self.cmd('batch application create -g {} -n {} --application-id {} --allow-updates true'.
+ self.cmd('batch application create -g {} -n {} --application-id {} --allow-updates'.
format(rg, name, aname), checks=[
JMESPathCheck('id', aname),
JMESPathCheck('allowUpdates', True)
@@ -160,15 +151,17 @@ def body(self):
JMESPathCheck('[0].id', aname),
])
- self.cmd('batch application package create -g {} -n {} --application-id {} --version {} --package-file "{}"'. #pylint: disable=line-too-long
+ self.cmd('batch application package create -g {} -n {} --application-id {}'
+ ' --version {} --package-file "{}"'.
format(rg, name, aname, ver, self.package_file_name), checks=[
JMESPathCheck('id', aname),
JMESPathCheck('storageUrl != null', True),
JMESPathCheck('version', ver),
- JMESPathCheck('state', 'pending')
+ JMESPathCheck('state', 'active')
])
- self.cmd('batch application package activate -g {} -n {} --application-id {} --version {} --format zip'.format(rg, name, aname, ver)) #pylint: disable=line-too-long
+ self.cmd('batch application package activate -g {} -n {} --application-id {}'
+ ' --version {} --format zip'.format(rg, name, aname, ver))
self.cmd('batch application package show -g {} -n {} --application-id {} --version {}'.
format(rg, name, aname, ver), checks=[
@@ -178,18 +171,17 @@ def body(self):
JMESPathCheck('state', 'active')
])
- self.cmd('batch application set -g {} -n {} --application-id {} --default-version {}'.format(rg, name, aname, ver)) #pylint: disable=line-too-long
+ self.cmd('batch application set -g {} -n {} --application-id {} --default-version {}'.format(rg, name, aname, ver)) # pylint: disable=line-too-long
self.cmd('batch application show -g {} -n {} --application-id {}'.format(rg, name, aname),
- checks=[
- JMESPathCheck('id', aname),
- JMESPathCheck('defaultVersion', ver),
- JMESPathCheck('packages[0].format', 'zip'),
- JMESPathCheck('packages[0].state', 'active')
- ])
+ checks=[JMESPathCheck('id', aname),
+ JMESPathCheck('defaultVersion', ver),
+ JMESPathCheck('packages[0].format', 'zip'),
+ JMESPathCheck('packages[0].state', 'active')])
# test batch applcation delete
- self.cmd('batch application package delete -g {} -n {} --application-id {} --version {}'.
+ self.cmd('batch application package delete -g {} -n {} --application-id {} --version {} --force'. # pylint: disable=line-too-long
format(rg, name, aname, ver))
- self.cmd('batch application delete -g {} -n {} --application-id {}'.format(rg, name, aname))
+ self.cmd('batch application delete -g {} -n {} --application-id {} --force'.
+ format(rg, name, aname))
self.cmd('batch application list -g {} -n {}'.format(rg, name), checks=NoneCheck())
diff --git a/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_pool_commands.py b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_pool_commands.py
new file mode 100644
index 00000000000..6f5b64b6fc8
--- /dev/null
+++ b/src/command_modules/azure-cli-batch/azure/cli/command_modules/batch/tests/test_batch_pool_commands.py
@@ -0,0 +1,183 @@
+# --------------------------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# --------------------------------------------------------------------------------------------
+
+import os
+
+from azure.cli.core._util import CLIError
+from azure.cli.command_modules.batch.tests.test_batch_data_plane_command_base import (
+ BatchDataPlaneTestBase)
+
+
+class BatchPoolScenarioTest(BatchDataPlaneTestBase):
+
+ def __init__(self, test_method):
+ super(BatchPoolScenarioTest, self).__init__(__file__, test_method)
+ self.pool_paas = "azure-cli-test-paas"
+ self.pool_iaas = "azure-cli-test-iaas"
+ self.pool_json = "azure-cli-test-json"
+ self.data_dir = os.path.join(
+ os.path.dirname(__file__), 'data', 'batch-pool-{}.json').replace('\\', '\\\\')
+
+ def tear_down(self):
+ # Clean up any running pools in case the test exited early
+ for pool in [self.pool_iaas, self.pool_paas, self.pool_json]:
+ try:
+ self.cmd('batch pool delete --pool-id {} --force'.format(pool))
+ except Exception: # pylint: disable=broad-except
+ pass
+
+ def test_batch_pools(self):
+ self.execute()
+
+ def body(self):
+ # pylint: disable=too-many-statements
+ # test create paas pool using parameters
+ self.cmd('batch pool create --id {} --vm-size small --os-family 4'.format(
+ self.pool_paas))
+
+ # test create iaas pool using parameters
+ self.cmd('batch pool create --id {} --vm-size Standard_A1 '
+ '--image Canonical:UbuntuServer:16.04.0-LTS '
+ '--node-agent-sku-id "batch.node.ubuntu 16.04"'.
+ format(self.pool_iaas))
+
+ # test create pool with missing parameters
+ try:
+ self.cmd('batch pool create --id missing-params-test --os-family 4')
+ raise AssertionError("Excepted exception to be raised.")
+ except SystemExit as exp:
+ self.assertEqual(exp.code, 2)
+
+ # test create pool with missing required mutually exclusive parameters
+ try:
+ self.cmd('batch pool create --id missing-required-group-test --vm-size small')
+ raise AssertionError("Excepted exception to be raised.")
+ except SystemExit as exp:
+ self.assertEqual(exp.code, 2)
+
+ # test create pool with parameters from mutually exclusive groups
+ try:
+ self.cmd('batch pool create --id mutually-exclusive-test --vm-size small --os-family ' +
+ '4 --image Canonical:UbuntuServer:16-LTS:latest')
+ raise AssertionError("Excepted exception to be raised.")
+ except SystemExit as exp:
+ self.assertEqual(exp.code, 2)
+
+ # test create pool with invalid vm size for IaaS
+ try:
+ self.cmd('batch pool create --id invalid-size-test --vm-size small ' +
+ '--image Canonical:UbuntuServer:16.04.0-LTS --node-agent-sku-id ' +
+ '"batch.node.ubuntu 16.04"')
+ except SystemExit as exp:
+ self.assertEqual(exp.code, 2)
+
+ # test create pool with missing optional parameters
+ try:
+ self.cmd('batch pool create --id missing-optional-test --vm-size small --os-family' +
+ ' 4 --run-elevated')
+ raise AssertionError("Excepted exception to be raised.")
+ except SystemExit as exp:
+ self.assertEqual(exp.code, 2)
+
+ # test create pool from JSON file
+ self.cmd('batch pool create --json-file {}'.format(self.data_dir.format('create')))
+
+ # test create pool from non-existant JSON file
+ try:
+ self.cmd('batch pool create --json-file batch-pool-create-missing.json')
+ raise AssertionError("Excepted exception to be raised.")
+ except SystemExit as exp:
+ self.assertEqual(exp.code, 2)
+
+ # test create pool from invalid JSON file
+ try:
+ self.cmd('batch pool create --json-file {}'.format(
+ self.data_dir.format('create-invalid')))
+ raise AssertionError("Excepted exception to be raised.")
+ except SystemExit as exp:
+ self.assertEqual(exp.code, 2)
+
+ # test create pool from JSON file with additional parameters
+ try:
+ self.cmd('batch pool create --json-file {} --vm-size small'.format(
+ self.data_dir.format('create')))
+ raise AssertionError("Excepted exception to be raised.")
+ except SystemExit as exp:
+ self.assertEqual(exp.code, 2)
+
+ # test list pools
+ pool_list = self.cmd('batch pool list')
+ self.assertEqual(len(pool_list), 3)
+ pool_ids = sorted([p['id'] for p in pool_list])
+ self.assertEqual(pool_ids, [self.pool_iaas, self.pool_json, self.pool_paas])
+
+ # test list pools with select
+ pool_list = self.cmd('batch pool list --filter "id eq \'{}\'"'.format(self.pool_paas))
+ self.assertEqual(len(pool_list), 1)
+
+ # test resize pool
+ self.cmd('batch pool resize --pool-id {} --target-dedicated 5'.format(self.pool_paas))
+ pool_result = self.cmd('batch pool show --pool-id {} --select "allocationState,'
+ ' targetDedicated"'.format(self.pool_paas))
+ self.assertEqual(pool_result['allocationState'], 'resizing')
+ self.assertEqual(pool_result['targetDedicated'], 5)
+
+ # test cancel pool resize
+ self.cmd('batch pool resize --pool-id {} --abort'.format(self.pool_paas))
+
+ # test enable autoscale
+ self.cmd('batch pool autoscale enable --pool-id {} --auto-scale-formula '
+ '"$TargetDedicated=3"'.format(self.pool_iaas))
+ pool_result = self.cmd('batch pool show --pool-id {} --select "enableAutoScale"'.format(
+ self.pool_iaas))
+ self.assertEqual(pool_result['enableAutoScale'], True)
+
+ # test evaluate autoscale
+ self.cmd('batch pool autoscale evaluate --pool-id {} --auto-scale-formula '
+ '"$TargetDedicated=3"'.format(self.pool_iaas))
+
+ # test disable autoscale
+ self.cmd('batch pool autoscale disable --pool-id {}'.format(self.pool_iaas))
+ pool_result = self.cmd('batch pool show --pool-id {} --select "enableAutoScale"'.format(
+ self.pool_iaas))
+ self.assertEqual(pool_result['enableAutoScale'], False)
+
+ # test list usage metrics
+ self.cmd('batch pool usage-metrics list')
+
+ # TODO: Test update pool from JSON file
+
+ # test patch pool using parameters
+ current = self.cmd('batch pool show --pool-id {} --select "startTask"'.format(
+ self.pool_json))
+ self.cmd('batch pool set --pool-id {} --start-task-command-line new_value'.format(
+ self.pool_json))
+ updated = self.cmd('batch pool show --pool-id {} --select "startTask"'.format(
+ self.pool_json))
+ self.assertNotEqual(current['startTask']['commandLine'],
+ updated['startTask']['commandLine'])
+
+ # test list node agent skus
+ self.cmd('batch pool node-agent-skus list')
+
+ # test delete iaas pool
+ self.cmd('batch pool delete --pool-id {} --force'.format(self.pool_iaas))
+ pool_result = self.cmd('batch pool show --pool-id {} --select "state"'.format(
+ self.pool_iaas))
+ self.assertEqual(pool_result['state'], 'deleting')
+
+ # test app package reference
+ try:
+ self.cmd('batch pool create --id app_package_test --vm-size small --os-family 4 ' +
+ '--application-package-references does-not-exist')
+ raise AssertionError("Excepted exception to be raised.")
+ except CLIError:
+ pass
+ try:
+ self.cmd('batch pool set --pool-id {} --application-package-references '
+ 'does-not-exist'.format(self.pool_paas))
+ raise AssertionError("Excepted exception to be raised.")
+ except CLIError:
+ pass