Skip to content

Commit

Permalink
Update data plane CLI to 2023-10-01-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
am-lim committed Nov 3, 2023
1 parent 50e26d7 commit 7c2d5d4
Show file tree
Hide file tree
Showing 14 changed files with 10,976 additions and 5,661 deletions.
8 changes: 4 additions & 4 deletions src/devcenter/azext_devcenter/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ def cf_dev_boxes_dp(cli_ctx, dev_center, *_):
return cf_devcenter_dataplane(cli_ctx, dev_center).dev_boxes


def cf_dev_box_operations_dp(cli_ctx, dev_center, *_):
return cf_devcenter_dataplane(cli_ctx, dev_center).dev_box_operations
def cf_project_operations_dp(cli_ctx, dev_center, *_):
return cf_devcenter_dataplane(cli_ctx, dev_center).projects


def cf_environments_dp(cli_ctx, dev_center, *_):
return cf_devcenter_dataplane(cli_ctx, dev_center).environments


def cf_environment_operations_dp(cli_ctx, dev_center, *_):
return cf_devcenter_dataplane(cli_ctx, dev_center).environment_operations
def cf_deployment_environment_operations_dp(cli_ctx, dev_center, *_):
return cf_devcenter_dataplane(cli_ctx, dev_center).deployment_environments

# Control plane

Expand Down
294 changes: 294 additions & 0 deletions src/devcenter/azext_devcenter/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,12 @@ def load_arguments(self, _):
type=str,
help="Name of the environment definition.",
)
c.argument(
"expiration_date",
options_list=["--expiration_date", "--expiration"],
type=str,
help="The date of environment expiration. Must be an ISO string",
)

with self.argument_context("devcenter dev environment update") as c:
c.argument(
Expand Down Expand Up @@ -711,6 +717,12 @@ def load_arguments(self, _):
help="Parameters object for the environment. Expected "
"value: json-string/json-file/@json-file.",
)
c.argument(
"expiration_date",
options_list=["--expiration_date", "--expiration"],
type=str,
help="The date of environment expiration. Must be an ISO string",
)

with self.argument_context("devcenter dev environment deploy") as c:
c.argument(
Expand Down Expand Up @@ -743,6 +755,12 @@ def load_arguments(self, _):
help="Parameters object for the environment. Expected "
"value: json-string/json-file/@json-file.",
)
c.argument(
"expiration_date",
options_list=["--expiration_date", "--expiration"],
type=str,
help="The date of environment expiration. Must be an ISO string",
)

with self.argument_context("devcenter dev environment delete") as c:
c.argument(
Expand Down Expand Up @@ -855,3 +873,279 @@ def load_arguments(self, _):
"endpoint",
arg_type=endpoint,
)

with self.argument_context("devcenter dev environment list-operation") as c:
c.argument(
"dev_center",
arg_type=dev_center_type,
)
c.argument(
"project_name",
arg_type=project_type,
)
c.argument(
"endpoint",
arg_type=endpoint,
)
c.argument(
"user_id",
type=str,
help="The AAD object id of the user. If value is 'me', the identity is taken from the "
"authentication context",
)
c.argument(
"environment_name",
options_list=["--name", "-n", "--environment-name"],
type=str,
help="The name " "of the environment.",
)

with self.argument_context("devcenter dev environment show-operation") as c:
c.argument(
"dev_center",
arg_type=dev_center_type,
)
c.argument(
"project_name",
arg_type=project_type,
)
c.argument(
"endpoint",
arg_type=endpoint,
)
c.argument(
"user_id",
type=str,
help="The AAD object id of the user. If value is 'me', the identity is taken from the "
"authentication context",
)
c.argument(
"environment_name",
options_list=["--name", "-n", "--environment-name"],
type=str,
help="The name " "of the environment.",
)
c.argument(
"operation_id",
options_list=["--operation-id", "-o"],
type=str,
help="The ID " "of the operation.",
)

with self.argument_context("devcenter dev environment show-logs-by-operation") as c:
c.argument(
"dev_center",
arg_type=dev_center_type,
)
c.argument(
"project_name",
arg_type=project_type,
)
c.argument(
"endpoint",
arg_type=endpoint,
)
c.argument(
"user_id",
type=str,
help="The AAD object id of the user. If value is 'me', the identity is taken from the "
"authentication context",
)
c.argument(
"environment_name",
options_list=["--name", "-n", "--environment-name"],
type=str,
help="The name " "of the environment.",
)
c.argument(
"operation_id",
options_list=["--operation-id", "-o"],
type=str,
help="The ID " "of the operation.",
)

