Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
722f956
added commands for workload-network dhcp
jonathanhe-msft Sep 8, 2021
b37281e
set limit of 3 on server_addresses and updated moved specific argumen…
jonathanhe-msft Sep 8, 2021
b1bbc2e
removed comments
jonathanhe-msft Sep 8, 2021
775dbb0
updated error type for server_messages validation
jonathanhe-msft Sep 9, 2021
38f86c9
removed comments and styling
jonathanhe-msft Sep 9, 2021
957199d
Merge branch 'main' into jonathanhe/workload-network
jonathanhe-msft Sep 10, 2021
31d213c
added dns-server commands
jonathanhe-msft Sep 10, 2021
abdeca0
added dns-zone commands
jonathanhe-msft Sep 14, 2021
834d297
allow dhcp server and relay calls with None parameters
jonathanhe-msft Sep 14, 2021
339bd77
Merge branch 'jonathanhe/workload-network' into jonathanhe/workload-n…
jonathanhe-msft Sep 14, 2021
99b4574
added workload_network dns-zone commands
jonathanhe-msft Sep 14, 2021
3c30cc1
Update src/vmware/CHANGELOG.md
zhoxing-ms Sep 15, 2021
9b2dec6
renamed dhcp test files to workload-network
jonathanhe-msft Sep 15, 2021
42bc120
merged with main
jonathanhe-msft Sep 15, 2021
0afef5f
Merge branch 'jonathanhe/workload-network' of https://github.com/jona…
jonathanhe-msft Sep 15, 2021
39708dc
added port-mirroring and renamed dhcp test file to workloadnetwork
jonathanhe-msft Sep 16, 2021
11f2334
updated changelog
jonathanhe-msft Sep 16, 2021
1b795ff
updated help and param text based on comments
jonathanhe-msft Sep 16, 2021
33c2876
fixed parameter typo
jonathanhe-msft Sep 21, 2021
c4616eb
workload-network segment public-ip and vm-group commands
jonathanhe-msft Sep 23, 2021
45baa66
merged with main
jonathanhe-msft Sep 23, 2021
9e84d8d
fixed merge issue
jonathanhe-msft Sep 23, 2021
4e13b13
updated merge
jonathanhe-msft Sep 23, 2021
d09f570
added workload-network vm and gateway commands'
jonathanhe-msft Sep 23, 2021
0813139
updated changelog
jonathanhe-msft Sep 23, 2021
37350bd
styling updates
jonathanhe-msft Sep 23, 2021
b566758
updated help texts
jonathanhe-msft Sep 23, 2021
18f8f64
Merge branch 'main' into jonathanhe/workload-network
jonathanhe-msft Sep 29, 2021
946973e
updated parameter name
jonathanhe-msft Sep 29, 2021
b71ae50
removed '-id' from parameters
jonathanhe-msft Oct 7, 2021
0a91334
Merge remote-tracking branch 'upstream/main' into jonathanhe/workload…
jonathanhe-msft Oct 7, 2021
f1ad9d3
fixed unit tests
jonathanhe-msft Oct 8, 2021
f4e0077
Merge branch 'main' into jonathanhe/workload-network
jonathanhe-msft Oct 8, 2021
23c6977
updated sdk to 12-01 api and updated private cloud create and update …
jonathanhe-msft Oct 19, 2021
da25e89
Merge branch 'main' into jonathanhe/cmk
jonathanhe-msft Oct 19, 2021
6444f19
fixed unit tests that were broken from upgrade to 12-01-21
jonathanhe-msft Oct 20, 2021
045bd94
uncommented test file
jonathanhe-msft Oct 21, 2021
90535d6
Merge branch 'main' into jonathanhe/cmk
jonathanhe-msft Oct 21, 2021
9e66fd2
merged with main
jonathanhe-msft Oct 21, 2021
0d33ff2
Merge branch 'main' into jonathanhe/cmk
jonathanhe-msft Oct 26, 2021
7c4306c
added unit tests for placement-policy and vm
jonathanhe-msft Oct 26, 2021
412867f
added prefixes for flattened properties
jonathanhe-msft Oct 28, 2021
b0241df
changed encryption_status to enc_status to match abbreviation convention
jonathanhe-msft Nov 2, 2021
26b057c
Merge branch 'main' into jonathanhe/cmk
jonathanhe-msft Nov 2, 2021
e9ecc4c
Merge branch 'main' into jonathanhe/cmk
jonathanhe-msft Nov 9, 2021
8847a78
added managed identity parameters, warning prompt for placement polic…
jonathanhe-msft Nov 11, 2021
5343115
deprecated listadmincredentials, addidentitysource,deleteidentitysource
jonathanhe-msft Nov 12, 2021
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
3 changes: 2 additions & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ disable=
too-many-arguments,
invalid-name,
duplicate-code,
import-outside-toplevel
import-outside-toplevel,
too-many-lines

