Skip to content

Commit 3a5b66d

Browse files
vmware update to 2021-12-01 API (#3992)
* added commands for workload-network dhcp * set limit of 3 on server_addresses and updated moved specific arguments in params * removed comments * updated error type for server_messages validation * removed comments and styling * added dns-server commands * added dns-zone commands * allow dhcp server and relay calls with None parameters * added workload_network dns-zone commands * Update src/vmware/CHANGELOG.md * renamed dhcp test files to workload-network * added port-mirroring and renamed dhcp test file to workloadnetwork * updated changelog * updated help and param text based on comments * fixed parameter typo * workload-network segment public-ip and vm-group commands * fixed merge issue * updated merge * added workload-network vm and gateway commands' * updated changelog * styling updates * updated help texts * updated parameter name * removed '-id' from parameters * fixed unit tests * updated sdk to 12-01 api and updated private cloud create and update commands * fixed unit tests that were broken from upgrade to 12-01-21 * uncommented test file * merged with main * added unit tests for placement-policy and vm * added prefixes for flattened properties * changed encryption_status to enc_status to match abbreviation convention * added managed identity parameters, warning prompt for placement policy vm/vm host delete, updated private cloud methods * deprecated listadmincredentials, addidentitysource,deleteidentitysource Co-authored-by: Xing Zhou <[email protected]>
1 parent 6c61783 commit 3a5b66d

File tree

66 files changed

+5478
-10574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+5478
-10574
lines changed

pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ disable=
1616
too-many-arguments,
1717
invalid-name,
1818
duplicate-code,
19-
import-outside-toplevel
19+
import-outside-toplevel,
20+
too-many-lines
2021

2122
[TYPECHECK]
2223
# For Azure CLI extensions, we ignore some import errors as they'll be available in the environment of the CLI

src/vmware/DEVELOPMENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
```powershell
66
rm ..\azure-cli-extensions\src\vmware\azext_vmware\vendored_sdks -Recurse
77
8-
autorest --python --output-folder=..\azure-cli-extensions\src\vmware\azext_vmware\vendored_sdks --use=@autorest/python@5.8.0 --tag=package-2021-06-01 --azure-arm=true --namespace=avs_client --override-client-name=AVSClient specification\vmware\resource-manager\readme.md
8+
autorest --python --output-folder=..\azure-cli-extensions\src\vmware\azext_vmware\vendored_sdks --use=@autorest/python@5.9.3 --tag=package-2021-06-01 --azure-arm=true --namespace=avs_client --override-client-name=AVSClient specification\vmware\resource-manager\readme.md
99
```
1010

11-
It was run from a git clone of [azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs).
11+
It was run from a git clone of [azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs) within the python virtual environment (env\scripts\Activate.ps1). Ensure that no proxy has been set.
1212

1313
## Linter
1414

src/vmware/HISTORY.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Release History
22

3+
## 4.0.0 (2021-11)
4+
5+
- Add `az vmware placement-policy` command group
6+
- Add `az vmware vm` command group
7+
- Updated `az vmware private-cloud create` with new Identity parameter
8+
- Updated `az vmware private-cloud update` with new Identity parameter
9+
- Add `az vmware private-cloud add-availability-zone`
10+
- Add `az vmware private-cloud delete-availability-zone`
11+
- Add `az vmware private-cloud add-cmk-encryption`
12+
- Add `az vmware private-cloud delete-cmk-encryption`
13+
- Add `az vmware private-cloud list-admin-credentials`
14+
- Add `az vmware private-cloud add-identity-source`
15+
- Add `az vmware private-cloud delete-identity-source`
16+
- Deprecate `az vmware private-cloud listadmincredentials`
17+
- Deprecate `az vmware private-cloud addidentitysource`
18+
- Deprecate `az vmware private-cloud deleteidentitysource`
19+
320
## 3.2.0 (2021-10)
421

522
- Add `az vmware workload-network dhcp` command group

src/vmware/azext_vmware/_help.py

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,56 @@
8787
short-summary: Update a cluster in a private cloud.
8888
"""
8989

90+
helps['vmware private-cloud add-identity-source'] = """
91+
type: command
92+
short-summary: Add a vCenter Single Sign On Identity Source to a private cloud.
93+
"""
94+
9095
helps['vmware private-cloud addidentitysource'] = """
9196
type: command
9297
short-summary: Add a vCenter Single Sign On Identity Source to a private cloud.
9398
"""
9499

100+
helps['vmware private-cloud add-availability-zone'] = """
101+
type: command
102+
short-summary: Add an Availability Zone to a private cloud.
103+
"""
104+
105+
helps['vmware private-cloud delete-availability-zone'] = """
106+
type: command
107+
short-summary: Delete an Availability Zone from a private cloud.
108+
"""
109+
110+
helps['vmware private-cloud add-cmk-encryption'] = """
111+
type: command
112+
short-summary: Add a Customer Managed Keys Encryption to a private cloud.
113+
"""
114+
115+
helps['vmware private-cloud delete-cmk-encryption'] = """
116+
type: command
117+
short-summary: Delete a Customer Managed Keys Encryption from a private cloud.
118+
"""
119+
120+
helps['vmware private-cloud identity'] = """
121+
type: group
122+
short-summary: Commands for Managed Identity in a private cloud.
123+
"""
124+
125+
helps['vmware private-cloud identity assign'] = """
126+
type: command
127+
short-summary: Assign a Managed Identity in a private cloud.
128+
"""
129+
130+
helps['vmware private-cloud identity remove'] = """
131+
type: command
132+
short-summary: Remove a Managed Identity in a private cloud.
133+
"""
134+
135+
helps['vmware private-cloud identity show'] = """
136+
type: command
137+
short-summary: Show Managed Identities in a private cloud.
138+
"""
139+
95140
helps['vmware private-cloud create'] = """
96141
type: command
97142
short-summary: Create a private cloud.
@@ -102,6 +147,11 @@
102147
short-summary: Delete a private cloud.
103148
"""
104149

150+
helps['vmware private-cloud delete-identity-source'] = """
151+
type: command
152+
short-summary: Delete a vCenter Single Sign On Identity Source for a private cloud.
153+
"""
154+
105155
helps['vmware private-cloud deleteidentitysource'] = """
106156
type: command
107157
short-summary: Delete a vCenter Single Sign On Identity Source for a private cloud.
@@ -112,6 +162,11 @@
112162
short-summary: List the private clouds.
113163
"""
114164

165+
helps['vmware private-cloud list-admin-credentials'] = """
166+
type: command
167+
short-summary: List the admin credentials for the private cloud.
168+
"""
169+
115170
helps['vmware private-cloud listadmincredentials'] = """
116171
type: command
117172
short-summary: List the admin credentials for the private cloud.
@@ -881,3 +936,111 @@
881936
- name: Get a Gateway by ID in a workload network.
882937
text: az vmware workload-network gateway show --resource-group group1 --private-cloud cloud1 --gateway gateway1
883938
"""
939+
940+
helps['vmware placement-policy'] = """
941+
type: group
942+
short-summary: Commands to manage placement policies.
943+
"""
944+
945+
helps['vmware placement-policy list'] = """
946+
type: command
947+
short-summary: List placement policies in a private cloud cluster.
948+
examples:
949+
- name: List placement policies.
950+
text: az vmware placement-policy list --resource-group group1 --private-cloud cloud1 --cluster-name cluster1
951+
"""
952+
953+
helps['vmware placement-policy show'] = """
954+
type: command
955+
short-summary: Get a placement policy by name in a private cloud cluster.
956+
examples:
957+
- name: Get a placement policy by name.
958+
text: az vmware placement-policy show --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --placement-policy-name policy1
959+
"""
960+
961+
helps['vmware placement-policy vm-host'] = """
962+
type: group
963+
short-summary: Commands to manage VM Host placement policies.
964+
"""
965+
966+
helps['vmware placement-policy vm-host create'] = """
967+
type: command
968+
short-summary: Create a VM Host placement policy in a private cloud cluster.
969+
examples:
970+
- name: Create a VM Host placement policy.
971+
text: az vmware placement-policy vm-host create --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --placement-policy-name policy1 --state Enabled --display-name policy1 --vm-members /subscriptions/subId/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128 /subscriptions/subId/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256 --host-members fakehost22.nyc1.kubernetes.center fakehost23.nyc1.kubernetes.center --affinity-type AntiAffinity
972+
"""
973+
974+
helps['vmware placement-policy vm-host update'] = """
975+
type: command
976+
short-summary: Update a VM Host placement policy in a private cloud cluster.
977+
examples:
978+
- name: Update a VM Host placement policy.
979+
text: az vmware placement-policy vm-host update --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --placement-policy-name policy1 --state Enabled --vm-members /subscriptions/subId/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128 /subscriptions/subId/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256 --host-members fakehost22.nyc1.kubernetes.center fakehost23.nyc1.kubernetes.center
980+
"""
981+
982+
helps['vmware placement-policy vm-host delete'] = """
983+
type: command
984+
short-summary: Delete a VM Host placement policy in a private cloud cluster.
985+
examples:
986+
- name: Delete a VM Host placement policy.
987+
text: az vmware placement-policy vm-host delete --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --placement-policy-name policy1
988+
"""
989+
990+
helps['vmware placement-policy vm'] = """
991+
type: group
992+
short-summary: Commands to manage VM placement policies.
993+
"""
994+
995+
helps['vmware placement-policy vm create'] = """
996+
type: command
997+
short-summary: Create a VM placement policy in a private cloud cluster.
998+
examples:
999+
- name: Create a VM placement policy.
1000+
text: az vmware placement-policy vm create --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --placement-policy-name policy1 --state Enabled --display-name policy1 --vm-members /subscriptions/subId/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128 /subscriptions/subId/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256 --affinity-type AntiAffinity
1001+
"""
1002+
1003+
helps['vmware placement-policy vm update'] = """
1004+
type: command
1005+
short-summary: Update a VM placement policy in a private cloud cluster.
1006+
examples:
1007+
- name: Update a VM placement policy.
1008+
text: az vmware placement-policy vm update --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --placement-policy-name policy1 --state Enabled --vm-members /subscriptions/subId/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128 /subscriptions/subId/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256
1009+
"""
1010+
1011+
helps['vmware placement-policy vm delete'] = """
1012+
type: command
1013+
short-summary: Delete a VM placement policy in a private cloud cluster.
1014+
examples:
1015+
- name: Delete a VM placement policy.
1016+
text: az vmware placement-policy vm delete --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --placement-policy-name policy1
1017+
"""
1018+
1019+
helps['vmware vm'] = """
1020+
type: group
1021+
short-summary: Commands to manage Virtual Machines.
1022+
"""
1023+
1024+
helps['vmware vm show'] = """
1025+
type: command
1026+
short-summary: Get a virtual machine by ID in a private cloud cluster.
1027+
examples:
1028+
- name: Get a virtual machine by ID.
1029+
text: az vmware vm show --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --virtual-machine vm-209
1030+
"""
1031+
1032+
helps['vmware vm list'] = """
1033+
type: command
1034+
short-summary: List of virtual machines in a private cloud cluster.
1035+
examples:
1036+
- name: List of virtual machines.
1037+
text: az vmware vm list --resource-group group1 --private-cloud cloud1 --cluster-name cluster1
1038+
"""
1039+
1040+
helps['vmware vm restrict-movement'] = """
1041+
type: command
1042+
short-summary: Enable or disable DRS-driven VM movement restriction.
1043+
examples:
1044+
- name: Enable or disable DRS-driven VM movement restriction.
1045+
text: az vmware vm restrict-movement --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --virtual-machine vm-209 --restrict-movement Enabled
1046+
"""

src/vmware/azext_vmware/_params.py

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ def load_arguments(self, _):
2121
c.argument('private_cloud', options_list=['--private-cloud', '-c'], help='Name of the private cloud.')
2222

2323
with self.argument_context('vmware private-cloud') as c:
24-
c.argument('circuit_primary_subnet', help='A /30 subnet for the primary circuit in the Express Route to configure routing between your network and Microsoft\'s Enterprise edge (MSEEs) routers.')
25-
c.argument('circuit_secondary_subnet', help='A /30 subnet for the secondary circuit in the Express Route to configure routing between your network and Microsoft\'s Enterprise edge (MSEEs) routers.')
2624
c.argument('cluster_size', help='Number of hosts for the default management cluster. Minimum of 3 and maximum of 16.')
27-
c.argument('network_block', help='A subnet at least of size /22. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22.')
25+
c.argument('internet', help='Connectivity to internet. Specify "Enabled" or "Disabled".')
2826

2927
with self.argument_context('vmware cluster') as c:
3028
c.argument('name', options_list=['--name', '-n'], help='Name of the cluster.')
3129
c.argument('sku', help='The product SKU.')
3230
c.argument('size', help='Number of hosts for the cluster. Minimum of 3 and a maximum of 16.')
31+
c.argument('hosts', nargs='+', help='A cluster\'s hosts in the private cloud.')
3332

3433
with self.argument_context('vmware private-cloud create') as c:
3534
c.argument('name', options_list=['--name', '-n'], help='Name of the private cloud.')
3635
c.argument('sku', help='The product SKU.')
37-
c.argument('internet', help='Connectivity to internet. Specify "Enabled" or "Disabled".')
3836
c.argument('vcenter_password', help='vCenter admin password.')
3937
c.argument('nsxt_password', help='NSX-T Manager password.')
4038
c.argument('accept_eula', help='Accept the end-user license agreement without prompting.')
39+
c.argument('network_block', help='A subnet at least of size /22. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22.')
40+
c.argument('mi_system_assigned', help='Enable a system assigned identity.')
4141

4242
with self.argument_context('vmware private-cloud show') as c:
4343
c.argument('name', options_list=['--name', '-n'], help='Name of the private cloud.')
@@ -52,6 +52,29 @@ def load_arguments(self, _):
5252
with self.argument_context('vmware authorization') as c:
5353
c.argument('name', options_list=['--name', '-n'], help='Name of the authorization.')
5454

55+
with self.argument_context('vmware private-cloud add-availability-zone') as c:
56+
c.argument('strategy', help='The availability strategy for the private cloud. Possible values include: "SingleZone", "DualZone".')
57+
c.argument('zone', help='The primary availability zone for the private cloud')
58+
c.argument('secondary_zone', help='The secondary availability zone for the private cloud.')
59+
60+
with self.argument_context('vmware private-cloud add-cmk-encryption') as c:
61+
c.argument('enc_status', help='Status of customer managed encryption key. Possible values include "Enabled" and "Disabled".')
62+
c.argument('enc_kv_key_name', help='The name of the encryption key vault key.')
63+
c.argument('enc_kv_url', help='The URL of the encryption key vault.')
64+
c.argument('enc_kv_key_version', help='The version of the encryption key vault key.')
65+
66+
with self.argument_context('vmware private-cloud add-identity-source') as c:
67+
c.argument('alias', help='The domain\'s NetBIOS name.')
68+
c.argument('base_group_dn', help='The base distinguished name for groups.')
69+
c.argument('base_user_dn', help='The base distinguished name for users.')
70+
c.argument('domain', help='The domain\'s dns name.')
71+
c.argument('name', options_list=['--name', '-n'], help='The name of the identity source.')
72+
c.argument('password', help='The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups.')
73+
c.argument('primary_server', help='Primary server URL.')
74+
c.argument('secondary_server', help='Secondary server URL.')
75+
c.argument('ssl', help='Protect LDAP communication using SSL certificate (LDAPS). Specify "Enabled" or "Disabled".')
76+
c.argument('username', help='The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group.')
77+
5578
with self.argument_context('vmware private-cloud addidentitysource') as c:
5679
c.argument('alias', help='The domain\'s NetBIOS name.')
5780
c.argument('base_group_dn', help='The base distinguished name for groups.')
@@ -64,14 +87,21 @@ def load_arguments(self, _):
6487
c.argument('ssl', help='Protect LDAP communication using SSL certificate (LDAPS). Specify "Enabled" or "Disabled".')
6588
c.argument('username', help='The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group.')
6689

90+
with self.argument_context('vmware private-cloud delete-identity-source') as c:
91+
c.argument('alias', help='The domain\'s NetBIOS name.')
92+
c.argument('domain', help='The domain\'s dns name.')
93+
c.argument('name', options_list=['--name', '-n'], help='The name of the identity source.')
94+
6795
with self.argument_context('vmware private-cloud deleteidentitysource') as c:
6896
c.argument('alias', help='The domain\'s NetBIOS name.')
6997
c.argument('domain', help='The domain\'s dns name.')
7098
c.argument('name', options_list=['--name', '-n'], help='The name of the identity source.')
7199

100+
with self.argument_context('vmware private-cloud identity') as c:
101+
c.argument('system_assigned', help='Enable a system assigned identity.')
102+
72103
with self.argument_context('vmware private-cloud update') as c:
73104
c.argument('name', options_list=['--name', '-n'], help='Name of the private cloud.')
74-
c.argument('internet', help='Connectivity to internet. Specify "Enabled" or "Disabled".')
75105

76106
with self.argument_context('vmware hcx-enterprise-site') as c:
77107
c.argument('name', options_list=['--name', '-n'], help='The name of the HCX Enterprise Site.')
@@ -112,6 +142,7 @@ def load_arguments(self, _):
112142
with self.argument_context('vmware global-reach-connection create') as c:
113143
c.argument('peer_express_route_circuit', help='Identifier of the ExpressRoute Circuit to peer with.')
114144
c.argument('authorization_key', help='Authorization key from the peer express route.')
145+
c.argument('express_route_id', help="The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection.")
115146

116147
with self.argument_context('vmware cloud-link') as c:
117148
c.argument('name', options_list=['--name', '-n'], help='The name of the cloud link.')
@@ -200,3 +231,18 @@ def load_arguments(self, _):
200231

201232
with self.argument_context('vmware workload-network gateway') as c:
202233
c.argument('gateway', help="NSX Gateway identifier. Generally the same as the Gateway's display name.")
234+
235+
with self.argument_context('vmware placement-policy') as c:
236+
c.argument('cluster_name', help="Name of the cluster in the private cloud.")
237+
c.argument('placement_policy_name', help="Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy.")
238+
c.argument('state', help="Whether the placement policy is enabled or disabled. Possible values include: 'Enabled', 'Disabled'.")
239+
c.argument('display_name', help="Display name of the placement policy.")
240+
c.argument('vm_members', nargs='+', help="Virtual machine members list.")
241+
c.argument('affinity_type', help="Placement policy affinity type. Possible values include: 'Affinity', 'AntiAffinity'.")
242+
c.argument('host_members', nargs='+', help='Host members list.')
243+
c.argument('yes', help='Deletes without confirmation.')
244+
245+
with self.argument_context('vmware vm') as c:
246+
c.argument('cluster_name', help='Name of the cluster in the private cloud.')
247+
c.argument('virtual_machine', help='Virtual Machine identifier.')
248+
c.argument('restrict_movement', help='Whether VM DRS-driven movement is restricted (enabled) or not (disabled).')

0 commit comments

Comments
 (0)