Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI - Array of object feature request #262

Open
schaudhari6254888 opened this issue Jun 28, 2023 · 0 comments
Open

CLI - Array of object feature request #262

schaudhari6254888 opened this issue Jun 28, 2023 · 0 comments

Comments

@schaudhari6254888
Copy link

schaudhari6254888 commented Jun 28, 2023

CLI - Array of object feature request
The multiple addition/deletion feature is not supported by the aaz-dev-tool subcommand's current version. That is, when I use a subcommand to construct, for example, az eventhubs namespace encryption add, we can only add one encryption attribute at a time.

Therefore, in order to avoid this, we have built custom code. For example, I added the cli_add_encryption method. https://github.com/schaudhari6254888/azure-cli/blob/cccd800d7c631dbc33e9710719bfe6a3ea142fb1/src/azure-cli/azure/cli/command_modules/eventhubs/operations/namespace_custom.py#L90

However, if we can construct this Array of objects using a tool, for example, look at this swagger file.

https://github.com/schaudhari6254888/azure-rest-api-specs/blob/6c6b16dc98d720304633b76c8e82c282ffa9cc08/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-10-01-preview/namespaces-preview.json#L915

keyVaultProperties is an array of objects containing keyName, keyVaultURI, KeyVersion, and Identity. So the encryption add subcommand should take this keyVaultProperties as an array of objects, allowing us to handle multiple addition of encryption for the add subcommand.

Similarly, for the delete subcommand operation, we may use x-ms-identifier=['properties/keyVaultProperties'] to identify the deletion to be done on keyVaultProperties only.

for ex - az eventhubs namespace encryption remove --resource-group {rg} --namespace-name {namespacename} --encryption-config key-name={key2} key-vault-uri={key_uri} user-assigned-identity={id1} --encryption-config key-name={key3} key-vault-uri={key_uri} user-assigned-identity={id1}

This way, we can simplify the subcommands and avoid future custom code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant