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

feat!: remove state param for deployment commands #46

Merged
merged 1 commit into from
May 21, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
arg_group="Properties",
help="Server",
)
_args_schema.state = AAZStrArg(
options=["--state"],
arg_group="Properties",
help="State of API deployment.",
enum={"active": "active", "inactive": "inactive"},
)
_args_schema.title = AAZStrArg(
options=["--title"],
arg_group="Properties",
Expand Down Expand Up @@ -262,7 +256,6 @@ def content(self):
properties.set_prop("description", AAZStrType, ".description")
properties.set_prop("environmentId", AAZStrType, ".environment_id")
properties.set_prop("server", AAZObjectType, ".server")
properties.set_prop("state", AAZStrType, ".state")
properties.set_prop("title", AAZStrType, ".title")

custom_properties = _builder.get(".properties.customProperties")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="Server",
nullable=True,
)
_args_schema.state = AAZStrArg(
options=["--state"],
arg_group="Properties",
help="State of API deployment.",
nullable=True,
enum={"active": "active", "inactive": "inactive"},
)
_args_schema.title = AAZStrArg(
options=["--title"],
arg_group="Properties",
Expand Down Expand Up @@ -417,7 +410,6 @@ def _update_instance(self, instance):
properties.set_prop("description", AAZStrType, ".description")
properties.set_prop("environmentId", AAZStrType, ".environment_id")
properties.set_prop("server", AAZObjectType, ".server")
properties.set_prop("state", AAZStrType, ".state")
properties.set_prop("title", AAZStrType, ".title")

custom_properties = _builder.get(".properties.customProperties")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,14 @@ def test_deployment_create_with_all_optional_params(self, metadata_name):
'server': '{"runtimeUri":["https://example.com"]}',
'customProperties': '{{"{}":true}}'.format(metadata_name),
})
self.cmd('az apic api deployment create -g {rg} -s {s} --api-id {api} --definition-id /workspaces/default/apis/{api}/versions/{v}/definitions/{d} --environment-id /workspaces/default/environments/{e} --deployment-id {name} --title "test deployment" --server \'{server}\' --description "deployment description" --state active --custom-properties \'{customProperties}\'', checks=[
self.cmd('az apic api deployment create -g {rg} -s {s} --api-id {api} --definition-id /workspaces/default/apis/{api}/versions/{v}/definitions/{d} --environment-id /workspaces/default/environments/{e} --deployment-id {name} --title "test deployment" --server \'{server}\' --description "deployment description" --custom-properties \'{customProperties}\'', checks=[
self.check('name', '{name}'),
self.check('title', 'test deployment'),
self.check('server.runtimeUri[0]', 'https://example.com'),
self.check('customProperties.{}'.format(metadata_name), True),
self.check('definitionId', '/workspaces/default/apis/{api}/versions/{v}/definitions/{d}'),
self.check('environmentId', '/workspaces/default/environments/{e}'),
self.check('description', 'deployment description'),
# TODO: Uncomment this line after Control Plane API fixed related bug
# self.check('state', 'active'),
])

@ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32)
Expand Down Expand Up @@ -127,15 +125,13 @@ def test_deployment_update_with_all_optional_params(self, metadata_name):
'server': '{"runtimeUri":["https://example2.com"]}',
'customProperties': '{{"{}":true}}'.format(metadata_name),
})
self.cmd('az apic api deployment update -g {rg} -s {s} --api-id {api} --definition-id /workspaces/default/apis/{api}/versions/{v}/definitions/{d} --environment-id /workspaces/default/environments/{e} --deployment-id {dep} --title "updated deployment" --server \'{server}\' --description "deployment description" --state active --custom-properties \'{customProperties}\'', checks=[
self.cmd('az apic api deployment update -g {rg} -s {s} --api-id {api} --definition-id /workspaces/default/apis/{api}/versions/{v}/definitions/{d} --environment-id /workspaces/default/environments/{e} --deployment-id {dep} --title "updated deployment" --server \'{server}\' --description "deployment description" --custom-properties \'{customProperties}\'', checks=[
self.check('title', 'updated deployment'),
self.check('server.runtimeUri[0]', 'https://example2.com'),
self.check('customProperties.{}'.format(metadata_name), True),
self.check('definitionId', '/workspaces/default/apis/{api}/versions/{v}/definitions/{d}'),
self.check('environmentId', '/workspaces/default/environments/{e}'),
self.check('description', 'deployment description'),
# TODO: Uncomment this line after Control Plane API fixed related bug
# self.check('state', 'active'),
])

@ResourceGroupPreparer(name_prefix="clirg", location='eastus', random_name_length=32)
Expand Down
Loading