# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azure.cli.core.help_files import helps

# pylint: disable=line-too-long, too-many-lines

helps['storage entity insert'] = """
    type: command
    short-summary: Insert an entity into a table.
    parameters:
        - name: --table-name -t
          type: string
          short-summary: The name of the table to insert the entity into.
        - name: --entity -e
          type: list
          short-summary: A space-separated list of key=value pairs. Must contain a PartitionKey and a RowKey.
          long-summary: The PartitionKey and RowKey must be unique within the table, and may be up to 64Kb in size. If using an integer value as a key,
                        convert it to a fixed-width string which can be canonically sorted.
                        For example, convert the integer value 1 to the string value "0000001" to ensure proper sorting.
        - name: --if-exists
          type: string
          short-summary: Behavior when an entity already exists for the specified PartitionKey and RowKey.
        - name: --timeout
          short-summary: The server timeout, expressed in seconds.
"""

helps['storage blob upload'] = """
    type: command
    short-summary: Upload a file to a storage blob.
    long-summary: Creates a new blob from a file path, or updates the content of an existing blob with automatic chunking and progress notifications.
    examples:
        - name: Upload to a blob.
          text: az storage blob upload -f /path/to/file -c MyContainer -n MyBlob
"""

helps['storage file upload'] = """
    type: command
    short-summary: Upload a file to a share that uses the SMB 3.0 protocol.
    long-summary: Creates or updates an Azure file from a source path with automatic chunking and progress notifications.
    examples:
        - name: Upload to a local file to a share.
          text: az storage file upload -s MyShare -source /path/to/file
"""

helps['storage blob show'] = """
    type: command
    short-summary: Get the details of a blob.
    examples:
        - name: Show all properties of a blob.
          text: az storage blob show -c MyContainer -n MyBlob
"""

helps['storage blob delete'] = """
    type: command
    short-summary: Mark a blob or snapshot for deletion.
    long-summary: >
        The blob is marked for later deletion during garbage collection.  In order to delete a blob, all of its snapshots must also be deleted.
        Both can be removed at the same time.
    examples:
        - name: Delete a blob.
          text: az storage blob delete -c MyContainer -n MyBlob
"""

helps['storage account create'] = """
    type: command
    short-summary: Create a storage account.
    examples:
        - name: Create a storage account 'MyStorageAccount' in resource group 'MyResourceGroup' in the West US region with locally redundant storage.
          text: az storage account create -n MyStorageAccount -g MyResourceGroup -l westus --sku Standard_LRS
          min_profile: latest
        - name: Create a storage account 'MyStorageAccount' in resource group 'MyResourceGroup' in the West US region with locally redundant storage.
          text: az storage account create -n MyStorageAccount -g MyResourceGroup -l westus --account-type Standard_LRS
          max_profile: 2017-03-09-profile
"""

helps['storage container create'] = """
    type: command
    short-summary: Create a container in a storage account.
    examples:
        - name: Create a storage container in a storage account.
          text: az storage container create -n MyStorageContainer
        - name: Create a storage container in a storage account and return an error if the container already exists.
          text: az storage container create -n MyStorageContainer --fail-on-exist
"""

helps['storage account list'] = """
    type: command
    short-summary: List storage accounts.
    examples:
        - name: List all storage accounts in a subscription.
          text: az storage account list
        - name: List all storage accounts in a resource group.
          text: az storage account list -g MyResourceGroup
"""

helps['storage account show'] = """
    type: command
    short-summary: Show storage account properties.
    examples:
        - name: Show properties for a storage account by resource ID.
          text: az storage account show --ids /subscriptions/{SubID}/resourceGroups/{MyResourceGroup}/providers/Microsoft.Storage/storageAccounts/{MyStorageAccount}
        - name: Show properties for a storage account using an account name and resource group.
          text: az storage account show -g MyResourceGroup -n MyStorageAccount
"""

helps['storage blob list'] = """
    type: command
    short-summary: List storage blobs in a container.
    examples:
        - name: List all storage blobs in a container.
          text: az storage blob list -c MyContainer
"""

helps['storage account delete'] = """
    type: command
    short-summary: Delete a storage account.
    examples:
        - name: Delete a storage account using a resource ID.
          text: az storage account delete --ids /subscriptions/{SubID}/resourceGroups/{MyResourceGroup}/providers/Microsoft.Storage/storageAccounts/{MyStorageAccount}
        - name: Delete a storage account using an account name and resource group.
          text: az storage account delete -n MyStorageAccount -g MyResourceGroup
"""


