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

Updates to commands #11

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion src/devcenter/azext_devcenter/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def validate_pool_create(
if has_value(managed_virtual_network_regions) and (
virtual_network_type == "Unmanaged" or not has_value(virtual_network_type)
):
print(managed_virtual_network_regions[0])
error_message = """When virtual-network-type is not used or set to "Unmanaged", \
managed virtual network regions (--managed-virtual-network-regions) should not be set."""
raise RequiredArgumentMissingError(error_message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema = cls._args_schema
_args_schema.hibernate_support = AAZStrArg(
options=["--hibernate-support"],
is_preview=True,
arg_group="Properties",
help="Indicates whether dev boxes created with this definition are capable of hibernation. Not all images are capable of supporting hibernation. To find out more see https://aka.ms/devbox/hibernate",
enum={"Disabled": "Disabled", "Enabled": "Enabled"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
_args_schema = cls._args_schema
_args_schema.hibernate_support = AAZStrArg(
options=["--hibernate-support"],
is_preview=True,
arg_group="Properties",
help="Indicates whether dev boxes created with this definition are capable of hibernation. Not all images are capable of supporting hibernation. To find out more see https://aka.ms/devbox/hibernate",
nullable=True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,42 +108,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
arg_group="Properties",
help="The display name of the devcenter.",
)
_args_schema.encryption = AAZObjectArg(
options=["--encryption"],
arg_group="Properties",
help="Encryption settings to be used for server-side encryption for proprietary content (such as catalogs, logs, customizations).",
)

encryption = cls._args_schema.encryption
encryption.customer_managed_key_encryption = AAZObjectArg(
options=["customer-managed-key-encryption"],
help="All Customer-managed key encryption properties for the resource.",
)

customer_managed_key_encryption = cls._args_schema.encryption.customer_managed_key_encryption
customer_managed_key_encryption.key_encryption_key_identity = AAZObjectArg(
options=["key-encryption-key-identity"],
help="All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault.",
)
customer_managed_key_encryption.key_encryption_key_url = AAZStrArg(
options=["key-encryption-key-url"],
help="key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek.",
)

key_encryption_key_identity = cls._args_schema.encryption.customer_managed_key_encryption.key_encryption_key_identity
key_encryption_key_identity.delegated_identity_client_id = AAZUuidArg(
options=["delegated-identity-client-id"],
help="delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only.",
)
key_encryption_key_identity.identity_type = AAZStrArg(
options=["identity-type"],
help="Values can be systemAssignedIdentity or userAssignedIdentity",
enum={"delegatedResourceIdentity": "delegatedResourceIdentity", "systemAssignedIdentity": "systemAssignedIdentity", "userAssignedIdentity": "userAssignedIdentity"},
)
key_encryption_key_identity.user_assigned_identity_resource_id = AAZResourceIdArg(
options=["user-assigned-identity-resource-id"],
help="user assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and delegatedResourceIdentity.",
)
return cls._args_schema

def _execute_operations(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,49 +108,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The display name of the devcenter.",
nullable=True,
)
_args_schema.encryption = AAZObjectArg(
options=["--encryption"],
arg_group="Properties",
help="Encryption settings to be used for server-side encryption for proprietary content (such as catalogs, logs, customizations).",
nullable=True,
)

encryption = cls._args_schema.encryption
encryption.customer_managed_key_encryption = AAZObjectArg(
options=["customer-managed-key-encryption"],
help="All Customer-managed key encryption properties for the resource.",
nullable=True,
)

customer_managed_key_encryption = cls._args_schema.encryption.customer_managed_key_encryption
customer_managed_key_encryption.key_encryption_key_identity = AAZObjectArg(
options=["key-encryption-key-identity"],
help="All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault.",
nullable=True,
)
customer_managed_key_encryption.key_encryption_key_url = AAZStrArg(
options=["key-encryption-key-url"],
help="key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek.",
nullable=True,
)

key_encryption_key_identity = cls._args_schema.encryption.customer_managed_key_encryption.key_encryption_key_identity
key_encryption_key_identity.delegated_identity_client_id = AAZUuidArg(
options=["delegated-identity-client-id"],
help="delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only.",
nullable=True,
)
key_encryption_key_identity.identity_type = AAZStrArg(
options=["identity-type"],
help="Values can be systemAssignedIdentity or userAssignedIdentity",
nullable=True,
enum={"delegatedResourceIdentity": "delegatedResourceIdentity", "systemAssignedIdentity": "systemAssignedIdentity", "userAssignedIdentity": "userAssignedIdentity"},
)
key_encryption_key_identity.user_assigned_identity_resource_id = AAZResourceIdArg(
options=["user-assigned-identity-resource-id"],
help="user assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and delegatedResourceIdentity.",
nullable=True,
)
return cls._args_schema

def _execute_operations(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def _build_arguments_schema(cls, *args, **kwargs):
options=["--domain-password"],
arg_group="Properties",
help="The password for the account used to join domain",
blank=AAZPromptInput(
msg="Domain password:",
),
)
_args_schema.domain_username = AAZStrArg(
options=["--domain-username"],
Expand Down
Loading