with self.argument_context("devcenter dev environment show-action") as c:
c.argument(
"dev_center",
arg_type=dev_center_type,
)
c.argument(
"project_name",
arg_type=project_type,
)
c.argument(
"endpoint",
arg_type=endpoint,
)
c.argument(
"user_id",
type=str,
help="The AAD object id of the user. If value is 'me', the identity is taken from the "
"authentication context",
)
c.argument(
"environment_name",
options_list=["--name", "-n", "--environment-name"],
type=str,
help="The name " "of the environment.",
)
c.argument(
"action_name",
options_list=["--action-name"],
type=str,
help="The name of an action that will take place on an environment.",
)

with self.argument_context("devcenter dev environment skip-action") as c:
c.argument(
"dev_center",
arg_type=dev_center_type,
)
c.argument(
"project_name",
arg_type=project_type,
)
c.argument(
"endpoint",
arg_type=endpoint,
)
c.argument(
"user_id",
type=str,
help="The AAD object id of the user. If value is 'me', the identity is taken from the "
"authentication context",
)
c.argument(
"environment_name",
options_list=["--name", "-n", "--environment-name"],
type=str,
help="The name " "of the environment.",
)
c.argument(
"action_name",
options_list=["--action-name"],
type=str,
help="The name of an action that will take place on an environment.",
)

with self.argument_context("devcenter dev environment list-action") as c:
c.argument(
"dev_center",
arg_type=dev_center_type,
)
c.argument(
"project_name",
arg_type=project_type,
)
c.argument(
"endpoint",
arg_type=endpoint,
)
c.argument(
"user_id",
type=str,
help="The AAD object id of the user. If value is 'me', the identity is taken from the "
"authentication context",
)
c.argument(
"environment_name",
options_list=["--name", "-n", "--environment-name"],
type=str,
help="The name " "of the environment.",
)

with self.argument_context("devcenter dev environment delay-action") as c:
c.argument(
"dev_center",
arg_type=dev_center_type,
)
c.argument(
"project_name",
arg_type=project_type,
)
c.argument(
"endpoint",
arg_type=endpoint,
)
c.argument(
"user_id",
type=str,
help="The AAD object id of the user. If value is 'me', the identity is taken from the "
"authentication context",
)
c.argument(
"environment_name",
options_list=["--name", "-n", "--environment-name"],
type=str,
help="The name " "of the environment.",
)
c.argument(
"action_name",
options_list=["--action-name"],
type=str,
help="The name of an action that will take place on an environment.",
)
c.argument(
"until",
options_list=["--until"],
type=str,
help="The time to delay the environment action until. Must be an ISO string",
)

with self.argument_context("devcenter dev environment show-outputs") as c:
c.argument(
"dev_center",
arg_type=dev_center_type,
)
c.argument(
"project_name",
arg_type=project_type,
)
c.argument(
"endpoint",
arg_type=endpoint,
)
c.argument(
"user_id",
type=str,
help="The AAD object id of the user. If value is 'me', the identity is taken from the "
"authentication context",
)
c.argument(
"environment_name",
options_list=["--name", "-n", "--environment-name"],
type=str,
help="The name " "of the environment.",
)

with self.argument_context("devcenter dev environment update-environment-expiration-date") as c:
c.argument(
"dev_center",
arg_type=dev_center_type,
)
c.argument(
"project_name",
arg_type=project_type,
)
c.argument(
"endpoint",
arg_type=endpoint,
)
c.argument(
"user_id",
type=str,
help="The AAD object id of the user. If value is 'me', the identity is taken from the "
"authentication context",
)
c.argument(
"environment_name",
options_list=["--name", "-n", "--environment-name"],
type=str,
help="The name " "of the environment.",
)
c.argument(
"expiration_date",
options_list=["--expiration_date", "--expiration"],
type=str,
help="The date of environment expiration. Must be an ISO string",
)
9 changes: 9 additions & 0 deletions src/devcenter/azext_devcenter/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,15 @@ def load_command_table(self, _):
supports_no_wait=True,
confirmation=True,
)
g.custom_command("list-operation", "devcenter_environment_operation_list")
g.custom_command("show-operation", "devcenter_environment_operation_show")
g.custom_command("show-logs-by-operation", "devcenter_environment_operation_show_logs_by_operation")
g.custom_command("show-action", "devcenter_environment_operation_show_action")
g.custom_command("list-action", "devcenter_environment_operation_list_action")
g.custom_command("delay-action", "devcenter_environment_operation_delay_action")
g.custom_command("skip-action", "devcenter_environment_operation_skip_action")
g.custom_command("show-outputs", "devcenter_environment_operation_show_outputs")
g.custom_command("update-environment-expiration-date", "devcenter_environment_operation_update_environment")

with self.command_group("devcenter dev catalog", environments_dp) as g:
g.custom_command("list", "devcenter_catalog_list_dp")
Expand Down
Loading

0 comments on commit 7c2d5d4

Please sign in to comment.