From 3bfe1ce12aab2b3c049af57f41261792dae55dd4 Mon Sep 17 00:00:00 2001 From: Sean Hobbs Date: Tue, 14 Nov 2023 09:47:11 -0800 Subject: [PATCH 01/11] updated fleet help text --- src/fleet/azext_fleet/_help.py | 84 +++++++++++++++++++++++++++++----- 1 file changed, 72 insertions(+), 12 deletions(-) diff --git a/src/fleet/azext_fleet/_help.py b/src/fleet/azext_fleet/_help.py index 8e9ec948b6a..5d6ce52e910 100644 --- a/src/fleet/azext_fleet/_help.py +++ b/src/fleet/azext_fleet/_help.py @@ -21,43 +21,55 @@ short-summary: Prefix for hostnames that are created. If not specified, generate a hostname using the managed cluster and resource group names. examples: - - name: Create a hubless fleet - text: az fleet create -g MyResourceGroup -l MyLocation -n MyFleetName --tags "TagKey=TagValue" - - name: Create a hubful fleet - text: az fleet create -g MyResourceGroup -l MyLocation -n MyFleetName --enable-hub --tags "TagKey=TagValue" - + - name: Create a hubless fleet. + text: az fleet create -g MyFleetResourceGroup -l MyLocation -n MyFleetName --tags "TagKey=TagValue" + - name: Create a hubful fleet. + text: az fleet create -g MyFleetResourceGroup -l MyLocation -n MyFleetName --enable-hub --tags "TagKey=TagValue" + - name: Create a fleet with a system assigned Managed Service Identity. + text: az fleet create -g MyFleetResourceGroup -l MyLocation -n MyFleetName --enable-managed-identity + - name: Create a fleet with a user provided Managed Service Identity. + text: az fleet create -g MyFleetResourceGroup -l MyLocation -n MyFleetName --enable-managed-identity --assign-identity "/subscription/00000000-0000-0000-0000-000000000000/resourcegroup/MyFleetResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyIdentity" """ helps['fleet update'] = """ type: command short-summary: Patches a fleet resource. examples: - - name: Update a Fleet's tags - text: az fleet update -g MyResourceGroup -n MyFleetName --tags Key=Value + - name: Update a Fleet's tags. + text: az fleet update -g MyFleetResourceGroup -n MyFleetName --tags Key=Value - name: Update a Fleet to use a system assigned managed service identity. - text: az fleet update -g MyResourceGroup -n MyFleetName --enable-managed-identity --tags Key=Value + text: az fleet update -g MyFleetResourceGroup -n MyFleetName --enable-managed-identity --tags Key=Value - name: Update a Fleet to use a user assigned managed service identity. - text: az fleet update -g MyResourceGroup -n MyFleetName --enable-managed-identity --assign-identity "/subscription/00000000-0000-0000-0000-000000000000/resourcegroup/MyResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyIdentity" --tags Key=Value + text: az fleet update -g MyFleetResourceGroup -n MyFleetName --enable-managed-identity --assign-identity "/subscription/00000000-0000-0000-0000-000000000000/resourcegroup/MyFleetResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyIdentity" --tags Key=Value """ helps['fleet show'] = """ type: command short-summary: Gets a Fleet. + examples: + - name: Show the details of a fleet. + text: az fleet show -g MyFleetResourceGroup -f MyFleetName """ helps['fleet list'] = """ type: command - short-summary: Lists fleets in the specified subscription and resource group. + short-summary: Lists all fleets within a resource group. + examples: + - name: List all fleets that exist within a specific subscription and resource group. + text: az fleet list -g MyResourceGroup """ helps['fleet delete'] = """ type: command short-summary: Deletes a Fleet. + examples: + - name: Delete a specific fleet. + text: az fleet delete -g MyFleetResourceGroup -f MyFleetName """ helps['fleet get-credentials'] = """ type: command - short-summary: Lists the user credentials of a Fleet. + short-summary: For hubful fleets, gets the kubeconfig for the fleet's hub cluster. parameters: - name: --overwrite-existing type: bool @@ -65,6 +77,11 @@ - name: --file -f type: string short-summary: Kubernetes configuration file to update. Use "-" to print YAML to stdout instead. + examples: + - name: Get a Fleet's hub cluster kubeconfig. + text: az fleet get-credentials -g MyFleetResourceGroup -n MyFleetName + - name: Get a Fleet's hub cluster kubeconfig, and save it to a specific file. + text: az fleet get-credentials -g MyFleetResourceGroup -n MyFleetName -f ~/mykubeconfigfile.txt """ helps['fleet wait'] = """ @@ -88,6 +105,9 @@ - name: --update-group type: string short-summary: Group of the fleet member. + examples: + - name: Create a fleet member and assign it to a specific update group. + text: az fleet member create -g MyFleetResourceGroup -f MyFleetName -n NameOfMember --update-group UpdateGroup1 --member-cluster-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyFleetResourceGroup/providers/Microsoft.ContainerService/managedClusters/MyManagedCluster" """ helps['fleet member update'] = """ @@ -97,21 +117,33 @@ - name: --update-group type: string short-summary: Group of the fleet member. + examples: + - name: Update an existing member's update group. + text: az fleet member update -g MyFleetResourceGroup -f MyFleetName -n NameOfMember --update-group UpdateGroup2" """ helps['fleet member list'] = """ type: command short-summary: Lists the members of a fleet. + examples: + - name: List all members for a given fleet. + text: az fleet member list -g MyFleetResourceGroup -n MyFleetName """ helps['fleet member show'] = """ type: command - short-summary: Gets a Fleet member. + short-summary: Gets a fleet member. + examples: + - name: Show the details of a specific fleet member. + text: az fleet member show -g MyFleetResourceGroup -f MyFleetName -n NameOfMember """ helps['fleet member delete'] = """ type: command short-summary: Deletes a fleet member. + examples: + - name: Delete a specific fleet member + text: az fleet member delete -g MyFleetResourceGroup -f MyFleetName -n NameOfMember """ helps['fleet member wait'] = """ @@ -187,26 +219,42 @@ helps['fleet updaterun show'] = """ type: command short-summary: Shows a fleet update run. + examples: + - name: Show the details of a specific updaterun + text: az fleet updaterun show -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun """ helps['fleet updaterun list'] = """ type: command short-summary: Lists the update runs of a fleet. + examples: + - name: Show the details of a specific updaterun + text: az fleet updaterun show -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun """ helps['fleet updaterun delete'] = """ type: command short-summary: Deletes a fleet update run. + examples: + - name: Delete a specific updaterun. + text: az fleet updaterun delete -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun """ helps['fleet updaterun start'] = """ type: command short-summary: Starts a fleet update run. + examples: + - name: Starts an updaterun + text: az fleet updaterun start -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun """ helps['fleet updaterun stop'] = """ type: command short-summary: Stops a fleet update run. + examples: + - name: Stops an updaterun + text: az fleet updaterun stop -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun + """ helps['fleet updaterun wait'] = """ @@ -227,21 +275,33 @@ - name: --stages type: string short-summary: Path to a json file that defines the update strategy. + examples: + - name: Create an updatestrategy from a JSON file. + text: az fleet updatestrategy create -g MyFleetResourceGroup -f MyFleetName -n MyUpdateStrategy --stages MyUpdateStrategyFile.json """ helps['fleet updatestrategy show'] = """ type: command short-summary: Shows a update strategy. + examples: + - name: Show the details of a specific updatestrategy. + text: az fleet updatestrategy show -g MyFleetResourceGroup -f MyFleetName -n MyUpdateStrategy """ helps['fleet updatestrategy list'] = """ type: command short-summary: Lists the fleet's update strategies. + examples: + - name: List all updatestratgies for a given fleet. + text: az fleet updatestrategy list -g MyFleetResourceGroup -f MyFleetName """ helps['fleet updatestrategy delete'] = """ type: command short-summary: Deletes a update strategy. + examples: + - name: Delete a specific updatestrategy. + text: az fleet updatestrategy delete -g MyFleetResourceGroup -f MyFleetName -n MyUpdateStrategy """ helps['fleet updatestrategy wait'] = """ From e1815155cde6219797d440bfe2cdd11e99d21185 Mon Sep 17 00:00:00 2001 From: Sean Hobbs Date: Tue, 14 Nov 2023 09:48:49 -0800 Subject: [PATCH 02/11] bumped version --- src/fleet/HISTORY.rst | 6 +++++- src/fleet/setup.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fleet/HISTORY.rst b/src/fleet/HISTORY.rst index fcd4c8bdb75..5d243791d7b 100644 --- a/src/fleet/HISTORY.rst +++ b/src/fleet/HISTORY.rst @@ -59,4 +59,8 @@ Release History 1.0.0 ++++++ * Promoted extension to GA. -* Added `az fleet create` preview parameter `vm-size` for Hubful fleets. \ No newline at end of file +* Added `az fleet create` preview parameter `vm-size` for Hubful fleets. + +1.0.1 +++++++ +* Updated help examples. \ No newline at end of file diff --git a/src/fleet/setup.py b/src/fleet/setup.py index 02b13a9f0c1..d6153c6c39a 100644 --- a/src/fleet/setup.py +++ b/src/fleet/setup.py @@ -16,7 +16,7 @@ # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '1.0.0' +VERSION = '1.0.1' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From 6a986295b85ae5da3f19041a4db7cf0ad243a214 Mon Sep 17 00:00:00 2001 From: Sean Hobbs Date: Tue, 14 Nov 2023 10:10:05 -0800 Subject: [PATCH 03/11] help text fix --- src/fleet/azext_fleet/_help.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fleet/azext_fleet/_help.py b/src/fleet/azext_fleet/_help.py index 5d6ce52e910..aebfb2b93f2 100644 --- a/src/fleet/azext_fleet/_help.py +++ b/src/fleet/azext_fleet/_help.py @@ -48,7 +48,7 @@ short-summary: Gets a Fleet. examples: - name: Show the details of a fleet. - text: az fleet show -g MyFleetResourceGroup -f MyFleetName + text: az fleet show -g MyFleetResourceGroup -n MyFleetName """ helps['fleet list'] = """ @@ -64,7 +64,7 @@ short-summary: Deletes a Fleet. examples: - name: Delete a specific fleet. - text: az fleet delete -g MyFleetResourceGroup -f MyFleetName + text: az fleet delete -g MyFleetResourceGroup -n MyFleetName """ helps['fleet get-credentials'] = """ @@ -119,7 +119,7 @@ short-summary: Group of the fleet member. examples: - name: Update an existing member's update group. - text: az fleet member update -g MyFleetResourceGroup -f MyFleetName -n NameOfMember --update-group UpdateGroup2" + text: az fleet member update -g MyFleetResourceGroup -f MyFleetName -n NameOfMember --update-group UpdateGroup2 """ helps['fleet member list'] = """ @@ -127,7 +127,7 @@ short-summary: Lists the members of a fleet. examples: - name: List all members for a given fleet. - text: az fleet member list -g MyFleetResourceGroup -n MyFleetName + text: az fleet member list -g MyFleetResourceGroup -f MyFleetName """ helps['fleet member show'] = """ @@ -229,7 +229,7 @@ short-summary: Lists the update runs of a fleet. examples: - name: Show the details of a specific updaterun - text: az fleet updaterun show -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun + text: az fleet updaterun list -g MyFleetResourceGroup -f MyFleetName """ helps['fleet updaterun delete'] = """ From ad1b59047b75f000be3367ac4b834e4147f5234f Mon Sep 17 00:00:00 2001 From: Sean Hobbs Date: Tue, 14 Nov 2023 10:47:01 -0800 Subject: [PATCH 04/11] white space --- src/fleet/azext_fleet/_help.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fleet/azext_fleet/_help.py b/src/fleet/azext_fleet/_help.py index aebfb2b93f2..680ffaf6edd 100644 --- a/src/fleet/azext_fleet/_help.py +++ b/src/fleet/azext_fleet/_help.py @@ -78,7 +78,7 @@ type: string short-summary: Kubernetes configuration file to update. Use "-" to print YAML to stdout instead. examples: - - name: Get a Fleet's hub cluster kubeconfig. + - name: Get a Fleet's hub cluster kubeconfig. text: az fleet get-credentials -g MyFleetResourceGroup -n MyFleetName - name: Get a Fleet's hub cluster kubeconfig, and save it to a specific file. text: az fleet get-credentials -g MyFleetResourceGroup -n MyFleetName -f ~/mykubeconfigfile.txt @@ -254,7 +254,7 @@ examples: - name: Stops an updaterun text: az fleet updaterun stop -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun - + """ helps['fleet updaterun wait'] = """ From 2a843d44e6043623746a34af7437fe9dc716e588 Mon Sep 17 00:00:00 2001 From: Sean Hobbs Date: Tue, 14 Nov 2023 22:58:15 -0800 Subject: [PATCH 05/11] More help text updates. --- src/fleet/azext_fleet/_help.py | 112 +++++++++++++++++---------------- 1 file changed, 57 insertions(+), 55 deletions(-) diff --git a/src/fleet/azext_fleet/_help.py b/src/fleet/azext_fleet/_help.py index 680ffaf6edd..aba105384cb 100644 --- a/src/fleet/azext_fleet/_help.py +++ b/src/fleet/azext_fleet/_help.py @@ -14,20 +14,20 @@ helps['fleet create'] = """ type: command - short-summary: Creates or updates a Fleet. + short-summary: Creates or updates a fleet. parameters: - name: --dns-name-prefix -p type: string - short-summary: Prefix for hostnames that are created. If not specified, generate a hostname using the + short-summary: Prefix for host names that are created. If not specified, generate a host name using the managed cluster and resource group names. examples: - name: Create a hubless fleet. text: az fleet create -g MyFleetResourceGroup -l MyLocation -n MyFleetName --tags "TagKey=TagValue" - name: Create a hubful fleet. text: az fleet create -g MyFleetResourceGroup -l MyLocation -n MyFleetName --enable-hub --tags "TagKey=TagValue" - - name: Create a fleet with a system assigned Managed Service Identity. + - name: Create a fleet with a system assigned managed service identity. text: az fleet create -g MyFleetResourceGroup -l MyLocation -n MyFleetName --enable-managed-identity - - name: Create a fleet with a user provided Managed Service Identity. + - name: Create a fleet with a user provided managed service identity. text: az fleet create -g MyFleetResourceGroup -l MyLocation -n MyFleetName --enable-managed-identity --assign-identity "/subscription/00000000-0000-0000-0000-000000000000/resourcegroup/MyFleetResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyIdentity" """ @@ -35,17 +35,17 @@ type: command short-summary: Patches a fleet resource. examples: - - name: Update a Fleet's tags. + - name: Update a fleet's tags. text: az fleet update -g MyFleetResourceGroup -n MyFleetName --tags Key=Value - - name: Update a Fleet to use a system assigned managed service identity. + - name: Update a fleet to use a system assigned managed service identity. text: az fleet update -g MyFleetResourceGroup -n MyFleetName --enable-managed-identity --tags Key=Value - - name: Update a Fleet to use a user assigned managed service identity. + - name: Update a fleet to use a user assigned managed service identity. text: az fleet update -g MyFleetResourceGroup -n MyFleetName --enable-managed-identity --assign-identity "/subscription/00000000-0000-0000-0000-000000000000/resourcegroup/MyFleetResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/MyIdentity" --tags Key=Value """ helps['fleet show'] = """ type: command - short-summary: Gets a Fleet. + short-summary: Gets a fleet. examples: - name: Show the details of a fleet. text: az fleet show -g MyFleetResourceGroup -n MyFleetName @@ -55,13 +55,13 @@ type: command short-summary: Lists all fleets within a resource group. examples: - - name: List all fleets that exist within a specific subscription and resource group. + - name: List all fleets that exist within a resource group. text: az fleet list -g MyResourceGroup """ helps['fleet delete'] = """ type: command - short-summary: Deletes a Fleet. + short-summary: Deletes a fleet. examples: - name: Delete a specific fleet. text: az fleet delete -g MyFleetResourceGroup -n MyFleetName @@ -78,9 +78,9 @@ type: string short-summary: Kubernetes configuration file to update. Use "-" to print YAML to stdout instead. examples: - - name: Get a Fleet's hub cluster kubeconfig. + - name: Get a fleet's hub cluster kubeconfig. text: az fleet get-credentials -g MyFleetResourceGroup -n MyFleetName - - name: Get a Fleet's hub cluster kubeconfig, and save it to a specific file. + - name: Get a fleet's hub cluster kubeconfig, and save it to a specific file. text: az fleet get-credentials -g MyFleetResourceGroup -n MyFleetName -f ~/mykubeconfigfile.txt """ @@ -92,31 +92,31 @@ helps['fleet member'] = """ type: group - short-summary: Commands to manage a fleet member. + short-summary: Commands to manage members. """ helps['fleet member create'] = """ type: command - short-summary: Creates or updates a fleet member. + short-summary: Creates or updates a member. parameters: - name: --member-cluster-id type: string short-summary: ID of the managed cluster. - name: --update-group type: string - short-summary: Group of the fleet member. + short-summary: Update group of the member. examples: - - name: Create a fleet member and assign it to a specific update group. + - name: Create a member and assign it to an update group. text: az fleet member create -g MyFleetResourceGroup -f MyFleetName -n NameOfMember --update-group UpdateGroup1 --member-cluster-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyFleetResourceGroup/providers/Microsoft.ContainerService/managedClusters/MyManagedCluster" """ helps['fleet member update'] = """ type: command - short-summary: Update a fleet member. + short-summary: Update a member. parameters: - name: --update-group type: string - short-summary: Group of the fleet member. + short-summary: Update group of the member. examples: - name: Update an existing member's update group. text: az fleet member update -g MyFleetResourceGroup -f MyFleetName -n NameOfMember --update-group UpdateGroup2 @@ -124,7 +124,7 @@ helps['fleet member list'] = """ type: command - short-summary: Lists the members of a fleet. + short-summary: Lists a fleet's members. examples: - name: List all members for a given fleet. text: az fleet member list -g MyFleetResourceGroup -f MyFleetName @@ -142,45 +142,47 @@ type: command short-summary: Deletes a fleet member. examples: - - name: Delete a specific fleet member + - name: Delete a specific fleet member. text: az fleet member delete -g MyFleetResourceGroup -f MyFleetName -n NameOfMember """ helps['fleet member wait'] = """ type: command - short-summary: Wait for a fleet member resource to reach a desired state. - long-summary: If an operation on fleet member was interrupted or was started with `--no-wait`, use this command to wait for it to complete. + short-summary: Wait for a member resource to reach a desired state. + long-summary: If an operation on member was interrupted or was started with `--no-wait`, use this command to wait for it to complete. """ helps['fleet updaterun'] = """ type: group - short-summary: Commands to manage a fleet update run. + short-summary: Commands to manage update runs. """ helps['fleet updaterun create'] = """ type: command - short-summary: Creates or updates a fleet update run. + short-summary: Creates or updates an update run. parameters: - name: --upgrade-type type: string - short-summary: Specify the upgrade type of fleet members. Acceptable values are 'Full' and 'NodeImageOnly'. + short-summary: Specify the upgrade type of members. Acceptable values are 'Full' and 'NodeImageOnly'. - name: --kubernetes-version type: string - short-summary: Specify the kubernetes version to upgrade fleet member(s) to, when --upgrade-type is set to 'Full'. Acceptable format is x.x.x (eg. 1.2.3). + short-summary: Specify the kubernetes version to upgrade member(s) to, when --upgrade-type is set to 'Full'. Acceptable format is x.x.x (eg. 1.2.3). - name: --stages type: string - short-summary: Path to a json file that defines stages to upgrade a fleet. See examples for further reference. + short-summary: Path to a JSON file that defines stages to upgrade a fleet. See examples for reference. examples: - - name: Create updaterun for a fleet with 'Full' upgrade type. + - name: Create an update run for a fleet with 'Full' upgrade type. text: az fleet updaterun create -g MyResourceGroup -f MyFleet -n MyUpdateRun --upgrade-type Full --kubernetes-version 1.25.0 --node-image-selection Latest - - name: Create updaterun for a fleet with 'NodeImageOnly' upgrade type. + - name: Create an update run for a fleet with 'NodeImageOnly' upgrade type. text: az fleet updaterun create -g MyResourceGroup -f MyFleet -n MyUpdateRun --upgrade-type NodeImageOnly --node-image-selection Latest - - name: Create updaterun for a fleet with 'Full' upgrade type & stages. + - name: Create an update run for a fleet with 'Full' upgrade type & stages. text: | az fleet updaterun create -g MyResourceGroup -f MyFleet -n MyUpdateRun --upgrade-type Full --kubernetes-version 1.25.0 --node-image-selection Latest --stages ./test/stages.json - A sample json to demonstrate the expected format. It takes a stages array. Each stage consists of the stage name, groups array and an optional afterStageWaitInSeconds integer. - Within groups, each group consists of group name, given to a fleet's member(s). + The following JSON structure represents example contents of the parameter '--stages ./test/stages.json'. + A stages array is composed of one or more stages, each containing one or more groups. + Each group contains the 'name' property, which represents the group to which a cluster belongs (see 'az fleet member create --help'). + Stages have an optional 'afterStageWaitInSeconds' integer property, acting as a delay between stage execution. { "stages": [ { @@ -218,73 +220,73 @@ helps['fleet updaterun show'] = """ type: command - short-summary: Shows a fleet update run. + short-summary: Shows an update run. examples: - - name: Show the details of a specific updaterun + - name: Show the details of an update run. text: az fleet updaterun show -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun """ helps['fleet updaterun list'] = """ type: command - short-summary: Lists the update runs of a fleet. + short-summary: Lists a fleet's update runs. examples: - - name: Show the details of a specific updaterun + - name: Show the details of an update run. text: az fleet updaterun list -g MyFleetResourceGroup -f MyFleetName """ helps['fleet updaterun delete'] = """ type: command - short-summary: Deletes a fleet update run. + short-summary: Deletes an update run. examples: - - name: Delete a specific updaterun. + - name: Delete an update run. text: az fleet updaterun delete -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun """ helps['fleet updaterun start'] = """ type: command - short-summary: Starts a fleet update run. + short-summary: Starts an update run. examples: - - name: Starts an updaterun + - name: Start an update run. text: az fleet updaterun start -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun """ helps['fleet updaterun stop'] = """ type: command - short-summary: Stops a fleet update run. + short-summary: Stops an update run. examples: - - name: Stops an updaterun + - name: Stop an update run. text: az fleet updaterun stop -g MyFleetResourceGroup -f MyFleetName -n NameofUpdateRun """ helps['fleet updaterun wait'] = """ type: command - short-summary: Wait for a fleet updateraun resource to reach a desired state. - long-summary: If an operation on fleet updateraun was interrupted or was started with `--no-wait`, use this command to wait for it to complete. + short-summary: Wait for an update run resource to reach a desired state. + long-summary: If an operation on an update run was interrupted or was started with `--no-wait`, use this command to wait for it to complete. """ helps['fleet updatestrategy'] = """ type: group - short-summary: Commands to manage a fleet update strategy. + short-summary: Commands to manage update strategies. """ helps['fleet updatestrategy create'] = """ type: command - short-summary: Creates or updates a update strategy + short-summary: Creates or updates an update strategy. parameters: - name: --stages type: string - short-summary: Path to a json file that defines the update strategy. + short-summary: Path to a JSON file that defines the update strategy. examples: - - name: Create an updatestrategy from a JSON file. + - name: Create an update strategy from a JSON file. text: az fleet updatestrategy create -g MyFleetResourceGroup -f MyFleetName -n MyUpdateStrategy --stages MyUpdateStrategyFile.json """ helps['fleet updatestrategy show'] = """ type: command - short-summary: Shows a update strategy. + short-summary: Shows an update strategy. examples: - - name: Show the details of a specific updatestrategy. + - name: Show the details of an update strategy. text: az fleet updatestrategy show -g MyFleetResourceGroup -f MyFleetName -n MyUpdateStrategy """ @@ -292,7 +294,7 @@ type: command short-summary: Lists the fleet's update strategies. examples: - - name: List all updatestratgies for a given fleet. + - name: List all update strategies for a given fleet. text: az fleet updatestrategy list -g MyFleetResourceGroup -f MyFleetName """ @@ -300,12 +302,12 @@ type: command short-summary: Deletes a update strategy. examples: - - name: Delete a specific updatestrategy. + - name: Delete an update strategy. text: az fleet updatestrategy delete -g MyFleetResourceGroup -f MyFleetName -n MyUpdateStrategy """ helps['fleet updatestrategy wait'] = """ type: command - short-summary: Wait for a fleet updatestrategy resource to reach a desired state. - long-summary: If an operation on fleet updatestrategy was interrupted or was started with `--no-wait`, use this command to wait for it to complete. -""" + short-summary: Wait for a update strategy resource to reach a desired state. + long-summary: If an operation on an update strategy was interrupted or was started with `--no-wait`, use this command to wait for it to complete. +""" \ No newline at end of file From ac4870db9cca185c84479dc0a8cc4837c8049234 Mon Sep 17 00:00:00 2001 From: Sean Hobbs Date: Tue, 14 Nov 2023 23:19:55 -0800 Subject: [PATCH 06/11] fleet list example +1 --- src/fleet/azext_fleet/_help.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fleet/azext_fleet/_help.py b/src/fleet/azext_fleet/_help.py index aba105384cb..b50c2a34f75 100644 --- a/src/fleet/azext_fleet/_help.py +++ b/src/fleet/azext_fleet/_help.py @@ -55,7 +55,9 @@ type: command short-summary: Lists all fleets within a resource group. examples: - - name: List all fleets that exist within a resource group. + - name: List all fleets with a specific subscription. + text: az fleet list + - name: List all fleets that exist within a specific subscription and resource group. text: az fleet list -g MyResourceGroup """ From 480a49d2eeed2e0d267237b10ba07374ec85ab75 Mon Sep 17 00:00:00 2001 From: Sean Hobbs Date: Wed, 15 Nov 2023 07:27:10 -0800 Subject: [PATCH 07/11] lint --- src/fleet/azext_fleet/_help.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fleet/azext_fleet/_help.py b/src/fleet/azext_fleet/_help.py index b50c2a34f75..de244e31cf8 100644 --- a/src/fleet/azext_fleet/_help.py +++ b/src/fleet/azext_fleet/_help.py @@ -182,7 +182,7 @@ az fleet updaterun create -g MyResourceGroup -f MyFleet -n MyUpdateRun --upgrade-type Full --kubernetes-version 1.25.0 --node-image-selection Latest --stages ./test/stages.json The following JSON structure represents example contents of the parameter '--stages ./test/stages.json'. - A stages array is composed of one or more stages, each containing one or more groups. + A stages array is composed of one or more stages, each containing one or more groups. Each group contains the 'name' property, which represents the group to which a cluster belongs (see 'az fleet member create --help'). Stages have an optional 'afterStageWaitInSeconds' integer property, acting as a delay between stage execution. { @@ -312,4 +312,4 @@ type: command short-summary: Wait for a update strategy resource to reach a desired state. long-summary: If an operation on an update strategy was interrupted or was started with `--no-wait`, use this command to wait for it to complete. -""" \ No newline at end of file +""" From 81acd612dbcdca657508172b68a1ba6c3f9a61a9 Mon Sep 17 00:00:00 2001 From: Sean Hobbs Date: Wed, 15 Nov 2023 08:39:32 -0800 Subject: [PATCH 08/11] test recording update --- .../latest/recordings/test_fleet_hubful.yaml | 16 ++++++++-------- .../latest/recordings/test_fleet_hubless.yaml | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/fleet/azext_fleet/tests/latest/recordings/test_fleet_hubful.yaml b/src/fleet/azext_fleet/tests/latest/recordings/test_fleet_hubful.yaml index de607076f6d..3dc7e3abc67 100644 --- a/src/fleet/azext_fleet/tests/latest/recordings/test_fleet_hubful.yaml +++ b/src/fleet/azext_fleet/tests/latest/recordings/test_fleet_hubful.yaml @@ -673,7 +673,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.ContainerService/managedClusters/flmc-000003'' @@ -784,7 +784,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003\",\n @@ -1291,7 +1291,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003\",\n @@ -1759,7 +1759,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003\",\n @@ -1852,7 +1852,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003\",\n @@ -1945,7 +1945,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003\",\n @@ -2038,7 +2038,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003\",\n @@ -2131,7 +2131,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003\",\n diff --git a/src/fleet/azext_fleet/tests/latest/recordings/test_fleet_hubless.yaml b/src/fleet/azext_fleet/tests/latest/recordings/test_fleet_hubless.yaml index 0139717dbdb..141a95aae5a 100644 --- a/src/fleet/azext_fleet/tests/latest/recordings/test_fleet_hubless.yaml +++ b/src/fleet/azext_fleet/tests/latest/recordings/test_fleet_hubless.yaml @@ -490,7 +490,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.ContainerService/managedClusters/flmc-000003'' @@ -601,7 +601,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003\",\n @@ -1246,7 +1246,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003\",\n @@ -1718,7 +1718,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003\",\n @@ -1811,7 +1811,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003\",\n @@ -1904,7 +1904,7 @@ interactions: - AZURECLI/2.53.0 azsdk-python-azure-mgmt-containerservice/25.0.0b Python/3.10.12 (Linux-6.2.0-1012-azure-x86_64-with-glibc2.35) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-07-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003?api-version=2023-08-01 response: body: string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli-000001/providers/Microsoft.ContainerService/managedClusters/flmc-000003\",\n From 20ba6b3b2c745a0f058cd3ef586b7dec16bfd664 Mon Sep 17 00:00:00 2001 From: pdaru Date: Wed, 15 Nov 2023 22:15:16 +0000 Subject: [PATCH 09/11] bug fix: return response instead of exception --- src/fleet/azext_fleet/custom.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/fleet/azext_fleet/custom.py b/src/fleet/azext_fleet/custom.py index 76596ecd00c..f7a44d97a8c 100644 --- a/src/fleet/azext_fleet/custom.py +++ b/src/fleet/azext_fleet/custom.py @@ -333,14 +333,9 @@ def create_update_run(cmd, strategy=update_run_strategy, managed_cluster_update=managed_cluster_update) - result = None - try: - result = sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name, fleet_name, name, update_run) - print("After successfully creating the run, you need to use the following command to start the run:" + result = sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name, fleet_name, name, update_run) + print("After successfully creating the run, you need to use the following command to start the run:" f"az fleet updaterun start --resource-group={resource_group_name} --fleet={fleet_name} --name={name}") - except Exception as e: - return e - return result From aa795a18b6ca996d3455bd3b20691ec17a6db8df Mon Sep 17 00:00:00 2001 From: Sean Hobbs Date: Wed, 15 Nov 2023 14:19:31 -0800 Subject: [PATCH 10/11] updated version notes --- src/fleet/HISTORY.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fleet/HISTORY.rst b/src/fleet/HISTORY.rst index 5d243791d7b..6489cc99f1f 100644 --- a/src/fleet/HISTORY.rst +++ b/src/fleet/HISTORY.rst @@ -63,4 +63,5 @@ Release History 1.0.1 ++++++ -* Updated help examples. \ No newline at end of file +* Updated help examples. +* Fixed serialization bug. \ No newline at end of file From 60040f4c58e21e17d98c5cee7ffe173765a5ff04 Mon Sep 17 00:00:00 2001 From: Sean Hobbs Date: Wed, 15 Nov 2023 16:53:39 -0800 Subject: [PATCH 11/11] lint fixes --- src/fleet/azext_fleet/custom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fleet/azext_fleet/custom.py b/src/fleet/azext_fleet/custom.py index f7a44d97a8c..c1b45fcea95 100644 --- a/src/fleet/azext_fleet/custom.py +++ b/src/fleet/azext_fleet/custom.py @@ -333,9 +333,9 @@ def create_update_run(cmd, strategy=update_run_strategy, managed_cluster_update=managed_cluster_update) - result = sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name, fleet_name, name, update_run) + result = sdk_no_wait(no_wait, client.begin_create_or_update, resource_group_name, fleet_name, name, update_run) print("After successfully creating the run, you need to use the following command to start the run:" - f"az fleet updaterun start --resource-group={resource_group_name} --fleet={fleet_name} --name={name}") + f"az fleet updaterun start --resource-group={resource_group_name} --fleet={fleet_name} --name={name}") return result