Skip to content

Commit

Permalink
Merge pull request #22 from am-lim/amlim/UpdateTo2024-05-01-preview
Browse files Browse the repository at this point in the history
Update to 2024-05-01-preview
  • Loading branch information
am-lim authored May 14, 2024
2 parents 0e1c30e + f7a59cd commit 5ca4b5c
Show file tree
Hide file tree
Showing 161 changed files with 14,950 additions and 2,142 deletions.
129 changes: 129 additions & 0 deletions src/devcenter/azext_devcenter/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,4 +807,133 @@
text: |-
az devcenter dev environment update-expiration-date --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" \
--name "mydevenv" --project-name "DevProject" --user-id "00000000-0000-0000-0000-000000000000" --expiration "2025-11-30T22:35:00+00:00"
"""

helps[
"devcenter dev customization-group"
] = """
type: group
short-summary: Manage customization groups.
"""

helps[
"devcenter dev customization-group create"
] = """
type: command
short-summary: "Create a customization group."
examples:
- name: Create using dev center
text: |-
az devcenter dev customization-group create --dev-center-name "ContosoDevCenter" --project-name "DevProject" \
--dev-box-name "myDevBox" --tasks "[{\\"name\\": \\"catalogName/choco\\", \\"displayName\\": \\"Install VS Code\\", \\"parameters\\": {\\"packageName\\": \\"vscode\
\\", \\"packageVersion\\": \\"1.0.0\\"}}, {\\"name\\": \\"catalogName/write-to-file\\", \\"runAs\\": \\"User\\"}]" --name "Provisioning" --user-id "00000000-0000-0000-0000-000000000000"
- name: Create using endpoint
text: |-
az devcenter dev customization-group create --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" --project-name "DevProject" \
--dev-box-name "myDevBox" --tasks "[{\\"name\\": \\"catalogName/choco\\", \\"displayName\\": \\"Install VS Code\\", \\"parameters\\": {\\"packageName\\": \\"vscode\
\\", \\"packageVersion\\": \\"1.0.0\\"}}, {\\"name\\": \\"catalogName/write-to-file\\", \\"runAs\\": \\"User\\"}]" --name "Provisioning" --user-id "00000000-0000-0000-0000-000000000000"
"""

helps[
"devcenter dev customization-group show"
] = """
type: command
short-summary: "Get a customization group."
examples:
- name: Get using dev center
text: |-
az devcenter dev customization-group show --dev-center-name "ContosoDevCenter" --project-name "DevProject" \
--dev-box-name "myDevBox" --name "Provisioning" --user-id "00000000-0000-0000-0000-000000000000"
- name: Get using endpoint
text: |-
az devcenter dev customization-group show --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" --project-name "DevProject" \
--dev-box-name "myDevBox" --name "Provisioning" --user-id "00000000-0000-0000-0000-000000000000"
"""

helps[
"devcenter dev customization-group list"
] = """
type: command
short-summary: "List customization groups on the dev box"
examples:
- name: List using dev center
text: |-
az devcenter dev customization-group list --dev-center-name "ContosoDevCenter" --project-name "DevProject" \
--dev-box-name "myDevBox" --user-id "00000000-0000-0000-0000-000000000000" --include-tasks
- name: List using endpoint
text: |-
az devcenter dev customization-group list --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" --project-name "DevProject" \
--dev-box-name "myDevBox" --user-id "00000000-0000-0000-0000-000000000000" --include-tasks
"""

helps[
"devcenter dev customization-task"
] = """
type: group
short-summary: Manage customization tasks.
"""

helps[
"devcenter dev customization-task show"
] = """
type: command
short-summary: "Get a customization task."
examples:
- name: Get using dev center
text: |-
az devcenter dev customization-task show --dev-center-name "ContosoDevCenter" --project-name "DevProject" \
--task-name "choco" --catalog-name "myCatalog"
- name: Get using endpoint
text: |-
az devcenter dev customization-task show --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" --project-name "DevProject" \
--task-name "choco" --catalog-name "myCatalog"
"""

helps[
"devcenter dev customization-task list"
] = """
type: command
short-summary: "List customization task."
examples:
- name: List using dev center
text: |-
az devcenter dev customization-task list --dev-center-name "ContosoDevCenter" --project-name "DevProject"
- name: List using endpoint
text: |-
az devcenter dev customization-task list --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" --project-name "DevProject"
"""

helps[
"devcenter dev customization-task validate"
] = """
type: command
short-summary: "Validate customization tasks."
examples:
- name: Validate using dev center
text: |-
az devcenter dev customization-task validate --dev-center-name "ContosoDevCenter" --project-name "DevProject" \
--tasks "[{\\"name\\": \\"catalogName/choco\\", \\"displayName\\": \\"Install VS Code\\", \\"parameters\\": {\\"packageName\\": \\"vscode\
\\", \\"packageVersion\\": \\"1.0.0\\"}}, {\\"name\\": \\"catalogName/write-to-file\\", \\"runAs\\": \\"User\\"}]"
- name: Validate using endpoint
text: |-
az devcenter dev customization-task validate --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" --project-name "DevProject" \
--tasks "[{\\"name\\": \\"catalogName/choco\\", \\"displayName\\": \\"Install VS Code\\", \\"parameters\\": {\\"packageName\\": \\"vscode\
\\", \\"packageVersion\\": \\"1.0.0\\"}}, {\\"name\\": \\"catalogName/write-to-file\\", \\"runAs\\": \\"User\\"}]"
"""

helps[
"devcenter dev customization-task show-logs"
] = """
type: command
short-summary: "Show logs of a customization task."
examples:
- name: Get using dev center
text: |-
az devcenter dev customization-task show-logs --dev-center-name "ContosoDevCenter" --project-name "DevProject" \
--dev-box-name "myDevBox" --customization-group-name "Provisioning" --customization-task-id "91835dc0-ef5a-4f58-9e3a-099aea8481f4" --user-id "00000000-0000-0000-0000-000000000000"
- name: Get using endpoint
text: |-
az devcenter dev customization-task show-logs --endpoint "https://8a40af38-3b4c-4672-a6a4-5e964b1870ed-contosodevcenter.centralus.devcenter.azure.com/" --project-name "DevProject" \
--dev-box-name "myDevBox" --customization-group-name "Provisioning" --customization-task-id "91835dc0-ef5a-4f58-9e3a-099aea8481f4" --user-id "00000000-0000-0000-0000-000000000000"
"""
206 changes: 202 additions & 4 deletions src/devcenter/azext_devcenter/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,9 @@ def load_arguments(self, _):
help="The name " "of the environment.",
)

with self.argument_context("devcenter dev environment create", validator=is_iso8601) as c:
with self.argument_context(
"devcenter dev environment create", validator=is_iso8601
) as c:
c.argument(
"dev_center",
arg_type=dev_center_type,
Expand Down Expand Up @@ -688,7 +690,9 @@ def load_arguments(self, _):
" and associated resources will be deleted. The string format is ISO format.",
)

with self.argument_context("devcenter dev environment update", validator=is_iso8601) as c:
with self.argument_context(
"devcenter dev environment update", validator=is_iso8601
) as c:
c.argument(
"dev_center",
arg_type=dev_center_type,
Expand Down Expand Up @@ -726,7 +730,9 @@ def load_arguments(self, _):
help="The date of environment expiration. Must be an ISO string",
)

with self.argument_context("devcenter dev environment deploy", validator=is_iso8601) as c:
with self.argument_context(
"devcenter dev environment deploy", validator=is_iso8601
) as c:
c.argument(
"dev_center",
arg_type=dev_center_type,
Expand Down Expand Up @@ -1120,7 +1126,9 @@ def load_arguments(self, _):
help="The name " "of the environment.",
)

with self.argument_context("devcenter dev environment update-expiration-date", validator=is_iso8601) as c:
with self.argument_context(
"devcenter dev environment update-expiration-date", validator=is_iso8601
) as c:
c.argument(
"dev_center",
arg_type=dev_center_type,
Expand Down Expand Up @@ -1152,3 +1160,193 @@ def load_arguments(self, _):
help="The time the expiration date will be triggered (UTC), after which the environment "
"and associated resources will be deleted. The string format is ISO format.",
)

with self.argument_context("devcenter dev customization-group create") 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(
"dev_box_name",
options_list=["--dev-box-name", "--dev-box"],
type=str,
help="The name " "of the dev box.",
)
c.argument(
"tasks",
type=validate_file_or_dict,
help="Parameters object for the tasks. Expected "
"value: json-string/json-file/@json-file.",
)
c.argument(
"customization_group_name",
options_list=["--name", "-n", "--customization-group-name"],
type=str,
help="The name of customization group",
)

with self.argument_context("devcenter dev customization-group show") 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(
"dev_box_name",
options_list=["--dev-box-name", "--dev-box"],
type=str,
help="The name " "of the dev box.",
)
c.argument(
"customization_group_name",
options_list=["--name", "-n", "--customization-group-name"],
type=str,
help="The name of customization group",
)

with self.argument_context("devcenter dev customization-group list") 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(
"dev_box_name",
options_list=["--dev-box-name", "--dev-box"],
type=str,
help="The name " "of the dev box.",
)
c.argument(
"include_tasks",
arg_type=get_three_state_flag(),
help="Optional parameter to include task information in the response.",
is_preview=True,
)

with self.argument_context("devcenter dev customization-task show") 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("catalog_name", type=str, help="The name of the catalog")
c.argument("task_name", type=str, help="The name of the task")

with self.argument_context("devcenter dev customization-task list") 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,
)

with self.argument_context("devcenter dev customization-task validate") 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(
"tasks",
type=validate_file_or_dict,
help="Parameters object for the tasks. Expected "
"value: json-string/json-file/@json-file.",
)

with self.argument_context("devcenter dev customization-task show-logs") 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(
"dev_box_name",
options_list=["--dev-box-name", "--dev-box"],
type=str,
help="The name " "of the dev box.",
)
c.argument(
"customization_task_id",
options_list=["--customization-task-id", "--task-id" "-t"],
type=str,
help="The name " "of the dev box.",
)
c.argument(
"customization_group_name",
options_list=["--name", "-n", "--customization-group-name"],
type=str,
help="The name of customization group",
)
Loading

0 comments on commit 5ca4b5c

Please sign in to comment.