Skip to content
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
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Azure CLI Debug (Integrated Console)",
"type": "python",
"request": "launch",
"pythonPath": "${command:python.interpreterPath}",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/src/azure-cli/azure/cli/__main__.py",
"cwd": "${workspaceRoot}",
"args": [
Expand All @@ -24,7 +24,7 @@
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${command:python.interpreterPath}",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/src/azure-cli/azure/cli/__main__.py",
"cwd": "${workspaceRoot}",
"args": [
Expand All @@ -40,7 +40,7 @@
"name": "Azdev Scripts",
"type": "python",
"request": "launch",
"pythonPath": "${command:python.interpreterPath}",
"python": "${command:python.interpreterPath}",
"program": "${workspaceRoot}/tools/automation/__main__.py",
"cwd": "${workspaceRoot}",
"args": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,31 @@ def network_client_factory(cli_ctx, **_):
from azure.cli.core.profiles import ResourceType
from azure.cli.core.commands.client_factory import get_mgmt_service_client
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_NETWORK)


# Managed clusters

def servicefabric_managed_client_factory(cli_ctx, **_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.mgmt.servicefabricmanagedclusters import ServiceFabricManagedClustersManagementClient
return get_mgmt_service_client(cli_ctx, ServiceFabricManagedClustersManagementClient)


def servicefabric_managed_client_factory_all(cli_ctx, kwargs):
return servicefabric_managed_client_factory(cli_ctx, **kwargs)


def servicefabric_managed_application_type_client_factory(cli_ctx, kwargs):
return servicefabric_managed_client_factory(cli_ctx, **kwargs).application_types


def servicefabric_managed_application_type_version_client_factory(cli_ctx, kwargs):
return servicefabric_managed_client_factory(cli_ctx, **kwargs).application_type_versions


def servicefabric_managed_application_client_factory(cli_ctx, kwargs):
return servicefabric_managed_client_factory(cli_ctx, **kwargs).applications


def servicefabric_managed_service_client_factory(cli_ctx, kwargs):
return servicefabric_managed_client_factory(cli_ctx, **kwargs).services
311 changes: 311 additions & 0 deletions src/azure-cli/azure/cli/command_modules/servicefabric/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,3 +620,314 @@
text: >
az sf managed-node-type vm-secret add -g testRG -c testCluster -n snt --source-vault-id /subscriptions/XXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/resourceGroups/testRG/providers/Microsoft.KeyVault/vaults/testkv --certificate-url https://testskv.vault.azure.net:443/secrets/TestCert/xxxxxxxxxxxxxxxxxxxxxxxx --certificate-store my
"""

helps['sf managed-application'] = """
type: group
short-summary: Manage applications running on an Azure Service Fabric managed cluster. Only support ARM deployed applications.
"""

helps['sf managed-application create'] = """
type: command
short-summary: Create a new managed application on an Azure Service Fabric managed cluster.
examples:
- name: Create managed application "testApp" with parameters. The application type "TestAppType" version "v1" should already exist in the cluster, and the application parameters should be defined in the application manifest.
text: >
az sf managed-application create -g testRG -c testCluster --application-name testApp --application-type-name TestAppType \\
--application-type-version v1 --application-parameters key0=value0 --tags key1=value1
- name: Create application "testApp" and app type version using the package url provided.
text: >
az sf managed-application create -g testRG -c testCluster --application-name testApp --application-type-name TestAppType \\
--application-type-version v1 --package-url "https://sftestapp.blob.core.windows.net/sftestapp/testApp_1.0.sfpkg" \\
--application-parameters key0=value0
"""

helps['sf managed-application update'] = """
type: command
short-summary: Update a Azure Service Fabric managed application.
long-summary: This allows for updating the tags, the application parameters, value is the application UpgradePolicy and/or upgrade the application type version which will trigger an application upgrade.
examples:
- name: Update application parameters and upgreade policy values and app type version to v2.
text: >
az sf managed-application update -g testRG -c testCluster --application-name testApp --application-type-version v2 \\
--application-parameters key0=value0 --health-check-stable-duration 0 --health-check-wait-duration 0 --health-check-retry-timeout 0 \\
--upgrade-domain-timeout 5000 --upgrade-timeout 7000 --failure-action Rollback --upgrade-replica-set-check-timeout 300 --force-restart
- name: Update managed application service type health policy map.
text: >
az sf managed-application update -g testRG -c testCluster --application-name testApp --service-type-health-policy-map \"ServiceTypeName01\"=\"5,10,5\" \"ServiceTypeName02\"=\"5,5,5\"
"""

helps['sf managed-application show'] = """
type: command
short-summary: Show the properties of a managed application on an Azure Service Fabric managed cluster.
examples:
- name: Get managed application.
text: >
az sf managed-application show -g testRG -c testCluster --application-name testApp
"""

helps['sf managed-application list'] = """
type: command
short-summary: List managed applications of a given managed cluster.
examples:
- name: List managed applications for a given managed cluster.
text: >
az sf managed-application list -g testRG -c testCluster
"""

helps['sf managed-application delete'] = """
type: command
short-summary: Delete a managed application.
examples:
- name: Delete managed application.
text: >
az sf managed-application delete -g testRG -c testCluster --application-name testApp
"""

helps['sf managed-application-type'] = """
type: group
short-summary: Manage applications types and its versions running on an Azure Service Fabric managed cluster. Only support ARM deployed application types.
"""

helps['sf managed-application-type'] = """
type: group
short-summary: Manage application types on an Azure Service Fabric cluster.
"""

helps['sf managed-application-type create'] = """
type: command
short-summary: Create a new managed application type on an Azure Service Fabric managed cluster.
examples:
- name: Create new managed application type.
text: >
az sf managed-application-type create -g testRG -c testCluster --application-type-name testAppType
"""

helps['sf managed-application-type show'] = """
type: command
short-summary: Show the properties of a managed application type on an Azure Service Fabric managed cluster.
examples:
- name: Get managed application type.
text: >
az sf managed-application-type show -g testRG -c testCluster --application-type-name CalcServiceApp
"""

helps['sf managed-application-type list'] = """
type: command
short-summary: List managed application types of a given managed cluster.
examples:
- name: List managed application types for a given managed cluster.
text: >
az sf managed-application-type list -g testRG -c testCluster
"""

helps['sf managed-application-type update'] = """
type: command
short-summary: Update an managed application type.
long-summary: This allows for updating of application type tags.
examples:
- name: Update application type tags.
text: >
az sf managed-application-type update -g testRG -c testCluster --application-type-name CalcServiceApp --tags new=tags are=nice
"""

helps['sf managed-application-type delete'] = """
type: command
short-summary: Delete a managed application type.
examples:
- name: Delete managed application type.
text: >
az sf managed-application-type delete -g testRG -c testCluster --application-type-name CalcServiceApp
"""

helps['sf managed-application-type version'] = """
type: group
short-summary: Manage application type versions on an Azure Service Fabric managed cluster. Only support ARM deployed application type versions.
"""

helps['sf managed-application-type version create'] = """
type: command
short-summary: Create a new managed application type on an Azure Service Fabric managed cluster.
examples:
- name: Create new managed application type version using the provided package url. The version in the application manifest contained in the package should have the same version as the one specified in --version.
text: >
az sf managed-application-type version create -g testRG -c testCluster --application-type-name testAppType \\
--version 1.0 --package-url "https://sftestapp.blob.core.windows.net/sftestapp/testApp_1.0.sfpkg"
"""

helps['sf managed-application-type version show'] = """
type: command
short-summary: Show the properties of a managed application type version on an Azure Service Fabric managed cluster.
examples:
- name: Show the properties of a managed application type version on an Azure Service Fabric managed cluster.
text: >
az sf managed-application-type version show -g testRG -c testCluster --application-type-name CalcServiceApp --version 1.0
"""

helps['sf managed-application-type version list'] = """
type: command
short-summary: List versions of a given managed application type.
examples:
- name: List versions for a particular managed application type.
text: >
az sf managed-application-type version list -g testRG -c testCluster --application-type-name CalcServiceApp
"""

helps['sf managed-application-type version update'] = """
type: command
short-summary: Update a managed application type version.
long-summary: This allows for updating of application type version tags and the package url.
examples:
- name: Update managed application type version.
text: >
az sf managed-application-type version update -g testRG -c testCluster --application-type-name CalcServiceApp --version 1.0 --tags new=tags
"""

helps['sf managed-application-type version delete'] = """
type: command
short-summary: Delete a managed application type version.
examples:
- name: Delete managed application type version.
text: >
az sf managed-application-type version delete -g testRG -c testCluster --application-type-name CalcServiceApp --version 1.0
"""

helps['sf managed-service'] = """
type: group
short-summary: Manage services running on an Azure Service Fabric managed cluster. Only support ARM deployed services.
"""

helps['sf managed-service create'] = """
type: command
short-summary: Create a new managed service on an Azure Service Fabric managed cluster.
examples:
- name: Create a new stateless managed service "testService1" with instance count -1 (on all the nodes).
text: >
az sf managed-service create -g testRG -c testCluster --application-name testApp --state stateless --service-name testService \\
--service-type testStateless --instance-count -1 --partition-scheme singleton
- name: Create a new stateful service "testService2" with a target of 5 nodes.
text: >
az sf managed-service create -g testRG -c testCluster --application-name testApp --state stateful --service-name testService2 --has-persisted-state \\
--service-type testStatefulType --min-replica-set-size 3 --target-replica-set-size 5 --partition-scheme uniformint64range --partition-count 1 --low-key 0 --high-key 25
"""

helps['sf managed-service show'] = """
type: command
short-summary: Get a service.
examples:
- name: Show the properties of a managed service on an Azure Service Fabric managed cluster.
text: >
az sf managed-service show -g testRG -c testCluster --application-name testApp --service-name testService
"""

helps['sf managed-service list'] = """
type: command
short-summary: List managed services of a given managed application.
examples:
- name: List managed services.
text: >
az sf managed-service list -g testRG -c testCluster --application-name testApp
"""

helps['sf managed-service update'] = """
type: command
short-summary: Update a managed service.
examples:
- name: Update managed stateless service.
text: >
az sf managed-service update -g testRG -c testCluster --application-name testApp --service-name testService --min-instance-count 2 \\
--min-instance-percentage 20 --instance-close-delay-duration '00:11:00'
- name: Update managed stateful service.
text: >
az sf managed-service update -g testRG -c testCluster --application-name testApp --service-name testService2 --service-placement-time-limit '00:11:00' \\
--stand-by-replica-keep-duration '00:11:00' --replica-restart-wait-duration '00:11:00' --quorum-loss-wait-duration '00:11:00'
"""

helps['sf managed-service delete'] = """
type: command
short-summary: Delete a managed service.
examples:
- name: Delete managed service.
text: >
az sf managed-service delete -g testRG -c testCluster --application-name testApp --service-name testService
"""

helps['sf managed-service correlation-scheme'] = """
type: group
short-summary: Manage correlation schemes of services running on an Azure Service Fabric managed cluster. Only support ARM deployed services.
"""

helps['sf managed-service correlation-scheme create'] = """
type: command
short-summary: Create a new managed service correlation scheme on an Azure Service Fabric managed cluster.
long-summary: Create a new managed service correlation scheme on an Azure Service Fabric managed cluster. NOTE You can only have one service correlation per service.
examples:
- name: Create a new managed service correlation scheme.
text: >
az sf managed-service correlation-scheme create -g testRG -c testCluster --application-name testApp --service-name testService \\
--correlated-service-name "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/testRg/providers/Microsoft.ServiceFabric/managedclusters/testCluster/applications/testApp/services/testService2" \\
--scheme AlignedAffinity
"""

helps['sf managed-service correlation-scheme update'] = """
type: command
short-summary: Update a managed service correlation scheme.
examples:
- name: Update managed service correlation scheme.
text: >
az sf managed-service correlation-scheme update -g testRG -c testCluster --application-name testApp --service-name testService \\
--correlated-service-name "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/testRg/providers/Microsoft.ServiceFabric/managedclusters/testCluster/applications/testApp/services/testService2" \\
--scheme NonAlignedAffinity
"""

helps['sf managed-service correlation-scheme delete'] = """
type: command
short-summary: Delete a managed service correlation scheme.
examples:
- name: Delete managed service correlation scheme.
text: >
az sf managed-service correlation-scheme delete -g testRG -c testCluster --application-name testApp --service-name testService \\
--correlated-service-name "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/testRg/providers/Microsoft.ServiceFabric/managedclusters/testCluster/applications/testApp/services/testService2"
"""

helps['sf managed-service load-metrics'] = """
type: group
short-summary: Manage service load metrics running on an Azure Service Fabric managed cluster. Only support ARM deployed services.
"""

helps['sf managed-service load-metrics create'] = """
type: command
short-summary: Create a new managed service load metric on an Azure Service Fabric managed cluster.
examples:
- name: Create a new stateless managed service load metric.
text: >
az sf managed-service load-metrics create -g testRG -c testCluster --application-name testApp --service-name testService \\
--metric-name Metric1 --weight Low --default-load 3
- name: Create a new stateful service load metric.
text: >
az sf managed-service load-metrics create -g testRG -c testCluster --application-name testApp --service-name testService2 \\
--metric-name Metric2 --weight High --primary-default-load 3 --secondary-default-load 2
"""

helps['sf managed-service load-metrics update'] = """
type: command
short-summary: Update a managed service.
examples:
- name: Update a new stateless managed service load metric.
text: >
az sf managed-service load-metrics update -g testRG -c testCluster --application-name testApp --service-name testService \\
--metric-name Metric1 --weight Medium --default-load 5
- name: Update a new stateful service load metric.
text: >
az sf managed-service load-metrics update -g testRG -c testCluster --application-name testApp --service-name testService2 \\
--metric-name Metric2 --weight Low --primary-default-load 2 --secondary-default-load 1
"""

helps['sf managed-service load-metrics delete'] = """
type: command
short-summary: Delete a managed service.
examples:
- name: Delete managed service.
text: >
az sf managed-service load-metrics delete -g testRG -c testCluster --application-name testApp --service-name testService2 \\
--metric-name Metric1
"""
Loading