[TYPECHECK]
# For Azure CLI extensions, we ignore some import errors as they'll be available in the environment of the CLI
Expand Down
4 changes: 2 additions & 2 deletions src/vmware/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
```powershell
rm ..\azure-cli-extensions\src\vmware\azext_vmware\vendored_sdks -Recurse

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
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
```

It was run from a git clone of [azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs).
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.

## Linter

Expand Down
17 changes: 17 additions & 0 deletions src/vmware/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Release History

## 4.0.0 (2021-11)

- Add `az vmware placement-policy` command group
- Add `az vmware vm` command group
- Updated `az vmware private-cloud create` with new Identity parameter
- Updated `az vmware private-cloud update` with new Identity parameter
- Add `az vmware private-cloud add-availability-zone`
- Add `az vmware private-cloud delete-availability-zone`
- Add `az vmware private-cloud add-cmk-encryption`
- Add `az vmware private-cloud delete-cmk-encryption`
- Add `az vmware private-cloud list-admin-credentials`
- Add `az vmware private-cloud add-identity-source`
- Add `az vmware private-cloud delete-identity-source`
- Deprecate `az vmware private-cloud listadmincredentials`
- Deprecate `az vmware private-cloud addidentitysource`
- Deprecate `az vmware private-cloud deleteidentitysource`

## 3.2.0 (2021-10)

