Skip to content

Commit

Permalink
[connectedmachine] release preview version 2024-05-20 (#7797)
Browse files Browse the repository at this point in the history
* generate code

* update version

* add gateway commands

* remove vmware update

* run tests

* add gateway tests

* add tests

* hide subscription

* add arc module

* add gateway tests

* add NSP get test

* add service name for gateway

* add 200 response in nsp reconcile

* remove NSP PATCH

* fix pylint errors

* update codebase

* Update src/connectedmachine/azext_connectedmachine/aaz/latest/connectedmachine/license/_update.py

Co-authored-by: Yan Zhu <[email protected]>

* fix ci error

* fix ci

* fix ci

* remove arc

* fix comment

* fix comment

* fix comment

---------

Co-authored-by: Yan Zhu <[email protected]>
  • Loading branch information
yaotongms and yanzhudd authored Aug 5, 2024
1 parent 836eec9 commit d9baa11
Show file tree
Hide file tree
Showing 59 changed files with 2,435 additions and 1,509 deletions.
4 changes: 4 additions & 0 deletions src/connectedmachine/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Release History
===============
1.0.0b2
+++++
* Add features. 2024/05/20-preview is used for aaz generation. Migrated to aaz.

1.0.0b1
+++++
* Add ESU license and Network Security Perimeter API's. 2024/03/31-preview is used for aaz generation. Migrated to aaz.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"connectedmachine",
)
class __CMDGroup(AAZCommandGroup):
"""Manage an Azure Arc-Enabled Server.
"""Manage Azure Arc-Enabled Server.
"""
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class AssessPatches(AAZCommand):
"""

_aaz_info = {
"version": "2024-03-31-preview",
"version": "2024-05-20-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/assesspatches", "2024-03-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/assesspatches", "2024-05-20-preview"],
]
}

Expand Down Expand Up @@ -137,7 +137,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-03-31-preview",
"api-version", "2024-05-20-preview",
required=True,
),
}
Expand Down Expand Up @@ -179,6 +179,7 @@ def _build_schema_on_200(cls):
)
_schema_on_200.error_details = AAZObjectType(
serialized_name="errorDetails",
flags={"read_only": True},
)
_AssessPatchesHelper._build_schema_error_detail_read(_schema_on_200.error_details)
_schema_on_200.last_modified_date_time = AAZStrType(
Expand Down Expand Up @@ -259,7 +260,9 @@ def _build_schema_error_detail_read(cls, _schema):
_schema.target = cls._schema_error_detail_read.target
return

cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType()
cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType(
flags={"read_only": True}
)

error_detail_read = _schema_error_detail_read
error_detail_read.additional_info = AAZListType(
Expand All @@ -283,12 +286,17 @@ def _build_schema_error_detail_read(cls, _schema):
additional_info.Element = AAZObjectType()

_element = _schema_error_detail_read.additional_info.Element
_element.info = AAZObjectType(
flags={"read_only": True},
)
_element.type = AAZStrType(
flags={"read_only": True},
)

details = _schema_error_detail_read.details
details.Element = AAZObjectType()
details.Element = AAZObjectType(
flags={"read_only": True},
)
cls._build_schema_error_detail_read(details.Element)

_schema.additional_info = cls._schema_error_detail_read.additional_info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
confirmation="Are you sure you want to perform this operation?",
)
class Delete(AAZCommand):
"""Delete operation to delete an Azure Arc-Enabled Server.
"""Delete an Azure Arc-Enabled Server.
:example: Sample command for delete
az connectedmachine delete --name myMachine --resource-group myResourceGroup
"""

_aaz_info = {
"version": "2024-03-31-preview",
"version": "2024-05-20-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}", "2024-03-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}", "2024-05-20-preview"],
]
}

Expand Down Expand Up @@ -124,7 +124,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-03-31-preview",
"api-version", "2024-05-20-preview",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class InstallPatches(AAZCommand):
"""

_aaz_info = {
"version": "2024-03-31-preview",
"version": "2024-05-20-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/installpatches", "2024-03-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines/{}/installpatches", "2024-05-20-preview"],
]
}

