Skip to content

Commit

Permalink
Upgrade vmware extension to 2023-09-01 API version (#7757)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanhe-msft authored Jul 10, 2024
1 parent 5b374d7 commit 8977f76
Show file tree
Hide file tree
Showing 142 changed files with 7,406 additions and 1,508 deletions.
14 changes: 14 additions & 0 deletions src/vmware/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Release History

## 7.0.0 (2024-06)

- Update to AVS 2023-09-01 API
- Add `az vmware datastore elastic-san-volume` command group
- Add `az vmware iscsi-path` command group
- Add `az vmware cloud-link wait` command
- Add `--vsan-datastore-name` argument to `az vmware cluster create`
- Add `--vsan-datastore-name` argument to `az vmware cluster update`
- Add `--virtual-network-id` argument to `az vmware private-cloud create`
- Add `--hosts`, `vsan-datastore-name`, `dns-zone-type` arguments to `az vmware private-cloud update`
- Add `az vmware private-cloud rotate-nsxt-password`
- [BREAKING CHANGE] Remove `--sku` argument from `az vmware cluster update` as sku cannot be modified after cluster creation
- [BREAKING CHANGE] Add confirmation prompt to `az vmware script-execution create` if `--script-cmdlet-id` contains `scriptPackages/Microsoft.AVS.VMFS`, `scriptPackages/Microsoft.AVS.NFS`, or `scriptPackages/Microsoft.AVS.VVOLS`

## 6.0.1 (2023-12)

- Fix `az vmware private-cloud list-admin-credentials` not returning `nsxtPassword` and `vcenterPassword`
Expand Down
19 changes: 16 additions & 3 deletions src/vmware/azext_vmware/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
short-summary: Rotate the NSX-T Manager password.
examples:
- name: Rotate the NSX-T Manager password.
text: az vmware private-cloud rotate-nsxt-password
text: az vmware private-cloud rotate-nsxt-password --resource-group MyResourceGroup --private-cloud MyPrivateCloud
"""

helps['vmware authorization create'] = """
Expand Down Expand Up @@ -274,7 +274,7 @@

helps['vmware datastore netapp-volume'] = """
type: group
short-summary: Create a new Microsoft.NetApp provided NetApp volume in a private cloud cluster.
short-summary: Manage NetApp volume resource.
"""

helps['vmware datastore netapp-volume create'] = """
Expand All @@ -287,7 +287,7 @@

helps['vmware datastore disk-pool-volume'] = """
type: group
short-summary: Create a VMFS datastore in a private cloud cluster using Microsoft.StoragePool provided iSCSI target.
short-summary: Manage disk pool volume resource.
"""

helps['vmware datastore disk-pool-volume create'] = """
Expand All @@ -298,6 +298,19 @@
text: az vmware datastore disk-pool-volume create --name iSCSIDatastore1 --resource-group MyResourceGroup --cluster Cluster-1 --private-cloud MyPrivateCloud --target-id /subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.StoragePool/diskPools/mpio-diskpool/iscsiTargets/mpio-iscsi-target --lun-name lun0
"""

helps['vmware datastore elastic-san-volume'] = """
type: group
short-summary: Manage Elastic SAN volume resource.
"""

helps['vmware datastore elastic-san-volume create'] = """
type: command
short-summary: Create an Elastic SAN volume in a private cloud cluster using Microsoft.ElasticSan provider.
examples:
- name: Create a new Microsoft.ElasticSan provided Elastic SAN volume based datastore.
text: az vmware datastore elastic-san-volume create --name ElasticSANDatastore --resource-group MyResourceGroup --cluster Cluster-1 --private-cloud MyPrivateCloud --elastic-san-volume elasticsan
"""

helps['vmware datastore show'] = """
type: command
short-summary: Show details of a datastore in a private cloud cluster.
Expand Down
1 change: 1 addition & 0 deletions src/vmware/azext_vmware/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ def load_arguments(self, _):
c.argument('out', nargs='*', help='Standard output stream from the powershell execution.')
c.argument('named_outputs', action=ScriptExecutionNamedOutputAction, nargs='*', help='User-defined dictionary.')
c.argument('script_cmdlet_id', help='A reference to the script cmdlet resource if user is running a AVS script.')
c.argument('yes', help='Create without confirmation.')
45 changes: 34 additions & 11 deletions src/vmware/azext_vmware/aaz/latest/vmware/addon/_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@


class Create(AAZCommand):
"""Create a addon in a private cloud
"""Create an addon in a private cloud
"""

_aaz_info = {
"version": "2023-03-01",
"version": "2023-09-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.avs/privateclouds/{}/addons/{}", "2023-03-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.avs/privateclouds/{}/addons/{}", "2023-09-01"],
]
}

Expand Down Expand Up @@ -51,6 +51,9 @@ def _build_arguments_schema(cls, *args, **kwargs):
options=["-c", "--private-cloud"],
help="Name of the private cloud",
required=True,
fmt=AAZStrArgFormat(
pattern="^[-\w\._]+$",
),
)
_args_schema.resource_group = AAZResourceGroupNameArg(
required=True,
Expand All @@ -77,14 +80,13 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema.vr = AAZObjectArg(
options=["--vr"],
arg_group="Properties",
help="a vSphere Replication (VR) addon for a private cloud",
help="a vSphere Replication (VR) addon for a private cloud.",
)

arc = cls._args_schema.arc
arc.vcenter = AAZStrArg(
options=["vcenter"],
help="The VMware vCenter resource ID",
required=True,
)

hcx = cls._args_schema.hcx
Expand All @@ -98,7 +100,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
srm.license_key = AAZStrArg(
options=["license-key"],
help="The Site Recovery Manager (SRM) license",
required=True,
)

vr = cls._args_schema.vr
Expand Down Expand Up @@ -194,7 +195,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-03-01",
"api-version", "2023-09-01",
required=True,
),
}
Expand Down Expand Up @@ -234,15 +235,15 @@ def content(self):

disc_arc = _builder.get(".properties{addonType:Arc}")
if disc_arc is not None:
disc_arc.set_prop("vCenter", AAZStrType, ".arc.vcenter", typ_kwargs={"flags": {"required": True}})
disc_arc.set_prop("vCenter", AAZStrType, ".arc.vcenter")

disc_hcx = _builder.get(".properties{addonType:HCX}")
if disc_hcx is not None:
disc_hcx.set_prop("offer", AAZStrType, ".hcx.offer", typ_kwargs={"flags": {"required": True}})

disc_srm = _builder.get(".properties{addonType:SRM}")
if disc_srm is not None:
disc_srm.set_prop("licenseKey", AAZStrType, ".srm.license_key", typ_kwargs={"flags": {"required": True}})
disc_srm.set_prop("licenseKey", AAZStrType, ".srm.license_key")

disc_vr = _builder.get(".properties{addonType:VR}")
if disc_vr is not None:
Expand Down Expand Up @@ -275,6 +276,10 @@ def _build_schema_on_200_201(cls):
flags={"read_only": True},
)
_schema_on_200_201.properties = AAZObjectType()
_schema_on_200_201.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_schema_on_200_201.type = AAZStrType(
flags={"read_only": True},
)
Expand All @@ -292,7 +297,6 @@ def _build_schema_on_200_201(cls):
disc_arc = cls._schema_on_200_201.properties.discriminate_by("addon_type", "Arc")
disc_arc.v_center = AAZStrType(
serialized_name="vCenter",
flags={"required": True},
)

disc_hcx = cls._schema_on_200_201.properties.discriminate_by("addon_type", "HCX")
Expand All @@ -303,7 +307,6 @@ def _build_schema_on_200_201(cls):
disc_srm = cls._schema_on_200_201.properties.discriminate_by("addon_type", "SRM")
disc_srm.license_key = AAZStrType(
serialized_name="licenseKey",
flags={"required": True},
)

disc_vr = cls._schema_on_200_201.properties.discriminate_by("addon_type", "VR")
Expand All @@ -312,6 +315,26 @@ def _build_schema_on_200_201(cls):
flags={"required": True},
)

system_data = cls._schema_on_200_201.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)

return cls._schema_on_200_201


Expand Down
14 changes: 7 additions & 7 deletions src/vmware/azext_vmware/aaz/latest/vmware/addon/_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@


class Delete(AAZCommand):
"""Delete a addon in a private cloud
"""Delete an addon in a private cloud
"""

_aaz_info = {
"version": "2023-03-01",
"version": "2023-09-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.avs/privateclouds/{}/addons/{}", "2023-03-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.avs/privateclouds/{}/addons/{}", "2023-09-01"],
]
}

