Skip to content

Commit

Permalink
run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yaotongms committed Jun 26, 2024
1 parent 059fd5d commit a290808
Show file tree
Hide file tree
Showing 14 changed files with 469 additions and 4,564 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,58 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
)

# define Arg Group "LicenseDetails"

_args_schema = cls._args_schema
_args_schema.edition = AAZStrArg(
options=["--edition"],
arg_group="LicenseDetails",
help="Describes the edition of the license. The values are either Standard or Datacenter.",
enum={"Datacenter": "Datacenter", "Standard": "Standard"},
)
_args_schema.processors = AAZIntArg(
options=["--processors"],
arg_group="LicenseDetails",
help="Describes the number of processors.",
)
_args_schema.state = AAZStrArg(
options=["--state"],
arg_group="LicenseDetails",
help="Describes the state of the license.",
enum={"Activated": "Activated", "Deactivated": "Deactivated"},
)
_args_schema.target = AAZStrArg(
options=["--target"],
arg_group="LicenseDetails",
help="Describes the license target server.",
enum={"Windows Server 2012": "Windows Server 2012", "Windows Server 2012 R2": "Windows Server 2012 R2"},
)
_args_schema.type = AAZStrArg(
options=["--type"],
arg_group="LicenseDetails",
help="Describes the license core type (pCore or vCore).",
enum={"pCore": "pCore", "vCore": "vCore"},
)
_args_schema.volume_license_details = AAZListArg(
options=["--volume-license-details"],
arg_group="LicenseDetails",
help="A list of volume license details.",
)

volume_license_details = cls._args_schema.volume_license_details
volume_license_details.Element = AAZObjectArg()

_element = cls._args_schema.volume_license_details.Element
_element.invoice_id = AAZStrArg(
options=["invoice-id"],
help="The invoice id for the volume license.",
)
_element.program_year = AAZStrArg(
options=["program-year"],
help="Describes the program year the volume license is for.",
enum={"Year 1": "Year 1", "Year 2": "Year 2", "Year 3": "Year 3"},
)

# define Arg Group "Parameters"

_args_schema = cls._args_schema
Expand All @@ -80,11 +132,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group "Properties"

_args_schema = cls._args_schema
_args_schema.license_details = AAZObjectArg(
options=["--license-details"],
arg_group="Properties",
help="Describes the properties of a License.",
)
_args_schema.license_type = AAZStrArg(
options=["--license-type"],
arg_group="Properties",
Expand All @@ -96,50 +143,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
arg_group="Properties",
help="Describes the tenant id.",
)

license_details = cls._args_schema.license_details
license_details.edition = AAZStrArg(
options=["edition"],
help="Describes the edition of the license. The values are either Standard or Datacenter.",
enum={"Datacenter": "Datacenter", "Standard": "Standard"},
)
license_details.processors = AAZIntArg(
options=["processors"],
help="Describes the number of processors.",
)
license_details.state = AAZStrArg(
options=["state"],
help="Describes the state of the license.",
enum={"Activated": "Activated", "Deactivated": "Deactivated"},
)
license_details.target = AAZStrArg(
options=["target"],
help="Describes the license target server.",
enum={"Windows Server 2012": "Windows Server 2012", "Windows Server 2012 R2": "Windows Server 2012 R2"},
)
license_details.type = AAZStrArg(
options=["type"],
help="Describes the license core type (pCore or vCore).",
enum={"pCore": "pCore", "vCore": "vCore"},
)
license_details.volume_license_details = AAZListArg(
options=["volume-license-details"],
help="A list of volume license details.",
)

volume_license_details = cls._args_schema.license_details.volume_license_details
volume_license_details.Element = AAZObjectArg()

_element = cls._args_schema.license_details.volume_license_details.Element
_element.invoice_id = AAZStrArg(
options=["invoice-id"],
help="The invoice id for the volume license.",
)
_element.program_year = AAZStrArg(
options=["program-year"],
help="Describes the program year the volume license is for.",
enum={"Year 1": "Year 1", "Year 2": "Year 2", "Year 3": "Year 3"},
)
return cls._args_schema

def _execute_operations(self):
Expand Down Expand Up @@ -254,7 +257,7 @@ def content(self):

properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("licenseDetails", AAZObjectType, ".license_details")
properties.set_prop("licenseDetails", AAZObjectType)
properties.set_prop("licenseType", AAZStrType, ".license_type")
properties.set_prop("tenantId", AAZStrType, ".tenant_id")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,86 +60,56 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
)

# define Arg Group "Parameters"
# define Arg Group "LicenseDetails"

_args_schema = cls._args_schema
_args_schema.tags = AAZDictArg(
options=["--tags"],
arg_group="Parameters",
help="Resource tags.",
nullable=True,
)

tags = cls._args_schema.tags
tags.Element = AAZStrArg(
nullable=True,
)

# define Arg Group "Properties"

_args_schema = cls._args_schema
_args_schema.license_details = AAZObjectArg(
options=["--license-details"],
arg_group="Properties",
help="Describes the properties of a License.",
nullable=True,
)
_args_schema.license_type = AAZStrArg(
options=["--license-type"],
arg_group="Properties",
help="The type of the license resource.",
nullable=True,
enum={"ESU": "ESU"},
)
_args_schema.tenant_id = AAZStrArg(
options=["--tenant-id"],
arg_group="Properties",
help="Describes the tenant id.",
nullable=True,
)

