diff --git a/src/load/HISTORY.rst b/src/load/HISTORY.rst index 2d22f14afa5..a0ad3670919 100644 --- a/src/load/HISTORY.rst +++ b/src/load/HISTORY.rst @@ -2,6 +2,9 @@ Release History =============== +1.8.0 +++++++ +* Add commands for creating and managing schedule triggers using CLI. 1.7.0 ++++++ diff --git a/src/load/azext_load/__init__.py b/src/load/azext_load/__init__.py index 20bae4acc43..5f85307a2db 100644 --- a/src/load/azext_load/__init__.py +++ b/src/load/azext_load/__init__.py @@ -18,6 +18,7 @@ def load_command_table(self, args): from azext_load.commands import load_command_table from azext_load.data_plane.load_test.commands import load_test_commands from azext_load.data_plane.load_test_run.commands import load_test_run_commands + from azext_load.data_plane.load_trigger.commands import load_trigger_schedule_commands from azure.cli.core.aaz import load_aaz_command_table try: from . import aaz @@ -32,6 +33,7 @@ def load_command_table(self, args): load_command_table(self, args) load_test_commands(self, args) load_test_run_commands(self, args) + load_trigger_schedule_commands(self, args) return self.command_table def load_arguments(self, command): @@ -39,11 +41,13 @@ def load_arguments(self, command): from azext_load.data_plane.params import load_arguments as load_common_arguments from azext_load.data_plane.load_test.params import load_arguments as load_test_arguments from azext_load.data_plane.load_test_run.params import load_arguments as load_test_run_arguments + from azext_load.data_plane.load_trigger.params import load_arguments as load_trigger_schedule_arguments load_arguments(self, command) load_common_arguments(self, command) load_test_arguments(self, command) load_test_run_arguments(self, command) + load_trigger_schedule_arguments(self, command) COMMAND_LOADER_CLS = LoadCommandsLoader diff --git a/src/load/azext_load/_help.py b/src/load/azext_load/_help.py index c93efdd050d..790d2939d33 100644 --- a/src/load/azext_load/_help.py +++ b/src/load/azext_load/_help.py @@ -12,7 +12,9 @@ from azext_load.data_plane.help import helps as data_common_helps from azext_load.data_plane.load_test.help import helps as data_load_test_helps from azext_load.data_plane.load_test_run.help import helps as data_load_test_run_helps +from azext_load.data_plane.load_trigger.help import helps as data_load_trigger_helps helps.update(data_common_helps) helps.update(data_load_test_helps) helps.update(data_load_test_run_helps) +helps.update(data_load_trigger_helps) diff --git a/src/load/azext_load/data_plane/help.py b/src/load/azext_load/data_plane/help.py index e5f769d364e..4f56dbcfce5 100644 --- a/src/load/azext_load/data_plane/help.py +++ b/src/load/azext_load/data_plane/help.py @@ -84,3 +84,19 @@ short-summary: Command group to retrieve load test run metrics. long-summary: Command group to retrieve load test run metrics with list, get-namespaces, get-definitions, get-dimension. """ + _common_params + +helps[ + "load trigger" +] = """ +type: group +short-summary: Command group to manage trigger. +long-summary: Command group to manage triggers. Currently the only supported trigger type is schedule. +""" + _common_params + +helps[ + "load trigger schedule" +] = """ +type: group +short-summary: Command group to manage schedule triggers. +long-summary: Command group to manage schedule triggers. +""" + _common_params diff --git a/src/load/azext_load/data_plane/load_trigger/__init__.py b/src/load/azext_load/data_plane/load_trigger/__init__.py new file mode 100644 index 00000000000..fbc0cb13956 --- /dev/null +++ b/src/load/azext_load/data_plane/load_trigger/__init__.py @@ -0,0 +1,6 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +__path__ = __import__("pkgutil").extend_path(__path__, __name__) diff --git a/src/load/azext_load/data_plane/load_trigger/commands.py b/src/load/azext_load/data_plane/load_trigger/commands.py new file mode 100644 index 00000000000..86f10b8d7f4 --- /dev/null +++ b/src/load/azext_load/data_plane/load_trigger/commands.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core.commands import CliCommandType + +admin_custom_sdk = CliCommandType( + operations_tmpl="azext_load.data_plane.load_trigger.custom#{}" +) + + +def load_trigger_schedule_commands(self, _): + with self.command_group( + "load trigger", custom_command_type=admin_custom_sdk, is_preview=True + ): + pass + + with self.command_group( + "load trigger schedule", custom_command_type=admin_custom_sdk, is_preview=True + ) as g: + g.custom_command("create", "create_trigger_schedule") + g.custom_command("update", "update_trigger_schedule") + g.custom_command("delete", "delete_trigger_schedule", confirmation=True) + g.custom_show_command("show", "get_trigger_schedule") + g.custom_command("pause", "pause_trigger_schedule") + g.custom_command("enable", "enable_trigger_schedule") + g.custom_command("list", "list_trigger_schedules") diff --git a/src/load/azext_load/data_plane/load_trigger/custom.py b/src/load/azext_load/data_plane/load_trigger/custom.py new file mode 100644 index 00000000000..8d8ae536d87 --- /dev/null +++ b/src/load/azext_load/data_plane/load_trigger/custom.py @@ -0,0 +1,247 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long + +from azure.core.exceptions import ResourceNotFoundError +from azure.cli.core.azclierror import InvalidArgumentValueError, ValidationError +from knack.log import get_logger +from azext_load.data_plane.utils.utils import ( + get_admin_data_plane_client) +from azext_load.vendored_sdks.loadtesting.models import (_models as models, _enums as enums) +from azext_load.data_plane.load_trigger import utils + +logger = get_logger(__name__) + + +def create_trigger_schedule( + cmd, + load_test_resource, + resource_group_name=None, + trigger_id=None, + description=None, + display_name=None, + trigger_start_date_time=None, + recurrence_type=None, + recurrence_interval=None, + recurrence_index=None, + recurrence_cron_expression=None, + recurrence_dates_in_month=None, + recurrence_week_days=None, + end_after_occurrence=None, + end_after_date_time=None, + test_ids=None, +): + client = get_admin_data_plane_client(cmd, load_test_resource, resource_group_name) + logger.info("Creating schedule trigger.") + try: + client.get_trigger(trigger_id) + msg = "Trigger schedule with id: {} already exists.".format(trigger_id) + logger.error(msg) + raise InvalidArgumentValueError(msg) + except ResourceNotFoundError: + pass + recurrence_end_body = utils.get_recurrence_end_body( + end_after_occurrence, + end_after_date_time, + ) + logger.debug("Recurrence end object: %s", recurrence_end_body) + recurrence_body = utils.get_recurrence_body( + recurrence_type, + recurrence_interval, + recurrence_index, + recurrence_cron_expression, + recurrence_dates_in_month, + recurrence_week_days, + recurrence_end_body, + ) + logger.debug("Recurrence object: %s", recurrence_body) + trigger_body = models.ScheduleTestsTrigger( + test_ids=test_ids, + recurrence=recurrence_body, + start_date_time=trigger_start_date_time, + state=enums.TriggerState.ACTIVE, + display_name=display_name, + description=description, + ) + logger.debug("Trigger schedule body: %s", trigger_body) + try: + response = client.create_or_update_trigger(trigger_id=trigger_id, body=trigger_body) + logger.debug("Created trigger schedule: %s", response) + logger.info("Creating trigger schedule completed") + return response.as_dict() + except Exception: + logger.error("Error occurred while creating schedule trigger.") + raise + + +def update_trigger_schedule( + cmd, + load_test_resource, + trigger_id, + resource_group_name=None, + description=None, + display_name=None, + trigger_start_date_time=None, + recurrence_type=None, + recurrence_interval=None, + recurrence_index=None, + recurrence_cron_expression=None, + recurrence_dates_in_month=None, + recurrence_week_days=None, + end_after_occurrence=None, + end_after_date_time=None, + test_ids=None, +): + client = get_admin_data_plane_client(cmd, load_test_resource, resource_group_name) + logger.info("Updating schedule trigger with id: %s", trigger_id) + existing_trigger_schedule: models.ScheduleTestsTrigger = None + try: + existing_trigger_schedule = client.get_trigger(trigger_id) + except ResourceNotFoundError: + msg = "Schedule trigger with id: {} does not exists.".format(trigger_id) + logger.debug(msg) + raise InvalidArgumentValueError(msg) + logger.debug("Existing schedule trigger: %s", existing_trigger_schedule) + recurrence_end_body = utils.get_recurrence_end_body( + end_after_occurrence, + end_after_date_time, + existing_trigger_schedule.recurrence.recurrence_end if existing_trigger_schedule.recurrence else None + ) + logger.debug("Recurrence end object: %s", recurrence_end_body) + recurrence_body = utils.get_recurrence_body_for_update( + recurrence_type, + recurrence_interval, + recurrence_index, + recurrence_cron_expression, + recurrence_dates_in_month, + recurrence_week_days, + recurrence_end_body, + existing_trigger_schedule.recurrence + ) + logger.debug("Recurrence object: %s", recurrence_body) + new_trigger_body = models.ScheduleTestsTrigger( + test_ids=test_ids, + recurrence=recurrence_body, + start_date_time=trigger_start_date_time, + display_name=display_name, + description=description, + ) + new_trigger_body.state = existing_trigger_schedule.state + logger.debug("Schedule trigger body to be sent for update: %s", new_trigger_body) + try: + response = client.create_or_update_trigger(trigger_id=trigger_id, body=new_trigger_body) + logger.debug("Updated schedule trigger: %s", response) + logger.info("Updating schedule trigger completed") + return response.as_dict() + except Exception: + logger.error("Error occurred while updating schedule trigger.") + raise + + +def delete_trigger_schedule( + cmd, + load_test_resource, + trigger_id, + resource_group_name=None, +): + logger.info( + "Deleting schedule trigger with id: %s", trigger_id + ) + client = get_admin_data_plane_client(cmd, load_test_resource, resource_group_name) + client.delete_trigger(trigger_id) + logger.info("Deleting schedule trigger completed.") + + +def get_trigger_schedule( + cmd, + load_test_resource, + trigger_id, + resource_group_name=None, +): + logger.info( + "Getting schedule trigger with id: %s", trigger_id + ) + client = get_admin_data_plane_client(cmd, load_test_resource, resource_group_name) + response = client.get_trigger(trigger_id) + logger.debug("Fetched schedule trigger: %s", response) + return response.as_dict() + + +def pause_trigger_schedule( + cmd, + load_test_resource, + trigger_id, + resource_group_name=None, +): + logger.info( + "Pausing schedule trigger with id: %s", trigger_id + ) + client = get_admin_data_plane_client(cmd, load_test_resource, resource_group_name) + existing_trigger_schedule: models.ScheduleTestsTrigger = None + try: + existing_trigger_schedule = client.get_trigger(trigger_id) + except ResourceNotFoundError: + msg = "Schedule trigger with id: {} does not exists.".format(trigger_id) + logger.debug(msg) + raise InvalidArgumentValueError(msg) + logger.debug("Existing schedule trigger object: %s", existing_trigger_schedule) + if existing_trigger_schedule.state == enums.TriggerState.ACTIVE: + existing_trigger_schedule.state = enums.TriggerState.PAUSED + response = client.create_or_update_trigger(trigger_id=trigger_id, body=existing_trigger_schedule) + logger.debug("Paused schedule trigger: %s", response) + return response.as_dict() + if existing_trigger_schedule.state == enums.TriggerState.COMPLETED: + msg = "Schedule trigger with id: {} is already completed. A completed schedule cannot be paused.".format(trigger_id) + logger.error(msg) + raise ValidationError(msg) + logger.warning("Schedule trigger is not active. It is in %s state. Enable the schedule before performing pause action.", existing_trigger_schedule.state.value) + + +def enable_trigger_schedule( + cmd, + load_test_resource, + trigger_id, + resource_group_name=None, +): + logger.info( + "Enabling schedule trigger with id: %s", trigger_id + ) + client = get_admin_data_plane_client(cmd, load_test_resource, resource_group_name) + existing_trigger_schedule: models.ScheduleTestsTrigger = None + try: + existing_trigger_schedule = client.get_trigger(trigger_id) + except ResourceNotFoundError: + msg = "Schedule trigger with id: {} does not exists.".format(trigger_id) + logger.debug(msg) + raise InvalidArgumentValueError(msg) + logger.debug("Existing trigger object: %s", existing_trigger_schedule) + if existing_trigger_schedule.state != enums.TriggerState.COMPLETED: + existing_trigger_schedule.state = enums.TriggerState.ACTIVE + response = client.create_or_update_trigger(trigger_id=trigger_id, body=existing_trigger_schedule) + logger.debug("Enabled schedule trigger: %s", response) + return response.as_dict() + msg = "Schedule trigger with id: {} is already completed. A completed schedule cannot be enabled.".format(trigger_id) + logger.debug(msg) + raise ValidationError(msg) + + +def list_trigger_schedules( + cmd, + load_test_resource, + resource_group_name=None, + trigger_states=None, + test_ids=None, +): + logger.info("Listing schedule triggers.") + client = get_admin_data_plane_client(cmd, load_test_resource, resource_group_name) + if trigger_states: + trigger_states = ",".join(trigger_states) + if test_ids: + test_ids = ",".join(test_ids) + logger.info("Schedule trigger states: %s", trigger_states) + response_list = client.list_trigger(test_ids=test_ids, states=trigger_states) + logger.debug("Fetched list of schedule triggers: %s", response_list) + return [response.as_dict() for response in response_list] diff --git a/src/load/azext_load/data_plane/load_trigger/help.py b/src/load/azext_load/data_plane/load_trigger/help.py new file mode 100644 index 00000000000..669514bcf3a --- /dev/null +++ b/src/load/azext_load/data_plane/load_trigger/help.py @@ -0,0 +1,107 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# pylint: disable=too-many-lines + +helps = {} + +helps[ + "load trigger schedule create" +] = """ +type: command +short-summary: Create a new load trigger schedule. +examples: + - name: Create a schedule trigger with daily recurrence. + text: | + az load trigger schedule create --load-test-resource sample-alt-resource --resource-group sample-rg --trigger-id sample-trigger-id --description "Sample description" --display-name "Sample display name" --start-date-time 2023-01-01T15:16:17Z --recurrence-type Daily --recurrence-interval 1 --end-after-occurrence 5 --test-ids sample-test-id + - name: Create a schedule trigger with weekly recurrence. + text: | + az load trigger schedule create --load-test-resource sample-alt-resource --resource-group sample-rg --trigger-id sample-trigger-id --description "Sample description" --display-name "Sample display name" --start-date-time 2023-01-01T15:16:17Z --recurrence-type Weekly --recurrence-interval 1 --recurrence-week-days Monday Tuesday Wednesday Thursday Friday --end-after-occurrence 15 --test-ids sample-test-id + - name: Create a schedule trigger with cron expression. + text: | + az load trigger schedule create --load-test-resource sample-alt-resource --resource-group sample-rg --trigger-id sample-trigger-id --description "Sample description" --display-name "Sample display name" --start-date-time 2023-01-01T15:16:17Z --recurrence-cron-exp "0 0 12 * *" --end-after-occurrence 10 --test-ids sample-test-id +""" + +helps[ + "load trigger schedule update" +] = """ +type: command +short-summary: Update a load trigger schedule. +examples: + - name: Update display name of schedule. + text: | + az load trigger schedule update --load-test-resource sample-alt-resource --resource-group sample-rg --trigger-id sample-trigger-id --display-name "Updated display name" + - name: Update recurrence type of schedule. + text: | + az load trigger schedule update --load-test-resource sample-alt-resource --resource-group sample-rg --trigger-id sample-trigger-id --recurrence-type Weekly --recurrence-interval 2 --recurrence-week-days Monday Tuesday Wednesday Thursday Friday + - name: Update recurrence end date of schedule. + text: | + az load trigger schedule update --load-test-resource sample-alt-resource --resource-group sample-rg --trigger-id sample-trigger-id --end-after-date-time 2025-12-31T15:16:17Z +""" + +helps[ + "load trigger schedule delete" +] = """ +type: command +short-summary: Delete a load trigger schedule. +examples: + - name: Delete schedule. + text: | + az load trigger schedule delete --load-test-resource sample-alt-resource --resource-group sample-rg --trigger-id sample-trigger-id +""" + +helps[ + "load trigger schedule show" +] = """ +type: command +short-summary: Show details of a load trigger schedule. +examples: + - name: Show schedule. + text: | + az load trigger schedule show --load-test-resource sample-alt-resource --resource-group sample-rg --trigger-id sample-trigger-id +""" + +helps[ + "load trigger schedule pause" +] = """ +type: command +short-summary: Pause a schedule trigger. +examples: + - name: Pause schedule. + text: | + az load trigger schedule pause --load-test-resource sample-alt-resource --resource-group sample-rg --trigger-id sample-trigger-id +""" + +helps[ + "load trigger schedule enable" +] = """ +type: command +short-summary: Enable a schedule trigger. +examples: + - name: Enable schedule. + text: | + az load trigger schedule enable --load-test-resource sample-alt-resource --resource-group sample-rg --trigger-id sample-trigger-id +""" + +helps[ + "load trigger schedule list" +] = """ +type: command +short-summary: List all schedule triggers. +examples: + - name: List all schedule triggers. + text: | + az load trigger schedule list --load-test-resource sample-alt-resource --resource-group sample-rg + - name: List schedule which are in active state. + text: | + az load trigger schedule list --load-test-resource sample-alt-resource --resource-group sample-rg --states Active + - name: List schedule which are associated with given test ids. + text: | + az load trigger schedule list --load-test-resource sample-alt-resource --resource-group sample-rg --test-ids sample-test-id1 sample-test-id2 + - name: List schedule which are in paused state and associated with given test ids. + text: | + az load trigger schedule list --load-test-resource sample-alt-resource --resource-group sample-rg --states Paused --test-ids sample-test-id1 sample-test-id2 +""" diff --git a/src/load/azext_load/data_plane/load_trigger/params.py b/src/load/azext_load/data_plane/load_trigger/params.py new file mode 100644 index 00000000000..45be52fca43 --- /dev/null +++ b/src/load/azext_load/data_plane/load_trigger/params.py @@ -0,0 +1,53 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements +# pylint: disable=line-too-long + +from azext_load.data_plane.utils import argtypes + + +def load_arguments(self, _): + # Load Trigger Schedule + with self.argument_context("load trigger schedule") as c: + c.argument("load_test_resource", argtypes.load_test_resource) + c.argument("resource_group_name", argtypes.resource_group) + c.argument("trigger_id", argtypes.trigger_id) + + # Load Trigger Schedule Create + with self.argument_context("load trigger schedule create") as c: + c.argument("description", argtypes.trigger_description) + c.argument("display_name", argtypes.trigger_display_name) + c.argument("trigger_start_date_time", argtypes.trigger_start_date_time) + c.argument("recurrence_type", argtypes.recurrence_type) + c.argument("recurrence_interval", argtypes.recurrence_interval) + c.argument("recurrence_index", argtypes.recurrence_index) + c.argument("recurrence_cron_expression", argtypes.recurrence_cron_expression) + c.argument("recurrence_dates_in_month", argtypes.recurrence_dates_in_month) + c.argument("recurrence_week_days", argtypes.recurrence_week_days) + c.argument("end_after_occurrence", argtypes.end_after_occurrences) + c.argument("end_after_date_time", argtypes.end_after_date_time) + c.argument("test_ids", argtypes.test_ids) + + # Load Trigger Schedule Update + with self.argument_context("load trigger schedule update") as c: + c.argument("description", argtypes.trigger_description) + c.argument("display_name", argtypes.trigger_display_name) + c.argument("trigger_start_date_time", argtypes.trigger_start_date_time) + c.argument("recurrence_type", argtypes.recurrence_type) + c.argument("recurrence_interval", argtypes.recurrence_interval) + c.argument("recurrence_index", argtypes.recurrence_index) + c.argument("recurrence_cron_expression", argtypes.recurrence_cron_expression) + c.argument("recurrence_dates_in_month", argtypes.recurrence_dates_in_month) + c.argument("recurrence_week_days", argtypes.recurrence_week_days) + c.argument("end_after_occurrence", argtypes.end_after_occurrences) + c.argument("end_after_date_time", argtypes.end_after_date_time) + c.argument("test_ids", argtypes.test_ids) + + # Load Trigger Schedule List + with self.argument_context("load trigger schedule list") as c: + c.argument("test_ids", argtypes.list_schedule_test_ids) + c.argument("trigger_states", argtypes.list_schedule_states) diff --git a/src/load/azext_load/data_plane/load_trigger/utils.py b/src/load/azext_load/data_plane/load_trigger/utils.py new file mode 100644 index 00000000000..f4dea80c7c2 --- /dev/null +++ b/src/load/azext_load/data_plane/load_trigger/utils.py @@ -0,0 +1,197 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +# Disabled since logging statements were flagged as too long + +from datetime import datetime +from azext_load.vendored_sdks.loadtesting.models import _models as models +from azext_load.vendored_sdks.loadtesting.models import _enums as enums +from knack.log import get_logger +from azure.cli.core.azclierror import InvalidArgumentValueError + +logger = get_logger(__name__) + + +def parse_datetime_in_utc(value): + try: + parsed_date_time = datetime.strptime(value, "%Y-%m-%dT%H:%M:%SZ") + return parsed_date_time + except ValueError: + raise InvalidArgumentValueError("Invalid datetime format. Please provide datetime in UTC format (YYYY-MM-DDTHH:MM:SSZ).") + + +def get_recurrence_end_body(end_after_occurrence, end_after_date_time, existing_recurrence_end=None): + if end_after_occurrence is not None and end_after_date_time is not None: + raise InvalidArgumentValueError("Specify either end_after_occurrence or end_after_date_time, not both.") + + if end_after_occurrence is not None: + return models.RecurrenceEnd(number_of_occurrences=end_after_occurrence) + + if end_after_date_time is not None: + return models.RecurrenceEnd(end_date_time=end_after_date_time) + + return existing_recurrence_end + + +def _handle_daily_recurrence(recurrence_interval, recurrence_end_body, **kwargs): + if recurrence_interval is None: + raise InvalidArgumentValueError("Recurrence interval is required for daily recurrence.") + if any(kwargs.values()): + raise InvalidArgumentValueError("Only recurrence interval is a valid input for daily recurrence.") + return models.DailyRecurrence( + interval=recurrence_interval, + recurrence_end=recurrence_end_body + ) + + +def _handle_weekly_recurrence(recurrence_interval, recurrence_week_days, recurrence_end_body, **kwargs): + if recurrence_interval is None: + raise InvalidArgumentValueError("Recurrence interval is required for weekly recurrence.") + if recurrence_week_days is None or len(recurrence_week_days) == 0: + raise InvalidArgumentValueError("Recurrence week days are required for weekly recurrence.") + if any(kwargs.values()): + raise InvalidArgumentValueError("Only recurrence interval and week days are valid inputs for weekly recurrence.") + return models.WeeklyRecurrence( + interval=recurrence_interval, + days_of_week=recurrence_week_days, + recurrence_end=recurrence_end_body + ) + + +def _handle_hourly_recurrence(recurrence_interval, recurrence_end_body, **kwargs): + if recurrence_interval is None: + raise InvalidArgumentValueError("Recurrence interval is required for hourly recurrence.") + if any(kwargs.values()): + raise InvalidArgumentValueError("Only recurrence interval is a valid input for hourly recurrence.") + return models.HourlyRecurrence( + interval=recurrence_interval, + recurrence_end=recurrence_end_body + ) + + +def _handle_monthly_by_dates_recurrence(recurrence_interval, recurrence_dates_in_month, recurrence_end_body, **kwargs): + if recurrence_interval is None: + raise InvalidArgumentValueError("Recurrence interval is required for monthly by dates recurrence.") + if recurrence_dates_in_month is None or len(recurrence_dates_in_month) == 0: + raise InvalidArgumentValueError("Recurrence dates in month are required for monthly by dates recurrence.") + if any(kwargs.values()): + raise InvalidArgumentValueError("Only recurrence interval and dates in month are valid input for monthly by dates recurrence.") + return models.MonthlyRecurrenceByDates( + interval=recurrence_interval, + dates_in_month=recurrence_dates_in_month, + recurrence_end=recurrence_end_body + ) + + +def _handle_monthly_by_days_recurrence(recurrence_interval, recurrence_week_days, recurrence_index, recurrence_end_body, **kwargs): + if recurrence_interval is None: + raise InvalidArgumentValueError("Recurrence interval is required for monthly by days recurrence.") + if recurrence_week_days is None or len(recurrence_week_days) == 0: + raise InvalidArgumentValueError("Recurrence week days are required for monthly by days recurrence.") + if recurrence_index not in range(1, 6): + raise InvalidArgumentValueError("Recurrence index should be between 1 and 5 for monthly by days recurrence.") + if any(kwargs.values()): + raise InvalidArgumentValueError("Only recurrence interval, week days, and index are valid input for monthly by days recurrence.") + return models.MonthlyRecurrenceByWeekDays( + interval=recurrence_interval, + week_days_in_month=recurrence_week_days, + index=recurrence_index, + recurrence_end=recurrence_end_body + ) + + +def _handle_cron_recurrence(recurrence_cron_expression, recurrence_end_body, **kwargs): + if recurrence_cron_expression is None: + raise InvalidArgumentValueError("Recurrence cron expression is required for cron recurrence.") + if any(kwargs.values()): + raise InvalidArgumentValueError("Only recurrence cron expression is valid input for cron recurrence.") + return models.RecurrenceWithCron( + cron_expression=recurrence_cron_expression, + recurrence_end=recurrence_end_body + ) + + +recurrence_handlers = { + enums.Frequency.DAILY: _handle_daily_recurrence, + enums.Frequency.WEEKLY: _handle_weekly_recurrence, + enums.Frequency.HOURLY: _handle_hourly_recurrence, + enums.Frequency.MONTHLY_BY_DATES: _handle_monthly_by_dates_recurrence, + enums.Frequency.MONTHLY_BY_DAYS: _handle_monthly_by_days_recurrence, + enums.Frequency.CRON: _handle_cron_recurrence, +} + + +def get_recurrence_body( + recurrence_type, + recurrence_interval, + recurrence_index, + recurrence_cron_expression, + recurrence_dates_in_month, + recurrence_week_days, + recurrence_end_body, +): + if recurrence_type is None: + if any([recurrence_interval, recurrence_index, recurrence_cron_expression, recurrence_dates_in_month, recurrence_week_days]): + raise InvalidArgumentValueError("Recurrence type is required.") + logger.debug("Recurrence type not provided. Treating it as one-time trigger.") + return None + + handler = recurrence_handlers.get(recurrence_type) + if handler: + return handler( + recurrence_interval=recurrence_interval, + recurrence_index=recurrence_index, + recurrence_cron_expression=recurrence_cron_expression, + recurrence_dates_in_month=recurrence_dates_in_month, + recurrence_week_days=recurrence_week_days, + recurrence_end_body=recurrence_end_body + ) + return None + + +def get_recurrence_body_for_update( + recurrence_type, + recurrence_interval, + recurrence_index, + recurrence_cron_expression, + recurrence_dates_in_month, + recurrence_week_days, + recurrence_end_body, + existing_recurrence, +): + if recurrence_type is None: + if existing_recurrence is None: + if any([recurrence_interval, recurrence_index, recurrence_cron_expression, recurrence_dates_in_month, recurrence_week_days]): + raise InvalidArgumentValueError("Updating recurrence properties of a non recurring schedule requires recurrence type.") + logger.debug("Recurrence type not provided. Treating it as one-time trigger.") + return None + recurrence_type = existing_recurrence.frequency + if recurrence_type == enums.Frequency.CRON: + recurrence_cron_expression = recurrence_cron_expression or existing_recurrence.cron_expression + elif recurrence_type == enums.Frequency.DAILY: + recurrence_interval = recurrence_interval or existing_recurrence.interval + elif recurrence_type == enums.Frequency.WEEKLY: + recurrence_interval = recurrence_interval or existing_recurrence.interval + recurrence_week_days = recurrence_week_days or existing_recurrence.days_of_week + elif recurrence_type == enums.Frequency.HOURLY: + recurrence_interval = recurrence_interval or existing_recurrence.interval + elif recurrence_type == enums.Frequency.MONTHLY_BY_DATES: + recurrence_interval = recurrence_interval or existing_recurrence.interval + recurrence_dates_in_month = recurrence_dates_in_month or existing_recurrence.days_of_month + elif recurrence_type == enums.Frequency.MONTHLY_BY_DAYS: + recurrence_interval = recurrence_interval or existing_recurrence.interval + recurrence_week_days = recurrence_week_days or existing_recurrence.days_of_week + recurrence_index = recurrence_index or existing_recurrence.index + + return get_recurrence_body( + recurrence_type, + recurrence_interval, + recurrence_index, + recurrence_cron_expression, + recurrence_dates_in_month, + recurrence_week_days, + recurrence_end_body + ) diff --git a/src/load/azext_load/data_plane/utils/argtypes.py b/src/load/azext_load/data_plane/utils/argtypes.py index b6cc5288c69..f3a26f3d9f3 100644 --- a/src/load/azext_load/data_plane/utils/argtypes.py +++ b/src/load/azext_load/data_plane/utils/argtypes.py @@ -5,7 +5,6 @@ # pylint: disable=line-too-long -from azext_load.data_plane.utils import completers, models, utils, validators from azure.cli.core.commands.parameters import ( get_generic_completion_list, get_resource_name_completion_list, @@ -13,6 +12,9 @@ resource_group_name_type, ) from knack.arguments import CLIArgumentType +from azext_load.data_plane.utils import completers, models, utils, validators +from azext_load.vendored_sdks.loadtesting.models._enums import WeekDays, Frequency, TriggerState +from azext_load.data_plane.load_trigger import utils as trigger_utils quote_text = f"Use {quotes} to clear existing {{}}." @@ -423,3 +425,101 @@ choices=utils.get_enum_values(models.AllowedTrendsResponseTimeAggregations), help="Specify the aggregation method for response time.", ) + +trigger_id = CLIArgumentType( + validator=validators.validate_trigger_id, + options_list=["--trigger-id"], + type=str, + help="Trigger ID of the load trigger", +) + +trigger_start_date_time = CLIArgumentType( + options_list=["--start-date-time"], + type=trigger_utils.parse_datetime_in_utc, + help="Start date time of the load trigger schedule", +) + +recurrence_type = CLIArgumentType( + options_list=["--recurrence-type"], + type=str, + choices=utils.get_enum_values(Frequency), + help="Recurrence type of the load trigger schedule", +) + +end_after_occurrences = CLIArgumentType( + options_list=["--end-after-occurrence"], + type=int, + help="End after occurrence of the load trigger schedule", +) + +end_after_date_time = CLIArgumentType( + options_list=["--end-after-date-time"], + type=trigger_utils.parse_datetime_in_utc, + help="End after date time of the load trigger schedule", +) + +test_ids = CLIArgumentType( + options_list=["--test-ids"], + nargs=1, + validator=validators.validate_schedule_test_ids, + help="Test IDs of the load tests to be triggered by schedule. Currently we only support one test ID per schedule.", +) + +trigger_display_name = CLIArgumentType( + options_list=["--display-name"], + type=str, + help="Display name of the load trigger schedule", +) + +trigger_description = CLIArgumentType( + options_list=["--description"], + type=str, + help="Description of the load trigger schedule", +) + +recurrence_cron_expression = CLIArgumentType( + options_list=["--recurrence-cron-exp"], + type=str, + help="Cron expression for the recurrence type 'Cron'.", +) + +recurrence_interval = CLIArgumentType( + options_list=["--recurrence-interval"], + type=int, + help="Interval for all recurrence type except 'Cron'.", +) + +recurrence_dates_in_month = CLIArgumentType( + options_list=["--recurrence-dates"], + nargs="+", + type=int, + validator=validators.validate_recurrence_dates_in_month, + help="Space separated list of dates in month for the recurrence type 'Monthly'.", +) + +recurrence_week_days = CLIArgumentType( + options_list=["--recurrence-week-days"], + choices=utils.get_enum_values(WeekDays), + nargs="*", + help="Week days for the recurrence type 'Weekly' and 'MonthlyByDays'.", +) + +recurrence_index = CLIArgumentType( + options_list=["--recurrence-index"], + type=int, + choices=[1, 2, 3, 4, 5], + help="Index for the recurrence type 'MonthlyByDays'.", +) + +list_schedule_test_ids = CLIArgumentType( + options_list=["--test-ids"], + nargs="*", + help="List all the schedules which are associated with the provided test ids.", +) + +list_schedule_states = CLIArgumentType( + options_list=["--states"], + nargs="*", + choices=utils.get_enum_values(TriggerState), + help="List all the schedules in the resource which are in the provided states.", +) diff --git a/src/load/azext_load/data_plane/utils/validators.py b/src/load/azext_load/data_plane/utils/validators.py index 78e3d5a1736..15958fbbceb 100644 --- a/src/load/azext_load/data_plane/utils/validators.py +++ b/src/load/azext_load/data_plane/utils/validators.py @@ -27,26 +27,28 @@ logger = get_logger(__name__) -def validate_test_id(namespace): - """Validates test-id""" - if not isinstance(namespace.test_id, str): +def _validate_id(namespace, id_name, arg_name=None): + """Validates a generic ID""" + id_value = getattr(namespace, id_name, None) + arg_name = arg_name or id_name + if id_value is None: + raise InvalidArgumentValueError(f"{arg_name} is required.") + if not isinstance(id_value, str): raise InvalidArgumentValueError( - f"Invalid test-id type: {type(namespace.test_id)}" + f"Invalid {arg_name} type: {type(id_value)}. Expected a string." ) - if not re.match("^[a-z0-9_-]*$", namespace.test_id): - raise InvalidArgumentValueError("Invalid test-id value") + if not re.match("^[a-z0-9_-]*$", id_value): + raise InvalidArgumentValueError(f"Invalid {arg_name} value.") + + +def validate_test_id(namespace): + """Validates test-id""" + _validate_id(namespace, "test_id", "test-id") def validate_test_run_id(namespace): """Validates test-run-id""" - if namespace.test_run_id is None: - namespace.test_run_id = utils.get_random_uuid() - if not isinstance(namespace.test_run_id, str): - raise InvalidArgumentValueError( - f"Invalid test-run-id type: {type(namespace.test_run_id)}" - ) - if not re.match("^[a-z0-9_-]*$", namespace.test_run_id): - raise InvalidArgumentValueError("Invalid test-run-id value") + _validate_id(namespace, "test_run_id", "test-run-id") def _validate_akv_url(string, url_type="secrets|certificates|keys|storage"): @@ -570,3 +572,34 @@ def validate_engine_ref_ids_and_type(incoming_engine_ref_id_type, engine_ref_ids raise InvalidArgumentValueError( "Atleast one engine-ref-ids should be provided when engine-ref-id-type is UserAssigned" ) + + +def validate_trigger_id(namespace): + """Validates trigger-id""" + _validate_id(namespace, "trigger_id", "trigger-id") + + +def validate_recurrence_dates_in_month(namespace): + if namespace.recurrence_dates_in_month is None: + return + if not isinstance(namespace.recurrence_dates_in_month, list): + raise InvalidArgumentValueError( + f"Invalid recurrence-dates type: {type(namespace.recurrence_dates_in_month)}. \ + Expected list of integers" + ) + for item in namespace.recurrence_dates_in_month: + if not isinstance(item, int) or item < 1 or item > 31: + raise InvalidArgumentValueError( + f"Invalid recurrence-dates item: {item}. Expected integer between 1 and 31" + ) + + +def validate_schedule_test_ids(namespace): + if namespace.test_ids is None: + return + if not isinstance(namespace.test_ids, list): + raise InvalidArgumentValueError("Invalid test-ids type: {}. Expected list of test id.".format(type(namespace.test_ids))) + if len(namespace.test_ids) != 1: + raise InvalidArgumentValueError("Currently we only support one test ID per schedule.") + if not re.match("^[a-z0-9_-]*$", namespace.test_ids[0]): + raise InvalidArgumentValueError("Invalid test-id value.") diff --git a/src/load/azext_load/tests/latest/constants.py b/src/load/azext_load/tests/latest/constants.py index f7544ab09a3..56e99dff591 100644 --- a/src/load/azext_load/tests/latest/constants.py +++ b/src/load/azext_load/tests/latest/constants.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -import os +import os, datetime TEST_RESOURCES_DIR = os.path.join(os.path.dirname(__file__), r"resources") @@ -261,3 +261,91 @@ class LoadTestFailureCriteriaKeys: "LessThan": "<", "GreaterThan": ">" } + + +class LoadTestTriggerConstants(LoadConstants): + # Constants for test_pause_trigger_schedule + PAUSE_TRIGGER_ID = "test-trigger-id-pause" + PAUSE_DESCRIPTION = "Trigger schedule for pause test case" + PAUSE_DISPLAY_NAME = "Pause Trigger" + PAUSE_TEST_IDS = "test-id-pause" + + # Constants for test_enable_trigger_schedule + ENABLE_TRIGGER_ID = "test-trigger-id-enable" + ENABLE_DESCRIPTION = "Trigger schedule for enable test case" + ENABLE_DISPLAY_NAME = "Enable Trigger" + ENABLE_TEST_IDS = "test-id-enable" + + # Constants for test_delete_trigger_schedule + DELETE_TRIGGER_ID = "test-trigger-id-delete" + DELETE_DESCRIPTION = "Trigger schedule for delete test case" + DELETE_DISPLAY_NAME = "Delete Trigger" + DELETE_TEST_IDS = "test-id-delete" + + # Constants for test_list_trigger_schedule + LIST_TRIGGER_ID = "test-trigger-id-list" + LIST_DESCRIPTION = "Trigger schedule for list test case" + LIST_DISPLAY_NAME = "List Trigger" + LIST_TEST_IDS = "test-id-list" + + # Constants for test_update_trigger_schedule + UPDATE_TRIGGER_ID = "test-trigger-id-update" + UPDATE_DESCRIPTION = "Trigger schedule for update test case" + UPDATE_DISPLAY_NAME = "Update Trigger" + UPDATE_TEST_IDS = "test-id-update" + + DAILY_RECURRENCE_TYPE = "Daily" + RECURRENCE_INTERVAL_ONE = 1 + CURRENT_DATE_TIME = datetime.datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ') + + # Constants for cron schedule + CRON_TRIGGER_ID = "test-trigger-id-cron" + CRON_DESCRIPTION = "Trigger schedule for cron test case" + CRON_DISPLAY_NAME = "Cron Trigger" + CRON_TEST_IDS = "test-id-cron" + CRON_RECURRENCE_TYPE = "Cron" + CRON_RECURRENCE_CRON_EXPRESSION = "0 0 12 * *" + + # Constants for daily schedule + DAILY_TRIGGER_ID = "test-trigger-id-daily" + DAILY_DESCRIPTION = "Trigger schedule for daily test case" + DAILY_DISPLAY_NAME = "Daily Trigger" + DAILY_TEST_IDS = "test-id-daily" + DAILY_RECURRENCE_TYPE = "Daily" + DAILY_RECURRENCE_INTERVAL = 1 + + # Constants for weekly schedule + WEEKLY_TRIGGER_ID = "test-trigger-id-weekly" + WEEKLY_DESCRIPTION = "Trigger schedule for weekly test case" + WEEKLY_DISPLAY_NAME = "Weekly Trigger" + WEEKLY_TEST_IDS = "test-id-weekly" + WEEKLY_RECURRENCE_TYPE = "Weekly" + WEEKLY_RECURRENCE_INTERVAL = 1 + WEEKLY_RECURRENCE_DAYS = "Monday" + + # Constants for monthly by dates schedule + MONTHLY_DATES_TRIGGER_ID = "test-trigger-id-monthly-dates" + MONTHLY_DATES_DESCRIPTION = "Trigger schedule for monthly by dates test case" + MONTHLY_DATES_DISPLAY_NAME = "Monthly By Dates Trigger" + MONTHLY_DATES_TEST_IDS = "test-id-monthly-dates" + MONTHLY_DATES_RECURRENCE_TYPE = "MonthlyByDates" + MONTHLY_DATES_RECURRENCE_INTERVAL = 1 + MONTHLY_DATES_RECURRENCE_DATES_IN_MONTH = "1 15" + + # Constants for monthly by days schedule + MONTHLY_DAYS_TRIGGER_ID = "test-trigger-id-monthly-days" + MONTHLY_DAYS_DESCRIPTION = "Trigger schedule for monthly by days test case" + MONTHLY_DAYS_DISPLAY_NAME = "Monthly By Days Trigger" + MONTHLY_DAYS_TEST_IDS = "test-id-monthly-days" + MONTHLY_DAYS_RECURRENCE_TYPE = "MonthlyByDays" + MONTHLY_DAYS_RECURRENCE_INTERVAL = 1 + MONTHLY_DAYS_RECURRENCE_WEEK_DAYS = "Monday" + MONTHLY_DAYS_RECURRENCE_INDEX = 1 + + # Constants for invalid cases + INVALID_DAILY_TRIGGER_ID = "invalid-daily-trigger" + INVALID_WEEKLY_TRIGGER_ID = "invalid-weekly-trigger" + INVALID_MONTHLY_DATES_TRIGGER_ID = "invalid-monthly-dates-trigger" + INVALID_MONTHLY_DAYS_TRIGGER_ID = "invalid-monthly-days-trigger" + INVALID_CRON_TRIGGER_ID = "invalid-cron-trigger" + INVALID_UPDATE_TRIGGER_ID = "update-invalid-trigger" diff --git a/src/load/azext_load/tests/latest/recordings/test_create_and_verify_trigger_schedules.yaml b/src/load/azext_load/tests/latest/recordings/test_create_and_verify_trigger_schedules.yaml new file mode 100644 index 00000000000..4bd89263f2f --- /dev/null +++ b/src/load/azext_load/tests/latest/recordings/test_create_and_verify_trigger_schedules.yaml @@ -0,0 +1,1156 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.7579714Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.7579714Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:48 GMT + etag: + - '"d900a4d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: CDD737A5CF384CC2BF2530E7CAAE24DB Ref B: MAA201060514023 Ref C: 2025-03-19T08:13:47Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-daily?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: test-trigger-id-daily + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:49 GMT + mise-correlation-id: + - c0a5c7f8-fe16-4c0d-878d-73bbd52ac85f + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081349Z-18477bc996c8hpqzhC1SG179ms00000003zg00000000ytnh + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: '{"kind": "ScheduleTestsTrigger", "testIds": ["test-id-daily"], "recurrence": + {"frequency": "Daily", "interval": 1}, "startDateTime": "2025-03-19T08:13:05Z", + "state": "Active", "displayName": "Daily Trigger", "description": "Trigger schedule + for daily test case"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '262' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-daily?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-daily"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Daily + Trigger","triggerId":"test-trigger-id-daily","description":"Trigger schedule + for daily test case","state":"Active","createdDateTime":"2025-03-19T08:13:49.929Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:49.929Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '523' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:50 GMT + location: + - https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-daily?api-version=2024-12-01-preview + mise-correlation-id: + - ac4d0946-24db-4297-b280-6e4b3e34fedc + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081349Z-18477bc996c8hpqzhC1SG179ms00000003zg00000000ytrf + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.7579714Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.7579714Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:51 GMT + etag: + - '"d900a4d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 4114C7955B034C21B0A8DC594D8F32F1 Ref B: MAA201060516053 Ref C: 2025-03-19T08:13:50Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-daily?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-daily"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Daily + Trigger","triggerId":"test-trigger-id-daily","description":"Trigger schedule + for daily test case","state":"Active","createdDateTime":"2025-03-19T08:13:49.929Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:49.929Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '523' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:52 GMT + mise-correlation-id: + - 9719d94e-db34-40f7-a057-254b167b26f0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081351Z-18477bc996c8769chC1SG17fqs000000042000000000n49v + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.7579714Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.7579714Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:52 GMT + etag: + - '"d900a4d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 9E69D9E76B4741B4998B6658253C64FA Ref B: MAA201060513039 Ref C: 2025-03-19T08:13:52Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-weekly?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: test-trigger-id-weekly + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:54 GMT + mise-correlation-id: + - 867f24cb-ba48-4a01-be7a-604f52b39e46 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081352Z-18477bc996cxk5l8hC1SG1wnx0000000040000000000xk0m + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: '{"kind": "ScheduleTestsTrigger", "testIds": ["test-id-weekly"], "recurrence": + {"frequency": "Weekly", "interval": 1, "daysOfWeek": ["Monday"]}, "startDateTime": + "2025-03-19T08:13:05Z", "state": "Active", "displayName": "Weekly Trigger", + "description": "Trigger schedule for weekly test case"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '292' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-weekly?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-weekly"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Weekly","daysOfWeek":["Monday"],"interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-24T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Weekly + Trigger","triggerId":"test-trigger-id-weekly","description":"Trigger schedule + for weekly test case","state":"Active","createdDateTime":"2025-03-19T08:13:54.366Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:54.366Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '552' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:54 GMT + location: + - https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-weekly?api-version=2024-12-01-preview + mise-correlation-id: + - e4940e45-2127-4f52-b916-7781e0e15c99 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081354Z-18477bc996cxk5l8hC1SG1wnx0000000040000000000xk81 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.7579714Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.7579714Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:55 GMT + etag: + - '"d900a4d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 1CC8C2A371FE4B9CA879A5E42EA94E42 Ref B: MAA201060514035 Ref C: 2025-03-19T08:13:55Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-weekly?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-weekly"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Weekly","daysOfWeek":["Monday"],"interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-24T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Weekly + Trigger","triggerId":"test-trigger-id-weekly","description":"Trigger schedule + for weekly test case","state":"Active","createdDateTime":"2025-03-19T08:13:54.366Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:54.366Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '552' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:56 GMT + mise-correlation-id: + - a6717a18-95f6-430c-89fa-9511bfca3724 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081355Z-18477bc996cqfz4fhC1SG1ugpc000000045000000000946p + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.7579714Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.7579714Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:56 GMT + etag: + - '"d900a4d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: DB65A1355EE04ADD887F933FF13B3AC6 Ref B: MAA201060516049 Ref C: 2025-03-19T08:13:56Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-monthly-dates?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: test-trigger-id-monthly-dates + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:58 GMT + mise-correlation-id: + - 306b9e5c-c720-49b5-944c-20457574c0f2 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081357Z-18477bc996c8hpqzhC1SG179ms000000041000000000syz0 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: '{"kind": "ScheduleTestsTrigger", "testIds": ["test-id-monthly-dates"], + "recurrence": {"frequency": "MonthlyByDates", "interval": 1, "datesInMonth": + [1, 15]}, "startDateTime": "2025-03-19T08:13:05Z", "state": "Active", "displayName": + "Monthly By Dates Trigger", "description": "Trigger schedule for monthly by + dates test case"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '326' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-monthly-dates?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-monthly-dates"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"MonthlyByDates","datesInMonth":[1,15],"interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-04-01T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Monthly + By Dates Trigger","triggerId":"test-trigger-id-monthly-dates","description":"Trigger + schedule for monthly by dates test case","state":"Active","createdDateTime":"2025-03-19T08:13:58.852Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:58.852Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '592' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:58 GMT + location: + - https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-monthly-dates?api-version=2024-12-01-preview + mise-correlation-id: + - a32edfbf-ad1a-4192-bbbe-6cc1ffc9519e + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081358Z-18477bc996c8hpqzhC1SG179ms000000041000000000sz2a + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.7579714Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.7579714Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:14:00 GMT + etag: + - '"d900a4d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 750E494BC6DF40CFB0C52116E1341DC2 Ref B: MAA201060515051 Ref C: 2025-03-19T08:13:59Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-monthly-dates?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-monthly-dates"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"MonthlyByDates","datesInMonth":[1,15],"interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-04-01T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Monthly + By Dates Trigger","triggerId":"test-trigger-id-monthly-dates","description":"Trigger + schedule for monthly by dates test case","state":"Active","createdDateTime":"2025-03-19T08:13:58.852Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:58.852Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '592' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:14:01 GMT + mise-correlation-id: + - 2e8f20b7-7429-4cde-a376-ab3e331679cb + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081400Z-18477bc996c7qjcphC1SG1f06w000000044000000000gth4 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.7579714Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.7579714Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:14:02 GMT + etag: + - '"d900a4d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 4F3D5B8583684EA9957EA07338459B48 Ref B: MAA201060516035 Ref C: 2025-03-19T08:14:01Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-monthly-days?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: test-trigger-id-monthly-days + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:14:03 GMT + mise-correlation-id: + - e87c202e-d192-49bb-b76d-3137e1bd5de4 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081402Z-18477bc996cmrxbmhC1SG1uv1g000000046g000000003aq4 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: '{"kind": "ScheduleTestsTrigger", "testIds": ["test-id-monthly-days"], "recurrence": + {"frequency": "MonthlyByDays", "interval": 1, "weekDaysInMonth": ["Monday"], + "index": 1}, "startDateTime": "2025-03-19T08:13:05Z", "state": "Active", "displayName": + "Monthly By Days Trigger", "description": "Trigger schedule for monthly by days + test case"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '340' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-monthly-days?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-monthly-days"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"MonthlyByDays","weekDaysInMonth":["Monday"],"interval":1,"index":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-04-07T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Monthly + By Days Trigger","triggerId":"test-trigger-id-monthly-days","description":"Trigger + schedule for monthly by days test case","state":"Active","createdDateTime":"2025-03-19T08:14:03.776Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:14:03.776Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '604' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:14:03 GMT + location: + - https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-monthly-days?api-version=2024-12-01-preview + mise-correlation-id: + - 8c07d510-0cdb-4dfc-b2d5-d93392f57de5 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081403Z-18477bc996cmrxbmhC1SG1uv1g000000046g000000003atz + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.7579714Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.7579714Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:14:03 GMT + etag: + - '"d900a4d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 4E39C06D18CA4862A13E84291CEC1313 Ref B: MAA201060514047 Ref C: 2025-03-19T08:14:04Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-monthly-days?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-monthly-days"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"MonthlyByDays","weekDaysInMonth":["Monday"],"interval":1,"index":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-04-07T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Monthly + By Days Trigger","triggerId":"test-trigger-id-monthly-days","description":"Trigger + schedule for monthly by days test case","state":"Active","createdDateTime":"2025-03-19T08:14:03.776Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:14:03.776Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '604' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:14:05 GMT + mise-correlation-id: + - 17c24611-0b08-4fa3-ae78-597ea5f327e1 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081404Z-18477bc996cf8wxshC1SG1rav4000000042000000000phrr + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.7579714Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.7579714Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:14:05 GMT + etag: + - '"d900a4d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: E8E406F4E9CE460D854FD892935B374E Ref B: MAA201060516011 Ref C: 2025-03-19T08:14:05Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-cron?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: test-trigger-id-cron + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:14:07 GMT + mise-correlation-id: + - 4a76fac2-d110-4c56-a34b-004cdf3b3a35 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081406Z-18477bc996cxk5l8hC1SG1wnx0000000042000000000pqbn + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: '{"kind": "ScheduleTestsTrigger", "testIds": ["test-id-cron"], "recurrence": + {"frequency": "Cron", "cronExpression": "0 0 12 * *"}, "startDateTime": "2025-03-19T08:13:05Z", + "state": "Active", "displayName": "Cron Trigger", "description": "Trigger schedule + for cron test case"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '275' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-cron?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-cron"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Cron","cronExpression":"0 + 0 12 * *"},"recurrenceStatus":{"nextScheduledDateTimes":["2025-04-12T00:00:00Z"]},"kind":"ScheduleTestsTrigger","displayName":"Cron + Trigger","triggerId":"test-trigger-id-cron","description":"Trigger schedule + for cron test case","state":"Active","createdDateTime":"2025-03-19T08:14:07.54Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:14:07.54Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '533' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:14:07 GMT + location: + - https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-cron?api-version=2024-12-01-preview + mise-correlation-id: + - 799df6ec-e335-4b9e-ae86-45325b4cf76d + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081407Z-18477bc996cxk5l8hC1SG1wnx0000000042000000000pqeh + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.7579714Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.7579714Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:14:07 GMT + etag: + - '"d900a4d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: F5C832D0DF52400195F045A0A860FA79 Ref B: MAA201060514033 Ref C: 2025-03-19T08:14:07Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://f37a39b5-231f-4268-8ab2-65b76c9fe6cb.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-cron?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-cron"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Cron","cronExpression":"0 + 0 12 * *"},"recurrenceStatus":{"nextScheduledDateTimes":["2025-04-12T00:00:00Z"]},"kind":"ScheduleTestsTrigger","displayName":"Cron + Trigger","triggerId":"test-trigger-id-cron","description":"Trigger schedule + for cron test case","state":"Active","createdDateTime":"2025-03-19T08:14:07.54Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:14:07.54Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '533' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:14:09 GMT + mise-correlation-id: + - 41a6f5e1-f9ea-41f4-bf13-17e6c8c348a4 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081408Z-18477bc996ccts7chC1SG1v4mc000000044000000000e6rz + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/load/azext_load/tests/latest/recordings/test_create_trigger_schedule_invalid_cases.yaml b/src/load/azext_load/tests/latest/recordings/test_create_trigger_schedule_invalid_cases.yaml new file mode 100644 index 00000000000..4486dca6db3 --- /dev/null +++ b/src/load/azext_load/tests/latest/recordings/test_create_trigger_schedule_invalid_cases.yaml @@ -0,0 +1,447 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.9218429Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.9218429Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"2b9d975e-fd96-4bfa-b03f-3b99bd7778e1.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:48 GMT + etag: + - '"d900c2d8-0000-0200-0000-67da7cb20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: E91FBAD458E345249248D364C7E7FD2E Ref B: MAA201060515021 Ref C: 2025-03-19T08:13:48Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://2b9d975e-fd96-4bfa-b03f-3b99bd7778e1.eastus.cnt-prod.loadtesting.azure.com/triggers/invalid-daily-trigger?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: invalid-daily-trigger + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:49 GMT + mise-correlation-id: + - d8476d50-9f81-4a87-86c6-45294205aeb0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081349Z-18477bc996c8wq9dhC1SG1e2t000000004500000000089up + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.9218429Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.9218429Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"2b9d975e-fd96-4bfa-b03f-3b99bd7778e1.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:51 GMT + etag: + - '"d900c2d8-0000-0200-0000-67da7cb20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 62B9E4A3AC2B4A059CA56AB2D038EB47 Ref B: MAA201060515029 Ref C: 2025-03-19T08:13:50Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://2b9d975e-fd96-4bfa-b03f-3b99bd7778e1.eastus.cnt-prod.loadtesting.azure.com/triggers/invalid-weekly-trigger?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: invalid-weekly-trigger + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:52 GMT + mise-correlation-id: + - fe55ed18-67da-4bf5-9e23-187d216db7c1 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081351Z-18477bc996cwsj7whC1SG1ee1c000000040000000000x72h + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.9218429Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.9218429Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"2b9d975e-fd96-4bfa-b03f-3b99bd7778e1.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:53 GMT + etag: + - '"d900c2d8-0000-0200-0000-67da7cb20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 781670A5047F406EB9B6CA01881B2268 Ref B: MAA201060515017 Ref C: 2025-03-19T08:13:52Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://2b9d975e-fd96-4bfa-b03f-3b99bd7778e1.eastus.cnt-prod.loadtesting.azure.com/triggers/invalid-monthly-dates-trigger?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: invalid-monthly-dates-trigger + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:54 GMT + mise-correlation-id: + - bbb31f23-eea0-401c-9f50-9cc7ccf77705 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081353Z-18477bc996clttsthC1SG10a4s000000040000000000zmw8 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.9218429Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.9218429Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"2b9d975e-fd96-4bfa-b03f-3b99bd7778e1.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:55 GMT + etag: + - '"d900c2d8-0000-0200-0000-67da7cb20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: C1049B5DEDE145B797F5418438135C4A Ref B: MAA201060515021 Ref C: 2025-03-19T08:13:54Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://2b9d975e-fd96-4bfa-b03f-3b99bd7778e1.eastus.cnt-prod.loadtesting.azure.com/triggers/invalid-monthly-days-trigger?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: invalid-monthly-days-trigger + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:56 GMT + mise-correlation-id: + - f844b7e6-1da2-41ba-826c-182b79ecdccc + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081355Z-18477bc996cf8wxshC1SG1rav4000000043g00000000fxep + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.9218429Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.9218429Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"2b9d975e-fd96-4bfa-b03f-3b99bd7778e1.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:57 GMT + etag: + - '"d900c2d8-0000-0200-0000-67da7cb20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 5A5FBCBEE6D84E53B7F9069460DD0672 Ref B: MAA201060514023 Ref C: 2025-03-19T08:13:56Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://2b9d975e-fd96-4bfa-b03f-3b99bd7778e1.eastus.cnt-prod.loadtesting.azure.com/triggers/invalid-cron-trigger?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: invalid-cron-trigger + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:58 GMT + mise-correlation-id: + - d41eb619-9eec-4990-aa9d-8b7de761b4e8 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081357Z-18477bc996cb8q6qhC1SG1qtwn000000043g00000000f1u7 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +version: 1 diff --git a/src/load/azext_load/tests/latest/recordings/test_delete_trigger_schedule.yaml b/src/load/azext_load/tests/latest/recordings/test_delete_trigger_schedule.yaml new file mode 100644 index 00000000000..74df7fbb331 --- /dev/null +++ b/src/load/azext_load/tests/latest/recordings/test_delete_trigger_schedule.yaml @@ -0,0 +1,314 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.9454299Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.9454299Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"3b8ba859-b7bd-4680-8598-5cbf8ce8b4fc.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:50 GMT + etag: + - '"d900d2d8-0000-0200-0000-67da7cb30000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 6D408120DF284B8F8680B7647EDFF253 Ref B: MAA201060513045 Ref C: 2025-03-19T08:13:49Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://3b8ba859-b7bd-4680-8598-5cbf8ce8b4fc.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-delete?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: test-trigger-id-delete + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:51 GMT + mise-correlation-id: + - 8aab6f6f-0c87-43a4-9ca5-f9708eb2e501 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081350Z-18477bc996cxwjzbhC1SG1ra6g00000001u000000000r6xc + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: '{"kind": "ScheduleTestsTrigger", "testIds": ["test-id-delete"], "recurrence": + {"frequency": "Daily", "interval": 1}, "startDateTime": "2025-03-19T08:13:05Z", + "state": "Active", "displayName": "Delete Trigger", "description": "Trigger + schedule for delete test case"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '265' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://3b8ba859-b7bd-4680-8598-5cbf8ce8b4fc.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-delete?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-delete"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Delete + Trigger","triggerId":"test-trigger-id-delete","description":"Trigger schedule + for delete test case","state":"Active","createdDateTime":"2025-03-19T08:13:51.533Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:51.533Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '527' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:51 GMT + location: + - https://3b8ba859-b7bd-4680-8598-5cbf8ce8b4fc.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-delete?api-version=2024-12-01-preview + mise-correlation-id: + - 11561f48-2203-4b3e-a9ce-0543e2691b64 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081351Z-18477bc996cxwjzbhC1SG1ra6g00000001u000000000r6zy + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.9454299Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.9454299Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"3b8ba859-b7bd-4680-8598-5cbf8ce8b4fc.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:52 GMT + etag: + - '"d900d2d8-0000-0200-0000-67da7cb30000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 546448FDD9F648C88A36A811E8D78166 Ref B: MAA201060515027 Ref C: 2025-03-19T08:13:51Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: DELETE + uri: https://3b8ba859-b7bd-4680-8598-5cbf8ce8b4fc.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-delete?api-version=2024-12-01-preview + response: + body: + string: '' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + date: + - Wed, 19 Mar 2025 08:13:53 GMT + mise-correlation-id: + - 18348f62-2973-4ad4-be74-0c338f4a3d3f + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081353Z-18477bc996cclmt4hC1SG1728c000000044000000000dedf + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.9454299Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.9454299Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"3b8ba859-b7bd-4680-8598-5cbf8ce8b4fc.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:54 GMT + etag: + - '"d900d2d8-0000-0200-0000-67da7cb30000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: C05D4CE22C73475CA375662D97A6D072 Ref B: MAA201060514017 Ref C: 2025-03-19T08:13:53Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://3b8ba859-b7bd-4680-8598-5cbf8ce8b4fc.eastus.cnt-prod.loadtesting.azure.com/triggers?api-version=2024-12-01-preview + response: + body: + string: '{"value":[]}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:55 GMT + mise-correlation-id: + - a1ac5f9b-c1d4-4fe4-b082-ecd9479d9564 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081355Z-18477bc996cxk5l8hC1SG1wnx0000000041g00000000s3ke + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/load/azext_load/tests/latest/recordings/test_enable_trigger_schedule.yaml b/src/load/azext_load/tests/latest/recordings/test_enable_trigger_schedule.yaml new file mode 100644 index 00000000000..92e5866dfdd --- /dev/null +++ b/src/load/azext_load/tests/latest/recordings/test_enable_trigger_schedule.yaml @@ -0,0 +1,514 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.8947479Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.8947479Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"4a3a4635-6e43-4846-bb78-207e4b7fdb05.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:49 GMT + etag: + - '"d900c0d8-0000-0200-0000-67da7cb20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 1F17ECA56103434AB6A65F8044959408 Ref B: MAA201060516045 Ref C: 2025-03-19T08:13:49Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://4a3a4635-6e43-4846-bb78-207e4b7fdb05.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-enable?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: test-trigger-id-enable + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:51 GMT + mise-correlation-id: + - 8db7e9aa-1b0c-4630-a5ea-0993055e1bd9 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081350Z-18477bc996cclmt4hC1SG1728c000000046000000000517v + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: '{"kind": "ScheduleTestsTrigger", "testIds": ["test-id-enable"], "recurrence": + {"frequency": "Daily", "interval": 1}, "startDateTime": "2025-03-19T08:13:05Z", + "state": "Active", "displayName": "Enable Trigger", "description": "Trigger + schedule for enable test case"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '265' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://4a3a4635-6e43-4846-bb78-207e4b7fdb05.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-enable?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-enable"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Enable + Trigger","triggerId":"test-trigger-id-enable","description":"Trigger schedule + for enable test case","state":"Active","createdDateTime":"2025-03-19T08:13:51.345Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:51.345Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '527' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:51 GMT + location: + - https://4a3a4635-6e43-4846-bb78-207e4b7fdb05.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-enable?api-version=2024-12-01-preview + mise-correlation-id: + - 0ca06656-70f5-49cb-bafc-da7e8243669f + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081351Z-18477bc996cclmt4hC1SG1728c00000004600000000051au + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.8947479Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.8947479Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"4a3a4635-6e43-4846-bb78-207e4b7fdb05.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:52 GMT + etag: + - '"d900c0d8-0000-0200-0000-67da7cb20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: FD14816AE64D45608A88C3313959531E Ref B: MAA201060514031 Ref C: 2025-03-19T08:13:51Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://4a3a4635-6e43-4846-bb78-207e4b7fdb05.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-enable?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-enable"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Enable + Trigger","triggerId":"test-trigger-id-enable","description":"Trigger schedule + for enable test case","state":"Active","createdDateTime":"2025-03-19T08:13:51.345Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:51.345Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '527' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:53 GMT + mise-correlation-id: + - 5c7e227c-1cd3-461c-a7b0-9cc031052860 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081352Z-18477bc996cf8wxshC1SG1rav4000000044g00000000bre0 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"testIds": ["test-id-enable"], "startDateTime": "2025-03-19T08:13:05Z", + "recurrence": {"frequency": "Daily", "interval": 1}, "kind": "ScheduleTestsTrigger", + "displayName": "Enable Trigger", "description": "Trigger schedule for enable + test case", "state": "Paused"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '265' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://4a3a4635-6e43-4846-bb78-207e4b7fdb05.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-enable?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-enable"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":[]},"kind":"ScheduleTestsTrigger","displayName":"Enable + Trigger","triggerId":"test-trigger-id-enable","description":"Trigger schedule + for enable test case","state":"Paused","createdDateTime":"2025-03-19T08:13:51.345Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:53.617Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '505' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:53 GMT + mise-correlation-id: + - 6291ee27-c415-4690-bdb1-fcd3b179d834 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081353Z-18477bc996cf8wxshC1SG1rav4000000044g00000000brh8 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.8947479Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.8947479Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"4a3a4635-6e43-4846-bb78-207e4b7fdb05.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:53 GMT + etag: + - '"d900c0d8-0000-0200-0000-67da7cb20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 050C9944449F4DE1B25CE2A80AB37C53 Ref B: MAA201060515025 Ref C: 2025-03-19T08:13:53Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://4a3a4635-6e43-4846-bb78-207e4b7fdb05.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-enable?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-enable"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":[]},"kind":"ScheduleTestsTrigger","displayName":"Enable + Trigger","triggerId":"test-trigger-id-enable","description":"Trigger schedule + for enable test case","state":"Paused","createdDateTime":"2025-03-19T08:13:51.345Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:53.617Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '505' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:55 GMT + mise-correlation-id: + - a8881ffa-49d3-4114-b6d9-ef02fd2d6f8f + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081354Z-18477bc996cxwjzbhC1SG1ra6g0000000200000000001fc6 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"testIds": ["test-id-enable"], "startDateTime": "2025-03-19T08:13:05Z", + "recurrence": {"frequency": "Daily", "interval": 1}, "kind": "ScheduleTestsTrigger", + "displayName": "Enable Trigger", "description": "Trigger schedule for enable + test case", "state": "Active"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '265' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://4a3a4635-6e43-4846-bb78-207e4b7fdb05.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-enable?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-enable"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Enable + Trigger","triggerId":"test-trigger-id-enable","description":"Trigger schedule + for enable test case","state":"Active","createdDateTime":"2025-03-19T08:13:51.345Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:55.448Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '527' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:55 GMT + mise-correlation-id: + - 89826419-ead9-4c88-ae44-173585d260aa + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081355Z-18477bc996cxwjzbhC1SG1ra6g0000000200000000001fg4 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.8947479Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.8947479Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"4a3a4635-6e43-4846-bb78-207e4b7fdb05.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:56 GMT + etag: + - '"d900c0d8-0000-0200-0000-67da7cb20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: E40165D508464082914DDC7D6F048671 Ref B: MAA201060515031 Ref C: 2025-03-19T08:13:55Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://4a3a4635-6e43-4846-bb78-207e4b7fdb05.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-enable?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-enable"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Enable + Trigger","triggerId":"test-trigger-id-enable","description":"Trigger schedule + for enable test case","state":"Active","createdDateTime":"2025-03-19T08:13:51.345Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:55.448Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '527' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:57 GMT + mise-correlation-id: + - da745308-9a3f-425e-81c8-929bf1696461 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081356Z-18477bc996crszl4hC1SG168uc000000041g00000000q1ed + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/load/azext_load/tests/latest/recordings/test_list_trigger_schedules.yaml b/src/load/azext_load/tests/latest/recordings/test_list_trigger_schedules.yaml new file mode 100644 index 00000000000..17eccfd8e80 --- /dev/null +++ b/src/load/azext_load/tests/latest/recordings/test_list_trigger_schedules.yaml @@ -0,0 +1,232 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.8070692Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.8070692Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"65ce7663-3446-44e4-a509-41bb2d8089d1.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:49 GMT + etag: + - '"d90090d8-0000-0200-0000-67da7cb00000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 8646279F365640BA8D47BDE7AEF642C8 Ref B: MAA201060513049 Ref C: 2025-03-19T08:13:48Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://65ce7663-3446-44e4-a509-41bb2d8089d1.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-list?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: test-trigger-id-list + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:50 GMT + mise-correlation-id: + - 74579dba-9bac-4861-8ee7-ad0b69e563ee + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081349Z-r1bf87c6457xz99vhC1SG1adaw0000000cug00000000agve + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: '{"kind": "ScheduleTestsTrigger", "testIds": ["test-id-list"], "recurrence": + {"frequency": "Daily", "interval": 1}, "startDateTime": "2025-03-19T08:13:05Z", + "state": "Active", "displayName": "List Trigger", "description": "Trigger schedule + for list test case"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '259' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://65ce7663-3446-44e4-a509-41bb2d8089d1.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-list?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-list"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"List + Trigger","triggerId":"test-trigger-id-list","description":"Trigger schedule + for list test case","state":"Active","createdDateTime":"2025-03-19T08:13:50.35Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:50.35Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '517' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:50 GMT + location: + - https://65ce7663-3446-44e4-a509-41bb2d8089d1.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-list?api-version=2024-12-01-preview + mise-correlation-id: + - 885ad875-69eb-4d0a-a579-7244840dd890 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081350Z-r1bf87c6457xz99vhC1SG1adaw0000000cug00000000agx2 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.8070692Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.8070692Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"65ce7663-3446-44e4-a509-41bb2d8089d1.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:51 GMT + etag: + - '"d90090d8-0000-0200-0000-67da7cb00000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 233496B3791F4FBFB194899101EC3BE8 Ref B: MAA201060513025 Ref C: 2025-03-19T08:13:50Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://65ce7663-3446-44e4-a509-41bb2d8089d1.eastus.cnt-prod.loadtesting.azure.com/triggers?api-version=2024-12-01-preview + response: + body: + string: '{"value":[{"testIds":["test-id-list"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"List + Trigger","triggerId":"test-trigger-id-list","description":"Trigger schedule + for list test case","state":"Active","createdDateTime":"2025-03-19T08:13:50.35Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:50.35Z","lastModifiedBy":"hbisht@microsoft.com"}]}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '529' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:52 GMT + mise-correlation-id: + - d7615834-11fd-4630-910f-32ebf24f57d7 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081351Z-18477bc996cpf7dhhC1SG1fbe4000000042g00000000gmzr + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/load/azext_load/tests/latest/recordings/test_pause_trigger_schedule.yaml b/src/load/azext_load/tests/latest/recordings/test_pause_trigger_schedule.yaml new file mode 100644 index 00000000000..286448b7abd --- /dev/null +++ b/src/load/azext_load/tests/latest/recordings/test_pause_trigger_schedule.yaml @@ -0,0 +1,373 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.8085976Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.8085976Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"91d08108-433a-430c-8357-8b694126c3d1.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:49 GMT + etag: + - '"d900dcd8-0000-0200-0000-67da7cb40000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 12DFFB9795BE4A68A648175CA982445F Ref B: MAA201060513031 Ref C: 2025-03-19T08:13:48Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://91d08108-433a-430c-8357-8b694126c3d1.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-pause?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: test-trigger-id-pause + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:50 GMT + mise-correlation-id: + - 44eca4d6-70e4-4e42-988e-ec108ff83bfe + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081349Z-18477bc996crszl4hC1SG168uc0000000470000000001c5a + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: '{"kind": "ScheduleTestsTrigger", "testIds": ["test-id-pause"], "recurrence": + {"frequency": "Daily", "interval": 1}, "startDateTime": "2025-03-19T08:13:05Z", + "state": "Active", "displayName": "Pause Trigger", "description": "Trigger schedule + for pause test case"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '262' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://91d08108-433a-430c-8357-8b694126c3d1.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-pause?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-pause"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Pause + Trigger","triggerId":"test-trigger-id-pause","description":"Trigger schedule + for pause test case","state":"Active","createdDateTime":"2025-03-19T08:13:50.493Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:50.493Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '523' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:50 GMT + location: + - https://91d08108-433a-430c-8357-8b694126c3d1.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-pause?api-version=2024-12-01-preview + mise-correlation-id: + - d7ef09f5-57c9-4838-9c5b-64e229adffc5 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081350Z-18477bc996crszl4hC1SG168uc0000000470000000001c7r + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.8085976Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.8085976Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"91d08108-433a-430c-8357-8b694126c3d1.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:51 GMT + etag: + - '"d900dcd8-0000-0200-0000-67da7cb40000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16498' + x-msedge-ref: + - 'Ref A: 67EF4B6BEEE7487C901899C6F73CDE91 Ref B: MAA201060516009 Ref C: 2025-03-19T08:13:50Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://91d08108-433a-430c-8357-8b694126c3d1.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-pause?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-pause"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Pause + Trigger","triggerId":"test-trigger-id-pause","description":"Trigger schedule + for pause test case","state":"Active","createdDateTime":"2025-03-19T08:13:50.493Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:50.493Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '523' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:52 GMT + mise-correlation-id: + - 46aabd3b-803b-4886-b285-0b37230a8485 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081351Z-18477bc996cnwpbrhC1SG1z5r00000000480000000001m56 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"testIds": ["test-id-pause"], "startDateTime": "2025-03-19T08:13:05Z", + "recurrence": {"frequency": "Daily", "interval": 1}, "kind": "ScheduleTestsTrigger", + "displayName": "Pause Trigger", "description": "Trigger schedule for pause test + case", "state": "Paused"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '262' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://91d08108-433a-430c-8357-8b694126c3d1.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-pause?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-pause"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":[]},"kind":"ScheduleTestsTrigger","displayName":"Pause + Trigger","triggerId":"test-trigger-id-pause","description":"Trigger schedule + for pause test case","state":"Paused","createdDateTime":"2025-03-19T08:13:50.493Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:52.709Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '501' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:52 GMT + mise-correlation-id: + - 77c68945-2ebf-47e0-b011-c13ce06f2c86 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081352Z-18477bc996cnwpbrhC1SG1z5r00000000480000000001m8c + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.8085976Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.8085976Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"91d08108-433a-430c-8357-8b694126c3d1.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:53 GMT + etag: + - '"d900dcd8-0000-0200-0000-67da7cb40000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16498' + x-msedge-ref: + - 'Ref A: 99A3CA60422F4517960E0747FD2599E1 Ref B: MAA201060514011 Ref C: 2025-03-19T08:13:53Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://91d08108-433a-430c-8357-8b694126c3d1.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-pause?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-pause"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":[]},"kind":"ScheduleTestsTrigger","displayName":"Pause + Trigger","triggerId":"test-trigger-id-pause","description":"Trigger schedule + for pause test case","state":"Paused","createdDateTime":"2025-03-19T08:13:50.493Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:52.709Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '501' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:54 GMT + mise-correlation-id: + - 995ffbd0-c82b-4342-9241-0b55611fceaa + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081354Z-18477bc996cb8q6qhC1SG1qtwn000000040000000000y2wf + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/load/azext_load/tests/latest/recordings/test_update_trigger_schedule.yaml b/src/load/azext_load/tests/latest/recordings/test_update_trigger_schedule.yaml new file mode 100644 index 00000000000..430ba816d4d --- /dev/null +++ b/src/load/azext_load/tests/latest/recordings/test_update_trigger_schedule.yaml @@ -0,0 +1,283 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.7758883Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.7758883Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"d9a75b6c-936b-4ed6-8d82-a364caf44a32.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:49 GMT + etag: + - '"d900bdd8-0000-0200-0000-67da7cb20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16498' + x-msedge-ref: + - 'Ref A: A616C0D56707431CA93F8274BA31349A Ref B: MAA201060515017 Ref C: 2025-03-19T08:13:48Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://d9a75b6c-936b-4ed6-8d82-a364caf44a32.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-update?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: test-trigger-id-update + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:50 GMT + mise-correlation-id: + - 8168c9a7-9c3c-4bc0-80c4-c0d2a92cf8c6 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081349Z-r1bf87c64574hs45hC1SG1nrp000000003eg000000003dna + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: '{"kind": "ScheduleTestsTrigger", "testIds": ["test-id-update"], "recurrence": + {"frequency": "Daily", "interval": 1}, "startDateTime": "2025-03-19T08:13:05Z", + "state": "Active", "displayName": "Update Trigger", "description": "Trigger + schedule for update test case"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '265' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://d9a75b6c-936b-4ed6-8d82-a364caf44a32.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-update?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-update"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Update + Trigger","triggerId":"test-trigger-id-update","description":"Trigger schedule + for update test case","state":"Active","createdDateTime":"2025-03-19T08:13:50.421Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:50.421Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '527' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:50 GMT + location: + - https://d9a75b6c-936b-4ed6-8d82-a364caf44a32.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-update?api-version=2024-12-01-preview + mise-correlation-id: + - 375b263c-7604-4ddd-a2b9-eaa0f860bb7d + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081350Z-r1bf87c64574hs45hC1SG1nrp000000003eg000000003dpu + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:14.7758883Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:14.7758883Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"d9a75b6c-936b-4ed6-8d82-a364caf44a32.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:50 GMT + etag: + - '"d900bdd8-0000-0200-0000-67da7cb20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16498' + x-msedge-ref: + - 'Ref A: 21FF39AF848C4465913F180AE90D5A8A Ref B: MAA201060516019 Ref C: 2025-03-19T08:13:50Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://d9a75b6c-936b-4ed6-8d82-a364caf44a32.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-update?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-update"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Update + Trigger","triggerId":"test-trigger-id-update","description":"Trigger schedule + for update test case","state":"Active","createdDateTime":"2025-03-19T08:13:50.421Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:50.421Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '527' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:52 GMT + mise-correlation-id: + - 44a6abf5-0f9e-4c03-92c2-ab99d6b8a62a + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081351Z-r1bf87c6457mxg5mhC1SG1uyvs00000007xg0000000087v2 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"kind": "ScheduleTestsTrigger", "testIds": ["test-id-update"], "recurrence": + {"frequency": "Weekly", "interval": 1, "daysOfWeek": ["Monday"]}, "startDateTime": + "2025-03-19T08:13:05Z", "displayName": "Update Trigger", "description": "Trigger + schedule for update test case", "state": "Active"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '292' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://d9a75b6c-936b-4ed6-8d82-a364caf44a32.eastus.cnt-prod.loadtesting.azure.com/triggers/test-trigger-id-update?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-update"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Weekly","daysOfWeek":["Monday"],"interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-24T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Update + Trigger","triggerId":"test-trigger-id-update","description":"Trigger schedule + for update test case","state":"Active","createdDateTime":"2025-03-19T08:13:50.421Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:52.65Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '551' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:52 GMT + mise-correlation-id: + - 0a7f8345-7402-4d66-9658-ec7d666e5da1 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081352Z-r1bf87c6457mxg5mhC1SG1uyvs00000007xg0000000087xg + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/load/azext_load/tests/latest/recordings/test_update_trigger_schedule_invalid_cases.yaml b/src/load/azext_load/tests/latest/recordings/test_update_trigger_schedule_invalid_cases.yaml new file mode 100644 index 00000000000..27cbb244536 --- /dev/null +++ b/src/load/azext_load/tests/latest/recordings/test_update_trigger_schedule_invalid_cases.yaml @@ -0,0 +1,592 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:13.6743145Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:13.6743145Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:47 GMT + etag: + - '"d900a7d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 70F844E0D86E4408A7320C38FC28E8BB Ref B: MAA201060516017 Ref C: 2025-03-19T08:13:46Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com/triggers/update-invalid-trigger?api-version=2024-12-01-preview + response: + body: + string: '{"error":{"code":"TriggerNotFound","message":"Trigger with Id: update-invalid-trigger + not found.","target":null,"details":null}}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-type: + - application/json + date: + - Wed, 19 Mar 2025 08:13:48 GMT + mise-correlation-id: + - e670f58b-d6ab-4e58-a7cb-33622ab242d9 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-azure-ref: + - 20250319T081347Z-r1bf87c6457wp5w4hC1SG1u5yc0000000dh000000000ega6 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-error-code: + - TriggerNotFound + status: + code: 404 + message: Not Found +- request: + body: '{"kind": "ScheduleTestsTrigger", "testIds": ["test-id-update"], "recurrence": + {"frequency": "Daily", "interval": 1}, "startDateTime": "2025-03-19T08:13:05Z", + "state": "Active", "displayName": "Update Trigger", "description": "Trigger + schedule for update test case"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '265' + Content-Type: + - application/merge-patch+json + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: PATCH + uri: https://b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com/triggers/update-invalid-trigger?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-update"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Update + Trigger","triggerId":"update-invalid-trigger","description":"Trigger schedule + for update test case","state":"Active","createdDateTime":"2025-03-19T08:13:48.302Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:48.302Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '527' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:48 GMT + location: + - https://b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com/triggers/update-invalid-trigger?api-version=2024-12-01-preview + mise-correlation-id: + - 1d8db4d2-5816-4b86-a7c1-ee0cd9540b71 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081348Z-r1bf87c6457wp5w4hC1SG1u5yc0000000dh000000000egcg + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:13.6743145Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:13.6743145Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:49 GMT + etag: + - '"d900a7d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16498' + x-msedge-ref: + - 'Ref A: 3C5803459CC14322AA3407C7C6AD9D2B Ref B: MAA201060513027 Ref C: 2025-03-19T08:13:48Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com/triggers/update-invalid-trigger?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-update"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Update + Trigger","triggerId":"update-invalid-trigger","description":"Trigger schedule + for update test case","state":"Active","createdDateTime":"2025-03-19T08:13:48.302Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:48.302Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '527' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:50 GMT + mise-correlation-id: + - 32b8556c-00b5-44a5-9997-162d98be79e6 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081349Z-18477bc996c8769chC1SG17fqs00000003zg00000000ynhh + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:13.6743145Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:13.6743145Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:51 GMT + etag: + - '"d900a7d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 99D5EAEF9897459FA3B628BF4AE3A28B Ref B: MAA201060513011 Ref C: 2025-03-19T08:13:50Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com/triggers/update-invalid-trigger?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-update"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Update + Trigger","triggerId":"update-invalid-trigger","description":"Trigger schedule + for update test case","state":"Active","createdDateTime":"2025-03-19T08:13:48.302Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:48.302Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '527' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:52 GMT + mise-correlation-id: + - 14a82046-f296-48e5-bd46-28ec5febf355 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081351Z-18477bc996cqfz4fhC1SG1ugpc000000044g00000000asa5 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:13.6743145Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:13.6743145Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:53 GMT + etag: + - '"d900a7d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 1206D9A4B08140D1825EF7CF714CA0C0 Ref B: MAA201060513025 Ref C: 2025-03-19T08:13:52Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com/triggers/update-invalid-trigger?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-update"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Update + Trigger","triggerId":"update-invalid-trigger","description":"Trigger schedule + for update test case","state":"Active","createdDateTime":"2025-03-19T08:13:48.302Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:48.302Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '527' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:54 GMT + mise-correlation-id: + - 36203f19-bc0a-48f0-b9c2-4c0987bc56b0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081353Z-18477bc996c7789nhC1SG1cyf8000000044g00000000ag5k + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:13.6743145Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:13.6743145Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:54 GMT + etag: + - '"d900a7d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: DD47264939B74C90A582BCD9B2BA2B62 Ref B: MAA201060515019 Ref C: 2025-03-19T08:13:54Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com/triggers/update-invalid-trigger?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-update"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Update + Trigger","triggerId":"update-invalid-trigger","description":"Trigger schedule + for update test case","state":"Active","createdDateTime":"2025-03-19T08:13:48.302Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:48.302Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '527' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:55 GMT + mise-correlation-id: + - e61ada95-cd26-41d9-b976-124d1d43c1be + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081355Z-18477bc996crszl4hC1SG168uc0000000470000000001csk + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-mgmt-loadtesting/1.0.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002?api-version=2022-12-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest-schedule-000001/providers/Microsoft.LoadTestService/loadTests/clitest-schedule-000002","name":"clitest-schedule-000002","type":"microsoft.loadtestservice/loadtests","location":"eastus","systemData":{"createdBy":"hbisht@microsoft.com","createdByType":"User","createdAt":"2025-03-19T08:13:13.6743145Z","lastModifiedBy":"hbisht@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2025-03-19T08:13:13.6743145Z"},"identity":{"type":"None"},"properties":{"dataPlaneURI":"b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '665' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:56 GMT + etag: + - '"d900a7d8-0000-0200-0000-67da7cb10000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-global-reads: + - '16499' + x-msedge-ref: + - 'Ref A: 95CB078BAC7D45159A3DB7E74A9DE3DD Ref B: MAA201060515047 Ref C: 2025-03-19T08:13:55Z' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - AZURECLI/2.70.0 azsdk-python-core/1.31.0 Python/3.12.8 (Linux-6.8.0-1021-azure-x86_64-with-glibc2.36) + method: GET + uri: https://b3df55b7-ab6f-4e6c-9470-9ec8da7c6ff0.eastus.cnt-prod.loadtesting.azure.com/triggers/update-invalid-trigger?api-version=2024-12-01-preview + response: + body: + string: '{"testIds":["test-id-update"],"startDateTime":"2025-03-19T08:13:05Z","recurrence":{"frequency":"Daily","interval":1},"recurrenceStatus":{"nextScheduledDateTimes":["2025-03-20T08:13:05Z"]},"kind":"ScheduleTestsTrigger","displayName":"Update + Trigger","triggerId":"update-invalid-trigger","description":"Trigger schedule + for update test case","state":"Active","createdDateTime":"2025-03-19T08:13:48.302Z","createdBy":"hbisht@microsoft.com","lastModifiedDateTime":"2025-03-19T08:13:48.302Z","lastModifiedBy":"hbisht@microsoft.com"}' + headers: + accept-ranges: + - bytes + api-supported-versions: + - 2024-07-01-preview, 2024-12-01-preview, 2025-03-01-preview + connection: + - keep-alive + content-length: + - '527' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 19 Mar 2025 08:13:57 GMT + mise-correlation-id: + - 96759ba4-20bc-4996-b2fc-c77dfdc39c3f + strict-transport-security: + - max-age=31536000; includeSubDomains + x-azure-ref: + - 20250319T081356Z-18477bc996cplk7jhC1SG12qn8000000041g00000000qra9 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/load/azext_load/tests/latest/test_load_trigger_schedule.py b/src/load/azext_load/tests/latest/test_load_trigger_schedule.py new file mode 100644 index 00000000000..5d3cbe12a61 --- /dev/null +++ b/src/load/azext_load/tests/latest/test_load_trigger_schedule.py @@ -0,0 +1,605 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azext_load.tests.latest.constants import LoadTestTriggerConstants +from azext_load.tests.latest.preparers import LoadTestResourcePreparer +from azure.cli.testsdk import ( + JMESPathCheck, + ResourceGroupPreparer, + ScenarioTest, +) +from knack.log import get_logger +from azure.cli.core.azclierror import InvalidArgumentValueError + +logger = get_logger(__name__) + +rg_params = { + "name_prefix": "clitest-schedule-", + "location": "eastus", + "key": "resource_group", + "parameter_name": "rg", + "random_name_length": 30, +} +load_params = { + "name_prefix": "clitest-schedule-", + "location": "eastus", + "key": "load_test_resource", + "parameter_name": "load", + "resource_group_key": "resource_group", + "random_name_length": 30, +} + +class LoadTestScenarioTriggerSchedule(ScenarioTest): + def __init__(self, *args, **kwargs): + super(LoadTestScenarioTriggerSchedule, self).__init__(*args, **kwargs) + self.kwargs.update({"subscription_id": self.get_subscription_id()}) + + def create_trigger_schedule(self, trigger_id, description, display_name, start_date_time, test_ids, recurrence_type=None, recurrence_interval=None, recurrence_week_days=None, recurrence_dates_in_month=None, recurrence_index=None, recurrence_cron_expression=None): + cmd = [ + 'az load trigger schedule create', + '--name {load_test_resource}', + '--resource-group {resource_group}', + f'--trigger-id {trigger_id}', + f'--description "{description}"', + f'--display-name "{display_name}"', + f'--start-date-time {start_date_time}', + f'--test-ids {test_ids}' + ] + if recurrence_type: + cmd.append(f'--recurrence-type {recurrence_type}') + if recurrence_interval: + cmd.append(f'--recurrence-interval {recurrence_interval}') + if recurrence_week_days: + cmd.append(f'--recurrence-week-days {recurrence_week_days}') + if recurrence_dates_in_month: + cmd.append(f'--recurrence-dates {recurrence_dates_in_month}') + if recurrence_index: + cmd.append(f'--recurrence-index {recurrence_index}') + if recurrence_cron_expression: + cmd.append(f'--recurrence-cron-exp "{recurrence_cron_expression}"') + + self.cmd(' '.join(cmd)) + + def verify_trigger_schedule(self, trigger_id, description, display_name, test_ids, start_date_time=None, recurrence_type=None, recurrence_interval=None, recurrence_week_days=None, recurrence_dates_in_month=None, recurrence_index=None, recurrence_cron_expression=None): + checks = [ + JMESPathCheck("description", description), + JMESPathCheck("displayName", display_name), + JMESPathCheck("testIds[0]", test_ids), + ] + if recurrence_type: + checks.append(JMESPathCheck("recurrence.frequency", recurrence_type)) + if recurrence_interval: + checks.append(JMESPathCheck("recurrence.interval", recurrence_interval)) + if start_date_time: + checks.append(JMESPathCheck("startDateTime", start_date_time)) + if recurrence_week_days: + week_days = recurrence_week_days.split() + if recurrence_type == "Weekly": + for i, day in enumerate(week_days): + checks.append(JMESPathCheck(f"recurrence.daysOfWeek[{i}]", day)) + else: + for i, day in enumerate(week_days): + checks.append(JMESPathCheck(f"recurrence.weekDaysInMonth[{i}]", day)) + if recurrence_dates_in_month: + dates_in_month = recurrence_dates_in_month.split() + for i, date in enumerate(dates_in_month): + checks.append(JMESPathCheck(f"recurrence.datesInMonth[{i}]", int(date))) + if recurrence_index: + checks.append(JMESPathCheck("recurrence.index", recurrence_index)) + if recurrence_cron_expression: + checks.append(JMESPathCheck("recurrence.cronExpression", recurrence_cron_expression)) + + self.cmd( + 'az load trigger schedule show ' + '--name {load_test_resource} ' + '--resource-group {resource_group} ' + f'--trigger-id {trigger_id}', + checks=checks + ) + + @ResourceGroupPreparer(**rg_params) + @LoadTestResourcePreparer(**load_params) + def test_create_and_verify_trigger_schedules(self, rg, load): + # Test Daily Recurrence + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.DAILY_TRIGGER_ID, + description=LoadTestTriggerConstants.DAILY_DESCRIPTION, + display_name=LoadTestTriggerConstants.DAILY_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.DAILY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.DAILY_RECURRENCE_INTERVAL, + test_ids=LoadTestTriggerConstants.DAILY_TEST_IDS + ) + self.verify_trigger_schedule( + trigger_id=LoadTestTriggerConstants.DAILY_TRIGGER_ID, + description=LoadTestTriggerConstants.DAILY_DESCRIPTION, + display_name=LoadTestTriggerConstants.DAILY_DISPLAY_NAME, + recurrence_type=LoadTestTriggerConstants.DAILY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.DAILY_RECURRENCE_INTERVAL, + test_ids=LoadTestTriggerConstants.DAILY_TEST_IDS + ) + + # Test Weekly Recurrence + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.WEEKLY_TRIGGER_ID, + description=LoadTestTriggerConstants.WEEKLY_DESCRIPTION, + display_name=LoadTestTriggerConstants.WEEKLY_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.WEEKLY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.WEEKLY_RECURRENCE_INTERVAL, + recurrence_week_days=LoadTestTriggerConstants.WEEKLY_RECURRENCE_DAYS, + test_ids=LoadTestTriggerConstants.WEEKLY_TEST_IDS + ) + self.verify_trigger_schedule( + trigger_id=LoadTestTriggerConstants.WEEKLY_TRIGGER_ID, + description=LoadTestTriggerConstants.WEEKLY_DESCRIPTION, + display_name=LoadTestTriggerConstants.WEEKLY_DISPLAY_NAME, + recurrence_type=LoadTestTriggerConstants.WEEKLY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.WEEKLY_RECURRENCE_INTERVAL, + recurrence_week_days=LoadTestTriggerConstants.WEEKLY_RECURRENCE_DAYS, + test_ids=LoadTestTriggerConstants.WEEKLY_TEST_IDS + ) + + # Test Monthly By Dates Recurrence + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.MONTHLY_DATES_TRIGGER_ID, + description=LoadTestTriggerConstants.MONTHLY_DATES_DESCRIPTION, + display_name=LoadTestTriggerConstants.MONTHLY_DATES_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_INTERVAL, + recurrence_dates_in_month=LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_DATES_IN_MONTH, + test_ids=LoadTestTriggerConstants.MONTHLY_DATES_TEST_IDS + ) + self.verify_trigger_schedule( + trigger_id=LoadTestTriggerConstants.MONTHLY_DATES_TRIGGER_ID, + description=LoadTestTriggerConstants.MONTHLY_DATES_DESCRIPTION, + display_name=LoadTestTriggerConstants.MONTHLY_DATES_DISPLAY_NAME, + recurrence_type=LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_INTERVAL, + recurrence_dates_in_month=LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_DATES_IN_MONTH, + test_ids=LoadTestTriggerConstants.MONTHLY_DATES_TEST_IDS + ) + + # Test Monthly By Days Recurrence + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.MONTHLY_DAYS_TRIGGER_ID, + description=LoadTestTriggerConstants.MONTHLY_DAYS_DESCRIPTION, + display_name=LoadTestTriggerConstants.MONTHLY_DAYS_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_INTERVAL, + recurrence_week_days=LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_WEEK_DAYS, + recurrence_index=LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_INDEX, + test_ids=LoadTestTriggerConstants.MONTHLY_DAYS_TEST_IDS + ) + self.verify_trigger_schedule( + trigger_id=LoadTestTriggerConstants.MONTHLY_DAYS_TRIGGER_ID, + description=LoadTestTriggerConstants.MONTHLY_DAYS_DESCRIPTION, + display_name=LoadTestTriggerConstants.MONTHLY_DAYS_DISPLAY_NAME, + recurrence_type=LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_INTERVAL, + recurrence_week_days=LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_WEEK_DAYS, + recurrence_index=LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_INDEX, + test_ids=LoadTestTriggerConstants.MONTHLY_DAYS_TEST_IDS + ) + + # Test Cron Recurrence + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.CRON_TRIGGER_ID, + description=LoadTestTriggerConstants.CRON_DESCRIPTION, + display_name=LoadTestTriggerConstants.CRON_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.CRON_RECURRENCE_TYPE, + recurrence_cron_expression=LoadTestTriggerConstants.CRON_RECURRENCE_CRON_EXPRESSION, + test_ids=LoadTestTriggerConstants.CRON_TEST_IDS + ) + self.verify_trigger_schedule( + trigger_id=LoadTestTriggerConstants.CRON_TRIGGER_ID, + description=LoadTestTriggerConstants.CRON_DESCRIPTION, + display_name=LoadTestTriggerConstants.CRON_DISPLAY_NAME, + recurrence_type=LoadTestTriggerConstants.CRON_RECURRENCE_TYPE, + recurrence_cron_expression=LoadTestTriggerConstants.CRON_RECURRENCE_CRON_EXPRESSION, + test_ids=LoadTestTriggerConstants.CRON_TEST_IDS + ) + + @ResourceGroupPreparer(**rg_params) + @LoadTestResourcePreparer(**load_params) + def test_update_trigger_schedule(self, rg, load): + # Create the trigger schedule with Daily recurrence + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.UPDATE_TRIGGER_ID, + description=LoadTestTriggerConstants.UPDATE_DESCRIPTION, + display_name=LoadTestTriggerConstants.UPDATE_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.DAILY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.RECURRENCE_INTERVAL_ONE, + test_ids=LoadTestTriggerConstants.UPDATE_TEST_IDS + ) + + self.kwargs.update({ + "trigger_id": LoadTestTriggerConstants.UPDATE_TRIGGER_ID, + "description": LoadTestTriggerConstants.UPDATE_DESCRIPTION, + "display_name": LoadTestTriggerConstants.UPDATE_DISPLAY_NAME, + "start_date_time": LoadTestTriggerConstants.CURRENT_DATE_TIME, + "recurrence_type": LoadTestTriggerConstants.WEEKLY_RECURRENCE_TYPE, + "recurrence_interval": LoadTestTriggerConstants.WEEKLY_RECURRENCE_INTERVAL, + "recurrence_week_days": LoadTestTriggerConstants.WEEKLY_RECURRENCE_DAYS, + "test_ids": LoadTestTriggerConstants.UPDATE_TEST_IDS + }) + + checks = [ + JMESPathCheck("description", self.kwargs["description"]), + JMESPathCheck("displayName", self.kwargs["display_name"]), + JMESPathCheck("recurrence.frequency", self.kwargs["recurrence_type"]), + JMESPathCheck("recurrence.interval", self.kwargs["recurrence_interval"]), + JMESPathCheck("recurrence.daysOfWeek[0]", self.kwargs["recurrence_week_days"]), + JMESPathCheck("testIds[0]", self.kwargs["test_ids"]), + ] + + # Update the trigger schedule to weekly recurrence + self.cmd( + 'az load trigger schedule update ' + '--name {load_test_resource} ' + '--resource-group {resource_group} ' + '--trigger-id {trigger_id} ' + '--description "{description}" ' + '--display-name "{display_name}" ' + '--start-date-time {start_date_time} ' + '--recurrence-type {recurrence_type} ' + '--recurrence-interval {recurrence_interval} ' + '--recurrence-week-days {recurrence_week_days} ' + '--test-ids {test_ids}', + checks=checks, + ) + + + @ResourceGroupPreparer(**rg_params) + @LoadTestResourcePreparer(**load_params) + def test_list_trigger_schedules(self, rg, load): + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.LIST_TRIGGER_ID, + description=LoadTestTriggerConstants.LIST_DESCRIPTION, + display_name=LoadTestTriggerConstants.LIST_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.DAILY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.RECURRENCE_INTERVAL_ONE, + test_ids=LoadTestTriggerConstants.LIST_TEST_IDS + ) + + self.kwargs.update({ + "description": LoadTestTriggerConstants.LIST_DESCRIPTION, + "display_name": LoadTestTriggerConstants.LIST_DISPLAY_NAME, + "recurrence_type": LoadTestTriggerConstants.DAILY_RECURRENCE_TYPE, + "recurrence_interval": LoadTestTriggerConstants.RECURRENCE_INTERVAL_ONE, + "test_ids": LoadTestTriggerConstants.LIST_TEST_IDS + }) + + checks = [ + JMESPathCheck("length(@)", 1), + JMESPathCheck("[0].description", self.kwargs["description"]), + JMESPathCheck("[0].displayName", self.kwargs["display_name"]), + JMESPathCheck("[0].recurrence.frequency", self.kwargs["recurrence_type"]), + JMESPathCheck("[0].recurrence.interval", self.kwargs["recurrence_interval"]), + JMESPathCheck("[0].testIds[0]", self.kwargs["test_ids"]), + ] + + self.cmd( + 'az load trigger schedule list ' + '--name {load_test_resource} ' + '--resource-group {resource_group}', + checks=checks, + ) + + @ResourceGroupPreparer(**rg_params) + @LoadTestResourcePreparer(**load_params) + def test_delete_trigger_schedule(self, rg, load): + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.DELETE_TRIGGER_ID, + description=LoadTestTriggerConstants.DELETE_DESCRIPTION, + display_name=LoadTestTriggerConstants.DELETE_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.DAILY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.RECURRENCE_INTERVAL_ONE, + test_ids=LoadTestTriggerConstants.DELETE_TEST_IDS + ) + + self.kwargs.update({ + "trigger_id": LoadTestTriggerConstants.DELETE_TRIGGER_ID + }) + + # Delete the trigger schedule + self.cmd( + 'az load trigger schedule delete ' + '--name {load_test_resource} ' + '--resource-group {resource_group} ' + '--trigger-id {trigger_id} ' + '--yes' + ) + + checks = [ + JMESPathCheck("length(@)", 0) + ] + + self.cmd( + 'az load trigger schedule list ' + '--name {load_test_resource} ' + '--resource-group {resource_group}', + checks=checks, + ) + + @ResourceGroupPreparer(**rg_params) + @LoadTestResourcePreparer(**load_params) + def test_pause_trigger_schedule(self, rg, load): + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.PAUSE_TRIGGER_ID, + description=LoadTestTriggerConstants.PAUSE_DESCRIPTION, + display_name=LoadTestTriggerConstants.PAUSE_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.DAILY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.RECURRENCE_INTERVAL_ONE, + test_ids=LoadTestTriggerConstants.PAUSE_TEST_IDS + ) + + self.kwargs.update({ + "trigger_id": LoadTestTriggerConstants.PAUSE_TRIGGER_ID + }) + + # Pause the trigger schedule + self.cmd( + 'az load trigger schedule pause ' + '--name {load_test_resource} ' + '--resource-group {resource_group} ' + '--trigger-id {trigger_id}' + ) + + checks = [ + JMESPathCheck("state", "Paused") + ] + + self.cmd( + 'az load trigger schedule show ' + '--name {load_test_resource} ' + '--resource-group {resource_group} ' + '--trigger-id {trigger_id}', + checks=checks, + ) + + @ResourceGroupPreparer(**rg_params) + @LoadTestResourcePreparer(**load_params) + def test_enable_trigger_schedule(self, rg, load): + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.ENABLE_TRIGGER_ID, + description=LoadTestTriggerConstants.ENABLE_DESCRIPTION, + display_name=LoadTestTriggerConstants.ENABLE_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.DAILY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.RECURRENCE_INTERVAL_ONE, + test_ids=LoadTestTriggerConstants.ENABLE_TEST_IDS + ) + + self.kwargs.update({ + "trigger_id": LoadTestTriggerConstants.ENABLE_TRIGGER_ID + }) + + # Pause the trigger schedule + self.cmd( + 'az load trigger schedule pause ' + '--name {load_test_resource} ' + '--resource-group {resource_group} ' + '--trigger-id {trigger_id}' + ) + + # Enable the trigger schedule + self.cmd( + 'az load trigger schedule enable ' + '--name {load_test_resource} ' + '--resource-group {resource_group} ' + '--trigger-id {trigger_id}' + ) + + checks = [ + JMESPathCheck("state", "Active") + ] + + self.cmd( + 'az load trigger schedule show ' + '--name {load_test_resource} ' + '--resource-group {resource_group} ' + '--trigger-id {trigger_id}', + checks=checks, + ) + + + @ResourceGroupPreparer(**rg_params) + @LoadTestResourcePreparer(**load_params) + def test_create_trigger_schedule_invalid_cases(self, rg, load): + # Test invalid daily recurrence with extra parameters + with self.assertRaises(InvalidArgumentValueError): + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.INVALID_DAILY_TRIGGER_ID, + description=LoadTestTriggerConstants.DAILY_DESCRIPTION, + display_name=LoadTestTriggerConstants.DAILY_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.DAILY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.RECURRENCE_INTERVAL_ONE, + recurrence_week_days=LoadTestTriggerConstants.WEEKLY_RECURRENCE_DAYS, # Invalid parameter for daily recurrence + test_ids=LoadTestTriggerConstants.DAILY_TEST_IDS + ) + + # Test invalid weekly recurrence without required parameters + with self.assertRaises(InvalidArgumentValueError): + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.INVALID_WEEKLY_TRIGGER_ID, + description=LoadTestTriggerConstants.WEEKLY_DESCRIPTION, + display_name=LoadTestTriggerConstants.WEEKLY_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.WEEKLY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.WEEKLY_RECURRENCE_INTERVAL, + test_ids=LoadTestTriggerConstants.WEEKLY_TEST_IDS + ) + + # Test invalid monthly by dates recurrence with extra parameters + with self.assertRaises(InvalidArgumentValueError): + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.INVALID_MONTHLY_DATES_TRIGGER_ID, + description=LoadTestTriggerConstants.MONTHLY_DATES_DESCRIPTION, + display_name=LoadTestTriggerConstants.MONTHLY_DATES_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_INTERVAL, + recurrence_dates_in_month=LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_DATES_IN_MONTH, + recurrence_week_days=LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_WEEK_DAYS, # Invalid parameter for monthly by dates recurrence + test_ids=LoadTestTriggerConstants.MONTHLY_DATES_TEST_IDS + ) + + # Test invalid monthly by days recurrence without required parameters + with self.assertRaises(InvalidArgumentValueError): + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.INVALID_MONTHLY_DAYS_TRIGGER_ID, + description=LoadTestTriggerConstants.MONTHLY_DAYS_DESCRIPTION, + display_name=LoadTestTriggerConstants.MONTHLY_DAYS_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_INTERVAL, + recurrence_week_days=LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_WEEK_DAYS, + test_ids=LoadTestTriggerConstants.MONTHLY_DAYS_TEST_IDS + ) + + # Test invalid cron recurrence with extra parameters + with self.assertRaises(InvalidArgumentValueError): + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.INVALID_CRON_TRIGGER_ID, + description=LoadTestTriggerConstants.CRON_DESCRIPTION, + display_name=LoadTestTriggerConstants.CRON_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.CRON_RECURRENCE_TYPE, + recurrence_cron_expression=LoadTestTriggerConstants.CRON_RECURRENCE_CRON_EXPRESSION, + recurrence_interval=LoadTestTriggerConstants.RECURRENCE_INTERVAL_ONE, # Invalid parameter for cron recurrence + test_ids=LoadTestTriggerConstants.CRON_TEST_IDS + ) + + # Test invalid date-time format + with self.assertRaises(InvalidArgumentValueError): + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.INVALID_DAILY_TRIGGER_ID, + description=LoadTestTriggerConstants.DAILY_DESCRIPTION, + display_name=LoadTestTriggerConstants.DAILY_DISPLAY_NAME, + start_date_time="2025-02-04T14:20:31", # Invalid date-time format, not utc format + recurrence_type=LoadTestTriggerConstants.DAILY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.RECURRENCE_INTERVAL_ONE, + test_ids=LoadTestTriggerConstants.DAILY_TEST_IDS + ) + + # Test invalid recurrence interval + with self.assertRaises(SystemExit): # Use SystemExit to catch argument parser errors + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.INVALID_DAILY_TRIGGER_ID, + description=LoadTestTriggerConstants.DAILY_DESCRIPTION, + display_name=LoadTestTriggerConstants.DAILY_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.DAILY_RECURRENCE_TYPE, + recurrence_interval="invalid-interval", # Invalid recurrence interval + test_ids=LoadTestTriggerConstants.DAILY_TEST_IDS + ) + + # Test invalid recurrence dates in month + with self.assertRaises(SystemExit): # Use SystemExit to catch argument parser errors + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.INVALID_MONTHLY_DATES_TRIGGER_ID, + description=LoadTestTriggerConstants.MONTHLY_DATES_DESCRIPTION, + display_name=LoadTestTriggerConstants.MONTHLY_DATES_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_INTERVAL, + recurrence_dates_in_month="invalid-dates-in-month", # Invalid dates in month + test_ids=LoadTestTriggerConstants.MONTHLY_DATES_TEST_IDS + ) + + # Test invalid recurrence week days + with self.assertRaises(SystemExit): + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.INVALID_WEEKLY_TRIGGER_ID, + description=LoadTestTriggerConstants.WEEKLY_DESCRIPTION, + display_name=LoadTestTriggerConstants.WEEKLY_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.WEEKLY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.WEEKLY_RECURRENCE_INTERVAL, + recurrence_week_days="invalid-week-days", # Invalid week days + test_ids=LoadTestTriggerConstants.WEEKLY_TEST_IDS + ) + + @ResourceGroupPreparer(**rg_params) + @LoadTestResourcePreparer(**load_params) + def test_update_trigger_schedule_invalid_cases(self, rg, load): + self.create_trigger_schedule( + trigger_id=LoadTestTriggerConstants.INVALID_UPDATE_TRIGGER_ID, + description=LoadTestTriggerConstants.UPDATE_DESCRIPTION, + display_name=LoadTestTriggerConstants.UPDATE_DISPLAY_NAME, + start_date_time=LoadTestTriggerConstants.CURRENT_DATE_TIME, + recurrence_type=LoadTestTriggerConstants.DAILY_RECURRENCE_TYPE, + recurrence_interval=LoadTestTriggerConstants.RECURRENCE_INTERVAL_ONE, + test_ids=LoadTestTriggerConstants.UPDATE_TEST_IDS + ) + + # Test invalid update to daily recurrence with extra parameters + with self.assertRaises(InvalidArgumentValueError): + self.cmd( + 'az load trigger schedule update ' + '--name {load_test_resource} ' + '--resource-group {resource_group} ' + f'--trigger-id {LoadTestTriggerConstants.INVALID_UPDATE_TRIGGER_ID} ' + f'--recurrence-type {LoadTestTriggerConstants.DAILY_RECURRENCE_TYPE} ' + f'--recurrence-interval {LoadTestTriggerConstants.DAILY_RECURRENCE_INTERVAL} ' + f'--recurrence-week-days {LoadTestTriggerConstants.WEEKLY_RECURRENCE_DAYS} ' # Invalid parameter for daily recurrence + ) + + # Test invalid update to weekly recurrence without required parameter (recurrence-interval) + with self.assertRaises(InvalidArgumentValueError): + self.cmd( + 'az load trigger schedule update ' + '--name {load_test_resource} ' + '--resource-group {resource_group} ' + f'--trigger-id {LoadTestTriggerConstants.INVALID_UPDATE_TRIGGER_ID} ' + f'--recurrence-type {LoadTestTriggerConstants.WEEKLY_RECURRENCE_TYPE} ' + f'--recurrence-week-days {LoadTestTriggerConstants.WEEKLY_RECURRENCE_DAYS} ' + ) + + # Test invalid update to monthly by dates recurrence with extra parameters + with self.assertRaises(InvalidArgumentValueError): + self.cmd( + 'az load trigger schedule update ' + '--name {load_test_resource} ' + '--resource-group {resource_group} ' + f'--trigger-id {LoadTestTriggerConstants.INVALID_UPDATE_TRIGGER_ID} ' + f'--recurrence-type {LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_TYPE} ' + f'--recurrence-interval {LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_INTERVAL} ' + f'--recurrence-week-days {LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_WEEK_DAYS} ' # Invalid parameter for monthly by dates recurrence + f'--recurrence-dates {LoadTestTriggerConstants.MONTHLY_DATES_RECURRENCE_DATES_IN_MONTH} ' + ) + + # Test invalid update to monthly by days recurrence without required parameters + with self.assertRaises(InvalidArgumentValueError): + self.cmd( + 'az load trigger schedule update ' + '--name {load_test_resource} ' + '--resource-group {resource_group} ' + f'--trigger-id {LoadTestTriggerConstants.INVALID_UPDATE_TRIGGER_ID} ' + f'--recurrence-type {LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_TYPE} ' + f'--recurrence-interval {LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_INTERVAL} ' + f'--recurrence-week-days {LoadTestTriggerConstants.MONTHLY_DAYS_RECURRENCE_WEEK_DAYS} ' + ) + + # Test invalid update to cron recurrence with extra parameters + with self.assertRaises(InvalidArgumentValueError): + self.cmd( + 'az load trigger schedule update ' + '--name {load_test_resource} ' + '--resource-group {resource_group} ' + f'--trigger-id {LoadTestTriggerConstants.INVALID_UPDATE_TRIGGER_ID} ' + f'--recurrence-cron-exp "{LoadTestTriggerConstants.CRON_RECURRENCE_CRON_EXPRESSION}" ' + f'--recurrence-interval {LoadTestTriggerConstants.RECURRENCE_INTERVAL_ONE} ' # Invalid parameter for cron recurrence + f'--recurrence-type {LoadTestTriggerConstants.CRON_RECURRENCE_TYPE} ' + ) \ No newline at end of file diff --git a/src/load/setup.py b/src/load/setup.py index 6990380ce27..df605e9343e 100644 --- a/src/load/setup.py +++ b/src/load/setup.py @@ -10,7 +10,7 @@ # HISTORY.rst entry. -VERSION = '1.7.0' +VERSION = '1.8.0' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers