Skip to content

Commit

Permalink
Proposed move of deidservice under healthcareapis (#8224)
Browse files Browse the repository at this point in the history
* Proposed move of deidservice under healthcareapis

* bump version with details

* Fixed history.rst version format

* updated healthcareapis summary

* Bump healthcareapis extension version caused by deidservice move

* Bump/clean minCliCoreVersion to 2.66.0
  • Loading branch information
chrisribe authored Nov 14, 2024
1 parent 0b37a1d commit e508b54
Show file tree
Hide file tree
Showing 32 changed files with 2,058 additions and 333 deletions.
8 changes: 0 additions & 8 deletions src/deidservice/HISTORY.rst

This file was deleted.

13 changes: 0 additions & 13 deletions src/deidservice/README.md

This file was deleted.

42 changes: 0 additions & 42 deletions src/deidservice/azext_deidservice/__init__.py

This file was deleted.

11 changes: 0 additions & 11 deletions src/deidservice/azext_deidservice/_help.py

This file was deleted.

4 changes: 0 additions & 4 deletions src/deidservice/azext_deidservice/azext_metadata.json

This file was deleted.

6 changes: 0 additions & 6 deletions src/deidservice/azext_deidservice/tests/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion src/deidservice/setup.cfg

This file was deleted.

49 changes: 0 additions & 49 deletions src/deidservice/setup.py

This file was deleted.

5 changes: 5 additions & 0 deletions src/healthcareapis/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Release History
===============

1.0.0
++++++
* Moved deidservice under healthcareapis
* Bumped to 1.0.0 following the guidelines: https://github.com/Azure/azure-cli/blob/release/doc/extensions/versioning_guidelines.md

0.4.0
++++++

Expand Down
11 changes: 11 additions & 0 deletions src/healthcareapis/azext_healthcareapis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ def __init__(self, cli_ctx=None):

def load_command_table(self, args):
from azext_healthcareapis.generated.commands import load_command_table
from azure.cli.core.aaz import load_aaz_command_table
try:
from . import aaz
except ImportError:
aaz = None
if aaz:
load_aaz_command_table(
loader=self,
aaz_pkg_name=aaz.__name__,
args=args
)
load_command_table(self, args)
try:
from azext_healthcareapis.manual.commands import load_command_table as load_command_table_manual
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: disable=too-many-lines
# pylint: disable=too-many-statements
# pylint: skip-file
# flake8: noqa

from knack.log import get_logger
from azure.cli.core.aaz import *


logger = get_logger(__name__)
@register_command_group(
"healthcareapis",
)
class __CMDGroup(AAZCommandGroup):
"""Azure Healthcare APIs is a secure cloud platform for managing health data, supporting analytics, machine learning, and scalable solutions.
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from .__cmd_group import *
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@


@register_command_group(
"deidservice",
is_preview=True,
"healthcareapis deidservice",
)
class __CMDGroup(AAZCommandGroup):
"""Health Data service for providing de-identification of health PHI data (Features: Surrogation, multi-modality)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@


@register_command(
"deidservice create",
"healthcareapis deidservice create",
is_preview=True,
)
class Create(AAZCommand):
"""Create a DeidService
:example: DeidServices_Create - generated by [MaximumSet] rule
az hls deid create --resource-group rgopenapi --deid-service-name deidTest --location eastus
az deidservice create --resource-group rgopenapi --deid-service-name deidTest --location eastus
"""

_aaz_info = {
Expand Down Expand Up @@ -91,17 +91,30 @@ def _build_arguments_schema(cls, *args, **kwargs):
)

identity = cls._args_schema.identity
identity.mi_system_assigned = AAZStrArg(
options=["system-assigned", "mi-system-assigned"],
help="Set the system managed identity.",
blank="True",
)
identity.type = AAZStrArg(
options=["type"],
help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).",
required=True,
enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned,UserAssigned": "SystemAssigned,UserAssigned", "UserAssigned": "UserAssigned"},
)
identity.mi_user_assigned = AAZListArg(
options=["user-assigned", "mi-user-assigned"],
help="Set the user managed identities.",
blank=[],
)
identity.user_assigned_identities = AAZDictArg(
options=["user-assigned-identities"],
help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.",
)