helps['storage account show-connection-string'] = """
    type: command
    short-summary: Get the connection string for a storage account.
    examples:
        - name: Get a connection string for a storage account.
          text: az storage account show-connection-string -g MyResourceGroup -n MyStorageAccount
"""

helps['storage'] = """
    type: group
    short-summary: Manage Azure Cloud Storage resources.
"""

helps['storage account'] = """
    type: group
    short-summary: Manage storage accounts.
"""

helps['storage account update'] = """
    type: command
    short-summary: Update the properties of a storage account.
"""

helps['storage account keys'] = """
    type: group
    short-summary: Manage storage account keys.
"""

helps['storage account keys list'] = """
    type: command
    short-summary: List the primary and secondary keys for a storage account.
    examples:
        - name: List the primary and secondary keys for a storage account.
          text: az storage account keys list -g MyResourceGroup -n MyStorageAccount
"""

helps['storage blob'] = """
    type: group
    short-summary: Manage object storage for unstructured data (blobs).
"""

helps['storage blob exists'] = """
    type: command
    short-summary: Check for the existence of a blob in a container.
"""

helps['storage blob list'] = """
    type: command
    short-summary: List blobs in a given container.
"""

helps['storage blob copy'] = """
    type: group
    short-summary: Manage blob copy operations.
"""

helps['storage blob incremental-copy'] = """
    type: group
    short-summary: Manage blob incremental copy operations.
"""

helps['storage blob lease'] = """
    type: group
    short-summary: Manage storage blob leases.
"""

helps['storage blob metadata'] = """
    type: group
    short-summary: Manage blob metadata.
"""

helps['storage blob service-properties'] = """
    type: group
    short-summary: Manage storage blob service properties.
"""
helps['storage blob set-tier'] = """
    type: command
    short-summary: Set the block or page tiers on the blob.
    long-summary:  >
        For block blob this command only supports block blob on standard storage accounts.
        For page blob, this command only supports for page blobs on premium accounts.
"""
helps['storage blob copy start-batch'] = """
    type: command
    short-summary: Copy multiple blobs or files to a blob container.
    parameters:
        - name: --destination-container
          type: string
          short-summary: The blob container where the selected source files or blobs will be copied to.
        - name: --pattern
          type: string
          short-summary: The pattern used for globbing files or blobs in the source. The supported patterns are '*', '?', '[seq', and '[!seq]'.
        - name: --dryrun
          type: bool
          short-summary: List the files or blobs to be uploaded. No actual data transfer will occur.
        - name: --source-account-name
          type: string
          short-summary: The source storage account from which the files or blobs are copied to the destination. If omitted, the source account is used.
        - name: --source-account-key
          type: string
          short-summary: The account key for the source storage account.
        - name: --source-container
          type: string
          short-summary: The source container from which blobs are copied.
        - name: --source-share
          type: string
          short-summary: The source share from which files are copied.
        - name: --source-uri
          type: string
          short-summary: A URI specifying a file share or blob container from which the files or blobs are copied.
          long-summary: If the source is in another account, the source must either be public or be authenticated by using a shared access signature.
        - name: --source-sas
          type: string
          short-summary: The shared access signature for the source storage account.
"""
helps['storage container'] = """
    type: group
    short-summary: Manage blob storage containers.
"""

helps['storage container exists'] = """
    type: command
    short-summary: Check for the existence of a storage container.
"""

helps['storage container list'] = """
    type: command
    short-summary: List containers in a storage account.
"""

helps['storage container lease'] = """
    type: group
    short-summary: Manage blob storage container leases.
"""

helps['storage container metadata'] = """
    type: group
    short-summary: Manage container metadata.
"""

helps['storage container policy'] = """
    type: group
    short-summary: Manage container stored access policies.
"""

helps['storage cors'] = """
    type: group
    short-summary: Manage storage service Cross-Origin Resource Sharing (CORS).
"""