license_details = cls._args_schema.license_details
license_details.edition = AAZStrArg(
options=["edition"],
_args_schema.edition = AAZStrArg(
options=["--edition"],
arg_group="LicenseDetails",
help="Describes the edition of the license. The values are either Standard or Datacenter.",
nullable=True,
enum={"Datacenter": "Datacenter", "Standard": "Standard"},
)
license_details.processors = AAZIntArg(
options=["processors"],
_args_schema.processors = AAZIntArg(
options=["--processors"],
arg_group="LicenseDetails",
help="Describes the number of processors.",
nullable=True,
)
license_details.state = AAZStrArg(
options=["state"],
_args_schema.state = AAZStrArg(
options=["--state"],
arg_group="LicenseDetails",
help="Describes the state of the license.",
nullable=True,
enum={"Activated": "Activated", "Deactivated": "Deactivated"},
)
license_details.target = AAZStrArg(
options=["target"],
_args_schema.target = AAZStrArg(
options=["--target"],
arg_group="LicenseDetails",
help="Describes the license target server.",
nullable=True,
enum={"Windows Server 2012": "Windows Server 2012", "Windows Server 2012 R2": "Windows Server 2012 R2"},
)
license_details.type = AAZStrArg(
options=["type"],
_args_schema.type = AAZStrArg(
options=["--type"],
arg_group="LicenseDetails",
help="Describes the license core type (pCore or vCore).",
nullable=True,
enum={"pCore": "pCore", "vCore": "vCore"},
)
license_details.volume_license_details = AAZListArg(
options=["volume-license-details"],
_args_schema.volume_license_details = AAZListArg(
options=["--volume-license-details"],
arg_group="LicenseDetails",
help="A list of volume license details.",
nullable=True,
)

volume_license_details = cls._args_schema.license_details.volume_license_details
volume_license_details = cls._args_schema.volume_license_details
volume_license_details.Element = AAZObjectArg(
nullable=True,
)

_element = cls._args_schema.license_details.volume_license_details.Element
_element = cls._args_schema.volume_license_details.Element
_element.invoice_id = AAZStrArg(
options=["invoice-id"],
help="The invoice id for the volume license.",
Expand All @@ -151,6 +121,38 @@ def _build_arguments_schema(cls, *args, **kwargs):
nullable=True,
enum={"Year 1": "Year 1", "Year 2": "Year 2", "Year 3": "Year 3"},
)

# define Arg Group "Parameters"

_args_schema = cls._args_schema
_args_schema.tags = AAZDictArg(
options=["--tags"],
arg_group="Parameters",
help="Resource tags.",
nullable=True,
)

tags = cls._args_schema.tags
tags.Element = AAZStrArg(
nullable=True,
)

# define Arg Group "Properties"

_args_schema = cls._args_schema
_args_schema.license_type = AAZStrArg(
options=["--license-type"],
arg_group="Properties",
help="The type of the license resource.",
nullable=True,
enum={"ESU": "ESU"},
)
_args_schema.tenant_id = AAZStrArg(
options=["--tenant-id"],
arg_group="Properties",
help="Describes the tenant id.",
nullable=True,
)
return cls._args_schema

def _execute_operations(self):
Expand Down Expand Up @@ -393,7 +395,7 @@ def _update_instance(self, instance):

properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("licenseDetails", AAZObjectType, ".license_details")
properties.set_prop("licenseDetails", AAZObjectType)
properties.set_prop("licenseType", AAZStrType, ".license_type")
properties.set_prop("tenantId", AAZStrType, ".tenant_id")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Update(AAZCommand):
"""Update a private endpoint connection with a given name.
:example: Sample command for private-endpoint-connection update
az connectedmachine private-endpoint-connection update --connection-state "{{"description":"Rejected by AZ CLI", "status":"Rejected"}}" --name private-endpoint-connection-name --resource-group myResourceGroup --scope-name myPrivateLinkScope
az connectedmachine private-endpoint-connection update --description "Rejected by AZ CLI" --status "Rejected" --name private-endpoint-connection-name --resource-group myResourceGroup --scope-name myPrivateLinkScope
"""

_aaz_info = {
Expand Down Expand Up @@ -66,6 +66,20 @@ def _build_arguments_schema(cls, *args, **kwargs):
),
)

# define Arg Group "ConnectionState"

_args_schema = cls._args_schema
_args_schema.description = AAZStrArg(
options=["--description"],
arg_group="ConnectionState",
help="The private link service connection description.",
)
_args_schema.status = AAZStrArg(
options=["--status"],
arg_group="ConnectionState",
help="The private link service connection status.",
)

# define Arg Group "Properties"

_args_schema = cls._args_schema
Expand All @@ -75,29 +89,13 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="Private endpoint which the connection belongs to.",
nullable=True,
)
_args_schema.private_link_service_connection_state = AAZObjectArg(
options=["--connection-state", "--private-link-service-connection-state"],
arg_group="Properties",
help="Connection state of the private endpoint connection.",
nullable=True,
)

private_endpoint = cls._args_schema.private_endpoint
private_endpoint.id = AAZStrArg(
options=["id"],
help="Resource id of the private endpoint.",
nullable=True,
)

private_link_service_connection_state = cls._args_schema.private_link_service_connection_state
private_link_service_connection_state.description = AAZStrArg(
options=["description"],
help="The private link service connection description.",
)
private_link_service_connection_state.status = AAZStrArg(
options=["status"],
help="The private link service connection status.",
)
return cls._args_schema

def _execute_operations(self):
Expand Down Expand Up @@ -348,7 +346,7 @@ def _update_instance(self, instance):
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("privateEndpoint", AAZObjectType, ".private_endpoint")
properties.set_prop("privateLinkServiceConnectionState", AAZObjectType, ".private_link_service_connection_state")
properties.set_prop("privateLinkServiceConnectionState", AAZObjectType)

private_endpoint = _builder.get(".properties.privateEndpoint")
if private_endpoint is not None:
Expand Down
Loading

0 comments on commit a290808

Please sign in to comment.