# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=too-many-lines

from knack.help_files import helps


helps['datamigration get-assessment'] = """
    type: command
    short-summary: Start assessment on SQL Server instance(s).
    examples:
      - name: Run SQL Assessment on given SQL Server using connection string.
        text: |-
               az datamigration get-assessment --connection-string "Data Source=LabServer.database.net;Initial Catalog=master;Integrated Security=False;User Id=User;Password=password" --output-folder "C:\\AssessmentOutput" --overwrite
      - name: Run SQL Assessment on given SQL Server using assessment config file.
        text: |-
               az datamigration get-assessment --config-file-path "C:\\Users\\user\\document\\config.json"
      - name: Run SQL Assessment on multiple SQL Servers in one call using connection string.
        text: |-
               az datamigration get-assessment --connection-string "Data Source=LabServer1.database.net;Initial Catalog=master;Integrated Security=False;User Id=User;Password=password" "Data Source=LabServer2.database.net;Initial Catalog=master;Integrated Security=False;User Id=User;Password=password" --output-folder "C:\\AssessmentOutput" --overwrite
"""

helps['datamigration performance-data-collection'] = """
    type: command
    short-summary: Collect performance data for given SQL Server instance(s).
    examples:
      - name: Collect performance data of a given SQL Server using connection string.
        text: |-
               az datamigration performance-data-collection --connection-string "Data Source=LabServer.database.net;Initial Catalog=master;Integrated Security=False;User Id=User;Password=password" --output-folder "C:\\PerfCollectionOutput" --number-of-iteration 5 --perf-query-interval 10 --static-query-interval 60
      - name: Collect performance data of multiple SQL Servers in one call using connection string.
        text: |-
               az datamigration performance-data-collection --connection-string "Data Source=LabServer1.database.net;Initial Catalog=master;Integrated Security=False;User Id=User;Password=password" "Data Source=LabServer2.database.net;Initial Catalog=master;Integrated Security=False;User Id=User;Password=password" --output-folder "C:\\PerfCollectionOutput" --number-of-iteration 5 --perf-query-interval 10 --static-query-interval 60
      - name: Collect performance data of a given SQL Server using assessment config file.
        text: |-
               az datamigration performance-data-collection --config-file-path "C:\\Users\\user\\document\\config.json"
      - name: Collect performance data of a given SQL Server by specifying a time limit. If the time limit specified is before the complition of a iteration cycle, the process will end without saving the last cycle performance data.
        text: |-
               az datamigration performance-data-collection --connection-string "Data Source=LabServer.database.net;Initial Catalog=master;Integrated Security=False;User Id=User;Password=password" --output-folder "C:\\PerfCollectionOutput" --number-of-iteration 5 --perf-query-interval 10 --static-query-interval 60 --time 60
"""

helps['datamigration get-sku-recommendation'] = """
    type: command
    short-summary: Give SKU recommendations for Azure SQL offerings.
    examples:
      - name: Get SKU recommendation for given SQL Server using command line.
        text: |-
               az datamigration get-sku-recommendation --output-folder "C:\\PerfCollectionOutput" --database-allow-list AdventureWorks1 AdventureWorks2 --display-result --overwrite
      - name: Get SKU recommendation for given SQL Server using assessment config file.
        text: |-
               az datamigration get-sku-recommendation --config-file-path "C:\\Users\\user\\document\\config.json"
"""

helps['datamigration login-migration'] = """
    type: command
    short-summary: Migrate logins from the source Sql Servers to the target Azure Sql Servers.
    examples:
      - name: Run Migrate logins from the source Sql Servers to the target Azure Sql Servers using Parameters.
        text: |-
               az datamigration login-migration --src-sql-connection-str  "data source=servername;user id=userid;password=;initial catalog=master;TrustServerCertificate=True" --tgt-sql-connection-str  "data source=servername;user id=userid;password=;initial catalog=master;TrustServerCertificate=True" --csv-file-path "C:\\CSVFile" --list-of-login "loginname1" "loginname2" --output-folder "C:\\OutputFolder" --aad-domain-name "AADDomainName"
      - name: Run Migrate logins from the source Sql Servers to the target Azure Sql Servers using config file.
        text: |-
               az datamigration login-migration --config-file-path "C:\\Users\\user\\document\\config.json"
"""

helps['datamigration tde-migration'] = """
    type: command
    short-summary: Migrate TDE certificate from source SQL Server to the target Azure SQL Server.
    examples:
      - name: Migrate TDE certificate from source SQL Server to the target Azure SQL Server.
        text: |-
               az datamigration tde-migration --source-sql-connection-string "data source=servername;user id=userid;password=;initial catalog=master;TrustServerCertificate=True" --target-subscription-id "00000000-0000-0000-0000-000000000000" --target-resource-group-name "ResourceGroupName" --target-managed-instance-name "TargetManagedInstanceName" --network-share-path "\\NetworkShare\Folder" --network-share-domain "NetworkShare" --network-share-user-name "NetworkShareUserName" --network-share-password "" --database-name "TdeDb_0" "TdeDb_1" "TdeDb_2"
"""