helps['storage cors add'] = """
    type: command
    short-summary: Add a CORS rule to a storage account.
    parameters:
        - name: --services
          short-summary: >
            The storage service(s) to add rules to. Allowed options are: (b)lob, (f)ile,
            (q)ueue, (t)able. Can be combined.
        - name: --max-age
          short-summary: The maximum number of seconds the client/browser should cache a preflight response.
        - name: --origins
          short-summary: List of origin domains that will be allowed via CORS, or "*" to allow all domains.
        - name: --methods
          short-summary: List of HTTP methods allowed to be executed by the origin.
        - name: --allowed-headers
          short-summary: List of response headers allowed to be part of the cross-origin request.
        - name: --exposed-headers
          short-summary: List of response headers to expose to CORS clients.
"""

helps['storage cors clear'] = """
    type: command
    short-summary: Remove all CORS rules from a storage account.
    parameters:
        - name: --services
          short-summary: >
            The storage service(s) to remove rules from. Allowed options are: (b)lob, (f)ile,
            (q)ueue, (t)able. Can be combined.
"""

helps['storage cors list'] = """
    type: command
    short-summary: List all CORS rules for a storage account.
    parameters:
        - name: --services
          short-summary: >
            The storage service(s) to list rules for. Allowed options are: (b)lob, (f)ile,
            (q)ueue, (t)able. Can be combined.
"""

helps['storage directory'] = """
    type: group
    short-summary: Manage file storage directories.
"""

helps['storage directory exists'] = """
    type: command
    short-summary: Check for the existence of a storage directory.
"""

helps['storage directory metadata'] = """
    type: group
    short-summary: Manage file storage directory metadata.
"""

helps['storage directory list'] = """
    type: command
    short-summary: List directories in a share.
"""

helps['storage entity'] = """
    type: group
    short-summary: Manage table storage entities.
"""

helps['storage entity query'] = """
    type: command
    short-summary: List entities which satisfy a query.
"""

helps['storage file'] = """
    type: group
    short-summary: Manage file shares that use the SMB 3.0 protocol.
"""

helps['storage file exists'] = """
    type: command
    short-summary: Check for the existence of a file.
"""

helps['storage file list'] = """
    type: command
    short-summary: List files and directories in a share.
    parameters:
        - name: --exclude-dir
          type: bool
          short-summary: List only files in the given share.
"""

helps['storage file copy'] = """
    type: group
    short-summary: Manage file copy operations.
"""

helps['storage file metadata'] = """
    type: group
    short-summary: Manage file metadata.
"""

helps['storage file upload-batch'] = """
    type: command
    short-summary: Upload files from a local directory to an Azure Storage File Share in a batch operation.
    parameters:
        - name: --source -s
          type: string
          short-summary: The directory to upload files from.
        - name: --destination -d
          type: string
          short-summary: The destination of the upload operation.
          long-summary: The destination can be the file share URL or the share name. When the destination is the share URL, the storage account name is parsed from the URL.
        - name: --pattern
          type: string
          short-summary: The pattern used for file globbing. The supported patterns are '*', '?', '[seq', and '[!seq]'.
        - name: --dryrun
          type: bool
          short-summary: List the files and blobs to be uploaded. No actual data transfer will occur.
        - name: --max-connections
          type: integer
          short-summary: The maximum number of parallel connections to use. Default value is 1.
        - name: --validate-content
          type: bool
          short-summary: If set, calculates an MD5 hash for each range of the file for validation.
          long-summary: >
            The storage service checks the hash of the content that has arrived is identical to the hash that was sent.
            This is mostly valuable for detecting bitflips during transfer if using HTTP instead of HTTPS. This hash is not stored.
"""

helps['storage file download-batch'] = """
    type: command
    short-summary: Download files from an Azure Storage File Share to a local directory in a batch operation.
    parameters:
        - name: --source -s
          type: string
          short-summary: The source of the file download operation. The source can be the file share URL or the share name.
        - name: --destination -d
          type: string
          short-summary: The local directory where the files are downloaded to. This directory must already exist.
        - name: --pattern
          type: string
          short-summary: The pattern used for file globbing. The supported patterns are '*', '?', '[seq', and '[!seq]'.
        - name: --dryrun
          type: bool
          short-summary: List the files and blobs to be downloaded. No actual data transfer will occur.
        - name: --max-connections
          type: integer
          short-summary: The maximum number of parallel connections to use. Default value is 1.
        - name: --validate-content
          type: bool
          short-summary: If set, calculates an MD5 hash for each range of the file for validation.
          long-summary: >
            The storage service checks the hash of the content that has arrived is identical to the hash that was sent.
            This is mostly valuable for detecting bitflips during transfer if using HTTP instead of HTTPS. This hash is not stored.
"""