- Add `az vmware workload-network dhcp` command group
Expand Down
163 changes: 163 additions & 0 deletions src/vmware/azext_vmware/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,56 @@
short-summary: Update a cluster in a private cloud.
"""

helps['vmware private-cloud add-identity-source'] = """
type: command
short-summary: Add a vCenter Single Sign On Identity Source to a private cloud.
"""

helps['vmware private-cloud addidentitysource'] = """
type: command
short-summary: Add a vCenter Single Sign On Identity Source to a private cloud.
"""

helps['vmware private-cloud add-availability-zone'] = """
type: command
short-summary: Add an Availability Zone to a private cloud.
"""

helps['vmware private-cloud delete-availability-zone'] = """
type: command
short-summary: Delete an Availability Zone from a private cloud.
"""

helps['vmware private-cloud add-cmk-encryption'] = """
type: command
short-summary: Add a Customer Managed Keys Encryption to a private cloud.
"""

helps['vmware private-cloud delete-cmk-encryption'] = """
type: command
short-summary: Delete a Customer Managed Keys Encryption from a private cloud.
"""

helps['vmware private-cloud identity'] = """
type: group
short-summary: Commands for Managed Identity in a private cloud.
"""

helps['vmware private-cloud identity assign'] = """
type: command
short-summary: Assign a Managed Identity in a private cloud.
"""

helps['vmware private-cloud identity remove'] = """
type: command
short-summary: Remove a Managed Identity in a private cloud.
"""

helps['vmware private-cloud identity show'] = """
type: command
short-summary: Show Managed Identities in a private cloud.
"""

helps['vmware private-cloud create'] = """
type: command
short-summary: Create a private cloud.
Expand All @@ -102,6 +147,11 @@
short-summary: Delete a private cloud.
"""

helps['vmware private-cloud delete-identity-source'] = """
type: command
short-summary: Delete a vCenter Single Sign On Identity Source for a private cloud.
"""

helps['vmware private-cloud deleteidentitysource'] = """
type: command
short-summary: Delete a vCenter Single Sign On Identity Source for a private cloud.
Expand All @@ -112,6 +162,11 @@
short-summary: List the private clouds.
"""

helps['vmware private-cloud list-admin-credentials'] = """
type: command
short-summary: List the admin credentials for the private cloud.
"""

helps['vmware private-cloud listadmincredentials'] = """
type: command
short-summary: List the admin credentials for the private cloud.
Expand Down Expand Up @@ -881,3 +936,111 @@
- name: Get a Gateway by ID in a workload network.
text: az vmware workload-network gateway show --resource-group group1 --private-cloud cloud1 --gateway gateway1
"""

helps['vmware placement-policy'] = """
type: group
short-summary: Commands to manage placement policies.
"""

helps['vmware placement-policy list'] = """
type: command
short-summary: List placement policies in a private cloud cluster.
examples:
- name: List placement policies.
text: az vmware placement-policy list --resource-group group1 --private-cloud cloud1 --cluster-name cluster1
"""

helps['vmware placement-policy show'] = """
type: command
short-summary: Get a placement policy by name in a private cloud cluster.
examples:
- name: Get a placement policy by name.
text: az vmware placement-policy show --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --placement-policy-name policy1
"""

helps['vmware placement-policy vm-host'] = """
type: group
short-summary: Commands to manage VM Host placement policies.
"""

helps['vmware placement-policy vm-host create'] = """
type: command
short-summary: Create a VM Host placement policy in a private cloud cluster.
examples:
- name: Create a VM Host placement policy.
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
"""

helps['vmware placement-policy vm-host update'] = """
type: command
short-summary: Update a VM Host placement policy in a private cloud cluster.
examples:
- name: Update a VM Host placement policy.
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
"""

helps['vmware placement-policy vm-host delete'] = """
type: command
short-summary: Delete a VM Host placement policy in a private cloud cluster.
examples:
- name: Delete a VM Host placement policy.
text: az vmware placement-policy vm-host delete --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --placement-policy-name policy1
"""

helps['vmware placement-policy vm'] = """
type: group
short-summary: Commands to manage VM placement policies.
"""

helps['vmware placement-policy vm create'] = """
type: command
short-summary: Create a VM placement policy in a private cloud cluster.
examples:
- name: Create a VM placement policy.
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
"""

helps['vmware placement-policy vm update'] = """
type: command
short-summary: Update a VM placement policy in a private cloud cluster.
examples:
- name: Update a VM placement policy.
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
"""

helps['vmware placement-policy vm delete'] = """
type: command
short-summary: Delete a VM placement policy in a private cloud cluster.
examples:
- name: Delete a VM placement policy.
text: az vmware placement-policy vm delete --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --placement-policy-name policy1
"""

helps['vmware vm'] = """
type: group
short-summary: Commands to manage Virtual Machines.
"""

helps['vmware vm show'] = """
type: command
short-summary: Get a virtual machine by ID in a private cloud cluster.
examples:
- name: Get a virtual machine by ID.
text: az vmware vm show --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --virtual-machine vm-209
"""

helps['vmware vm list'] = """
type: command
short-summary: List of virtual machines in a private cloud cluster.
examples:
- name: List of virtual machines.
text: az vmware vm list --resource-group group1 --private-cloud cloud1 --cluster-name cluster1
"""

helps['vmware vm restrict-movement'] = """
type: command
short-summary: Enable or disable DRS-driven VM movement restriction.
examples:
- name: Enable or disable DRS-driven VM movement restriction.
text: az vmware vm restrict-movement --resource-group group1 --private-cloud cloud1 --cluster-name cluster1 --virtual-machine vm-209 --restrict-movement Enabled
"""
56 changes: 51 additions & 5 deletions src/vmware/azext_vmware/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ def load_arguments(self, _):
c.argument('private_cloud', options_list=['--private-cloud', '-c'], help='Name of the private cloud.')

with self.argument_context('vmware private-cloud') as c:
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.')
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.')
c.argument('cluster_size', help='Number of hosts for the default management cluster. Minimum of 3 and maximum of 16.')
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.')
c.argument('internet', help='Connectivity to internet. Specify "Enabled" or "Disabled".')

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

with self.argument_context('vmware private-cloud create') as c:
c.argument('name', options_list=['--name', '-n'], help='Name of the private cloud.')
c.argument('sku', help='The product SKU.')
c.argument('internet', help='Connectivity to internet. Specify "Enabled" or "Disabled".')
c.argument('vcenter_password', help='vCenter admin password.')
c.argument('nsxt_password', help='NSX-T Manager password.')
c.argument('accept_eula', help='Accept the end-user license agreement without prompting.')
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.')
c.argument('mi_system_assigned', help='Enable a system assigned identity.')

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

with self.argument_context('vmware private-cloud add-availability-zone') as c:
c.argument('strategy', help='The availability strategy for the private cloud. Possible values include: "SingleZone", "DualZone".')
c.argument('zone', help='The primary availability zone for the private cloud')
c.argument('secondary_zone', help='The secondary availability zone for the private cloud.')

with self.argument_context('vmware private-cloud add-cmk-encryption') as c:
c.argument('enc_status', help='Status of customer managed encryption key. Possible values include "Enabled" and "Disabled".')
c.argument('enc_kv_key_name', help='The name of the encryption key vault key.')
c.argument('enc_kv_url', help='The URL of the encryption key vault.')
c.argument('enc_kv_key_version', help='The version of the encryption key vault key.')

with self.argument_context('vmware private-cloud add-identity-source') as c:
c.argument('alias', help='The domain\'s NetBIOS name.')
c.argument('base_group_dn', help='The base distinguished name for groups.')
c.argument('base_user_dn', help='The base distinguished name for users.')
c.argument('domain', help='The domain\'s dns name.')
c.argument('name', options_list=['--name', '-n'], help='The name of the identity source.')
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.')
c.argument('primary_server', help='Primary server URL.')
c.argument('secondary_server', help='Secondary server URL.')
c.argument('ssl', help='Protect LDAP communication using SSL certificate (LDAPS). Specify "Enabled" or "Disabled".')
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.')

with self.argument_context('vmware private-cloud addidentitysource') as c:
c.argument('alias', help='The domain\'s NetBIOS name.')
c.argument('base_group_dn', help='The base distinguished name for groups.')
Expand All @@ -64,14 +87,21 @@ def load_arguments(self, _):
c.argument('ssl', help='Protect LDAP communication using SSL certificate (LDAPS). Specify "Enabled" or "Disabled".')
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.')

with self.argument_context('vmware private-cloud delete-identity-source') as c:
c.argument('alias', help='The domain\'s NetBIOS name.')
c.argument('domain', help='The domain\'s dns name.')
c.argument('name', options_list=['--name', '-n'], help='The name of the identity source.')

with self.argument_context('vmware private-cloud deleteidentitysource') as c:
c.argument('alias', help='The domain\'s NetBIOS name.')
c.argument('domain', help='The domain\'s dns name.')
c.argument('name', options_list=['--name', '-n'], help='The name of the identity source.')

with self.argument_context('vmware private-cloud identity') as c:
c.argument('system_assigned', help='Enable a system assigned identity.')

with self.argument_context('vmware private-cloud update') as c:
c.argument('name', options_list=['--name', '-n'], help='Name of the private cloud.')
c.argument('internet', help='Connectivity to internet. Specify "Enabled" or "Disabled".')

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

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

with self.argument_context('vmware workload-network gateway') as c:
c.argument('gateway', help="NSX Gateway identifier. Generally the same as the Gateway's display name.")

with self.argument_context('vmware placement-policy') as c:
c.argument('cluster_name', help="Name of the cluster in the private cloud.")
c.argument('placement_policy_name', help="Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy.")
c.argument('state', help="Whether the placement policy is enabled or disabled. Possible values include: 'Enabled', 'Disabled'.")
c.argument('display_name', help="Display name of the placement policy.")
c.argument('vm_members', nargs='+', help="Virtual machine members list.")
c.argument('affinity_type', help="Placement policy affinity type. Possible values include: 'Affinity', 'AntiAffinity'.")
c.argument('host_members', nargs='+', help='Host members list.')
c.argument('yes', help='Deletes without confirmation.')

with self.argument_context('vmware vm') as c:
c.argument('cluster_name', help='Name of the cluster in the private cloud.')
c.argument('virtual_machine', help='Virtual Machine identifier.')
c.argument('restrict_movement', help='Whether VM DRS-driven movement is restricted (enabled) or not (disabled).')
Loading