Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/support/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Release History
===============

1.0.1
-----
* Remove resource id existence check in liue of backend based check

1.0.0
-----

* GA release of "support" extension for Azure CLI.
* Command `update` under command group `tickets` supports new parameter `status`.
* `Severity` parameter used by command `update` and `create` under command group `tickets` supports an additional value `highestcriticalimpact`.

0.1.1
-----

Expand All @@ -11,11 +22,3 @@ Release History

* Initial release of "support" extension for Azure CLI.
* Adding two major command groups, `az support services` and `az support tickets` to manage support ticket and related resources.

1.0.0
-----

* GA release of "support" extension for Azure CLI.
* Command `update` under command group `tickets` supports new parameter `status`.
* `Severity` parameter used by command `update` and `create` under command group `tickets` supports an additional value `highestcriticalimpact`.

6 changes: 0 additions & 6 deletions src/support/azext_support/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,3 @@ def cf_support_tickets(cli_ctx, *_):

def cf_communications(cli_ctx, *_):
return cf_support(cli_ctx).communications


def cf_resource(cli_ctx, **_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.cli.core.profiles import ResourceType
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES)
17 changes: 2 additions & 15 deletions src/support/azext_support/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

import traceback
import uuid
from datetime import datetime

from azext_support._client_factory import cf_resource, cf_support_tickets, cf_communications
from azext_support._client_factory import cf_support_tickets, cf_communications
from azext_support._utils import is_technical_ticket, parse_support_area_path
from azure.cli.core.commands.client_factory import get_subscription_id
from knack.log import get_logger
from knack.util import CLIError
from msrestazure.azure_exceptions import CloudError
from msrestazure.tools import is_valid_resource_id, parse_resource_id

logger = get_logger(__name__)
Expand Down Expand Up @@ -68,7 +66,7 @@ def _validate_problem_classification_name(problem_classification_id):
def _validate_resource_name(cmd, resource_id):
if resource_id is None:
return
client = cf_resource(cmd.cli_ctx)

base_error_msg = "Technical resource argument {0} is invalid.".format(resource_id)
if not is_valid_resource_id(resource_id):
raise CLIError(base_error_msg)
Expand All @@ -82,17 +80,6 @@ def _validate_resource_name(cmd, resource_id):
if subid != session_subid:
raise CLIError("{0} {1} does not match with {2}".format(base_error_msg, subid, session_subid))

try:
client.resources.get(resource_group_name=parsed_resource['resource_group'],
resource_provider_namespace=parsed_resource["namespace"],
parent_resource_path=parsed_resource["resource_parent"],
resource_type=parsed_resource["type"],
resource_name=parsed_resource["name"],
api_version="2019-08-01")
except CloudError as e:
logger.debug(traceback.format_exc())
raise CLIError("{0} {1}".format(base_error_msg, e.error.message))


def _is_guid(guid):
try:
Expand Down
2 changes: 1 addition & 1 deletion src/support/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
logger.warn("Wheel is not available, disabling bdist_wheel hook")

# HISTORY.md entry.
VERSION = '1.0.0'
VERSION = '1.0.1'

# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down