helps['storage file copy start-batch'] = """
    type: command
    short-summary: Copy multiple files or blobs to a file share.
    parameters:
        - name: --destination-share
          type: string
          short-summary: The file share where the source data is copied to.
        - name: --destination-path
          type: string
          short-summary: The directory where the source data is copied to. If omitted, data is copied to the root directory.
        - name: --pattern
          type: string
          short-summary: The pattern used for globbing files and blobs. The supported patterns are '*', '?', '[seq', and '[!seq]'.
        - name: --dryrun
          type: bool
          short-summary: List the files and blobs to be copied. No actual data transfer will occur.
        - name: --source-account-name
          type: string
          short-summary: The source storage account to copy the data from. If omitted, the destination account is used.
        - name: --source-account-key
          type: string
          short-summary: The account key for the source storage account. If omitted, the active login is used to determine the account key.
        - name: --source-container
          type: string
          short-summary: The source container blobs are copied from.
        - name: --source-share
          type: string
          short-summary: The source share files are copied from.
        - name: --source-uri
          type: string
          short-summary: A URI that specifies a the source file share or blob container.
          long-summary: If the source is in another account, the source must either be public or authenticated via a shared access signature.
        - name: --source-sas
          type: string
          short-summary: The shared access signature for the source storage account.
"""

helps['storage logging'] = """
    type: group
    short-summary: Manage storage service logging information.
"""

helps['storage logging show'] = """
    type: command
    short-summary: Show logging settings for a storage account.
"""

helps['storage logging update'] = """
    type: command
    short-summary: Update logging settings for a storage account.
"""

helps['storage message'] = """
    type: group
    short-summary: Manage queue storage messages.
"""

helps['storage metrics'] = """
    type: group
    short-summary: Manage storage service metrics.
"""

helps['storage metrics show'] = """
    type: command
    short-summary: Show metrics settings for a storage account.
"""

helps['storage metrics update'] = """
    type: command
    short-summary: Update metrics settings for a storage account.
"""

helps['storage queue'] = """
    type: group
    short-summary: Manage storage queues.
"""

helps['storage queue list'] = """
    type: command
    short-summary: List queues in a storage account.
"""

helps['storage queue metadata'] = """
    type: group
    short-summary: Manage the metadata for a storage queue.
"""

helps['storage queue policy'] = """
    type: group
    short-summary: Manage shared access policies for a storage queue.
"""

helps['storage share'] = """
    type: group
    short-summary: Manage file shares.
"""

helps['storage share exists'] = """
    type: command
    short-summary: Check for the existence of a file share.
"""

helps['storage share list'] = """
    type: command
    short-summary: List the file shares in a storage account.
"""

helps['storage share metadata'] = """
    type: group
    short-summary: Manage the metadata of a file share.
"""

helps['storage share policy'] = """
    type: group
    short-summary: Manage shared access policies of a storage file share.
"""

helps['storage table'] = """
    type: group
    short-summary: Manage NoSQL key-value storage.
"""

helps['storage table list'] = """
    type: command
    short-summary: List tables in a storage account.
"""

helps['storage table policy'] = """
    type: group
    short-summary: Manage shared access policies of a storage table.
"""

helps['storage account network-rule'] = """
    type: group
    short-summary: Manage network rules.
"""

helps['storage account network-rule add'] = """
    type: command
    short-summary: Add a network rule.
    long-summary: >
        Rules can be created for an IPv4 address, address range (CIDR format), or a virtual network subnet.
    examples:
        - name: Create a rule to allow a specific address-range.
          text: az storage account network-rule add -g myRg --account-name mystorageaccount --ip-address 23.45.1.0/24
        - name: Create a rule to allow access for a subnet.
          text: az storage account network-rule add -g myRg --account-name mystorageaccount --vnet myvnet --subnet mysubnet
"""

helps['storage account network-rule list'] = """
    type: command
    short-summary: List network rules.
"""

helps['storage account network-rule remove'] = """
    type: command
    short-summary: Remove a network rule.
"""