helps['datamigration sql-server-schema'] = """
    type: command
    short-summary: Migrate schema from the source Sql Servers to the target Azure Sql Servers.
    examples:
      - name: Run Migrate database objects from the source SQL Server to the target Azure SQL Database using Parameters.
        text: |-
               az datamigration sql-server-schema --action "MigrateSchema" --src-sql-connection-str "Server=;Initial Catalog=;User ID=;Password=" --tgt-sql-connection-str "Server=;Initial Catalog=;User ID=;Password="
      - name: Run Generate TSQL schema script from the source SQL Server using Parameters.
        text: |-
               az datamigration sql-server-schema --action "GenerateScript" --src-sql-connection-str "Server=;Initial Catalog=;User ID=;Password=" --tgt-sql-connection-str "Server=;Initial Catalog=;User ID=;Password="  --output-folder "C:\OutputFolder"
      - name: Run Deploy TSQL script to the target Azure SQL Database using Parameters.
        text: |-
               az datamigration sql-server-schema --action "GenerateScript" --src-sql-connection-str "Server=;Initial Catalog=;User ID=;Password=" --tgt-sql-connection-str "Server=;Initial Catalog=;User ID=;Password="  --input-script-file-path "C:\OutputFolder\script.sql"
      - name: Run Migrate database objects from the source SQL Server to the target Azure SQL Database using ConfigFile.
        text: |-
               az datamigration sql-server-schema --config-file-path "C:\configfile.json"
"""

helps['datamigration register-integration-runtime'] = """
    type: command
    short-summary: Register Database Migration Service on Integration Runtime
    examples:
      - name: Register Sql Migration Service on Self Hosted Integration Runtime.
        text: |-
               az datamigration register-integration-runtime --auth-key "IR@00000-0000000-000000-aaaaa-bbbb-cccc"
      - name: Install Integration Runtime and register a Sql Migration Service on it.
        text: |-
               az datamigration register-integration-runtime --auth-key "IR@00000-0000000-000000-aaaaa-bbbb-cccc" --ir-path "C:\\Users\\user\\Downloads\\IntegrationRuntime.msi"
      - name: Read the Integration Runtime from given installation location.
        text: |-
               az datamigration register-integration-runtime --auth-key "IR@00000-0000000-000000-aaaaa-bbbb-cccc" --installed-ir-path "D:\\My Softwares\\Microsoft Integration Runtime\\5.0"
"""

helps['datamigration sql-managed-instance create'] = """
    type: command
    short-summary: "Create a new database migration to a given SQL Managed Instance."
    parameters:
      - name: --source-sql-connection
        short-summary: "Source SQL Server connection details."
        long-summary: |
            Usage: --source-sql-connection data-source=XX authentication=XX user-name=XX password=XX \
encrypt-connection=XX trust-server-certificate=XX

            data-source: Data source.
            authentication: Authentication type.
            user-name: User name to connect to source SQL.
            password: Password to connect to source SQL.
            encrypt-connection: Whether to encrypt connection or not.
            trust-server-certificate: Whether to trust server certificate or not.
      - name: --offline-configuration
        short-summary: "Offline configuration."
        long-summary: |
            Usage: --offline-configuration offline=XX last-backup-name=XX

            offline: Offline migration
            last-backup-name: Last backup name for offline migration. This is optional for migrations from file share. \
If it is not provided, then the service will determine the last backup file name based on latest backup files present \
in file share.
      - name: --target-location
        short-summary: "Target location for copying backups."
        long-summary: |
            Usage: --target-location storage-account-resource-id=XX account-key=XX

            storage-account-resource-id: Resource Id of the storage account copying backups.
            account-key: Storage Account Key.
    examples:
      - name: Create or Update Database Migration resource with fileshare as source for backup files.
        text: |-
               az datamigration sql-managed-instance create --managed-instance-name "managedInstance1" \
--source-location '{\\"fileShare\\":{\\"path\\":\\"\\\\\\\\SharedBackup\\\\user\\",\\"password\\":\\"placeholder\\",\
\\"username\\":\\"Server\\\\name\\"}}' --target-location account-key="abcd" storage-account-resource-id="account.database.win\
dows.net" --migration-service "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Micr\
osoft.DataMigration/sqlMigrationServices/testagent" --offline-configuration last-backup-name="last_backup_file_name" \
offline=true --scope "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql\
/managedInstances/instance" --source-database-name "aaa" --source-sql-connection authentication="WindowsAuthentication"\
 data-source="aaa" encrypt-connection=true password="placeholder" trust-server-certificate=true user-name="bbb" \
--resource-group "testrg" --target-db-name "db1"
      - name: Create or Update Database Migration resource with Azure Blob storage as source for backup files.
        text: |-
               az datamigration sql-managed-instance create --managed-instance-name "managedInstance1" \
--source-location '{\\"AzureBlob\\":{\\"storageAccountResourceId\\":\\"/subscriptions/1111-2222-3333-4444/resourceGroups/RG/prooviders\
/Microsoft.Storage/storageAccounts/MyStorage\\",\\"accountKey\\":\\"======AccountKey====\\",\\"blobContainerName\\":\\"ContainerName\
-X\\"}}' --migration-service "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Micr\
osoft.DataMigration/sqlMigrationServices/testagent" --offline-configuration last-backup-name="last_backup_file_name" \
offline=true --scope "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.Sql\
/managedInstances/instance" --source-database-name "aaa" --source-sql-connection authentication="WindowsAuthentication"\
 data-source="aaa" encrypt-connection=true password="placeholder" trust-server-certificate=true user-name="bbb" \
--resource-group "testrg" --target-db-name "db1"
"""