Expand Down Expand Up @@ -87,7 +87,7 @@ def __call__(self, *args, **kwargs):
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [200]:
Expand All @@ -96,7 +96,7 @@ def __call__(self, *args, **kwargs):
session,
self.on_200,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)
if session.http_response.status_code in [204]:
Expand All @@ -105,7 +105,7 @@ def __call__(self, *args, **kwargs):
session,
self.on_204,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)

Expand Down Expand Up @@ -152,7 +152,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-03-01",
"api-version", "2023-09-01",
required=True,
),
}
Expand Down
35 changes: 28 additions & 7 deletions src/vmware/azext_vmware/aaz/latest/vmware/addon/_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class List(AAZCommand):
"""

_aaz_info = {
"version": "2023-03-01",
"version": "2023-09-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.avs/privateclouds/{}/addons", "2023-03-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.avs/privateclouds/{}/addons", "2023-09-01"],
]
}

Expand Down Expand Up @@ -121,7 +121,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2023-03-01",
"api-version", "2023-09-01",
required=True,
),
}
Expand Down Expand Up @@ -156,10 +156,9 @@ def _build_schema_on_200(cls):
_schema_on_200 = cls._schema_on_200
_schema_on_200.next_link = AAZStrType(
serialized_name="nextLink",
flags={"read_only": True},
)
_schema_on_200.value = AAZListType(
flags={"read_only": True},
flags={"required": True},
)

value = cls._schema_on_200.value
Expand All @@ -173,6 +172,10 @@ def _build_schema_on_200(cls):
flags={"read_only": True},
)
_element.properties = AAZObjectType()
_element.system_data = AAZObjectType(
serialized_name="systemData",
flags={"read_only": True},
)
_element.type = AAZStrType(
flags={"read_only": True},
)
Expand All @@ -190,7 +193,6 @@ def _build_schema_on_200(cls):
disc_arc = cls._schema_on_200.value.Element.properties.discriminate_by("addon_type", "Arc")
disc_arc.v_center = AAZStrType(
serialized_name="vCenter",
flags={"required": True},
)

disc_hcx = cls._schema_on_200.value.Element.properties.discriminate_by("addon_type", "HCX")
Expand All @@ -201,7 +203,6 @@ def _build_schema_on_200(cls):
disc_srm = cls._schema_on_200.value.Element.properties.discriminate_by("addon_type", "SRM")
disc_srm.license_key = AAZStrType(
serialized_name="licenseKey",
flags={"required": True},
)

disc_vr = cls._schema_on_200.value.Element.properties.discriminate_by("addon_type", "VR")
Expand All @@ -210,6 +211,26 @@ def _build_schema_on_200(cls):
flags={"required": True},
)

system_data = cls._schema_on_200.value.Element.system_data
system_data.created_at = AAZStrType(
serialized_name="createdAt",
)
system_data.created_by = AAZStrType(
serialized_name="createdBy",
)
system_data.created_by_type = AAZStrType(
serialized_name="createdByType",
)
system_data.last_modified_at = AAZStrType(
serialized_name="lastModifiedAt",
)
system_data.last_modified_by = AAZStrType(
serialized_name="lastModifiedBy",
)
system_data.last_modified_by_type = AAZStrType(
serialized_name="lastModifiedByType",
)

return cls._schema_on_200


Expand Down
Loading

0 comments on commit 8977f76

Please sign in to comment.