Expand Down Expand Up @@ -222,7 +222,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2024-03-31-preview",
"api-version", "2024-05-20-preview",
required=True,
),
}
Expand Down Expand Up @@ -312,6 +312,7 @@ def _build_schema_on_200(cls):
_schema_on_200 = cls._schema_on_200
_schema_on_200.error_details = AAZObjectType(
serialized_name="errorDetails",
flags={"read_only": True},
)
_InstallPatchesHelper._build_schema_error_detail_read(_schema_on_200.error_details)
_schema_on_200.excluded_patch_count = AAZIntType(
Expand Down Expand Up @@ -388,7 +389,9 @@ def _build_schema_error_detail_read(cls, _schema):
_schema.target = cls._schema_error_detail_read.target
return

cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType()
cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType(
flags={"read_only": True}
)

error_detail_read = _schema_error_detail_read
error_detail_read.additional_info = AAZListType(
Expand All @@ -412,12 +415,17 @@ def _build_schema_error_detail_read(cls, _schema):
additional_info.Element = AAZObjectType()

_element = _schema_error_detail_read.additional_info.Element
_element.info = AAZObjectType(
flags={"read_only": True},
)
_element.type = AAZStrType(
flags={"read_only": True},
)

details = _schema_error_detail_read.details
details.Element = AAZObjectType()
details.Element = AAZObjectType(
flags={"read_only": True},
)
cls._build_schema_error_detail_read(details.Element)

_schema.additional_info = cls._schema_error_detail_read.additional_info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
"connectedmachine list",
)
class List(AAZCommand):
"""List all the Azure Arc-Enabled Servers in the specified resource group.
"""List all Azure Arc-Enabled Servers in the specified resource group.
:example: Sample command for list
az connectedmachine list --resource-group myResourceGroup
az connectedmachine list
"""

_aaz_info = {
"version": "2024-03-31-preview",
"version": "2024-05-20-preview",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines", "2024-03-31-preview"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.hybridcompute/machines", "2024-05-20-preview"],
]
}

Expand Down Expand Up @@ -120,7 +120,7 @@ def query_parameters(self):
"$expand", self.ctx.args.expand,
),
**self.serialize_query_param(
"api-version", "2024-03-31-preview",
"api-version", "2024-05-20-preview",
required=True,
),
}
Expand Down Expand Up @@ -396,7 +396,9 @@ def _build_schema_on_200(cls):
detected_properties.Element = AAZStrType()

error_details = cls._schema_on_200.value.Element.properties.error_details
error_details.Element = AAZObjectType()
error_details.Element = AAZObjectType(
flags={"read_only": True},
)
_ListHelper._build_schema_error_detail_read(error_details.Element)

extensions = cls._schema_on_200.value.Element.properties.extensions
Expand All @@ -417,7 +419,7 @@ def _build_schema_on_200(cls):
)
license_profile.product_profile = AAZObjectType(
serialized_name="productProfile",
flags={"client_flatten": True},
flags={"client_flatten": True, "read_only": True},
)
license_profile.software_assurance = AAZObjectType(
serialized_name="softwareAssurance",
Expand All @@ -434,9 +436,11 @@ def _build_schema_on_200(cls):
)
esu_profile.esu_eligibility = AAZStrType(
serialized_name="esuEligibility",
flags={"read_only": True},
)
esu_profile.esu_key_state = AAZStrType(
serialized_name="esuKeyState",
flags={"read_only": True},
)
esu_profile.esu_keys = AAZListType(
serialized_name="esuKeys",
Expand All @@ -447,6 +451,7 @@ def _build_schema_on_200(cls):
)
esu_profile.server_type = AAZStrType(
serialized_name="serverType",
flags={"read_only": True},
)

assigned_license = cls._schema_on_200.value.Element.properties.license_profile.esu_profile.assigned_license
Expand Down Expand Up @@ -529,6 +534,10 @@ def _build_schema_on_200(cls):
_element.sku = AAZStrType()

product_profile = cls._schema_on_200.value.Element.properties.license_profile.product_profile
product_profile.billing_end_date = AAZStrType(
serialized_name="billingEndDate",
flags={"read_only": True},
)
product_profile.billing_start_date = AAZStrType(
serialized_name="billingStartDate",
flags={"read_only": True},
Expand All @@ -541,6 +550,10 @@ def _build_schema_on_200(cls):
serialized_name="enrollmentDate",
flags={"read_only": True},
)
product_profile.error = AAZObjectType(
flags={"read_only": True},
)
_ListHelper._build_schema_error_detail_read(product_profile.error)
product_profile.product_features = AAZListType(
serialized_name="productFeatures",
)
Expand All @@ -555,6 +568,10 @@ def _build_schema_on_200(cls):
product_features.Element = AAZObjectType()

_element = cls._schema_on_200.value.Element.properties.license_profile.product_profile.product_features.Element
_element.billing_end_date = AAZStrType(
serialized_name="billingEndDate",
flags={"read_only": True},
)
_element.billing_start_date = AAZStrType(
serialized_name="billingStartDate",
flags={"read_only": True},
Expand All @@ -567,6 +584,10 @@ def _build_schema_on_200(cls):
serialized_name="enrollmentDate",
flags={"read_only": True},
)
_element.error = AAZObjectType(
flags={"read_only": True},
)
_ListHelper._build_schema_error_detail_read(_element.error)
_element.name = AAZStrType()
_element.subscription_status = AAZStrType(
serialized_name="subscriptionStatus",
Expand Down Expand Up @@ -755,7 +776,9 @@ def _build_schema_error_detail_read(cls, _schema):
_schema.target = cls._schema_error_detail_read.target
return

cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType()
cls._schema_error_detail_read = _schema_error_detail_read = AAZObjectType(
flags={"read_only": True}
)

error_detail_read = _schema_error_detail_read
error_detail_read.additional_info = AAZListType(
Expand All @@ -779,12 +802,17 @@ def _build_schema_error_detail_read(cls, _schema):
additional_info.Element = AAZObjectType()

_element = _schema_error_detail_read.additional_info.Element
_element.info = AAZObjectType(
flags={"read_only": True},
)
_element.type = AAZStrType(
flags={"read_only": True},
)

details = _schema_error_detail_read.details
details.Element = AAZObjectType()
details.Element = AAZObjectType(
flags={"read_only": True},
)
cls._build_schema_error_detail_read(details.Element)

_schema.additional_info = cls._schema_error_detail_read.additional_info
Expand Down Expand Up @@ -834,7 +862,9 @@ def _build_schema_machine_extension_instance_view_read(cls, _schema):
def _build_schema_patch_settings_read(cls, _schema):
if cls._schema_patch_settings_read is not None:
_schema.assessment_mode = cls._schema_patch_settings_read.assessment_mode
_schema.enable_hotpatching = cls._schema_patch_settings_read.enable_hotpatching
_schema.patch_mode = cls._schema_patch_settings_read.patch_mode
_schema.status = cls._schema_patch_settings_read.status
return

cls._schema_patch_settings_read = _schema_patch_settings_read = AAZObjectType()
Expand All @@ -843,12 +873,29 @@ def _build_schema_patch_settings_read(cls, _schema):
patch_settings_read.assessment_mode = AAZStrType(
serialized_name="assessmentMode",
)
patch_settings_read.enable_hotpatching = AAZBoolType(
serialized_name="enableHotpatching",
)
patch_settings_read.patch_mode = AAZStrType(
serialized_name="patchMode",
)
patch_settings_read.status = AAZObjectType(
flags={"read_only": True},
)

status = _schema_patch_settings_read.status
status.error = AAZObjectType(
flags={"read_only": True},
)
cls._build_schema_error_detail_read(status.error)
status.hotpatch_enablement_status = AAZStrType(
serialized_name="hotpatchEnablementStatus",
)

_schema.assessment_mode = cls._schema_patch_settings_read.assessment_mode
_schema.enable_hotpatching = cls._schema_patch_settings_read.enable_hotpatching
_schema.patch_mode = cls._schema_patch_settings_read.patch_mode
_schema.status = cls._schema_patch_settings_read.status

_schema_service_status_read = None

Expand Down
Loading

0 comments on commit d9baa11

Please sign in to comment.