helps['datamigration sql-vm create'] = """
    type: command
    short-summary: "Create a new database migration to a given SQL VM."
    parameters:
      - name: --source-sql-connection
        short-summary: "Source SQL Server connection details."
        long-summary: |
            Usage: --source-sql-connection data-source=XX authentication=XX user-name=XX password=XX \
encrypt-connection=XX trust-server-certificate=XX

            data-source: Data source.
            authentication: Authentication type.
            user-name: User name to connect to source SQL.
            password: Password to connect to source SQL.
            encrypt-connection: Whether to encrypt connection or not.
            trust-server-certificate: Whether to trust server certificate or not.
      - name: --offline-configuration
        short-summary: "Offline configuration."
        long-summary: |
            Usage: --offline-configuration offline=XX last-backup-name=XX

            offline: Offline migration
            last-backup-name: Last backup name for offline migration. This is optional for migrations from file share. \
If it is not provided, then the service will determine the last backup file name based on latest backup files present \
in file share.
      - name: --target-location
        short-summary: "Target location for copying backups."
        long-summary: |
            Usage: --target-location storage-account-resource-id=XX account-key=XX

            storage-account-resource-id: Resource Id of the storage account copying backups.
            account-key: Storage Account Key.
    examples:
      - name: Create or Update Database Migration resource with fileshare as source for backup files.
        text: |-
               az datamigration sql-vm create --source-location '{\\"fileShare\\":{\\"path\\":\\"\\\\\\\\SharedBackup\
\\\\user\\",\\"password\\":\\"placeholder\\",\\"username\\":\\"Server\\\\name\\"}}' --target-location account-key="abcd" \
storage-account-resource-id="account.database.windows.net" --migration-service "/subscriptions/00000000-1111-2222-3333-\
444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent" \
--offline-configuration last-backup-name="last_backup_file_name" offline=true --scope "/subscriptions/00000000-1111-222\
2-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm" \
--source-database-name "aaa" --source-sql-connection authentication="WindowsAuthentication" data-source="aaa" \
encrypt-connection=true password="placeholder" trust-server-certificate=true user-name="bbb" --resource-group "testrg" \
--sql-vm-name "testvm" --target-db-name "db1"
      - name: Create or Update Database Migration resource with Azure Blob storage as source for backup files.
        text: |-
               az datamigration sql-vm create --source-location '{\\"AzureBlob\\":{\\"storageAccountResourceId\\"\
:\\"/subscriptions/1111-2222-3333-4444/resourceGroups/RG/prooviders/Microsoft.Storage/storageAccounts/MyStorage\\",\
\\"accountKey\\":\\"======AccountKey====\\",\\"blobContainerName\\":\\"ContainerName-X\\"}}' --migration-service "/subscriptions\
/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.DataMigration/sqlMigrationServices/testagent" \
--offline-configuration last-backup-name="last_backup_file_name" offline=true --scope "/subscriptions/00000000-1111-222\
2-3333-444444444444/resourceGroups/testrg/providers/Microsoft.SqlVirtualMachine/sqlVirtualMachines/testvm" \
--source-database-name "aaa" --source-sql-connection authentication="WindowsAuthentication" data-source="aaa" \
encrypt-connection=true password="placeholder" trust-server-certificate=true user-name="bbb" --resource-group "testrg" \
--sql-vm-name "testvm" --target-db-name "db1"
"""

helps['datamigration sql-service create'] = """
    type: command
    short-summary: "Create Database Migration Service."
    examples:
      - name: Create or Update SQL Migration Service.
        text: |-
               az datamigration sql-service create --location "northeurope" --resource-group "testrg" --name \
"testagent"
"""
