Skip to content

Commit 3145a03

Browse files
pscloud: Release stable version 1.0.0 with CLI improvements (#9488)
* Improve pscloud pool CLI usability - Rename -n and --name - Add --zone and -z - Flatten --vnet-injection. - Remove unsupported identity options (--system-assigned, --user-assigned) - Make required parameters mandatory with client-side validation - --zone, --provisioned-bandwidth, --reservation-id - --subnet-id, --vnet-id - Remove wait subcommand for consistency with other Azure CLIs - Update examples to show cleaner syntax with individual flags * Update pscloud README with improved CLI syntax and removed features documentation * pscloud: Release stable version 1.0.0 with CLI improvements - Updated version from 1.0.0b1 to stable 1.0.0 with dual version management - Removed preview flags from all commands and command groups - Fixed parameter consistency across commands (--name/-n standardization) - Updated README documentation to reflect all parameter changes and stable version - Added version management with separate STABLE_VERSION and PREVIEW_VERSION variables * Test recordings updated for storagepool commands * Fix VCR cassette mismatches in pscloud tests - Changed test_pscloud_storagepool_create to use 'dhritijindal' to match VCR recording - Ensured test_pscloud_storagepool_delete uses 'dhritijindal123' to match its VCR recording - All 6 tests now pass successfully
1 parent 49cc84b commit 3145a03

22 files changed

Lines changed: 1107 additions & 1908 deletions

src/pscloud/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Release History
44
===============
55

6+
1.0.0
7+
+++++
8+
* Stable release.
9+
610
1.0.0b1
711
++++++
812
* Initial release.

src/pscloud/README.md

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
This is an extension to Azure CLI to manage Pure Storage Cloud Azure Native resources.
44

5+
## Recent Improvements ##
6+
7+
The pscloud CLI has been recently improved for better usability and consistency:
8+
9+
### Enhanced Parameter Usability ###
10+
- **Simplified zone specification**: Use `--zone` or `-z` instead of `--availability-zone`
11+
- **Flattened network parameters**: Use `--subnet-name` and `--vnet-name` directly instead of complex `--vnet-injection` JSON objects
12+
- **Improved parameter names**: Consistent use of `--name` or `-n` across all commands
13+
14+
### Removed Unsupported Features ###
15+
- **Identity parameters removed**: `--system-assigned`, `--user-assigned`, and related identity options have been removed as they are not supported by the Pure Storage Cloud service
16+
- **Wait command removed**: `az pscloud pool wait` has been removed for consistency with other Azure CLI extensions
17+
18+
### Enhanced Validation ###
19+
- **Required parameters**: Key parameters like `--zone`, `--provisioned-bandwidth`, `--reservation-id`, `--subnet-name`, and `--vnet-name` are now properly validated as required
20+
- **Better examples**: All command examples now show realistic Azure resource IDs and cleaner syntax
21+
522
## How to use ##
623

724
For more details about the Pure Storage Cloud resources please visit [documentation on Pure Support](https://support.purestorage.com/bundle/m_azure_native_pure_storage_cloud/page/Pure_Cloud_Block_Store/Azure_Native_Pure_Storage_Cloud/design/c_resources_in_psc.html).
@@ -10,7 +27,7 @@ For more details about the Pure Storage Cloud resources please visit [documentat
1027

1128
Install this extension using the below CLI command:
1229
```
13-
az extension add --name pscloud --allow-preview
30+
az extension add --name pscloud
1431
```
1532

1633
### Check the version ###
@@ -65,13 +82,33 @@ This resource represents a block storage array instance, delivered as a service,
6582
To create a Storage Pool, you need to have a virtual network with a delegated subnet to `PureStorage.Block` service.
6683

6784
```bash
68-
az pscloud pool create --resource-group {resource_group} --storage-pool-name {storage_pool_name} --location {location} --availability-zone {availability_zone} --vnet-injection '{{"subnet-id": "{subnet_id}", "vnet-id": "{vnet_id}"}}' --provisioned-bandwidth {bandwidth_mb_per_sec} --reservation-id {reservation_resource_id} --system-assigned --user-assigned {user_assigned_identity_ids} --tags "{key:value}"
85+
az pscloud pool create --resource-group {resource_group} --storage-pool-name {storage_pool_name} --location {location} --zone {availability_zone} --subnet-name {subnet_resource_id} --vnet-name {vnet_resource_id} --provisioned-bandwidth {bandwidth_mb_per_sec} --reservation-id {reservation_resource_id} --tags "{key:value}"
86+
```
87+
88+
**Required Parameters:**
89+
- `--zone` or `-z`: Azure Availability Zone (1, 2, or 3)
90+
- `--subnet-name`: Full Azure resource ID of the delegated subnet
91+
- `--vnet-name`: Full Azure resource ID of the virtual network
92+
- `--provisioned-bandwidth`: Bandwidth in MB/s
93+
- `--reservation-id`: Azure resource ID of the Pure Storage Cloud reservation
94+
95+
**Example with realistic values:**
96+
```bash
97+
az pscloud pool create \
98+
--resource-group myResourceGroup \
99+
--storage-pool-name myStoragePool \
100+
--location eastus \
101+
--zone 1 \
102+
--subnet-name /subscriptions/12345678-1234-1234-1234-123456789abc/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/mySubnet \
103+
--vnet-name /subscriptions/12345678-1234-1234-1234-123456789abc/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myVnet \
104+
--provisioned-bandwidth 100 \
105+
--reservation-id /subscriptions/12345678-1234-1234-1234-123456789abc/providers/PureStorage.Block/reservations/myReservation
69106
```
70107

71108
#### Show a Storage Pool ####
72109

73110
```bash
74-
az pscloud pool show --resource-group {resource_group} --storage-pool-name {storage_pool_name}
111+
az pscloud pool show --resource-group {resource_group} --name {storage_pool_name}
75112
```
76113

77114
#### List Storage Pools ####
@@ -86,10 +123,12 @@ az pscloud pool list --resource-group {resource_group}
86123
az pscloud pool update --resource-group {resource_group} --name {storage_pool_name} --provisioned-bandwidth {bandwidth_mb_per_sec}
87124
```
88125

126+
**Note:** Identity-related parameters (`--system-assigned`, `--user-assigned`) have been removed as they are not supported by the Pure Storage Cloud service.
127+
89128
#### Delete a Storage Pool ####
90129

91130
```bash
92-
az pscloud pool delete --resource-group {resource_group} --storage-pool-name {storage_pool_name}
131+
az pscloud pool delete --resource-group {resource_group} --name {storage_pool_name}
93132
```
94133

95134
#### Connect a Storage Pool to AVS ####
@@ -101,15 +140,17 @@ Currently, establishing a connection between a Storage Pool and an Azure VMware
101140
This command provides the health status about the Storage Pool.
102141

103142
```bash
104-
az pscloud pool get-health-status --resource-group {resource_group} --storage-pool-name {storage_pool_name}
143+
az pscloud pool get-health-status --resource-group {resource_group} --name {storage_pool_name}
105144
```
106145

107146
#### Get Storage Pool AVS Status ####
108147

109148
This command provides the current connection status between the Storage Pool and Azure VMware Solution (AVS) resource.
110149

111150
```bash
112-
az pscloud pool get-avs-status --resource-group {resource_group} --storage-pool-name {storage_pool_name}
151+
az pscloud pool get-avs-status --resource-group {resource_group} --name {storage_pool_name}
113152
```
114153

154+
**Note:** You can use either `--name` or `-n` for the storage pool name parameter.
155+
115156
If you have issues, please give feedback by opening an issue at https://github.com/Azure/azure-cli-extensions/issues.

src/pscloud/azext_pscloud/aaz/latest/pscloud/__cmd_group.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command_group(
1515
"pscloud",
16-
is_preview=True,
1716
)
1817
class __CMDGroup(AAZCommandGroup):
1918
"""Manage Pure Storage Block resources

src/pscloud/azext_pscloud/aaz/latest/pscloud/_list.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"pscloud list",
16-
is_preview=True,
1716
)
1817
class List(AAZCommand):
1918
"""List reservations by Azure subscription ID

src/pscloud/azext_pscloud/aaz/latest/pscloud/_show.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"pscloud show",
16-
is_preview=True,
1716
)
1817
class Show(AAZCommand):
1918
"""Get a reservation

src/pscloud/azext_pscloud/aaz/latest/pscloud/pool/__cmd_group.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command_group(
1515
"pscloud pool",
16-
is_preview=True,
1716
)
1817
class __CMDGroup(AAZCommandGroup):
1918
"""Manage Storage Pool

src/pscloud/azext_pscloud/aaz/latest/pscloud/pool/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@
1616
from ._list import *
1717
from ._show import *
1818
from ._update import *
19-
from ._wait import *

src/pscloud/azext_pscloud/aaz/latest/pscloud/pool/_create.py

Lines changed: 23 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313

1414
@register_command(
1515
"pscloud pool create",
16-
is_preview=True,
1716
)
1817
class Create(AAZCommand):
1918
"""Create a storage pool
2019
2120
:example: StoragePools_Create
22-
az pscloud pool create --resource-group rgpurestorage --storage-pool-name storagePoolname --availability-zone vknyl --vnet-injection "{subnet-id:tnlctolrxdvnkjiphlrdxq,vnet-id:zbumtytyqwewjcyckwqchiypshv}" --provisioned-bandwidth 17 --reservation-id xiowoxnbtcotutcmmrofvgdi --type None --user-assigned-identities "{key4211:{}}" --tags "{key7593:vsyiygyurvwlfaezpuqu}" --location lonlc
21+
az pscloud pool create --resource-group rgpurestorage --storage-pool-name storagePoolname --zone 1 --subnet-name /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} --vnet-name /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName} --provisioned-bandwidth 100 --reservation-id /subscriptions/{subscriptionId}/providers/PureStorage.Block/reservations/{reservationName} --location eastus
2322
"""
2423

2524
_aaz_info = {
@@ -60,58 +59,25 @@ def _build_arguments_schema(cls, *args, **kwargs):
6059
),
6160
)
6261

63-
# define Arg Group "Identity"
64-
65-
_args_schema = cls._args_schema
66-
_args_schema.mi_system_assigned = AAZStrArg(
67-
options=["--system-assigned", "--mi-system-assigned"],
68-
arg_group="Identity",
69-
help="Set the system managed identity.",
70-
blank="True",
71-
)
72-
_args_schema.mi_user_assigned = AAZListArg(
73-
options=["--user-assigned", "--mi-user-assigned"],
74-
arg_group="Identity",
75-
help="Set the user managed identities.",
76-
blank=[],
77-
)
78-
79-
mi_user_assigned = cls._args_schema.mi_user_assigned
80-
mi_user_assigned.Element = AAZStrArg()
81-
8262
# define Arg Group "Properties"
8363

8464
_args_schema = cls._args_schema
85-
_args_schema.availability_zone = AAZStrArg(
86-
options=["--availability-zone"],
65+
_args_schema.zone = AAZStrArg(
66+
options=["-z", "--zone"],
8767
arg_group="Properties",
8868
help="Azure Availability Zone the Pool is located in",
69+
required=True,
8970
)
9071
_args_schema.provisioned_bandwidth = AAZIntArg(
9172
options=["--provisioned-bandwidth"],
9273
arg_group="Properties",
9374
help="Total bandwidth provisioned for the pool, in MB/s",
75+
required=True,
9476
)
9577
_args_schema.reservation_id = AAZStrArg(
9678
options=["--reservation-id"],
9779
arg_group="Properties",
9880
help="Azure resource ID of the Pure Storage Cloud service (reservation resource) this storage pool belongs to",
99-
)
100-
_args_schema.vnet_injection = AAZObjectArg(
101-
options=["--vnet-injection"],
102-
arg_group="Properties",
103-
help="Network properties of the storage pool",
104-
)
105-
106-
vnet_injection = cls._args_schema.vnet_injection
107-
vnet_injection.subnet_id = AAZStrArg(
108-
options=["subnet-id"],
109-
help="Azure resource ID of the Virtual Network subnet where the storage pool will be connected",
110-
required=True,
111-
)
112-
vnet_injection.vnet_id = AAZStrArg(
113-
options=["vnet-id"],
114-
help="Azure resource ID of the Virtual Network in which the subnet is located",
11581
required=True,
11682
)
11783

@@ -134,6 +100,22 @@ def _build_arguments_schema(cls, *args, **kwargs):
134100

135101
tags = cls._args_schema.tags
136102
tags.Element = AAZStrArg()
103+
104+
# define Arg Group "VnetInjection"
105+
106+
_args_schema = cls._args_schema
107+
_args_schema.subnet_id = AAZStrArg(
108+
options=["--subnet-name"],
109+
arg_group="VnetInjection",
110+
help="Azure resource ID of the Virtual Network subnet where the storage pool will be connected",
111+
required=True,
112+
)
113+
_args_schema.vnet_id = AAZStrArg(
114+
options=["--vnet-name"],
115+
arg_group="VnetInjection",
116+
help="Azure resource ID of the Virtual Network in which the subnet is located",
117+
required=True,
118+
)
137119
return cls._args_schema
138120

139121
def _execute_operations(self):
@@ -242,26 +224,16 @@ def content(self):
242224
typ=AAZObjectType,
243225
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
244226
)
245-
_builder.set_prop("identity", AAZIdentityObjectType)
246227
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}})
247228
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
248229
_builder.set_prop("tags", AAZDictType, ".tags")
249230

250-
identity = _builder.get(".identity")
251-
if identity is not None:
252-
identity.set_prop("userAssigned", AAZListType, ".mi_user_assigned", typ_kwargs={"flags": {"action": "create"}})
253-
identity.set_prop("systemAssigned", AAZStrType, ".mi_system_assigned", typ_kwargs={"flags": {"action": "create"}})
254-
255-
user_assigned = _builder.get(".identity.userAssigned")
256-
if user_assigned is not None:
257-
user_assigned.set_elements(AAZStrType, ".")
258-
259231
properties = _builder.get(".properties")
260232
if properties is not None:
261-
properties.set_prop("availabilityZone", AAZStrType, ".availability_zone", typ_kwargs={"flags": {"required": True}})
233+
properties.set_prop("availabilityZone", AAZStrType, ".zone", typ_kwargs={"flags": {"required": True}})
262234
properties.set_prop("provisionedBandwidthMbPerSec", AAZIntType, ".provisioned_bandwidth", typ_kwargs={"flags": {"required": True}})
263235
properties.set_prop("reservationResourceId", AAZStrType, ".reservation_id", typ_kwargs={"flags": {"required": True}})
264-
properties.set_prop("vnetInjection", AAZObjectType, ".vnet_injection", typ_kwargs={"flags": {"required": True}})
236+
properties.set_prop("vnetInjection", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
265237

266238
vnet_injection = _builder.get(".properties.vnetInjection")
267239
if vnet_injection is not None:

src/pscloud/azext_pscloud/aaz/latest/pscloud/pool/_delete.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"pscloud pool delete",
16-
is_preview=True,
1716
confirmation="Are you sure you want to perform this operation?",
1817
)
1918
class Delete(AAZCommand):

src/pscloud/azext_pscloud/aaz/latest/pscloud/pool/_get_avs_status.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
@register_command(
1515
"pscloud pool get-avs-status",
16-
is_preview=True,
1716
)
1817
class GetAvsStatus(AAZCommand):
1918
"""Returns the status of the storage pool connection to AVS
@@ -49,7 +48,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
4948
required=True,
5049
)
5150
_args_schema.storage_pool_name = AAZStrArg(
52-
options=["--storage-pool-name"],
51+
options=["-n", "--name"],
5352
help="Name of the storage pool",
5453
required=True,
5554
id_part="name",

0 commit comments

Comments
 (0)