mi_user_assigned = cls._args_schema.identity.mi_user_assigned
mi_user_assigned.Element = AAZStrArg()

user_assigned_identities = cls._args_schema.identity.user_assigned_identities
user_assigned_identities.Element = AAZObjectArg(
nullable=True,
Expand Down Expand Up @@ -227,11 +240,17 @@ def content(self):
if identity is not None:
identity.set_prop("type", AAZStrType, ".type", typ_kwargs={"flags": {"required": True}})
identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities")
identity.set_prop("userAssigned", AAZListType, ".mi_user_assigned", typ_kwargs={"flags": {"action": "create"}})
identity.set_prop("systemAssigned", AAZStrType, ".mi_system_assigned", typ_kwargs={"flags": {"action": "create"}})

user_assigned_identities = _builder.get(".identity.userAssignedIdentities")
if user_assigned_identities is not None:
user_assigned_identities.set_elements(AAZObjectType, ".", typ_kwargs={"nullable": True})

user_assigned = _builder.get(".identity.userAssigned")
if user_assigned is not None:
user_assigned.set_elements(AAZStrType, ".")

properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("publicNetworkAccess", AAZStrType, ".public_network_access")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@


@register_command(
"deidservice delete",
"healthcareapis deidservice delete",
is_preview=True,
confirmation="Are you sure you want to perform this operation?",
)
class Delete(AAZCommand):
"""Delete a DeidService by name
:example: DeidServices_Delete - generated by [MaximumSet] rule - generated by [MaximumSet] rule
az hls deid delete --resource-group rgopenapi --deid-service-name deidTest
:example: DeidServices_Delete - generated by [MaximumSet] rule
az deidservice delete --resource-group rgopenapi --deid-service-name deidTest
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@


@register_command(
"deidservice list",
"healthcareapis deidservice list",
is_preview=True,
)
class List(AAZCommand):
"""List DeidService resources by subscription Id
:example: DeidServices_ListBySubscription - generated by [MaximumSet] rule - generated by [MaximumSet] rule
az hls deid list
:example: DeidServices_ListBySubscription - generated by [MaximumSet] rule
az deidservice list
"""

_aaz_info = {
Expand Down Expand Up @@ -52,12 +52,12 @@ def _build_arguments_schema(cls, *args, **kwargs):

def _execute_operations(self):
self.pre_operations()
condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
if condition_0:
self.DeidServicesListByResourceGroup(ctx=self.ctx)()
if condition_1:
self.DeidServicesListBySubscription(ctx=self.ctx)()
if condition_1:
self.DeidServicesListByResourceGroup(ctx=self.ctx)()
self.post_operations()

@register_callback
Expand All @@ -73,7 +73,7 @@ def _output(self, *args, **kwargs):
next_link = self.deserialize_output(self.ctx.vars.instance.next_link)
return result, next_link

class DeidServicesListByResourceGroup(AAZHttpOperation):
class DeidServicesListBySubscription(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
Expand All @@ -87,7 +87,7 @@ def __call__(self, *args, **kwargs):
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices",
"/subscriptions/{subscriptionId}/providers/Microsoft.HealthDataAIServices/deidServices",
**self.url_parameters
)

Expand All @@ -102,10 +102,6 @@ def error_format(self):
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
Expand Down Expand Up @@ -289,7 +285,7 @@ def _build_schema_on_200(cls):

return cls._schema_on_200

class DeidServicesListBySubscription(AAZHttpOperation):
class DeidServicesListByResourceGroup(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
Expand All @@ -303,7 +299,7 @@ def __call__(self, *args, **kwargs):
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Microsoft.HealthDataAIServices/deidServices",
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthDataAIServices/deidServices",
**self.url_parameters
)

Expand All @@ -318,6 +314,10 @@ def error_format(self):
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
Expand Down
Loading

0 comments on commit e508b54

Please sign in to comment.